Fixiaobai
2023-09-25 d5e3e8e67e817f0146df30d92ff8a16db674bea8
inventory-server/src/main/java/com/yuanchu/mom/controller/ImportRepertoryController.java
@@ -13,6 +13,7 @@
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;
@@ -36,16 +37,6 @@
    @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 = {
@@ -73,25 +64,6 @@
        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();
    }
}