From 7dc13d1e0d73dc8d785c22f225c9a27c3673c670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B5=B7=E8=88=AA?= <1344638791@qq.com> Date: Mon, 6 Nov 2023 11:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E8=AF=95?= =?UTF-8?q?=E5=89=82=E8=80=97=E6=9D=90=E4=BD=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReferenceMaterialController.java | 25 ++++++++++++++ .../platform/reagent/entity/LocationInfo.java | 28 ++++++++++++++++ .../reagent/mapper/LocationInfoMapper.java | 17 ++++++++++ .../reagent/service/LocationInfoService.java | 16 +++++++++ .../service/impl/LocationServiceImpl.java | 33 +++++++++++++++++++ .../platform/reagent/vo/LocationInfoVO.java | 9 +++++ .../resources/mapper/LocationInfoMapper.xml | 32 ++++++++++++++++++ 7 files changed, 160 insertions(+) create mode 100644 src/main/java/digital/laboratory/platform/reagent/controller/ReferenceMaterialController.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/entity/LocationInfo.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/mapper/LocationInfoMapper.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/service/LocationInfoService.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/service/impl/LocationServiceImpl.java create mode 100644 src/main/java/digital/laboratory/platform/reagent/vo/LocationInfoVO.java create mode 100644 src/main/resources/mapper/LocationInfoMapper.xml diff --git a/src/main/java/digital/laboratory/platform/reagent/controller/ReferenceMaterialController.java b/src/main/java/digital/laboratory/platform/reagent/controller/ReferenceMaterialController.java new file mode 100644 index 0000000..eb40d77 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/controller/ReferenceMaterialController.java @@ -0,0 +1,25 @@ +package digital.laboratory.platform.reagent.controller; + +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.reagent.entity.ReferenceMaterial; +import digital.laboratory.platform.reagent.service.ReferenceMaterialService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("/reference/material") +public class ReferenceMaterialController { + + @Autowired + private ReferenceMaterialService referenceMaterialService; + + @PutMapping("/code") + public R addCode(@RequestBody ReferenceMaterial referenceMaterial) { + + ReferenceMaterial material = referenceMaterialService.getById(referenceMaterial.getId()); + material.setCode(referenceMaterial.getCode()); + if (referenceMaterialService.updateById(material)) { + return R.ok(referenceMaterial, "录入条码信息成功"); + } else return R.failed(referenceMaterial, "录入条码信息出错"); + } +} diff --git a/src/main/java/digital/laboratory/platform/reagent/entity/LocationInfo.java b/src/main/java/digital/laboratory/platform/reagent/entity/LocationInfo.java new file mode 100644 index 0000000..9d589b7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/entity/LocationInfo.java @@ -0,0 +1,28 @@ +package digital.laboratory.platform.reagent.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@TableName(value = "location_info", autoResultMap = true) +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "(位置信息修改日志)") +public class LocationInfo extends BaseEntity { + + @TableId(value = "id",type = IdType.ASSIGN_ID) + private String id; + @ApiModelProperty(value = "物品批次ID") + private String batchDetailsId; + + @ApiModelProperty("上一次存放位置") + private String oldLocation; + + @ApiModelProperty(value = "新的存放位置") + private String newLocation; +} diff --git a/src/main/java/digital/laboratory/platform/reagent/mapper/LocationInfoMapper.java b/src/main/java/digital/laboratory/platform/reagent/mapper/LocationInfoMapper.java new file mode 100644 index 0000000..124e17e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/mapper/LocationInfoMapper.java @@ -0,0 +1,17 @@ +package digital.laboratory.platform.reagent.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import digital.laboratory.platform.reagent.entity.LocationInfo; +import digital.laboratory.platform.reagent.vo.LocationInfoVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface LocationInfoMapper extends BaseMapper { + + public List getListById(@Param("batchDetailsId") String batchDetailsId); +} diff --git a/src/main/java/digital/laboratory/platform/reagent/service/LocationInfoService.java b/src/main/java/digital/laboratory/platform/reagent/service/LocationInfoService.java new file mode 100644 index 0000000..ec0216d --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/service/LocationInfoService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.reagent.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.reagent.entity.LocationInfo; +import digital.laboratory.platform.reagent.mapper.LocationInfoMapper; +import digital.laboratory.platform.reagent.vo.LocationInfoVO; + +import java.util.List; + +public interface LocationInfoService extends IService { + List getListById(String batchDetailsId); + + boolean addInfo(String batchDetailsId, String oldLocation, String newLocation); +} diff --git a/src/main/java/digital/laboratory/platform/reagent/service/impl/LocationServiceImpl.java b/src/main/java/digital/laboratory/platform/reagent/service/impl/LocationServiceImpl.java new file mode 100644 index 0000000..f1aaaf4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/service/impl/LocationServiceImpl.java @@ -0,0 +1,33 @@ +package digital.laboratory.platform.reagent.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.reagent.entity.LocationInfo; +import digital.laboratory.platform.reagent.mapper.LocationInfoMapper; +import digital.laboratory.platform.reagent.service.LocationInfoService; +import digital.laboratory.platform.reagent.vo.LocationInfoVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class LocationServiceImpl extends ServiceImpl implements LocationInfoService { + + @Override + public List getListById(String batchDetailsId) { + return baseMapper.getListById(batchDetailsId); + } + + @Override + public boolean addInfo(String batchDetailsId, String oldLocation, String newLocation) { + LocationInfo locationInfo = new LocationInfo(); + locationInfo.setNewLocation(newLocation); + locationInfo.setOldLocation(oldLocation); + locationInfo.setBatchDetailsId(batchDetailsId); + locationInfo.setId(IdWorker.get32UUID().toUpperCase()); + return this.save(locationInfo); + } + + +} diff --git a/src/main/java/digital/laboratory/platform/reagent/vo/LocationInfoVO.java b/src/main/java/digital/laboratory/platform/reagent/vo/LocationInfoVO.java new file mode 100644 index 0000000..436c10b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/reagent/vo/LocationInfoVO.java @@ -0,0 +1,9 @@ +package digital.laboratory.platform.reagent.vo; + +import digital.laboratory.platform.reagent.entity.LocationInfo; +import lombok.Data; + +@Data +public class LocationInfoVO extends LocationInfo { + private String userName; +} diff --git a/src/main/resources/mapper/LocationInfoMapper.xml b/src/main/resources/mapper/LocationInfoMapper.xml new file mode 100644 index 0000000..2aae78d --- /dev/null +++ b/src/main/resources/mapper/LocationInfoMapper.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + +