| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.pojo.MetricalInformation; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdateMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.pojo.dto.UpdatedMetricalInformationDto; |
| | | import com.yuanchu.limslaboratory.service.MetricalInformationService; |
| | | import com.yuanchu.limslaboratory.service.UserService; |
| | | import com.yuanchu.limslaboratory.utils.JackSonUtil; |
| | |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | | * @since 2023-07-20 |
| | | */ |
| | | @Api(tags = "实验室-->设备台账-->4、计量信息") |
| | | @Api(tags = "实验室-->1、设备台账-->4、计量信息") |
| | | @RestController |
| | | @RequestMapping("/metrical-information") |
| | | public class MetricalInformationController { |
| | |
| | | |
| | | @ApiOperation("添加计量信息") |
| | | @PostMapping("/add") |
| | | @AuthHandler |
| | | public Result<?> addMetricalInformation(MetricalInformation metricalInformation, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) { |
| | | Integer isInsertSuccess = metricalInformationService.addEquipmentPointInformation(metricalInformation, file); |
| | |
| | | @ApiImplicitParam(name = "InstrumentId", value = "仪器模块Id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/list") |
| | | @AuthHandler |
| | | public Result<?> getListMetricalInformation(String InstrumentId) { |
| | | List<Map<String, Object>> list = metricalInformationService.getListEquipmentPointInformation(InstrumentId); |
| | | return Result.success(list); |
| | |
| | | @ApiImplicitParam(name = "metricalInformationId", value = "计量信息Id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @DeleteMapping("/delete") |
| | | @AuthHandler |
| | | public Result<?> deleteMetricalInformation(Integer metricalInformationId) { |
| | | Integer isDeleteSuccess = metricalInformationService.deleteMetricalInformation(metricalInformationId); |
| | | if (isDeleteSuccess == 1){ |
| | |
| | | |
| | | @ApiOperation("根据计量信息Id更新数据") |
| | | @PutMapping("/update") |
| | | @AuthHandler |
| | | public Result<?> updateMetricalInformation(UpdateMetricalInformationDto updateMetricalInformationDto, |
| | | @RequestPart(value = "file", required = false) MultipartFile file) throws Exception { |
| | | MetricalInformation metricalInformation = JackSonUtil.unmarshal(JackSonUtil.marshal(updateMetricalInformationDto), MetricalInformation.class); |
| | |
| | | |
| | | @ApiOperation("添加计量信息时负责人下拉框数据") |
| | | @GetMapping("/get_user") |
| | | @AuthHandler |
| | | public Result<?> getMapUserInformation() { |
| | | return Result.success(userService.getUserNameAndId()); |
| | | } |
| | | |
| | | @ApiOperation("更新计量结果") |
| | | @PostMapping("/updateMetricalInformationInfo") |
| | | @AuthHandler |
| | | public Result<?> updateMetricalInformationInfo(@RequestBody UpdatedMetricalInformationDto dto){ |
| | | return Result.success(metricalInformationService.updateMetricalInformationInfo(dto)); |
| | | } |
| | | |
| | | } |