From a3cc4df25c0e1fa14e0bd1ba41e8d4bfdd5e6a6c Mon Sep 17 00:00:00 2001 From: yanyang Date: Fri, 30 Sep 2022 08:54:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/controller/FactoryController.java | 6 +++ .../basic/controller/MachineController.java | 2 + .../basic/controller/PlatformController.java | 2 + .../ProductFactoryRelationController.java | 11 +++++ .../cnbm/basic/controller/UnitController.java | 2 + .../WorkingProcedureTypeController.java | 2 + .../java/com/cnbm/basic/dto/ProductDTO.java | 4 ++ .../mapper/ProductFactoryRelationMapper.java | 4 +- .../basic/mapper/ProductFeaturesMapper.java | 2 + .../IProductFactoryRelationService.java | 3 ++ .../service/impl/MachineServiceImpl.java | 5 ++ .../service/impl/PlatformServiceImpl.java | 4 ++ .../ProductFactoryRelationServiceImpl.java | 13 ++++++ .../impl/ProductFeaturesServiceImpl.java | 10 ++++ .../service/impl/ProductServiceImpl.java | 14 +++++- .../basic/service/impl/UnitServiceImpl.java | 5 ++ .../impl/WorkingProcedureTypeServiceImpl.java | 4 ++ .../mapper/ProductFactoryRelationMapper.xml | 5 ++ .../mapper/ProductFeaturesMapper.xml | 4 ++ .../controller/ControlGraphController.java | 12 ++--- .../InterpretationSchemeController.java | 18 ++++++++ .../MyInterpretationSchemeController.java | 7 +++ .../dto/InterpretationSchemeDTO.java | 10 +++- .../dto/MyInterpretationSchemeDTO.java | 3 -- .../entity/InterpretationScheme.java | 14 ++++-- .../entity/MyInterpretationScheme.java | 3 -- .../excel/InterpretationSchemeExcel.java | 9 +++- .../excel/MyInterpretationSchemeExcel.java | 2 - .../mapper/InterpretationSchemeMapper.java | 5 ++ .../service/IInterpretationSchemeService.java | 6 +++ .../impl/InterpretationSchemeServiceImpl.java | 46 +++++++++++++++++++ .../MyInterpretationSchemeServiceImpl.java | 8 ++++ .../mapper/InterpretationSchemeMapper.xml | 29 +++++++++++- 33 files changed, 249 insertions(+), 25 deletions(-) diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/FactoryController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/FactoryController.java index 7045782..ee0eb69 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/FactoryController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/FactoryController.java @@ -124,4 +124,10 @@ public class FactoryController { return new Result(); } + @PostMapping(value = "list") + @ApiOperation(value = "获取工厂列表") + @LogOperation("获取工厂列表") + public List list() { + return factoryService.list(); + } } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/MachineController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/MachineController.java index 07dc325..971f9c6 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/MachineController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/MachineController.java @@ -48,6 +48,8 @@ public class MachineController { @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), + @ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class), + @ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class) }) @PreAuthorize("@ex.hasAuthority('basic:machine:page')") diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/PlatformController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/PlatformController.java index 47393f8..66617a2 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/PlatformController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/PlatformController.java @@ -48,6 +48,8 @@ public class PlatformController { @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), + @ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class), + @ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class) }) @PreAuthorize("@ex.hasAuthority('basic:platform:page')") diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFactoryRelationController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFactoryRelationController.java index 51138ad..bad2476 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFactoryRelationController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/ProductFactoryRelationController.java @@ -1,6 +1,7 @@ package com.cnbm.basic.controller; import com.cnbm.admin.annotation.LogOperation; +import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO; import com.cnbm.common.constant.Constant; import com.cnbm.common.page.PageData; import com.cnbm.common.utils.ExcelUtils; @@ -114,4 +115,14 @@ public class ProductFactoryRelationController { ExcelUtils.exportExcelToTarget(response, null, list, ProductFactoryRelationExcel.class); } + @PostMapping("batchInsertFactory") + @ApiOperation("添加多个工厂关联") + @LogOperation("添加多个工厂关联") + public Result batchInsertFactory(@RequestBody ProductFactoryRelationDTO[] lists){ + + productFactoryRelationService.batchInsertFactory(lists); + + return new Result(); + } + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/UnitController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/UnitController.java index 7233a08..aca0151 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/UnitController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/UnitController.java @@ -50,6 +50,8 @@ public class UnitController { @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), + @ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class), + @ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class) }) @PreAuthorize("@ex.hasAuthority('basic:unit:page')") diff --git a/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureTypeController.java b/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureTypeController.java index adb2ec2..e0e7c35 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureTypeController.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/controller/WorkingProcedureTypeController.java @@ -49,6 +49,8 @@ public class WorkingProcedureTypeController { @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), + @ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class), + @ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class), @ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class) }) @PreAuthorize("@ex.hasAuthority('basic:workingProcedureType:page')") diff --git a/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductDTO.java b/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductDTO.java index abd5d4e..1a72f31 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductDTO.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/dto/ProductDTO.java @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.List; /** @@ -82,4 +83,7 @@ public class ProductDTO implements Serializable { @ApiModelProperty(value = "版本号") private Integer version; + @ApiModelProperty(value = "工厂") + private List factoryList; + } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFactoryRelationMapper.java b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFactoryRelationMapper.java index 436de4e..1e91a76 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFactoryRelationMapper.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFactoryRelationMapper.java @@ -4,6 +4,8 @@ import com.cnbm.common.dao.BaseDao; import com.cnbm.basic.entity.ProductFactoryRelation; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 产品-工厂 关系表 * @@ -12,5 +14,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ProductFactoryRelationMapper extends BaseDao { - + List getFactoryListByProductId(Long productId); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java index 8423663..af5bec6 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/mapper/ProductFeaturesMapper.java @@ -23,4 +23,6 @@ public interface ProductFeaturesMapper extends BaseDao { List getFeaturesByStageProcedure(Map params); List getFeaturesList(Map params); + + String getControlGraphNameById(Long id); } \ No newline at end of file diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFactoryRelationService.java b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFactoryRelationService.java index 01e43b2..84351d5 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFactoryRelationService.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/IProductFactoryRelationService.java @@ -1,5 +1,6 @@ package com.cnbm.basic.service; +import com.cnbm.basic.dto.ProductWorkingprocedureRelationDTO; import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; import com.cnbm.basic.dto.ProductFactoryRelationDTO; @@ -25,4 +26,6 @@ public interface IProductFactoryRelationService extends CrudService getWrapper(Map params){ + String name = (String)params.get("name"); + String code = (String)params.get("code"); QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + wrapper.like(StringUtils.isNotBlank(code), "code", code); wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status")); return wrapper; diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/PlatformServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/PlatformServiceImpl.java index a4fdf66..b0a1cf9 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/PlatformServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/PlatformServiceImpl.java @@ -34,8 +34,12 @@ private PlatformMapper mapper; @Override public QueryWrapper getWrapper(Map params){ + String name = (String)params.get("name"); + String code = (String)params.get("code"); QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + wrapper.like(StringUtils.isNotBlank(code), "code", code); wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status")); return wrapper; diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFactoryRelationServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFactoryRelationServiceImpl.java index d2cc9f8..5444d46 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFactoryRelationServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/ProductFactoryRelationServiceImpl.java @@ -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.basic.dto.ProductWorkingprocedureRelationDTO; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.basic.dto.ProductFactoryRelationDTO; @@ -9,6 +10,9 @@ import com.cnbm.basic.mapper.ProductFactoryRelationMapper; import com.cnbm.basic.entity.ProductFactoryRelation; import com.cnbm.basic.service.IProductFactoryRelationService; import com.cnbm.common.utils.ConvertUtils; +import com.cnbm.common.validator.ValidatorUtils; +import com.cnbm.common.validator.group.AddGroup; +import com.cnbm.common.validator.group.DefaultGroup; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -71,4 +75,13 @@ public class ProductFactoryRelationServiceImpl extends CrudServiceImpl factoryList = relationMapper.getFactoryListByProductId(id); + dto.setFactoryList(factoryList); + //return ConvertUtils.sourceToTarget(entity, ProductDTO.class); + return dto; } @Override diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java index 5d41d51..d8ead65 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java @@ -11,6 +11,7 @@ import com.cnbm.basic.entity.Unit; import com.cnbm.basic.mapper.UnitMapper; import com.cnbm.basic.service.IUnitService; 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; @@ -33,8 +34,12 @@ public class UnitServiceImpl extends CrudServiceImpl @Override public QueryWrapper getWrapper(Map params){ + String name = (String)params.get("name"); + String code = (String)params.get("code"); QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + wrapper.like(StringUtils.isNotBlank(code), "code", code); wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status")); return wrapper; diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureTypeServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureTypeServiceImpl.java index 8722d52..2615258 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureTypeServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureTypeServiceImpl.java @@ -29,8 +29,12 @@ public class WorkingProcedureTypeServiceImpl extends CrudServiceImpl getWrapper(Map params){ + String name = (String)params.get("name"); + String code = (String)params.get("code"); QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(name), "name", name); + wrapper.like(StringUtils.isNotBlank(code), "code", code); wrapper.eq(ObjectUtils.isNotNull(params.get("status")), "status", params.get("status")); return wrapper; diff --git a/ym-baisc/src/main/resources/mapper/ProductFactoryRelationMapper.xml b/ym-baisc/src/main/resources/mapper/ProductFactoryRelationMapper.xml index a673544..509b663 100644 --- a/ym-baisc/src/main/resources/mapper/ProductFactoryRelationMapper.xml +++ b/ym-baisc/src/main/resources/mapper/ProductFactoryRelationMapper.xml @@ -2,4 +2,9 @@ + + diff --git a/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml b/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml index ae09175..68e2d03 100644 --- a/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml +++ b/ym-baisc/src/main/resources/mapper/ProductFeaturesMapper.xml @@ -69,4 +69,8 @@ order by pf.id asc + + diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/ControlGraphController.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/ControlGraphController.java index 818b39d..e5a8512 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/ControlGraphController.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/ControlGraphController.java @@ -49,7 +49,7 @@ public class ControlGraphController { @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class), @ApiImplicitParam(name = "type", value = "产品特征类型", paramType = "query", dataTypeClass = Integer.class) }) - @PreAuthorize("@ex.hasAuthority('code:controlGraph:page')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:page')") public Result> page(@ApiIgnore @RequestParam Map params){ PageData page = controlGraphService.page(params); @@ -58,7 +58,7 @@ public class ControlGraphController { @GetMapping("{id}") @ApiOperation("信息") - @PreAuthorize("@ex.hasAuthority('code:controlGraph:info')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:info')") public Result get(@PathVariable("id") Long id){ ControlGraphDTO data = controlGraphService.get(id); @@ -68,7 +68,7 @@ public class ControlGraphController { @PostMapping @ApiOperation("保存") @LogOperation("保存") - @PreAuthorize("@ex.hasAuthority('code:controlGraph:save')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:save')") public Result save(@RequestBody ControlGraphDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -81,7 +81,7 @@ public class ControlGraphController { @PutMapping @ApiOperation("修改") @LogOperation("修改") - @PreAuthorize("@ex.hasAuthority('code:controlGraph:update')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:update')") public Result update(@RequestBody ControlGraphDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -94,7 +94,7 @@ public class ControlGraphController { @DeleteMapping @ApiOperation("删除") @LogOperation("删除") - @PreAuthorize("@ex.hasAuthority('code:controlGraph:delete')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:delete')") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -107,7 +107,7 @@ public class ControlGraphController { @GetMapping("export") @ApiOperation("导出") @LogOperation("导出") - @PreAuthorize("@ex.hasAuthority('code:controlGraph:export')") + @PreAuthorize("@ex.hasAuthority('qualityPlanning:controlGraph:export')") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = controlGraphService.list(params); diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/InterpretationSchemeController.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/InterpretationSchemeController.java index c044955..3142660 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/InterpretationSchemeController.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/InterpretationSchemeController.java @@ -92,6 +92,15 @@ public class InterpretationSchemeController { return new Result().ok(dto.getId()); } + @PutMapping("batchUpdate") + @ApiOperation("批量修改") + public Result batchupdate(@RequestBody InterpretationSchemeDTO[] lists){ + + interpretationSchemeService.batchUpdate(lists); + + return new Result(); + } + @DeleteMapping @ApiOperation("删除") @LogOperation("删除") @@ -121,4 +130,13 @@ public class InterpretationSchemeController { return interpretationSchemeService.list(); } + @PostMapping(value = "listByMyInterpretationSchemeId") + @ApiOperation(value = "获取判读方案列表 依据自定义判读方案id") + @ApiImplicitParams({ + @ApiImplicitParam(name = "myInterpretationSchemeId", value = "自定义判读方案id", paramType = "query", required = true, dataTypeClass=Long.class) + }) + public List listByMyInterpretationSchemeId(@ApiIgnore @RequestParam Map params) { + return interpretationSchemeService.listByMyInterpretationSchemeId(params); + } + } \ No newline at end of file diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/MyInterpretationSchemeController.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/MyInterpretationSchemeController.java index 71c7f00..81b8733 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/MyInterpretationSchemeController.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/controller/MyInterpretationSchemeController.java @@ -12,6 +12,7 @@ import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.common.validator.group.UpdateGroup; import com.cnbm.qualityPlanning.dto.MyInterpretationSchemeDTO; import com.cnbm.qualityPlanning.excel.MyInterpretationSchemeExcel; +import com.cnbm.qualityPlanning.service.IInterpretationSchemeService; import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -66,6 +67,9 @@ public class MyInterpretationSchemeController { return new Result().ok(data); } + @Autowired + private IInterpretationSchemeService interpretationSchemeService; + @PostMapping @ApiOperation("保存") @LogOperation("保存") @@ -75,6 +79,9 @@ public class MyInterpretationSchemeController { ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); myInterpretationSchemeService.save(dto); + //System.out.println(dto.getId()); + //每新增一条自定义判读方案,同时对应新增十条判读方案 + //interpretationSchemeService.batchInsert(dto.getId()); return new Result().ok(dto.getId()); } diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/InterpretationSchemeDTO.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/InterpretationSchemeDTO.java index 4f9fcbc..af88784 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/InterpretationSchemeDTO.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/InterpretationSchemeDTO.java @@ -7,12 +7,14 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.math.BigDecimal; + /** * 判读方案 表 * * @author why - * @since 2022-08-15 + * @since 2022-09-20 */ @Data @ApiModel(value = "判读方案 表DTO对象") @@ -39,6 +41,12 @@ public class InterpretationSchemeDTO implements Serializable { @ApiModelProperty(value = "判读方案vaule2,(2)") private Integer ruleValue2; + @ApiModelProperty(value = "自定义判读方案id") + private Long myInterpretationSchemeId; + + @ApiModelProperty(value = "'1 = activate, 0 = inactivate '") + private Integer flag; + @ApiModelProperty(value = "备注") private String remark; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/MyInterpretationSchemeDTO.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/MyInterpretationSchemeDTO.java index 23587bb..4241791 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/MyInterpretationSchemeDTO.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/dto/MyInterpretationSchemeDTO.java @@ -30,9 +30,6 @@ public class MyInterpretationSchemeDTO implements Serializable { @ApiModelProperty(value = "自定义判读方案名") private String name; - @ApiModelProperty(value = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3") - private String interpretationSchemeIds; - @ApiModelProperty(value = "备注") private String remark; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/InterpretationScheme.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/InterpretationScheme.java index fff0a33..673b291 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/InterpretationScheme.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/InterpretationScheme.java @@ -1,20 +1,20 @@ package com.cnbm.qualityPlanning.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; -import java.io.Serializable; -import java.time.LocalDateTime; - /** *

* 判读方案 表 *

* * @author why - * @since 2022-08-16 + * @since 2022-09-20 */ @Data @TableName("interpretation_scheme") @@ -41,6 +41,12 @@ public class InterpretationScheme implements Serializable { @ApiModelProperty("判读方案vaule2,(2)") private Integer ruleValue2; + @ApiModelProperty("自定义判读方案id") + private Long myInterpretationSchemeId; + + @ApiModelProperty("'1 = activate, 0 = inactivate '") + private Integer flag; + @ApiModelProperty("备注") private String remark; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/MyInterpretationScheme.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/MyInterpretationScheme.java index 28c6c96..757e14d 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/MyInterpretationScheme.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/entity/MyInterpretationScheme.java @@ -32,9 +32,6 @@ public class MyInterpretationScheme implements Serializable { @ApiModelProperty("自定义判读方案名") private String name; - @ApiModelProperty("判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3") - private String interpretationSchemeIds; - @ApiModelProperty("备注") private String remark; diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/InterpretationSchemeExcel.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/InterpretationSchemeExcel.java index 4477788..cfe8b0d 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/InterpretationSchemeExcel.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/InterpretationSchemeExcel.java @@ -4,12 +4,15 @@ 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-15 + * @since 2022-09-20 */ @Data public class InterpretationSchemeExcel { @@ -25,6 +28,10 @@ public class InterpretationSchemeExcel { private Integer ruleValue1; @Excel(name = "判读方案vaule2,(2)") private Integer ruleValue2; + @Excel(name = "自定义判读方案id") + private Long myInterpretationSchemeId; + @Excel(name = "'1 = activate, 0 = inactivate '") + private Integer flag; @Excel(name = "备注") private String remark; @Excel(name = "删除标志,是否有效:1 可用 0不可用") diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/MyInterpretationSchemeExcel.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/MyInterpretationSchemeExcel.java index 709ec84..374eda8 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/MyInterpretationSchemeExcel.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/excel/MyInterpretationSchemeExcel.java @@ -19,8 +19,6 @@ public class MyInterpretationSchemeExcel { private Integer code; @Excel(name = "自定义判读方案名") private String name; - @Excel(name = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3") - private String interpretationSchemeIds; @Excel(name = "备注") private String remark; @Excel(name = "删除标志,是否有效:1 可用 0不可用") diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/mapper/InterpretationSchemeMapper.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/mapper/InterpretationSchemeMapper.java index 265abf0..f770d83 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/mapper/InterpretationSchemeMapper.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/mapper/InterpretationSchemeMapper.java @@ -6,6 +6,7 @@ import com.cnbm.qualityPlanning.entity.InterpretationScheme; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; /** * 判读方案 表 @@ -18,4 +19,8 @@ public interface InterpretationSchemeMapper extends BaseDao list(); + List listByMyInterpretationSchemeId(Map params); + + void batchInsert(Long myInterpretationSchemeId); + } \ No newline at end of file diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/IInterpretationSchemeService.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/IInterpretationSchemeService.java index 92b9d72..d65b913 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/IInterpretationSchemeService.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/IInterpretationSchemeService.java @@ -24,7 +24,13 @@ public interface IInterpretationSchemeService extends CrudService list(); + + List listByMyInterpretationSchemeId(Map params); + + void batchInsert(Long myInterpretationSchemeId); } \ No newline at end of file diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/InterpretationSchemeServiceImpl.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/InterpretationSchemeServiceImpl.java index ad80b65..dace686 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/InterpretationSchemeServiceImpl.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/InterpretationSchemeServiceImpl.java @@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.common.utils.ConvertUtils; +import com.cnbm.common.validator.ValidatorUtils; +import com.cnbm.common.validator.group.DefaultGroup; +import com.cnbm.common.validator.group.UpdateGroup; import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO; import com.cnbm.qualityPlanning.entity.InterpretationScheme; import com.cnbm.qualityPlanning.mapper.InterpretationSchemeMapper; @@ -64,12 +67,48 @@ public class InterpretationSchemeServiceImpl extends CrudServiceImpl lists= new ArrayList<>(); + lists.add(InterpretationSchemeDTO.builder().code(1).ruleNum(1).ruleKey("规则一:有1点落在三倍标准差以外").myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(2).ruleNum(2).ruleKey("规则二:连续x点落在管制中心线同一侧").ruleValue1(6).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(3).ruleNum(3).ruleKey("规则三:连续x点持续上升或下降").ruleValue1(6).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(4).ruleNum(4).ruleKey("规则四:连续x点交替上下跳动").ruleValue1(14).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(5).ruleNum(5).ruleKey("规则五:连续x点中有x点落在中心线同侧两倍标准差以外").ruleValue1(3).ruleValue2(2).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(6).ruleNum(6).ruleKey("规则六:连续x点中有x点落在中心线同侧一倍标准差以外").ruleValue1(5).ruleValue2(4).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(7).ruleNum(7).ruleKey("规则七:连续x点落在中心线两侧的一倍标准差以内").ruleValue1(15).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(8).ruleNum(8).ruleKey("规则八:连续x点落在中心线两侧但未在一倍标准差以内").ruleValue1(8).myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(9).ruleNum(9).ruleKey("规则九:落在规格线以外").myInterpretationSchemeId(myInterpretationSchemeId).build()); + lists.add(InterpretationSchemeDTO.builder().code(10).ruleNum(10).ruleKey("规则十:CPK小于目标值").myInterpretationSchemeId(myInterpretationSchemeId).build()); + + for(InterpretationSchemeDTO dto:lists){ + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + save(dto); + } + */ + mapper.batchInsert(myInterpretationSchemeId); + } + + @Override @Transactional(rollbackFor = Exception.class) public void update(InterpretationSchemeDTO dto) { InterpretationScheme entity = ConvertUtils.sourceToTarget(dto, InterpretationScheme.class); updateById(entity); } + + @Override + @Transactional(rollbackFor = Exception.class) + public void batchUpdate(InterpretationSchemeDTO[] lists) { + for(InterpretationSchemeDTO dto:lists){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + update(dto); + } + } @Override @Transactional(rollbackFor = Exception.class) @@ -84,5 +123,12 @@ public class InterpretationSchemeServiceImpl extends CrudServiceImpl list = mapper.list(); return list; } + + @Override + @Transactional(rollbackFor = Exception.class) + public List listByMyInterpretationSchemeId(Map params) { + List listByMyInterpretationSchemeId = mapper.listByMyInterpretationSchemeId(params); + return listByMyInterpretationSchemeId; + } } \ No newline at end of file diff --git a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/MyInterpretationSchemeServiceImpl.java b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/MyInterpretationSchemeServiceImpl.java index c98e468..2ddb1f7 100644 --- a/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/MyInterpretationSchemeServiceImpl.java +++ b/ym-quality-planning/src/main/java/com/cnbm/qualityPlanning/service/impl/MyInterpretationSchemeServiceImpl.java @@ -10,6 +10,7 @@ import com.cnbm.qualityPlanning.entity.MyInterpretationScheme; import com.cnbm.qualityPlanning.mapper.MyInterpretationSchemeMapper; import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -52,11 +53,18 @@ public class MyInterpretationSchemeServiceImpl extends CrudServiceImpl select * from interpretation_scheme - order by id asc + order by rule_num asc - + + + + insert into interpretation_scheme(code,rule_num,rule_key,rule_value1,rule_value2,my_interpretation_scheme_id) values + (1,1,'规则一:有1点落在三倍标准差以外',null,null,#{myInterpretationSchemeId}), + (2,2,'规则二:连续x点落在管制中心线同一侧',6,null,#{myInterpretationSchemeId}), + (3,3,'规则三:连续x点持续上升或下降',6,null,#{myInterpretationSchemeId}), + (4,4,'规则四:连续x点交替上下跳动',14,null,#{myInterpretationSchemeId}), + (5,5,'规则五:连续x点中有x点落在中心线同侧两倍标准差以外',3,2,#{myInterpretationSchemeId}), + (6,6,'规则六:连续x点中有x点落在中心线同侧一倍标准差以外',5,4,#{myInterpretationSchemeId}), + (7,7,'规则七:连续x点落在中心线两侧的一倍标准差以内',15,null,#{myInterpretationSchemeId}), + (8,8,'规则八:连续x点落在中心线两侧但未在一倍标准差以内',8,null,#{myInterpretationSchemeId}), + (9,9,'规则九:落在规格线以外',null,null,#{myInterpretationSchemeId}), + (10,10,'规则十:CPK小于目标值',null,null,#{myInterpretationSchemeId}) + + + \ No newline at end of file From 1b9c3499a3a104eb03f30ff5be425400c81abad5 Mon Sep 17 00:00:00 2001 From: yanyang Date: Fri, 25 Nov 2022 10:06:25 +0800 Subject: [PATCH 2/2] m --- .../controller/InspectionSheetController.java | 11 ++++++ .../dto/InspectionSampleDTO.java | 25 ++++++++++++ .../service/IInspectionSheetService.java | 3 ++ .../impl/InspectionSheetServiceImpl.java | 38 +++++++++++++++++-- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/InspectionSampleDTO.java diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java index bc08129..812ac64 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/controller/InspectionSheetController.java @@ -1,6 +1,7 @@ package com.cnbm.processInspection.controller; import com.cnbm.admin.annotation.LogOperation; +import com.cnbm.basic.dto.ProductFeaturesDTO; import com.cnbm.common.constant.Constant; import com.cnbm.common.page.PageData; import com.cnbm.common.utils.ExcelUtils; @@ -11,6 +12,7 @@ import com.cnbm.common.validator.group.AddGroup; import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.common.validator.group.UpdateGroup; import com.cnbm.influx.param.QueryDataParam; +import com.cnbm.processInspection.dto.InspectionSampleDTO; import com.cnbm.processInspection.dto.InspectionSheetDTO; import com.cnbm.processInspection.excel.InspectionSheetExcel; import com.cnbm.processInspection.service.IInspectionSheetService; @@ -154,4 +156,13 @@ public class InspectionSheetController { return inspectionSheetService.getFluxParamList(params); } + @PutMapping("saveFluxParamList") + @ApiOperation("将样本检测参数写入influxdb") + public Result saveFluxParamList(@RequestBody InspectionSampleDTO[] lists){ + + inspectionSheetService.saveFluxParamList(lists); + + return new Result(); + } + } \ No newline at end of file diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/InspectionSampleDTO.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/InspectionSampleDTO.java new file mode 100644 index 0000000..f1f603a --- /dev/null +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/dto/InspectionSampleDTO.java @@ -0,0 +1,25 @@ +package com.cnbm.processInspection.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 检验样本 表 + * + * @author yanyang + * @since 2022-11-24 + */ +@Data +@ApiModel(value = "检验样本 DTO对象") +public class InspectionSampleDTO implements Serializable { + + @ApiModelProperty(value = "工序名称,关联working_procedure表") + private String workingProcedureName; + + @ApiModelProperty(value = "检验单id") + private String inspectionSheetId; + +} diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/IInspectionSheetService.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/IInspectionSheetService.java index 529e55b..0550160 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/IInspectionSheetService.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/IInspectionSheetService.java @@ -3,6 +3,7 @@ package com.cnbm.processInspection.service; import com.cnbm.common.page.PageData; import com.cnbm.common.service.CrudService; import com.cnbm.influx.param.QueryDataParam; +import com.cnbm.processInspection.dto.InspectionSampleDTO; import com.cnbm.processInspection.dto.InspectionSheetDTO; import com.cnbm.processInspection.entity.InspectionSheet; import com.influxdb.query.FluxTable; @@ -31,5 +32,7 @@ public interface IInspectionSheetService extends CrudService list(Map params); List getFluxParamList(Map params); + + void saveFluxParamList(InspectionSampleDTO[] lists); } \ No newline at end of file diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java index 712e05e..69bdd99 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java @@ -3,6 +3,8 @@ package com.cnbm.processInspection.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.basic.dto.ProductFactoryRelationDTO; +import com.cnbm.basic.dto.ProductFeaturesDTO; import com.cnbm.basic.entity.Machine; import com.cnbm.basic.entity.Product; import com.cnbm.basic.entity.Shift; @@ -14,25 +16,30 @@ import com.cnbm.basic.service.impl.WorkingProcedureServiceImpl; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.common.utils.ConvertUtils; +import com.cnbm.common.validator.ValidatorUtils; +import com.cnbm.common.validator.group.AddGroup; +import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.influx.config.InfluxClient; import com.cnbm.influx.param.QueryDataParam; import com.cnbm.influx.param.Range; import com.cnbm.influx.template.Event; +import com.cnbm.processInspection.dto.InspectionSampleDTO; import com.cnbm.processInspection.dto.InspectionSheetDTO; import com.cnbm.processInspection.entity.InspectionSheet; import com.cnbm.processInspection.mapper.InspectionSheetMapper; import com.cnbm.processInspection.service.IInspectionSheetService; +import com.fasterxml.jackson.core.JsonProcessingException; import com.influxdb.query.FluxTable; 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 org.springframework.web.bind.annotation.RequestBody; import java.time.Instant; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; /** * 检验单 表 @@ -167,4 +174,27 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl list = InfluxClient.Client.query(queryDataParam); return list; } + + @Override + public void saveFluxParamList(@RequestBody InspectionSampleDTO[] lists){ + for(InspectionSampleDTO dto:lists){ + String equipmentName = dto.getWorkingProcedureName(); + LocalDateTime eventTimestamp = LocalDateTime.now(); + Instant eventTime = eventTimestamp.toInstant(ZoneOffset.UTC); + String inspectionSheetId =dto.getInspectionSheetId(); +// Event event = new Event(eventTime,inspectionSheetId,"ppExecName",ppExecName); +// InfluxClient.Client.insert(event,equipmentName); + } + } + + private Event newEvent(Instant time,String inspectionSheetId,String argName,Double argValue){ + Event event = new Event(); + event.setInspectionSheetId(inspectionSheetId); + event.setTime(time); + event.setArgName(argName); + if(!Objects.equals(argValue, "") && argValue != null ){ + event.setArgValue(argValue); + } + return event; + } } \ No newline at end of file