From e98b7969c7a2d150663e5961f488b8df97ad944f Mon Sep 17 00:00:00 2001 From: liuhanqing Date: Thu, 11 Sep 2025 16:15:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=AE=A1=E7=90=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BasProductController.java | 56 ++--- .../bas/BasProduct/domain/BasProduct.java | 131 +++++------ .../BasProduct/mapper/BasProductMapper.java | 63 ++--- .../service/IBasProductService.java | 62 +++-- .../service/impl/BasProductServiceImpl.java | 68 ++---- .../resources/mapper/bas/BasProductMapper.xml | 147 +++++------- ruoyi-ui/src/api/bas/BasProduct.js | 10 +- ruoyi-ui/src/views/bas/basProduct/index.vue | 220 +++++++++--------- 8 files changed, 336 insertions(+), 421 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/controller/BasProductController.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/controller/BasProductController.java index a5a7e24..172d059 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/controller/BasProductController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/controller/BasProductController.java @@ -1,25 +1,31 @@ package com.ruoyi.bas.BasProduct.controller; -import cn.hutool.core.util.IdUtil; -import com.ruoyi.bas.BasProduct.domain.BasProduct; -import com.ruoyi.bas.BasProduct.service.IBasProductService; +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.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.bas.BasProduct.domain.BasProduct; +import com.ruoyi.bas.BasProduct.service.IBasProductService; import com.ruoyi.common.utils.poi.ExcelUtil; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import com.ruoyi.common.core.page.TableDataInfo; -import java.util.List; /** - * 物料管理Controller - * - * @author ruoyi - * @date 2025-05-20 + * 物料信息Controller + * + * @author gw + * @date 2025-09-11 */ @RestController @RequestMapping("/bas/BasProduct") @@ -29,7 +35,7 @@ public class BasProductController extends BaseController private IBasProductService basProductService; /** - * 查询物料管理列表 + * 查询物料信息列表 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:list')") @GetMapping("/list") @@ -41,20 +47,20 @@ public class BasProductController extends BaseController } /** - * 导出物料管理列表 + * 导出物料信息列表 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:export')") - @Log(title = "物料管理", businessType = BusinessType.EXPORT) + @Log(title = "物料信息", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, BasProduct basProduct) { List list = basProductService.selectBasProductList(basProduct); ExcelUtil util = new ExcelUtil(BasProduct.class); - util.exportExcel(response, list, "物料管理数据"); + util.exportExcel(response, list, "物料信息数据"); } /** - * 获取物料管理详细信息 + * 获取物料信息详细信息 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:query')") @GetMapping(value = "/{productGuid}") @@ -64,23 +70,21 @@ public class BasProductController extends BaseController } /** - * 新增物料管理 + * 新增物料信息 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:add')") - @Log(title = "物料管理", businessType = BusinessType.INSERT) + @Log(title = "物料信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody BasProduct basProduct) { - // 使用雪花算法生成ID并转为字符串 - basProduct.setProductGuid(String.valueOf(IdUtil.getSnowflake().nextId())); return toAjax(basProductService.insertBasProduct(basProduct)); } /** - * 修改物料管理 + * 修改物料信息 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:edit')") - @Log(title = "物料管理", businessType = BusinessType.UPDATE) + @Log(title = "物料信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody BasProduct basProduct) { @@ -88,10 +92,10 @@ public class BasProductController extends BaseController } /** - * 删除物料管理 + * 删除物料信息 */ @PreAuthorize("@ss.hasPermi('bas:BasProduct:remove')") - @Log(title = "物料管理", businessType = BusinessType.DELETE) + @Log(title = "物料信息", businessType = BusinessType.DELETE) @DeleteMapping("/{productGuids}") public AjaxResult remove(@PathVariable String[] productGuids) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/domain/BasProduct.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/domain/BasProduct.java index 7dd4771..8123942 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/domain/BasProduct.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/domain/BasProduct.java @@ -1,18 +1,22 @@ package com.ruoyi.bas.BasProduct.domain; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +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; -import lombok.Data; -import lombok.EqualsAndHashCode; /** - * 物料管理对象 bas_product + * 物料信息对象 bas_product * - * @author ruoyi - * @date 2025-05-20 + * @author gw + * @date 2025-09-11 */ -@EqualsAndHashCode(callSuper = true) @Data +@AllArgsConstructor +@NoArgsConstructor public class BasProduct extends BaseEntity { private static final long serialVersionUID = 1L; @@ -21,85 +25,66 @@ public class BasProduct extends BaseEntity private String productGuid; /** 物料编码 */ - @Excel(name = "${bas.Product.productId}") + @Excel(name = "物料编码") private String productId; /** 物料名称 */ - @Excel(name = "${bas.Product.productName}") + @Excel(name = "物料名称") private String productName; - /** 英文描述 */ - @Excel(name = "${bas.Product.spare1}") - private String spare1; - - /** 单位 */ - @Excel(name = "${bas.Product.unit}") - private String unit; - - /** 单件净重KG */ - @Excel(name = "${bas.Product.spare2}") - private String spare2; - - /** 长MM */ - @Excel(name = "${bas.Product.spare5}") - private String spare5; - - /** 宽MM */ - @Excel(name = "${bas.Product.spare6}") - private String spare6; - - /** 高MM */ - @Excel(name = "${bas.Product.spare7}") - private String spare7; - - /** 体积m³ */ - @Excel(name = "${bas.Product.spare8}") - private String spare8; - - /** 价格 */ - @Excel(name = "${bas.Product.price}") - private String price; - - /** 描述 */ - @Excel(name = "${bas.Product.remark}") - private String remark; - - /** 父节点id */ -// @Excel(name = "${bas.Product.parentId}") - private String parentId; - - /** 品牌 */ -// @Excel(name = "${bas.Product.cargoNo}") - private String cargoNo; - - /** 规格 */ -// @Excel(name = "${bas.Product.spec}") - private String spec; - - /** 备用字段3 */ -// @Excel(name = "${bas.Product.spare3}") - private String spare3; - - /** 备用字段4 */ -// @Excel(name = "${bas.Product.spare4}") + /** 序列号 */ + @Excel(name = "序列号") private String spare4; + /** 相位 */ + @Excel(name = "相位") + private String spare7; - /** 备用字段6 */ -// @Excel(name = "${bas.Product.spare9}") + /** 型号 */ + @Excel(name = "型号") + private String spare1; + + /** 净重 */ + @Excel(name = "净重") + private String spare2; + + /** 毛重 */ + @Excel(name = "毛重") + private String spare8; + + /** 颜色 */ + @Excel(name = "颜色") + private String spare3; + + /** 电压 */ + @Excel(name = "电压") + private String spare5; + + /** 功率 */ + @Excel(name = "功率") + private String spare6; + + /** $column.columnComment */ + private String parentId; + + /** $column.columnComment */ + private String price; + + /** $column.columnComment */ + private String cargoNo; + + /** $column.columnComment */ + private String unit; + + /** $column.columnComment */ + private String spec; + + /** $column.columnComment */ private String spare9; - /** - * 数量 - */ private String quantity; - /** - * 批号 - */ + private String lotNo; - private String totalNetWeight; - private String netWeight; - private String grossWeight; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/mapper/BasProductMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/mapper/BasProductMapper.java index 5c78032..bec161f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/mapper/BasProductMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/mapper/BasProductMapper.java @@ -1,74 +1,61 @@ package com.ruoyi.bas.BasProduct.mapper; -import com.ruoyi.bas.BasProduct.domain.BasProduct; -import org.apache.ibatis.annotations.Param; - import java.util.List; +import com.ruoyi.bas.BasProduct.domain.BasProduct; /** - * 物料管理Mapper接口 - * - * @author ruoyi - * @date 2025-05-20 + * 物料信息Mapper接口 + * + * @author gw + * @date 2025-09-11 */ -public interface BasProductMapper +public interface BasProductMapper { /** - * 查询物料管理 - * - * @param productGuid 物料管理主键 - * @return 物料管理 + * 查询物料信息 + * + * @param productGuid 物料信息主键 + * @return 物料信息 */ public BasProduct selectBasProductByProductGuid(String productGuid); /** - * 查询物料管理列表 - * - * @param basProduct 物料管理 - * @return 物料管理集合 + * 查询物料信息列表 + * + * @param basProduct 物料信息 + * @return 物料信息集合 */ public List selectBasProductList(BasProduct basProduct); /** - * 新增物料管理 - * - * @param basProduct 物料管理 + * 新增物料信息 + * + * @param basProduct 物料信息 * @return 结果 */ public int insertBasProduct(BasProduct basProduct); /** - * 修改物料管理 - * - * @param basProduct 物料管理 + * 修改物料信息 + * + * @param basProduct 物料信息 * @return 结果 */ public int updateBasProduct(BasProduct basProduct); /** - * 删除物料管理 - * - * @param productGuid 物料管理主键 + * 删除物料信息 + * + * @param productGuid 物料信息主键 * @return 结果 */ public int deleteBasProductByProductGuid(String productGuid); /** - * 批量删除物料管理 - * + * 批量删除物料信息 + * * @param productGuids 需要删除的数据主键集合 * @return 结果 */ public int deleteBasProductByProductGuids(String[] productGuids); - - /** - * 通过物料id列表批量查询物料信息 - * @param collect - * @return - */ - List selectBasProductListByProductGuids(@Param("productGuids") List collect); - - BasProduct selectBasProductByProductId(String productId); - - List selectBasProductListByProductIds(@Param("productIds") List collect); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/IBasProductService.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/IBasProductService.java index 0e57ce4..ad813ac 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/IBasProductService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/IBasProductService.java @@ -1,73 +1,65 @@ package com.ruoyi.bas.BasProduct.service; +import java.util.List; import com.ruoyi.bas.BasProduct.domain.BasProduct; -import java.util.List; - /** - * 物料管理Service接口 - * - * @author ruoyi - * @date 2025-05-20 + * 物料信息Service接口 + * + * @author gw + * @date 2025-09-11 */ -public interface IBasProductService +public interface IBasProductService { /** - * 查询物料管理 - * - * @param productGuid 物料管理主键 - * @return 物料管理 + * 查询物料信息 + * + * @param productGuid 物料信息主键 + * @return 物料信息 */ public BasProduct selectBasProductByProductGuid(String productGuid); - public BasProduct selectBasProductByProductId(String productId); - /** - * 查询物料管理列表 - * - * @param basProduct 物料管理 - * @return 物料管理集合 + * 查询物料信息列表 + * + * @param basProduct 物料信息 + * @return 物料信息集合 */ public List selectBasProductList(BasProduct basProduct); /** - * 新增物料管理 - * - * @param basProduct 物料管理 + * 新增物料信息 + * + * @param basProduct 物料信息 * @return 结果 */ public int insertBasProduct(BasProduct basProduct); /** - * 修改物料管理 - * - * @param basProduct 物料管理 + * 修改物料信息 + * + * @param basProduct 物料信息 * @return 结果 */ public int updateBasProduct(BasProduct basProduct); /** - * 批量删除物料管理 - * - * @param productGuids 需要删除的物料管理主键集合 + * 批量删除物料信息 + * + * @param productGuids 需要删除的物料信息主键集合 * @return 结果 */ public int deleteBasProductByProductGuids(String[] productGuids); /** - * 删除物料管理信息 - * - * @param productGuid 物料管理主键 + * 删除物料信息信息 + * + * @param productGuid 物料信息主键 * @return 结果 */ public int deleteBasProductByProductGuid(String productGuid); - /** - * 通过物料id列表查询物料信息 - * @param collect - * @return - */ - List selectBasProductListByProductGuids(List collect); + BasProduct selectBasProductByProductId(String productId); List selectBasProductListByProductIds(List collect); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/impl/BasProductServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/impl/BasProductServiceImpl.java index 565a83b..83c9182 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/impl/BasProductServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/bas/BasProduct/service/impl/BasProductServiceImpl.java @@ -1,20 +1,17 @@ package com.ruoyi.bas.BasProduct.service.impl; -import cn.hutool.core.collection.CollUtil; -import com.ruoyi.bas.BasProduct.domain.BasProduct; -import com.ruoyi.bas.BasProduct.mapper.BasProductMapper; -import com.ruoyi.bas.BasProduct.service.IBasProductService; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; +import com.ruoyi.bas.BasProduct.mapper.BasProductMapper; +import com.ruoyi.bas.BasProduct.domain.BasProduct; +import com.ruoyi.bas.BasProduct.service.IBasProductService; /** - * 物料管理Service业务层处理 + * 物料信息Service业务层处理 * - * @author ruoyi - * @date 2025-05-20 + * @author gw + * @date 2025-09-11 */ @Service public class BasProductServiceImpl implements IBasProductService @@ -23,10 +20,10 @@ public class BasProductServiceImpl implements IBasProductService private BasProductMapper basProductMapper; /** - * 查询物料管理 + * 查询物料信息 * - * @param productGuid 物料管理主键 - * @return 物料管理 + * @param productGuid 物料信息主键 + * @return 物料信息 */ @Override public BasProduct selectBasProductByProductGuid(String productGuid) @@ -34,16 +31,11 @@ public class BasProductServiceImpl implements IBasProductService return basProductMapper.selectBasProductByProductGuid(productGuid); } - @Override - public BasProduct selectBasProductByProductId(String productId) { - return basProductMapper.selectBasProductByProductId(productId); - } - /** - * 查询物料管理列表 + * 查询物料信息列表 * - * @param basProduct 物料管理 - * @return 物料管理 + * @param basProduct 物料信息 + * @return 物料信息 */ @Override public List selectBasProductList(BasProduct basProduct) @@ -52,9 +44,9 @@ public class BasProductServiceImpl implements IBasProductService } /** - * 新增物料管理 + * 新增物料信息 * - * @param basProduct 物料管理 + * @param basProduct 物料信息 * @return 结果 */ @Override @@ -64,9 +56,9 @@ public class BasProductServiceImpl implements IBasProductService } /** - * 修改物料管理 + * 修改物料信息 * - * @param basProduct 物料管理 + * @param basProduct 物料信息 * @return 结果 */ @Override @@ -76,9 +68,9 @@ public class BasProductServiceImpl implements IBasProductService } /** - * 批量删除物料管理 + * 批量删除物料信息 * - * @param productGuids 需要删除的物料管理主键 + * @param productGuids 需要删除的物料信息主键 * @return 结果 */ @Override @@ -88,9 +80,9 @@ public class BasProductServiceImpl implements IBasProductService } /** - * 删除物料管理信息 + * 删除物料信息信息 * - * @param productGuid 物料管理主键 + * @param productGuid 物料信息主键 * @return 结果 */ @Override @@ -98,24 +90,14 @@ public class BasProductServiceImpl implements IBasProductService { return basProductMapper.deleteBasProductByProductGuid(productGuid); } - /** - * 通过物料id列表查询物料信息 - * @param collect - * @return - */ + @Override - public List selectBasProductListByProductGuids(List collect) { - if (CollUtil.isEmpty(collect)){ - return new ArrayList<>(); - } - return basProductMapper.selectBasProductListByProductGuids(collect); + public BasProduct selectBasProductByProductId(String productId) { + return null; } @Override public List selectBasProductListByProductIds(List collect) { - if (CollUtil.isEmpty(collect)){ - return new ArrayList<>(); - } - return basProductMapper.selectBasProductListByProductIds(collect); + return List.of(); } } diff --git a/ruoyi-admin/src/main/resources/mapper/bas/BasProductMapper.xml b/ruoyi-admin/src/main/resources/mapper/bas/BasProductMapper.xml index de73879..4570b74 100644 --- a/ruoyi-admin/src/main/resources/mapper/bas/BasProductMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/bas/BasProductMapper.xml @@ -3,142 +3,117 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + + + + + + + + + + + - - - - - - - - - - - select product_guid, product_id, parent_id, price, cargo_no, unit, spec, remark, spare1, spare2, spare3, spare4, spare5, spare6, product_name, spare7, spare8, spare9 from bas_product + select product_guid, product_id, product_name, spare4, spare7, spare1, spare2, spare8, spare3, spare5, spare6, remark, parent_id, price, cargo_no, unit, spec, spare9 from bas_product - + - - - insert into bas_product product_guid, - product_id, - parent_id, + product_id, + product_name, + spare4, + spare7, + spare1, + spare2, + spare8, + spare3, + spare5, + spare6, + remark, + parent_id, price, cargo_no, unit, spec, - remark, - spare1, - spare2, - spare3, - spare4, - spare5, - spare6, - spare7, - spare8, spare9, - product_name, #{productGuid}, - #{productId}, - #{parentId}, + #{productId}, + #{productName}, + #{spare4}, + #{spare7}, + #{spare1}, + #{spare2}, + #{spare8}, + #{spare3}, + #{spare5}, + #{spare6}, + #{remark}, + #{parentId}, #{price}, #{cargoNo}, #{unit}, #{spec}, - #{remark}, - #{spare1}, - #{spare2}, - #{spare3}, - #{spare4}, - #{spare5}, - #{spare6}, - #{spare7}, - #{spare8}, #{spare9}, - #{productName}, update bas_product - product_id = #{productId}, - parent_id = #{parentId}, + product_id = #{productId}, + product_name = #{productName}, + spare4 = #{spare4}, + spare7 = #{spare7}, + spare1 = #{spare1}, + spare2 = #{spare2}, + spare8 = #{spare8}, + spare3 = #{spare3}, + spare5 = #{spare5}, + spare6 = #{spare6}, + remark = #{remark}, + parent_id = #{parentId}, price = #{price}, cargo_no = #{cargoNo}, unit = #{unit}, spec = #{spec}, - remark = #{remark}, - spare1 = #{spare1}, - spare2 = #{spare2}, - spare3 = #{spare3}, - spare4 = #{spare4}, - spare5 = #{spare5}, - spare6 = #{spare6}, - spare7 = #{spare7}, - spare8 = #{spare8}, spare9 = #{spare9}, - product_name = #{productName}, where product_guid = #{productGuid} @@ -148,9 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from bas_product where product_guid in + delete from bas_product where product_guid in #{productGuid} - + \ No newline at end of file diff --git a/ruoyi-ui/src/api/bas/BasProduct.js b/ruoyi-ui/src/api/bas/BasProduct.js index 3c9a8ef..3184cc4 100644 --- a/ruoyi-ui/src/api/bas/BasProduct.js +++ b/ruoyi-ui/src/api/bas/BasProduct.js @@ -1,6 +1,6 @@ import request from '@/utils/request' -// 查询物料管理列表 +// 查询物料信息列表 export function listBasProduct(query) { return request({ url: '/bas/BasProduct/list', @@ -9,7 +9,7 @@ export function listBasProduct(query) { }) } -// 查询物料管理详细 +// 查询物料信息详细 export function getBasProduct(productGuid) { return request({ url: '/bas/BasProduct/' + productGuid, @@ -17,7 +17,7 @@ export function getBasProduct(productGuid) { }) } -// 新增物料管理 +// 新增物料信息 export function addBasProduct(data) { return request({ url: '/bas/BasProduct', @@ -26,7 +26,7 @@ export function addBasProduct(data) { }) } -// 修改物料管理 +// 修改物料信息 export function updateBasProduct(data) { return request({ url: '/bas/BasProduct', @@ -35,7 +35,7 @@ export function updateBasProduct(data) { }) } -// 删除物料管理 +// 删除物料信息 export function delBasProduct(productGuid) { return request({ url: '/bas/BasProduct/' + productGuid, diff --git a/ruoyi-ui/src/views/bas/basProduct/index.vue b/ruoyi-ui/src/views/bas/basProduct/index.vue index 8e86a14..4b0d7df 100644 --- a/ruoyi-ui/src/views/bas/basProduct/index.vue +++ b/ruoyi-ui/src/views/bas/basProduct/index.vue @@ -1,10 +1,10 @@