| | |
| | | import com.jilongda.manage.dto.FrameInventoryDTO; |
| | | import com.jilongda.manage.dto.GetCurrentByParam; |
| | | import com.jilongda.manage.dto.GetCurrentByParamLens; |
| | | import com.jilongda.manage.dto.LensInventoryDTO; |
| | | import com.jilongda.manage.model.*; |
| | | import com.jilongda.manage.query.TFrameGoodsQuery; |
| | | import com.jilongda.manage.query.TInventoryQuery; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | } |
| | | @ApiOperation(value = "镜架添加盘点") |
| | | @PostMapping(value = "/addFrameInventory") |
| | | public ApiResult<PageInfo<TInventoryVO>> addFrameInventory(@RequestBody TInventoryQuery query) { |
| | | if (StringUtils.hasLength(query.getStartTime())){ |
| | | query.setStartTime(query.getStartTime()+" 00:00:00"); |
| | | query.setEndTime(query.getEndTime()+" 23:59:59"); |
| | | } |
| | | return ApiResult.success(inventoryService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "镜片添加盘点") |
| | | @PostMapping(value = "/addLensInventory") |
| | | public ApiResult addLensInventory(@RequestBody FrameInventoryDTO query) { |
| | | public ApiResult addFrameInventory(@RequestBody FrameInventoryDTO query) { |
| | | TInventory tInventory = new TInventory(); |
| | | BeanUtils.copyProperties(query, tInventory); |
| | | inventoryService.save(tInventory); |
| | |
| | | tInventoryFrameDetail.setInventoryId(tInventory.getId()); |
| | | } |
| | | inventoryFrameDetailService.saveBatch(query.getList()); |
| | | return ApiResult.success(); |
| | | return ApiResult.success(tInventory.getId()); |
| | | } |
| | | @ApiOperation(value = "镜片添加盘点") |
| | | @PostMapping(value = "/addLensInventory") |
| | | public ApiResult addLensInventory(@RequestBody LensInventoryDTO query) { |
| | | TInventory tInventory = new TInventory(); |
| | | BeanUtils.copyProperties(query, tInventory); |
| | | inventoryService.save(tInventory); |
| | | for (TInventoryLensDetail tInventoryFrameDetail : query.getList()) { |
| | | tInventoryFrameDetail.setInventoryId(tInventory.getId()); |
| | | } |
| | | inventoryLensDetailService.saveBatch(query.getList()); |
| | | return ApiResult.success(tInventory.getId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "镜架-根据品牌id查询对应库存") |
| | |
| | | TInventoryInfoVO tInventoryInfoVO = new TInventoryInfoVO(); |
| | | |
| | | TInventory byId = inventoryService.getById(id); |
| | | BeanUtils.copyProperties(byId, tInventoryInfoVO); |
| | | switch (byId.getType()){ |
| | | case 1: |
| | | List<TInventoryFrameDetail> list = inventoryFrameDetailService.lambdaQuery().eq(TInventoryFrameDetail::getInventoryId, id).list(); |