| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ImportRepertoryService; |
| | | |
| | |
| | | @Autowired |
| | | private ImportRepertoryService importRepertoryService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "新增成品入库") |
| | | @PostMapping("/addImpRep") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody ImportRepertoryDto importRepertoryDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | importRepertoryService.addImpRep(data.get("name").replaceAll("\"", ""), importRepertoryDto); |
| | | return Result.success("新增成功!"); |
| | | } |
| | | |
| | | @ApiOperation("查询所有入库列表") |
| | | @ApiImplicitParams(value = { |
| | |
| | | return Result.success(importRepertoryService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据入库id删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "入库id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delImpRep") |
| | | public Result delImpRep(Integer id) { |
| | | importRepertoryService.delImpRep(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllImpRep") |
| | | public Result delAllImpRep(@RequestParam("ids") List<Integer> ids) { |
| | | importRepertoryService.delAllImpRep(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |