diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java new file mode 100644 index 0000000..c606b62 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java @@ -0,0 +1,69 @@ +package com.hxhq.business.controller; + +import java.util.Arrays; +import java.util.List; + +import com.hxhq.common.security.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.hxhq.common.core.web.controller.BaseController; +import com.hxhq.common.core.web.domain.AjaxResult; +import com.hxhq.common.core.web.page.TableDataInfo; + + +/** + * 存储位置Controller + * + * @author hxhq + * @date 2026-03-02 + */ +@RestController +@RequestMapping("/business/storageLocation") +public class StorageLocationController extends BaseController +{ + @Autowired + private IStorageLocationService storageLocationService; + + /** + * 查询存储位置列表 + */ + @GetMapping("/list") + @RequiresPermissions("business:storageLocation:list") + public TableDataInfo list(StorageLocation storageLocation) + { + startPage(); + List list = storageLocationService.queryList(storageLocation); + return getDataTable(list); + } + + /** + * 获取存储位置详细信息 + */ + @GetMapping(value = "/info") + public AjaxResult getInfo(Long id) + { + return AjaxResult.success(storageLocationService.getById(id)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/save") + @RequiresPermissions("business:storageLocation:add") + public AjaxResult save(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } + + /** + * 新增存储位置信息 + */ + @PostMapping("/edit") + @RequiresPermissions("business:storageLocation:edit") + public AjaxResult edit(@RequestBody StorageLocation storageLocation) + { + return toAjax(storageLocationService.saveOrUpdate(storageLocation)); + } +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java new file mode 100644 index 0000000..b718d51 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java @@ -0,0 +1,108 @@ +package com.hxhq.business.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.hxhq.common.core.domain.MpBaseEntity; + + +/** + * 存储位置对象 t_storage_location + * + * @author hxhq + * @date 2026-03-02 + */ +@TableName("t_storage_location") +public class StorageLocation extends MpBaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 放置地点 */ + private String location; + + /** 设备名称或编号 */ + private String name; + + /** 放置货架 */ + private String shelfPlacement; + + /** 温层 */ + private String compartment; + + /** 部门id */ + private Long deptId; + + /** 状态 1-禁用 10-启用 */ + private Integer status; + + @TableField(exist = false) + private String deptName; + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public void setLocation(String location) + { + this.location = location; + } + + public String getLocation() + { + return location; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + public void setShelfPlacement(String shelfPlacement) + { + this.shelfPlacement = shelfPlacement; + } + + public String getShelfPlacement() + { + return shelfPlacement; + } + + public void setCompartment(String compartment) + { + this.compartment = compartment; + } + + public String getCompartment() + { + return compartment; + } + + public void setDeptId(Long deptId) + { + this.deptId = deptId; + } + + public Long getDeptId() + { + return deptId; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java new file mode 100644 index 0000000..1c2c553 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/mapper/StorageLocationMapper.java @@ -0,0 +1,25 @@ +package com.hxhq.business.mapper; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.hxhq.business.domain.Bacteria; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 存储位置Mapper接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface StorageLocationMapper extends BaseMapper +{ + /** + * 列表 + * @param queryWrapper + * @return + */ + List queryList(@Param("ew") Wrapper queryWrapper); +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java new file mode 100644 index 0000000..1d8e4b4 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java @@ -0,0 +1,23 @@ +package com.hxhq.business.service; + +import java.util.List; +import com.hxhq.business.domain.StorageLocation; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 存储位置Service接口 + * + * @author hxhq + * @date 2026-03-02 + */ +public interface IStorageLocationService extends IService +{ + /** + * 查询存储位置列表 + * + * @param storageLocation 存储位置 + * @return 存储位置集合 + */ + public List queryList(StorageLocation storageLocation); + +} diff --git a/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java new file mode 100644 index 0000000..182a2c2 --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java @@ -0,0 +1,49 @@ +package com.hxhq.business.service.impl; + +import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; + import com.hxhq.common.core.utils.DateUtils; +import com.hxhq.common.core.utils.StringUtils; +import org.springframework.stereotype.Service; +import com.hxhq.business.mapper.StorageLocationMapper; +import com.hxhq.business.domain.StorageLocation; +import com.hxhq.business.service.IStorageLocationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * 存储位置Service业务层处理 + * + * @author hxhq + * @date 2026-03-02 + */ +@Service +public class StorageLocationServiceImpl extends ServiceImpl implements IStorageLocationService +{ + /** + * 查询存储位置列表 + * + * @param form 存储位置 + * @return 存储位置 + */ + @Override + public List queryList(StorageLocation form) + { + QueryWrapper queryWrapper = Wrappers.query(); + queryWrapper.eq("s.del_flag", 0); + if(StringUtils.isNotEmpty(form.getName())) { + queryWrapper.like("s.name", form.getName()); + } + if(StringUtils.isNotEmpty(form.getLocation())) { + queryWrapper.like("s.location", form.getLocation()); + } + if(StringUtils.isNotEmpty(form.getShelfPlacement())) { + queryWrapper.like("s.shelf_placement", form.getShelfPlacement()); + } + if(form.getStatus() != null) { + queryWrapper.eq("s.status", form.getStatus()); + } + return baseMapper.queryList(queryWrapper); + } + +} diff --git a/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml new file mode 100644 index 0000000..a3871ec --- /dev/null +++ b/hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file