| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.web_site.DeviceSpare; |
| | | import com.whyc.service.DeviceSpareService; |
| | | import com.whyc.util.JsonUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("deviceSpare") |
| | | @Api(tags = "设备仓库管理") |
| | | @Api(tags = {"设备器件备件","维修管理","维修调度"}) |
| | | public class DeviceSpareController { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @PostMapping("add") |
| | | @ApiOperation("添加") |
| | | public Response add(@RequestBody DeviceSpare spare) { |
| | | return service.add(spare); |
| | | public Response add(@RequestPart(value = "file",required = false) List<MultipartFile> file,@RequestParam String deviceSpareJsonStr) throws IOException { |
| | | DeviceSpare spare = JsonUtil.getGson().fromJson(deviceSpareJsonStr, DeviceSpare.class); |
| | | return service.add(spare,file); |
| | | } |
| | | |
| | | @PostMapping("addByExcel") |
| | | @ApiOperation("excel导入") |
| | | public Response addByExcel(@RequestParam MultipartFile file) throws IOException { |
| | | return service.addByExcel(file); |
| | | } |
| | | |
| | | |
| | | @PostMapping("update") |
| | | @ApiOperation("修改") |
| | |
| | | return service.delete(id); |
| | | } |
| | | |
| | | @GetMapping("getListByIds") |
| | | @ApiOperation("查询器件的库存信息,根据告警巡检所需的器件ids") |
| | | public Response<List<DeviceSpare>> getListByIds(@RequestParam String deviceSpareIds){ |
| | | return service.getListByIds(deviceSpareIds); |
| | | } |
| | | |
| | | } |