From 0c73ad08203bbc827e3417f4da8ed714e989392e Mon Sep 17 00:00:00 2001 From: liuhanqing Date: Wed, 14 Jan 2026 15:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasCargoSpaceWeightRuleController.java | 104 ++++++++++++++ .../domain/BasCargoSpaceWeightRule.java | 128 ++++++++++++++++++ .../mapper/BasCargoSpaceWeightRuleMapper.java | 63 +++++++++ .../IBasCargoSpaceWeightRuleService.java | 63 +++++++++ .../BasCargoSpaceWeightRuleServiceImpl.java | 98 ++++++++++++++ .../bas/BasCargoSpaceWeightRuleMapper.xml | 89 ++++++++++++ 6 files changed, 545 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/controller/BasCargoSpaceWeightRuleController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/domain/BasCargoSpaceWeightRule.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/mapper/BasCargoSpaceWeightRuleMapper.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/IBasCargoSpaceWeightRuleService.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/impl/BasCargoSpaceWeightRuleServiceImpl.java create mode 100644 ruoyi-admin/src/main/resources/mapper/bas/BasCargoSpaceWeightRuleMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/controller/BasCargoSpaceWeightRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/controller/BasCargoSpaceWeightRuleController.java new file mode 100644 index 0000000..c7a2586 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/controller/BasCargoSpaceWeightRuleController.java @@ -0,0 +1,104 @@ +package com.ruoyi.bas.weightRule.controller; + +import java.util.List; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.bas.weightRule.domain.BasCargoSpaceWeightRule; +import com.ruoyi.bas.weightRule.service.IBasCargoSpaceWeightRuleService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 重量规则Controller + * + * @author ruoyi + * @date 2026-01-11 + */ +@RestController +@RequestMapping("/bas/rule") +public class BasCargoSpaceWeightRuleController extends BaseController +{ + @Autowired + private IBasCargoSpaceWeightRuleService basCargoSpaceWeightRuleService; + + /** + * 查询重量规则列表 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:list')") + @GetMapping("/list") + public TableDataInfo list(BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + startPage(); + List list = basCargoSpaceWeightRuleService.selectBasCargoSpaceWeightRuleList(basCargoSpaceWeightRule); + return getDataTable(list); + } + + /** + * 导出重量规则列表 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:export')") + @Log(title = "重量规则", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + List list = basCargoSpaceWeightRuleService.selectBasCargoSpaceWeightRuleList(basCargoSpaceWeightRule); + ExcelUtil util = new ExcelUtil(BasCargoSpaceWeightRule.class); + util.exportExcel(response, list, "重量规则数据"); + } + + /** + * 获取重量规则详细信息 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:query')") + @GetMapping(value = "/{warehouseId}") + public AjaxResult getInfo(@PathVariable("warehouseId") String warehouseId) + { + return success(basCargoSpaceWeightRuleService.selectBasCargoSpaceWeightRuleByWarehouseId(warehouseId)); + } + + /** + * 新增重量规则 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:add')") + @Log(title = "重量规则", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + return toAjax(basCargoSpaceWeightRuleService.insertBasCargoSpaceWeightRule(basCargoSpaceWeightRule)); + } + + /** + * 修改重量规则 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:edit')") + @Log(title = "重量规则", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + return toAjax(basCargoSpaceWeightRuleService.updateBasCargoSpaceWeightRule(basCargoSpaceWeightRule)); + } + + /** + * 删除重量规则 + */ + @PreAuthorize("@ss.hasPermi('bas:rule:remove')") + @Log(title = "重量规则", businessType = BusinessType.DELETE) + @DeleteMapping("/{warehouseIds}") + public AjaxResult remove(@PathVariable String[] warehouseIds) + { + return toAjax(basCargoSpaceWeightRuleService.deleteBasCargoSpaceWeightRuleByWarehouseIds(warehouseIds)); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/domain/BasCargoSpaceWeightRule.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/domain/BasCargoSpaceWeightRule.java new file mode 100644 index 0000000..113508e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/domain/BasCargoSpaceWeightRule.java @@ -0,0 +1,128 @@ +package com.ruoyi.bas.weightRule.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 重量规则对象 bas_cargo_space_weight_rule + * + * @author ruoyi + * @date 2026-01-11 + */ +public class BasCargoSpaceWeightRule extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 仓库编码 */ + @Excel(name = "仓库编码") + private String warehouseId; + + /** 重量 */ + @Excel(name = "重量") + private String weight; + + /** 层数 */ + @Excel(name = "层数") + private String floor; + + /** 巷道 */ + @Excel(name = "巷道") + private String roadwayId; + + /** 备用1 */ + @Excel(name = "备用1") + private String spare1; + + /** 备用2 */ + @Excel(name = "备用2") + private String spare2; + + /** 备用3 */ + @Excel(name = "备用3") + private String spare3; + + public void setWarehouseId(String warehouseId) + { + this.warehouseId = warehouseId; + } + + public String getWarehouseId() + { + return warehouseId; + } + + public void setWeight(String weight) + { + this.weight = weight; + } + + public String getWeight() + { + return weight; + } + + public void setFloor(String floor) + { + this.floor = floor; + } + + public String getFloor() + { + return floor; + } + + public void setRoadwayId(String roadwayId) + { + this.roadwayId = roadwayId; + } + + public String getRoadwayId() + { + return roadwayId; + } + + public void setSpare1(String spare1) + { + this.spare1 = spare1; + } + + public String getSpare1() + { + return spare1; + } + + public void setSpare2(String spare2) + { + this.spare2 = spare2; + } + + public String getSpare2() + { + return spare2; + } + + public void setSpare3(String spare3) + { + this.spare3 = spare3; + } + + public String getSpare3() + { + return spare3; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("warehouseId", getWarehouseId()) + .append("weight", getWeight()) + .append("floor", getFloor()) + .append("roadwayId", getRoadwayId()) + .append("spare1", getSpare1()) + .append("spare2", getSpare2()) + .append("spare3", getSpare3()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/mapper/BasCargoSpaceWeightRuleMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/mapper/BasCargoSpaceWeightRuleMapper.java new file mode 100644 index 0000000..9d65210 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/mapper/BasCargoSpaceWeightRuleMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.bas.weightRule.mapper; + +import java.util.List; +import com.ruoyi.bas.weightRule.domain.BasCargoSpaceWeightRule; + +/** + * 重量规则Mapper接口 + * + * @author ruoyi + * @date 2026-01-11 + */ +public interface BasCargoSpaceWeightRuleMapper +{ + /** + * 查询重量规则 + * + * @param warehouseId 重量规则主键 + * @return 重量规则 + */ + public BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseId(String warehouseId); + + /** + * 查询重量规则列表 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 重量规则集合 + */ + public List selectBasCargoSpaceWeightRuleList(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 新增重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + public int insertBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 修改重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + public int updateBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 删除重量规则 + * + * @param warehouseId 重量规则主键 + * @return 结果 + */ + public int deleteBasCargoSpaceWeightRuleByWarehouseId(String warehouseId); + + /** + * 批量删除重量规则 + * + * @param warehouseIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBasCargoSpaceWeightRuleByWarehouseIds(String[] warehouseIds); + + BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseIdAndRoadwayId(BasCargoSpaceWeightRule weightParam); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/IBasCargoSpaceWeightRuleService.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/IBasCargoSpaceWeightRuleService.java new file mode 100644 index 0000000..94d3bb4 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/IBasCargoSpaceWeightRuleService.java @@ -0,0 +1,63 @@ +package com.ruoyi.bas.weightRule.service; + +import java.util.List; +import com.ruoyi.bas.weightRule.domain.BasCargoSpaceWeightRule; + +/** + * 重量规则Service接口 + * + * @author ruoyi + * @date 2026-01-11 + */ +public interface IBasCargoSpaceWeightRuleService +{ + /** + * 查询重量规则 + * + * @param warehouseId 重量规则主键 + * @return 重量规则 + */ + public BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseId(String warehouseId); + + /** + * 查询重量规则列表 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 重量规则集合 + */ + public List selectBasCargoSpaceWeightRuleList(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 新增重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + public int insertBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 修改重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + public int updateBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule); + + /** + * 批量删除重量规则 + * + * @param warehouseIds 需要删除的重量规则主键集合 + * @return 结果 + */ + public int deleteBasCargoSpaceWeightRuleByWarehouseIds(String[] warehouseIds); + + /** + * 删除重量规则信息 + * + * @param warehouseId 重量规则主键 + * @return 结果 + */ + public int deleteBasCargoSpaceWeightRuleByWarehouseId(String warehouseId); + + BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseIdAndRoadwayId(BasCargoSpaceWeightRule weightParam); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/impl/BasCargoSpaceWeightRuleServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/impl/BasCargoSpaceWeightRuleServiceImpl.java new file mode 100644 index 0000000..7cd3eff --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/weightRule/service/impl/BasCargoSpaceWeightRuleServiceImpl.java @@ -0,0 +1,98 @@ +package com.ruoyi.bas.weightRule.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.bas.weightRule.mapper.BasCargoSpaceWeightRuleMapper; +import com.ruoyi.bas.weightRule.domain.BasCargoSpaceWeightRule; +import com.ruoyi.bas.weightRule.service.IBasCargoSpaceWeightRuleService; + +/** + * 重量规则Service业务层处理 + * + * @author ruoyi + * @date 2026-01-11 + */ +@Service +public class BasCargoSpaceWeightRuleServiceImpl implements IBasCargoSpaceWeightRuleService +{ + @Autowired + private BasCargoSpaceWeightRuleMapper basCargoSpaceWeightRuleMapper; + + /** + * 查询重量规则 + * + * @param warehouseId 重量规则主键 + * @return 重量规则 + */ + @Override + public BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseId(String warehouseId) + { + return basCargoSpaceWeightRuleMapper.selectBasCargoSpaceWeightRuleByWarehouseId(warehouseId); + } + + /** + * 查询重量规则列表 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 重量规则 + */ + @Override + public List selectBasCargoSpaceWeightRuleList(BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + return basCargoSpaceWeightRuleMapper.selectBasCargoSpaceWeightRuleList(basCargoSpaceWeightRule); + } + + /** + * 新增重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + @Override + public int insertBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + return basCargoSpaceWeightRuleMapper.insertBasCargoSpaceWeightRule(basCargoSpaceWeightRule); + } + + /** + * 修改重量规则 + * + * @param basCargoSpaceWeightRule 重量规则 + * @return 结果 + */ + @Override + public int updateBasCargoSpaceWeightRule(BasCargoSpaceWeightRule basCargoSpaceWeightRule) + { + return basCargoSpaceWeightRuleMapper.updateBasCargoSpaceWeightRule(basCargoSpaceWeightRule); + } + + /** + * 批量删除重量规则 + * + * @param warehouseIds 需要删除的重量规则主键 + * @return 结果 + */ + @Override + public int deleteBasCargoSpaceWeightRuleByWarehouseIds(String[] warehouseIds) + { + return basCargoSpaceWeightRuleMapper.deleteBasCargoSpaceWeightRuleByWarehouseIds(warehouseIds); + } + + /** + * 删除重量规则信息 + * + * @param warehouseId 重量规则主键 + * @return 结果 + */ + @Override + public int deleteBasCargoSpaceWeightRuleByWarehouseId(String warehouseId) + { + return basCargoSpaceWeightRuleMapper.deleteBasCargoSpaceWeightRuleByWarehouseId(warehouseId); + } + + @Override + public BasCargoSpaceWeightRule selectBasCargoSpaceWeightRuleByWarehouseIdAndRoadwayId(BasCargoSpaceWeightRule weightParam) { + return basCargoSpaceWeightRuleMapper.selectBasCargoSpaceWeightRuleByWarehouseIdAndRoadwayId(weightParam); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/bas/BasCargoSpaceWeightRuleMapper.xml b/ruoyi-admin/src/main/resources/mapper/bas/BasCargoSpaceWeightRuleMapper.xml new file mode 100644 index 0000000..29a4662 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/bas/BasCargoSpaceWeightRuleMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + select warehouse_id, weight, floor, roadway_id, spare1, spare2, spare3 from bas_cargo_space_weight_rule + + + + + + + + + + insert into bas_cargo_space_weight_rule + + warehouse_id, + weight, + floor, + roadway_id, + spare1, + spare2, + spare3, + + + #{warehouseId}, + #{weight}, + #{floor}, + #{roadwayId}, + #{spare1}, + #{spare2}, + #{spare3}, + + + + + update bas_cargo_space_weight_rule + + weight = #{weight}, + floor = #{floor}, + roadway_id = #{roadwayId}, + spare1 = #{spare1}, + spare2 = #{spare2}, + spare3 = #{spare3}, + + where warehouse_id = #{warehouseId} + + + + delete from bas_cargo_space_weight_rule where warehouse_id = #{warehouseId} + + + + delete from bas_cargo_space_weight_rule where warehouse_id in + + #{warehouseId} + + + \ No newline at end of file