Explorar o código

部件字典管理接口和部件po

shiyue hai 6 meses
pai
achega
b0ceec30f7

+ 5 - 1
energy-manage-common/src/main/java/com/energy/manage/common/enums/IdPrefixEnum.java

@@ -14,7 +14,11 @@ public enum IdPrefixEnum {
     WIND_TOWER_NUMBER("WOT", "测风塔信息编号"),
     WIND_ENGINE_BATCH_NUMBER("WOB","风机批次编号"),
 
-    UNIT_DICT_TYPE_CODE("UDTC","部件字典编号");
+    UNIT_DICT_TYPE_CODE("UDTC","部件字典编号"),
+
+    UNIT_BEARINGS_CODE("UTINTB","部件主轴"),
+    UNIT_GEAR_CODE("UTINTG","部件齿轮箱"),
+    UNIT_DYNAMO_CODE("UTINTD","部件发电机");
 
     IdPrefixEnum(String code, String name) {
         this.code = code;

+ 1 - 1
energy-manage-common/src/main/java/com/energy/manage/common/po/units/UnitGearboxStructurePO.java

@@ -25,7 +25,7 @@ public class UnitGearboxStructurePO extends NewBaseDomain {
     /**
      * 齿轮箱结构类型;1.行星轮2.平行轮
      */
-    private String untitled;
+    private Integer gearboxStructure;
     /**
      * 齿轮箱结构等级;sort_num1,2......
      */

+ 26 - 0
energy-manage-service/src/main/java/com/energy/manage/service/controller/units/UnitController.java

@@ -1,13 +1,16 @@
 package com.energy.manage.service.controller.units;
 
 
+import com.dtflys.forest.annotation.Get;
 import com.energy.manage.common.reponse.ResultResp;
 import com.energy.manage.service.config.annotations.UserLoginToken;
 import com.energy.manage.service.controller.base.BaseServiceController;
 import com.energy.manage.service.domain.dto.units.UnitDictBrandModelDto;
 import com.energy.manage.service.domain.dto.units.UnitDictConstantsDelDto;
 import com.energy.manage.service.domain.dto.units.UnitDictRoutineDto;
+import com.energy.manage.service.domain.dto.units.UnitDto;
 import com.energy.manage.service.domain.vo.units.UnitDictRoutineListVo;
+import com.energy.manage.service.domain.vo.units.UnitVo;
 import com.energy.manage.service.service.units.UnitService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -54,6 +57,29 @@ public class UnitController extends BaseServiceController {
 
 
 
+    @UserLoginToken
+    @PostMapping(value = "/modificationUnit")
+    @ApiOperation(value = "更新部件相关信息")
+    public ResultResp modificationUnit(@RequestBody @Valid UnitDto unitDto) {
+
+
+
+        boolean flg =  unitService.modificationUnit(unitDto);
+        return flg ? ResultResp.SUCCESS() : ResultResp.FAIL();
+    }
+
+
+
+    @UserLoginToken
+    @GetMapping(value = "/getUnitVo")
+    @ApiOperation(value = "通过机型编号查询部件信息")
+    public ResultResp<UnitVo> getUnitVo(@RequestParam String millTypeCode) {
+        UnitVo vo = unitService.getUnitVo(millTypeCode);
+        return ResultResp.SUCCESS(vo);
+    }
+
+
+
 
 
 

+ 320 - 20
energy-manage-service/src/main/java/com/energy/manage/service/domain/dto/units/UnitDto.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
+import org.springframework.util.CollectionUtils;
 
 import java.util.List;
 
@@ -15,6 +16,12 @@ import java.util.List;
 @ApiModel("保存更新部件信息相关参数")
 public class UnitDto {
 
+    /**
+     * 机型编号
+     */
+    @ApiModelProperty("机型编号")
+    private String millTypeCode;
+
     @ApiModelProperty("主轴相关参数")
     UnitBearingsDto unitBearingsDto;
 
@@ -38,36 +45,75 @@ public class UnitDto {
         /**
          * 主键
          */
+        @ApiModelProperty("主键")
         private Integer id;
 
         /**
          * 部件编号
          */
+        @ApiModelProperty("部件编号")
         private String code;
-        /**
-         * 机型编号
-         */
-        private String millTypeCode;
+
         /**
          * 润滑油品牌
          */
+        @ApiModelProperty("润滑油品牌")
         private String lubricantBrand;
         /**
          * 润滑油型号
          */
+        @ApiModelProperty("润滑油型号")
         private String lubricantModel;
 
 
         /**
+         * 齿轮箱轴承集合
+         */
+        @ApiModelProperty("齿轮箱轴承集合")
+        List<UnitGearboxBearingsDto> unitGearboxBearingsDtoList;
+
+        /**
          * 齿轮箱结构集合
          */
+        @ApiModelProperty("齿轮箱结构集合")
         List<UnitGearboxStructureDto> unitGearboxStructureDtoList;
 
-
         /**
-         * 齿轮箱结构集合
+         * 数据校验
+         * @param unitGearDto
+         * @return
          */
-        List<UnitGearboxBearingsDto> unitGearboxBearingsDtoList;
+        public static boolean isValid(UnitGearDto unitGearDto) {
+            if (unitGearDto == null) {
+                return false;
+            }
+
+            if (unitGearDto.getId() == null) {
+                return false;
+            }
+
+            if (unitGearDto.getCode() == null || unitGearDto.getCode().isEmpty()) {
+                return false;
+            }
+
+            if (unitGearDto.getLubricantBrand() == null || unitGearDto.getLubricantBrand().isEmpty()) {
+                return false;
+            }
+
+            if (unitGearDto.getLubricantModel() == null || unitGearDto.getLubricantModel().isEmpty()) {
+                return false;
+            }
+
+            if (CollectionUtils.isEmpty(unitGearDto.getUnitGearboxStructureDtoList())) {
+                return false;
+            }
+
+            if (CollectionUtils.isEmpty(unitGearDto.getUnitGearboxBearingsDtoList())) {
+                return false;
+            }
+
+            return true;
+        }
 
 
     }
@@ -80,61 +126,143 @@ public class UnitDto {
     @ApiModel
     public static class UnitGearboxStructureDto{
 
+        @ApiModelProperty("主键")
         private Integer id;
 
         /**
          * 齿轮箱总表编号
          */
+        @ApiModelProperty("齿轮箱总表编号")
         private String gearboxCode;
         /**
          * 齿轮箱结构类型;1.行星轮2.平行轮
          */
-        private String untitled;
+        @ApiModelProperty("齿轮箱结构类型;1.行星轮2.平行轮")
+        private Integer gearboxStructure;
         /**
          * 齿轮箱结构等级;sort_num1,2......
          */
+        @ApiModelProperty("齿轮箱结构等级;sort_num1,2......")
         private Integer planetaryGearGrade;
         /**
          * 大齿轮齿数
          */
+        @ApiModelProperty("大齿轮齿数")
         private String largeGearTeethCount;
         /**
          * 小齿轮齿数
          */
+        @ApiModelProperty("小齿轮齿数")
         private String smallGearTeethCount;
         /**
          * 轴承品牌
          */
+        @ApiModelProperty("轴承品牌")
         private String bearingBrand;
         /**
          * 轴承型号
          */
+        @ApiModelProperty("轴承型号")
         private String bearingModel;
         /**
          * 齿圈齿数
          */
+        @ApiModelProperty("齿圈齿数")
         private String gearRingTeethCount;
         /**
          * 太阳轮齿数
          */
+        @ApiModelProperty("太阳轮齿数")
         private String sunWheelTeethCount;
         /**
          * 行星轮个数
          */
+        @ApiModelProperty("行星轮个数")
         private String planetWheelCount;
         /**
          * 行星轮齿数
          */
+        @ApiModelProperty("行星轮齿数")
         private String planetWheelTeethCount;
         /**
          * 太阳轮轴承品牌
          */
+        @ApiModelProperty("太阳轮轴承品牌")
         private String sunWheelBearingBrand;
         /**
          * 太阳轮轴承型号
          */
+        @ApiModelProperty("太阳轮轴承型号")
         private String sunWheelBearingModel;
 
+        /**
+         * 数据校验
+         * @param dto
+         * @return
+         */
+        public static boolean isValid(UnitGearboxStructureDto dto) {
+            if (dto == null) {
+                return false;
+            }
+
+            if (dto.getId() == null) {
+                return false;
+            }
+
+            if (dto.getGearboxCode() == null || dto.getGearboxCode().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getGearboxStructure() == null) {
+                return false;
+            }
+
+            if (dto.getPlanetaryGearGrade() == null) {
+                return false;
+            }
+
+            if (dto.getLargeGearTeethCount() == null || dto.getLargeGearTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getSmallGearTeethCount() == null || dto.getSmallGearTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getBearingBrand() == null || dto.getBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getBearingModel() == null || dto.getBearingModel().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getGearRingTeethCount() == null || dto.getGearRingTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getSunWheelTeethCount() == null || dto.getSunWheelTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getPlanetWheelCount() == null || dto.getPlanetWheelCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getPlanetWheelTeethCount() == null || dto.getPlanetWheelTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getSunWheelBearingBrand() == null || dto.getSunWheelBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (dto.getSunWheelBearingModel() == null || dto.getSunWheelBearingModel().isEmpty()) {
+                return false;
+            }
+
+            return true;
+        }
 
     }
 
@@ -147,53 +275,126 @@ public class UnitDto {
     @ApiModel
     public static class UnitGearboxBearingsDto{
 
+        @ApiModelProperty("主键")
         private Integer id;
 
         /**
          * 齿轮箱编号
          */
+        @ApiModelProperty("齿轮箱编号")
         private String gearboxCode;
+
         /**
-         * 齿轮箱轴承类型
+         * 齿轮箱轴承类型1.低速轴,2.低速中间轴3.高速轴
          */
+        @ApiModelProperty("齿轮箱轴承类型1.低速轴,2.低速中间轴3.高速轴")
         private Integer parallelWheelGrade;
         /**
          * 齿轮箱轴承编号
          */
+        @ApiModelProperty("齿轮箱轴承编号")
         private String gearboxBearingNumber;
         /**
-         * 齿轮箱轴承级别
+         * 齿轮箱轴承级别1.2.3
          */
+        @ApiModelProperty(" 齿轮箱轴承级别1.2.3")
         private String gearboxBearingLevel;
         /**
          * 轴承品牌
          */
+        @ApiModelProperty("轴承品牌")
         private String bearingBrand;
         /**
          * 轴承型号
          */
+        @ApiModelProperty("轴承型号")
         private String bearingModel;
         /**
          * 齿圈齿数
          */
+        @ApiModelProperty("齿圈齿数")
         private String gearRingTeethCount;
         /**
          * 轴承-RS品牌
          */
+        @ApiModelProperty("轴承-RS品牌")
         private String bearingRsBrand;
         /**
          * 轴承-RS型号
          */
+        @ApiModelProperty(" 轴承-RS型号")
         private String bearingRsModel;
         /**
          * 轴承-GS品牌
          */
+        @ApiModelProperty("轴承-GS品牌")
         private String bearingGsBrand;
         /**
          * 轴承-GS型号
          */
+        @ApiModelProperty("轴承-GS型号")
         private String bearingGsModel;
 
+        /**
+         * 数据校验
+         * @param gearboxBearing
+         * @return
+         */
+        public static boolean isValid(UnitGearboxBearingsDto gearboxBearing) {
+            if (gearboxBearing == null) {
+                return false;
+            }
+
+            if (gearboxBearing.getId() == null) {
+                return false;
+            }
+
+            if (gearboxBearing.getGearboxCode() == null || gearboxBearing.getGearboxCode().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getParallelWheelGrade() == null) {
+                return false;
+            }
+
+            if (gearboxBearing.getGearboxBearingNumber() == null || gearboxBearing.getGearboxBearingNumber().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getGearboxBearingLevel() == null || gearboxBearing.getGearboxBearingLevel().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingBrand() == null || gearboxBearing.getBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingModel() == null || gearboxBearing.getBearingModel().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getGearRingTeethCount() == null || gearboxBearing.getGearRingTeethCount().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingRsBrand() == null || gearboxBearing.getBearingRsBrand().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingRsModel() == null || gearboxBearing.getBearingRsModel().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingGsBrand() == null || gearboxBearing.getBearingGsBrand().isEmpty()) {
+                return false;
+            }
+
+            if (gearboxBearing.getBearingGsModel() == null || gearboxBearing.getBearingGsModel().isEmpty()) {
+                return false;
+            }
+
+            return true;
+        }
 
     }
 
@@ -210,44 +411,90 @@ public class UnitDto {
         /**
          * 主键
          */
+        @ApiModelProperty("主键")
         private Integer id;
 
         /**
          * 主轴部件编号;主轴部件编号
          */
+        @ApiModelProperty("主轴部件编号")
         private String code;
-        /**
-         * 机型编号
-         */
-        private String millTypeCode;
+
         /**
          * 润滑油品牌
          */
+        @ApiModelProperty("润滑油品牌")
         private String lubricantBrand;
         /**
          * 润滑油型号
          */
+        @ApiModelProperty("润滑油型号")
         private String lubricantModel;
         /**
          * 前轴承品牌
          */
+        @ApiModelProperty("前轴承品牌")
         private String frontBearingBrand;
         /**
          * 前轴承型号
          */
+        @ApiModelProperty("前轴承型号")
         private String frontBearingModel;
         /**
          * 后轴承品牌
          */
+        @ApiModelProperty("后轴承品牌")
         private String rearBearingBrand;
         /**
          * 后轴承型号
          */
+        @ApiModelProperty("后轴承型号")
         private String rearBearingModel;
+
         /**
-         * 删除状态;删除状态
+         * 数据验证
+         * @param component
+         * @return
          */
-        private Integer delState;
+        public static boolean isValid(UnitBearingsDto component) {
+            if (component == null) {
+                return false;
+            }
+
+            if (component.getId() == null) {
+                return false;
+            }
+
+            if (component.getCode() == null || component.getCode().isEmpty()) {
+                return false;
+            }
+
+            if (component.getLubricantBrand() == null || component.getLubricantBrand().isEmpty()) {
+                return false;
+            }
+
+            if (component.getLubricantModel() == null || component.getLubricantModel().isEmpty()) {
+                return false;
+            }
+
+            if (component.getFrontBearingBrand() == null || component.getFrontBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (component.getFrontBearingModel() == null || component.getFrontBearingModel().isEmpty()) {
+                return false;
+            }
+
+            if (component.getRearBearingBrand() == null || component.getRearBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (component.getRearBearingModel() == null || component.getRearBearingModel().isEmpty()) {
+                return false;
+            }
+
+            return true;
+        }
 
     }
 
@@ -263,45 +510,98 @@ public class UnitDto {
         /**
          * 主键
          */
+        @ApiModelProperty("主键")
         private Integer id;
 
         /**
-         * 机型编号
-         */
-        private String millTypeCode;
-        /**
          * 极对数
          */
+        @ApiModelProperty("极对数")
         private Integer polePairs;
         /**
          * 冷却方式
          */
+        @ApiModelProperty("冷却方式")
         private Integer coolingMethod;
         /**
          * 润滑油品牌
          */
+        @ApiModelProperty("润滑油品牌")
         private String lubricantBrand;
         /**
          * 润滑油型号
          */
+        @ApiModelProperty("润滑油型号")
         private String lubricantModel;
         /**
          * 驱动端轴承品牌
          */
+        @ApiModelProperty("驱动端轴承品牌")
         private String driveEndBearingBrand;
         /**
          * 驱动端轴承型号
          */
+        @ApiModelProperty("驱动端轴承型号")
         private String driveEndBearingModel;
         /**
          * 非驱动端轴承品牌
          */
+        @ApiModelProperty("非驱动端轴承品牌")
         private String nonDriveEndBearingBrand;
         /**
          * 非驱动端轴承型号
          */
+        @ApiModelProperty("非驱动端轴承型号")
         private String nonDriveEndBearingModel;
 
+        /**
+         * 数据校验
+         * @param motor
+         * @return
+         */
+        public static boolean isValid(UnitDynamoDto motor) {
+            if (motor == null) {
+                return false;
+            }
+
+            if (motor.getId() == null) {
+                return false;
+            }
+
+            if (motor.getPolePairs() == null) {
+                return false;
+            }
+
+            if (motor.getCoolingMethod() == null) {
+                return false;
+            }
+
+            if (motor.getLubricantBrand() == null || motor.getLubricantBrand().isEmpty()) {
+                return false;
+            }
+
+            if (motor.getLubricantModel() == null || motor.getLubricantModel().isEmpty()) {
+                return false;
+            }
+
+            if (motor.getDriveEndBearingBrand() == null || motor.getDriveEndBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (motor.getDriveEndBearingModel() == null || motor.getDriveEndBearingModel().isEmpty()) {
+                return false;
+            }
+
+            if (motor.getNonDriveEndBearingBrand() == null || motor.getNonDriveEndBearingBrand().isEmpty()) {
+                return false;
+            }
+
+            if (motor.getNonDriveEndBearingModel() == null || motor.getNonDriveEndBearingModel().isEmpty()) {
+                return false;
+            }
+
+            return true;
+        }
 
     }
 

+ 354 - 0
energy-manage-service/src/main/java/com/energy/manage/service/domain/vo/units/UnitVo.java

@@ -0,0 +1,354 @@
+package com.energy.manage.service.domain.vo.units;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * 显示部件相关信息
+ */
+@Getter
+@Setter
+@ApiModel("显示部件相关信息")
+public class UnitVo {
+
+    /**
+     * 机型编号
+     */
+    @ApiModelProperty("机型编号")
+    private String millTypeCode;
+
+    @ApiModelProperty("主轴相关参数")
+    UnitBearingsVo unitBearingsVo;
+
+
+    @ApiModelProperty("齿轮箱相关参数")
+    UnitGearVo unitGearVo;
+
+
+    @ApiModelProperty("发电机相关参数")
+    UnitDynamoVo unitDynamoVo;
+
+
+    /**
+     * 齿轮箱相关参数
+     */
+    @Setter
+    @Getter
+    @ApiModel("齿轮箱相关")
+    public static class UnitGearVo{
+
+        /**
+         * 主键
+         */
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        /**
+         * 部件编号
+         */
+        @ApiModelProperty("部件编号")
+        private String code;
+
+        /**
+         * 润滑油品牌
+         */
+        @ApiModelProperty("润滑油品牌")
+        private String lubricantBrand;
+        /**
+         * 润滑油型号
+         */
+        @ApiModelProperty("润滑油型号")
+        private String lubricantModel;
+
+
+        /**
+         * 齿轮箱轴承集合
+         */
+        @ApiModelProperty("齿轮箱轴承集合")
+        List<UnitGearboxBearingsVo> unitGearboxBearingsList;
+
+        /**
+         * 齿轮箱结构集合
+         */
+        @ApiModelProperty("齿轮箱结构集合")
+        List<UnitGearboxStructureVo> unitGearboxStructureList;
+
+
+    }
+
+    /**
+     * 齿轮箱结构表
+     */
+    @Setter
+    @Getter
+    @ApiModel("齿轮箱结构表")
+    public static class UnitGearboxStructureVo{
+
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        /**
+         * 齿轮箱总表编号
+         */
+        @ApiModelProperty("齿轮箱总表编号")
+        private String gearboxCode;
+        /**
+         * 齿轮箱结构类型;1.行星轮2.平行轮
+         */
+        @ApiModelProperty("齿轮箱结构类型;1.行星轮2.平行轮")
+        private Integer gearboxStructure;
+        /**
+         * 齿轮箱结构等级;sort_num1,2......
+         */
+        @ApiModelProperty("齿轮箱结构等级;sort_num1,2......")
+        private Integer planetaryGearGrade;
+        /**
+         * 大齿轮齿数
+         */
+        @ApiModelProperty("大齿轮齿数")
+        private String largeGearTeethCount;
+        /**
+         * 小齿轮齿数
+         */
+        @ApiModelProperty("小齿轮齿数")
+        private String smallGearTeethCount;
+        /**
+         * 轴承品牌
+         */
+        @ApiModelProperty("轴承品牌")
+        private String bearingBrand;
+        /**
+         * 轴承型号
+         */
+        @ApiModelProperty("轴承型号")
+        private String bearingModel;
+        /**
+         * 齿圈齿数
+         */
+        @ApiModelProperty("齿圈齿数")
+        private String gearRingTeethCount;
+        /**
+         * 太阳轮齿数
+         */
+        @ApiModelProperty("太阳轮齿数")
+        private String sunWheelTeethCount;
+        /**
+         * 行星轮个数
+         */
+        @ApiModelProperty("行星轮个数")
+        private String planetWheelCount;
+        /**
+         * 行星轮齿数
+         */
+        @ApiModelProperty("行星轮齿数")
+        private String planetWheelTeethCount;
+        /**
+         * 太阳轮轴承品牌
+         */
+        @ApiModelProperty("太阳轮轴承品牌")
+        private String sunWheelBearingBrand;
+        /**
+         * 太阳轮轴承型号
+         */
+        @ApiModelProperty("太阳轮轴承型号")
+        private String sunWheelBearingModel;
+
+
+    }
+
+
+    /**
+     * 齿轮箱轴承
+     */
+    @Setter
+    @Getter
+    @ApiModel
+    public static class UnitGearboxBearingsVo{
+
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        /**
+         * 齿轮箱编号
+         */
+        @ApiModelProperty("齿轮箱编号")
+        private String gearboxCode;
+        /**
+         * 齿轮箱轴承类型1.低速轴,2.低速中间轴3.高速轴
+         */
+        @ApiModelProperty("齿轮箱轴承类型1.低速轴,2.低速中间轴3.高速轴")
+        private Integer parallelWheelGrade;
+        /**
+         * 齿轮箱轴承编号
+         */
+        @ApiModelProperty("齿轮箱轴承编号")
+        private String gearboxBearingNumber;
+        /**
+         * 齿轮箱轴承级别1.2.3
+         */
+        @ApiModelProperty("齿轮箱轴承级别1.2.3")
+        private String gearboxBearingLevel;
+        /**
+         * 轴承品牌
+         */
+        @ApiModelProperty("轴承品牌")
+        private String bearingBrand;
+        /**
+         * 轴承型号
+         */
+        @ApiModelProperty("轴承型号")
+        private String bearingModel;
+        /**
+         * 齿圈齿数
+         */
+        @ApiModelProperty("齿圈齿数")
+        private String gearRingTeethCount;
+        /**
+         * 轴承-RS品牌
+         */
+        @ApiModelProperty("轴承-RS品牌")
+        private String bearingRsBrand;
+        /**
+         * 轴承-RS型号
+         */
+        @ApiModelProperty("轴承-RS型号")
+        private String bearingRsModel;
+        /**
+         * 轴承-GS品牌
+         */
+        @ApiModelProperty("轴承-GS品牌")
+        private String bearingGsBrand;
+        /**
+         * 轴承-GS型号
+         */
+        @ApiModelProperty("轴承-GS型号")
+        private String bearingGsModel;
+
+
+    }
+
+
+
+    /**
+     * 主轴相关参数
+     */
+    @Setter
+    @Getter
+    @ApiModel
+    public static class UnitBearingsVo {
+
+        /**
+         * 主键
+         */
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        /**
+         * 主轴部件编号
+         */
+        @ApiModelProperty("主轴部件编号")
+        private String code;
+
+        /**
+         * 润滑油品牌
+         */
+        @ApiModelProperty("润滑油品牌")
+        private String lubricantBrand;
+        /**
+         * 润滑油型号
+         */
+        @ApiModelProperty("润滑油型号")
+        private String lubricantModel;
+        /**
+         * 前轴承品牌
+         */
+        @ApiModelProperty("前轴承品牌")
+        private String frontBearingBrand;
+        /**
+         * 前轴承型号
+         */
+        @ApiModelProperty("前轴承型号")
+        private String frontBearingModel;
+        /**
+         * 后轴承品牌
+         */
+        @ApiModelProperty("后轴承品牌")
+        private String rearBearingBrand;
+        /**
+         * 后轴承型号
+         */
+        @ApiModelProperty("后轴承型号")
+        private String rearBearingModel;
+        /**
+         * 删除状态
+         */
+        @ApiModelProperty("删除状态")
+        private Integer delState;
+
+    }
+
+
+    /**
+     * 发电机相关参数
+     */
+    @Setter
+    @Getter
+    @ApiModel
+    public static class UnitDynamoVo {
+
+        /**
+         * 主键
+         */
+        @ApiModelProperty("主键")
+        private Integer id;
+
+        /**
+         * 极对数
+         */
+        @ApiModelProperty("极对数")
+        private Integer polePairs;
+        /**
+         * 冷却方式
+         */
+        @ApiModelProperty("冷却方式")
+        private Integer coolingMethod;
+        /**
+         * 润滑油品牌
+         */
+        @ApiModelProperty("润滑油品牌")
+        private String lubricantBrand;
+        /**
+         * 润滑油型号
+         */
+        @ApiModelProperty("润滑油型号")
+        private String lubricantModel;
+        /**
+         * 驱动端轴承品牌
+         */
+        @ApiModelProperty("驱动端轴承品牌")
+        private String driveEndBearingBrand;
+        /**
+         * 驱动端轴承型号
+         */
+        @ApiModelProperty("驱动端轴承型号")
+        private String driveEndBearingModel;
+        /**
+         * 非驱动端轴承品牌
+         */
+        @ApiModelProperty("非驱动端轴承品牌")
+        private String nonDriveEndBearingBrand;
+        /**
+         * 非驱动端轴承型号
+         */
+        @ApiModelProperty("非驱动端轴承型号")
+        private String nonDriveEndBearingModel;
+
+
+    }
+
+
+}

+ 7 - 2
energy-manage-service/src/main/java/com/energy/manage/service/service/units/UnitService.java

@@ -4,6 +4,7 @@ import com.energy.manage.service.domain.dto.units.UnitDictBrandModelDto;
 import com.energy.manage.service.domain.dto.units.UnitDictRoutineDto;
 import com.energy.manage.service.domain.dto.units.UnitDto;
 import com.energy.manage.service.domain.vo.units.UnitDictRoutineListVo;
+import com.energy.manage.service.domain.vo.units.UnitVo;
 
 import java.util.List;
 
@@ -34,7 +35,11 @@ public interface UnitService {
      */
     boolean modificationUnit(UnitDto unitDto);
 
-
-
+    /**
+     * 通过机型编号查询部件信息
+     * @param millTypeCode
+     * @return
+     */
+    UnitVo getUnitVo(String millTypeCode);
 
 }

+ 189 - 4
energy-manage-service/src/main/java/com/energy/manage/service/service/units/impl/UnitServiceImpl.java

@@ -7,13 +7,13 @@ import com.energy.manage.common.base.Page;
 import com.energy.manage.common.constant.redis.ManagerRedisKeyConstant;
 import com.energy.manage.common.enums.DeleteStatusEnum;
 import com.energy.manage.common.enums.IdPrefixEnum;
-import com.energy.manage.common.po.units.UnitDictBrandModelPO;
-import com.energy.manage.common.po.units.UnitDictConstantsPO;
+import com.energy.manage.common.po.units.*;
 import com.energy.manage.common.util.IdGeneratorUtil;
 import com.energy.manage.service.domain.dto.units.*;
 import com.energy.manage.service.domain.vo.units.UnitDictBrandModelVo;
 import com.energy.manage.service.domain.vo.units.UnitDictConstantsVo;
 import com.energy.manage.service.domain.vo.units.UnitDictRoutineListVo;
+import com.energy.manage.service.domain.vo.units.UnitVo;
 import com.energy.manage.service.mappers.units.*;
 import com.energy.manage.service.service.cache.CacheService;
 import com.energy.manage.service.service.dict.DictConstantsService;
@@ -27,6 +27,8 @@ 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.util.CollectionUtils;
+import springfox.documentation.schema.Collections;
 import tk.mybatis.mapper.entity.Example;
 
 import java.util.Date;
@@ -57,13 +59,16 @@ public class UnitServiceImpl implements UnitService {
     @Autowired
     private UnitGearboxBearingsMapper unitGearboxBearingsMapper;
 
+    @Autowired
+    private CacheService cacheService;
+
 
     @Override
     public List<UnitDictRoutineListVo> getUnitDictRoutineList(UnitDictRoutineDto unitDictRoutineDto) {
         List<UnitDictConstantsVo> unitDictConstantsVos = unitDictConstantsService.getUnitDictConstantsList(unitDictRoutineDto.getContentsType());
         UnitDictRoutineListVo vo = null;
         List<UnitDictRoutineListVo> listVos = Lists.newArrayList();
-        for(UnitDictConstantsVo dictConstantsVo : unitDictConstantsVos){
+        for (UnitDictConstantsVo dictConstantsVo : unitDictConstantsVos) {
             vo = new UnitDictRoutineListVo();
             vo.setKeyId(dictConstantsVo.getContentsValue());
             vo.setValueName(dictConstantsVo.getContentsName());
@@ -82,9 +87,189 @@ public class UnitServiceImpl implements UnitService {
     @Transactional(rollbackFor = Exception.class)
     public boolean modificationUnit(UnitDto unitDto) {
 
+        boolean flg = true;
+        // 处理主轴
+        outBearings:
+        if (unitDto.getUnitBearingsDto() != null) {
+            UnitBearingsPO unitBearingsPO = new UnitBearingsPO();
+            BeanUtil.copyProperties(unitDto.getUnitBearingsDto(), unitBearingsPO);
+
+            //更新
+            if (unitBearingsPO.getId() != null && unitBearingsPO.getId() > 0) {
+                Example queryExample = new Example(UnitBearingsPO.class);
+                Example.Criteria criteria = queryExample.createCriteria();
+                criteria.andEqualTo("id", unitBearingsPO.getId());
+                flg = unitBearingsMapper.updateByExampleSelective(unitBearingsPO, queryExample) > 0;
+                break outBearings;
+            }
+            // 创建
+            String unitBearingsCode = IdPrefixEnum.UNIT_BEARINGS_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_BEARINGS_CODE.getCode()))));
+            unitBearingsPO.setMillTypeCode(unitDto.getMillTypeCode());
+            unitBearingsPO.setCode(unitBearingsCode);
+            unitBearingsPO.setCreateTime(new Date());
+            unitBearingsPO.setUpdateTime(new Date());
+            flg = unitBearingsMapper.insertUseGeneratedKeys(unitBearingsPO) > 0;
+        }
+
+        // 处理发电机数据
+        outDynamo:
+        if (unitDto.getUnitDynamoDto() != null) {
+            UnitDynamoPO unitDynamoPO = new UnitDynamoPO();
+            BeanUtil.copyProperties(unitDto.getUnitDynamoDto(), unitDynamoPO);
+
+            //更新
+            if (unitDynamoPO.getId() != null && unitDynamoPO.getId() > 0) {
+                Example queryExample = new Example(UnitDynamoPO.class);
+                Example.Criteria criteria = queryExample.createCriteria();
+                criteria.andEqualTo("id", unitDynamoPO.getId());
+                flg = unitDynamoMapper.updateByExampleSelective(unitDynamoPO, queryExample) > 0;
+                break outDynamo;
+            }
+            // 创建
+            String unitDynamoCode = IdPrefixEnum.UNIT_GEAR_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_DYNAMO_CODE.getCode()))));
+            unitDynamoPO.setMillTypeCode(unitDto.getMillTypeCode());
+            unitDynamoPO.setCode(unitDynamoCode);
+            unitDynamoPO.setCreateTime(new Date());
+            unitDynamoPO.setUpdateTime(new Date());
+            flg = unitDynamoMapper.insertUseGeneratedKeys(unitDynamoPO) > 0;
+        }
+
+        // 处理齿轮箱总表数据
+        UnitGearboxPO unitGearboxPO = new UnitGearboxPO();
+        outunitGearbox:
+        if (unitDto.getUnitGearDto() != null) {
+            unitGearboxPO.setLubricantBrand(unitDto.getUnitGearDto().getLubricantBrand());
+            unitGearboxPO.setLubricantModel(unitDto.getUnitGearDto().getLubricantModel());
+            unitGearboxPO.setUpdateTime(new Date());
+            //更新齿轮箱总表
+            if (unitDto.getUnitGearDto().getId() != null && unitDto.getUnitGearDto().getId() > 0) {
+                unitGearboxPO.setId(unitDto.getUnitGearDto().getId());
+                Example queryExample = new Example(UnitDynamoPO.class);
+                Example.Criteria criteria = queryExample.createCriteria();
+                criteria.andEqualTo("id", unitGearboxPO.getId());
+                flg = unitGearboxMapper.updateByExampleSelective(unitGearboxPO, queryExample) > 0;
+                break outunitGearbox;
+            }
+            unitGearboxPO.setMillTypeCode(unitDto.getMillTypeCode());
+            String unitGearboxCode = IdPrefixEnum.UNIT_GEAR_CODE.getCode().concat(IdGeneratorUtil.zeroFillUtil(cacheService.incr(ManagerRedisKeyConstant.build(ManagerRedisKeyConstant.IDGENERATOR_CONSTANTS_KEY, IdPrefixEnum.UNIT_GEAR_CODE.getCode()))));
+            unitGearboxPO.setCode(unitGearboxCode);
+            unitGearboxPO.setCreateTime(new Date());
+            unitGearboxPO.setDelState(DeleteStatusEnum.NODELETE.getCode());
+            flg = unitGearboxMapper.insertUseGeneratedKeys(unitGearboxPO) > 0;
+
+        }
+
+        // 处理齿轮箱轴承处理
+        if (!CollectionUtils.isEmpty(unitDto.getUnitGearDto().getUnitGearboxBearingsDtoList())) {
+            UnitGearboxBearingsPO unitGearboxBearingsPO = null;
+            List<UnitGearboxBearingsPO> unitGearboxBearingsPOList = Lists.newArrayList();
+            for (UnitDto.UnitGearboxBearingsDto dto : unitDto.getUnitGearDto().getUnitGearboxBearingsDtoList()) {
+                unitGearboxBearingsPO = new UnitGearboxBearingsPO();
+                BeanUtil.copyProperties(dto, unitGearboxBearingsPO);
+                unitGearboxBearingsPO.setGearboxCode(unitGearboxPO.getCode());
+                unitGearboxBearingsPO.setCreateTime(new Date());
+                unitGearboxBearingsPO.setUpdateTime(new Date());
+                unitGearboxBearingsPOList.add(unitGearboxBearingsPO);
+            }
+            UnitGearboxBearingsPO po = new UnitGearboxBearingsPO();
+            po.setGearboxCode(unitGearboxPO.getCode());
+            unitGearboxBearingsMapper.delete(po);
+
+            flg = unitGearboxBearingsMapper.insertList(unitGearboxBearingsPOList) > 0;
+        }
+
+        // 处理齿轮箱结构
+        if (!CollectionUtils.isEmpty(unitDto.getUnitGearDto().getUnitGearboxStructureDtoList())) {
+            UnitGearboxStructurePO unitGearboxStructurePO = null;
+            List<UnitGearboxStructurePO> unitGearboxStructurePOList = Lists.newArrayList();
+            for (UnitDto.UnitGearboxStructureDto dto : unitDto.getUnitGearDto().getUnitGearboxStructureDtoList()) {
+                unitGearboxStructurePO = new UnitGearboxStructurePO();
+                BeanUtil.copyProperties(dto, unitGearboxStructurePO);
+                unitGearboxStructurePO.setGearboxCode(unitGearboxPO.getCode());
+                unitGearboxStructurePO.setCreateTime(new Date());
+                unitGearboxStructurePO.setUpdateTime(new Date());
+                unitGearboxStructurePOList.add(unitGearboxStructurePO);
+            }
+            UnitGearboxStructurePO po = new UnitGearboxStructurePO();
+            po.setGearboxCode(unitGearboxPO.getCode());
+            unitGearboxStructureMapper.delete(po);
+
+            flg = unitGearboxStructureMapper.insertList(unitGearboxStructurePOList) > 0;
+        }
+        return flg;
+    }
 
+    @Override
+    public UnitVo getUnitVo(String millTypeCode) {
+
+        UnitVo unitVo = new UnitVo();
+        unitVo.setMillTypeCode(millTypeCode);
+
+        if (StringUtils.isEmpty(millTypeCode)) {
+            return null;
+        }
+
+        // 主轴
+        Example queryExample = new Example(UnitBearingsPO.class);
+        Example.Criteria criteria = queryExample.createCriteria();
+        criteria.andEqualTo("millTypeCode", millTypeCode);
+        UnitBearingsPO unitBearingsPO = unitBearingsMapper.selectOneByExample(queryExample);
+
+        UnitVo.UnitBearingsVo unitBearingsVo = new UnitVo.UnitBearingsVo();
+        BeanUtil.copyProperties(unitBearingsPO,unitBearingsVo);
+        unitVo.setUnitBearingsVo(unitBearingsVo);
+
+        // 发电机
+        Example queryUdExample = new Example(UnitDynamoPO.class);
+        Example.Criteria criteriaUd = queryUdExample.createCriteria();
+        criteriaUd.andEqualTo("millTypeCode", millTypeCode);
+        UnitDynamoPO unitDynamoPO = unitDynamoMapper.selectOneByExample(queryUdExample);
+
+        UnitVo.UnitDynamoVo unitDynamoVo = new UnitVo.UnitDynamoVo();
+        BeanUtil.copyProperties(unitDynamoPO,unitDynamoVo);
+        unitVo.setUnitDynamoVo(unitDynamoVo);
+
+        // 齿轮箱
+        UnitVo.UnitGearVo unitGearVo = new UnitVo.UnitGearVo();
+        Example queryUgExample = new Example(UnitGearboxPO.class);
+        Example.Criteria criteriaUg = queryUgExample.createCriteria();
+        criteriaUg.andEqualTo("millTypeCode", millTypeCode);
+
+        UnitGearboxPO unitGearboxPO = unitGearboxMapper.selectOneByExample(queryUgExample);
+        BeanUtil.copyProperties(unitGearboxPO,unitGearVo);
+
+        // 齿轮箱轴承
+        Example queryUgbExample = new Example(UnitGearboxBearingsPO.class);
+        Example.Criteria criteriaUgb = queryUgbExample.createCriteria();
+        criteriaUgb.andEqualTo("gearboxCode", unitGearboxPO.getCode());
+        List<UnitGearboxBearingsPO> unitGearboxBearingsPOList =  unitGearboxBearingsMapper.selectByExample(queryUgbExample);
+
+        UnitVo.UnitGearboxBearingsVo unitGearboxBearingsVo = null;
+        List<UnitVo.UnitGearboxBearingsVo> unitGearboxBearingsVos = Lists.newArrayList();
+        for(UnitGearboxBearingsPO unitGearboxBearingsPO : unitGearboxBearingsPOList){
+            unitGearboxBearingsVo = new UnitVo.UnitGearboxBearingsVo();
+            BeanUtil.copyProperties(unitGearboxBearingsPO,unitGearboxBearingsVo);
+            unitGearboxBearingsVos.add(unitGearboxBearingsVo);
+        }
+        unitGearVo.setUnitGearboxBearingsList(unitGearboxBearingsVos);
+
+        // 齿轮箱结构
+        Example queryUgsExample = new Example(UnitGearboxStructurePO.class);
+        Example.Criteria criteriaUgs = queryUgbExample.createCriteria();
+        criteriaUgs.andEqualTo("gearboxCode", unitGearboxPO.getCode());
+        List<UnitGearboxStructurePO> unitGearboxStructurePOList =  unitGearboxStructureMapper.selectByExample(queryUgbExample);
+
+        UnitVo.UnitGearboxStructureVo unitGearboxStructureVo = null;
+        List<UnitVo.UnitGearboxStructureVo> unitGearboxStructureVos = Lists.newArrayList();
+        for(UnitGearboxStructurePO unitGearboxStructurePO : unitGearboxStructurePOList){
+            unitGearboxStructureVo = new UnitVo.UnitGearboxStructureVo();
+            BeanUtil.copyProperties(unitGearboxStructurePO,unitGearboxStructureVo);
+            unitGearboxStructureVos.add(unitGearboxStructureVo);
+        }
+        unitGearVo.setUnitGearboxStructureList(unitGearboxStructureVos);
 
+        unitVo.setUnitGearVo(unitGearVo);
 
-        return false;
+        return unitVo;
     }
 }

+ 4 - 4
energy-manage-service/src/test/java/client/SkfClientWebTest.java

@@ -71,12 +71,12 @@ public class SkfClientWebTest {
             }
         }
 
-        Integer pointId = 128;
+        Integer pointId = 86;
 
         List<String> xlist = Lists.newArrayList();
-        xlist.add("7");
-        xlist.add("8");
-        xlist.add("9");
+//        xlist.add("7");
+//        xlist.add("8");
+        xlist.add("11");
 
         for(String x : xlist){
             String fromDateUTC = "2024-0"+x+"-01";