初定 第一版

This commit is contained in:
caixiang 2023-01-13 11:01:42 +08:00
parent 2bc72469a0
commit 7c21dfe8e1
10 changed files with 58 additions and 44 deletions

View File

@ -19,7 +19,7 @@ public class CodeGenerator {
@Test @Test
public void test(){ public void test(){
mybatisPlusGenerator(new String[]{"inspection_sheet"}); mybatisPlusGenerator(new String[]{"unit"});
} }
public static void mybatisPlusGenerator(String[] include){ public static void mybatisPlusGenerator(String[] include){

View File

@ -31,7 +31,7 @@ import java.util.Map;
* 单位 前端控制器 * 单位 前端控制器
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@RestController @RestController
@RequestMapping("/code/unit") @RequestMapping("/code/unit")
@ -68,26 +68,26 @@ public class UnitController {
@ApiOperation("保存") @ApiOperation("保存")
@LogOperation("保存") @LogOperation("保存")
@PreAuthorize("@ex.hasAuthority('code:unit:save')") @PreAuthorize("@ex.hasAuthority('code:unit:save')")
public Result save(@RequestBody UnitDTO dto){ public Result<Long> save(@RequestBody UnitDTO dto){
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
unitService.save(dto); unitService.save(dto);
return new Result(); return new Result<Long>().ok(dto.getId());
} }
@PutMapping @PutMapping
@ApiOperation("修改") @ApiOperation("修改")
@LogOperation("修改") @LogOperation("修改")
@PreAuthorize("@ex.hasAuthority('code:unit:update')") @PreAuthorize("@ex.hasAuthority('code:unit:update')")
public Result update(@RequestBody UnitDTO dto){ public Result<Long> update(@RequestBody UnitDTO dto){
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
unitService.update(dto); unitService.update(dto);
return new Result(); return new Result<Long>().ok(dto.getId());
} }
@DeleteMapping @DeleteMapping

View File

@ -14,7 +14,7 @@ import java.math.BigDecimal;
* 单位 * 单位
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@Data @Data
@ApiModel(value = "单位 表DTO对象") @ApiModel(value = "单位 表DTO对象")
@ -23,8 +23,8 @@ public class UnitDTO implements Serializable {
@ApiModelProperty(value = "ID") @ApiModelProperty(value = "")
private BigDecimal id; private Long id;
@ApiModelProperty(value = "单位 名") @ApiModelProperty(value = "单位 名")
private String name; private String name;
@ -33,19 +33,19 @@ public class UnitDTO implements Serializable {
private String code; private String code;
@ApiModelProperty(value = "单位类型1 可计数2 不可计数") @ApiModelProperty(value = "单位类型1 可计数2 不可计数")
private BigDecimal type; private Integer type;
@ApiModelProperty(value = "1 可用0 不可用") @ApiModelProperty(value = "1 可用0 不可用")
private BigDecimal status; private Integer status;
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用") @ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid; private Integer valid;
@ApiModelProperty(value = "创建人") @ApiModelProperty(value = "")
private BigDecimal creatorId; private Long creatorId;
@ApiModelProperty(value = "创建人姓名") @ApiModelProperty(value = "创建人姓名")
private String creatorName; private String creatorName;
@ -53,8 +53,8 @@ public class UnitDTO implements Serializable {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "更新人") @ApiModelProperty(value = "")
private BigDecimal updaterId; private Long updaterId;
@ApiModelProperty(value = "更新人姓名") @ApiModelProperty(value = "更新人姓名")
private String updaterName; private String updaterName;
@ -63,6 +63,6 @@ public class UnitDTO implements Serializable {
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty(value = "版本号") @ApiModelProperty(value = "版本号")
private BigDecimal version; private Integer version;
} }

View File

@ -1,7 +1,7 @@
package com.cnbm.generator.code.entity; package com.cnbm.generator.code.entity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -13,7 +13,7 @@ import lombok.Data;
* </p> * </p>
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@Data @Data
@ApiModel(value = "Unit对象", description = "单位 表") @ApiModel(value = "Unit对象", description = "单位 表")
@ -21,8 +21,7 @@ public class Unit implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("ID") private Long id;
private BigDecimal id;
@ApiModelProperty("单位 名") @ApiModelProperty("单位 名")
private String name; private String name;
@ -31,19 +30,19 @@ public class Unit implements Serializable {
private String code; private String code;
@ApiModelProperty("单位类型1 可计数2 不可计数") @ApiModelProperty("单位类型1 可计数2 不可计数")
private BigDecimal type; private Integer type;
@ApiModelProperty("1 可用0 不可用") @ApiModelProperty("1 可用0 不可用")
private BigDecimal status; private Integer status;
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用") @ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid; @TableLogic
private Integer valid;
@ApiModelProperty("创建人") private Long creatorId;
private BigDecimal creatorId;
@ApiModelProperty("创建人姓名") @ApiModelProperty("创建人姓名")
private String creatorName; private String creatorName;
@ -51,8 +50,7 @@ public class Unit implements Serializable {
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty("更新人") private Long updaterId;
private BigDecimal updaterId;
@ApiModelProperty("更新人姓名") @ApiModelProperty("更新人姓名")
private String updaterName; private String updaterName;
@ -61,7 +59,7 @@ public class Unit implements Serializable {
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("版本号") @ApiModelProperty("版本号")
private BigDecimal version; private Integer version;
} }

View File

@ -12,37 +12,37 @@ import java.util.Date;
* 单位 * 单位
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@Data @Data
public class UnitExcel { public class UnitExcel {
@Excel(name = "ID") @Excel(name = "")
private BigDecimal id; private Long id;
@Excel(name = "单位 名") @Excel(name = "单位 名")
private String name; private String name;
@Excel(name = "单位 编码") @Excel(name = "单位 编码")
private String code; private String code;
@Excel(name = "单位类型1 可计数2 不可计数") @Excel(name = "单位类型1 可计数2 不可计数")
private BigDecimal type; private Integer type;
@Excel(name = "1 可用0 不可用") @Excel(name = "1 可用0 不可用")
private BigDecimal status; private Integer status;
@Excel(name = "备注") @Excel(name = "备注")
private String remark; private String remark;
@Excel(name = "删除标志,是否有效:1 可用 0不可用") @Excel(name = "删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid; private Integer valid;
@Excel(name = "创建人") @Excel(name = "")
private BigDecimal creatorId; private Long creatorId;
@Excel(name = "创建人姓名") @Excel(name = "创建人姓名")
private String creatorName; private String creatorName;
@Excel(name = "创建时间") @Excel(name = "创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@Excel(name = "更新人") @Excel(name = "")
private BigDecimal updaterId; private Long updaterId;
@Excel(name = "更新人姓名") @Excel(name = "更新人姓名")
private String updaterName; private String updaterName;
@Excel(name = "更新时间") @Excel(name = "更新时间")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@Excel(name = "版本号") @Excel(name = "版本号")
private BigDecimal version; private Integer version;
} }

View File

@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
* 单位 * 单位
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@Mapper @Mapper
public interface UnitMapper extends BaseDao<Unit> { public interface UnitMapper extends BaseDao<Unit> {

View File

@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cnbm.generator.code.mapper.UnitMapper"> <mapper namespace="com.cnbm.generator.code.mapper.UnitMapper">
<resultMap type="com.cnbm.generator.code.entity.Unit" id="UnitMap">
<id column="id" property="id" />
<id column="name" property="name" />
<id column="code" property="code" />
<id column="type" property="type" />
<id column="status" property="status" />
<id column="remark" property="remark" />
<id column="valid" property="valid" />
<id column="creator_id" property="creatorId" />
<id column="creator_name" property="creatorName" />
<id column="create_time" property="createTime" />
<id column="updater_id" property="updaterId" />
<id column="updater_name" property="updaterName" />
<id column="update_time" property="updateTime" />
<id column="version" property="version" />
</resultMap>
</mapper> </mapper>

View File

@ -8,7 +8,7 @@ import com.cnbm.generator.code.entity.Unit;
* 单位 * 单位
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
public interface IUnitService extends CrudService<Unit, UnitDTO> { public interface IUnitService extends CrudService<Unit, UnitDTO> {

View File

@ -15,7 +15,7 @@ import java.util.Map;
* 单位 * 单位
* *
* @author why * @author why
* @since 2022-06-30 * @since 2023-01-12
*/ */
@Service @Service
public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO> implements IUnitService { public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO> implements IUnitService {

View File

@ -120,7 +120,7 @@ public enum InfluxClient {
}else { }else {
point = Point.measurement(measurement) point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId()==null ? "" : event.getTransationId()) .addTag("transationId", event.getTransationId()==null ? "" : event.getTransationId())
.addTag("inspectionSheetId", event.getInspectionSheetId()) .addTag("inspectionSheetId", event.getInspectionSheetId()==null ? "" : event.getInspectionSheetId())
// .addTag("batchNum", event.getBatchNum()) // .addTag("batchNum", event.getBatchNum())
.addTag("sampleNumber", event.getSampleNumber()) .addTag("sampleNumber", event.getSampleNumber())