From 7c21dfe8e1c57d5de35a87b73a20954af505071a Mon Sep 17 00:00:00 2001 From: caixiang <939387484@qq.com> Date: Fri, 13 Jan 2023 11:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=AE=9A=20=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cnbm/generator/build/CodeGenerator.java | 2 +- .../code/controller/UnitController.java | 10 ++++----- .../com/cnbm/generator/code/dto/UnitDTO.java | 22 +++++++++---------- .../com/cnbm/generator/code/entity/Unit.java | 22 +++++++++---------- .../cnbm/generator/code/excel/UnitExcel.java | 22 +++++++++---------- .../generator/code/mapper/UnitMapper.java | 2 +- .../cnbm/generator/code/mapper/UnitMapper.xml | 16 ++++++++++++++ .../generator/code/service/IUnitService.java | 2 +- .../code/service/impl/UnitServiceImpl.java | 2 +- .../com/cnbm/influx/config/InfluxClient.java | 2 +- 10 files changed, 58 insertions(+), 44 deletions(-) diff --git a/ym-generator/src/main/java/com/cnbm/generator/build/CodeGenerator.java b/ym-generator/src/main/java/com/cnbm/generator/build/CodeGenerator.java index 070557f..2aff475 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/build/CodeGenerator.java +++ b/ym-generator/src/main/java/com/cnbm/generator/build/CodeGenerator.java @@ -19,7 +19,7 @@ public class CodeGenerator { @Test public void test(){ - mybatisPlusGenerator(new String[]{"inspection_sheet"}); + mybatisPlusGenerator(new String[]{"unit"}); } public static void mybatisPlusGenerator(String[] include){ diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/controller/UnitController.java b/ym-generator/src/main/java/com/cnbm/generator/code/controller/UnitController.java index a617f93..0d2ce35 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/controller/UnitController.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/controller/UnitController.java @@ -31,7 +31,7 @@ import java.util.Map; * 单位 表 前端控制器 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @RestController @RequestMapping("/code/unit") @@ -68,26 +68,26 @@ public class UnitController { @ApiOperation("保存") @LogOperation("保存") @PreAuthorize("@ex.hasAuthority('code:unit:save')") - public Result save(@RequestBody UnitDTO dto){ + public Result save(@RequestBody UnitDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); unitService.save(dto); - return new Result(); + return new Result().ok(dto.getId()); } @PutMapping @ApiOperation("修改") @LogOperation("修改") @PreAuthorize("@ex.hasAuthority('code:unit:update')") - public Result update(@RequestBody UnitDTO dto){ + public Result update(@RequestBody UnitDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); unitService.update(dto); - return new Result(); + return new Result().ok(dto.getId()); } @DeleteMapping diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/dto/UnitDTO.java b/ym-generator/src/main/java/com/cnbm/generator/code/dto/UnitDTO.java index 73789dd..fc702ef 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/dto/UnitDTO.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/dto/UnitDTO.java @@ -14,7 +14,7 @@ import java.math.BigDecimal; * 单位 表 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @Data @ApiModel(value = "单位 表DTO对象") @@ -23,8 +23,8 @@ public class UnitDTO implements Serializable { - @ApiModelProperty(value = "ID") - private BigDecimal id; + @ApiModelProperty(value = "") + private Long id; @ApiModelProperty(value = "单位 名") private String name; @@ -33,19 +33,19 @@ public class UnitDTO implements Serializable { private String code; @ApiModelProperty(value = "单位类型,1 可计数,2 不可计数") - private BigDecimal type; + private Integer type; @ApiModelProperty(value = "1 可用,0 不可用") - private BigDecimal status; + private Integer status; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用") - private BigDecimal valid; + private Integer valid; - @ApiModelProperty(value = "创建人") - private BigDecimal creatorId; + @ApiModelProperty(value = "") + private Long creatorId; @ApiModelProperty(value = "创建人姓名") private String creatorName; @@ -53,8 +53,8 @@ public class UnitDTO implements Serializable { @ApiModelProperty(value = "创建时间") private LocalDateTime createTime; - @ApiModelProperty(value = "更新人") - private BigDecimal updaterId; + @ApiModelProperty(value = "") + private Long updaterId; @ApiModelProperty(value = "更新人姓名") private String updaterName; @@ -63,6 +63,6 @@ public class UnitDTO implements Serializable { private LocalDateTime updateTime; @ApiModelProperty(value = "版本号") - private BigDecimal version; + private Integer version; } \ No newline at end of file diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/entity/Unit.java b/ym-generator/src/main/java/com/cnbm/generator/code/entity/Unit.java index 17f9f8d..7e3663e 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/entity/Unit.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/entity/Unit.java @@ -1,7 +1,7 @@ package com.cnbm.generator.code.entity; +import com.baomidou.mybatisplus.annotation.TableLogic; import java.io.Serializable; -import java.math.BigDecimal; import java.time.LocalDateTime; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -13,7 +13,7 @@ import lombok.Data; *

* * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @Data @ApiModel(value = "Unit对象", description = "单位 表") @@ -21,8 +21,7 @@ public class Unit implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty("ID") - private BigDecimal id; + private Long id; @ApiModelProperty("单位 名") private String name; @@ -31,19 +30,19 @@ public class Unit implements Serializable { private String code; @ApiModelProperty("单位类型,1 可计数,2 不可计数") - private BigDecimal type; + private Integer type; @ApiModelProperty("1 可用,0 不可用") - private BigDecimal status; + private Integer status; @ApiModelProperty("备注") private String remark; @ApiModelProperty("删除标志,是否有效:1 可用 0不可用") - private BigDecimal valid; + @TableLogic + private Integer valid; - @ApiModelProperty("创建人") - private BigDecimal creatorId; + private Long creatorId; @ApiModelProperty("创建人姓名") private String creatorName; @@ -51,8 +50,7 @@ public class Unit implements Serializable { @ApiModelProperty("创建时间") private LocalDateTime createTime; - @ApiModelProperty("更新人") - private BigDecimal updaterId; + private Long updaterId; @ApiModelProperty("更新人姓名") private String updaterName; @@ -61,7 +59,7 @@ public class Unit implements Serializable { private LocalDateTime updateTime; @ApiModelProperty("版本号") - private BigDecimal version; + private Integer version; } diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/excel/UnitExcel.java b/ym-generator/src/main/java/com/cnbm/generator/code/excel/UnitExcel.java index 0772fea..8c7596a 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/excel/UnitExcel.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/excel/UnitExcel.java @@ -12,37 +12,37 @@ import java.util.Date; * 单位 表 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @Data public class UnitExcel { - @Excel(name = "ID") - private BigDecimal id; + @Excel(name = "") + private Long id; @Excel(name = "单位 名") private String name; @Excel(name = "单位 编码") private String code; @Excel(name = "单位类型,1 可计数,2 不可计数") - private BigDecimal type; + private Integer type; @Excel(name = "1 可用,0 不可用") - private BigDecimal status; + private Integer status; @Excel(name = "备注") private String remark; @Excel(name = "删除标志,是否有效:1 可用 0不可用") - private BigDecimal valid; - @Excel(name = "创建人") - private BigDecimal creatorId; + private Integer valid; + @Excel(name = "") + private Long creatorId; @Excel(name = "创建人姓名") private String creatorName; @Excel(name = "创建时间") private LocalDateTime createTime; - @Excel(name = "更新人") - private BigDecimal updaterId; + @Excel(name = "") + private Long updaterId; @Excel(name = "更新人姓名") private String updaterName; @Excel(name = "更新时间") private LocalDateTime updateTime; @Excel(name = "版本号") - private BigDecimal version; + private Integer version; } \ No newline at end of file diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.java b/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.java index f4fa7cd..841862c 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.java @@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper; * 单位 表 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @Mapper public interface UnitMapper extends BaseDao { diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.xml b/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.xml index 42c18b6..90705bd 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.xml +++ b/ym-generator/src/main/java/com/cnbm/generator/code/mapper/UnitMapper.xml @@ -1,5 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/service/IUnitService.java b/ym-generator/src/main/java/com/cnbm/generator/code/service/IUnitService.java index bc12537..6a10408 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/service/IUnitService.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/service/IUnitService.java @@ -8,7 +8,7 @@ import com.cnbm.generator.code.entity.Unit; * 单位 表 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ public interface IUnitService extends CrudService { diff --git a/ym-generator/src/main/java/com/cnbm/generator/code/service/impl/UnitServiceImpl.java b/ym-generator/src/main/java/com/cnbm/generator/code/service/impl/UnitServiceImpl.java index 05263d4..87f9aa1 100644 --- a/ym-generator/src/main/java/com/cnbm/generator/code/service/impl/UnitServiceImpl.java +++ b/ym-generator/src/main/java/com/cnbm/generator/code/service/impl/UnitServiceImpl.java @@ -15,7 +15,7 @@ import java.util.Map; * 单位 表 * * @author why - * @since 2022-06-30 + * @since 2023-01-12 */ @Service public class UnitServiceImpl extends CrudServiceImpl implements IUnitService { diff --git a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java index ed74b69..662c45b 100644 --- a/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java +++ b/ym-influx/src/main/java/com/cnbm/influx/config/InfluxClient.java @@ -120,7 +120,7 @@ public enum InfluxClient { }else { point = Point.measurement(measurement) .addTag("transationId", event.getTransationId()==null ? "" : event.getTransationId()) - .addTag("inspectionSheetId", event.getInspectionSheetId()) + .addTag("inspectionSheetId", event.getInspectionSheetId()==null ? "" : event.getInspectionSheetId()) // .addTag("batchNum", event.getBatchNum()) .addTag("sampleNumber", event.getSampleNumber())