guoyujia 1 kuukausi sitten
vanhempi
commit
5a37624270

+ 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));
+    }
+}

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

@@ -53,22 +53,22 @@ public class BizProductAccessoriesMaterialController extends BaseController
     @Resource
     private IBizMaterialBaseService bizMaterialBaseService;
     public static final String PAGE_SIZE = "pageSize";
-    @ApiOperation("获取物料详细")
+//    @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);
@@ -84,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){
@@ -95,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){
@@ -106,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
@@ -162,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("新增失败,产品编码不能为空");
                 }
                 //判断产品编码是否有重复
@@ -177,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) {
@@ -226,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("新增失败,辅料编码不能为空");
                 }
                 //判断辅料编码是否有重复
@@ -286,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("新增失败,材料编码不能为空");
                 }
                 //判断原材料编码是否有重复
@@ -517,7 +517,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.getHistoryProductCode()== null)) {
+                if (productCollect.stream().anyMatch(material -> material.getHistoryProductCode()== null || material.getHistoryProductCode()== "")) {
                     throw new RuntimeException("修改失败,产品原始编码不能为空");
                 }
                 if (productCollect.stream().anyMatch(material -> material.getProductCode()== "")) {
@@ -530,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("修改失败,产品编码不能重复");
@@ -546,7 +546,7 @@ 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("修改失败,产品编码不能重复");
                                 }
@@ -674,7 +674,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.getHistoryAccessoriesCode()== null)) {
+                if (accessoriesCollect.stream().anyMatch(material -> material.getHistoryAccessoriesCode()== null || material.getHistoryAccessoriesCode()== "")) {
                     throw new RuntimeException("修改失败,辅料原始编码不能为空");
                 }
                 if (accessoriesCollect.stream().anyMatch(material -> material.getAccessoriesCode() == "")) {
@@ -687,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("修改失败,辅料编码不能重复");
@@ -702,7 +702,7 @@ 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("修改失败,辅料编码不能重复");
                                 }
@@ -817,7 +817,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.getHistoryMaterialCode()== null)) {
+                if (materialCollect.stream().anyMatch(material -> material.getHistoryMaterialCode()== null || material.getHistoryMaterialCode()== "")) {
                     throw new RuntimeException("修改失败,原材料原始编码不能为空");
                 }
                 if (materialCollect.stream().anyMatch(material -> material.getMaterialCode() == "")) {
@@ -830,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("修改失败,原材料编码不能重复");
@@ -845,7 +845,7 @@ 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("修改失败,原材料编码不能重复");
                                 }

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

@@ -0,0 +1,142 @@
+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")
+    @Excel(name = "禁用人", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "禁用人")
+    private Date forbiddenTime;
+
+    /** 禁用日期 */
+    @Excel(name = "禁用日期")
+    @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;
+
+}

+ 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>