Compare commits
56 Commits
b93869c4a1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60a46c3248 | ||
|
|
ed054a2bf2 | ||
|
|
6ebe466df1 | ||
|
|
bc685ccf45 | ||
| e4b8d773af | |||
| 32647c035c | |||
| 9546ceec03 | |||
| 3a583ac09f | |||
|
|
fced72a94f | ||
|
|
e149150b1d | ||
|
|
3d5e5e5845 | ||
|
|
5a9f5ee38b | ||
|
|
7c21dfe8e1 | ||
|
|
2bc72469a0 | ||
|
|
cafcdd65e0 | ||
| cc5848e5cd | |||
| 445c7c0c3f | |||
| 214f0a8ec9 | |||
|
|
74aaf857f0 | ||
|
|
353471b1f7 | ||
|
|
23aa6d5f89 | ||
| ea70ac4a6b | |||
| b6990dc4a0 | |||
|
|
8b14c369fb | ||
|
|
c1d37a3dbc | ||
| 5e32971f26 | |||
| 1ce177ab5d | |||
| 8b4e6b116e | |||
|
|
9b545a9a03 | ||
|
|
c75c89cab9 | ||
| 04e8cc187a | |||
| add0eea2ac | |||
|
|
69f911c07c | ||
|
|
5e8110ad2c | ||
|
|
7e3e028eb0 | ||
| 37f0dbe548 | |||
| b501e8cd98 | |||
| 98baf93cff | |||
|
|
ff63c194ee | ||
| 1173d670e4 | |||
| c7c43cd906 | |||
|
|
1798ba8d1d | ||
|
|
652812d3ba | ||
| 1562854e59 | |||
| d03a3e06a3 | |||
| c9d01c9e11 | |||
|
|
de3fe9b95c | ||
|
|
53f0c58507 | ||
| 95a82b042d | |||
| b15ad64d76 | |||
|
|
bf67380718 | ||
| 6829169a4a | |||
| 0e3f0f9168 | |||
| b515eacbab | |||
| ab35b10130 | |||
| 4864545f12 |
21
README.md
21
README.md
@@ -1,23 +1,4 @@
|
||||
**项目说明**
|
||||
- 这是根据renren框架重新修改出来的框架
|
||||
- 采用SpringBoot、MyBatis、spring security框架
|
||||
- 提供了代码生成器,只需编写30%左右代码,其余的代码交给系统自动生成,可快速完成开发任务
|
||||
- 代码生成器是用的Velocity模版引擎,如果需要可以在ym-generator模块中进行vm模板的修改和一些包名等基础修改
|
||||
<br>
|
||||
|
||||
**新增业务模块需要注意**
|
||||
- 新增业务模块时,业务模块需要依赖ym-admin,并且ym-gateway模块maven需要依赖新建模块
|
||||
- 自动生成的controller接口都带鉴权注解,如果开发阶段可以先注释掉,后面开发完成之后再把鉴权添加到数据库
|
||||
<br>
|
||||
|
||||
**技术选型:**
|
||||
- 核心框架:Spring Boot 2.7
|
||||
- 安全框架:Spring Security
|
||||
- 持久层框架:MyBatis 3.5
|
||||
- 定时器:Quartz 2.3
|
||||
- 数据库连接池:HikariCP
|
||||
- 日志管理:log4j2
|
||||
- 页面交互:Vue2.x
|
||||
spc 主项目
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
"/webjars/**",
|
||||
"/websocket/**",
|
||||
"/influx/**",
|
||||
"/spcData/**",
|
||||
|
||||
// "/basic/**",
|
||||
// "/qualityPlanning/**",
|
||||
|
||||
@@ -160,4 +160,10 @@ public class SysUserController {
|
||||
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, SysUserExcel.class);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取用户列表")
|
||||
@LogOperation("获取用户列表")
|
||||
public List<SysUserDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return sysUserService.list(params); }
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ public class LoginServiceImpl implements LoginService {
|
||||
@Override
|
||||
public Result login(HttpServletRequest request, LoginParam loginParam) {
|
||||
//验证码是否正确
|
||||
boolean flag = captchaService.validate(loginParam.getUuid(), loginParam.getCaptcha());
|
||||
if(!flag){
|
||||
return new Result<>().error(ErrorCode.CAPTCHA_ERROR, "验证码错误");
|
||||
}
|
||||
// boolean flag = captchaService.validate(loginParam.getUuid(), loginParam.getCaptcha());
|
||||
// if(!flag){
|
||||
// return new Result<>().error(ErrorCode.CAPTCHA_ERROR, "验证码错误");
|
||||
// }
|
||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(loginParam.getUsername(),loginParam.getPassword());
|
||||
Authentication authenticate = authenticationManager.authenticate(authenticationToken);
|
||||
//登录日志
|
||||
|
||||
@@ -144,4 +144,12 @@ public class MachineController {
|
||||
return new Result().ok(true);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取机台列表")
|
||||
@LogOperation("获取机台列表")
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
public List<MachineDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return machineService.list(params);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,4 +129,11 @@ public class ProductController {
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取产品列表")
|
||||
@LogOperation("获取产品列表")
|
||||
public List<ProductDTO> list() {
|
||||
return productService.list();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,7 @@ package com.cnbm.basic.controller;
|
||||
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.admin.params.IdParam;
|
||||
import com.cnbm.basic.dto.FeaturesProcedureDTO;
|
||||
import com.cnbm.basic.dto.FeaturesStageProcedureRelationDTO;
|
||||
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||
import com.cnbm.basic.dto.*;
|
||||
import com.cnbm.basic.entity.ProductFeatures;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
@@ -15,7 +13,6 @@ 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.basic.dto.ProductFeaturesDTO;
|
||||
import com.cnbm.basic.excel.ProductFeaturesExcel;
|
||||
import com.cnbm.basic.service.IProductFeaturesService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -162,4 +159,17 @@ public class ProductFeaturesController {
|
||||
return new Result<List<ProductFeaturesDTO>>().ok(list);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取特性列表")
|
||||
@LogOperation("获取特性列表")
|
||||
public List<ProductFeaturesDTO> list() {
|
||||
return productFeaturesService.list();
|
||||
}
|
||||
|
||||
@PostMapping("getProductFeaturesByType")
|
||||
@ApiOperation("根据特性类型 获取特性列表 计量型1 计数型2")
|
||||
public List<ProductFeaturesDTO> getProductFeaturesByType(Integer type){
|
||||
return productFeaturesService.getProductFeaturesByType(type);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -114,4 +114,11 @@ public class ShiftController {
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, ShiftExcel.class);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取班次列表")
|
||||
@LogOperation("获取班次列表")
|
||||
public List<ShiftDTO> list() {
|
||||
return shiftService.list();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cnbm.basic.controller;
|
||||
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.basic.dto.ShiftDTO;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.utils.ExcelUtils;
|
||||
@@ -114,4 +115,9 @@ public class TeamController {
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, TeamExcel.class);
|
||||
}
|
||||
|
||||
@PostMapping(value = "list")
|
||||
@ApiOperation(value = "获取班组列表")
|
||||
@LogOperation("获取班组列表")
|
||||
public List<TeamDTO> list() { return teamService.list(); }
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cnbm.basic.controller;
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.admin.params.IdParam;
|
||||
import com.cnbm.basic.dto.UnitDTO;
|
||||
import com.cnbm.basic.dto.WorkingProcedureTypeDTO;
|
||||
import com.cnbm.basic.entity.WorkingProcedure;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.utils.ExcelUtils;
|
||||
@@ -141,4 +143,15 @@ public class WorkingProcedureController {
|
||||
return workingProcedureService.list();
|
||||
}
|
||||
|
||||
@PostMapping(value = "listByType/{typeId}")
|
||||
@ApiOperation(value = "根据工序类型 获取工序列表")
|
||||
public List<WorkingProcedure> listByType(@PathVariable("typeId") Long typeId) {
|
||||
return workingProcedureService.listByType(typeId);
|
||||
}
|
||||
|
||||
@PostMapping(value = "listWithType")
|
||||
@ApiOperation(value = "工序类型及对应工序列表")
|
||||
public List<WorkingProcedureTypeDTO> listWithType () {
|
||||
return workingProcedureService.listWithType();
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ public class ProductFeaturesDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
@@ -113,4 +112,10 @@ public class ProductFeaturesDTO implements Serializable {
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "工序id,关联 working_procedure 表")
|
||||
private Long workingProcedureId;
|
||||
|
||||
@ApiModelProperty(value = "工序 名,关联working_procedure表")
|
||||
private String workingProcedureName;
|
||||
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.cnbm.basic.dto;
|
||||
|
||||
import com.cnbm.basic.entity.WorkingProcedure;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工序类型表 表
|
||||
@@ -59,4 +61,7 @@ public class WorkingProcedureTypeDTO implements Serializable {
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@ApiModelProperty(value = "工序列表")
|
||||
private List<WorkingProcedure> workingProcedureList;
|
||||
|
||||
}
|
||||
@@ -25,4 +25,8 @@ public interface ProductFeaturesMapper extends BaseDao<ProductFeatures> {
|
||||
List<ProductFeaturesDTO> getFeaturesList(Map<String, Object> params);
|
||||
|
||||
String getControlGraphNameById(Long id);
|
||||
|
||||
List<ProductFeaturesDTO> list();
|
||||
|
||||
List<ProductFeaturesDTO> getProductFeaturesByType(Integer type);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.cnbm.basic.entity.Product;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -18,4 +19,5 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface ProductMapper extends BaseDao<Product> {
|
||||
// IPage<ProductDTO> page(Map<String, Object> params);
|
||||
List<ProductDTO> list();
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.cnbm.basic.mapper;
|
||||
|
||||
import com.cnbm.basic.dto.ShiftDTO;
|
||||
import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.basic.entity.Shift;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 班次 表
|
||||
*
|
||||
@@ -12,5 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShiftMapper extends BaseDao<Shift> {
|
||||
|
||||
|
||||
List<ShiftDTO> list();
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.cnbm.basic.mapper;
|
||||
|
||||
import com.cnbm.basic.dto.TeamDTO;
|
||||
import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.basic.entity.Team;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 班组 表
|
||||
*
|
||||
@@ -12,5 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface TeamMapper extends BaseDao<Team> {
|
||||
|
||||
|
||||
List<TeamDTO> list();
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.cnbm.basic.mapper;
|
||||
|
||||
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||
import com.cnbm.basic.dto.WorkingProcedureTypeDTO;
|
||||
import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.basic.entity.WorkingProcedureType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工序类型表 表
|
||||
*
|
||||
@@ -12,5 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
*/
|
||||
@Mapper
|
||||
public interface WorkingProcedureTypeMapper extends BaseDao<WorkingProcedureType> {
|
||||
|
||||
|
||||
List<WorkingProcedureTypeDTO> list();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cnbm.basic.service;
|
||||
|
||||
import com.cnbm.basic.dto.FactoryDTO;
|
||||
import com.cnbm.basic.dto.FeaturesProcedureDTO;
|
||||
import com.cnbm.basic.dto.FeaturesStageProcedureRelationDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
@@ -34,4 +35,8 @@ public interface IProductFeaturesService extends CrudService<ProductFeatures, Pr
|
||||
void batchUpdate(ProductFeaturesDTO[] lists);
|
||||
|
||||
List<ProductFeaturesDTO> getFeaturesList(Map<String, Object> params);
|
||||
|
||||
List<ProductFeaturesDTO> list();
|
||||
|
||||
List<ProductFeaturesDTO> getProductFeaturesByType(Integer type);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.cnbm.basic.dto.ProductDTO;
|
||||
import com.cnbm.basic.entity.Product;
|
||||
import com.cnbm.common.vo.IdVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -27,4 +28,6 @@ public interface IProductService extends CrudService<Product, ProductDTO> {
|
||||
|
||||
boolean changeStatus(Long id);
|
||||
|
||||
List<ProductDTO> list();
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.basic.dto.ShiftDTO;
|
||||
import com.cnbm.basic.entity.Shift;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -23,4 +24,6 @@ public interface IShiftService extends CrudService<Shift, ShiftDTO> {
|
||||
void update(ShiftDTO dto);
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<ShiftDTO> list();
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.basic.dto.TeamDTO;
|
||||
import com.cnbm.basic.entity.Team;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -23,4 +24,6 @@ public interface ITeamService extends CrudService<Team, TeamDTO> {
|
||||
void update(TeamDTO dto);
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<TeamDTO> list();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cnbm.basic.service;
|
||||
|
||||
import com.cnbm.basic.dto.WorkingProcedureTypeDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||
@@ -30,4 +31,8 @@ public interface IWorkingProcedureService extends CrudService<WorkingProcedure,
|
||||
List<WorkingProcedureDTO> getWorkingProcedureByProductId(Long productId);
|
||||
|
||||
List<WorkingProcedureDTO> list();
|
||||
|
||||
List<WorkingProcedure> listByType(Long typeId);
|
||||
|
||||
List<WorkingProcedureTypeDTO> listWithType();
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.MachineDTO;
|
||||
import com.cnbm.basic.dto.ProductTypeDTO;
|
||||
import com.cnbm.basic.entity.ProductType;
|
||||
@@ -67,6 +68,7 @@ public class FactoryServiceImpl extends CrudServiceImpl<FactoryMapper, Factory,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(FactoryDTO dto) {
|
||||
Factory entity = ConvertUtils.sourceToTarget(dto, Factory.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -74,6 +76,7 @@ public class FactoryServiceImpl extends CrudServiceImpl<FactoryMapper, Factory,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(FactoryDTO dto) {
|
||||
Factory entity = ConvertUtils.sourceToTarget(dto, Factory.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.ProductFeaturesDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
@@ -64,6 +65,7 @@ public class FeaturesStageProcedureRelationServiceImpl extends CrudServiceImpl<F
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(FeaturesStageProcedureRelationDTO dto) {
|
||||
FeaturesStageProcedureRelation entity = ConvertUtils.sourceToTarget(dto, FeaturesStageProcedureRelation.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -71,6 +73,7 @@ public class FeaturesStageProcedureRelationServiceImpl extends CrudServiceImpl<F
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(FeaturesStageProcedureRelationDTO dto) {
|
||||
FeaturesStageProcedureRelation entity = ConvertUtils.sourceToTarget(dto, FeaturesStageProcedureRelation.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -86,6 +89,7 @@ public class FeaturesStageProcedureRelationServiceImpl extends CrudServiceImpl<F
|
||||
public void batchInsert(FeaturesStageProcedureRelationDTO[] lists) {
|
||||
for(FeaturesStageProcedureRelationDTO dto:lists){
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
BaseSupportUtils.setCommonField(dto);
|
||||
save(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.entity.Platform;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
@@ -95,6 +96,7 @@ public class MachineServiceImpl extends CrudServiceImpl<MachineMapper, Machine,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(MachineDTO dto) {
|
||||
Machine entity = ConvertUtils.sourceToTarget(dto, Machine.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -102,6 +104,7 @@ public class MachineServiceImpl extends CrudServiceImpl<MachineMapper, Machine,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MachineDTO dto) {
|
||||
Machine entity = ConvertUtils.sourceToTarget(dto, Machine.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.MeasureToolDTO;
|
||||
@@ -61,6 +62,7 @@ public class MeasureToolServiceImpl extends CrudServiceImpl<MeasureToolMapper, M
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(MeasureToolDTO dto) {
|
||||
MeasureTool entity = ConvertUtils.sourceToTarget(dto, MeasureTool.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -68,6 +70,7 @@ public class MeasureToolServiceImpl extends CrudServiceImpl<MeasureToolMapper, M
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MeasureToolDTO dto) {
|
||||
MeasureTool entity = ConvertUtils.sourceToTarget(dto, MeasureTool.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.FactoryDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
@@ -64,6 +65,7 @@ private PlatformMapper mapper;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(PlatformDTO dto) {
|
||||
Platform entity = ConvertUtils.sourceToTarget(dto, Platform.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -71,6 +73,7 @@ private PlatformMapper mapper;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(PlatformDTO dto) {
|
||||
Platform entity = ConvertUtils.sourceToTarget(dto, Platform.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
@@ -58,6 +59,7 @@ public class ProductFactoryRelationServiceImpl extends CrudServiceImpl<ProductFa
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ProductFactoryRelationDTO dto) {
|
||||
ProductFactoryRelation entity = ConvertUtils.sourceToTarget(dto, ProductFactoryRelation.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -65,6 +67,7 @@ public class ProductFactoryRelationServiceImpl extends CrudServiceImpl<ProductFa
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductFactoryRelationDTO dto) {
|
||||
ProductFactoryRelation entity = ConvertUtils.sourceToTarget(dto, ProductFactoryRelation.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -80,6 +83,7 @@ public class ProductFactoryRelationServiceImpl extends CrudServiceImpl<ProductFa
|
||||
public void batchInsertFactory(ProductFactoryRelationDTO[] lists) {
|
||||
for(ProductFactoryRelationDTO dto:lists){
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
BaseSupportUtils.setCommonField(dto);
|
||||
save(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.ProductFeaturesHisDTO;
|
||||
@@ -55,6 +56,7 @@ public class ProductFeaturesHisServiceImpl extends CrudServiceImpl<ProductFeatur
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ProductFeaturesHisDTO dto) {
|
||||
ProductFeaturesHis entity = ConvertUtils.sourceToTarget(dto, ProductFeaturesHis.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -62,6 +64,7 @@ public class ProductFeaturesHisServiceImpl extends CrudServiceImpl<ProductFeatur
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductFeaturesHisDTO dto) {
|
||||
ProductFeaturesHis entity = ConvertUtils.sourceToTarget(dto, ProductFeaturesHis.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.params.IdParam;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.*;
|
||||
import com.cnbm.basic.entity.ProductFeaturesHis;
|
||||
import com.cnbm.basic.entity.ProductWorkingprocedureRelation;
|
||||
@@ -64,7 +65,9 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesM
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ProductFeaturesDTO dto) {
|
||||
|
||||
ProductFeatures entity = ConvertUtils.sourceToTarget(dto, ProductFeatures.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -92,6 +95,7 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesM
|
||||
productFeaturesHisServiceImpl.save(history);
|
||||
//更新
|
||||
ProductFeatures entity = ConvertUtils.sourceToTarget(dto, ProductFeatures.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
|
||||
}
|
||||
@@ -145,6 +149,7 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesM
|
||||
for(ProductFeaturesDTO dto:lists){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
BaseSupportUtils.setUpdateCommonField(dto);
|
||||
update(dto);
|
||||
}
|
||||
}
|
||||
@@ -154,4 +159,19 @@ public class ProductFeaturesServiceImpl extends CrudServiceImpl<ProductFeaturesM
|
||||
List<ProductFeaturesDTO> list = mapper.getFeaturesList(params);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ProductFeaturesDTO> list() {
|
||||
List<ProductFeaturesDTO> list = mapper.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ProductFeaturesDTO> getProductFeaturesByType(Integer type) {
|
||||
List<ProductFeaturesDTO> listByType = mapper.getProductFeaturesByType(type);
|
||||
return listByType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.entity.ProductType;
|
||||
import com.cnbm.basic.mapper.ProductFactoryRelationMapper;
|
||||
import com.cnbm.common.page.PageData;
|
||||
@@ -96,6 +97,7 @@ public class ProductServiceImpl extends CrudServiceImpl<ProductMapper, Product,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo add(ProductDTO dto) {
|
||||
Product entity = ConvertUtils.sourceToTarget(dto, Product.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
//返回新增产品id
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
@@ -105,6 +107,7 @@ public class ProductServiceImpl extends CrudServiceImpl<ProductMapper, Product,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductDTO dto) {
|
||||
Product entity = ConvertUtils.sourceToTarget(dto, Product.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -125,4 +128,11 @@ public class ProductServiceImpl extends CrudServiceImpl<ProductMapper, Product,
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ProductDTO> list() {
|
||||
List<ProductDTO> list = mapper.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cnbm.admin.dto.SysDictDataDTO;
|
||||
import com.cnbm.admin.entity.SysDictDataEntity;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.FactoryDTO;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
@@ -68,6 +69,7 @@ public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, P
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ProductTypeDTO dto) {
|
||||
ProductType entity = ConvertUtils.sourceToTarget(dto, ProductType.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -75,6 +77,7 @@ public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, P
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductTypeDTO dto) {
|
||||
ProductType entity = ConvertUtils.sourceToTarget(dto, ProductType.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.ProductFeaturesDTO;
|
||||
import com.cnbm.basic.dto.SequenceDTO;
|
||||
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||
@@ -85,6 +86,7 @@ public class ProductWorkingprocedureRelationServiceImpl extends CrudServiceImpl<
|
||||
Integer lastSequence = lastDto.getSequence();
|
||||
entity.setSequence(lastSequence + 1);
|
||||
}
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
else{
|
||||
@@ -96,6 +98,7 @@ public class ProductWorkingprocedureRelationServiceImpl extends CrudServiceImpl<
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductWorkingprocedureRelationDTO dto) {
|
||||
ProductWorkingprocedureRelation entity = ConvertUtils.sourceToTarget(dto, ProductWorkingprocedureRelation.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -143,6 +146,7 @@ public class ProductWorkingprocedureRelationServiceImpl extends CrudServiceImpl<
|
||||
public void batchInsertWorkingprocedure(ProductWorkingprocedureRelationDTO[] lists) {
|
||||
for(ProductWorkingprocedureRelationDTO dto:lists){
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
BaseSupportUtils.setCommonField(dto);
|
||||
save(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.ShiftDTO;
|
||||
@@ -10,10 +11,12 @@ import com.cnbm.basic.entity.Shift;
|
||||
import com.cnbm.basic.service.IShiftService;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -25,6 +28,9 @@ import java.util.Map;
|
||||
@Service
|
||||
public class ShiftServiceImpl extends CrudServiceImpl<ShiftMapper, Shift, ShiftDTO> implements IShiftService {
|
||||
|
||||
@Autowired
|
||||
private ShiftMapper mapper;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Shift> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
@@ -55,6 +61,7 @@ public class ShiftServiceImpl extends CrudServiceImpl<ShiftMapper, Shift, ShiftD
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(ShiftDTO dto) {
|
||||
Shift entity = ConvertUtils.sourceToTarget(dto, Shift.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -62,6 +69,7 @@ public class ShiftServiceImpl extends CrudServiceImpl<ShiftMapper, Shift, ShiftD
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ShiftDTO dto) {
|
||||
Shift entity = ConvertUtils.sourceToTarget(dto, Shift.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -72,4 +80,11 @@ public class ShiftServiceImpl extends CrudServiceImpl<ShiftMapper, Shift, ShiftD
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<ShiftDTO> list() {
|
||||
List<ShiftDTO> list = mapper.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,8 +2,7 @@ package com.cnbm.basic.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.cnbm.basic.dto.ProductTypeDTO;
|
||||
import com.cnbm.basic.entity.ProductType;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.TeamDTO;
|
||||
@@ -12,11 +11,13 @@ import com.cnbm.basic.entity.Team;
|
||||
import com.cnbm.basic.service.ITeamService;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -28,6 +29,9 @@ import java.util.Map;
|
||||
@Service
|
||||
public class TeamServiceImpl extends CrudServiceImpl<TeamMapper, Team, TeamDTO> implements ITeamService {
|
||||
|
||||
@Autowired
|
||||
private TeamMapper mapper;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<Team> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
@@ -57,6 +61,7 @@ public class TeamServiceImpl extends CrudServiceImpl<TeamMapper, Team, TeamDTO>
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(TeamDTO dto) {
|
||||
Team entity = ConvertUtils.sourceToTarget(dto, Team.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -64,6 +69,7 @@ public class TeamServiceImpl extends CrudServiceImpl<TeamMapper, Team, TeamDTO>
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TeamDTO dto) {
|
||||
Team entity = ConvertUtils.sourceToTarget(dto, Team.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -74,4 +80,11 @@ public class TeamServiceImpl extends CrudServiceImpl<TeamMapper, Team, TeamDTO>
|
||||
deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<TeamDTO> list() {
|
||||
List<TeamDTO> list = mapper.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.FactoryDTO;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
@@ -64,6 +65,7 @@ public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO>
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(UnitDTO dto) {
|
||||
Unit entity = ConvertUtils.sourceToTarget(dto, Unit.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -71,6 +73,7 @@ public class UnitServiceImpl extends CrudServiceImpl<UnitMapper, Unit, UnitDTO>
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(UnitDTO dto) {
|
||||
Unit entity = ConvertUtils.sourceToTarget(dto, Unit.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,15 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.basic.dto.UnitDTO;
|
||||
import com.cnbm.basic.dto.WorkingProcedureTypeDTO;
|
||||
import com.cnbm.basic.entity.Machine;
|
||||
import com.cnbm.basic.entity.ProductWorkingprocedureRelation;
|
||||
import com.cnbm.basic.entity.WorkingProcedureType;
|
||||
import com.cnbm.basic.mapper.ProductWorkingprocedureRelationMapper;
|
||||
import com.cnbm.basic.mapper.UnitMapper;
|
||||
import com.cnbm.basic.mapper.WorkingProcedureTypeMapper;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||
@@ -105,6 +108,7 @@ public class WorkingProcedureServiceImpl extends CrudServiceImpl<WorkingProcedur
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(WorkingProcedureDTO dto) {
|
||||
WorkingProcedure entity = ConvertUtils.sourceToTarget(dto, WorkingProcedure.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -112,6 +116,7 @@ public class WorkingProcedureServiceImpl extends CrudServiceImpl<WorkingProcedur
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(WorkingProcedureDTO dto) {
|
||||
WorkingProcedure entity = ConvertUtils.sourceToTarget(dto, WorkingProcedure.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@@ -153,11 +158,36 @@ public class WorkingProcedureServiceImpl extends CrudServiceImpl<WorkingProcedur
|
||||
@Autowired
|
||||
private WorkingProcedureMapper workingProcedureMapper;
|
||||
|
||||
@Autowired
|
||||
private WorkingProcedureTypeMapper workingProcedureTypeMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<WorkingProcedureDTO> list() {
|
||||
List<WorkingProcedureDTO> list = workingProcedureMapper.list();
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<WorkingProcedure> listByType(Long typeId) {
|
||||
QueryWrapper<WorkingProcedure> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(ObjectUtils.isNotNull(typeId), "working_procedure_type_id", typeId);
|
||||
List<WorkingProcedure> listOfType = workingProcedureMapper.selectList(wrapper);
|
||||
|
||||
return listOfType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<WorkingProcedureTypeDTO> listWithType () {
|
||||
List<WorkingProcedureTypeDTO> workingProcedureTypeDTOList = workingProcedureTypeMapper.list();
|
||||
for(WorkingProcedureTypeDTO workingProcedureTypeDTO: workingProcedureTypeDTOList){
|
||||
List<WorkingProcedure> workingProcedureList = listByType(workingProcedureTypeDTO.getId());
|
||||
if(workingProcedureList!=null & workingProcedureList.size() > 0)
|
||||
workingProcedureTypeDTO.setWorkingProcedureList(workingProcedureList);
|
||||
}
|
||||
return workingProcedureTypeDTOList;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.basic.dto.WorkingProcedureTypeDTO;
|
||||
@@ -59,6 +60,7 @@ public class WorkingProcedureTypeServiceImpl extends CrudServiceImpl<WorkingProc
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void save(WorkingProcedureTypeDTO dto) {
|
||||
WorkingProcedureType entity = ConvertUtils.sourceToTarget(dto, WorkingProcedureType.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@@ -66,6 +68,7 @@ public class WorkingProcedureTypeServiceImpl extends CrudServiceImpl<WorkingProc
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(WorkingProcedureTypeDTO dto) {
|
||||
WorkingProcedureType entity = ConvertUtils.sourceToTarget(dto, WorkingProcedureType.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,4 +73,18 @@
|
||||
<select id="getControlGraphNameById" resultType="String">
|
||||
select name from control_graph where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.ProductFeaturesDTO">
|
||||
select * from product_features
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
<select id="getProductFeaturesByType" resultType="com.cnbm.basic.dto.ProductFeaturesDTO">
|
||||
select * from product_features
|
||||
<where>
|
||||
valid = 1 AND type = #{type}
|
||||
</where>
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -2,4 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.basic.mapper.ProductMapper">
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.ProductDTO">
|
||||
select * from product
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -2,4 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.basic.mapper.ShiftMapper">
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.ShiftDTO">
|
||||
select * from shift
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -2,4 +2,9 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cnbm.basic.mapper.TeamMapper">
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.TeamDTO">
|
||||
select * from team
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
<mapper namespace="com.cnbm.basic.mapper.WorkingProcedureMapper">
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.WorkingProcedureDTO">
|
||||
select * from working_procedure
|
||||
order by id asc
|
||||
select wp.*,wpt.name as workingProcedureTypeName from working_procedure wp
|
||||
LEFT JOIN working_procedure_type wpt ON wp.working_procedure_type_id=wpt.id
|
||||
order by wp.id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?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.basic.mapper.WorkingProcedureTypeMapper">
|
||||
|
||||
<select id="list" resultType="com.cnbm.basic.dto.WorkingProcedureTypeDTO">
|
||||
select * from working_procedure_type
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,6 +1,11 @@
|
||||
package com.cnbm.common.spc.util;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
@@ -13,14 +18,18 @@ import java.util.List;
|
||||
*/
|
||||
public class DataUtils {
|
||||
public static void main(String[] args) {
|
||||
ArrayList<Integer> arrs = new ArrayList<>();
|
||||
|
||||
for(int i=0;i<100;i++){
|
||||
arrs.add(i);
|
||||
}
|
||||
List<List<Integer>> lists = fixedGroup(arrs, 10);
|
||||
System.out.println();
|
||||
|
||||
// ArrayList<Integer> arrs = new ArrayList<>();
|
||||
//
|
||||
// for(int i=0;i<100;i++){
|
||||
// arrs.add(i);
|
||||
// }
|
||||
// List<List<Integer>> lists = fixedGroup(arrs, 10);
|
||||
// System.out.println();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
Instant instant1 = now.atZone(ZoneId.systemDefault()).toInstant();
|
||||
Instant instant2 = now.toInstant(ZoneOffset.UTC);
|
||||
Instant instant3 = StringToInstant("2024-01-22 12:00:00");
|
||||
System.out.println(instant1+" - "+instant2+" - "+instant3);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +55,20 @@ public class DataUtils {
|
||||
|
||||
return result;
|
||||
}
|
||||
public static final Instant StringToInstant(String string) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime parse = LocalDateTime.parse(string, dateTimeFormatter);
|
||||
//return parse.toInstant(ZoneOffset.UTC);
|
||||
return parse.atZone(ZoneId.systemDefault()).toInstant();
|
||||
}
|
||||
|
||||
|
||||
public static final Instant StringToInstantPlus8(String string) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||
//LocalDateTime parse = LocalDateTime.parse(string, dateTimeFormatter).plusHours(8);
|
||||
LocalDateTime parse = LocalDateTime.parse(string, dateTimeFormatter).minusHours(8);
|
||||
return parse.toInstant(ZoneOffset.UTC);
|
||||
}
|
||||
public static String splitToNeed(String s,Integer type){
|
||||
String[] s1 = s.split(" ");
|
||||
String[] split = s1[0].split("-");
|
||||
|
||||
@@ -86,4 +86,61 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.12</version>
|
||||
<configuration>
|
||||
<!--指定运行main函数的包-->
|
||||
<mainClass>com.cnbm.YmApplication</mainClass>
|
||||
<!--开启分层编译支持-->
|
||||
<layers>
|
||||
<enabled>true</enabled>
|
||||
<configuration>${project.basedir}/src/main/resources/layers.xml</configuration>
|
||||
</layers>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>${docker.plugin.version}</version>
|
||||
<configuration>
|
||||
<imageName>ym-pass/${project.artifactId}</imageName>
|
||||
<dockerDirectory>${project.basedir}/</dockerDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -21,14 +21,11 @@ import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
|
||||
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.collect.Lists.newArrayList;
|
||||
|
||||
/**
|
||||
* @Author weihongyang
|
||||
* @Date 2022/6/21 10:56 AM
|
||||
@@ -128,6 +125,7 @@ public class SwaggerConfig {
|
||||
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Docket processInspectionApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
|
||||
@@ -2,9 +2,15 @@ spring:
|
||||
datasource:
|
||||
#MySQL
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://mysql.picaiba.com:30307/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 1qaz@WSX3edc$RFV
|
||||
# url: jdbc:mysql://mysql.picaiba.com:30307/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: spcw
|
||||
password: fxltsblXSSXYBY
|
||||
# url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: spcw
|
||||
# password: fxltsblXSSXYBY
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
|
||||
@@ -77,4 +83,4 @@ spring:
|
||||
# writeTimeout: 5s # Write timeout for OkHttpClient. (Default: 10s)
|
||||
# connectTimeout: 5s # Connection timeout for OkHttpClient. (Default: 10s)
|
||||
|
||||
# management.health.influx.enabled=true # Whether to enable InfluxDB 2.x health check.
|
||||
# management.health.influx.enabled=true # Whether to enable InfluxDB 2.x health check.
|
||||
@@ -2,9 +2,12 @@ spring:
|
||||
datasource:
|
||||
#MySQL
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://mysql.picaiba.com:30307/ym_pass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 1qaz@WSX3edc$RFV
|
||||
# url: jdbc:mysql://mysql.picaiba.com:30307/ym_pass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: 1qaz@WSX3edc$RFV
|
||||
url: jdbc:mysql://172.16.21.131:3306/spc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: spcw
|
||||
password: fxltsblXSSXYBY
|
||||
# #Oracle
|
||||
# driver-class-name: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
|
||||
|
||||
@@ -5,9 +5,9 @@ server:
|
||||
threads:
|
||||
max: 1000
|
||||
min-spare: 30
|
||||
port: 8080
|
||||
port: 8999
|
||||
servlet:
|
||||
context-path: /ym-spc
|
||||
context-path: /spcserver
|
||||
session:
|
||||
cookie:
|
||||
http-only: true
|
||||
@@ -33,7 +33,10 @@ spring:
|
||||
enabled: true
|
||||
redis:
|
||||
database: 2
|
||||
host: redis.picaiba.com
|
||||
# host: 127.0.0.1
|
||||
# port: 6379
|
||||
# password: ''
|
||||
host: 172.16.21.99
|
||||
port: 6380
|
||||
password: '@WSXcde3' # 密码(默认为空)
|
||||
timeout: 6000ms # 连接超时时长(毫秒)
|
||||
|
||||
27
ym-gateway/src/main/resources/layers.xml
Normal file
27
ym-gateway/src/main/resources/layers.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<layers xmlns="http://www.springframework.org/schema/boot/layers"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/boot/layers
|
||||
https://www.springframework.org/schema/boot/layers/layers.xsd">
|
||||
<application>
|
||||
<into layer="spring-boot-loader">
|
||||
<include>org/springframework/boot/loader/**</include>
|
||||
</into>
|
||||
<into layer="application" />
|
||||
</application>
|
||||
<dependencies>
|
||||
<into layer="snapshot-dependencies">
|
||||
<include>*:*:*SNAPSHOT</include>
|
||||
</into>
|
||||
<into layer="company-dependencies">
|
||||
<include>com.cnbm:*</include>
|
||||
</into>
|
||||
<into layer="dependencies"/>
|
||||
</dependencies>
|
||||
<layerOrder>
|
||||
<layer>dependencies</layer>
|
||||
<layer>spring-boot-loader</layer>
|
||||
<layer>snapshot-dependencies</layer>
|
||||
<layer>company-dependencies</layer>
|
||||
<layer>application</layer>
|
||||
</layerOrder>
|
||||
</layers>
|
||||
@@ -19,7 +19,7 @@ public class CodeGenerator {
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
mybatisPlusGenerator(new String[]{"product_type"});
|
||||
mybatisPlusGenerator(new String[]{"unit"});
|
||||
}
|
||||
|
||||
public static void mybatisPlusGenerator(String[] include){
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
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.InspectionSheetDTO;
|
||||
import com.cnbm.generator.code.excel.InspectionSheetExcel;
|
||||
import com.cnbm.generator.code.service.IInspectionSheetService;
|
||||
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-12-07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/code/inspectionSheet")
|
||||
@Api(tags="检验单 表")
|
||||
public class InspectionSheetController {
|
||||
@Autowired
|
||||
private IInspectionSheetService inspectionSheetService;
|
||||
|
||||
@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:inspectionSheet:page')")
|
||||
public Result<PageData<InspectionSheetDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<InspectionSheetDTO> page = inspectionSheetService.page(params);
|
||||
return new Result<PageData<InspectionSheetDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
@PreAuthorize("@ex.hasAuthority('code:inspectionSheet:info')")
|
||||
public Result<InspectionSheetDTO> get(@PathVariable("id") Long id){
|
||||
InspectionSheetDTO data = inspectionSheetService.get(id);
|
||||
return new Result<InspectionSheetDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
@PreAuthorize("@ex.hasAuthority('code:inspectionSheet:save')")
|
||||
public Result<Long> save(@RequestBody InspectionSheetDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
try {
|
||||
inspectionSheetService.save(dto);
|
||||
}catch (Exception e){
|
||||
return new Result<Long>().error(1,"没有发现检验参数");
|
||||
}
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@PreAuthorize("@ex.hasAuthority('code:inspectionSheet:update')")
|
||||
public Result<Long> update(@RequestBody InspectionSheetDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
inspectionSheetService.update(dto);
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
@PreAuthorize("@ex.hasAuthority('code:inspectionSheet:delete')")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
inspectionSheetService.delete(ids);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
@PreAuthorize("@ex.hasAuthority('code:inspectionSheet:export')")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<InspectionSheetDTO> list = inspectionSheetService.list(params);
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, InspectionSheetExcel.class);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
@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<Long> save(@RequestBody UnitDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
unitService.save(dto);
|
||||
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
@PreAuthorize("@ex.hasAuthority('code:unit:update')")
|
||||
public Result<Long> update(@RequestBody UnitDTO dto){
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
|
||||
unitService.update(dto);
|
||||
|
||||
return new Result<Long>().ok(dto.getId());
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
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-12-07
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "检验单 表DTO对象")
|
||||
public class InspectionSheetDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "订单号,手动输入")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty(value = "批次号,手填")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty(value = "检验站点,手填")
|
||||
private String inspectionSite;
|
||||
|
||||
@ApiModelProperty(value = "产品id,关联product表")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty(value = "检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验")
|
||||
private Integer inspectionStage;
|
||||
|
||||
@ApiModelProperty(value = "工序id,关联working_procedure表")
|
||||
private Long workingProcedureId;
|
||||
|
||||
@ApiModelProperty(value = "机台id,关联machine表")
|
||||
private Long machineId;
|
||||
|
||||
@ApiModelProperty(value = "班次id,关联shift表")
|
||||
private Long shiftId;
|
||||
|
||||
@ApiModelProperty(value = "分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfGroupedSamples;
|
||||
|
||||
@ApiModelProperty(value = "样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfSamples;
|
||||
|
||||
@ApiModelProperty(value = "缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer numberOfDefects;
|
||||
|
||||
@ApiModelProperty(value = "不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer defectiveQuantity;
|
||||
|
||||
@ApiModelProperty(value = "生产人")
|
||||
private String producer;
|
||||
|
||||
@ApiModelProperty(value = "检验人")
|
||||
private String inspector;
|
||||
|
||||
@ApiModelProperty(value = "产品特性类型:1 计量型;2 计数型")
|
||||
private Integer type;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "单位 表DTO对象")
|
||||
public class UnitDTO 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 = "单位类型,1 可计数,2 不可计数")
|
||||
private Integer type;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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-12-07
|
||||
*/
|
||||
@Data
|
||||
@TableName("inspection_sheet")
|
||||
@ApiModel(value = "InspectionSheet对象", description = "检验单 表")
|
||||
public class InspectionSheet implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("订单号,手动输入")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("批次号,手填")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("检验站点,手填")
|
||||
private String inspectionSite;
|
||||
|
||||
@ApiModelProperty("产品id,关联product表")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty("检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验")
|
||||
private Integer inspectionStage;
|
||||
|
||||
@ApiModelProperty("工序id,关联working_procedure表")
|
||||
private Long workingProcedureId;
|
||||
|
||||
@ApiModelProperty("机台id,关联machine表")
|
||||
private Long machineId;
|
||||
|
||||
@ApiModelProperty("班次id,关联shift表")
|
||||
private Long shiftId;
|
||||
|
||||
@ApiModelProperty("分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfGroupedSamples;
|
||||
|
||||
@ApiModelProperty("样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfSamples;
|
||||
|
||||
@ApiModelProperty("缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer numberOfDefects;
|
||||
|
||||
@ApiModelProperty("不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer defectiveQuantity;
|
||||
|
||||
@ApiModelProperty("生产人")
|
||||
private String producer;
|
||||
|
||||
@ApiModelProperty("检验人")
|
||||
private String inspector;
|
||||
|
||||
@ApiModelProperty("产品特性类型:1 计量型;2 计数型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("1 可用,0 不可用")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||
@TableLogic
|
||||
private Integer valid;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long creatorId;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String creatorName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("更新人")
|
||||
private Long updaterId;
|
||||
|
||||
@ApiModelProperty("更新人姓名")
|
||||
private String updaterName;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty("版本号")
|
||||
private Integer version;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.cnbm.generator.code.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
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 2023-01-12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Unit对象", description = "单位 表")
|
||||
public class Unit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("单位 名")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("单位 编码")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("单位类型,1 可计数,2 不可计数")
|
||||
private Integer type;
|
||||
|
||||
@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;
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
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-12-07
|
||||
*/
|
||||
@Data
|
||||
public class InspectionSheetExcel {
|
||||
@Excel(name = "ID")
|
||||
private Long id;
|
||||
@Excel(name = "订单号,手动输入")
|
||||
private String orderNumber;
|
||||
@Excel(name = "批次号,手填")
|
||||
private String batchNumber;
|
||||
@Excel(name = "检验站点,手填")
|
||||
private String inspectionSite;
|
||||
@Excel(name = "产品id,关联product表")
|
||||
private Long productId;
|
||||
@Excel(name = "检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验")
|
||||
private Integer inspectionStage;
|
||||
@Excel(name = "工序id,关联working_procedure表")
|
||||
private Long workingProcedureId;
|
||||
@Excel(name = "机台id,关联machine表")
|
||||
private Long machineId;
|
||||
@Excel(name = "班次id,关联shift表")
|
||||
private Long shiftId;
|
||||
@Excel(name = "分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfGroupedSamples;
|
||||
@Excel(name = "样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||
private Integer numberOfSamples;
|
||||
@Excel(name = "缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer numberOfDefects;
|
||||
@Excel(name = "不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||
private Integer defectiveQuantity;
|
||||
@Excel(name = "生产人")
|
||||
private String producer;
|
||||
@Excel(name = "检验人")
|
||||
private String inspector;
|
||||
@Excel(name = "产品特性类型:1 计量型;2 计数型")
|
||||
private Integer type;
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
@Data
|
||||
public class UnitExcel {
|
||||
@Excel(name = "")
|
||||
private Long id;
|
||||
@Excel(name = "单位 名")
|
||||
private String name;
|
||||
@Excel(name = "单位 编码")
|
||||
private String code;
|
||||
@Excel(name = "单位类型,1 可计数,2 不可计数")
|
||||
private Integer type;
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.cnbm.generator.code.mapper;
|
||||
|
||||
import com.cnbm.common.dao.BaseDao;
|
||||
import com.cnbm.generator.code.entity.InspectionSheet;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 检验单 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-12-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface InspectionSheetMapper extends BaseDao<InspectionSheet> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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.InspectionSheetMapper">
|
||||
<resultMap type="com.cnbm.generator.code.entity.InspectionSheet" id="InspectionSheetMap">
|
||||
<id column="id" property="id" />
|
||||
<id column="order_number" property="orderNumber" />
|
||||
<id column="batch_number" property="batchNumber" />
|
||||
<id column="inspection_site" property="inspectionSite" />
|
||||
<id column="product_id" property="productId" />
|
||||
<id column="inspection_stage" property="inspectionStage" />
|
||||
<id column="working_procedure_id" property="workingProcedureId" />
|
||||
<id column="machine_id" property="machineId" />
|
||||
<id column="shift_id" property="shiftId" />
|
||||
<id column="number_of_grouped_samples" property="numberOfGroupedSamples" />
|
||||
<id column="number_of_samples" property="numberOfSamples" />
|
||||
<id column="number_of_defects" property="numberOfDefects" />
|
||||
<id column="defective_quantity" property="defectiveQuantity" />
|
||||
<id column="producer" property="producer" />
|
||||
<id column="inspector" property="inspector" />
|
||||
<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>
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface UnitMapper extends BaseDao<Unit> {
|
||||
|
||||
}
|
||||
@@ -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.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>
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +1,7 @@
|
||||
-- 菜单初始SQL
|
||||
INSERT INTO sys_menu(id, pid, name, url, permissions, type, icon, sort, creator, create_date, updater, update_date)VALUES (1600308190230409218, 1067246875800000035, '检验单 表', 'code/inspectionSheet', 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 (1600308190230409219, 1600308190230409218, '查看', NULL, 'code:inspectionSheet:page,code:inspectionSheet: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 (1600308190230409220, 1600308190230409218, '新增', NULL, 'code:inspectionSheet: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 (1600308190230409221, 1600308190230409218, '修改', NULL, 'code:inspectionSheet: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 (1600308190230409222, 1600308190230409218, '删除', NULL, 'code:inspectionSheet: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 (1600308190230409223, 1600308190230409218, '导出', NULL, 'code:inspectionSheet:export', 1, NULL, 4, 1067246875800000001, now(), 1067246875800000001, now());
|
||||
@@ -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());
|
||||
@@ -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());
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.cnbm.generator.code.service;
|
||||
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.generator.code.dto.InspectionSheetDTO;
|
||||
import com.cnbm.generator.code.entity.InspectionSheet;
|
||||
|
||||
/**
|
||||
* 检验单 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-12-07
|
||||
*/
|
||||
public interface IInspectionSheetService extends CrudService<InspectionSheet, InspectionSheetDTO> {
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
public interface IUnitService extends CrudService<Unit, UnitDTO> {
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
}
|
||||
@@ -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.InspectionSheetDTO;
|
||||
import com.cnbm.generator.code.mapper.InspectionSheetMapper;
|
||||
import com.cnbm.generator.code.entity.InspectionSheet;
|
||||
import com.cnbm.generator.code.service.IInspectionSheetService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 检验单 表
|
||||
*
|
||||
* @author why
|
||||
* @since 2022-12-07
|
||||
*/
|
||||
@Service
|
||||
public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetMapper, InspectionSheet, InspectionSheetDTO> implements IInspectionSheetService {
|
||||
|
||||
@Override
|
||||
public QueryWrapper<InspectionSheet> getWrapper(Map<String, Object> params){
|
||||
String id = (String)params.get("id");
|
||||
|
||||
QueryWrapper<InspectionSheet> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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 2023-01-12
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -182,41 +182,6 @@ public class Main {
|
||||
return day;
|
||||
}
|
||||
|
||||
private static List<FluxTable> query(QueryDataParam param,InfluxDBClient influxDBClient){
|
||||
String measurement = param.getMeasurement();
|
||||
List<String> dropedTagName = param.getDropedTagNames();
|
||||
Range range = param.getRange();
|
||||
String bucket = param.getBucket();
|
||||
String tagName = param.getTag().getTagName();
|
||||
String tagValue = param.getTag().getTagValue();
|
||||
PageInfo pageInfo = param.getPageInfo();
|
||||
|
||||
String flux = "from(bucket:\""+bucket+"\")";
|
||||
flux += "|> range(start: "+range.getBegin().toString()+",stop:"+range.getEnd().toString()+") \n";
|
||||
flux += "|> filter(fn: (r) => r[\"_measurement\"] == \""+measurement+"\") \n";
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\") \n";
|
||||
for(String dropName:dropedTagName){
|
||||
flux += "|> drop(columns: [\""+ dropName +"\"]) \n";
|
||||
}
|
||||
flux += "|> sort(columns: [\"_time\"], desc: true) \n";
|
||||
flux += "|> window(every: 1y) \n";
|
||||
if(pageInfo!=null){
|
||||
flux += "|> limit(n: "+pageInfo.getSize()+", offset: "+(pageInfo.getCurrent()-1)* pageInfo.getSize()+")";
|
||||
}
|
||||
|
||||
QueryApi queryApi = influxDBClient.getQueryApi();
|
||||
|
||||
List<FluxTable> tables = queryApi.query(flux);
|
||||
for (FluxTable fluxTable : tables) {
|
||||
List<FluxRecord> records = fluxTable.getRecords();
|
||||
for (FluxRecord fluxRecord : records) {
|
||||
System.out.println("time: "+fluxRecord.getTime() +" key:"+fluxRecord.getField()+" value: " + fluxRecord.getValueByKey("_value")+" measurement: " + fluxRecord.getMeasurement());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return tables;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.cnbm.influx.config;
|
||||
|
||||
import com.cnbm.common.spc.util.DataUtils;
|
||||
import com.cnbm.influx.constant.Constant;
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.QueryDataGroupByTimeParam;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.param.Range;
|
||||
import com.cnbm.influx.param.*;
|
||||
import com.cnbm.influx.template.Event;
|
||||
import com.influxdb.client.InfluxDBClient;
|
||||
import com.influxdb.client.InfluxDBClientFactory;
|
||||
@@ -22,8 +20,10 @@ public enum InfluxClient {
|
||||
/**
|
||||
* influxdb 读写客户端,,如果write比较繁忙,后续可以考虑,维护 client一个线程池。
|
||||
* */
|
||||
Client("http://192.168.0.170:8086","lkBsC27QZr1W50BSPlGxpTqNNpwuUk5uz1dZZRPSPbCG5VmNDDUo8P3UkZIhGWwfJwkuz6ZGZ7Et4_KBaG3gHw==","qgs","qgs-bucket"),
|
||||
//Client("http://192.168.0.171:8086","lkq32gtomiKd4nu-kwZVUBEbn1HLdigjRPfuA6p8c29KFfqRs8JcR3IDLDsKzVFA-TDHbG1W6EP3EcJKKqpDPg==","qgs","qgs-bucket"),
|
||||
|
||||
//瑞昌-cdte spc-all-token
|
||||
Client("http://172.16.21.111:8086","XLTjiVj368gLL0j-hTcAS6HE17M7tY5fj3ipt1gXTjgVqdGRE5pEhpGMABzchYFZpmaQsGTUckR5Rs8Erz8nKQ==","qgs","qgs-bucket"),
|
||||
;
|
||||
private String url;
|
||||
private String token;
|
||||
@@ -77,14 +77,14 @@ public enum InfluxClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* desc: 异步批量 写入数据/更新数据
|
||||
* desc: 异步批量 写入数据 / 更新数据
|
||||
* notes: 如果是更新数据,要保证time字段不能改变
|
||||
* auth: caixaing
|
||||
* */
|
||||
public void insert(Event event, String measurement){
|
||||
|
||||
Point point = null;
|
||||
if(event.getBatchNum()==null){
|
||||
if(event.getSampleNumber()==null){
|
||||
point = Point.measurement(measurement)
|
||||
.addTag("transationId", event.getTransationId())
|
||||
.addTag("argName", event.getArgName())
|
||||
@@ -96,14 +96,12 @@ public enum InfluxClient {
|
||||
|
||||
.addTag("inspectionSheetId", event.getInspectionSheetId())
|
||||
.addTag("sampleNumber", event.getSampleNumber())
|
||||
.addTag("batchNum", event.getBatchNum())
|
||||
|
||||
.addTag("argName", event.getArgName())
|
||||
.addField("argValue", event.getArgValue())
|
||||
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
|
||||
}
|
||||
writeApi.writePoint(point);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,104 +113,140 @@ public enum InfluxClient {
|
||||
List<Point> list = new ArrayList<>();
|
||||
for(Event event:events){
|
||||
Point point = null;
|
||||
if(event.getBatchNum()==null){
|
||||
if(event.getSampleNumber()==null){
|
||||
point = Point.measurement(measurement)
|
||||
.addTag("transationId", event.getTransationId())
|
||||
.addTag("transationId", event.getTransationId()==null ? "" : event.getTransationId())
|
||||
.addTag("argName", event.getArgName())
|
||||
.addField("argValue", event.getArgValue())
|
||||
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
|
||||
//.time(DataUtils.StringToInstantPlus8(event.getTime().toString()).toEpochMilli(), WritePrecision.MS);
|
||||
|
||||
}else {
|
||||
point = Point.measurement(measurement)
|
||||
.addTag("transationId", event.getTransationId())
|
||||
.addTag("inspectionSheetId", event.getInspectionSheetId())
|
||||
.addTag("transationId", event.getTransationId()==null ? "" : event.getTransationId())
|
||||
.addTag("inspectionSheetId", event.getInspectionSheetId()==null ? "" : event.getInspectionSheetId())
|
||||
|
||||
// .addTag("batchNum", event.getBatchNum())
|
||||
.addTag("sampleNumber", event.getSampleNumber())
|
||||
.addField("batchNum", event.getBatchNum())
|
||||
//.addField("batchNum", event.getBatchNum())
|
||||
|
||||
.addTag("argName", event.getArgName())
|
||||
.addField("argValue", event.getArgValue())
|
||||
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
|
||||
//.time(DataUtils.StringToInstantPlus8(event.getTime().toString()).toEpochMilli(), WritePrecision.MS);
|
||||
}
|
||||
|
||||
|
||||
list.add(point);
|
||||
}
|
||||
writeApi.writePoints(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<FluxTable> query(QueryDataParam param){
|
||||
String measurement = param.getMeasurement();
|
||||
List<String> dropedTagNames = param.getDropedTagNames();
|
||||
Range range = param.getRange();
|
||||
|
||||
|
||||
String bucket = param.getBucket();
|
||||
PageInfo pageInfo = param.getPageInfo();
|
||||
|
||||
|
||||
String flux = "from(bucket:\""+bucket+"\")";
|
||||
flux += "|> range(start: "+range.getBegin()+",stop:"+range.getEnd()+")";
|
||||
|
||||
if(param.getRange() != null){
|
||||
Range range = param.getRange();
|
||||
flux += "|> range(start: "+range.getBegin()+",stop:"+range.getEnd()+")";
|
||||
}
|
||||
|
||||
flux += "|> filter(fn: (r) => r[\"_measurement\"] == \""+measurement+"\")";
|
||||
|
||||
if(param.getTag()!=null){
|
||||
String tagName = param.getTag().getTagName();
|
||||
String tagValue = param.getTag().getTagValue();
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
if(param.getTags()!=null && param.getTags().size()>0){
|
||||
for(Tag tag:param.getTags()){
|
||||
String tagName = tag.getTagName();
|
||||
String tagValue = tag.getTagValue();
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
}
|
||||
}
|
||||
|
||||
//调整时区,查询出的结果 +8个小时
|
||||
//flux += "|> timeShift(duration: 8h)";
|
||||
|
||||
|
||||
for(String dropName:dropedTagNames){
|
||||
flux += "|> drop(columns: [\""+dropName+"\"])";
|
||||
if(param.getDropedTagNames() != null){
|
||||
List<String> dropedTagNames = param.getDropedTagNames();
|
||||
for(String dropName:dropedTagNames){
|
||||
flux += "|> drop(columns: [\""+dropName+"\"])";
|
||||
}
|
||||
}
|
||||
|
||||
flux += "|> sort(columns: [\"_time\"], desc: true)";
|
||||
if(pageInfo!=null){
|
||||
if(param.getPageInfo() != null){
|
||||
PageInfo pageInfo = param.getPageInfo();
|
||||
flux += "|> limit(n: "+pageInfo.getSize()+", offset: "+(pageInfo.getCurrent()-1)* pageInfo.getSize()+")";
|
||||
}
|
||||
return queryApi.query(flux);
|
||||
}
|
||||
|
||||
public List<FluxTable> queryByGroup(QueryDataParam param){
|
||||
String measurement = param.getMeasurement();
|
||||
List<String> dropedTagNames = param.getDropedTagNames();
|
||||
Range range = param.getRange();
|
||||
String bucket = param.getBucket();
|
||||
String tagName = param.getTag().getTagName();
|
||||
String tagValue = param.getTag().getTagValue();
|
||||
String groupName = param.getGroupName();
|
||||
PageInfo pageInfo = param.getPageInfo();
|
||||
|
||||
String flux = "from(bucket:\""+bucket+"\")";
|
||||
flux += "|> range(start: "+range.getBegin()+",stop:"+range.getEnd()+")";
|
||||
flux += "|> filter(fn: (r) => r[\"_measurement\"] == \""+measurement+"\")";
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
flux += "|> timeShift(duration: 8h)";
|
||||
flux += "|> group(columns: [\""+groupName+"\"], mode: \"except\")";
|
||||
for(String dropName:dropedTagNames){
|
||||
flux += "|> drop(columns: [\""+dropName+"\"])";
|
||||
}
|
||||
flux += "|> sort(columns: [\"_time\"], desc: true)";
|
||||
if(pageInfo!=null){
|
||||
flux += "|> limit(n: "+pageInfo.getSize()+", offset: "+(pageInfo.getCurrent()-1)* pageInfo.getSize()+")";
|
||||
}
|
||||
return queryApi.query(flux);
|
||||
}
|
||||
// public List<FluxTable> queryByGroup(QueryDataParam param){
|
||||
// String measurement = param.getMeasurement();
|
||||
// List<String> dropedTagNames = param.getDropedTagNames();
|
||||
// Range range = param.getRange();
|
||||
// String bucket = param.getBucket();
|
||||
//
|
||||
//
|
||||
//
|
||||
// String groupName = param.getGroupName();
|
||||
// PageInfo pageInfo = param.getPageInfo();
|
||||
//
|
||||
// String flux = "from(bucket:\""+bucket+"\")";
|
||||
// flux += "|> range(start: "+range.getBegin()+",stop:"+range.getEnd()+")";
|
||||
// flux += "|> filter(fn: (r) => r[\"_measurement\"] == \""+measurement+"\")";
|
||||
//
|
||||
//// String tagName = param.getTag().getTagName();
|
||||
//// String tagValue = param.getTag().getTagValue();
|
||||
//// flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
// if(param.getTags()!=null && param.getTags().size()>0){
|
||||
// for(Tag tag:param.getTags()){
|
||||
// String tagName = tag.getTagName();
|
||||
// String tagValue = tag.getTagValue();
|
||||
// flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// flux += "|> timeShift(duration: 8h)";
|
||||
// flux += "|> group(columns: [\""+groupName+"\"], mode: \"except\")";
|
||||
// for(String dropName:dropedTagNames){
|
||||
// flux += "|> drop(columns: [\""+dropName+"\"])";
|
||||
// }
|
||||
// flux += "|> sort(columns: [\"_time\"], desc: true)";
|
||||
// if(pageInfo!=null){
|
||||
// flux += "|> limit(n: "+pageInfo.getSize()+", offset: "+(pageInfo.getCurrent()-1)* pageInfo.getSize()+")";
|
||||
// }
|
||||
// return queryApi.query(flux);
|
||||
// }
|
||||
|
||||
public List<FluxTable> queryGroupByTime(QueryDataGroupByTimeParam param){
|
||||
String measurement = param.getMeasurement();
|
||||
List<String> dropedTagNames = param.getDropedTagNames();
|
||||
Range range = param.getRange();
|
||||
String bucket = param.getBucket();
|
||||
String tagName = param.getTag().getTagName();
|
||||
String tagValue = param.getTag().getTagValue();
|
||||
|
||||
PageInfo pageInfo = param.getPageInfo();
|
||||
|
||||
String flux = "from(bucket:\""+bucket+"\")";
|
||||
flux += "|> range(start: "+range.getBegin()+",stop:"+range.getEnd()+")";
|
||||
flux += "|> filter(fn: (r) => r[\"_measurement\"] == \""+measurement+"\")";
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
flux += "|> timeShift(duration: 8h)";
|
||||
|
||||
// String tagName = param.getTag().getTagName();
|
||||
// String tagValue = param.getTag().getTagValue();
|
||||
// flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
// flux += "|> timeShift(duration: 8h)";
|
||||
if(param.getTags()!=null && param.getTags().size()>0){
|
||||
for(Tag tag:param.getTags()){
|
||||
String tagName = tag.getTagName();
|
||||
String tagValue = tag.getTagValue();
|
||||
flux += "|> filter(fn: (r) => r[\""+tagName+"\"] == \""+tagValue+"\")";
|
||||
}
|
||||
}
|
||||
|
||||
for(String dropName:dropedTagNames){
|
||||
flux += "|> drop(columns: [\""+dropName+"\"])";
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.influxdb.query.FluxTable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -52,7 +53,7 @@ public class Main {
|
||||
|
||||
event.setTime(new Date().toInstant());
|
||||
event.setTransationId("2344");
|
||||
event.setBatchNum("22");
|
||||
|
||||
event.setArgName("forUpdate");
|
||||
event.setArgValue("124.1");
|
||||
InfluxClient.Client.insert(event,"FORUPDATE");
|
||||
@@ -69,7 +70,7 @@ public class Main {
|
||||
dropNames.add("transationId");
|
||||
dropNames.add("inspectionSheetId");
|
||||
queryDataParam.setDropedTagNames(dropNames);
|
||||
queryDataParam.setTag(new Tag("argName","forUpdate"));
|
||||
queryDataParam.setTags(Arrays.asList(new Tag("argName","forUpdate")));
|
||||
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(),DataUtils.getAfterDate(999).toInstant()));
|
||||
queryDataParam.setPageInfo(new PageInfo(1,10));
|
||||
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cnbm.influx.controller;
|
||||
|
||||
import com.cnbm.influx.template.Event;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Desc: ""
|
||||
* @Author: caixiang
|
||||
* @DATE: 2022/12/9 15:53
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "Events")
|
||||
public class InfluxData {
|
||||
@ApiModelProperty("ID (transationId、argName、argValue、time 必填)")
|
||||
private List<Event> events;
|
||||
|
||||
@ApiModelProperty("measurement(相当于mysql 中的table,一台工艺设备一个measurement)")
|
||||
private String measurement;
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cnbm.influx.controller;
|
||||
|
||||
import com.cnbm.common.spc.util.DataUtils;
|
||||
import com.cnbm.common.utils.Result;
|
||||
import com.cnbm.influx.config.InfluxClient;
|
||||
import com.cnbm.influx.constant.Constant;
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.param.Range;
|
||||
@@ -14,14 +16,12 @@ import com.influxdb.query.FluxTable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/influx")
|
||||
@@ -35,6 +35,27 @@ public class S7DemoController {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
for(int i=0;i<999;i++){
|
||||
Thread.sleep(10);
|
||||
Event event = new Event();
|
||||
event.setTime(DataUtils.getAfterDate(i).toInstant());
|
||||
event.setTransationId("forbatch"+i);
|
||||
event.setArgName("LTWeight");
|
||||
Double d = r.nextDouble() * 2.5 + 66;
|
||||
event.setArgValue(d.toString());
|
||||
|
||||
event.setInspectionSheetId(i+"");
|
||||
list.add(event);
|
||||
}
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
}
|
||||
|
||||
//for 常规计数型
|
||||
@PostMapping("/insertDemoDataForCount")
|
||||
public void insertDemoDataForCount() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
for(int i=0;i<999;i++){
|
||||
Thread.sleep(10);
|
||||
Event event = new Event();
|
||||
@@ -53,52 +74,102 @@ public class S7DemoController {
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
long l1 = System.currentTimeMillis();
|
||||
System.out.println(l1);
|
||||
Date date = new Date(l1);
|
||||
Thread.sleep(1000);
|
||||
Date date2 = new Date(l1);
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@PostMapping("/insertDemoOne")
|
||||
public void insertDemoOne() throws InterruptedException {
|
||||
public void insertDemoOne(){
|
||||
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
Thread.sleep(10);
|
||||
Instant time = new Date().toInstant();
|
||||
Event event = new Event();
|
||||
event.setTime(time);
|
||||
event.setTransationId("asas123");
|
||||
event.setTime(new Date(1670554110451L).toInstant());
|
||||
event.setArgName("failDayDay");
|
||||
event.setArgValue("1");
|
||||
event.setArgValue("30089");
|
||||
event.setSampleNumber("10001");
|
||||
list.add(event);
|
||||
|
||||
Thread.sleep(1000);
|
||||
|
||||
Event event2 = new Event();
|
||||
event2.setTime(time);
|
||||
event2.setTransationId("asas456");
|
||||
event2.setTime(new Date(1670555006702L).toInstant());
|
||||
event2.setArgName("failDayDay");
|
||||
event2.setArgValue("2");
|
||||
event2.setArgValue("40088");
|
||||
event2.setSampleNumber("10001");
|
||||
list.add(event2);
|
||||
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
}
|
||||
@PostMapping("/readDemoOne")
|
||||
public void readDemoOne() {
|
||||
List<String> dropNames = new ArrayList<>();
|
||||
dropNames.add("transationId");
|
||||
// dropNames.add("inspectionSheetId");
|
||||
// dropNames.add("batchNum");
|
||||
|
||||
QueryDataParam queryDataParam = new QueryDataParam();
|
||||
queryDataParam.setMeasurement("PID2");
|
||||
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(999).toInstant(), DataUtils.getAfterDate(999).toInstant() ));
|
||||
|
||||
queryDataParam.setDropedTagNames(dropNames);
|
||||
queryDataParam.setTags(Arrays.asList(new Tag("argName","LTWeight"),new Tag("inspectionSheetId","1601123134690340865")));
|
||||
queryDataParam.setBucket(Constant.bucket);
|
||||
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/getFlux")
|
||||
public Result<Instant> getFlux() {
|
||||
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.setTags(Arrays.asList(new Tag("argName","failDayDay")));
|
||||
queryDataParam.setBucket(Constant.bucket);
|
||||
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
|
||||
Instant time = query.get(0).getRecords().get(0).getTime();
|
||||
return new Result<Instant>().ok(time);
|
||||
}
|
||||
|
||||
@PostMapping("/saveFlux1")
|
||||
public Result<Instant> saveFlux1() {
|
||||
|
||||
//for 常规计数型
|
||||
@PostMapping("/insertDemoDataForCount")
|
||||
public void insertDemoDataForCount() throws InterruptedException {
|
||||
List<Event> list = new ArrayList<>();
|
||||
Random r = new Random();
|
||||
|
||||
for(int i=0;i<99;i++){
|
||||
Thread.sleep(10);
|
||||
Event event = new Event();
|
||||
event.setTime(Instant.now());
|
||||
event.setTransationId("forbatch"+i);
|
||||
event.setArgName("LTWeight");
|
||||
Double d = r.nextDouble() * 2.5 + 66;
|
||||
event.setArgValue(d.toString());
|
||||
event.setBatchNum(4+"");
|
||||
event.setInspectionSheetId(i+"");
|
||||
list.add(event);
|
||||
}
|
||||
Event event2 = new Event();
|
||||
Instant instant = new Date().toInstant();
|
||||
event2.setTime(instant);
|
||||
event2.setArgName("failDayDay");
|
||||
event2.setArgValue("");
|
||||
event2.setSampleNumber("10001");
|
||||
list.add(event2);
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
return new Result<Instant>().ok(instant);
|
||||
}
|
||||
|
||||
@PostMapping("/saveFlux2")
|
||||
public void saveFlux2(@RequestBody TIMETest timeTest) {
|
||||
|
||||
List<Event> list = new ArrayList<>();
|
||||
Event event2 = new Event();
|
||||
event2.setTime(timeTest.getTime2());
|
||||
event2.setArgName("failDayDay");
|
||||
event2.setArgValue("40091");
|
||||
event2.setSampleNumber("10001");
|
||||
list.add(event2);
|
||||
InfluxClient.Client.batchInsert(list,"Weight");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// @PostMapping("/insertBatchJYD")
|
||||
// public void insertBatchJYD() throws InterruptedException {
|
||||
@@ -127,7 +198,7 @@ public class S7DemoController {
|
||||
// public void insertAndQuery() throws InterruptedException {
|
||||
// Event event = new Event();
|
||||
//
|
||||
//// long l = System.currentTimeMillis();
|
||||
// long l = System.currentTimeMillis();
|
||||
//// System.out.println("l:"+l);
|
||||
//// event.setTime(new Date(1669874900889l).toInstant());
|
||||
////
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user