Merge branch 'master' of http://git.picaiba.com/CaiXiang/SPC into yanyang

This commit is contained in:
闫阳 2022-12-09 09:08:12 +08:00
commit c9d01c9e11
38 changed files with 1706 additions and 11 deletions

View File

@ -0,0 +1,116 @@
package com.cnbm.generator.code.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
import com.cnbm.common.utils.Result;
import com.cnbm.common.validator.AssertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.generator.code.dto.ProductFeaturesDTO;
import com.cnbm.generator.code.excel.ProductFeaturesExcel;
import com.cnbm.generator.code.service.IProductFeaturesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 产品特性 前端控制器
*
* @author why
* @since 2022-08-23
*/
@RestController
@RequestMapping("/code/productFeatures")
@Api(tags="产品特性 表")
public class ProductFeaturesController {
@Autowired
private IProductFeaturesService productFeaturesService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('code:productFeatures:page')")
public Result<PageData<ProductFeaturesDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<ProductFeaturesDTO> page = productFeaturesService.page(params);
return new Result<PageData<ProductFeaturesDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("@ex.hasAuthority('code:productFeatures:info')")
public Result<ProductFeaturesDTO> get(@PathVariable("id") Long id){
ProductFeaturesDTO data = productFeaturesService.get(id);
return new Result<ProductFeaturesDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("@ex.hasAuthority('code:productFeatures:save')")
public Result<Long> save(@RequestBody ProductFeaturesDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
productFeaturesService.save(dto);
return new Result<Long>().ok(dto.getId());
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("@ex.hasAuthority('code:productFeatures:update')")
public Result<Long> update(@RequestBody ProductFeaturesDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
productFeaturesService.update(dto);
return new Result<Long>().ok(dto.getId());
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("@ex.hasAuthority('code:productFeatures:delete')")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
productFeaturesService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@PreAuthorize("@ex.hasAuthority('code:productFeatures:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ProductFeaturesDTO> list = productFeaturesService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProductFeaturesExcel.class);
}
}

View File

@ -0,0 +1,116 @@
package com.cnbm.generator.code.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
import com.cnbm.common.utils.Result;
import com.cnbm.common.validator.AssertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.generator.code.dto.ProductTypeDTO;
import com.cnbm.generator.code.excel.ProductTypeExcel;
import com.cnbm.generator.code.service.IProductTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 产品类型 前端控制器
*
* @author why
* @since 2022-08-23
*/
@RestController
@RequestMapping("/code/productType")
@Api(tags="产品类型 表")
public class ProductTypeController {
@Autowired
private IProductTypeService productTypeService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('code:productType:page')")
public Result<PageData<ProductTypeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<ProductTypeDTO> page = productTypeService.page(params);
return new Result<PageData<ProductTypeDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("@ex.hasAuthority('code:productType:info')")
public Result<ProductTypeDTO> get(@PathVariable("id") Long id){
ProductTypeDTO data = productTypeService.get(id);
return new Result<ProductTypeDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("@ex.hasAuthority('code:productType:save')")
public Result<Long> save(@RequestBody ProductTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
productTypeService.save(dto);
return new Result<Long>().ok(dto.getId());
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("@ex.hasAuthority('code:productType:update')")
public Result<Long> update(@RequestBody ProductTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
productTypeService.update(dto);
return new Result<Long>().ok(dto.getId());
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("@ex.hasAuthority('code:productType:delete')")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
productTypeService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@PreAuthorize("@ex.hasAuthority('code:productType:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ProductTypeDTO> list = productTypeService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProductTypeExcel.class);
}
}

View File

@ -0,0 +1,116 @@
package com.cnbm.generator.code.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
import com.cnbm.common.utils.Result;
import com.cnbm.common.validator.AssertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.generator.code.dto.UnitDTO;
import com.cnbm.generator.code.excel.UnitExcel;
import com.cnbm.generator.code.service.IUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 单位 前端控制器
*
* @author why
* @since 2022-06-30
*/
@RestController
@RequestMapping("/code/unit")
@Api(tags="单位 表")
public class UnitController {
@Autowired
private IUnitService unitService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('code:unit:page')")
public Result<PageData<UnitDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<UnitDTO> page = unitService.page(params);
return new Result<PageData<UnitDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("@ex.hasAuthority('code:unit:info')")
public Result<UnitDTO> get(@PathVariable("id") Long id){
UnitDTO data = unitService.get(id);
return new Result<UnitDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("@ex.hasAuthority('code:unit:save')")
public Result save(@RequestBody UnitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
unitService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("@ex.hasAuthority('code:unit:update')")
public Result update(@RequestBody UnitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
unitService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("@ex.hasAuthority('code:unit:delete')")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
unitService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@PreAuthorize("@ex.hasAuthority('code:unit:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UnitDTO> list = unitService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UnitExcel.class);
}
}

View File

@ -0,0 +1,116 @@
package com.cnbm.generator.code.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
import com.cnbm.common.utils.Result;
import com.cnbm.common.validator.AssertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.generator.code.dto.UserDTO;
import com.cnbm.generator.code.excel.UserExcel;
import com.cnbm.generator.code.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 系统用户 前端控制器
*
* @author why
* @since 2022-08-23
*/
@RestController
@RequestMapping("/code/user")
@Api(tags="系统用户")
public class UserController {
@Autowired
private IUserService userService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('code:user:page')")
public Result<PageData<UserDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<UserDTO> page = userService.page(params);
return new Result<PageData<UserDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@PreAuthorize("@ex.hasAuthority('code:user:info')")
public Result<UserDTO> get(@PathVariable("id") Long id){
UserDTO data = userService.get(id);
return new Result<UserDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@PreAuthorize("@ex.hasAuthority('code:user:save')")
public Result<Long> save(@RequestBody UserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userService.save(dto);
return new Result<Long>().ok(dto.getId());
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@PreAuthorize("@ex.hasAuthority('code:user:update')")
public Result<Long> update(@RequestBody UserDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userService.update(dto);
return new Result<Long>().ok(dto.getId());
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@PreAuthorize("@ex.hasAuthority('code:user:delete')")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@PreAuthorize("@ex.hasAuthority('code:user:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserDTO> list = userService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserExcel.class);
}
}

View File

@ -0,0 +1,113 @@
package com.cnbm.generator.code.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.math.BigDecimal;
/**
* 产品特性
*
* @author why
* @since 2022-08-23
*/
@Data
@ApiModel(value = "产品特性 表DTO对象")
public class ProductFeaturesDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "")
private Long productId;
@ApiModelProperty(value = "")
private Long measureToolId;
@ApiModelProperty(value = "")
private Long unitId;
@ApiModelProperty(value = "产品特性 名")
private String name;
@ApiModelProperty(value = "产品特性 编码")
private String code;
@ApiModelProperty(value = "产品特性类型1 计量型2 计数型")
private Integer type;
@ApiModelProperty(value = "缺陷等级1 致命缺陷2 严重缺陷3.轻微缺陷")
private Integer defectLevel;
@ApiModelProperty(value = "产品特性 规格")
private String specifications;
@ApiModelProperty(value = "检验参数 规格下线")
private Float lsl;
@ApiModelProperty(value = "检验参数 规格中心线")
private Float sl;
@ApiModelProperty(value = "检验参数 规格上线")
private Float usl;
@ApiModelProperty(value = "")
private Long workingProcedureId;
@ApiModelProperty(value = "")
private Long controlGraphId;
@ApiModelProperty(value = "是否需要spc分析1 yes;0 no")
private Integer isSpc;
@ApiModelProperty(value = "样本大小一般2-25之间。 会依据这个size 把所有待分析的数据 组成一个一个样本")
private Integer sampleSize;
@ApiModelProperty(value = "采样频率,只用于展示")
private String samplingFrequency;
@ApiModelProperty(value = "小数位数(限制 检验参数小数点后面位数),这个先放着后续再说。")
private Integer decimalPlaces;
@ApiModelProperty(value = "目标cpk")
private Float targetCpk;
@ApiModelProperty(value = "目标cpk")
private Float targetPpk;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@ApiModelProperty(value = "")
private Long creatorId;
@ApiModelProperty(value = "创建人姓名")
private String creatorName;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "")
private Long updaterId;
@ApiModelProperty(value = "更新人姓名")
private String updaterName;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "版本号")
private Integer version;
}

View File

@ -0,0 +1,68 @@
package com.cnbm.generator.code.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.math.BigDecimal;
/**
* 产品类型
*
* @author why
* @since 2022-08-23
*/
@Data
@ApiModel(value = "产品类型 表DTO对象")
public class ProductTypeDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "产品类型 名")
private String name;
@ApiModelProperty(value = "产品类型 编码")
private String code;
@ApiModelProperty(value = "描述")
private String descs;
@ApiModelProperty(value = "1 可用0 不可用")
private Integer status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@ApiModelProperty(value = "")
private Long creatorId;
@ApiModelProperty(value = "创建人姓名")
private String creatorName;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "")
private Long updaterId;
@ApiModelProperty(value = "更新人姓名")
private String updaterName;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "版本号")
private Integer version;
}

View File

@ -0,0 +1,68 @@
package com.cnbm.generator.code.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.math.BigDecimal;
/**
* 单位
*
* @author why
* @since 2022-06-30
*/
@Data
@ApiModel(value = "单位 表DTO对象")
public class UnitDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
private BigDecimal id;
@ApiModelProperty(value = "单位 名")
private String name;
@ApiModelProperty(value = "单位 编码")
private String code;
@ApiModelProperty(value = "单位类型1 可计数2 不可计数")
private BigDecimal type;
@ApiModelProperty(value = "1 可用0 不可用")
private BigDecimal status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid;
@ApiModelProperty(value = "创建人")
private BigDecimal creatorId;
@ApiModelProperty(value = "创建人姓名")
private String creatorName;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "更新人")
private BigDecimal updaterId;
@ApiModelProperty(value = "更新人姓名")
private String updaterName;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "版本号")
private BigDecimal version;
}

View File

@ -0,0 +1,71 @@
package com.cnbm.generator.code.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.math.BigDecimal;
/**
* 系统用户
*
* @author why
* @since 2022-08-23
*/
@Data
@ApiModel(value = "系统用户DTO对象")
public class UserDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "姓名")
private String realName;
@ApiModelProperty(value = "头像")
private String headUrl;
@ApiModelProperty(value = "性别 0男 1女 2保密")
private Integer gender;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "超级管理员 0否 1")
private Integer superAdmin;
@ApiModelProperty(value = "状态 0停用 1正常")
private Integer status;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createDate;
@ApiModelProperty(value = "更新者")
private Long updater;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateDate;
}

View File

@ -0,0 +1,105 @@
package com.cnbm.generator.code.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 产品特性
* </p>
*
* @author why
* @since 2022-08-23
*/
@Data
@TableName("product_features")
@ApiModel(value = "ProductFeatures对象", description = "产品特性 表")
public class ProductFeatures implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Long productId;
private Long measureToolId;
private Long unitId;
@ApiModelProperty("产品特性 名")
private String name;
@ApiModelProperty("产品特性 编码")
private String code;
@ApiModelProperty("产品特性类型1 计量型2 计数型")
private Integer type;
@ApiModelProperty("缺陷等级1 致命缺陷2 严重缺陷3.轻微缺陷")
private Integer defectLevel;
@ApiModelProperty("产品特性 规格")
private String specifications;
@ApiModelProperty("检验参数 规格下线")
private Float lsl;
@ApiModelProperty("检验参数 规格中心线")
private Float sl;
@ApiModelProperty("检验参数 规格上线")
private Float usl;
private Long workingProcedureId;
private Long controlGraphId;
@ApiModelProperty("是否需要spc分析1 yes;0 no")
private Integer isSpc;
@ApiModelProperty("样本大小一般2-25之间。 会依据这个size 把所有待分析的数据 组成一个一个样本")
private Integer sampleSize;
@ApiModelProperty("采样频率,只用于展示")
private String samplingFrequency;
@ApiModelProperty("小数位数(限制 检验参数小数点后面位数),这个先放着后续再说。")
private Integer decimalPlaces;
@ApiModelProperty("目标cpk")
private Float targetCpk;
@ApiModelProperty("目标cpk")
private Float targetPpk;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
private Integer valid;
private Long creatorId;
@ApiModelProperty("创建人姓名")
private String creatorName;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
private Long updaterId;
@ApiModelProperty("更新人姓名")
private String updaterName;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
@ApiModelProperty("版本号")
private Integer version;
}

View File

@ -0,0 +1,67 @@
package com.cnbm.generator.code.entity;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 产品类型
* </p>
*
* @author why
* @since 2022-08-23
*/
@Data
@TableName("product_type")
@ApiModel(value = "ProductType对象", description = "产品类型 表")
public class ProductType implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
@ApiModelProperty("产品类型 名")
private String name;
@ApiModelProperty("产品类型 编码")
private String code;
@ApiModelProperty("描述")
private String descs;
@ApiModelProperty("1 可用0 不可用")
private Integer status;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
@TableLogic
private Integer valid;
private Long creatorId;
@ApiModelProperty("创建人姓名")
private String creatorName;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
private Long updaterId;
@ApiModelProperty("更新人姓名")
private String updaterName;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
@ApiModelProperty("版本号")
private Integer version;
}

View File

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

View File

@ -0,0 +1,71 @@
package com.cnbm.generator.code.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 系统用户
* </p>
*
* @author why
* @since 2022-08-23
*/
@Data
@TableName("sys_user")
@ApiModel(value = "User对象", description = "系统用户")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("姓名")
private String realName;
@ApiModelProperty("头像")
private String headUrl;
@ApiModelProperty("性别 0男 1女 2保密")
private Integer gender;
@ApiModelProperty("邮箱")
private String email;
@ApiModelProperty("手机号")
private String mobile;
@ApiModelProperty("部门ID")
private Long deptId;
@ApiModelProperty("超级管理员 0否 1")
private Integer superAdmin;
@ApiModelProperty("状态 0停用 1正常")
private Integer status;
@ApiModelProperty("创建者")
private Long creator;
@ApiModelProperty("创建时间")
private LocalDateTime createDate;
@ApiModelProperty("更新者")
private Long updater;
@ApiModelProperty("更新时间")
private LocalDateTime updateDate;
}

View File

@ -0,0 +1,78 @@
package com.cnbm.generator.code.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.Date;
/**
* 产品特性
*
* @author why
* @since 2022-08-23
*/
@Data
public class ProductFeaturesExcel {
@Excel(name = "")
private Long id;
@Excel(name = "")
private Long productId;
@Excel(name = "")
private Long measureToolId;
@Excel(name = "")
private Long unitId;
@Excel(name = "产品特性 名")
private String name;
@Excel(name = "产品特性 编码")
private String code;
@Excel(name = "产品特性类型1 计量型2 计数型")
private Integer type;
@Excel(name = "缺陷等级1 致命缺陷2 严重缺陷3.轻微缺陷")
private Integer defectLevel;
@Excel(name = "产品特性 规格")
private String specifications;
@Excel(name = "检验参数 规格下线")
private Float lsl;
@Excel(name = "检验参数 规格中心线")
private Float sl;
@Excel(name = "检验参数 规格上线")
private Float usl;
@Excel(name = "")
private Long workingProcedureId;
@Excel(name = "")
private Long controlGraphId;
@Excel(name = "是否需要spc分析1 yes;0 no")
private Integer isSpc;
@Excel(name = "样本大小一般2-25之间。 会依据这个size 把所有待分析的数据 组成一个一个样本")
private Integer sampleSize;
@Excel(name = "采样频率,只用于展示")
private String samplingFrequency;
@Excel(name = "小数位数(限制 检验参数小数点后面位数),这个先放着后续再说。")
private Integer decimalPlaces;
@Excel(name = "目标cpk")
private Float targetCpk;
@Excel(name = "目标cpk")
private Float targetPpk;
@Excel(name = "备注")
private String remark;
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@Excel(name = "")
private Long creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "创建时间")
private LocalDateTime createTime;
@Excel(name = "")
private Long updaterId;
@Excel(name = "更新人姓名")
private String updaterName;
@Excel(name = "更新时间")
private LocalDateTime updateTime;
@Excel(name = "版本号")
private Integer version;
}

View File

@ -0,0 +1,48 @@
package com.cnbm.generator.code.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.Date;
/**
* 产品类型
*
* @author why
* @since 2022-08-23
*/
@Data
public class ProductTypeExcel {
@Excel(name = "")
private Long id;
@Excel(name = "产品类型 名")
private String name;
@Excel(name = "产品类型 编码")
private String code;
@Excel(name = "描述")
private String descs;
@Excel(name = "1 可用0 不可用")
private Integer status;
@Excel(name = "备注")
private String remark;
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
private Integer valid;
@Excel(name = "")
private Long creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "创建时间")
private LocalDateTime createTime;
@Excel(name = "")
private Long updaterId;
@Excel(name = "更新人姓名")
private String updaterName;
@Excel(name = "更新时间")
private LocalDateTime updateTime;
@Excel(name = "版本号")
private Integer version;
}

View File

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

View File

@ -0,0 +1,50 @@
package com.cnbm.generator.code.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.util.Date;
/**
* 系统用户
*
* @author why
* @since 2022-08-23
*/
@Data
public class UserExcel {
@Excel(name = "id")
private Long id;
@Excel(name = "用户名")
private String username;
@Excel(name = "密码")
private String password;
@Excel(name = "姓名")
private String realName;
@Excel(name = "头像")
private String headUrl;
@Excel(name = "性别 0男 1女 2保密")
private Integer gender;
@Excel(name = "邮箱")
private String email;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "部门ID")
private Long deptId;
@Excel(name = "超级管理员 0否 1")
private Integer superAdmin;
@Excel(name = "状态 0停用 1正常")
private Integer status;
@Excel(name = "创建者")
private Long creator;
@Excel(name = "创建时间")
private LocalDateTime createDate;
@Excel(name = "更新者")
private Long updater;
@Excel(name = "更新时间")
private LocalDateTime updateDate;
}

View File

@ -0,0 +1,16 @@
package com.cnbm.generator.code.mapper;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.generator.code.entity.ProductFeatures;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品特性
*
* @author why
* @since 2022-08-23
*/
@Mapper
public interface ProductFeaturesMapper extends BaseDao<ProductFeatures> {
}

View File

@ -0,0 +1,36 @@
<?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="com.cnbm.generator.code.mapper.ProductFeaturesMapper">
<resultMap type="com.cnbm.generator.code.entity.ProductFeatures" id="ProductFeaturesMap">
<id column="id" property="id" />
<id column="product_id" property="productId" />
<id column="measure_tool_id" property="measureToolId" />
<id column="unit_id" property="unitId" />
<id column="name" property="name" />
<id column="code" property="code" />
<id column="type" property="type" />
<id column="defect_level" property="defectLevel" />
<id column="specifications" property="specifications" />
<id column="lsl" property="lsl" />
<id column="sl" property="sl" />
<id column="usl" property="usl" />
<id column="working_procedure_id" property="workingProcedureId" />
<id column="control_graph_id" property="controlGraphId" />
<id column="is_spc" property="isSpc" />
<id column="sample_size" property="sampleSize" />
<id column="sampling_frequency" property="samplingFrequency" />
<id column="decimal_places" property="decimalPlaces" />
<id column="target_cpk" property="targetCpk" />
<id column="target_ppk" property="targetPpk" />
<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>

View File

@ -0,0 +1,16 @@
package com.cnbm.generator.code.mapper;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.generator.code.entity.ProductType;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品类型
*
* @author why
* @since 2022-08-23
*/
@Mapper
public interface ProductTypeMapper extends BaseDao<ProductType> {
}

View File

@ -0,0 +1,21 @@
<?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="com.cnbm.generator.code.mapper.ProductTypeMapper">
<resultMap type="com.cnbm.generator.code.entity.ProductType" id="ProductTypeMap">
<id column="id" property="id" />
<id column="name" property="name" />
<id column="code" property="code" />
<id column="descs" property="descs" />
<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>

View File

@ -0,0 +1,16 @@
package com.cnbm.generator.code.mapper;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.generator.code.entity.Unit;
import org.apache.ibatis.annotations.Mapper;
/**
* 单位
*
* @author why
* @since 2022-06-30
*/
@Mapper
public interface UnitMapper extends BaseDao<Unit> {
}

View File

@ -0,0 +1,5 @@
<?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="com.cnbm.generator.code.mapper.UnitMapper">
</mapper>

View File

@ -0,0 +1,16 @@
package com.cnbm.generator.code.mapper;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.generator.code.entity.User;
import org.apache.ibatis.annotations.Mapper;
/**
* 系统用户
*
* @author why
* @since 2022-08-23
*/
@Mapper
public interface UserMapper extends BaseDao<User> {
}

View File

@ -0,0 +1,22 @@
<?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="com.cnbm.generator.code.mapper.UserMapper">
<resultMap type="com.cnbm.generator.code.entity.User" id="UserMap">
<id column="id" property="id" />
<id column="username" property="username" />
<id column="password" property="password" />
<id column="real_name" property="realName" />
<id column="head_url" property="headUrl" />
<id column="gender" property="gender" />
<id column="email" property="email" />
<id column="mobile" property="mobile" />
<id column="dept_id" property="deptId" />
<id column="super_admin" property="superAdmin" />
<id column="status" property="status" />
<id column="creator" property="creator" />
<id column="create_date" property="createDate" />
<id column="updater" property="updater" />
<id column="update_date" property="updateDate" />
</resultMap>
</mapper>

View File

@ -0,0 +1,7 @@
-- 菜单初始SQL
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1561967925485420546, 1067246875800000035, '产品类型 表', 'code/productType', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967925485420547, 1561967925485420546, '查看', NULL, 'code:productType:page,code:productType:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967925485420548, 1561967925485420546, '新增', NULL, 'code:productType:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967925485420549, 1561967925485420546, '修改', NULL, 'code:productType:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967925485420550, 1561967925485420546, '删除', NULL, 'code:productType:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967925485420551, 1561967925485420546, '导出', NULL, 'code:productType:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());

View File

@ -0,0 +1,7 @@
-- 菜单初始SQL
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1561967818685841409, 1067246875800000035, '系统用户', 'code/user', NULL, 0, 'icon-desktop', 0, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967818685841410, 1561967818685841409, '查看', NULL, 'code:user:page,code:user:info', 1, NULL, 0, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967818685841411, 1561967818685841409, '新增', NULL, 'code:user:save', 1, NULL, 1, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967818685841412, 1561967818685841409, '修改', NULL, 'code:user:update', 1, NULL, 2, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967818685841413, 1561967818685841409, '删除', NULL, 'code:user:delete', 1, NULL, 3, 1067246875800000001, now(), 1067246875800000001, now());
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date) VALUES (1561967818685841414, 1561967818685841409, '导出', NULL, 'code:user:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());

View File

@ -0,0 +1,15 @@
package com.cnbm.generator.code.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.generator.code.dto.ProductFeaturesDTO;
import com.cnbm.generator.code.entity.ProductFeatures;
/**
* 产品特性
*
* @author why
* @since 2022-08-23
*/
public interface IProductFeaturesService extends CrudService<ProductFeatures, ProductFeaturesDTO> {
}

View File

@ -0,0 +1,15 @@
package com.cnbm.generator.code.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.generator.code.dto.ProductTypeDTO;
import com.cnbm.generator.code.entity.ProductType;
/**
* 产品类型
*
* @author why
* @since 2022-08-23
*/
public interface IProductTypeService extends CrudService<ProductType, ProductTypeDTO> {
}

View File

@ -0,0 +1,15 @@
package com.cnbm.generator.code.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.generator.code.dto.UnitDTO;
import com.cnbm.generator.code.entity.Unit;
/**
* 单位
*
* @author why
* @since 2022-06-30
*/
public interface IUnitService extends CrudService<Unit, UnitDTO> {
}

View File

@ -0,0 +1,15 @@
package com.cnbm.generator.code.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.generator.code.dto.UserDTO;
import com.cnbm.generator.code.entity.User;
/**
* 系统用户
*
* @author why
* @since 2022-08-23
*/
public interface IUserService extends CrudService<User, UserDTO> {
}

View File

@ -0,0 +1,34 @@
package com.cnbm.generator.code.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.generator.code.dto.ProductFeaturesDTO;
import com.cnbm.generator.code.mapper.ProductFeaturesMapper;
import com.cnbm.generator.code.entity.ProductFeatures;
import com.cnbm.generator.code.service.IProductFeaturesService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 产品特性
*
* @author why
* @since 2022-08-23
*/
@Service
public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesMapper, ProductFeatures, ProductFeaturesDTO> implements IProductFeaturesService {
@Override
public QueryWrapper<ProductFeatures> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<ProductFeatures> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}

View File

@ -0,0 +1,34 @@
package com.cnbm.generator.code.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.generator.code.dto.ProductTypeDTO;
import com.cnbm.generator.code.mapper.ProductTypeMapper;
import com.cnbm.generator.code.entity.ProductType;
import com.cnbm.generator.code.service.IProductTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 产品类型
*
* @author why
* @since 2022-08-23
*/
@Service
public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, ProductType, ProductTypeDTO> implements IProductTypeService {
@Override
public QueryWrapper<ProductType> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<ProductType> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}

View File

@ -0,0 +1,34 @@
package com.cnbm.generator.code.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.generator.code.dto.UnitDTO;
import com.cnbm.generator.code.mapper.UnitMapper;
import com.cnbm.generator.code.entity.Unit;
import com.cnbm.generator.code.service.IUnitService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 单位
*
* @author why
* @since 2022-06-30
*/
@Service
public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO> implements IUnitService {
@Override
public QueryWrapper<Unit> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<Unit> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}

View File

@ -0,0 +1,34 @@
package com.cnbm.generator.code.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.generator.code.dto.UserDTO;
import com.cnbm.generator.code.mapper.UserMapper;
import com.cnbm.generator.code.entity.User;
import com.cnbm.generator.code.service.IUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 系统用户
*
* @author why
* @since 2022-08-23
*/
@Service
public class UserServiceImpl extends CrudServiceImpl<UserMapper, User, UserDTO> implements IUserService {
@Override
public QueryWrapper<User> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<User> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}

View File

@ -84,7 +84,7 @@ public enum InfluxClient {
public void insert(Event event, String measurement){ public void insert(Event event, String measurement){
Point point = null; Point point = null;
if(event.getBatchNum()==null){ if(event.getSampleNumber()==null){
point = Point.measurement(measurement) point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId()) .addTag("transationId", event.getTransationId())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
@ -96,7 +96,6 @@ public enum InfluxClient {
.addTag("inspectionSheetId", event.getInspectionSheetId()) .addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("sampleNumber", event.getSampleNumber()) .addTag("sampleNumber", event.getSampleNumber())
.addTag("batchNum", event.getBatchNum())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue()) .addField("argValue", event.getArgValue())
@ -115,7 +114,7 @@ public enum InfluxClient {
List<Point> list = new ArrayList<>(); List<Point> list = new ArrayList<>();
for(Event event:events){ for(Event event:events){
Point point = null; Point point = null;
if(event.getBatchNum()==null){ if(event.getSampleNumber()==null){
point = Point.measurement(measurement) point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId()) .addTag("transationId", event.getTransationId())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
@ -128,7 +127,7 @@ public enum InfluxClient {
// .addTag("batchNum", event.getBatchNum()) // .addTag("batchNum", event.getBatchNum())
.addTag("sampleNumber", event.getSampleNumber()) .addTag("sampleNumber", event.getSampleNumber())
.addField("batchNum", event.getBatchNum()) //.addField("batchNum", event.getBatchNum())
.addTag("argName", event.getArgName()) .addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue()) .addField("argValue", event.getArgValue())

View File

@ -52,7 +52,7 @@ public class Main {
event.setTime(new Date().toInstant()); event.setTime(new Date().toInstant());
event.setTransationId("2344"); event.setTransationId("2344");
event.setBatchNum("22");
event.setArgName("forUpdate"); event.setArgName("forUpdate");
event.setArgValue("124.1"); event.setArgValue("124.1");
InfluxClient.Client.insert(event,"FORUPDATE"); InfluxClient.Client.insert(event,"FORUPDATE");

View File

@ -2,6 +2,7 @@ package com.cnbm.influx.controller;
import com.cnbm.common.spc.util.DataUtils; import com.cnbm.common.spc.util.DataUtils;
import com.cnbm.influx.config.InfluxClient; import com.cnbm.influx.config.InfluxClient;
import com.cnbm.influx.constant.Constant;
import com.cnbm.influx.param.PageInfo; import com.cnbm.influx.param.PageInfo;
import com.cnbm.influx.param.QueryDataParam; import com.cnbm.influx.param.QueryDataParam;
import com.cnbm.influx.param.Range; import com.cnbm.influx.param.Range;
@ -61,22 +62,41 @@ public class S7DemoController {
Instant time = new Date().toInstant(); Instant time = new Date().toInstant();
Event event = new Event(); Event event = new Event();
event.setTime(time); event.setTime(time);
event.setTransationId("asas123");
event.setArgName("failDayDay"); event.setArgName("failDayDay");
event.setArgValue("1"); event.setArgValue("1");
event.setSampleNumber("10001");
list.add(event); list.add(event);
Thread.sleep(1000); Thread.sleep(1000);
Event event2 = new Event(); Event event2 = new Event();
event2.setTime(time); event2.setTime(time);
event2.setTransationId("asas456");
event2.setArgName("failDayDay"); event2.setArgName("failDayDay");
event2.setArgValue("2"); event2.setArgValue("2");
event2.setSampleNumber("10001");
list.add(event2); list.add(event2);
InfluxClient.Client.batchInsert(list,"Weight"); InfluxClient.Client.batchInsert(list,"Weight");
} }
@PostMapping("/readDemoOne")
public void readDemoOne() throws InterruptedException {
List<String> dropNames = new ArrayList<>();
dropNames.add("transationId");
dropNames.add("inspectionSheetId");
dropNames.add("batchNum");
QueryDataParam queryDataParam = new QueryDataParam();
queryDataParam.setMeasurement(Constant.measurement);
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
queryDataParam.setDropedTagNames(dropNames);
queryDataParam.setTag(new Tag("argName","failDayDay"));
queryDataParam.setBucket(Constant.bucket);
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
System.out.println();
}
//for 常规计数型 //for 常规计数型
@ -93,7 +113,7 @@ public class S7DemoController {
event.setArgName("LTWeight"); event.setArgName("LTWeight");
Double d = r.nextDouble() * 2.5 + 66; Double d = r.nextDouble() * 2.5 + 66;
event.setArgValue(d.toString()); event.setArgValue(d.toString());
event.setBatchNum(4+"");
event.setInspectionSheetId(i+""); event.setInspectionSheetId(i+"");
list.add(event); list.add(event);
} }

View File

@ -23,8 +23,8 @@ public class Event {
private String argValue; private String argValue;
//batchNumber必填 作为区分 手动录入 自动录入的区别 //batchNum 舍弃了influxdb中不存批次号存在mysql - inspection_sheet表 中批次号字段
private String batchNum; //private String batchNum;
private String inspectionSheetId; private String inspectionSheetId;
@ -32,7 +32,7 @@ public class Event {
public Event() { public Event() {
//自动录入给个默认值 //自动录入给个默认值
this.batchNum = "-1"; // this.batchNum = "-1";
this.inspectionSheetId = "-1"; this.inspectionSheetId = "-1";
this.sampleNumber = "-1"; this.sampleNumber = "-1";
} }