Fixiaobai
2023-09-05 c9da1b0da1178911e383ddcaebecd1e088fa6004
laboratory-server/src/main/java/com/yuanchu/limslaboratory/controller/InstrumentController.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.annotation.AuthHandler;
import com.yuanchu.limslaboratory.pojo.Instrument;
import com.yuanchu.limslaboratory.pojo.dto.UpdateInstrumentDto;
import com.yuanchu.limslaboratory.service.InstrumentService;
@@ -42,6 +43,7 @@
    @ApiOperation("添加仪器设备")
    @PostMapping("/add")
    @AuthHandler
    public Result<?> addInstrumentInformation(@RequestHeader("X-Token") String token, @RequestBody Instrument instrument) throws Exception {
        Object object = RedisUtil.get(token);
        Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
@@ -63,6 +65,7 @@
            @ApiImplicitParam(name = "whetherWhether", value = "是否已过期", dataTypeClass = Boolean.class),
            @ApiImplicitParam(name = "numberOrNameOrSpecifications", value = "编号/设备名称/规格型号", dataTypeClass = String.class)
    })
    @AuthHandler
    public Result<?> getListInstrumentInformation(Integer pageNo,
                                                  Integer pageSize,
                                                  Integer conditions,
@@ -82,6 +85,7 @@
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "instrumentId", value = "仪器Id", dataTypeClass = String.class, required = true)
    })
    @AuthHandler
    public Result<?> deleteInstrumentInformation(String instrumentId) {
        Boolean isDeleteSuccess = instrumentService.deleteInstrumentInformation(instrumentId);
        if (isDeleteSuccess){
@@ -92,6 +96,7 @@
    @ApiOperation("添加仪器时保管人下拉框数据")
    @GetMapping("/get_user")
    @AuthHandler
    public Result<?> getMapUserInformation() {
        return Result.success(userService.getUserNameAndId());
    }
@@ -101,13 +106,14 @@
            @ApiImplicitParam(name = "InstrumentId", value = "分类Id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/get_instrument")
    @AuthHandler
    public Result<?> getIdInstrumentInformation(Integer InstrumentId) {
        Instrument idInstrumentInformation = instrumentService.getIdInstrumentInformation(InstrumentId);
        return Result.success(idInstrumentInformation);
        return Result.success(instrumentService.getIdInstrumentInformation(InstrumentId));
    }
    @ApiOperation("根据仪器Id更新数据")
    @PutMapping("/update")
    @AuthHandler
    public Result<?> updateEquipmentPointInformation(@RequestBody UpdateInstrumentDto updateInstrumentDto) throws Exception {
        Instrument instrument = JackSonUtil.unmarshal(JackSonUtil.marshal(updateInstrumentDto), Instrument.class);
        Integer isUpdateSuccess = instrumentService.updateEquipmentPointInformation(instrument);