Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

wangxin 1 miesiąc temu
rodzic
commit
b581438fa8

+ 77 - 77
src/main/java/cn/ezhizao/project/business/controller/BizCompanyProductPackageController.java

@@ -49,12 +49,12 @@ public class BizCompanyProductPackageController extends BaseController
     /**
      * 查询包装方式列表
      */
-    @ApiOperation("获取包装方式详细")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "productDescription", value = "产品描述", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",  dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-    })
+//    @ApiOperation("获取包装方式详细")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "productDescription", value = "产品描述", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",  dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//    })
     @Log(title = "包装方式查询")
     @GetMapping("/list")
     public TableDataInfo list(BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
@@ -76,39 +76,39 @@ public class BizCompanyProductPackageController extends BaseController
     /**
      * 新增包装方式
      */
-    @ApiOperation("新增包装方式")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "productCode", value = "产品编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "companyCode", value = "客户编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",required = true,  dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
-            @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
-            @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
-    })
+//    @ApiOperation("新增包装方式")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "productCode", value = "产品编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "companyCode", value = "客户编码",required = true, dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码",required = true,  dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+//            @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+//            @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+//    })
     @Log(title = "包装方式新增", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
@@ -149,40 +149,40 @@ public class BizCompanyProductPackageController extends BaseController
     /**
      * 修改包装方式
      */
-    @ApiOperation("修改包装方式")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "包装方式ID",required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class),
-            @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "companyCode", value = "客户编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
-            @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
-            @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
-            @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
-    })
+//    @ApiOperation("修改包装方式")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "id", value = "包装方式ID",required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+//            @ApiImplicitParam(name = "productCode", value = "产品编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "companyCode", value = "客户编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageCode", value = "包装箱辅料编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageTypeCode", value = "包装形式码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageNo", value = "包装箱号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageStandard", value = "包装尺寸", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageLength", value = "包装长度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageWidth", value = "包装宽度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packageHeight", value = "包装箱高度", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "singleGrossWeight", value = "单箱毛重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+//            @ApiImplicitParam(name = "singleNumber", value = "单箱支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "perNumber", value = "每层箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "minNumber", value = "满托最小箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "maxNumber", value = "满托最大箱数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "maxBranchNumber", value = "满托支数", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "palletStandard", value = "托盘规格", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "palletType", value = "托盘类型", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "areaType", value = "放置区域", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "unit", value = "库存单位", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "deliveryStatus", value = "传送状态", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "outboxHeight", value = "外箱高度", dataType = "Integer", paramType = "path", dataTypeClass = Integer.class),
+//            @ApiImplicitParam(name = "recipientName", value = "收货方", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "packingOrder", value = "装运单", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "purchaseOrderNo", value = "采购订单号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "customerPartNo", value = "客户零件编号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "customerPartName", value = "客户零件名称", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "netWeight", value = "净重", dataType = "BigDecimal", paramType = "path", dataTypeClass = BigDecimal.class),
+//            @ApiImplicitParam(name = "engineerChangeNumber", value = "工程变更号", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "supplierCode", value = "供应商编码", dataType = "String", paramType = "path", dataTypeClass = String.class),
+//            @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "Long", paramType = "path", dataTypeClass = Long.class),
+//    })
     @Log(title = "包装方式修改", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BizCompanyProductPackage bizCompanyProductPackage) throws NoSuchFieldException, IllegalAccessException
@@ -232,10 +232,10 @@ public class BizCompanyProductPackageController extends BaseController
     /**
      * 删除包装方式
      */
-    @ApiOperation("删除包装方式")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "id", value = "包装方式ID", required = true, dataType = "List<Long>", paramType = "path", dataTypeClass = List.class)
-    })
+//    @ApiOperation("删除包装方式")
+//    @ApiImplicitParams({
+//            @ApiImplicitParam(name = "id", value = "包装方式ID", required = true, dataType = "List<Long>", paramType = "path", dataTypeClass = List.class)
+//    })
     @Log(title = "包装方式删除", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable List<Long> ids)

+ 226 - 0
src/main/java/cn/ezhizao/project/business/controller/BizMeasurementController.java

@@ -0,0 +1,226 @@
+package cn.ezhizao.project.business.controller;
+
+import java.util.*;
+import java.util.stream.Collectors;
+import javax.annotation.Resource;
+
+import cn.ezhizao.common.utils.ServletUtils;
+import cn.ezhizao.framework.aspectj.lang.annotation.Log;
+import cn.ezhizao.framework.aspectj.lang.enums.BusinessType;
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.framework.web.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.transaction.annotation.Transactional;
+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 cn.ezhizao.project.business.domain.BizMeasurement;
+import cn.ezhizao.project.business.service.IBizMeasurementService;
+
+/**
+ * 计量单位Controller
+ *
+ * @author ezhizao
+ * @date 2025-04-23
+ */
+@Api("计量单位管理")
+@RestController
+@RequestMapping("/business/measurement")
+public class BizMeasurementController extends BaseController
+{
+    @Resource
+    private IBizMeasurementService bizMeasurementService;
+    public static final String PAGE_SIZE = "pageSize";
+
+    /**
+     * 查询计量单位列表
+     */
+    @ApiOperation("获取计量单位详细")
+    @GetMapping("/list")
+    public TableDataInfo list(BizMeasurement bizMeasurement) throws NoSuchFieldException, IllegalAccessException
+    {
+        String pageSizeStr = ServletUtils.getParameter(PAGE_SIZE);
+        if (pageSizeStr !=null) {
+            startPage();
+        }
+        List<BizMeasurement> list = bizMeasurementService.getList(bizMeasurement);
+        return getDataTable(list);
+    }
+    /**
+     * 新增计量单位
+     */
+    @ApiOperation("新增计量单位")
+    @Log(title = "计量单位", businessType = BusinessType.INSERT)
+    @PostMapping
+    @Transactional
+    public AjaxResult add(@RequestBody List<BizMeasurement> bizMeasurementList) throws NoSuchFieldException, IllegalAccessException
+    {
+        //判断传入的个数
+        if(bizMeasurementList.size() == 0){
+            throw new RuntimeException("新增失败,数据不能为空");
+        }
+        if(bizMeasurementList.size() >100) {
+            throw new RuntimeException("新增失败,数据过多,不允许超过100条");
+        }
+            if (bizMeasurementList.stream().anyMatch(measurement -> measurement.getCode() == null || measurement.getCode() == "")) {
+                throw new RuntimeException("新增失败,编码不能为空");
+            }
+            //判断编码是否有重复
+            List<String> measurementCodes = bizMeasurementList.stream()
+                    .map(BizMeasurement::getCode)
+                    .collect(Collectors.toList());
+            Set<String> uniqueMeasurementCodes = new HashSet<>(measurementCodes);
+            if (measurementCodes.size() != uniqueMeasurementCodes.size()) {
+                throw new RuntimeException("新增失败,编码不能重复");
+        }
+                //新增的编码没有重复
+                //判断数据库是否存在相同的编码
+                List<BizMeasurement> measurements = bizMeasurementService.query().in("code", measurementCodes).list();
+                if (!measurements.isEmpty()){
+                    throw new RuntimeException("新增失败,存在重复的编码");
+                }
+        return toAjax(bizMeasurementService.saveBatch(bizMeasurementList));
+    }
+
+    /**
+     * 修改计量单位
+     */
+    @ApiOperation("修改计量单位")
+    @Log(title = "计量单位", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody List<BizMeasurement> bizMeasurementList) throws NoSuchFieldException, IllegalAccessException
+    {
+        //判断传入的个数
+        if(bizMeasurementList.size() == 0){
+            throw new RuntimeException("修改失败,数据不能为空");
+        }
+        if(bizMeasurementList.size() >100) {
+            throw new RuntimeException("修改失败,数据过多,不允许超过100条");
+        }
+        if (bizMeasurementList.stream().anyMatch(measurement -> measurement.getHistoryCode() == null ||measurement.getHistoryCode() == "")) {
+            throw new RuntimeException("修改失败,原始编码不能为空");
+        }
+        //判断产品编码是否有重复(可能存在相同的id和编码写了多次
+        Map<String, List<BizMeasurement>> measurementCodeMap = bizMeasurementList.stream()
+                .filter(material -> material.getCode() != null)
+                .collect(Collectors.groupingBy(BizMeasurement::getCode));
+
+        boolean hasDuplicate = measurementCodeMap.values().stream()
+                .anyMatch(list -> list.size() > 1 &&
+                        list.stream().map(BizMeasurement::getHistoryCode).distinct().count() > 1);
+
+        if (hasDuplicate) {
+            throw new RuntimeException("修改失败,编码不能重复");
+        }
+        //判断数据库是否有重复的编码
+        List<String> measurementCodes = bizMeasurementList.stream()
+                .filter(material -> material.getCode() != null)
+                .map(BizMeasurement::getCode)
+                .collect(Collectors.toList());
+        if (!measurementCodes.isEmpty()) {
+            List<BizMeasurement> measurementList = bizMeasurementService.query().in("code", measurementCodes).list();
+            for (BizMeasurement measurement : bizMeasurementList) {
+                for (BizMeasurement measure : measurementList) {
+                    if (Objects.equals(measurement.getCode(), measure.getCode()) &&
+                            !Objects.equals(measurement.getHistoryCode(), measure.getCode())) {
+                        // 如果找到匹配的项,则抛出错误
+                        throw new RuntimeException("修改失败,编码不能重复");
+                    }
+                }
+            }
+        }
+        List<BizMeasurement> measurementList = bizMeasurementService.query().in("code", bizMeasurementList.stream()
+                .map(BizMeasurement::getHistoryCode)
+                .collect(Collectors.toList())).list();
+        for (BizMeasurement measure : bizMeasurementList) {
+            BizMeasurement bizMeasurement =  measurementList.stream().filter(item -> item.getCode().equals(measure.getHistoryCode())).findFirst().orElse(null);
+            if (bizMeasurement == null) {
+                throw new RuntimeException("修改失败,编码不存在");
+            }
+            if (measure.getCode() != null) {
+                bizMeasurement.setCode(measure.getCode());
+            }
+            if (measure.getHistoryCode() != null) {
+                bizMeasurement.setHistoryCode(measure.getHistoryCode());
+            }
+            if (measure.getNumerator() != null) {
+                bizMeasurement.setNumerator(measure.getNumerator());
+            }
+            if (measure.getDenominator() != null) {
+                bizMeasurement.setDenominator(measure.getDenominator());
+            }
+            if (measure.getName() != null) {
+                bizMeasurement.setName(measure.getName());
+            }
+            if (measure.getRemake() != null) {
+                bizMeasurement.setRemake(measure.getRemake());
+            }
+            if (measure.getGroup() != null) {
+                bizMeasurement.setGroup(measure.getGroup());
+            }
+            if (measure.getStandard() != null) {
+                bizMeasurement.setStandard(measure.getStandard());
+            }
+            if (measure.getConversionType() != null) {
+                bizMeasurement.setConversionType(measure.getConversionType());
+            }
+            if (measure.getPrecision() != null) {
+                bizMeasurement.setPrecision(measure.getPrecision());
+            }
+            if (measure.getRoundingType() != null) {
+                bizMeasurement.setRoundingType(measure.getRoundingType());
+            }
+            if (measure.getStatus() != null) {
+                bizMeasurement.setStatus(measure.getStatus());
+            }
+            if (measure.getForbidden() != null) {
+                bizMeasurement.setForbidden(measure.getForbidden());
+            }
+            if (measure.getCreateName() != null) {
+                bizMeasurement.setCreateName(measure.getCreateName());
+            }
+            if (measure.getUpdateName() != null) {
+                bizMeasurement.setUpdateName(measure.getUpdateName());
+            }
+            if (measure.getAuditTime() != null) {
+                bizMeasurement.setAuditTime(measure.getAuditTime());
+            }
+            if (measure.getAuditName() != null) {
+                bizMeasurement.setAuditName(measure.getAuditName());
+            }
+            if (measure.getForbiddenTime() != null) {
+                bizMeasurement.setForbiddenTime(measure.getForbiddenTime());
+            }
+            if (measure.getForbiddenName() != null) {
+                bizMeasurement.setForbiddenName(measure.getForbiddenName());
+            }
+            if (measure.getInit() != null) {
+                bizMeasurement.setInit(measure.getInit());
+            }
+
+        }
+            return toAjax(bizMeasurementService.updateBatchById(measurementList));
+    }
+
+    /**
+     * 删除计量单位
+     */
+    @ApiOperation("删除计量单位")
+    @Log(title = "计量单位", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{codes}")
+    public AjaxResult remove(@PathVariable List<String> codes)
+    {
+        if(codes.isEmpty()){
+            return error("删除失败,编码不能为空");
+        }
+        List<BizMeasurement> list = bizMeasurementService.query().in("code", codes).list();
+        return toAjax(bizMeasurementService.removeBatchByIds(list));
+    }
+}

+ 45 - 38
src/main/java/cn/ezhizao/project/business/controller/BizProductAccessoriesMaterialController.java

@@ -19,6 +19,7 @@ import cn.ezhizao.project.business.domain.*;
 import cn.ezhizao.project.business.service.*;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -38,7 +39,7 @@ import static cn.ezhizao.framework.web.page.TableSupport.PAGE_SIZE;
  * @author ezhizao
  * @date 2025-04-09
  */
-@Api("公司管理")
+@Api("物料管理")
 @RestController
 @RequestMapping("/business/productAccessoriesMaterial")
 public class BizProductAccessoriesMaterialController extends BaseController
@@ -52,22 +53,22 @@ public class BizProductAccessoriesMaterialController extends BaseController
     @Resource
     private IBizMaterialBaseService bizMaterialBaseService;
     public static final String PAGE_SIZE = "pageSize";
-
+//    @ApiOperation("获取物料详细")
     @GetMapping("/list")
-    public AjaxResult list(BizProductAccessoriesMaterial bizProductAccessoriesMaterial) throws NoSuchFieldException, IllegalAccessException
+    public TableDataInfo list(BizProductAccessoriesMaterial bizProductAccessoriesMaterial) throws NoSuchFieldException, IllegalAccessException
     {
         //判断类别
         if(bizProductAccessoriesMaterial.getCategory() == null){
-            return error("查询失败,类别不能为空");
+            throw new RuntimeException("查询失败,类别不能为空");
         }
         if(bizProductAccessoriesMaterial.getCategory() != 1 && bizProductAccessoriesMaterial.getCategory() != 2 && bizProductAccessoriesMaterial.getCategory() != 3){
-            return error("查询失败,类别只能为1、2、3");
+            throw new RuntimeException("查询失败,类别只能为1、2、3");
         }
       //判断厂别
         if(bizProductAccessoriesMaterial.getTenantId() != null){
             List<BizTenant> tenantList = bizTenantService.query().eq("id", bizProductAccessoriesMaterial.getTenantId()).list();
             if(tenantList.isEmpty()){
-                return error("查询失败,租户ID不存在");
+                throw new RuntimeException("查询失败,租户ID不存在");
             }
         }
         String pageSizeStr = ServletUtils.getParameter(PAGE_SIZE);
@@ -83,7 +84,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
             if(bizProductAccessoriesMaterial.getProductCode() != null && bizProductAccessoriesMaterial.getProductCode() != ""){
                 bizProduct.setProductCode(bizProductAccessoriesMaterial.getProductCode());
             }
-            return success(bizProductService.getList(bizProduct));
+            return getDataTable(bizProductService.getList(bizProduct));
         }
         //类别为2 accessories
         if(bizProductAccessoriesMaterial.getCategory() == 2){
@@ -94,7 +95,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
             if(bizProductAccessoriesMaterial.getAccessoriesCode() != null && bizProductAccessoriesMaterial.getAccessoriesCode() != ""){
                 bizAccessories.setAccessoriesCode(bizProductAccessoriesMaterial.getAccessoriesCode());
             }
-            return success(bizAccessoriesService.getList(bizAccessories));
+            return getDataTable(bizAccessoriesService.getList(bizAccessories));
         }
         //类别为3 material
         if(bizProductAccessoriesMaterial.getCategory() == 3){
@@ -105,9 +106,9 @@ public class BizProductAccessoriesMaterialController extends BaseController
             if(bizProductAccessoriesMaterial.getMaterialCode() != null && bizProductAccessoriesMaterial.getMaterialCode() != ""){
                 bizMaterialBase.setMaterialCode(bizProductAccessoriesMaterial.getMaterialCode());
             }
-            return success(bizMaterialBaseService.getList(bizMaterialBase));
+            return getDataTable(bizMaterialBaseService.getList(bizMaterialBase));
         }
-        return success();
+        return getDataTable(new ArrayList<>());
     }
 
     @PostMapping
@@ -161,7 +162,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //产品
             List<BizProductAccessoriesMaterial> productCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 1).collect(Collectors.toList());
             if(!productCollect.isEmpty()){
-                if (productCollect.stream().anyMatch(material -> material.getProductCode() == null)) {
+                if (productCollect.stream().anyMatch(material -> material.getProductCode() == null || material.getProductCode() == "")) {
                     throw new RuntimeException("新增失败,产品编码不能为空");
                 }
                 //判断产品编码是否有重复
@@ -176,7 +177,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
                     //判断数据库是否存在相同的产品编码
                     List<BizProduct> bizProductList = bizProductService.query().in("product_code", productCodes).list();
                         if (!bizProductList.isEmpty()){
-                            return error("新增失败,存在重复的产品编码");
+                            throw new RuntimeException("新增失败,存在重复的产品编码");
                         }else{
                             List<BizProduct> productList = new ArrayList<>();
                             for (BizProductAccessoriesMaterial product : productCollect) {
@@ -225,7 +226,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //辅料
             List<BizProductAccessoriesMaterial> accessoriesCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 2).collect(Collectors.toList());
             if(!accessoriesCollect.isEmpty()){
-                if (accessoriesCollect.stream().anyMatch(material -> material.getAccessoriesCode() == null)) {
+                if (accessoriesCollect.stream().anyMatch(material -> material.getAccessoriesCode() == null || material.getAccessoriesCode() == "")) {
                     throw new RuntimeException("新增失败,辅料编码不能为空");
                 }
                 //判断辅料编码是否有重复
@@ -285,7 +286,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //原材料
             List<BizProductAccessoriesMaterial> materialCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 3).collect(Collectors.toList());
             if(!materialCollect.isEmpty()){
-                if (materialCollect.stream().anyMatch(material -> material.getMaterialCode() == null)) {
+                if (materialCollect.stream().anyMatch(material -> material.getMaterialCode() == null || material.getMaterialCode() == "")) {
                     throw new RuntimeException("新增失败,材料编码不能为空");
                 }
                 //判断原材料编码是否有重复
@@ -493,9 +494,6 @@ public class BizProductAccessoriesMaterialController extends BaseController
                 }
             }
         } else {
-            if (bizProductAccessoriesMaterialList.stream().anyMatch(material -> material.getId() == null)) {
-                throw new RuntimeException("修改失败,id不能为空");
-            }
             if (bizProductAccessoriesMaterialList.stream().anyMatch(material -> material.getCategory() == null)) {
                 throw new RuntimeException("修改失败,类别不能为空");
             }
@@ -519,8 +517,11 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //产品
             List<BizProductAccessoriesMaterial> productCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 1).collect(Collectors.toList());
             if (!productCollect.isEmpty()) {
-                if (productCollect.stream().anyMatch(material -> material.getProductCode() == "")) {
-                    throw new RuntimeException("修改失败,产品编码不能为空");
+                if (productCollect.stream().anyMatch(material -> material.getHistoryProductCode()== null || material.getHistoryProductCode()== "")) {
+                    throw new RuntimeException("修改失败,产品原始编码不能为空");
+                }
+                if (productCollect.stream().anyMatch(material -> material.getProductCode()== "")) {
+                    throw new RuntimeException("修改失败,产品目标编码不能为空");
                 }
                 //判断产品编码是否有重复(可能存在相同的id和编码写了多次
                 Map<String, List<BizProductAccessoriesMaterial>> productCodeMap = productCollect.stream()
@@ -529,7 +530,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
 
                 boolean hasDuplicate = productCodeMap.values().stream()
                         .anyMatch(list -> list.size() > 1 &&
-                                list.stream().map(BizProductAccessoriesMaterial::getId).distinct().count() > 1);
+                                list.stream().map(BizProductAccessoriesMaterial::getHistoryProductCode).distinct().count() > 1);
 
                 if (hasDuplicate) {
                     throw new RuntimeException("修改失败,产品编码不能重复");
@@ -545,20 +546,20 @@ public class BizProductAccessoriesMaterialController extends BaseController
                         for (BizProductAccessoriesMaterial material : productCollect) {
                             for (BizProduct product : bizProductList) {
                                 if (Objects.equals(material.getProductCode(), product.getProductCode()) &&
-                                        !Objects.equals(material.getId(), product.getId())) {
+                                        !Objects.equals(material.getHistoryProductCode(), product.getProductCode())) {
                                     // 如果找到匹配的项,则抛出错误
                                     throw new RuntimeException("修改失败,产品编码不能重复");
                                 }
                             }
                         }
                     }
-                        List<BizProduct> productList = bizProductService.query().in("id", productCollect.stream()
-                                .map(BizProductAccessoriesMaterial::getId)
+                        List<BizProduct> productList = bizProductService.query().in("product_code", productCollect.stream()
+                                .map(BizProductAccessoriesMaterial::getHistoryProductCode)
                                 .collect(Collectors.toList())).list();
                         for (BizProductAccessoriesMaterial product : productCollect) {
-                            BizProduct bizProduct  = productList.stream().filter(item->item.getId().equals(product.getId())).findFirst().orElse(null);
+                            BizProduct bizProduct  = productList.stream().filter(item->item.getProductCode().equals(product.getHistoryProductCode())).findFirst().orElse(null);
                             if (bizProduct == null) {
-                                throw new RuntimeException("修改失败,产品id不存在");
+                                throw new RuntimeException("修改失败,产品编码不存在");
                             }
                             if (product.getTenantId() != null) {
                                 bizProduct.setTenantId(product.getTenantId());
@@ -673,8 +674,11 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //辅料
             List<BizProductAccessoriesMaterial> accessoriesCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 2).collect(Collectors.toList());
             if (!accessoriesCollect.isEmpty()) {
+                if (accessoriesCollect.stream().anyMatch(material -> material.getHistoryAccessoriesCode()== null || material.getHistoryAccessoriesCode()== "")) {
+                    throw new RuntimeException("修改失败,辅料原始编码不能为空");
+                }
                 if (accessoriesCollect.stream().anyMatch(material -> material.getAccessoriesCode() == "")) {
-                    throw new RuntimeException("修改失败,辅料编码不能为空");
+                    throw new RuntimeException("修改失败,辅料目标编码不能为空");
                 }
                 //判断辅料编码是否有重复(可能存在相同的id和编码写了多次
                 Map<String, List<BizProductAccessoriesMaterial>> accessoriesCodeMap = accessoriesCollect.stream()
@@ -683,7 +687,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
 
                 boolean hasDuplicate = accessoriesCodeMap.values().stream()
                         .anyMatch(list -> list.size() > 1 &&
-                                list.stream().map(BizProductAccessoriesMaterial::getId).distinct().count() > 1);
+                                list.stream().map(BizProductAccessoriesMaterial::getHistoryMaterialCode).distinct().count() > 1);
 
                 if (hasDuplicate) {
                     throw new RuntimeException("修改失败,辅料编码不能重复");
@@ -698,20 +702,20 @@ public class BizProductAccessoriesMaterialController extends BaseController
                         for (BizProductAccessoriesMaterial material : accessoriesCollect) {
                             for (BizAccessories accessories : bizAccessoriesList) {
                                 if (Objects.equals(material.getAccessoriesCode(), accessories.getAccessoriesCode()) &&
-                                        !Objects.equals(material.getId(), accessories.getId())) {
+                                        !Objects.equals(material.getHistoryAccessoriesCode(), accessories.getAccessoriesCode())) {
                                     // 如果找到匹配的项,则抛出错误
                                     throw new RuntimeException("修改失败,辅料编码不能重复");
                                 }
                             }
                         }
                     }
-                    List<BizAccessories> accesoriesList = bizAccessoriesService.query().in("id", accessoriesCollect.stream()
-                            .map(BizProductAccessoriesMaterial::getId)
+                    List<BizAccessories> accesoriesList = bizAccessoriesService.query().in("accessories_code", accessoriesCollect.stream()
+                            .map(BizProductAccessoriesMaterial::getHistoryAccessoriesCode)
                             .collect(Collectors.toList())).list();
                     for (BizProductAccessoriesMaterial accessories : accessoriesCollect) {
-                        BizAccessories bizAccessories  = accesoriesList.stream().filter(item->item.getId().equals(accessories.getId())).findFirst().orElse(null);
+                        BizAccessories bizAccessories  = accesoriesList.stream().filter(item->item.getAccessoriesCode().equals(accessories.getHistoryAccessoriesCode())).findFirst().orElse(null);
                         if (bizAccessories == null) {
-                            throw new RuntimeException("修改失败,辅料id不存在");
+                            throw new RuntimeException("修改失败,辅料编码不存在");
                         }
                         if (accessories.getAccessoriesCode() != null) {
                             bizAccessories.setAccessoriesCode(accessories.getAccessoriesCode());
@@ -813,6 +817,9 @@ public class BizProductAccessoriesMaterialController extends BaseController
             //原材料
             List<BizProductAccessoriesMaterial> materialCollect = bizProductAccessoriesMaterialList.stream().filter(item -> item.getCategory() == 3).collect(Collectors.toList());
             if (!materialCollect.isEmpty()) {
+                if (materialCollect.stream().anyMatch(material -> material.getHistoryMaterialCode()== null || material.getHistoryMaterialCode()== "")) {
+                    throw new RuntimeException("修改失败,原材料原始编码不能为空");
+                }
                 if (materialCollect.stream().anyMatch(material -> material.getMaterialCode() == "")) {
                     throw new RuntimeException("修改失败,原材料编码不能为空");
                 }
@@ -823,7 +830,7 @@ public class BizProductAccessoriesMaterialController extends BaseController
 
                 boolean hasDuplicate = materialCodeMap.values().stream()
                         .anyMatch(list -> list.size() > 1 &&
-                                list.stream().map(BizProductAccessoriesMaterial::getId).distinct().count() > 1);
+                                list.stream().map(BizProductAccessoriesMaterial::getHistoryAccessoriesCode).distinct().count() > 1);
 
                 if (hasDuplicate) {
                     throw new RuntimeException("修改失败,原材料编码不能重复");
@@ -838,20 +845,20 @@ public class BizProductAccessoriesMaterialController extends BaseController
                         for (BizProductAccessoriesMaterial material : materialCollect) {
                             for (BizMaterialBase materials : bizMaterialList) {
                                 if (Objects.equals(material.getMaterialCode(), materials.getMaterial()) &&
-                                        !Objects.equals(material.getId(), materials.getId())) {
+                                        !Objects.equals(material.getHistoryMaterialCode(), materials.getMaterialCode())) {
                                     // 如果找到匹配的项,则抛出错误
                                     throw new RuntimeException("修改失败,原材料编码不能重复");
                                 }
                             }
                         }
                     }
-                    List<BizMaterialBase> materialList = bizMaterialBaseService.query().in("id", materialCollect.stream()
-                            .map(BizProductAccessoriesMaterial::getId)
+                    List<BizMaterialBase> materialList = bizMaterialBaseService.query().in("material_code", materialCollect.stream()
+                            .map(BizProductAccessoriesMaterial::getHistoryMaterialCode)
                             .collect(Collectors.toList())).list();
                     for (BizProductAccessoriesMaterial material : materialCollect) {
-                        BizMaterialBase bizMaterialBase  = materialList.stream().filter(item->item.getId().equals(material.getId())).findFirst().orElse(null);
+                        BizMaterialBase bizMaterialBase  = materialList.stream().filter(item->item.getMaterialCode().equals(material.getHistoryMaterialCode())).findFirst().orElse(null);
                         if (bizMaterialBase == null) {
-                            throw new RuntimeException("修改失败,原材料id不存在");
+                            throw new RuntimeException("修改失败,原材料编码不存在");
                         }
 
                         if (material.getMaterialCode() != null) {

+ 140 - 0
src/main/java/cn/ezhizao/project/business/domain/BizMeasurement.java

@@ -0,0 +1,140 @@
+package cn.ezhizao.project.business.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
+import cn.ezhizao.framework.web.domain.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 计量单位对象 biz_measurement
+ *
+ * @author ezhizao
+ * @date 2025-04-23
+ */
+@Data
+@TableName(value = "biz_measurement")
+public class BizMeasurement extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编码 */
+    @Excel(name = "编码")
+    @ApiModelProperty(value = "目标编码")
+    private String code;
+    @TableField(exist = false)
+    @ApiModelProperty(value = "原始编码")
+    private String historyCode;
+
+    /** 换算分子
+ */
+    @Excel(name = "换算分子 ")
+    @ApiModelProperty(value = "换算分子 ")
+    private Long numerator;
+
+    /** 换算分母
+ */
+    @Excel(name = "换算分母 ")
+    @ApiModelProperty(value = "换算分母 ")
+    private String denominator;
+
+    /** 名称
+ */
+    @Excel(name = "名称 ")
+    @ApiModelProperty(value = "名称 ")
+    private String name;
+
+    /** 描述
+ */
+    @Excel(name = "描述 ")
+    @ApiModelProperty(value = "描述 ")
+    private String remake;
+
+    /** 所属组别
+ */
+    @TableField("`group`")
+    @ApiModelProperty(value = "所属组别 ")
+    private String group;
+
+    /** 基准计量单位
+ */
+    @Excel(name = "基准计量单位 ")
+    @ApiModelProperty(value = "基准计量单位 ")
+    private String standard;
+
+    /** 换算类型
+ */
+    @Excel(name = "换算类型 ")
+    @ApiModelProperty(value = "换算类型 ")
+    private String conversionType;
+
+    /** 精度 */
+    @TableField("`precision`")
+    @Excel(name = "精度")
+    @ApiModelProperty(value = "精度")
+    private Long precision;
+
+    /** 舍入类型 */
+    @Excel(name = "舍入类型")
+    @ApiModelProperty(value = "舍入类型")
+    private String roundingType;
+
+    /** 数据状态 */
+    @Excel(name = "数据状态")
+    @ApiModelProperty(value = "数据状态")
+    private String status;
+
+    /** 禁用状态 */
+    @Excel(name = "禁用状态")
+    @ApiModelProperty(value = "禁用状态")
+    private String forbidden;
+
+    /** 创建日期 */
+    @Excel(name = "创建日期")
+    @ApiModelProperty(value = "创建日期")
+    private String createName;
+
+    /** 修改日期 */
+    @Excel(name = "修改日期")
+    @ApiModelProperty(value = "修改日期")
+    private String updateName;
+
+    /** 审核人 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审核人", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "审核日期")
+    private Date auditTime;
+
+    /** 审核日期 */
+    @Excel(name = "审核日期")
+    @ApiModelProperty(value = "审核人")
+    private String auditName;
+
+    /** 禁用人 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "禁用时间")
+    private Date forbiddenTime;
+
+    /** 禁用日期 */
+    @ApiModelProperty(value = "禁用人")
+    private String forbiddenName;
+
+    /** 系统预置 */
+    @Excel(name = "系统预置")
+    @ApiModelProperty(value = "系统预置")
+    private String init;
+    @TableField(exist = false)
+    private List<String> codes;
+    @TableField(exist = false)
+    private Long tenantId;
+    @TableField(exist = false)
+    private Long updaterId;
+    @TableField(exist = false)
+    private Long creatorId;
+
+}

+ 9 - 4
src/main/java/cn/ezhizao/project/business/domain/BizProductAccessoriesMaterial.java

@@ -31,8 +31,10 @@ public class BizProductAccessoriesMaterial extends BaseEntity
 
     /** 料号 */
     @Excel(name = "料号")
-    @ApiModelProperty(value = "料号")
+    @ApiModelProperty(value = "目标料号")
     private String productCode;
+    @ApiModelProperty(value = "原始料号")
+    private String historyProductCode;
 
     /** 预入仓库 */
     @Excel(name = "预入仓库")
@@ -116,8 +118,10 @@ public class BizProductAccessoriesMaterial extends BaseEntity
 
     /** 材质编码 */
     @Excel(name = "材质编码")
-    @ApiModelProperty(value = "材质编码")
+    @ApiModelProperty(value = "目标材质编码")
     private String materialCode;
+    @ApiModelProperty(value = "原始材质编码")
+    private String historyMaterialCode;
 
     /** 密度 */
     @Excel(name = "密度")
@@ -191,9 +195,10 @@ public class BizProductAccessoriesMaterial extends BaseEntity
     //辅料
     /** 辅料编号 */
     @Excel(name = "辅料编号")
-    @ApiModelProperty(value = "辅料编号")
+    @ApiModelProperty(value = "目标辅料编号")
     private String accessoriesCode;
-
+    @ApiModelProperty(value = "原始辅料编号")
+    private String historyAccessoriesCode;
     /** 账号 */
     @Excel(name = "账号")
     @ApiModelProperty(value = "账号")

+ 29 - 0
src/main/java/cn/ezhizao/project/business/mapper/BizMeasurementMapper.java

@@ -0,0 +1,29 @@
+package cn.ezhizao.project.business.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import cn.ezhizao.project.business.domain.BizMeasurement;
+
+/**
+ * 计量单位Mapper接口
+ *
+ * @author ezhizao
+ * @date 2025-04-23
+ */
+public interface BizMeasurementMapper extends BaseMapper<BizMeasurement>
+{
+    /**
+     * 查询计量单位列表
+     *
+     * @param bizMeasurement 计量单位
+     * @return 计量单位集合
+     */
+    public List<BizMeasurement> getList(BizMeasurement bizMeasurement);
+
+    /**
+     * 物理删除
+     * @param bizMeasurement
+     * @return 删除结果
+    */
+    public int physicalDelete(BizMeasurement bizMeasurement);
+}

+ 30 - 0
src/main/java/cn/ezhizao/project/business/service/IBizMeasurementService.java

@@ -0,0 +1,30 @@
+package cn.ezhizao.project.business.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import cn.ezhizao.project.business.domain.BizMeasurement;
+
+/**
+ * 计量单位Service接口
+ *
+ * @author ezhizao
+ * @date 2025-04-23
+ */
+public interface IBizMeasurementService extends IService<BizMeasurement>
+{
+    /**
+     * 查询计量单位列表
+     *
+     * @param bizMeasurement 计量单位
+     * @return 计量单位集合
+     */
+    public List<BizMeasurement> getList(BizMeasurement bizMeasurement);
+
+    /**
+     * 物理删除
+     * @param bizMeasurement
+     * @return 删除结果
+     */
+    public int physicalDelete(BizMeasurement bizMeasurement);
+
+}

+ 43 - 0
src/main/java/cn/ezhizao/project/business/service/impl/BizMeasurementServiceImpl.java

@@ -0,0 +1,43 @@
+package cn.ezhizao.project.business.service.impl;
+
+import java.util.List;
+import javax.annotation.Resource;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import cn.ezhizao.project.business.mapper.BizMeasurementMapper;
+import cn.ezhizao.project.business.domain.BizMeasurement;
+import cn.ezhizao.project.business.service.IBizMeasurementService;
+
+/**
+ * 计量单位Service业务层处理
+ *
+ * @author ezhizao
+ * @date 2025-04-23
+ */
+@Service
+public class BizMeasurementServiceImpl  extends ServiceImpl<BizMeasurementMapper, BizMeasurement> implements IBizMeasurementService
+{
+    @Resource
+    private BizMeasurementMapper bizMeasurementMapper;
+
+    /**
+     * 查询计量单位列表
+     *
+     * @param bizMeasurement 计量单位
+     * @return 计量单位
+     */
+    @Override
+    public List<BizMeasurement> getList(BizMeasurement bizMeasurement)
+    {
+        return bizMeasurementMapper.getList(bizMeasurement);
+    }
+
+    /**
+     * 物理删除
+     * @param bizMeasurement
+     * @return 删除结果
+     */
+    @Override
+    public int physicalDelete(BizMeasurement bizMeasurement){ return bizMeasurementMapper.physicalDelete(bizMeasurement); };
+
+}

+ 47 - 0
src/main/resources/mybatis/business/BizMeasurementMapper.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.ezhizao.project.business.mapper.BizMeasurementMapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.BizMeasurement" id="BizMeasurementResult">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="BizMeasurement" resultMap="BizMeasurementResult">
+        SELECT * FROM biz_measurement
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            deleted = 0
+            <if test="code != null "> AND code = #{code}</if>
+            <if test="numerator != null "> AND numerator = #{numerator}</if>
+            <if test="denominator != null  and denominator != ''"> AND denominator = #{denominator}</if>
+            <if test="name != null  and name != ''"> AND name like concat('%', #{name}, '%')</if>
+            <if test="remake != null  and remake != ''"> AND remake = #{remake}</if>
+            <if test="group != null  and group != ''"> AND group = #{group}</if>
+            <if test="standard != null  and standard != ''"> AND standard = #{standard}</if>
+            <if test="conversionType != null  and conversionType != ''"> AND conversion_type = #{conversionType}</if>
+            <if test="precision != null "> AND precision = #{precision}</if>
+            <if test="roundingType != null  and roundingType != ''"> AND rounding_type = #{roundingType}</if>
+            <if test="status != null  and status != ''"> AND status = #{status}</if>
+            <if test="forbidden != null  and forbidden != ''"> AND forbidden = #{forbidden}</if>
+            <if test="createName != null  and createName != ''"> AND create_name like concat('%', #{createName}, '%')</if>
+            <if test="updateName != null  and updateName != ''"> AND update_name like concat('%', #{updateName}, '%')</if>
+            <if test="auditTime != null "> AND audit_time = #{auditTime}</if>
+            <if test="auditName != null  and auditName != ''"> AND audit_name like concat('%', #{auditName}, '%')</if>
+            <if test="forbiddenTime != null "> AND forbidden_time = #{forbiddenTime}</if>
+            <if test="forbiddenName != null  and forbiddenName != ''"> AND forbidden_name like concat('%', #{forbiddenName}, '%')</if>
+            <if test="init != null  and init != ''"> AND init = #{init}</if>
+        </trim>
+    </select>
+
+    <delete id="physicalDelete">
+        DELETE FROM biz_measurement
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="id != null">
+                id = #{id} AND
+            </if>
+       <!-- 删除条件为其他外键可以在这里加 -->
+        </trim>
+    </delete>
+</mapper>