| | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.dto.FrameInventoryDTO; |
| | | import com.jilongda.manage.model.TInventory; |
| | | import com.jilongda.manage.model.TInventoryFrameDetail; |
| | | import com.jilongda.manage.query.TFrameGoodsQuery; |
| | | import com.jilongda.manage.query.TInventoryQuery; |
| | | import com.jilongda.manage.service.TInventoryFrameDetailService; |
| | |
| | | import com.jilongda.manage.vo.TInventoryVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | } |
| | | return ApiResult.success(inventoryService.pageList(query)); |
| | | } |
| | | @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) { |
| | | TInventory tInventory = new TInventory(); |
| | | BeanUtils.copyProperties(query, tInventory); |
| | | inventoryService.save(tInventory); |
| | | for (TInventoryFrameDetail tInventoryFrameDetail : query.getList()) { |
| | | tInventoryFrameDetail.setInventoryId(tInventory.getId()); |
| | | } |
| | | inventoryFrameDetailService.saveBatch(query.getList()); |
| | | return ApiResult.success(); |
| | | } |
| | | } |
| | | |