浏览代码

********************WX***********************
添加调度器

zhangweixin 4 年之前
父节点
当前提交
73f457bca8
共有 89 个文件被更改,包括 6016 次插入787 次删除
  1. 4 4
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/block/RelationAddRequest.kt
  2. 0 3
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/RelBuilding.kt
  3. 0 6
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/RelEquipmentBuilding.kt
  4. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentControlRelationOne.kt
  5. 4 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentControlRelationTwoSy.kt
  6. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentEq2SpControlEquipNetwork.kt
  7. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentEq2SpOther.kt
  8. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentSensorNetworkOne.kt
  9. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentSs2Sy.kt
  10. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDHWNetworkOne.kt
  11. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrainingWaterNetworkOne.kt
  12. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrainingWaterNetworkTwo.kt
  13. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrinkingWaterNetworkTwo.kt
  14. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentFireVentNetworkOne.kt
  15. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentGasNetworkOne.kt
  16. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentGasNetworkTwo.kt
  17. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentRecycleWaterNetworkOne.kt
  18. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentSupplyWaterNetworkOne.kt
  19. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentSupplyWaterNetworkTwo.kt
  20. 1 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentHubOrdinary.kt
  21. 2 19
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubOrdinary.kt
  22. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubPrepare.kt
  23. 1 15
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentRoutinePower.kt
  24. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSparePower.kt
  25. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSyRoutinePower.kt
  26. 2 16
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSySparePower.kt
  27. 1 14
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/hvac/RelEquipmentCoolingWaterLoopTwo.kt
  28. 1 4
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RShInSyList.kt
  29. 1 7
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSpVerticalSp.kt
  30. 1 2
      data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSyEqList.kt
  31. 7 10
      datacenter/src/main/kotlin/com/persagy/server/controllers/objects/GeneralSystemController.kt
  32. 4 4
      datacenter/src/main/kotlin/com/persagy/server/controllers/relation_calc/ManualRelationCalcController.kt
  33. 1 1
      datacenter/src/main/kotlin/com/persagy/server/services/objects/GeneralSystemService.kt
  34. 8 8
      datacenter/src/main/kotlin/com/persagy/server/services/rel/RSyEqService.kt
  35. 490 353
      datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/ManualRelationCalcService.kt
  36. 1 0
      datacenter/src/main/resources/application-prod.yml
  37. 1 9
      equip-componet/src/main/kotlin/com/persagy/server/models/PointPorperty.kt
  38. 1 1
      equip-componet/src/main/kotlin/com/persagy/server/service/RSyEqService.kt
  39. 1 1
      equip-componet/src/main/kotlin/com/persagy/server/service/objects/EquipmentService.kt
  40. 1 0
      equip-componet/src/main/resources/application-prod.yml
  41. 7 0
      pendingIssues.md
  42. 0 1
      revit-algorithm/src/main/kotlin/com/persagy/revit/backstage/model/UpdateRequest.kt
  43. 188 0
      scheduler/build.gradle
  44. 66 0
      scheduler/src/main/java/com/persagy/mybatis/DownloadTaskModel.java
  45. 64 0
      scheduler/src/main/java/com/persagy/mybatis/MyBatisSqlSessionFactory.java
  46. 166 0
      scheduler/src/main/java/com/persagy/mybatis/TaskDAO.java
  47. 50 0
      scheduler/src/main/java/com/persagy/mybatis/TaskMapper.java
  48. 132 0
      scheduler/src/main/java/com/persagy/mybatis/TaskModel.java
  49. 86 0
      scheduler/src/main/java/com/persagy/mybatis/TaskService.java
  50. 805 0
      scheduler/src/main/java/com/persagy/proto/MessageProto.java.bak
  51. 904 0
      scheduler/src/main/java/com/persagy/proto/MessageProtoStr.java
  52. 53 0
      scheduler/src/main/java/com/persagy/proto/MessageUtil.java
  53. 72 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/SchedulerApp.kt
  54. 83 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/Swagger2Config.kt
  55. 32 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/TimedTaskRunner.kt
  56. 142 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/DownloadController.kt
  57. 193 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/TaskController.kt
  58. 107 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/TaskResultController.kt
  59. 34 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/CommitTaskRequest.kt
  60. 34 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DispatchTaskResponse.kt
  61. 61 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DownloadEntity.kt
  62. 52 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DownloadSpeedRequest.kt
  63. 134 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/TaskEntity.kt
  64. 55 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/models/TaskResultEntity.kt
  65. 164 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/ChannelHandlerContextWrapper.kt
  66. 32 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/ClientMessage.kt
  67. 59 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/Command.kt
  68. 6 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/Config.kt
  69. 68 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/TaskStatus.kt
  70. 279 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/server/DispatchTask.kt
  71. 84 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/server/MessageHandler.kt
  72. 155 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/server/SchedulerHandler.kt
  73. 130 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/server/Server.kt
  74. 38 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/service/ActiveMQConsumer.kt
  75. 46 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/service/BaseDataService.kt
  76. 54 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/service/JMSProducer.kt
  77. 167 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/service/TasksService.kt
  78. 72 0
      scheduler/src/main/kotlin/com/persagy/server/scheduler/utils/CommonUtil.kt
  79. 17 0
      scheduler/src/main/proto/MessageProto.proto
  80. 76 0
      scheduler/src/main/resources-dev/application.yml
  81. 83 0
      scheduler/src/main/resources-prod/application.yml
  82. 1 0
      scheduler/src/main/resources/config.yml
  83. 35 0
      scheduler/src/main/resources/log4j.properties
  84. 43 0
      scheduler/src/main/resources/logback-spring.xml
  85. 80 0
      scheduler/src/main/resources/mapper/TaskMap.xml
  86. 54 0
      scheduler/src/main/resources/mybatis-config.xml
  87. 82 0
      scheduler/src/main/resources/table_mysql.sql
  88. 112 0
      scheduler/src/main/resources/table_postgresql.sql
  89. 1 0
      settings.gradle

+ 4 - 4
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/block/RelationAddRequest.kt

@@ -49,10 +49,10 @@ class RelationAddRequest : Serializable {
     @Schema(description = "从对象内容")
     var fromContent: ArrayList<String>? = null
 
-    /** 图类型编码 */
-    @Schema(description = "图类型编码")
-    @Column(name = "graphic_type")
-    var graphicType: String? = null
+//    /** 图类型编码 */
+//    @Schema(description = "图类型编码")
+//    @Column(name = "graphic_type")
+//    var graphicType: String? = null
 
 
 } // Class RelationAddRequest

+ 0 - 3
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/RelBuilding.kt

@@ -44,19 +44,16 @@ open class RelBuilding : BaseInfo() {
     @Schema(description = "建筑体ID")
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 建筑体名称 */
     @Schema(description = "建筑体名称")
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 建筑本地编码 */
     @Schema(description = "建筑本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 建筑本地名称 */

+ 0 - 6
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/RelEquipmentBuilding.kt

@@ -48,32 +48,26 @@ open class RelEquipmentBuilding : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
-//    @JsonProperty("EquipID")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentControlRelationOne.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentControlRelationOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentControlRelationOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_ControlRelation_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentControlRelationOne
+}
 
 
 

+ 4 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentControlRelationTwoSy.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelGeneralSystem
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelGeneralSystem
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,53 @@ open class RelEquipmentControlRelationTwoSy : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
+
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
+
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +105,19 @@ open class RelEquipmentControlRelationTwoSy : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2sy", idColumn="id1", childIdColumn="id2",self = false,filter = "type = 'eq2eq_ControlRelation_2'")
-    @JSONField(name = "objectInfo")
     var objectInfo: ArrayList<RelGeneralSystem>? = null
 
-} // Class RelEquipmentControlRelationTwoSy
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentEq2SpControlEquipNetwork.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
@@ -47,61 +46,51 @@ open class RelEquipmentEq2SpControlEquipNetwork : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -113,22 +102,19 @@ open class RelEquipmentEq2SpControlEquipNetwork : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_ControlEquipNetwork'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentEq2SpControlEquipNetwork>? = null
 
-} // Class RelEquipmentEq2SpControlEquipNetwork
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentEq2SpOther.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelZoneSpace
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelZoneSpace
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentEq2SpOther : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentEq2SpOther : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2sp", idColumn="eq_id", childIdColumn="sp_id",self = false,filter = "type = 'eq2sp_x'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelZoneSpace>? = null
 
-} // Class RelEquipmentEq2SpOther
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentSensorNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentSensorNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSensorNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_SensorNetwork_1'")
-    @JSONField(name = "objectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSensorNetworkOne
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/control/RelEquipmentSs2Sy.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.control
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelGeneralSystem
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelGeneralSystem
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentSs2Sy : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSs2Sy : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2sy", idColumn="id1", childIdColumn="id2",self = false,filter = "type = 'eq2sy_SensorRelationship_ss2sy'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelGeneralSystem>? = null
 
-} // Class RelEquipmentSs2Sy
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDHWNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentDHWNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentDHWNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_DHWNetwork_1'")
-    @JSONField(name = "objectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentDHWNetworkOne
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrainingWaterNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentDrainingWaterNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentDrainingWaterNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_DrainingWaterNetwork_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentDrainingWaterNetworkOne
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrainingWaterNetworkTwo.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentDrainingWaterNetworkTwo : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentDrainingWaterNetworkTwo : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_DrainingWaterNetwork_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentDrainingWaterNetworkTwo
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentDrinkingWaterNetworkTwo.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentDrinkingWaterNetworkTwo : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentDrinkingWaterNetworkTwo : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_DrinkingWaterNetwork_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentDrinkingWaterNetworkTwo
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentFireVentNetworkOne.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentFireVentNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentFireVentNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_FireVentNetwork_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentFireVentNetworkOne
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentGasNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentGasNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,19 +103,16 @@ open class RelEquipmentGasNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_GasNetwork_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentGasNetworkOne
+}

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentGasNetworkTwo.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentGasNetworkTwo : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentGasNetworkTwo : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_GasNetwork_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentGasNetworkTwo
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentRecycleWaterNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentRecycleWaterNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentRecycleWaterNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_RecycleWaterNetwork_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentRecycleWaterNetworkOne
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentSupplyWaterNetworkOne.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentSupplyWaterNetworkOne : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSupplyWaterNetworkOne : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_SupplyWaterNetwork_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSupplyWaterNetworkOne
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/drainage/RelEquipmentSupplyWaterNetworkTwo.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.drainage
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentSupplyWaterNetworkTwo : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSupplyWaterNetworkTwo : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_SupplyWaterNetwork_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSupplyWaterNetworkTwo
+}
 
 
 

+ 1 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentHubOrdinary.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -49,26 +48,21 @@ open class RelEquipmentHubOrdinary : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
-//    @JsonProperty("EquipID")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
 
@@ -76,37 +70,31 @@ open class RelEquipmentHubOrdinary : BaseInfo() {
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -118,22 +106,19 @@ open class RelEquipmentHubOrdinary : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_HUDistribution_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentHubOrdinary
+}
 
 
 

+ 2 - 19
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubOrdinary.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -49,64 +48,51 @@ open class RelEquipmentLubOrdinary : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
-//    @JsonProperty("EquipID")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
-
-
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -118,22 +104,19 @@ open class RelEquipmentLubOrdinary : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_LUDistribution_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentLubOrdinary
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentLubPrepare.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentLubPrepare : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentLubPrepare : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_LUDistribution_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class Equipment
+}
 
 
 

+ 1 - 15
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentRoutinePower.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
@@ -48,61 +47,51 @@ open class RelEquipmentRoutinePower : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentRoutinePower : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_EquipPower_1'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentRoutinePower
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSparePower.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentSparePower : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSparePower : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_EquipPower_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSparePower
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSyRoutinePower.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentSyRoutinePower : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSyRoutinePower : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_EquipPower_3'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSyRoutinePower
+}
 
 
 

+ 2 - 16
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/electricity/RelEquipmentSySparePower.kt

@@ -26,9 +26,8 @@
 
 package com.persagy.server.datacenter.models.entities.graphtype.rel.electricity
 
-import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelEquipmentFloor
 import com.persagy.service.models.annotations.SCascade
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -48,61 +47,51 @@ open class RelEquipmentSySparePower : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +103,19 @@ open class RelEquipmentSySparePower : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_EquipPower_4'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentSySparePower
+}
 
 
 

+ 1 - 14
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/graphtype/rel/hvac/RelEquipmentCoolingWaterLoopTwo.kt

@@ -48,61 +48,51 @@ open class RelEquipmentCoolingWaterLoopTwo : BaseInfo() {
     @Schema(description = "设备id",required = true)
     @Id
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 设备名称 */
     @Schema(description = "设备名称",required = true)
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 设备本地编码 */
     @Schema(description = "设备本地编码")
     @Column(name = "local_id")
-    @JSONField(name = "LocalID")
     var localId: String? = null
 
     /** 设备本地名称 */
     @Schema(description = "设备本地名称")
     @Column(name = "local_name")
-    @JSONField(name = "LocalName")
     var localName: String? = null
 
     /** 设计图纸中编码 */
     @Schema(description = "设计图纸中编码")
     @Column(name = "cad_id")
-    @JSONField(name = "CADID")
     var cadId: String? = null
 
     /** BIM模型中编码 */
     @Schema(description = "BIM模型中编码")
     @Column(name = "bim_id")
-    @JSONField(name = "BIMID")
     var bimId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id",required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 设备类型code */
     @Schema(description = "设备类型code")
     @Column(name = "category")
-    @JSONField(name = "Category")
     var category: String? = null
 
     /** 设备所在建筑id */
     @Schema(description = "设备所在建筑id")
     @Column(name = "building_id")
-    @JSONField(name = "BuildingId")
     var buildingId: String? = null
 
     /** 设备所在楼层id */
     @Schema(description = "设备所在楼层id")
     @Column(name = "floor_id")
-    @JSONField(name = "FloorId")
     var floorId: String? = null
 
 //    //    /** 设备关联的资产id */
@@ -114,22 +104,19 @@ open class RelEquipmentCoolingWaterLoopTwo : BaseInfo() {
     /** Revit族 */
     @Schema(description = "Revit族 ")
     @Column(name = "family_name")
-    @JSONField(name = "BIMFamilyName")
     var familyName: String? = null
 
     /** Revit族类型 */
     @Schema(description = "Revit族类型 ")
     @Column(name = "family_symbol")
-    @JSONField(name = "BIMFamilySymbol")
     var familySymbol: String? = null
 
     /** 级联-设备 */
     @Schema(description = "级联-设备")
     @SCascade(table="relationship.r_eq2eq", idColumn="id1", childIdColumn="id2",self = true,filter = "type = 'eq2eq_CoolingWaterLoop_2'")
-    @JSONField(name = "ObjectInfo")
     var objectInfo: ArrayList<RelEquipmentFloor>? = null
 
-} // Class RelEquipmentCoolingWaterLoopTwo
+}
 
 
 

+ 1 - 4
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RShInSyList.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.rel
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.RBaseInfo
 import io.swagger.v3.oas.annotations.media.Schema
 
@@ -40,12 +39,10 @@ class RShInSyList : RBaseInfo() {
 
     /** 竖井id */
     @Schema(description = "竖井id")
-    @JSONField(name = "ShaftId")
     var shaftId: String? = null
 
     /** 系统id列表 */
     @Schema(description = "系统id列表")
-    @JSONField(name = "sysIdList")
     var sysIdList: ArrayList<String>? = null
 
-} // Class RShInSyList
+}

+ 1 - 7
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSpVerticalSp.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.datacenter.models.entities.rel
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.RBaseInfo
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -44,32 +43,27 @@ class RSpVerticalSp : RBaseInfo(){
     @Schema(description = "空间id", required = true)
     @Id
     @Column(name = "space_id")
-    @JSONField(name = "SpaceId")
     var spaceId: String? = null
 
     /** 关系空间id */
     @Schema(description = "关系空间id", required = true)
     @Id
     @Column(name = "space_other_id")
-    @JSONField(name = "SpaceOtherId")
     var spaceOtherId: String? = null
 
     /** 项目id */
     @Schema(description = "项目id", required = true)
     @Column(name = "project_id")
-    @JSONField(name = "ProjectId")
     var projectId: String? = null
 
     /** 空间类型 */
     @Schema(description = "空间类型", required = true)
     @Column(name = "object_type")
-    @JSONField(name = "ObjectType")
     var objectType: String? = null
 
     /** 标记手动 1 自动 2 */
     @Schema(description = "标记手动 1 自动 2 ", required = true)
     @Column(name = "sign")
-    @JSONField(name = "Sign")
     var sign: Int? = null
 
-} // Class RSpVerticalSp
+}

+ 1 - 2
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/RSyEqList.kt

@@ -49,12 +49,11 @@ class RSyEqList : RBaseInfo(){
 
     /** 系统id */
     @Schema(description = "系统id", required = true)
-    @JSONField(name = "SysID")
     var sysId: String? = null
 
     /** 设备id */
     @Schema(description = "设备id列表", required = true)
     @JSONField(name = "EquipIdList")
-    var listEquipId: ArrayList<String>? = null
+    var equipIdList: ArrayList<String>? = null
 
 } // Class RSyEq

+ 7 - 10
datacenter/src/main/kotlin/com/persagy/server/controllers/objects/GeneralSystemController.kt

@@ -47,10 +47,7 @@ import com.persagy.service.models.responses.SQueryResponse
 import io.swagger.v3.oas.annotations.Operation
 import io.swagger.v3.oas.annotations.tags.Tag
 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 org.springframework.web.bind.annotation.*
 
 /**
  * 系统接口
@@ -176,9 +173,9 @@ open class GeneralSystemController {
      *
      * @param   sysId        系统id
      */
-    @Operation(summary ="查询没有和当前系统关联的设备", description ="sysId 为系统id")
+    @Operation(summary ="查询没有和当前系统关联的设备", description ="id 为系统id")
     @PostMapping(value = ["/un-sys-equip"])
-    fun unSysEquip( sysId: String,@RequestBody request: SQueryRequest): SQueryResponse<Equipment>{
+    fun unSysEquip(@RequestParam sysId: String, @RequestBody request: SQueryRequest): SQueryResponse<Equipment>{
         return GeneralSystemService.unSysEquip(sysId, request)
     } // Fun unSysEquip()
 
@@ -187,9 +184,9 @@ open class GeneralSystemController {
      *
      * @param   sysId        系统id
      */
-    @Operation(summary ="查询没有和当前系统关联的竖井", description ="sysId 为系统id")
+    @Operation(summary ="查询没有和当前系统关联的竖井", description ="id 为系统id")
     @PostMapping(value = ["/un-sys-shaft"])
-    fun unSysShaft( sysId: String,@RequestBody request: SQueryRequest): SQueryResponse<Shaft>{
+    fun unSysShaft(@RequestParam sysId: String,@RequestBody request: SQueryRequest): SQueryResponse<Shaft>{
         return GeneralSystemService.unSysShaft(sysId, request)
     } //  Fun unSysShaft()
 
@@ -198,9 +195,9 @@ open class GeneralSystemController {
      *
      * @param   sysId        系统id
      */
-    @Operation(summary ="查询没有和当前系统关联的业务空间", description ="sysId 为系统id")
+    @Operation(summary ="查询没有和当前系统关联的业务空间", description ="id 为系统id")
     @PostMapping(value = ["/un-sys-zoneSpaceBaseTable"])
-    fun unSysZoneSpaceBaseTable( sysId: String,@RequestBody request: SQueryRequest): SQueryResponse<ZoneSpace>{
+    fun unSysZoneSpaceBaseTable(@RequestParam sysId: String,@RequestBody request: SQueryRequest): SQueryResponse<ZoneSpace>{
         return GeneralSystemService.unSysZoneSpaceBaseTable(sysId, request)
     } // Fun unSysZoneSpaceBaseTable()
 

+ 4 - 4
datacenter/src/main/kotlin/com/persagy/server/controllers/relation_calc/ManualRelationCalcController.kt

@@ -64,7 +64,7 @@ class ManualRelationCalcController {
     @PostMapping(value = ["/query"])
     fun query(@RequestBody manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
         return service.query(manualRelationCalcRequest)
-    } // Fun
+    }
 
     /**
      * 添加关系
@@ -73,7 +73,7 @@ class ManualRelationCalcController {
     @PostMapping(value = ["/add"])
     fun addRels(@RequestBody relationAddRequest: RelationAddRequest): ManualRelationCalcSCreateResponse {
         return service.addRel(relationAddRequest)
-    } // Fun
+    }
 
     /**
      * 删除关系
@@ -82,9 +82,9 @@ class ManualRelationCalcController {
     @PostMapping(value = ["/del"])
     fun delRels(@RequestBody manualRelationCalcDel: ManualRelationCalcDel): SBaseResponse {
         return service.delRel(manualRelationCalcDel)
-    } // Fun
+    }
 
-} // Class ManualRelationCalcController
+}
 
 
 

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/services/objects/GeneralSystemService.kt

@@ -348,7 +348,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
             /** 失败集合 */
             val failureList = ArrayList<Any>()
 
-            for (equipId in rSyEqList.listEquipId!!){
+            for (equipId in rSyEqList.equipIdList!!){
                 val r = RSyEq()
                 r.sysId = sysId
                 r.equipId = equipId

+ 8 - 8
datacenter/src/main/kotlin/com/persagy/server/services/rel/RSyEqService.kt

@@ -26,14 +26,14 @@
 
 package com.persagy.server.services.rel
 
+import com.persagy.base.extensions.toJson
+import com.persagy.database.SFilter
+import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.datacenter.models.entities.rel.REqSyList
 import com.persagy.server.datacenter.models.entities.rel.RSyEq
 import com.persagy.server.datacenter.models.entities.rel.RSyEqList
 import com.persagy.server.services.base.RService
 import com.persagy.server.services.objects.EquipmentService
-import com.persagy.base.extensions.toJson
-import com.persagy.database.SFilter
-import com.persagy.mybatis.SMybatisDao
 import com.persagy.service.SPageContext
 import com.persagy.service.models.enums.SResponseType
 import com.persagy.service.models.responses.SBaseResponse
@@ -152,8 +152,8 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
             } catch (e: Exception) {
                 e.printStackTrace()
             }
-            if (rSyEqList.listEquipId!=null&&rSyEqList.listEquipId!!.isNotEmpty()){
-                for (eqId in rSyEqList.listEquipId!!){
+            if (rSyEqList.equipIdList!=null&&rSyEqList.equipIdList!!.isNotEmpty()){
+                for (eqId in rSyEqList.equipIdList!!){
                     val rSyEq = RSyEq()
                     rSyEq.equipId = eqId
                     rSyEq.sysId =  rSyEqList.sysId
@@ -272,11 +272,11 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
 
             /** 失败集合 */
             val failureList = ArrayList<RSyEq>()
-            if (rSyEqList.listEquipId!=null&&rSyEqList.listEquipId!!.isNotEmpty()){
+            if (rSyEqList.equipIdList!=null&&rSyEqList.equipIdList!!.isNotEmpty()){
 
                 /** 成功集合 */
                 val successList = ArrayList<RSyEq>()
-                for (eqId in rSyEqList.listEquipId!!){
+                for (eqId in rSyEqList.equipIdList!!){
                     val rSyEq = RSyEq()
                     logger.debug("设备和系统11 =${eqId}")
                     rSyEq.equipId = eqId
@@ -310,7 +310,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
                     jsonObject.put("obj_type", "SystemEquip")
                     jsonObject.put("linkId",successList.toJson())
                     /** 发送消息 */
-                    messageHandler.sendMessage(jsonObject.toString())
+//                    messageHandler.sendMessage(jsonObject.toString())
 //                    kafkaService.sendNotice("datacenterrel", RelationNotice(projectId!!, "SystemEquip", "14", IdUtils.uuidCreate(),  rSyEqList.sysId!!, null),false)
                     val sCreateResponse = SCreateResponse<RSyEq>(SResponseType.success)
                     if (failureList.size>0){

文件差异内容过多而无法显示
+ 490 - 353
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/ManualRelationCalcService.kt


+ 1 - 0
datacenter/src/main/resources/application-prod.yml

@@ -33,6 +33,7 @@ spring:
 #    password:                           123qwe!@#
 #    url:                                jdbc:postgresql://172.17.100.16:5432/datacenterlabsl
     url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj

+ 1 - 9
equip-componet/src/main/kotlin/com/persagy/server/models/PointPorperty.kt

@@ -26,7 +26,6 @@
 
 package com.persagy.server.models
 
-import com.alibaba.fastjson.annotation.JSONField
 import com.persagy.server.datacenter.models.entities.base.BaseInfo
 import io.swagger.v3.oas.annotations.media.Schema
 import javax.persistence.Column
@@ -39,43 +38,36 @@ class PointPorperty : BaseInfo() {
     /** id */
     @Schema(description = "id")
     @Column(name = "id")
-    @JSONField(name = "Id")
     var id: String? = null
 
     /** 名称 */
     @Schema(description = "名称")
     @Column(name = "name")
-    @JSONField(name = "Name")
     var name: String? = null
 
     /** 坐标x */
     @Schema(description = "坐标x")
     @Column(name = "x")
-    @JSONField(name = "X")
     var x: Double? = null
 
     /** 坐标y */
     @Schema(description = "坐标y")
     @Column(name = "y")
-    @JSONField(name = "Y")
     var y: Double? = null
 
     /** 数量资产 */
     @Schema(description = "数量资产")
     @Column(name = "total")
-    @JSONField(name = "Total")
     var total: Int? = null
 
     /** 未修订数量 */
     @Schema(description = "未修订数量")
     @Column(name = "nocheck")
-    @JSONField(name = "Nocheck")
     var nocheck: Int? = null
 
     /** 图片key值 */
     @Schema(description = "图片key值")
     @Column(name = "image")
-    @JSONField(name = "Image")
     var image: String? = null
 
-} // Class PointPorperty
+}

+ 1 - 1
equip-componet/src/main/kotlin/com/persagy/server/service/RSyEqService.kt

@@ -99,7 +99,7 @@ object RSyEqService : RService<RSyEq>(SMybatisDao(RSyEq::class.java)) {
             /** 失败集合 */
             val failureList = ArrayList<Any>()
             delete("sysID = '${rSyEqList.sysId}'")
-            for (eqId in rSyEqList.listEquipId!!){
+            for (eqId in rSyEqList.equipIdList!!){
                 val rSyEq = RSyEq()
 //                rSyEq.id = IdUtils.uuidCreate()
                 rSyEq.equipId = eqId

+ 1 - 1
equip-componet/src/main/kotlin/com/persagy/server/service/objects/EquipmentService.kt

@@ -644,7 +644,7 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                         sBaseResponse.message = "设备id不能为空"
                         sBaseResponse
                     }
-                    val equip = select(SFilter.eq("projectId", projectId!!), SFilter.eq("equipId", equipUpDateEnclosure.equipId!!)).entity()
+                    val equip = select(SFilter.eq("projectId", projectId!!), SFilter.eq("id", equipUpDateEnclosure.equipId!!)).entity()
 
                     if (equip == null){
                         continue

+ 1 - 0
equip-componet/src/main/resources/application-prod.yml

@@ -21,6 +21,7 @@ spring:
 #    password:                           123qwe!@#
 #    url:                                jdbc:postgresql://172.17.100.16:5432/datacenterlabsl
     url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj

+ 7 - 0
pendingIssues.md

@@ -44,4 +44,11 @@ ip: 192.168.12.14
 
 ```
 
+```
+登录网址  https://signin.aliyun.com/login.htm  
+账户  fanxiaoyu@1942828987597127.onaliyun.com  
+密码  fanxiaoyu-ram  
+查询操作  华北2(北京)  控制台-》实例-》标签-》team-》saga
+```
+
 

+ 0 - 1
revit-algorithm/src/main/kotlin/com/persagy/revit/backstage/model/UpdateRequest.kt

@@ -8,6 +8,5 @@ import com.alibaba.fastjson.annotation.JSONField
  * @author jxing
  */
 class UpdateRequest<T> {
-    @JSONField(name = "Content")
     var content : ArrayList<T>? = null
 }

+ 188 - 0
scheduler/build.gradle

@@ -0,0 +1,188 @@
+group 'cn.sagacloud.server'
+version '2.0.0'
+
+apply plugin: "kotlin"
+apply plugin: 'java'
+apply plugin: "org.jetbrains.dokka"
+apply plugin: "war"
+apply plugin: 'org.springframework.boot'
+apply plugin: 'io.spring.dependency-management'
+apply plugin: 'maven'
+//apply plugin: 'com.google.protobuf'
+//apply plugin: 'application'
+
+sourceCompatibility = 1.8
+
+compileKotlin {
+    kotlinOptions.jvmTarget = JVM_TARGET
+}
+compileTestKotlin {
+    kotlinOptions.jvmTarget = JVM_TARGET
+}
+//protobuf {
+//    generatedFilesBaseDir = "src"
+//    protoc {
+//        artifact = "com.google.protobuf:protoc:3.7.0"
+//    }
+//
+////    plugins {
+////        grpc {
+////            artifact = 'io.grpc:protoc-gen-grpc-java:1.19.0'
+////        }
+////    }
+////    generateProtoTasks {
+////        all()*.plugins {
+////            grpc {}
+////        } 
+////    }
+//}
+tasks.withType(JavaCompile) {
+    options.encoding = "UTF-8"
+}
+
+
+dependencies {
+    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
+    testCompile group: 'junit', name: 'junit', version: '4.12'
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//    // kotlin 依赖
+    compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: KOTLIN_VERSION
+    compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: KOTLIN_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // spring boot 依赖
+    compile group: "org.springframework.boot", name: "spring-boot-starter-web", version: SPRING_BOOT_VERSION
+    compile group: "org.springframework.boot", name: "spring-boot-starter-actuator", version: SPRING_BOOT_VERSION
+    compile group: "org.springframework.boot", name: "spring-boot-starter-logging", version: SPRING_BOOT_VERSION
+    //消息
+    compile group: "org.springframework.boot", name: "spring-boot-starter-activemq", version: SPRING_BOOT_VERSION
+    providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
+//    compile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
+    // spring boot 缓存
+    compile group:"org.springframework.boot", name:"spring-boot-starter-cache", version: SPRING_BOOT_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // spring cloud 依赖
+//    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // MySQL
+    // https://mvnrepository.com/artifact/mysql/mysql-connector-java
+//    compile group: 'mysql', name: 'mysql-connector-java', version: MYSQL_VERSION
+
+//    // PostgreSQL
+//    //https://mvnrepository.com/artifact/org.postgresql/postgresql
+//    compile group: 'org.postgresql',    name: 'postgresql',     version: POSTGRESQL_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // RESTful API 文档生成工具
+    // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
+    compile group: "io.springfox", name: "springfox-swagger-ui", version: SWAGGER_VERSION
+    compile group: "io.springfox", name: "springfox-swagger2", version: SWAGGER_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // Sybotan依赖
+//    compile group: "cn.sagacloud", name: "saga-kotlin-base", version: SAGA_KOTLIN_VERSION
+//    compile group: "cn.sagacloud", name: "saga-kotlin-database", version: SAGA_KOTLIN_VERSION
+//    compile group: "cn.sagacloud", name: "saga-kotlin-mybatis", version: SAGA_KOTLIN_VERSION
+//    compile group: "cn.sagacloud", name: "saga-kotlin-postgresql", version: SAGA_KOTLIN_VERSION
+//    compile group: "cn.sagacloud", name: "saga-service-base", version: SAGA_SERVICE_VERSION
+//    compile group: "cn.sagacloud", name: "saga-service-mybatis", version: SAGA_SERVICE_VERSION
+    compile group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.persagy", name: "persagy-kotlin-database", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.persagy", name: "persagy-kotlin-postgresql", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.persagy", name: "persagy-service-base", version: PERSAGY_SERVICE_VERSION
+    compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
+
+    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    // 数据中心依赖  
+    compile project(":data-core")
+
+    // 网络操作依赖
+    // https://mvnrepository.com/artifact/io.netty/netty-all
+    compile group: 'io.netty',  name: 'netty-all',  version: NETTY_VERSION
+
+//    // https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
+//    compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.7.0'
+
+    // https://mvnrepository.com/artifact/org.mybatis/mybatis
+    compile group: 'org.mybatis', name: 'mybatis', version: '3.5.0'
+
+    // https://mvnrepository.com/artifact/org.mybatis/mybatis-guice
+    compile group: 'org.mybatis', name: 'mybatis-guice', version: '3.10'
+    // https://mvnrepository.com/artifact/org.yaml/snakeyaml
+    compile group: 'org.yaml', name: 'snakeyaml', version: '1.24'
+    // https://mvnrepository.com/artifact/com.google.inject/guice
+    compile group: 'com.google.inject', name: 'guice', version: '4.2.2'
+
+    // https://mvnrepository.com/artifact/log4j/log4j
+    compile group: 'log4j', name: 'log4j', version: '1.2.17'
+    // https://mvnrepository.com/artifact/com.alibaba/fastjson
+    compile group: 'com.alibaba', name: 'fastjson', version: '1.2.56'
+
+    compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25'
+
+    // https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
+    compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.11.4'
+
+    // 生成uuid
+    // https://mvnrepository.com/artifact/com.fasterxml.uuid/java-uuid-generator
+    compile group: 'com.fasterxml.uuid', name: 'java-uuid-generator', version: '3.2.0'
+
+}
+
+//dependencyManagement {
+//    imports {
+//        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${SPRING_CLOUD_DEPENDENCIES}"
+//    }
+//}
+
+
+// 下面是配置文件选择
+/*******************************************************/
+
+sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
+//ext.needTest = 'true'
+// 打产品包
+task buildProdWar {
+    doFirst {
+        sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-prod"]
+        test.onlyIf {
+            project.hasProperty("needTest")
+        }
+    }
+    finalizedBy(build)
+}
+// 打开发环境包
+task buildDevWar {
+    doFirst {
+        sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
+        test.onlyIf {
+            project.hasProperty("needTest")
+        }
+    }
+    finalizedBy(build)
+}
+
+// 打产品包
+task buildProdJar {
+    doFirst {
+        sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-prod"]
+        test.onlyIf {
+            project.hasProperty("needTest")
+        }
+    }
+    finalizedBy(bootJar)
+}
+// 打开发环境包
+task buildDevJar {
+    doFirst {
+        sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
+        test.onlyIf {
+            project.hasProperty("needTest")
+        }
+    }
+    finalizedBy(bootJar)
+}
+

+ 66 - 0
scheduler/src/main/java/com/persagy/mybatis/DownloadTaskModel.java

@@ -0,0 +1,66 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//public class DownloadTaskModel {
+//    private int id;
+//    private int task_id;
+//    private String task_url;
+//    private String task_md5;
+//
+//    public int getId() {
+//        return id;
+//    }
+//
+//    public void setId(int id) {
+//        this.id = id;
+//    }
+//
+//    public int getTask_id() {
+//        return task_id;
+//    }
+//
+//    public void setTask_id(int task_id) {
+//        this.task_id = task_id;
+//    }
+//
+//    public String getTask_url() {
+//        return task_url;
+//    }
+//
+//    public void setTask_url(String task_url) {
+//        this.task_url = task_url;
+//    }
+//
+//    public String getTask_md5() {
+//        return task_md5;
+//    }
+//
+//    public void setTask_md5(String task_md5) {
+//        this.task_md5 = task_md5;
+//    }
+//}

+ 64 - 0
scheduler/src/main/java/com/persagy/mybatis/MyBatisSqlSessionFactory.java

@@ -0,0 +1,64 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//import org.apache.ibatis.io.Resources;
+//import org.apache.ibatis.session.SqlSession;
+//import org.apache.ibatis.session.SqlSessionFactory;
+//import org.apache.ibatis.session.SqlSessionFactoryBuilder;
+//
+//import java.io.IOException;
+//import java.io.InputStream;
+//
+//public class MyBatisSqlSessionFactory {
+//    private MyBatisSqlSessionFactory(){}
+//    private static volatile SqlSessionFactory sqlSessionFactory = null;
+//    public static SqlSessionFactory getSqlSessionFactory(){
+//        if(sqlSessionFactory==null){
+//            InputStream inputStream;
+//            try {
+//                synchronized(MyBatisSqlSessionFactory.class) {
+//                    if (sqlSessionFactory == null) {
+//                        inputStream = Resources.getResourceAsStream("mybatis-config.xml");
+//                        sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
+//                    }
+//                }
+////                sqlSessionFactory.getConfiguration().addMapper(UserMapper.class);
+////                sqlSessionFactory.getConfiguration().addMapper(ManufacturerMapper.class);
+////                sqlSessionFactory.getConfiguration().addMapper(BrandMapper.class);
+//            }
+//            catch(IOException e){
+//                System.out.println(e.getMessage());
+//                throw new RuntimeException(e.getCause());
+//            }
+//        }
+//        return sqlSessionFactory;
+//    }
+//    public static SqlSession openSession(){
+//        return getSqlSessionFactory().openSession();
+//    }
+//}

+ 166 - 0
scheduler/src/main/java/com/persagy/mybatis/TaskDAO.java

@@ -0,0 +1,166 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//import org.apache.ibatis.session.SqlSession;
+//
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//import cn.sagacloud.mybatis.*;
+//
+//public class TaskDAO {
+//
+//
+//    public boolean addTask(TaskModel task) {
+//        SqlSession session = null;
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            int affectedRow = taskMapper.addTask(task);
+//            boolean result = addDownload(task);
+//            if(!result){
+//                session.rollback();
+//            }
+//            return result;
+//        } catch (Exception e) {
+//            return false;
+//        } finally {
+//            if(session != null)
+//                session.commit();
+//            if (session != null)
+//                session.close();
+//        }
+//    }
+//
+//    private boolean addDownload(TaskModel task) {
+//        SqlSession session = null;
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            if(task.getId() == 0)
+//                return false;
+//            if(task.getDownloadTaskModelList().size() == 0)
+//                return true;
+//            int infectedRow = taskMapper.addDownload(task.getDownloadTaskModelList(), task.getId());
+//
+//            if(infectedRow == task.getDownloadTaskModelList().size())
+//                return true;
+//            return true;
+//        } catch (Exception e) {
+//            session.rollback();
+//            return false;
+//        } finally {
+//            if(session != null)
+//                session.commit();
+//            if (session != null)
+//                session.close();
+//        }
+//    }
+//
+//    public ArrayList<TaskModel> getTasksByIds(List<Integer> idList) {
+//        SqlSession session = null;
+//        ArrayList<TaskModel> result = new ArrayList<>();
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            result = taskMapper.getTasksByIds(idList);
+//            session.commit();
+//        } catch (Exception ignore) {
+//        } finally {
+//            if (session != null)
+//                session.close();
+//        }
+//        return result;
+//    }
+//
+//    public ArrayList<TaskModel> getTasksByStatus(List<Integer> statusList) {
+//        SqlSession session = null;
+//        ArrayList<TaskModel> result = new ArrayList<>();
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            result = taskMapper.getTasksByStatus(statusList);
+//            session.commit();
+//        } catch (Exception ignore) {
+//        } finally {
+//            if (session != null)
+//                session.close();
+//        }
+//        return result;
+//    }
+//
+//    public boolean updateSingleTask(TaskModel task) {
+//        SqlSession session = null;
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            int affectedRow = taskMapper.updateSingleTask(task);
+//            session.commit();
+//            return affectedRow > -1;
+//        } catch (Exception e) {
+//            return false;
+//        } finally {
+//            if (session != null)
+//                session.close();
+//        }
+//    }
+//
+//
+//    public Map<Integer, TaskModel> getAllTaskMapByStatus(List<Integer> statusList) {
+//        SqlSession session = null;
+//        Map<Integer, TaskModel> result = new HashMap<>();
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            result = taskMapper.getTasksMapByStatus(statusList);
+//            session.commit();
+//        } catch (Exception ignore) {
+//        } finally {
+//            if (session != null)
+//                session.close();
+//        }
+//        return result;
+//    }
+//
+//    public Map<Integer, TaskModel> getTaskMapByIds(List<Integer> idList) {
+//        SqlSession session = null;
+//        Map<Integer, TaskModel> result = new HashMap<>();
+//        try {
+//            session = MyBatisSqlSessionFactory.openSession();
+//            TaskMapper taskMapper = session.getMapper(TaskMapper.class);
+//            result = taskMapper.getTasksMapByIds(idList);
+//            session.commit();
+//        } catch (Exception ignore) {
+//        } finally {
+//            if (session != null)
+//                session.close();
+//        }
+//        return result;
+//    }
+//}

+ 50 - 0
scheduler/src/main/java/com/persagy/mybatis/TaskMapper.java

@@ -0,0 +1,50 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//import org.apache.ibatis.annotations.MapKey;
+//import org.apache.ibatis.annotations.Param;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//import java.util.Map;
+//
+//public interface TaskMapper {
+//    int addTask(TaskModel task);
+//
+//    int addDownload(@Param("list") List<DownloadTaskModel> downloadTaskModelList, @Param("taskId") int id);
+//
+//    ArrayList<TaskModel> getTasksByIds(List<Integer> idList);
+//
+//    ArrayList<TaskModel> getTasksByStatus(List<Integer> statusList);
+//
+//    int updateSingleTask(TaskModel task);
+//    @MapKey("id")
+//    Map<Integer, TaskModel> getTasksMapByIds(List<Integer> idList);
+//    @MapKey("id")
+//    Map<Integer, TaskModel> getTasksMapByStatus(List<Integer> statusList);
+//}

+ 132 - 0
scheduler/src/main/java/com/persagy/mybatis/TaskModel.java

@@ -0,0 +1,132 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//
+//import com.alibaba.fastjson.annotation.JSONField;
+//
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//public class TaskModel {
+//    private int id;
+//    private String task_name;
+//    private String task_cmd;
+//    private String task_param;
+//    @JSONField(serialize=false)
+//    private int task_status;
+//    private String task_result_json;
+//    @JSONField(serialize=false)
+//    private String task_last_client;
+//    @JSONField(serialize=false)
+//    private long task_sent_time;
+//    private long task_expected_finish_time;
+//
+//    private List<DownloadTaskModel> downloadTaskModelList;
+//
+//    public long getTask_sent_time() {
+//        return task_sent_time;
+//    }
+//
+//    public void setTask_sent_time(long task_sent_time) {
+//        this.task_sent_time = task_sent_time;
+//    }
+//
+//    public int getId() {
+//        return id;
+//    }
+//
+//    public void setId(int id) {
+//        this.id = id;
+//    }
+//
+//    public String getTask_name() {
+//        return task_name;
+//    }
+//
+//    public void setTask_name(String task_name) {
+//        this.task_name = task_name;
+//    }
+//
+//    public String getTask_cmd() {
+//        return task_cmd;
+//    }
+//
+//    public void setTask_cmd(String task_cmd) {
+//        this.task_cmd = task_cmd;
+//    }
+//
+//    public String getTask_param() {
+//        return task_param;
+//    }
+//
+//    public void setTask_param(String task_param) {
+//        this.task_param = task_param;
+//    }
+//
+//    public int getTask_status() {
+//        return task_status;
+//    }
+//
+//    public void setTask_status(int task_status) {
+//        this.task_status = task_status;
+//    }
+//
+//    public String getTask_result_json() {
+//        return task_result_json;
+//    }
+//
+//    public void setTask_result_json(String task_result_json) {
+//        this.task_result_json = task_result_json;
+//    }
+//
+//    public String getTask_last_client() {
+//        return task_last_client;
+//    }
+//
+//    public void setTask_last_client(String task_last_client) {
+//        this.task_last_client = task_last_client;
+//    }
+//
+//    public long getTask_expected_finish_time() {
+//        return task_expected_finish_time;
+//    }
+//
+//    public void setTask_expected_finish_time(long task_expected_finish_time) {
+//        this.task_expected_finish_time = task_expected_finish_time;
+//    }
+//
+//    public List<DownloadTaskModel> getDownloadTaskModelList() {
+//        if(downloadTaskModelList == null )
+//            downloadTaskModelList = new ArrayList<>();
+//        return downloadTaskModelList;
+//    }
+//
+//    public void setDownloadTaskModelList(List<DownloadTaskModel> downloadTaskModelList) {
+//        this.downloadTaskModelList = downloadTaskModelList;
+//    }
+//}

+ 86 - 0
scheduler/src/main/java/com/persagy/mybatis/TaskService.java

@@ -0,0 +1,86 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.mybatis;//package cn.sagacloud.mybatis;
+//
+//import com.google.inject.Inject;
+//import org.mybatis.guice.transactional.Transactional;
+//
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//public class TaskService {
+//    private TaskDAO taskDAO;
+//
+//    @Inject
+//    public TaskService(TaskDAO taskDAO){
+//        this.taskDAO = taskDAO;
+//    }
+//    @Transactional
+//    public boolean addTask(TaskModel task) throws Exception {
+//        if(task.getDownloadTaskModelList().size() == 0)
+//            throw new Exception("不能添加没有下载文件的任务");
+//        if(taskDAO.addTask(task))
+//            return true;
+//        return false;
+//    }
+//    @Transactional
+//    public boolean updateTask(TaskModel task) throws Exception {
+//        boolean result = taskDAO.updateSingleTask(task);
+//        return result;
+//    }
+//
+//
+//    public ArrayList<TaskModel> getAllTaskByStatus(List<Integer> statusList) throws Exception {
+//        if(statusList == null || statusList.size() == 0)
+//            return new ArrayList<>();
+//        ArrayList<TaskModel> tasks = taskDAO.getTasksByStatus(statusList);
+//        return tasks;
+//    }
+//
+//    public ArrayList<TaskModel> getTaskByIds(List<Integer> idList) throws Exception {
+//        if(idList == null || idList.size() == 0)
+//            return new ArrayList<>();
+//        ArrayList<TaskModel> tasks = taskDAO.getTasksByIds(idList);
+//        return tasks;
+//    }
+//
+//    public Map<Integer, TaskModel> getAllTaskMapByStatus(List<Integer> statusList) throws Exception {
+//        if(statusList == null || statusList.size() == 0)
+//            return new HashMap<>();
+//        Map<Integer, TaskModel> tasks = taskDAO.getAllTaskMapByStatus(statusList);
+//        return tasks;
+//    }
+//
+//    public Map<Integer, TaskModel> getTaskMapByIds(List<Integer> idList) throws Exception {
+//        if(idList == null || idList.size() == 0)
+//            return new HashMap<>();
+//        Map<Integer, TaskModel> tasks = taskDAO.getTaskMapByIds(idList);
+//        return tasks;
+//    }
+//}

+ 805 - 0
scheduler/src/main/java/com/persagy/proto/MessageProto.java.bak

@@ -0,0 +1,805 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: MessageProto.proto
+
+package cn.sagacloud.proto;
+
+public final class MessageProto {
+  private MessageProto() {}
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistryLite registry) {
+  }
+
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistry registry) {
+    registerAllExtensions(
+        (com.google.protobuf.ExtensionRegistryLite) registry);
+  }
+  public interface MessageOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:cn.sagacloud.proto.Message)
+      com.google.protobuf.MessageOrBuilder {
+
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    String getCmd();
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    com.google.protobuf.ByteString
+        getCmdBytes();
+
+    /**
+     * <code>int32 taskId = 2;</code>
+     */
+    int getTaskId();
+
+    /**
+     * <code>string content = 3;</code>
+     */
+    String getContent();
+    /**
+     * <code>string content = 3;</code>
+     */
+    com.google.protobuf.ByteString
+        getContentBytes();
+  }
+  /**
+   * Protobuf type {@code cn.sagacloud.proto.Message}
+   */
+  public  static final class Message extends
+      com.google.protobuf.GeneratedMessageV3 implements
+      // @@protoc_insertion_point(message_implements:cn.sagacloud.proto.Message)
+      MessageOrBuilder {
+  private static final long serialVersionUID = 0L;
+    // Use Message.newBuilder() to construct.
+    private Message(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
+      super(builder);
+    }
+    private Message() {
+      cmd_ = "";
+      content_ = "";
+    }
+
+    @Override
+    public final com.google.protobuf.UnknownFieldSet
+    getUnknownFields() {
+      return this.unknownFields;
+    }
+    private Message(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      this();
+      if (extensionRegistry == null) {
+        throw new NullPointerException();
+      }
+      int mutable_bitField0_ = 0;
+      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+          com.google.protobuf.UnknownFieldSet.newBuilder();
+      try {
+        boolean done = false;
+        while (!done) {
+          int tag = input.readTag();
+          switch (tag) {
+            case 0:
+              done = true;
+              break;
+            case 10: {
+              String s = input.readStringRequireUtf8();
+
+              cmd_ = s;
+              break;
+            }
+            case 16: {
+
+              taskId_ = input.readInt32();
+              break;
+            }
+            case 26: {
+              String s = input.readStringRequireUtf8();
+
+              content_ = s;
+              break;
+            }
+            default: {
+              if (!parseUnknownField(
+                  input, unknownFields, extensionRegistry, tag)) {
+                done = true;
+              }
+              break;
+            }
+          }
+        }
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        throw e.setUnfinishedMessage(this);
+      } catch (java.io.IOException e) {
+        throw new com.google.protobuf.InvalidProtocolBufferException(
+            e).setUnfinishedMessage(this);
+      } finally {
+        this.unknownFields = unknownFields.build();
+        makeExtensionsImmutable();
+      }
+    }
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return MessageProto.internal_static_cn_sagacloud_proto_Message_descriptor;
+    }
+
+    @Override
+    protected FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return MessageProto.internal_static_cn_sagacloud_proto_Message_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              Message.class, Builder.class);
+    }
+
+    public static final int CMD_FIELD_NUMBER = 1;
+    private volatile Object cmd_;
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    public String getCmd() {
+      Object ref = cmd_;
+      if (ref instanceof String) {
+        return (String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        cmd_ = s;
+        return s;
+      }
+    }
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    public com.google.protobuf.ByteString
+        getCmdBytes() {
+      Object ref = cmd_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        cmd_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
+    public static final int TASKID_FIELD_NUMBER = 2;
+    private int taskId_;
+    /**
+     * <code>int32 taskId = 2;</code>
+     */
+    public int getTaskId() {
+      return taskId_;
+    }
+
+    public static final int CONTENT_FIELD_NUMBER = 3;
+    private volatile Object content_;
+    /**
+     * <code>string content = 3;</code>
+     */
+    public String getContent() {
+      Object ref = content_;
+      if (ref instanceof String) {
+        return (String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        content_ = s;
+        return s;
+      }
+    }
+    /**
+     * <code>string content = 3;</code>
+     */
+    public com.google.protobuf.ByteString
+        getContentBytes() {
+      Object ref = content_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        content_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
+    private byte memoizedIsInitialized = -1;
+    @Override
+    public final boolean isInitialized() {
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized == 1) return true;
+      if (isInitialized == 0) return false;
+
+      memoizedIsInitialized = 1;
+      return true;
+    }
+
+    @Override
+    public void writeTo(com.google.protobuf.CodedOutputStream output)
+                        throws java.io.IOException {
+      if (!getCmdBytes().isEmpty()) {
+        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cmd_);
+      }
+      if (taskId_ != 0) {
+        output.writeInt32(2, taskId_);
+      }
+      if (!getContentBytes().isEmpty()) {
+        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_);
+      }
+      unknownFields.writeTo(output);
+    }
+
+    @Override
+    public int getSerializedSize() {
+      int size = memoizedSize;
+      if (size != -1) return size;
+
+      size = 0;
+      if (!getCmdBytes().isEmpty()) {
+        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cmd_);
+      }
+      if (taskId_ != 0) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(2, taskId_);
+      }
+      if (!getContentBytes().isEmpty()) {
+        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_);
+      }
+      size += unknownFields.getSerializedSize();
+      memoizedSize = size;
+      return size;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+      if (obj == this) {
+       return true;
+      }
+      if (!(obj instanceof Message)) {
+        return super.equals(obj);
+      }
+      Message other = (Message) obj;
+
+      if (!getCmd()
+          .equals(other.getCmd())) return false;
+      if (getTaskId()
+          != other.getTaskId()) return false;
+      if (!getContent()
+          .equals(other.getContent())) return false;
+      if (!unknownFields.equals(other.unknownFields)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      if (memoizedHashCode != 0) {
+        return memoizedHashCode;
+      }
+      int hash = 41;
+      hash = (19 * hash) + getDescriptor().hashCode();
+      hash = (37 * hash) + CMD_FIELD_NUMBER;
+      hash = (53 * hash) + getCmd().hashCode();
+      hash = (37 * hash) + TASKID_FIELD_NUMBER;
+      hash = (53 * hash) + getTaskId();
+      hash = (37 * hash) + CONTENT_FIELD_NUMBER;
+      hash = (53 * hash) + getContent().hashCode();
+      hash = (29 * hash) + unknownFields.hashCode();
+      memoizedHashCode = hash;
+      return hash;
+    }
+
+    public static Message parseFrom(
+        java.nio.ByteBuffer data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        java.nio.ByteBuffer data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.ByteString data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.ByteString data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(byte[] data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        byte[] data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input);
+    }
+    public static Message parseFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input, extensionRegistry);
+    }
+    public static Message parseDelimitedFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseDelimitedWithIOException(PARSER, input);
+    }
+    public static Message parseDelimitedFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.CodedInputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input, extensionRegistry);
+    }
+
+    @Override
+    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
+    public static Builder newBuilder(Message prototype) {
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+    }
+    @Override
+    public Builder toBuilder() {
+      return this == DEFAULT_INSTANCE
+          ? new Builder() : new Builder().mergeFrom(this);
+    }
+
+    @Override
+    protected Builder newBuilderForType(
+        BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
+    /**
+     * Protobuf type {@code cn.sagacloud.proto.Message}
+     */
+    public static final class Builder extends
+        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
+        // @@protoc_insertion_point(builder_implements:cn.sagacloud.proto.Message)
+        MessageOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return MessageProto.internal_static_cn_sagacloud_proto_Message_descriptor;
+      }
+
+      @Override
+      protected FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return MessageProto.internal_static_cn_sagacloud_proto_Message_fieldAccessorTable
+            .ensureFieldAccessorsInitialized(
+                Message.class, Builder.class);
+      }
+
+      // Construct using cn.sagacloud.proto.MessageProto.Message.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
+      }
+
+      private Builder(
+          BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessageV3
+                .alwaysUseFieldBuilders) {
+        }
+      }
+      @Override
+      public Builder clear() {
+        super.clear();
+        cmd_ = "";
+
+        taskId_ = 0;
+
+        content_ = "";
+
+        return this;
+      }
+
+      @Override
+      public com.google.protobuf.Descriptors.Descriptor
+          getDescriptorForType() {
+        return MessageProto.internal_static_cn_sagacloud_proto_Message_descriptor;
+      }
+
+      @Override
+      public Message getDefaultInstanceForType() {
+        return Message.getDefaultInstance();
+      }
+
+      @Override
+      public Message build() {
+        Message result = buildPartial();
+        if (!result.isInitialized()) {
+          throw newUninitializedMessageException(result);
+        }
+        return result;
+      }
+
+      @Override
+      public Message buildPartial() {
+        Message result = new Message(this);
+        result.cmd_ = cmd_;
+        result.taskId_ = taskId_;
+        result.content_ = content_;
+        onBuilt();
+        return result;
+      }
+
+      @Override
+      public Builder clone() {
+        return super.clone();
+      }
+      @Override
+      public Builder setField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          Object value) {
+        return super.setField(field, value);
+      }
+      @Override
+      public Builder clearField(
+          com.google.protobuf.Descriptors.FieldDescriptor field) {
+        return super.clearField(field);
+      }
+      @Override
+      public Builder clearOneof(
+          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+        return super.clearOneof(oneof);
+      }
+      @Override
+      public Builder setRepeatedField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          int index, Object value) {
+        return super.setRepeatedField(field, index, value);
+      }
+      @Override
+      public Builder addRepeatedField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          Object value) {
+        return super.addRepeatedField(field, value);
+      }
+      @Override
+      public Builder mergeFrom(com.google.protobuf.Message other) {
+        if (other instanceof Message) {
+          return mergeFrom((Message)other);
+        } else {
+          super.mergeFrom(other);
+          return this;
+        }
+      }
+
+      public Builder mergeFrom(Message other) {
+        if (other == Message.getDefaultInstance()) return this;
+        if (!other.getCmd().isEmpty()) {
+          cmd_ = other.cmd_;
+          onChanged();
+        }
+        if (other.getTaskId() != 0) {
+          setTaskId(other.getTaskId());
+        }
+        if (!other.getContent().isEmpty()) {
+          content_ = other.content_;
+          onChanged();
+        }
+        this.mergeUnknownFields(other.unknownFields);
+        onChanged();
+        return this;
+      }
+
+      @Override
+      public final boolean isInitialized() {
+        return true;
+      }
+
+      @Override
+      public Builder mergeFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws java.io.IOException {
+        Message parsedMessage = null;
+        try {
+          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          parsedMessage = (Message) e.getUnfinishedMessage();
+          throw e.unwrapIOException();
+        } finally {
+          if (parsedMessage != null) {
+            mergeFrom(parsedMessage);
+          }
+        }
+        return this;
+      }
+
+      private Object cmd_ = "";
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public String getCmd() {
+        Object ref = cmd_;
+        if (!(ref instanceof String)) {
+          com.google.protobuf.ByteString bs =
+              (com.google.protobuf.ByteString) ref;
+          String s = bs.toStringUtf8();
+          cmd_ = s;
+          return s;
+        } else {
+          return (String) ref;
+        }
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public com.google.protobuf.ByteString
+          getCmdBytes() {
+        Object ref = cmd_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (String) ref);
+          cmd_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder setCmd(
+          String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  
+        cmd_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder clearCmd() {
+        
+        cmd_ = getDefaultInstance().getCmd();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder setCmdBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+        
+        cmd_ = value;
+        onChanged();
+        return this;
+      }
+
+      private int taskId_ ;
+      /**
+       * <code>int32 taskId = 2;</code>
+       */
+      public int getTaskId() {
+        return taskId_;
+      }
+      /**
+       * <code>int32 taskId = 2;</code>
+       */
+      public Builder setTaskId(int value) {
+        
+        taskId_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>int32 taskId = 2;</code>
+       */
+      public Builder clearTaskId() {
+        
+        taskId_ = 0;
+        onChanged();
+        return this;
+      }
+
+      private Object content_ = "";
+      /**
+       * <code>string content = 3;</code>
+       */
+      public String getContent() {
+        Object ref = content_;
+        if (!(ref instanceof String)) {
+          com.google.protobuf.ByteString bs =
+              (com.google.protobuf.ByteString) ref;
+          String s = bs.toStringUtf8();
+          content_ = s;
+          return s;
+        } else {
+          return (String) ref;
+        }
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public com.google.protobuf.ByteString
+          getContentBytes() {
+        Object ref = content_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (String) ref);
+          content_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder setContent(
+          String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  
+        content_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder clearContent() {
+        
+        content_ = getDefaultInstance().getContent();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder setContentBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+        
+        content_ = value;
+        onChanged();
+        return this;
+      }
+      @Override
+      public final Builder setUnknownFields(
+          final com.google.protobuf.UnknownFieldSet unknownFields) {
+        return super.setUnknownFields(unknownFields);
+      }
+
+      @Override
+      public final Builder mergeUnknownFields(
+          final com.google.protobuf.UnknownFieldSet unknownFields) {
+        return super.mergeUnknownFields(unknownFields);
+      }
+
+
+      // @@protoc_insertion_point(builder_scope:cn.sagacloud.proto.Message)
+    }
+
+    // @@protoc_insertion_point(class_scope:cn.sagacloud.proto.Message)
+    private static final Message DEFAULT_INSTANCE;
+    static {
+      DEFAULT_INSTANCE = new Message();
+    }
+
+    public static Message getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static final com.google.protobuf.Parser<Message>
+        PARSER = new com.google.protobuf.AbstractParser<Message>() {
+      @Override
+      public Message parsePartialFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws com.google.protobuf.InvalidProtocolBufferException {
+        return new Message(input, extensionRegistry);
+      }
+    };
+
+    public static com.google.protobuf.Parser<Message> parser() {
+      return PARSER;
+    }
+
+    @Override
+    public com.google.protobuf.Parser<Message> getParserForType() {
+      return PARSER;
+    }
+
+    @Override
+    public Message getDefaultInstanceForType() {
+      return DEFAULT_INSTANCE;
+    }
+
+  }
+
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_cn_sagacloud_proto_Message_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_cn_sagacloud_proto_Message_fieldAccessorTable;
+
+  public static com.google.protobuf.Descriptors.FileDescriptor
+      getDescriptor() {
+    return descriptor;
+  }
+  private static  com.google.protobuf.Descriptors.FileDescriptor
+      descriptor;
+  static {
+    String[] descriptorData = {
+      "\n\022MessageProto.proto\022\022cn.sagacloud.proto" +
+      "\"7\n\007Message\022\013\n\003cmd\030\001 \001(\t\022\016\n\006taskId\030\002 \001(\005" +
+      "\022\017\n\007content\030\003 \001(\tB\020B\014MessageProtoH\001b\006pro" +
+      "to3"
+    };
+    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
+          public com.google.protobuf.ExtensionRegistry assignDescriptors(
+              com.google.protobuf.Descriptors.FileDescriptor root) {
+            descriptor = root;
+            return null;
+          }
+        };
+    com.google.protobuf.Descriptors.FileDescriptor
+      .internalBuildGeneratedFileFrom(descriptorData,
+        new com.google.protobuf.Descriptors.FileDescriptor[] {
+        }, assigner);
+    internal_static_cn_sagacloud_proto_Message_descriptor =
+      getDescriptor().getMessageTypes().get(0);
+    internal_static_cn_sagacloud_proto_Message_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_cn_sagacloud_proto_Message_descriptor,
+        new String[] { "Cmd", "TaskId", "Content", });
+  }
+
+  // @@protoc_insertion_point(outer_class_scope)
+}

+ 904 - 0
scheduler/src/main/java/com/persagy/proto/MessageProtoStr.java

@@ -0,0 +1,904 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: MessageProto.proto
+
+package com.persagy.proto;
+
+public final class MessageProtoStr {
+  private MessageProtoStr() {}
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistryLite registry) {
+  }
+
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistry registry) {
+    registerAllExtensions(
+        (com.google.protobuf.ExtensionRegistryLite) registry);
+  }
+  public interface MessageOrBuilder extends
+      // @@protoc_insertion_point(interface_extends:cn.sagacloud.proto.Message)
+      com.google.protobuf.MessageOrBuilder {
+
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    String getCmd();
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    com.google.protobuf.ByteString
+        getCmdBytes();
+
+    /**
+     * <code>string taskId = 2;</code>
+     */
+    String getTaskId();
+    /**
+     * <code>string taskId = 2;</code>
+     */
+    com.google.protobuf.ByteString
+        getTaskIdBytes();
+
+    /**
+     * <code>string content = 3;</code>
+     */
+    String getContent();
+    /**
+     * <code>string content = 3;</code>
+     */
+    com.google.protobuf.ByteString
+        getContentBytes();
+  }
+  /**
+   * Protobuf type {@code cn.sagacloud.proto.Message}
+   */
+  public  static final class Message extends
+      com.google.protobuf.GeneratedMessageV3 implements
+      // @@protoc_insertion_point(message_implements:cn.sagacloud.proto.Message)
+      MessageOrBuilder {
+  private static final long serialVersionUID = 0L;
+    // Use Message.newBuilder() to construct.
+    private Message(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
+      super(builder);
+    }
+    private Message() {
+      cmd_ = "";
+      taskId_ = "";
+      content_ = "";
+    }
+
+    @Override
+    @SuppressWarnings({"unused"})
+    protected Object newInstance(
+        UnusedPrivateParameter unused) {
+      return new Message();
+    }
+
+    @Override
+    public final com.google.protobuf.UnknownFieldSet
+    getUnknownFields() {
+      return this.unknownFields;
+    }
+    private Message(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      this();
+      if (extensionRegistry == null) {
+        throw new NullPointerException();
+      }
+      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+          com.google.protobuf.UnknownFieldSet.newBuilder();
+      try {
+        boolean done = false;
+        while (!done) {
+          int tag = input.readTag();
+          switch (tag) {
+            case 0:
+              done = true;
+              break;
+            case 10: {
+              String s = input.readStringRequireUtf8();
+
+              cmd_ = s;
+              break;
+            }
+            case 18: {
+              String s = input.readStringRequireUtf8();
+
+              taskId_ = s;
+              break;
+            }
+            case 26: {
+              String s = input.readStringRequireUtf8();
+
+              content_ = s;
+              break;
+            }
+            default: {
+              if (!parseUnknownField(
+                  input, unknownFields, extensionRegistry, tag)) {
+                done = true;
+              }
+              break;
+            }
+          }
+        }
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        throw e.setUnfinishedMessage(this);
+      } catch (java.io.IOException e) {
+        throw new com.google.protobuf.InvalidProtocolBufferException(
+            e).setUnfinishedMessage(this);
+      } finally {
+        this.unknownFields = unknownFields.build();
+        makeExtensionsImmutable();
+      }
+    }
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return MessageProtoStr.internal_static_cn_sagacloud_proto_Message_descriptor;
+    }
+
+    @Override
+    protected FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return MessageProtoStr.internal_static_cn_sagacloud_proto_Message_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              Message.class, Builder.class);
+    }
+
+    public static final int CMD_FIELD_NUMBER = 1;
+    private volatile Object cmd_;
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    public String getCmd() {
+      Object ref = cmd_;
+      if (ref instanceof String) {
+        return (String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        cmd_ = s;
+        return s;
+      }
+    }
+    /**
+     * <code>string cmd = 1;</code>
+     */
+    public com.google.protobuf.ByteString
+        getCmdBytes() {
+      Object ref = cmd_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        cmd_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
+    public static final int TASKID_FIELD_NUMBER = 2;
+    private volatile Object taskId_;
+    /**
+     * <code>string taskId = 2;</code>
+     */
+    public String getTaskId() {
+      Object ref = taskId_;
+      if (ref instanceof String) {
+        return (String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        taskId_ = s;
+        return s;
+      }
+    }
+    /**
+     * <code>string taskId = 2;</code>
+     */
+    public com.google.protobuf.ByteString
+        getTaskIdBytes() {
+      Object ref = taskId_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        taskId_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
+    public static final int CONTENT_FIELD_NUMBER = 3;
+    private volatile Object content_;
+    /**
+     * <code>string content = 3;</code>
+     */
+    public String getContent() {
+      Object ref = content_;
+      if (ref instanceof String) {
+        return (String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        content_ = s;
+        return s;
+      }
+    }
+    /**
+     * <code>string content = 3;</code>
+     */
+    public com.google.protobuf.ByteString
+        getContentBytes() {
+      Object ref = content_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        content_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
+    private byte memoizedIsInitialized = -1;
+    @Override
+    public final boolean isInitialized() {
+      byte isInitialized = memoizedIsInitialized;
+      if (isInitialized == 1) return true;
+      if (isInitialized == 0) return false;
+
+      memoizedIsInitialized = 1;
+      return true;
+    }
+
+    @Override
+    public void writeTo(com.google.protobuf.CodedOutputStream output)
+                        throws java.io.IOException {
+      if (!getCmdBytes().isEmpty()) {
+        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cmd_);
+      }
+      if (!getTaskIdBytes().isEmpty()) {
+        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, taskId_);
+      }
+      if (!getContentBytes().isEmpty()) {
+        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, content_);
+      }
+      unknownFields.writeTo(output);
+    }
+
+    @Override
+    public int getSerializedSize() {
+      int size = memoizedSize;
+      if (size != -1) return size;
+
+      size = 0;
+      if (!getCmdBytes().isEmpty()) {
+        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cmd_);
+      }
+      if (!getTaskIdBytes().isEmpty()) {
+        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, taskId_);
+      }
+      if (!getContentBytes().isEmpty()) {
+        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, content_);
+      }
+      size += unknownFields.getSerializedSize();
+      memoizedSize = size;
+      return size;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+      if (obj == this) {
+       return true;
+      }
+      if (!(obj instanceof Message)) {
+        return super.equals(obj);
+      }
+      Message other = (Message) obj;
+
+      if (!getCmd()
+          .equals(other.getCmd())) return false;
+      if (!getTaskId()
+          .equals(other.getTaskId())) return false;
+      if (!getContent()
+          .equals(other.getContent())) return false;
+      if (!unknownFields.equals(other.unknownFields)) return false;
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      if (memoizedHashCode != 0) {
+        return memoizedHashCode;
+      }
+      int hash = 41;
+      hash = (19 * hash) + getDescriptor().hashCode();
+      hash = (37 * hash) + CMD_FIELD_NUMBER;
+      hash = (53 * hash) + getCmd().hashCode();
+      hash = (37 * hash) + TASKID_FIELD_NUMBER;
+      hash = (53 * hash) + getTaskId().hashCode();
+      hash = (37 * hash) + CONTENT_FIELD_NUMBER;
+      hash = (53 * hash) + getContent().hashCode();
+      hash = (29 * hash) + unknownFields.hashCode();
+      memoizedHashCode = hash;
+      return hash;
+    }
+
+    public static Message parseFrom(
+        java.nio.ByteBuffer data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        java.nio.ByteBuffer data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.ByteString data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.ByteString data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(byte[] data)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data);
+    }
+    public static Message parseFrom(
+        byte[] data,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return PARSER.parseFrom(data, extensionRegistry);
+    }
+    public static Message parseFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input);
+    }
+    public static Message parseFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input, extensionRegistry);
+    }
+    public static Message parseDelimitedFrom(java.io.InputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseDelimitedWithIOException(PARSER, input);
+    }
+    public static Message parseDelimitedFrom(
+        java.io.InputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.CodedInputStream input)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input);
+    }
+    public static Message parseFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      return com.google.protobuf.GeneratedMessageV3
+          .parseWithIOException(PARSER, input, extensionRegistry);
+    }
+
+    @Override
+    public Builder newBuilderForType() { return newBuilder(); }
+    public static Builder newBuilder() {
+      return DEFAULT_INSTANCE.toBuilder();
+    }
+    public static Builder newBuilder(Message prototype) {
+      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+    }
+    @Override
+    public Builder toBuilder() {
+      return this == DEFAULT_INSTANCE
+          ? new Builder() : new Builder().mergeFrom(this);
+    }
+
+    @Override
+    protected Builder newBuilderForType(
+        BuilderParent parent) {
+      Builder builder = new Builder(parent);
+      return builder;
+    }
+    /**
+     * Protobuf type {@code cn.sagacloud.proto.Message}
+     */
+    public static final class Builder extends
+        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
+        // @@protoc_insertion_point(builder_implements:cn.sagacloud.proto.Message)
+        MessageOrBuilder {
+      public static final com.google.protobuf.Descriptors.Descriptor
+          getDescriptor() {
+        return MessageProtoStr.internal_static_cn_sagacloud_proto_Message_descriptor;
+      }
+
+      @Override
+      protected FieldAccessorTable
+          internalGetFieldAccessorTable() {
+        return MessageProtoStr.internal_static_cn_sagacloud_proto_Message_fieldAccessorTable
+            .ensureFieldAccessorsInitialized(
+                Message.class, Builder.class);
+      }
+
+      // Construct using cn.sagacloud.proto.MessageProtoStr.Message.newBuilder()
+      private Builder() {
+        maybeForceBuilderInitialization();
+      }
+
+      private Builder(
+          BuilderParent parent) {
+        super(parent);
+        maybeForceBuilderInitialization();
+      }
+      private void maybeForceBuilderInitialization() {
+        if (com.google.protobuf.GeneratedMessageV3
+                .alwaysUseFieldBuilders) {
+        }
+      }
+      @Override
+      public Builder clear() {
+        super.clear();
+        cmd_ = "";
+
+        taskId_ = "";
+
+        content_ = "";
+
+        return this;
+      }
+
+      @Override
+      public com.google.protobuf.Descriptors.Descriptor
+          getDescriptorForType() {
+        return MessageProtoStr.internal_static_cn_sagacloud_proto_Message_descriptor;
+      }
+
+      @Override
+      public Message getDefaultInstanceForType() {
+        return Message.getDefaultInstance();
+      }
+
+      @Override
+      public Message build() {
+        Message result = buildPartial();
+        if (!result.isInitialized()) {
+          throw newUninitializedMessageException(result);
+        }
+        return result;
+      }
+
+      @Override
+      public Message buildPartial() {
+        Message result = new Message(this);
+        result.cmd_ = cmd_;
+        result.taskId_ = taskId_;
+        result.content_ = content_;
+        onBuilt();
+        return result;
+      }
+
+      @Override
+      public Builder clone() {
+        return super.clone();
+      }
+      @Override
+      public Builder setField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          Object value) {
+        return super.setField(field, value);
+      }
+      @Override
+      public Builder clearField(
+          com.google.protobuf.Descriptors.FieldDescriptor field) {
+        return super.clearField(field);
+      }
+      @Override
+      public Builder clearOneof(
+          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+        return super.clearOneof(oneof);
+      }
+      @Override
+      public Builder setRepeatedField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          int index, Object value) {
+        return super.setRepeatedField(field, index, value);
+      }
+      @Override
+      public Builder addRepeatedField(
+          com.google.protobuf.Descriptors.FieldDescriptor field,
+          Object value) {
+        return super.addRepeatedField(field, value);
+      }
+      @Override
+      public Builder mergeFrom(com.google.protobuf.Message other) {
+        if (other instanceof Message) {
+          return mergeFrom((Message)other);
+        } else {
+          super.mergeFrom(other);
+          return this;
+        }
+      }
+
+      public Builder mergeFrom(Message other) {
+        if (other == Message.getDefaultInstance()) return this;
+        if (!other.getCmd().isEmpty()) {
+          cmd_ = other.cmd_;
+          onChanged();
+        }
+        if (!other.getTaskId().isEmpty()) {
+          taskId_ = other.taskId_;
+          onChanged();
+        }
+        if (!other.getContent().isEmpty()) {
+          content_ = other.content_;
+          onChanged();
+        }
+        this.mergeUnknownFields(other.unknownFields);
+        onChanged();
+        return this;
+      }
+
+      @Override
+      public final boolean isInitialized() {
+        return true;
+      }
+
+      @Override
+      public Builder mergeFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws java.io.IOException {
+        Message parsedMessage = null;
+        try {
+          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+          parsedMessage = (Message) e.getUnfinishedMessage();
+          throw e.unwrapIOException();
+        } finally {
+          if (parsedMessage != null) {
+            mergeFrom(parsedMessage);
+          }
+        }
+        return this;
+      }
+
+      private Object cmd_ = "";
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public String getCmd() {
+        Object ref = cmd_;
+        if (!(ref instanceof String)) {
+          com.google.protobuf.ByteString bs =
+              (com.google.protobuf.ByteString) ref;
+          String s = bs.toStringUtf8();
+          cmd_ = s;
+          return s;
+        } else {
+          return (String) ref;
+        }
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public com.google.protobuf.ByteString
+          getCmdBytes() {
+        Object ref = cmd_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (String) ref);
+          cmd_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder setCmd(
+          String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  
+        cmd_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder clearCmd() {
+        
+        cmd_ = getDefaultInstance().getCmd();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string cmd = 1;</code>
+       */
+      public Builder setCmdBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+        
+        cmd_ = value;
+        onChanged();
+        return this;
+      }
+
+      private Object taskId_ = "";
+      /**
+       * <code>string taskId = 2;</code>
+       */
+      public String getTaskId() {
+        Object ref = taskId_;
+        if (!(ref instanceof String)) {
+          com.google.protobuf.ByteString bs =
+              (com.google.protobuf.ByteString) ref;
+          String s = bs.toStringUtf8();
+          taskId_ = s;
+          return s;
+        } else {
+          return (String) ref;
+        }
+      }
+      /**
+       * <code>string taskId = 2;</code>
+       */
+      public com.google.protobuf.ByteString
+          getTaskIdBytes() {
+        Object ref = taskId_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (String) ref);
+          taskId_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>string taskId = 2;</code>
+       */
+      public Builder setTaskId(
+          String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  
+        taskId_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string taskId = 2;</code>
+       */
+      public Builder clearTaskId() {
+        
+        taskId_ = getDefaultInstance().getTaskId();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string taskId = 2;</code>
+       */
+      public Builder setTaskIdBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+        
+        taskId_ = value;
+        onChanged();
+        return this;
+      }
+
+      private Object content_ = "";
+      /**
+       * <code>string content = 3;</code>
+       */
+      public String getContent() {
+        Object ref = content_;
+        if (!(ref instanceof String)) {
+          com.google.protobuf.ByteString bs =
+              (com.google.protobuf.ByteString) ref;
+          String s = bs.toStringUtf8();
+          content_ = s;
+          return s;
+        } else {
+          return (String) ref;
+        }
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public com.google.protobuf.ByteString
+          getContentBytes() {
+        Object ref = content_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (String) ref);
+          content_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder setContent(
+          String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  
+        content_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder clearContent() {
+        
+        content_ = getDefaultInstance().getContent();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>string content = 3;</code>
+       */
+      public Builder setContentBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+        
+        content_ = value;
+        onChanged();
+        return this;
+      }
+      @Override
+      public final Builder setUnknownFields(
+          final com.google.protobuf.UnknownFieldSet unknownFields) {
+        return super.setUnknownFields(unknownFields);
+      }
+
+      @Override
+      public final Builder mergeUnknownFields(
+          final com.google.protobuf.UnknownFieldSet unknownFields) {
+        return super.mergeUnknownFields(unknownFields);
+      }
+
+
+      // @@protoc_insertion_point(builder_scope:cn.sagacloud.proto.Message)
+    }
+
+    // @@protoc_insertion_point(class_scope:cn.sagacloud.proto.Message)
+    private static final Message DEFAULT_INSTANCE;
+    static {
+      DEFAULT_INSTANCE = new Message();
+    }
+
+    public static Message getDefaultInstance() {
+      return DEFAULT_INSTANCE;
+    }
+
+    private static final com.google.protobuf.Parser<Message>
+        PARSER = new com.google.protobuf.AbstractParser<Message>() {
+      @Override
+      public Message parsePartialFrom(
+          com.google.protobuf.CodedInputStream input,
+          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+          throws com.google.protobuf.InvalidProtocolBufferException {
+        return new Message(input, extensionRegistry);
+      }
+    };
+
+    public static com.google.protobuf.Parser<Message> parser() {
+      return PARSER;
+    }
+
+    @Override
+    public com.google.protobuf.Parser<Message> getParserForType() {
+      return PARSER;
+    }
+
+    @Override
+    public Message getDefaultInstanceForType() {
+      return DEFAULT_INSTANCE;
+    }
+
+  }
+
+  private static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_cn_sagacloud_proto_Message_descriptor;
+  private static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_cn_sagacloud_proto_Message_fieldAccessorTable;
+
+  public static com.google.protobuf.Descriptors.FileDescriptor
+      getDescriptor() {
+    return descriptor;
+  }
+  private static  com.google.protobuf.Descriptors.FileDescriptor
+      descriptor;
+  static {
+    String[] descriptorData = {
+      "\n\022MessageProto.proto\022\022cn.sagacloud.proto" +
+      "\"7\n\007Message\022\013\n\003cmd\030\001 \001(\t\022\016\n\006taskId\030\002 \001(\t" +
+      "\022\017\n\007content\030\003 \001(\tB\023B\017MessageProtoStrH\001b\006" +
+      "proto3"
+    };
+    descriptor = com.google.protobuf.Descriptors.FileDescriptor
+      .internalBuildGeneratedFileFrom(descriptorData,
+        new com.google.protobuf.Descriptors.FileDescriptor[] {
+        });
+    internal_static_cn_sagacloud_proto_Message_descriptor =
+      getDescriptor().getMessageTypes().get(0);
+    internal_static_cn_sagacloud_proto_Message_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_cn_sagacloud_proto_Message_descriptor,
+        new String[] { "Cmd", "TaskId", "Content", });
+  }
+
+  // @@protoc_insertion_point(outer_class_scope)
+}

+ 53 - 0
scheduler/src/main/java/com/persagy/proto/MessageUtil.java

@@ -0,0 +1,53 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.proto;
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/22
+ */
+
+public class MessageUtil {
+//    public static MessageProto.Message buildMessage(String cmd, int taskId, String content){
+//        MessageProto.Message.Builder builder = MessageProto.Message.newBuilder();
+//        builder.setCmd(cmd);
+//        builder.setTaskId(taskId);
+//        builder.setContent(content);
+//        return builder.build();
+//    }
+
+    public static MessageProtoStr.Message buildMessage(String cmd, String taskId, String content){
+        MessageProtoStr.Message.Builder builder = MessageProtoStr.Message.newBuilder();
+        builder.setCmd(cmd);
+        builder.setTaskId(taskId);
+        builder.setContent(content);
+        return builder.build();
+    }
+
+    public static void printMessage(MessageProtoStr.Message msg){
+        System.out.println("msg : cmd : " + msg.getCmd() + ", taskId : " + msg.getTaskId() + ", content : " + msg.getContent());
+    }
+}

+ 72 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/SchedulerApp.kt

@@ -0,0 +1,72 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+package com.persagy.server.scheduler
+
+import org.mybatis.spring.annotation.MapperScan
+import org.slf4j.LoggerFactory
+import org.springframework.boot.SpringApplication
+import org.springframework.boot.autoconfigure.SpringBootApplication
+import org.springframework.boot.builder.SpringApplicationBuilder
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
+import org.springframework.context.annotation.ComponentScan
+
+/**
+ * 应用配置
+ *
+ * @author  Andy
+ */
+@ComponentScan(basePackages = ["com.persagy.server", "com.persagy"])           // 配置组件扫描路径
+@MapperScan("com.persagy", "com.persagy.server")                       // Mapper组件扫描路径
+//@EnableEurekaClient
+//@EnableDiscoveryClient
+@SpringBootApplication
+open class SchedulerApp : SpringBootServletInitializer() {
+
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(SchedulerApp::class.java)
+    } // Companion object
+
+    /**
+     * 配置应用
+     *
+     * @param   application     应用构建对象
+     */
+    override fun configure(application: SpringApplicationBuilder): SpringApplicationBuilder {
+        return application.sources(SchedulerApp::class.java)
+    } // Function configure
+} // Class Application
+
+/**
+ * Web应用入口
+ *
+ * @param   args        命令行参数
+ */
+fun main(args: Array<String>) {
+    SpringApplication.run(SchedulerApp::class.java, *args)
+//    Server().start()
+    return
+} // Function main()

+ 83 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/Swagger2Config.kt

@@ -0,0 +1,83 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+package com.persagy.server.scheduler
+
+import org.slf4j.LoggerFactory
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import springfox.documentation.builders.ApiInfoBuilder
+import springfox.documentation.builders.PathSelectors
+import springfox.documentation.builders.RequestHandlerSelectors
+import springfox.documentation.service.ApiInfo
+import springfox.documentation.service.Contact
+import springfox.documentation.spi.DocumentationType
+import springfox.documentation.spring.web.plugins.Docket
+import springfox.documentation.swagger2.annotations.EnableSwagger2
+
+/**
+ * RESTful API文档生成器Swagger2配置
+ *
+ * @author  PLX
+ */
+@Configuration
+@EnableSwagger2
+open class Swagger2Config {
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(Swagger2Config::class.java)
+    } // Companion object
+
+    /**
+     * 创建RestApi文档生成器
+     *
+     * @return  返回文档生成器对象
+     */
+    @Bean
+    open fun createRestApi(): Docket {
+        logger.debug("createRestApi")
+        return Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.persagy.server.scheduler"))
+                .paths(PathSelectors.any())
+                .build()
+    } // Function createRestApi()
+
+    /**
+     * 返回API信息基本
+     *
+     * @return  返回Api基本信息
+     */
+    private fun apiInfo(): ApiInfo {
+        return ApiInfoBuilder()
+                .title("Revit调度器")
+                .description("")
+                .termsOfServiceUrl("http://www.cn.sagacloud.cn/")
+                .contact(Contact("jxing", "", "xingjinghao@sagacloud.cn"))
+                .version("2.0")
+                .build()
+    } // Function apiInfo()
+} // Class Swagger2Config

+ 32 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/TimedTaskRunner.kt

@@ -0,0 +1,32 @@
+package com.persagy.server.scheduler
+
+import cn.sagacloud.server.Server
+import org.springframework.boot.ApplicationArguments
+import org.springframework.boot.ApplicationRunner
+import org.springframework.stereotype.Component
+import kotlin.concurrent.thread
+
+/**
+ *
+ *
+ * @author jxing
+ */
+@Component
+open class TimedTaskRunner : ApplicationRunner {
+
+    var server : Server? = null
+    /**
+     * SpringApplication启动后执行的回调函数。
+     * 在此启动调度器
+     *
+     * @param   args        启动参数
+     */
+    override fun run(args: ApplicationArguments?) {
+        thread(start = true) {
+            if(server == null){
+                server = Server()
+                server!!.start()
+            }
+        } // thread
+    } // Fun run()
+} // Class AppRunner

+ 142 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/DownloadController.kt

@@ -0,0 +1,142 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.controllers
+
+import com.alibaba.fastjson.JSON
+import com.persagy.base.extensions.toJson
+import com.persagy.server.scheduler.models.DownloadEntity
+import com.persagy.server.scheduler.models.DownloadSpeedRequest
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.service.BaseDataService
+import com.persagy.server.scheduler.service.JMSProducer
+import com.persagy.service.models.requests.SCreateRequest
+import com.persagy.service.models.requests.SQueryRequest
+import com.persagy.service.models.requests.SUpdateRequest
+import com.persagy.service.models.responses.SBaseResponse
+import com.persagy.service.models.responses.SCreateResponse
+import com.persagy.service.models.responses.SQueryResponse
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+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.util.*
+
+@Api(tags = ["download接口"])
+@RestController
+@RequestMapping("/download")
+open class DownloadController {
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(DownloadController::class.java)
+    } // Companion object
+
+    @Autowired
+    lateinit var activeMQ : JMSProducer
+    /**
+     * 下载速度
+     */
+    @ApiOperation(value = "下载速度", notes = "")
+    @PostMapping(value = ["/speed"])
+    fun speed(@RequestBody request: DownloadSpeedRequest): SBaseResponse {
+        logger.debug("task =${request.toJson()}")
+        // 如果已下载完, 则给完成时间加上
+        if(request.totalBytes != null && request.totalBytes!! > -1L && request.taskId != null) {
+            if (request.downloadedBytes == request.totalBytes) {
+                val task = TaskEntity()
+                task.id = request.taskId
+                task.downloadFinishTime = Date()
+                BaseDataService.taskService.update(task, arrayListOf("downloadFinishTime"))
+            }
+        }
+        // 发送到MQ
+        try {
+            activeMQ.sendMessage(JSON.toJSONString(request))
+        }catch (ignore : Exception){}
+        return SBaseResponse()
+    } // Function create()
+
+//    /**
+//     * 创建Task
+//     */
+//    @ApiOperation(value = "创建Task", notes = "")
+//    @PostMapping(value = ["/create"])
+//    fun create(@RequestBody taskEntity: ArrayList<DownloadEntity>): SCreateResponse<DownloadEntity> {
+//        logger.debug("equip =${taskEntity.toJson()}")
+//        val request = SCreateRequest<DownloadEntity>()
+//        request.content = taskEntity
+//        return downloadService.createList(request)
+//    } // Function create()
+    /**
+     * 创建Task
+     */
+    @ApiOperation(value = "创建Task", notes = "")
+    @PostMapping(value = ["/create"])
+    fun create(@RequestBody request: SCreateRequest<DownloadEntity>): SCreateResponse<DownloadEntity> {
+        logger.debug("task =${request.toJson()}")
+        return BaseDataService.downloadService.createList(request)
+    } // Function create()
+    /**
+     * 更新Task
+     *
+     * @param   request     更新请求
+     * @return  更新结果应答信息
+     */
+    @ApiOperation(value="更新Task", notes="")
+    @PostMapping(value = ["/update"])
+    fun update(@RequestBody request: SUpdateRequest<DownloadEntity>): SBaseResponse {
+        return BaseDataService.downloadService.updateList(request)
+    } // Function update()
+
+    /**
+     * 查询Task
+     *
+     * @param   request     查询请求
+     * @return  查询结果应答信息
+     */
+    @ApiOperation(value="查询Task", notes="")
+    @PostMapping(value = ["/query"])
+    fun query(@RequestBody request: SQueryRequest): SQueryResponse<DownloadEntity> {
+        return BaseDataService.downloadService.pageQuery(request)
+    } // Function query()
+
+
+    /**
+     * 删除下载Task
+     *
+     * @param   idList      TaskEntity ID列表
+     * @return  删除结果应答信息
+     */
+    @ApiOperation(value = "删除Task", notes = "")
+    @PostMapping(value = ["/delete"])
+    fun delete(@RequestBody idList: ArrayList<DownloadEntity>): SBaseResponse {
+        return BaseDataService.downloadService.deleteByKeysList(idList)
+    } // Function delete()
+}

+ 193 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/TaskController.kt

@@ -0,0 +1,193 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.controllers
+
+import com.persagy.database.SFilter
+import com.persagy.server.scheduler.models.CommitTaskRequest
+import com.persagy.server.scheduler.models.DispatchTaskResponse
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.pojo.Command
+import com.persagy.server.scheduler.server.DispatchTask
+import com.persagy.server.scheduler.service.BaseDataService
+import com.persagy.server.scheduler.service.TasksService
+import com.persagy.server.scheduler.utils.CommonUtil
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.requests.SCreateRequest
+import com.persagy.service.models.requests.SQueryRequest
+import com.persagy.service.models.requests.SUpdateRequest
+import com.persagy.service.models.responses.SBaseResponse
+import com.persagy.service.models.responses.SCreateResponse
+import com.persagy.service.models.responses.SQueryResponse
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+import org.slf4j.LoggerFactory
+import org.springframework.beans.factory.annotation.Autowired
+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
+
+
+@Api(tags = ["Task接口"])
+@RestController
+@RequestMapping("/task")
+open class TaskController{
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(TaskController::class.java)
+    } // Companion object
+
+    @Autowired
+    lateinit var tasksService : TasksService
+
+    /**
+     * 被动派发Task任务
+     *
+     * @param   request     请求
+     * @return  派发结果应答信息
+     */
+    @ApiOperation(value="派发Task任务", notes="输入为下载模型文件的md5集合")
+    @PostMapping(value = ["/dispatch"])
+    fun dispatch(@RequestBody request: ArrayList<String>): SBaseResponse {
+        val allTaskMap = tasksService.getAllTaskMapByStatus(arrayListOf(0, 1))
+        if(allTaskMap.isEmpty()){
+            return SBaseResponse()
+        }
+        // 匹配到MD5的任务
+        val taskEntity = tasksService.getTaskByMD5(request, allTaskMap)
+        val dispatchTaskResponse = DispatchTaskResponse()
+        dispatchTaskResponse.result = SResponseType.success
+        if(taskEntity == null){
+//            dispatchTaskResponse.tasks.add(allTaskMap[0]!!)
+            dispatchTaskResponse.tasks.add(allTaskMap.values.iterator().next())
+        }else
+            dispatchTaskResponse.tasks.add(taskEntity)
+        return dispatchTaskResponse
+    } // Function update()
+
+    /**
+     * 客户端确认接受Task任务
+     *
+     * @param   request     请求
+     * @return  结果应答信息
+     */
+    @ApiOperation(value="确认Task任务", notes="输入为任务Id, LastClient, 暂时只支持单个任务的确认")
+    @PostMapping(value = ["/confirm"])
+    fun confirmDispatch(@RequestBody request: TaskEntity): SBaseResponse {
+        val response = SBaseResponse()
+        request.status = 2
+        val updateResult = BaseDataService.taskService.update(request, arrayListOf("status", "lastClient"), SFilter.inList("status", (arrayListOf(0, 1))))
+        if(updateResult){
+            response.result = SResponseType.success
+        }
+        return response
+    } // Function update()
+
+    /**
+     * 客户端提交Task任务结果
+     *
+     * @param   request     请求
+     * @return  结果应答信息
+     */
+    @ApiOperation(value="提交Task任务结果", notes="输入为任务Id, TaskResultJson, ClientInfo, 暂时只支持单个任务的提交")
+    @PostMapping(value = ["/commit"])
+    fun commit(@RequestBody request: CommitTaskRequest): SBaseResponse {
+        val response = SBaseResponse()
+        if(request.command == null)
+            return response
+        when(request.command){
+            Command.CommandError -> {
+                request.status = 4
+            }
+            Command.DownloadError -> {
+                request.status = 3
+            }
+            Command.TaskSuccess -> {
+                request.status = 5
+            }
+        }
+        DispatchTask.processResult(request, request.resultJson?:"")
+        val updateResult = BaseDataService.taskService.update(request, arrayListOf("status", "resultJson", "clientInfo"), SFilter.Companion.inList("status", arrayListOf(0, 1, 2, 3, 4)))
+        if(updateResult)
+            response.result = SResponseType.success
+        return response
+    } // Function update()
+
+
+    /**
+     * 创建Task
+     */
+    @ApiOperation(value = "创建Task", notes = "")
+    @PostMapping(value = ["/create"])
+    fun create(@RequestBody taskEntity: SCreateRequest<TaskEntity>): SCreateResponse<TaskEntity> {
+        //logger.debug("download =${taskEntity.toJson()}")
+//        val response = taskService.createList(taskEntity)
+        taskEntity.content.forEach {
+            if(it.id == null){
+                it.id = CommonUtil.generateUUID("", true)
+            }
+        }
+        return BaseDataService.taskService.createList(taskEntity)
+    } // Function create()
+
+    /**
+     * 更新Task
+     *
+     * @param   request     更新请求
+     * @return  更新结果应答信息
+     */
+    @ApiOperation(value="更新Task", notes="")
+    @PostMapping(value = ["/update"])
+    fun update(@RequestBody request: SUpdateRequest<TaskEntity>): SBaseResponse {
+        return BaseDataService.taskService.updateList(request)
+    } // Function update()
+
+    /**
+     * 查询Task
+     *
+     * @param   request     查询请求
+     * @return  查询结果应答信息
+     */
+    @ApiOperation(value="查询Task", notes="")
+    @PostMapping(value = ["/query"])
+    fun query(@RequestBody request: SQueryRequest): SQueryResponse<TaskEntity> {
+        return BaseDataService.taskService.pageQuery(request)
+    } // Function query()
+
+
+    /**
+     * 删除Task
+     *
+     * @param   idList      TaskEntity ID列表
+     * @return  删除结果应答信息
+     */
+    @ApiOperation(value = "删除Task", notes = "")
+    @PostMapping(value = ["/delete"])
+    fun delete(@RequestBody idList: ArrayList<TaskEntity>): SBaseResponse {
+        return BaseDataService.taskService.deleteByKeysList(idList)
+    } // Function delete()
+}

+ 107 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/controllers/TaskResultController.kt

@@ -0,0 +1,107 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.controllers
+
+import com.persagy.base.extensions.toJson
+import com.persagy.server.scheduler.models.TaskResultEntity
+import com.persagy.server.scheduler.service.BaseDataService
+import com.persagy.service.models.requests.SCreateRequest
+import com.persagy.service.models.requests.SQueryRequest
+import com.persagy.service.models.requests.SUpdateRequest
+import com.persagy.service.models.responses.SBaseResponse
+import com.persagy.service.models.responses.SCreateResponse
+import com.persagy.service.models.responses.SQueryResponse
+import io.swagger.annotations.Api
+import io.swagger.annotations.ApiOperation
+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
+
+/**
+ *
+ *
+ * @author jxing
+ */
+@Api(tags = ["Task 执行结果 接口"])
+@RestController
+@RequestMapping("/result")
+class TaskResultController {
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(TaskResultController::class.java)
+    } // Companion object
+
+    /**
+     * 创建Task Result
+     */
+    @ApiOperation(value = "创建Task Result", notes = "")
+    @PostMapping(value = ["/create"])
+    fun create(@RequestBody taskEntity: SCreateRequest<TaskResultEntity>): SCreateResponse<TaskResultEntity> {
+        logger.debug("result =${taskEntity.toJson()}")
+//        val response = taskService.createList(taskEntity)
+        return BaseDataService.taskResultService.createList(taskEntity)
+    } // Function create()
+
+    /**
+     * 更新Task Result
+     *
+     * @param   request     更新请求
+     * @return  更新结果应答信息
+     */
+    @ApiOperation(value="更新Task Result", notes="")
+    @PostMapping(value = ["/update"])
+    fun update(@RequestBody request: SUpdateRequest<TaskResultEntity>): SBaseResponse {
+        return BaseDataService.taskResultService.updateList(request)
+    } // Function update()
+
+    /**
+     * 查询Task Result
+     *
+     * @param   request     查询请求
+     * @return  查询结果应答信息
+     */
+    @ApiOperation(value="查询Task Result", notes="")
+    @PostMapping(value = ["/query"])
+    fun query(@RequestBody request: SQueryRequest): SQueryResponse<TaskResultEntity> {
+        return BaseDataService.taskResultService.pageQuery(request)
+    } // Function query()
+
+
+    /**
+     * 删除Task Result
+     *
+     * @param   idList      TaskEntity ID列表
+     * @return  删除结果应答信息
+     */
+    @ApiOperation(value = "删除Task Result", notes = "")
+    @PostMapping(value = ["/delete"])
+    fun delete(@RequestBody idList: ArrayList<TaskResultEntity>): SBaseResponse {
+        return BaseDataService.taskResultService.deleteByKeysList(idList)
+    } // Function delete()
+}

+ 34 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/CommitTaskRequest.kt

@@ -0,0 +1,34 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import com.persagy.server.scheduler.pojo.Command
+
+
+class CommitTaskRequest : TaskEntity(){
+    var command : Command? = null
+}

+ 34 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DispatchTaskResponse.kt

@@ -0,0 +1,34 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import com.persagy.service.models.responses.SBaseResponse
+
+
+class DispatchTaskResponse : SBaseResponse() {
+    var tasks : ArrayList<TaskEntity> = ArrayList()
+}

+ 61 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DownloadEntity.kt

@@ -0,0 +1,61 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.persagy.service.models.SBaseEntity
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+
+@ApiModel(description = "下载子任务实体类")
+@Table(name = "scheduler_str.download")
+class DownloadEntity : SBaseEntity() {
+
+    /** 所属任务id*/
+    @ApiModelProperty(value = "所属任务id")
+    @Column(name = "task_id", insertable = true, updatable = false)
+    @Id
+    @JsonProperty(value = "TaskId")
+    var taskId: String? = null
+
+    /** 下载子任务的url, 只能是http(s)协议 */
+    @ApiModelProperty(value = "下载子任务的url, 只能是http(s)协议")
+    @Column(name = "task_url")
+    @JsonProperty(value = "HttpUrl")
+    var httpUrl: String? = null
+
+
+    /** task name */
+    @ApiModelProperty(value = "任务名")
+    @Column(name = "task_md5")
+    @JsonProperty(value = "Md5")
+    var md5: String? = null
+}

+ 52 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/DownloadSpeedRequest.kt

@@ -0,0 +1,52 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+
+@ApiModel(description = "下载速度请求实体")
+class DownloadSpeedRequest {
+
+    @ApiModelProperty(value = "模型id")
+    var modelId : String? = null
+
+    @ApiModelProperty(value = "任务id")
+    var taskId : String? = null
+
+    @ApiModelProperty(value = "任务命令")
+    var taskCmd : String? = null
+
+    @ApiModelProperty(value = "单位: 字节数/秒, 每秒钟下载的字节数")
+    var speed : Long? = null
+
+    @ApiModelProperty(value = "下载任务的总字节数")
+    var totalBytes : Long? = null
+
+    @ApiModelProperty(value = "已经下载了的字节数")
+    var downloadedBytes : Long? = null
+}

+ 134 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/TaskEntity.kt

@@ -0,0 +1,134 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import com.persagy.service.models.SBaseEntity
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import java.util.*
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+import kotlin.collections.ArrayList
+
+/**
+ * 任务实体
+ *
+ * @author jxing
+ */
+@ApiModel(description = "任务实体类")
+@Table(name = "scheduler_str.task")
+open class TaskEntity: SBaseEntity() {
+
+    /** 表自增id*/
+    @ApiModelProperty(value = "自增id")
+    @Column(name = "id", insertable = true, updatable = false)
+    @Id
+    var id: String? = null
+
+    /** task name */
+    @ApiModelProperty(value = "任务名")
+    @Column(name = "task_name")
+    var name: String? = null
+
+    /** cmd to be executed. */
+    @ApiModelProperty(value = "任务中要被执行的命令")
+    @Column(name = "task_cmd")
+    var cmd: String? = null
+
+    /** task parameter */
+    @ApiModelProperty(value = "任务参数")
+    @Column(name = "task_param")
+    var param: String? =null
+
+    /** task_status 0 Waiting, 1 Sending, 2 Sent, 3 FileDownloadException, 4 CommandExecuteException, 5 Finished*/
+    @ApiModelProperty(value = "任务状态 0 Waiting, 1 Sending, 2 Sent, 3 FileDownloadException, 4 CommandExecuteException, 5 Finished", example = "1000")
+    @Column(name = "task_status", insertable = false)
+//    @JsonIgnore
+    var status: Int? = null
+
+    /** task 执行结果 */
+    @ApiModelProperty(value = "任务执行结果")
+    @Column(name = "task_result_json", insertable = false)
+    var resultJson: String? =null
+
+
+    /** task 分发下去的时间 */
+    @ApiModelProperty(value = "任务分发时间点")
+    @Column(name = "task_sent_time", insertable = false)
+    var sentTime: Long? =null
+
+
+    /** 上一个获得该任务的客户端 */
+    @ApiModelProperty(value = "上一个获得该任务的客户端")
+    @Column(name = "task_last_client", insertable = false)
+    var lastClient: String? =null
+
+
+    /** 任务预期执行时间(单位是s) */
+    @ApiModelProperty(value = "任务预期执行时间(单位是s)")
+    @Column(name = "task_expected_finish_time")
+    var expectedFinishTime: Long? =null
+
+//    /** 任务添加时间 */
+//    @ApiModelProperty(value = "任务添加时间", example = "2019-06-18 17:58:00")
+//    @Column(name = "task_add_time", insertable = false, updatable = false)
+//    @JsonProperty(value = "addTime")
+//    var addTime: Date? =null
+
+    /** 任务中的下载子任务 */
+    var downloadTaskList: ArrayList<DownloadEntity> = ArrayList<DownloadEntity>()
+
+    /** projectId */
+    @ApiModelProperty(value = "任务中要被执行的命令")
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** modelId */
+    @ApiModelProperty(value = "任务参数")
+    @Column(name = "model_id")
+    var modelId: String? =null
+
+    /** task name */
+    @ApiModelProperty(value = "任务名")
+    @Column(name = "task_downloaded_time")
+    var downloadFinishTime: Date? = null
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+ 55 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/models/TaskResultEntity.kt

@@ -0,0 +1,55 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.models
+
+import com.persagy.service.models.SBaseEntity
+import io.swagger.annotations.ApiModel
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ *
+ *
+ * @author jxing
+ */
+@ApiModel(description = "任务结果详细信息实体类")
+@Table(name = "scheduler_str.task_result")
+class TaskResultEntity : SBaseEntity() {
+
+    /** 所属任务id*/
+    @ApiModelProperty(value = "所属任务id")
+    @Column(name = "task_id", insertable = true, updatable = false)
+    @Id
+    var taskId: String? = null
+
+    /** task 执行结果 */
+    @ApiModelProperty(value = "任务执行结果")
+    @Column(name = "content")
+    var content: String? =null
+}

+ 164 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/ChannelHandlerContextWrapper.kt

@@ -0,0 +1,164 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.pojo
+
+import cn.sagacloud.server.DispatchTask
+import com.alibaba.fastjson.JSON
+import com.alibaba.fastjson.JSONObject
+import com.persagy.proto.MessageProtoStr
+import com.persagy.proto.MessageUtil
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.utils.CommonUtil
+import io.netty.channel.ChannelHandlerContext
+import org.apache.log4j.Logger
+import java.util.*
+
+class ChannelHandlerContextWrapper(val ctx: ChannelHandlerContext) { // 通信handler
+    var lastRejectTime: Long = 0
+        private set        // unix时间片, 精确到秒
+    private val sendingTimeOut: Long = 15            // 发送给客户端任务, 如果超过该时间未响应, 则超时, 并将发送的任务状态置为初始状态
+    private val lastRefuseTimeOut: Long = 90       // 如果客户端拒绝任务, 则等待lastRefuseTimeOut秒, 才会再分配任务给该客户端
+    var clientInfo: String? = null             // mac地址
+    // 任务发送中状态map,     key --> taskid, value --> 发送任务时间点,    如果超过15s, 即为超时.
+    public val taskSendingStatusMap = HashMap<String, Long>()
+    companion object {
+        private val log = Logger.getLogger(ChannelHandlerContextWrapper::class.java)
+    }
+    /**
+     * 获取一个在发送任务时超时的任务id
+     * @return 任务id
+     */
+    val oneSendingTimeOutTaskId: String?
+        get() {
+            if (taskSendingStatusMap.size == 0)
+                return null
+            val currentTime = CommonUtil.time
+            for (id in taskSendingStatusMap.keys) {
+                val sentTime = taskSendingStatusMap[id]
+                if (currentTime - sentTime!! > sendingTimeOut) {
+                    return id
+                }
+            }
+            return null
+        }
+
+    val isLastRefuseTimeOutPassed: Boolean
+        get() {
+            if (lastRejectTime == 0L)
+                return true
+            val currentTime = CommonUtil.time
+            return if (currentTime - lastRefuseTimeOut > lastRejectTime) true else false
+        }
+
+    init {
+        this.lastRejectTime = 0
+        clientInfo = null
+    }
+
+    fun sendTask(toBeSent: TaskEntity) {
+        if (ctx.channel().isActive) {
+            log.info("task : ${toBeSent.id}, dest : $clientInfo")
+            val content = buildContent(toBeSent)
+            val msg = MessageUtil.buildMessage(Command.SendTask.name, toBeSent.id!!, content)
+            ctx.writeAndFlush(msg)
+            toBeSent.status = 1
+            taskSendingStatusMap[toBeSent.id!!] = CommonUtil.time
+        }
+    }
+
+    private fun buildContent(toBeSent: TaskEntity): String? {
+        if(toBeSent.param == null || toBeSent.param!!.isEmpty()){
+            var param = JSONObject()
+            param["MBIName"] = toBeSent.projectId
+            param["ModelId"] = toBeSent.modelId
+            toBeSent.param = param.toString()
+        }else{
+            try {
+                var jsonInfo = JSONObject.parseObject(toBeSent.param)
+                if(jsonInfo == null)
+                    jsonInfo = JSONObject()
+                if(!jsonInfo.containsKey("ProjectId"))
+                    jsonInfo["ProjectId"] = toBeSent.projectId
+                if(!jsonInfo.containsKey("ModelId"))
+                    jsonInfo["ModelId"] = toBeSent.modelId
+                toBeSent.param = jsonInfo.toString()
+            }catch (e : Exception){
+                var param = JSONObject()
+                param["ProjectId"] = toBeSent.projectId
+                param["ModelId"] = toBeSent.modelId
+                param["Info"] = toBeSent.param
+                toBeSent.param = param.toString()
+            }
+        }
+        return JSON.toJSONString(toBeSent)
+    }
+
+
+    fun resetSendingTimeOutTask(id: String?) {
+        if (id != null) {
+            taskSendingStatusMap.remove(id)
+        }
+    }
+
+    /**
+     * 设置上次被拒绝任务时间
+     */
+    fun setLastRejectTime(taskId: String) {
+        this.lastRejectTime = CommonUtil.time
+        DispatchTask.changeStatusByCmd(taskId, Command.RefuseTask, clientInfo!!)
+    }
+
+    /**
+     * 接受任务
+     */
+    fun acceptTask(taskId: String) {
+        DispatchTask.isAllowCmd(taskId, Command.AcceptTask) ?: return
+        DispatchTask.changeStatusByCmd(taskId, Command.AcceptTask, clientInfo!!)
+        taskSendingStatusMap.remove(taskId)
+    }
+
+    /**
+     * 客户端成功完成任务
+     */
+    fun taskSuccess(message: MessageProtoStr.Message) {
+        DispatchTask.changeStatusByCmdWithReturnJson(message.taskId, Command.TaskSuccess, clientInfo!!, message.content)
+    }
+
+    /**
+     * 因为命令错误, 执行异常未完成任务
+     */
+    fun commandError(message: MessageProtoStr.Message) {
+        DispatchTask.changeStatusByCmdWithReturnJson(message.taskId, Command.CommandError, clientInfo!!, message.content)
+    }
+
+    /**
+     * 客户端因为下载模型失败导致任务失败
+     */
+    fun downloadError(message: MessageProtoStr.Message) {
+        DispatchTask.changeStatusByCmdWithReturnJson(message.taskId, Command.DownloadError, clientInfo!!, message.content)
+    }
+}

+ 32 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/ClientMessage.kt

@@ -0,0 +1,32 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.pojo
+
+
+import com.persagy.proto.MessageProtoStr
+
+class ClientMessage(var ctxWrapper: ChannelHandlerContextWrapper?, var message: MessageProtoStr.Message?)

+ 59 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/Command.kt

@@ -0,0 +1,59 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.pojo
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/11
+ */
+
+import java.util.*
+
+enum class Command {
+    SendTask,
+    RefuseTask,
+    AcceptTask,
+    DownloadError,
+    CommandError,
+    TaskSuccess,
+    HeartBeat,
+    ClientInfo;
+
+
+    companion object {
+        private var cmdList: ArrayList<Command>? = null
+
+        init {
+            cmdList = ArrayList()
+            cmdList!!.addAll(Arrays.asList(*Command.values()))
+        }
+
+        // 是否是和任务状态转换相关的命令
+        fun isStatusRelated(cmd: Command): Boolean {
+            return ClientInfo != cmd
+        }
+    }
+}

+ 6 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/Config.kt

@@ -0,0 +1,6 @@
+package com.persagy.server.scheduler.pojo
+
+class Config {
+
+    var port: Int = 0
+}

+ 68 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/pojo/TaskStatus.kt

@@ -0,0 +1,68 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.pojo
+
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/11
+ */
+
+import java.util.*
+
+enum class TaskStatus {
+    // 顺序不可打乱, 添加要在后面添加
+    Waiting,
+    Sending, Sent, FileDownloadException, CommandExecuteException, Finished;
+
+
+    companion object {
+        private var statusList: ArrayList<TaskStatus>? = null
+
+        init {
+            statusList = ArrayList()
+            statusList!!.addAll(Arrays.asList(*TaskStatus.values()))
+        }
+
+        fun getTaskStatusById(index: Int?): TaskStatus? {
+            if(index == null)
+                return null
+            return if (index > -1 && index < statusList!!.size) {
+                statusList!![index]
+            } else null
+        }
+
+        fun getIdByTaskStatus(status: TaskStatus?): Int {
+            if (status == null)
+                return -1
+            for (i in statusList!!.indices) {
+                if (statusList!![i] == status)
+                    return i
+            }
+            return -1
+        }
+    }
+}

+ 279 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/server/DispatchTask.kt

@@ -0,0 +1,279 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.server
+
+
+import com.alibaba.fastjson.JSON
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.models.TaskResultEntity
+import com.persagy.server.scheduler.pojo.ChannelHandlerContextWrapper
+import com.persagy.server.scheduler.pojo.Command
+import com.persagy.server.scheduler.pojo.TaskStatus
+import com.persagy.server.scheduler.service.TasksService
+import com.persagy.server.scheduler.utils.CommonUtil
+import org.apache.log4j.Logger
+import java.util.*
+import kotlin.random.Random
+
+class DispatchTask @Throws(Exception::class)
+constructor(internal var clientList: ArrayList<ChannelHandlerContextWrapper>?) : Runnable {
+    private var clientIndex = 0
+    /**
+     * 获取一个在执行任务时超时的任务id
+     * @return
+     */
+    private val oneExecuteTimeOutTaskId: String?
+        get() {
+            if (tasks == null || tasks!!.size == 0)
+                return null
+            val currentTime = CommonUtil.time
+            for (id in tasks!!.keys) {
+                val task = tasks!![id]
+                val expectTime = task!!.expectedFinishTime!!
+                val sendTime = task.sentTime
+                if (sendTime == null || sendTime <= 0)
+                    continue
+                if (currentTime - sendTime > expectTime && task.status != 0) {
+                    return id
+                }
+            }
+            return null
+        }
+
+    private val oneAvailableClient: ChannelHandlerContextWrapper?
+        get() {
+            var clientCount: Int
+            if (clientList == null || clientList!!.size == 0)
+                return null
+            else {
+                clientCount = clientList!!.size
+                if (clientCount == 0)
+                    return null
+                clientIndex %= clientCount
+            }
+            var wrapper: ChannelHandlerContextWrapper?
+            do {
+                try {
+                    wrapper = clientList!![clientIndex]
+                } catch (ex: Exception) {
+                    log.error(ex.message)
+                    wrapper = null
+                    clientCount = clientList!!.size
+                }
+
+                if (wrapper == null || !wrapper.isLastRefuseTimeOutPassed) {
+                    wrapper = null
+                }
+                if (wrapper == null || wrapper.clientInfo == null || wrapper.clientInfo!!.length == 0)
+                    wrapper = null
+                if (clientCount == 0)
+                    return null
+                clientIndex = (clientIndex + 1) % clientCount
+            } while (wrapper == null && clientIndex != 0)
+//            if (wrapper != null)
+//                log.info("当前选中index :$clientIndex, Client Info : ${wrapper.clientInfo}")
+            return wrapper
+        }
+    val random = Random(99L)
+    private//检测到在waiting状态的任务, 返回
+    val oneAvailableTask: TaskEntity?
+        get() {
+            if(tasks!!.isEmpty())
+                return null
+            var times = random.nextInt(0, tasks!!.size)
+            for (taskId in tasks!!.keys) {
+                if(times != 0) {
+                    --times
+                    continue
+                }
+                val task = tasks!![taskId] ?: continue
+                if (task.status == 0 && task.downloadTaskList.size > 0) {
+                    return task
+                }
+            }
+            return null
+        }
+
+    init {
+        tasks = service.getAllTaskMapByStatus(listOf(0, 1, 2))
+    }
+
+    override fun run() {
+        // 考虑加锁
+        var cnt = Long.MIN_VALUE
+        while (true) {
+            try {
+                try {
+                    Thread.sleep(500)
+                } catch (e: InterruptedException) {
+                    e.printStackTrace()
+                }
+                // 获取到一个在waiting状态的任务
+                val toBeSent = oneAvailableTask
+                if (toBeSent != null) {
+                    // 获取到一个潜在可以接受任务的客户端
+                    val client = oneAvailableClient
+                    client?.sendTask(toBeSent)
+                }
+                // 检测sending, sent状态的任务, 是否有超时需要重新下载的任务
+                checkSendingTimeOut()
+                checkExecuteTimeOut()
+                if (++cnt % 60 == 0L) {
+                     syncTask()
+                }
+            } catch (ex: Exception) {
+                ex.printStackTrace()
+                log.error(ex.message)
+                println("出错")
+            }
+        }
+
+    }
+
+
+
+    private fun checkExecuteTimeOut() {
+        val id = oneExecuteTimeOutTaskId
+        if (id != null) {
+            // 是否加锁
+            tasks!![id]!!.status = 0
+            println("任务" + id + "执行超时, 已重置")
+        }
+    }
+
+    private fun checkSendingTimeOut() {
+        for (client in clientList!!) {
+            val id = client.oneSendingTimeOutTaskId
+            if (id != null) {
+                // 是否加锁
+                if(tasks!!.containsKey(id))
+                    tasks!![id]!!.status = 0
+                client.resetSendingTimeOutTask(id)
+                println("任务" + id + "发送超时, 已重置")
+            }
+        }
+    }
+
+    companion object {
+        private val log = Logger.getLogger(DispatchTask::class.java)
+        private val service = TasksService()
+        var tasks: Map<String, TaskEntity>? = null
+
+        /**
+         * 是否当前状态下可以执行该命令
+         * @param taskId task id
+         * @param cmd command
+         * @return 写一个状态, 如果不可执行该命令, 返回null
+         */
+        fun isAllowCmd(taskId: String, cmd: Command): TaskStatus? {
+            val task = tasks!![taskId] ?: return null
+            val status = TaskStatus.getTaskStatusById(task.status) ?: return null
+            val allowCmd = SchedulerHandler.statusTransitionMap[status] ?: return null
+            return allowCmd[cmd]
+        }
+
+        // 加锁
+        fun changeStatusByCmd(taskId: String, cmd: Command, clientInfo: String) {
+            val nextStatus = isAllowCmd(taskId, cmd) ?: return
+            val task = tasks!![taskId] ?: return
+            val newTask = TaskEntity()
+            newTask.id = task.id
+            newTask.sentTime = CommonUtil.time
+            newTask.lastClient = clientInfo
+            newTask.status = TaskStatus.getIdByTaskStatus(nextStatus)
+            updateTask(newTask)
+        }
+
+        fun changeStatusByCmdWithReturnJson(taskId: String, cmd: Command, clientInfo: String, returnJson: String) {
+            val nextStatus = isAllowCmd(taskId, cmd) ?: return
+            val task = tasks!![taskId] ?: return
+//            task.lastClient = clientInfo
+//            task.resultJson = returnJson
+//            task.status = TaskStatus.getIdByTaskStatus(nextStatus)
+            val newTask = TaskEntity()
+            newTask.id = task.id
+            newTask.lastClient = clientInfo
+            processResult(newTask, returnJson)
+//            newTask.resultJson = returnJson
+            newTask.status = TaskStatus.getIdByTaskStatus(nextStatus)
+            updateTask(newTask)
+        }
+
+        /**
+         * 转存结果到task_result表中
+         */
+        fun processResult(newTask: TaskEntity, returnJson: String) {
+            val json = JSON.parseObject(returnJson)
+            if(json == null || json.isEmpty() || !(json.containsKey("Content") || json.containsKey("content"))){
+                newTask.resultJson = returnJson
+                return
+            }
+            json.remove("Content")
+            json.remove("content")
+            newTask.resultJson = json.toString()
+            val taskResult = TaskResultEntity()
+            taskResult.taskId = newTask.id
+            taskResult.content = returnJson
+            createTaskResult(taskResult)
+        }
+
+        private fun updateTask(task: TaskEntity): Boolean {
+            try {
+                return service.updateSingleTask(task)
+            } catch (e: Exception) {
+                e.printStackTrace()
+                log.error("任务:" + task.id + "update失败")
+                return false
+            }
+        }
+
+        /**
+         * 插入TaskResult对象到表中
+         */
+        private fun createTaskResult(taskResult: TaskResultEntity): Boolean {
+            try {
+                return service.createTaskResult(taskResult)
+            } catch (e: Exception) {
+                e.printStackTrace()
+                log.error("任务Result:" + taskResult.taskId + " create失败")
+                return false
+            }
+        }
+
+        fun syncTask() {
+            try {
+                val tmpTasks = service.getAllTaskMapByStatus(Arrays.asList(0, 1, 2))
+                tasks = tmpTasks
+                log.info("同步数据库任务完成")
+            } catch (e: Exception) {
+                e.printStackTrace()
+                log.error("同步数据库失败")
+            }
+
+        }
+    }
+}

+ 84 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/server/MessageHandler.kt

@@ -0,0 +1,84 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.server
+
+import com.persagy.proto.MessageProtoStr
+import com.persagy.proto.MessageUtil
+import com.persagy.server.scheduler.pojo.ChannelHandlerContextWrapper
+import com.persagy.server.scheduler.pojo.ClientMessage
+import com.persagy.server.scheduler.pojo.Command
+import java.util.concurrent.ConcurrentLinkedQueue
+
+class MessageHandler : Runnable {
+
+    override fun run() {
+        while (true) {
+            val clientMessage = messageQueue.poll()
+            if (clientMessage == null) {
+                try {
+                    Thread.sleep(500)
+                } catch (e: InterruptedException) {
+                    e.printStackTrace()
+                }
+
+                continue
+            }
+            handle(clientMessage.message, clientMessage.ctxWrapper)
+        }
+    }
+
+    companion object {
+        var messageQueue = ConcurrentLinkedQueue<ClientMessage>()
+
+        fun handle(message: MessageProtoStr.Message?, clientWrapper: ChannelHandlerContextWrapper?) {
+            val cmd: Command
+            try {
+                cmd = Command.valueOf(message!!.cmd)
+            } catch (ex: Exception) {
+                return
+            }
+
+            when (cmd) {
+                Command.AcceptTask -> clientWrapper!!.acceptTask(message.taskId)
+                Command.RefuseTask -> clientWrapper!!.setLastRejectTime(message.taskId)
+                Command.ClientInfo -> clientWrapper!!.clientInfo = message.content
+                Command.TaskSuccess -> clientWrapper!!.taskSuccess(message)
+                Command.CommandError -> clientWrapper!!.commandError(message)
+                Command.DownloadError -> clientWrapper!!.downloadError(message)
+            }
+        }
+
+        fun offer(clientMessage: ClientMessage) {
+            MessageUtil.printMessage(clientMessage.message!!)
+            messageQueue.offer(clientMessage)
+        }
+    }
+}
+
+
+
+

+ 155 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/server/SchedulerHandler.kt

@@ -0,0 +1,155 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.server
+
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/20
+ */
+
+import com.persagy.proto.MessageProtoStr
+import com.persagy.proto.MessageUtil
+import com.persagy.server.scheduler.pojo.ChannelHandlerContextWrapper
+import com.persagy.server.scheduler.pojo.ClientMessage
+import com.persagy.server.scheduler.pojo.Command
+import com.persagy.server.scheduler.pojo.TaskStatus
+import io.netty.channel.ChannelHandlerContext
+import io.netty.channel.ChannelInboundHandlerAdapter
+import java.util.*
+import java.util.concurrent.ConcurrentHashMap
+
+class SchedulerHandler(internal var clientList: ArrayList<ChannelHandlerContextWrapper>) : ChannelInboundHandlerAdapter() {
+    private var ctxw: ChannelHandlerContextWrapper? = null
+
+    /**
+     * 刚添加上handler的时候    1
+     * @param ctx
+     */
+    override fun handlerAdded(ctx: ChannelHandlerContext?) {
+        //SocketAddress addr = ctx.channel().remoteAddress();
+        println("client incoming")
+    }
+
+    /**
+     * 客户端活动状态         2
+     * @param ctx
+     */
+    override fun channelActive(ctx: ChannelHandlerContext) {
+        ctxw = ChannelHandlerContextWrapper(ctx)
+        this.clientList.add(ctxw!!)
+        ctx.channel().writeAndFlush(MessageUtil.buildMessage(Command.ClientInfo.name, "", ""))
+    }
+
+    /**
+     * 客户端服务器互发消息      3
+     * @param ctx
+     * @param msg
+     * @throws Exception
+     */
+    @Throws(Exception::class)
+    override fun channelRead(ctx: ChannelHandlerContext, msg: Any) {
+        try {
+            // Do something with msg
+            val message = msg as MessageProtoStr.Message
+            MessageHandler.offer(ClientMessage(ctxw, message))
+            ctx.channel().writeAndFlush(MessageUtil.buildMessage(Command.HeartBeat.name, "", ""))
+        } catch (e : Exception){
+            println("Read Exception : ${e.message}")
+        }finally {
+            // 如果ctx write 或 writeAndFlush过的话, 就不用释放msg
+            //ReferenceCountUtil.release(msg);
+        }
+    }
+
+    /**
+     * 客户端异常原因  4
+     * @param ctx
+     * @param cause
+     */
+    override fun exceptionCaught(ctx: ChannelHandlerContext, cause: Throwable) {
+        println("client exceptionCaught : " + cause.message)
+    }
+
+    /**
+     * 客户端非活动状态  5
+     * @param ctx
+     */
+    override fun channelInactive(ctx: ChannelHandlerContext) {
+        println("client channelInactive")
+    }
+
+    /**
+     * 客户端断开连接 6
+     * @param ctx
+     */
+    override fun handlerRemoved(ctx: ChannelHandlerContext?) {
+        this.clientList.remove(ctxw)
+        try {
+            for (i in ctxw!!.taskSendingStatusMap){
+                if(DispatchTask.tasks!!.containsKey(i.key))
+                    DispatchTask.tasks!![i.key]!!.status = 0;
+            }
+        }catch (e : Exception){}
+    }
+
+    companion object {
+        // Map<当前状态, Map<可接受的命令, 接受完命令后的状态>>
+        var statusTransitionMap: MutableMap<TaskStatus, Map<Command, TaskStatus>> = ConcurrentHashMap()
+
+        init {
+            val waitingMap = HashMap<Command, TaskStatus>()
+            val sendingMap = HashMap<Command, TaskStatus>()
+            val sentMap = HashMap<Command, TaskStatus>()
+            val fileDownloadExceptionMap = HashMap<Command, TaskStatus>()
+            val commandExceptionMap = HashMap<Command, TaskStatus>()
+            statusTransitionMap[TaskStatus.Waiting] = waitingMap//CommonUtil.createSet(Command.TaskSuccess));
+            statusTransitionMap[TaskStatus.Sending] = sendingMap//CommonUtil.createSet(Command.AcceptTask, Command.RefuseTask, Command.TaskSuccess));
+            statusTransitionMap[TaskStatus.Sent] = sentMap//CommonUtil.createSet(Command.CommandError, Command.DownloadError, Command.TaskSuccess));
+            statusTransitionMap[TaskStatus.FileDownloadException] = fileDownloadExceptionMap//CommonUtil.createSet(Command.TaskSuccess));
+            statusTransitionMap[TaskStatus.CommandExecuteException] = commandExceptionMap//CommonUtil.createSet(Command.TaskSuccess));
+            statusTransitionMap[TaskStatus.Finished] = HashMap()
+
+            waitingMap[Command.TaskSuccess] = TaskStatus.Finished
+            waitingMap[Command.DownloadError] = TaskStatus.FileDownloadException
+            waitingMap[Command.CommandError] = TaskStatus.CommandExecuteException
+            waitingMap[Command.AcceptTask] = TaskStatus.Sent
+
+            sendingMap[Command.AcceptTask] = TaskStatus.Sent
+            sendingMap[Command.RefuseTask] = TaskStatus.Waiting
+            sendingMap[Command.TaskSuccess] = TaskStatus.Finished
+            sendingMap[Command.DownloadError] = TaskStatus.FileDownloadException
+            sendingMap[Command.CommandError] = TaskStatus.CommandExecuteException
+
+            sentMap[Command.TaskSuccess] = TaskStatus.Finished
+            sentMap[Command.DownloadError] = TaskStatus.FileDownloadException
+            sentMap[Command.CommandError] = TaskStatus.CommandExecuteException
+
+            fileDownloadExceptionMap[Command.TaskSuccess] = TaskStatus.Finished
+            commandExceptionMap[Command.TaskSuccess] = TaskStatus.Finished
+        }
+    }
+}

+ 130 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/server/Server.kt

@@ -0,0 +1,130 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.server
+
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/20
+ */
+
+import com.persagy.proto.MessageProtoStr
+import com.persagy.server.scheduler.pojo.ChannelHandlerContextWrapper
+import com.persagy.server.scheduler.pojo.Config
+import io.netty.bootstrap.ServerBootstrap
+import io.netty.channel.Channel
+import io.netty.channel.ChannelInitializer
+import io.netty.channel.ChannelOption
+import io.netty.channel.nio.NioEventLoopGroup
+import io.netty.channel.socket.SocketChannel
+import io.netty.channel.socket.nio.NioServerSocketChannel
+import io.netty.handler.codec.protobuf.ProtobufDecoder
+import io.netty.handler.codec.protobuf.ProtobufEncoder
+import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder
+import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender
+import org.apache.log4j.Logger
+import org.yaml.snakeyaml.Yaml
+import java.util.*
+import java.util.concurrent.Executors
+
+
+class Server @Throws(Exception::class)
+constructor() {
+    internal var bootstrap = ServerBootstrap()
+    private val acceptGroup = NioEventLoopGroup()
+    private val workerGroup = NioEventLoopGroup()
+    private var channel: Channel? = null
+    internal var config: Config
+    internal var dispatchTask: DispatchTask
+    internal var messageHandler: MessageHandler
+    internal var clientList = ArrayList<ChannelHandlerContextWrapper>()
+
+    init {
+        // 初始化serverSocket
+        bootstrap.group(acceptGroup, workerGroup)
+                .channel(NioServerSocketChannel::class.java)
+                .option(ChannelOption.SO_BROADCAST, true)
+                .childHandler(object : ChannelInitializer<SocketChannel>() {
+                    @Throws(Exception::class)
+                    override fun initChannel(ch: SocketChannel) {
+                        val pipeline = ch.pipeline()
+                        pipeline.addLast(ProtobufVarint32FrameDecoder())
+                        // 设置解码
+                        pipeline.addLast("decoder", ProtobufDecoder(MessageProtoStr.Message.getDefaultInstance()))
+                        pipeline.addLast(ProtobufVarint32LengthFieldPrepender())
+                        // 设置编码
+                        pipeline.addLast("encoder", ProtobufEncoder())
+                        pipeline.addLast(SchedulerHandler(clientList))
+
+                    }
+                })
+                .option(ChannelOption.SO_BACKLOG, 128)
+                .childOption(ChannelOption.SO_KEEPALIVE, true)
+        // 初始化配置
+        log.info("reading config file...开始读取配置文件...")
+        config = Yaml().loadAs(Server::class.java.getClassLoader().getResourceAsStream("config.yml"), Config::class.java)
+        log.info("config file read success...读取配置文件完毕...")
+        // 初始化Task(从sql到内存)
+        log.info("syncing tasks...开始同步数据库中任务...")
+        dispatchTask = DispatchTask(clientList)
+        messageHandler = MessageHandler()
+    }
+
+    @Throws(InterruptedException::class)
+    fun start() {
+        try {
+            // 启动服务
+            log.info("listening...开始启动监听...")
+            channel = bootstrap.bind(config.port).sync().channel()
+            log.info("dispatching...开始分发任务...")
+            pool.submit(dispatchTask)        // 开启任务分发线程
+            pool.submit(messageHandler)      // 开启消息处理线程
+            //pool.submit()
+            log.info("server started...服务器启动完毕")
+            channel!!.closeFuture().sync()
+        } finally {
+            workerGroup.shutdownGracefully()
+            acceptGroup.shutdownGracefully()
+        }
+    }
+
+    companion object {
+        var pool = Executors.newFixedThreadPool(8)
+        private val log = Logger.getLogger(Server::class.java)
+
+//        @Throws(Exception::class)
+//        @JvmStatic
+//        fun main(args: Array<String>) {
+//            //        int port = 6666;
+//            //        if (args.length > 0) {
+//            //            port = Integer.parseInt(args[0]);
+//            //        }
+//            Server().start()
+//
+//        }
+    }
+
+}

+ 38 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/service/ActiveMQConsumer.kt

@@ -0,0 +1,38 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.service
+
+import org.springframework.stereotype.Component
+
+
+@Component
+class ActiveMQConsumer {
+//    @JmsListener(destination = "mytest.topic")
+//    fun receiveQueue(text: String) {
+//        println("Consumer收到的报文为:$text")
+//    }
+}

+ 46 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/service/BaseDataService.kt

@@ -0,0 +1,46 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.service
+
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.scheduler.models.DownloadEntity
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.models.TaskResultEntity
+import com.persagy.service.SObjectService
+
+
+object BaseDataService {
+
+    // 任务数据服务
+    var taskService = SObjectService(SMybatisDao(TaskEntity::class.java))
+
+    // 下载任务数据服务
+    var downloadService = SObjectService(SMybatisDao(DownloadEntity::class.java))
+
+    // 任务结果数据服务
+    var taskResultService = SObjectService(SMybatisDao(TaskResultEntity::class.java))
+}

+ 54 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/service/JMSProducer.kt

@@ -0,0 +1,54 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.service
+
+import org.apache.activemq.command.ActiveMQTopic
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.jms.core.JmsMessagingTemplate
+import org.springframework.stereotype.Service
+
+
+@Service
+class JMSProducer {
+
+    @Autowired // 也可以注入JmsTemplate,JmsMessagingTemplate对JmsTemplate进行了封装
+    lateinit var jmsTemplate: JmsMessagingTemplate
+
+    val destinationTest = ActiveMQTopic("mytest.topic")
+    val destination = ActiveMQTopic("scheduler.speed")
+
+    fun sendMessage(message: String?) {
+        jmsTemplate.convertAndSend(destination, message?:"")
+    }
+
+//    fun sendMessage(message: JSON) {
+//        jmsTemplate.convertAndSend(destination, message.toJSONString())
+//    }
+
+
+
+}

+ 167 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/service/TasksService.kt

@@ -0,0 +1,167 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.service
+
+import com.persagy.database.SFilter
+import com.persagy.database.enums.SDirection
+import com.persagy.server.scheduler.models.DownloadEntity
+import com.persagy.server.scheduler.models.TaskEntity
+import com.persagy.server.scheduler.models.TaskResultEntity
+import com.persagy.server.scheduler.server.DispatchTask
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.requests.SCreateRequest
+import com.persagy.service.models.requests.SUpdateRequest
+import org.springframework.stereotype.Component
+
+@Component
+class TasksService{
+
+    /**
+     * 根据任务的状态获取任务(包含下载子任务)
+     */
+    fun getAllTaskMapByStatus(statusList : List<Int>) : Map<String, TaskEntity> {
+        // 获取所有任务 by status
+        val tasks = BaseDataService.taskService.select(SFilter.inList("status", statusList)).order("createTime", SDirection.ASC) .exec()
+        // 获取id List
+//        val idList = tasks.stream().map{ task -> task.id }.distinct().collect(Collectors.toList())
+        val idList = ArrayList<String>()
+        tasks.stream().forEach { task -> if(!idList.contains(task.id!!))idList.add(task.id!!) }
+        // 变成map
+        val taskMap = HashMap<String, TaskEntity>()
+        tasks.stream().forEach { task -> taskMap.put(task.id!!, task) }
+        if(taskMap.size == 0)
+            return taskMap
+        // 获取它们的下载子任务
+        val downloads = BaseDataService.downloadService.select(SFilter.inList("taskId", idList)).exec()
+        // 填充下载子任务到任务里
+        downloads.stream().forEach { download ->
+            if(taskMap[download.taskId] != null)
+                taskMap[download.taskId]!!.downloadTaskList.add(download)
+        }
+        val iterator = taskMap.iterator()
+        while(iterator.hasNext()){
+            val next = iterator.next()
+            if(next.value.downloadTaskList.isEmpty()){
+                iterator.remove()
+            }
+        }
+        return taskMap
+    }
+
+    /**
+     * 更新一个task任务
+     */
+    fun updateTask(taskEntity: TaskEntity) : Boolean{
+        val update = SUpdateRequest<TaskEntity>()
+        val list = ArrayList<TaskEntity>()
+        list.add(taskEntity)
+        update.content = list
+        try {
+            // 先更新taskEntity
+            BaseDataService.taskService.updateList(update)
+            // 删除 所有 download 表里 taskId = taskEntity.id的行
+            BaseDataService.downloadService.delete(SFilter.eq("taskId", taskEntity.id!!))
+            // 添加 taskEntity的downloadTaskList到download表.
+            val request = SCreateRequest<DownloadEntity>()
+            request.content = taskEntity.downloadTaskList
+            BaseDataService.downloadService.createList(request)
+            return true
+        }catch (e: Exception) {
+            e.printStackTrace()
+            return false
+        }
+    }
+
+
+    /**
+     * 更新一个task任务
+     */
+    fun updateSingleTask(taskEntity: TaskEntity) : Boolean{
+        val update = SUpdateRequest<TaskEntity>()
+        val list = ArrayList<TaskEntity>()
+
+        try {
+            list.add(taskEntity)
+            update.content = list
+            BaseDataService.taskService.updateList(update)
+            DispatchTask.syncTask()
+            return true
+        }catch (e: Exception) {
+            e.printStackTrace()
+            return false
+        }
+    }
+
+    /**
+     * 添加一个TaskResult对象到数据库
+     */
+    fun createTaskResult(taskResult: TaskResultEntity): Boolean {
+        val create = SCreateRequest<TaskResultEntity>()
+        create.content = arrayListOf(taskResult)
+        return BaseDataService.taskResultService.createList(create).result == SResponseType.success
+    }
+
+    /**
+     * 根据下载文件的MD5值来匹配taskMap中的任务
+     */
+    fun getTaskByMD5(md5List : ArrayList<String>, taskMap : Map<String, TaskEntity>) : TaskEntity?{
+        if(md5List.isEmpty())
+            return null
+        val md5Map = HashSet<String>(md5List)
+        for (t in taskMap){
+            for(down in t.value.downloadTaskList){
+                if (md5Map.contains(down.md5!!.toLowerCase()) || md5Map.contains(down.md5!!.toUpperCase())) {
+                    return t.value
+                }
+            }
+        }
+        return null
+    }
+//    /**
+//     * 更新一个task任务
+//     */
+//    fun updateTaskByAttr(taskEntity: TaskEntity, updateKeys : ArrayList<TaskEntityAttr>) : Boolean{
+//        val update = SUpdateRequest<TaskEntity>()
+//        val list = ArrayList<TaskEntity>()
+//
+//        try {
+//            val singleTask = setUpdateKeys(taskEntity, updateKeys)
+//            list.add(singleTask)
+//            update.content = list
+//            taskService.updateList(update)
+//
+//            return true
+//        }catch (e: Exception) {
+//            e.printStackTrace()
+//            return false
+//        }
+//    }
+
+//    private fun setUpdateKeys(taskEntity: TaskEntity, updateKeys: java.util.ArrayList<TaskEntityAttr>) : TaskEntity{
+//
+//    }
+}

+ 72 - 0
scheduler/src/main/kotlin/com/persagy/server/scheduler/utils/CommonUtil.kt

@@ -0,0 +1,72 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.scheduler.utils
+
+/*
+ * Author: Jxing
+ * Create Time: 2019/3/12
+ */
+
+import com.fasterxml.uuid.Generators
+import com.google.common.base.Strings
+import com.persagy.server.scheduler.pojo.Command
+import java.nio.CharBuffer
+import java.nio.charset.Charset
+import java.util.*
+
+object CommonUtil {
+    val time: Long
+        get() = System.currentTimeMillis() / 1000
+
+    fun createSet(vararg elements: Command): Set<Command> {
+        val set = HashSet<Command>()
+        for (e in elements) {
+            set.add(e)
+        }
+        return set
+    }
+
+    fun getBytes(chars: CharArray): ByteArray {
+        val cs = Charset.forName("UTF-8")
+        val cb = CharBuffer.allocate(chars.size)
+        cb.put(chars)
+        cb.flip()
+        val bb = cs.encode(cb)
+        return bb.array()
+    }
+
+
+    /**
+     * 生成基于时间的UUID
+     */
+    fun generateUUID(prefix: String?, isRemoveDash: Boolean): String {
+        //        UUID uuid = UUID.randomUUID();
+        val uuid = Generators.timeBasedGenerator().generate()
+        return arrayOf(Strings.nullToEmpty(prefix), if (isRemoveDash) uuid.toString().replace("-", "") else uuid.toString()).joinToString("")
+    }
+
+}

+ 17 - 0
scheduler/src/main/proto/MessageProto.proto

@@ -0,0 +1,17 @@
+syntax = "proto3";
+
+ package cn.sagacloud.proto;
+ option optimize_for = SPEED;
+ //option java_package = "cn.sagacloud.server.proto";
+ option java_outer_classname = "MessageProto";
+ //message Message{
+ //    int32 cmd = 1;
+ //    string className = 2;
+ //    string content = 3;
+ //}
+
+ message Message{
+     string cmd = 1;
+     string taskId = 2;
+     string content = 3;
+ }

+ 76 - 0
scheduler/src/main/resources-dev/application.yml

@@ -0,0 +1,76 @@
+## spring-cloud相关配置
+#eureka:
+#  client:                                   #客户端注册进eureka服务列表内
+#    service-url:
+#      defaultZone:                          http://eureka-service:8761/eureka
+##启用监控
+#management:
+#  endpoints:
+#    web:
+#      exposure:
+#        include:
+#          - "*"  # 开放所有端点health,info,metrics,通过actuator/+端点名就可以获取相应的信息。默认打开health和info
+#  endpoint:
+#    health:
+#      #未开启actuator/health时,我们获取到的信息是{"status":"UP"},status的值还有可能是 DOWN。开启后打印详细信息
+#      show-details:                       always
+###############################################################################################################
+
+server:
+  port: 8081
+#  ssl:
+#    key-store:                          classpath:keystore.key
+#    key-store-password:                 20090421
+#    key-store-type:                     PKCS12
+#    key-alias:                          cn.sagacloud
+
+spring:
+  application:
+    name:                               scheduler
+  mvc:
+    favicon:
+      enabled:                          true
+
+  jmx:
+    default-domain:                     scheduler
+
+  datasource:
+    name:                               scheduler
+    type:                               com.alibaba.druid.pool.DruidDataSource
+#    driver-class-name:                  com.mysql.cj.jdbc.Driver
+    driver-class-name:                  org.postgresql.Driver
+#    url:                                jdbc:mysql://172.16.0.235:3306/datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai  #&zeroDateTimeBehavior=convertToNull
+    url:                                jdbc:postgresql://172.16.44.234:5432/datacenter
+      #?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai  #&zeroDateTimeBehavior=convertToNull
+#    username:                           root
+#    password:                           123456
+    username:                           postgres
+    password:                           123456
+
+  jackson:
+    date-format:                        yyyy-MM-dd HH:mm:ss
+    time-zone:                          Asia/Shanghai
+    default-property-inclusion:         non_null
+    # 首字母大写
+    property-naming-strategy:           com.fasterxml.jackson.databind.PropertyNamingStrategy.PascalCaseStrategy
+    # 以下划线分隔全小写的单词
+    #property-naming-strategy:           com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy
+    mapper:
+      # 属性按字母顺序输出
+      sort_properties_alphabetically:   true
+
+  activemq:
+    #broker-url:                         tcp://172.17.134.225:61616
+    broker-url:                         failover:(tcp://172.16.42.210:61616)
+    in-memory:                          true
+    pool.enabled:                       false
+    user:                               admin
+    password:                           admin
+
+  jms:
+    pub-sub-domain: true
+
+topic:                                 datacenter.broadcast
+
+mybatis:
+  typeAliasesPackage:                   cn.sagacloud.server.datacenter.entities

+ 83 - 0
scheduler/src/main/resources-prod/application.yml

@@ -0,0 +1,83 @@
+################################################################################################################
+## spring-cloud相关配置
+#eureka:
+#  client:                                   #客户端注册进eureka服务列表内
+#    service-url:
+#      defaultZone:                          http://eureka-service:8761/eureka
+##启用监控
+#management:
+#  endpoints:
+#    web:
+#      exposure:
+#        include:
+#          - "*"  # 开放所有端点health,info,metrics,通过actuator/+端点名就可以获取相应的信息。默认打开health和info
+#  endpoint:
+#    health:
+#      #未开启actuator/health时,我们获取到的信息是{"status":"UP"},status的值还有可能是 DOWN。开启后打印详细信息
+#      show-details:                       always
+###############################################################################################################
+
+server:
+  port: 8080
+#  ssl:
+#    key-store:                          classpath:keystore.key
+#    key-store-password:                 20090421
+#    key-store-type:                     PKCS12
+#    key-alias:                          cn.sagacloud
+
+spring:
+  application:
+    name:                               scheduler
+  mvc:
+    favicon:
+      enabled:                          true
+
+  jmx:
+    default-domain:                     scheduler
+
+  datasource:
+    name:                               scheduler
+    type:                               com.alibaba.druid.pool.DruidDataSource
+#    driver-class-name:                  com.mysql.cj.jdbc.Driver
+    driver-class-name:                  org.postgresql.Driver
+    url:                                jdbc:postgresql://data-center:5432/datacenter
+    username:                           postgres
+    password:                           123qwe!@#
+
+  jackson:
+    date-format:                        yyyy-MM-dd HH:mm:ss
+    time-zone:                          Asia/Shanghai
+    default-property-inclusion:         non_null
+    # 首字母大写
+    property-naming-strategy:           com.fasterxml.jackson.databind.PropertyNamingStrategy.PascalCaseStrategy
+    # 以下划线分隔全小写的单词
+    #property-naming-strategy:           com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy
+    mapper:
+      # 属性按字母顺序输出
+      sort_properties_alphabetically:   true
+
+#  activemq:
+#    #broker-url:                         tcp://172.17.134.225:61616
+#    broker-url:                         tcp://activemq:61616
+#    in-memory:                          true
+#    pool.enabled:                       false
+#    user:                               admin
+#    password:                           admin
+  activemq:
+    broker-url: failover:(tcp://activemq:61616)
+    in-memory: true
+    pool:
+      enabled: false
+    user: admin
+    password: admin
+    non-blocking-redelivery: true
+
+  jms:
+    pub-sub-domain: true
+
+topic:                                 datacenter.broadcast
+
+mybatis:
+  typeAliasesPackage:                   cn.sagacloud.server.datacenter.entities
+#  configuration:
+#    log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl

+ 1 - 0
scheduler/src/main/resources/config.yml

@@ -0,0 +1 @@
+port: 6666

+ 35 - 0
scheduler/src/main/resources/log4j.properties

@@ -0,0 +1,35 @@
+### ����###
+log4j.rootLogger = debug,stdout,D,E,I
+
+### �����Ϣ������̧ ###
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target = System.out
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
+
+### ���DEBUG �������ϵ���־��=E://logs/error.log ###
+log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.D.File = D:/logs/log.log
+log4j.appender.D.Encoding=UTF-8
+log4j.appender.D.Append = true 
+log4j.appender.D.Threshold = DEBUG
+log4j.appender.D.layout = org.apache.log4j.PatternLayout
+log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
+
+### ���ERROR �������ϵ���־��=E://logs/error.log ###
+log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.E.File =D:/logs/error.log
+log4j.appender.E.Encoding=UTF-8
+log4j.appender.E.Append = true
+log4j.appender.E.Threshold = ERROR
+log4j.appender.E.layout = org.apache.log4j.PatternLayout
+log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n
+
+### ���INFO �������ϵ���־��=E://logs/error.log ###
+log4j.appender.I = org.apache.log4j.DailyRollingFileAppender
+log4j.appender.I.File =D:/logs/info.log
+log4j.appender.I.Encoding=UTF-8
+log4j.appender.I.Append = true
+log4j.appender.I.Threshold = INFO
+log4j.appender.I.layout = org.apache.log4j.PatternLayout
+log4j.appender.I.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss}  [ %t:%r ] - [ %p ]  %m%n

+ 43 - 0
scheduler/src/main/resources/logback-spring.xml

@@ -0,0 +1,43 @@
+<!--
+  ~ *********************************************************************************************************************
+  ~
+  ~                     :*$@@%$*:                         ;:                ;;    ;;
+  ~                   :@@%!  :!@@%:                       %!             ;%%@@%$ =@@@@@@@%;     @%@@@%%%%@@@@@
+  ~                  :@%;       :$=                       %%$$$%$$         ;$$  ;$@=   !@$
+  ~                  =@!                                  %!              @ $=;%   !@@@%:      !$$$$$$$$$$$$$$=
+  ~                  =@*                                  %!              @ $= % %@=   =%@!      %=
+  ~             *$%%! @@=        ;=$%%%$*:                %!              @ $= % =%%%%%%@$      *%:         =%
+  ~           %@@!:    !@@@%=$@@@@%!  :*@@$:              %!              @ $= % $*     ;@      @*          :%*
+  ~         ;@@!          ;!!!;:         ;@%:      =======@%========*     @ $$ % $%*****$@     :@$=*********=@$
+  ~         $@*   ;@@@%=!:                *@*
+  ~         =@$    ;;;!=%@@@@=!           =@!
+  ~          %@$:      =@%: :*@@@*       %@=                    Copyright (c) 2016-2019.  北京上格云技术有限公司
+  ~           ;%@@$=$@@%*       *@@@$=%@@%;
+  ~              ::;::             ::;::                                              All rights reserved.
+  ~
+  ~ *********************************************************************************************************************
+  -->
+
+<configuration scan="true" debug="false">
+    <contextName>datacenter</contextName>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        </encoder>
+    </appender>
+
+    <!-- 定义cn.sagacloud包的日志级别 -->
+    <logger name="com.persagy" level="DEBUG" additivity="false">
+        <appender-ref ref="STDOUT"/>
+    </logger>
+
+    <!-- 定义com.sybotan包的日志级别 -->
+    <logger name="com.persagy" level="DEBUG" additivity="false">
+        <appender-ref ref="STDOUT"/>
+    </logger>
+
+    <!-- 定义日志级别 -->
+    <root level="ERROR">
+        <appender-ref ref="STDOUT" />
+    </root>
+</configuration>

+ 80 - 0
scheduler/src/main/resources/mapper/TaskMap.xml

@@ -0,0 +1,80 @@
+<?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="cn.sagacloud.mybatis.mapper.TaskMapper">
+    <insert id="addTask" parameterType="cn.sagacloud.mybatis.model.TaskModel" useGeneratedKeys="true" keyProperty="id">
+        INSERT INTO scheduler.task(task_name, task_cmd, task_param, task_status, task_result_json, task_sent_time, task_last_client, task_expected_finish_time)
+        VALUE(#{task_name},#{task_cmd},#{task_param},#{task_status},#{task_result_json}, #{task_sent_time}, #{task_last_client},#{task_expected_finish_time});
+    </insert>
+
+    <insert id="addDownload" parameterType="cn.sagacloud.mybatis.model.DownloadTaskModel" useGeneratedKeys="true" keyProperty="list.id">
+        INSERT INTO scheduler.download(task_id,task_url,task_md5) VALUES
+        <foreach collection="list" item="item" separator=",">
+            (#{taskId},#{item.task_url},#{item.task_md5})
+        </foreach>
+    </insert>
+
+    <select id="getTasksByIds" resultMap="taskModelList">
+        select task.id, task_name, task_cmd, task_param, task_status, task_result_json, task_sent_time, task_last_client,
+        task_expected_finish_time, download.id downloadId, task_id, task_url, task_md5
+        from scheduler.task inner join scheduler.download on scheduler.task.id = scheduler.download.task_id where scheduler.task.id in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>;
+    </select>
+
+    <select id="getTasksByStatus" resultMap="taskModelList">
+        select task.id, task_name, task_cmd, task_param, task_status, task_result_json, task_sent_time, task_last_client,
+        task_expected_finish_time, download.id downloadId, task_id, task_url, task_md5
+        from scheduler.task inner join scheduler.download on scheduler.task.id = scheduler.download.task_id where scheduler.task.task_status in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>;
+    </select>
+
+    <select id="getTasksMapByIds" resultMap="taskModelList">
+        select task.id, task_name, task_cmd, task_param, task_status, task_result_json, task_sent_time, task_last_client,
+        task_expected_finish_time, download.id downloadId, task_id, task_url, task_md5
+        from scheduler.task inner join scheduler.download on scheduler.task.id = scheduler.download.task_id where scheduler.task.id in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>;
+    </select>
+
+    <select id="getTasksMapByStatus" resultMap="taskModelList">
+        select task.id, task_name, task_cmd, task_param, task_status, task_result_json, task_sent_time, task_last_client,
+        task_expected_finish_time, download.id downloadId, task_id, task_url, task_md5
+        from scheduler.task inner join scheduler.download on scheduler.task.id = scheduler.download.task_id where scheduler.task.task_status in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>;
+    </select>
+
+    <resultMap id="taskModelList" type="cn.sagacloud.mybatis.model.TaskModel">
+        <id property="id" column="id"/>
+        <result property="task_name" column="task_name"/>
+        <result property="task_cmd" column="task_cmd"/>
+        <result property="task_param" column="task_param"/>
+        <result property="task_status" column="task_status"/>
+        <result property="task_result_json" column="task_result_json"/>
+        <result property="task_last_client" column="task_last_client"/>
+        <result property="task_expected_finish_time" column="task_expected_finish_time"/>
+        <collection property="downloadTaskModelList" ofType="cn.sagacloud.mybatis.model.DownloadTaskModel">
+            <id property="id" column="downloadId"/>
+            <result property="task_id" column="task_id"/>
+            <result property="task_url" column="task_url"/>
+            <result property="task_md5" column="task_md5"/>
+        </collection>
+    </resultMap>
+
+    <update id="updateSingleTask" parameterType="cn.sagacloud.mybatis.model.TaskModel">
+        UPDATE scheduler.task
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="task_status!=null">task_status=#{task_status},</if>
+            <if test="task_result_json!=null">task_result_json=#{task_result_json},</if>
+            <if test="task_last_client!=null">task_last_client=#{task_last_client},</if>
+            <if test="task_sent_time!=null">task_sent_time=#{task_sent_time},</if>
+        </trim>
+        WHERE id = #{id};
+    </update>
+
+</mapper>

+ 54 - 0
scheduler/src/main/resources/mybatis-config.xml

@@ -0,0 +1,54 @@
+<!--<?xml version="1.0" encoding="UTF-8" ?>-->
+
+
+<!--<!DOCTYPE configuration-->
+<!--        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"-->
+<!--        "http://mybatis.org/dtd/mybatis-3-config.dtd">-->
+
+<!--<configuration>-->
+<!--    &lt;!&ndash;<settings>&ndash;&gt;-->
+<!--        &lt;!&ndash;输出日志&ndash;&gt;-->
+<!--        &lt;!&ndash;<setting name="logImpl" value="STDOUT_LOGGING" />&ndash;&gt;-->
+<!--    &lt;!&ndash;</settings>&ndash;&gt;-->
+
+<!--    <typeHandlers>-->
+<!--        &lt;!&ndash;<typeHandler jdbcType="INTEGER" javaType="java.lang.Integer" handler="cn.sagacloud.utils.typeHandler.NullToZero"/>&ndash;&gt;-->
+<!--    </typeHandlers>-->
+
+<!--    <environments default="development">-->
+<!--        <environment id="development">-->
+<!--            <transactionManager type="JDBC">-->
+<!--            </transactionManager>-->
+
+<!--&lt;!&ndash;            mysql config&ndash;&gt;-->
+<!--&lt;!&ndash;            <dataSource type="POOLED">&ndash;&gt;-->
+<!--&lt;!&ndash;                &lt;!&ndash;<property name="driver" value="com.mysql.jdbc.Driver"/>&ndash;&gt;&ndash;&gt;-->
+<!--&lt;!&ndash;                <property name="driver" value="com.mysql.cj.jdbc.Driver"/>&ndash;&gt;-->
+<!--&lt;!&ndash;                &lt;!&ndash;<property name="url" value="jdbc:mysql://101.201.234.108:3306/venders?serverTimezone=UTC"/>&ndash;&gt;&ndash;&gt;-->
+<!--&lt;!&ndash;                &lt;!&ndash;<property name="url" value="jdbc:mysql://172.16.3.12:3306/venders?serverTimezone=UTC"/>&ndash;&gt;&ndash;&gt;-->
+<!--&lt;!&ndash;                <property name="url" value="jdbc:mysql://127.0.0.1:3306/scheduler?serverTimezone=UTC"/>&ndash;&gt;-->
+<!--&lt;!&ndash;                &lt;!&ndash;<property name="username" value="pbsage"/>&ndash;&gt;&ndash;&gt;-->
+<!--&lt;!&ndash;                <property name="username" value="root"/>&ndash;&gt;-->
+<!--&lt;!&ndash;                <property name="password" value="123456"/>&ndash;&gt;-->
+<!--&lt;!&ndash;            </dataSource>&ndash;&gt;-->
+
+<!--&lt;!&ndash;            postgresql config&ndash;&gt;-->
+<!--            <dataSource type="POOLED">-->
+<!--                <property name="driver" value="org.postgresql.Driver"/>-->
+<!--                &lt;!&ndash;<property name="url" value="jdbc:mysql://101.201.234.108:3306/venders?serverTimezone=UTC"/>&ndash;&gt;-->
+<!--                &lt;!&ndash;                <property name="url" value="jdbc:mysql://192.168.20.235:3306/venders?serverTimezone=UTC"/>&ndash;&gt;-->
+<!--                <property name="url" value="jdbc:postgresql://192.168.20.235:5432/datacenter?serverTimezone=UTC"/>-->
+<!--                &lt;!&ndash;<property name="url" value="jdbc:mysql://localhost:3306/venders?serverTimezone=UTC"/>&ndash;&gt;-->
+<!--                &lt;!&ndash;<property name="username" value="pbsage"/>&ndash;&gt;-->
+<!--                <property name="username" value="postgres"/>-->
+<!--                <property name="password" value="123456"/>-->
+<!--            </dataSource>-->
+<!--        </environment>-->
+<!--    </environments>-->
+
+<!--    <mappers>-->
+<!--        <mapper resource="mapper/TaskMap.xml"/>-->
+<!--    </mappers>-->
+
+
+<!--</configuration>-->

+ 82 - 0
scheduler/src/main/resources/table_mysql.sql

@@ -0,0 +1,82 @@
+服务端
+库名: scheduler
+create table if not exists `task`(
+	`id` varchar(50),
+    `task_name` varchar(255),
+    `task_cmd` text,
+    `task_param` text,
+    `task_status` int DEFAULT 0 comment '0 Waiting, 1 Sending, 2 Sent, 3 FileDownloadException, 4 CommandExecuteException, 5 Finished',
+    `task_result_json` text,
+	`task_sent_time` long comment '客户端成功接收任务的时间',
+    `task_last_client` varchar(255),
+    `task_expected_finish_time` int comment '预期完成时间, 单位是s',
+	`task_add_time` timestamp DEFAULT CURRENT_TIMESTAMP,
+	`project_id` varchar(80),
+	`model_id` varchar(80),
+    PRIMARY KEY (`id`),
+	index statusIndex(task_status)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+create table if not exists `download`(
+    `task_id` varchar(50),
+    `task_url` varchar(255),
+    `task_md5` varchar(40),
+    PRIMARY KEY (`task_id`)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+
+客户端
+库名: worker
+create table if not exists `task`(
+	`tid` int NOT NULL AUTO_INCREMENT,
+	`id` int NOT NULL,
+    `task_name` varchar(255),
+    `task_cmd` text,
+    `task_param` text,
+    `task_status` int comment '0 Waiting, 1 Success, -1 downloadError, -2 execute error',
+    `task_result_json` text,
+	`task_expected_finish_time` int comment '预期完成时间, 单位是s',
+	`task_add_time` timestamp DEFAULT CURRENT_TIMESTAMP,
+    PRIMARY KEY (`tid`),
+	index taskIdIndex(id),
+	index statusIndex(task_status)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+create table if not exists `download`(
+	`tid` int NOT NULL AUTO_INCREMENT,
+	`id` int NOT NULL comment '服务器端下载任务id',
+    `task_id` int,
+    `task_url` varchar(255),
+    `local_dir` text,
+    `downloaded_bytes` long,
+    `file_bytes` long,
+    `finish_time` long,
+    `task_md5` varchar(40),
+    PRIMARY KEY (`tid`),
+	index taskIdIndex(task_id)
+)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+
+
+
+
+
+
+
+create table scheduler.task_result
+(
+	task_id varchar(50) not null primary key,
+	content text,
+	create_time timestamp with time zone default CURRENT_TIMESTAMP,
+	last_update timestamp with time zone default CURRENT_TIMESTAMP
+);
+
+comment on table scheduler.task_result is '任务返回结果';
+
+comment on column scheduler.task_result.task_id is '任务id';
+
+alter table scheduler.task_result owner to postgres;
+
+create index task_result_task_id_index
+	on scheduler.task_result (task_id);
+

+ 112 - 0
scheduler/src/main/resources/table_postgresql.sql

@@ -0,0 +1,112 @@
+服务端
+库名: scheduler
+create table scheduler.task
+(
+	id varchar(50) not null
+		constraint task_pkey
+			primary key,
+	task_name varchar(255) not null,
+	task_cmd text,
+	task_param text,
+	task_status smallint default 0 not null,
+	task_result_json text,
+	task_sent_time bigint,
+	task_last_client varchar(255),
+	task_expected_finish_time bigint,
+	create_time timestamp(0) with time zone default CURRENT_TIMESTAMP,
+	last_update timestamp(0) with time zone default CURRENT_TIMESTAMP,
+	project_id varchar(80),
+	model_id varchar(80)
+);
+
+comment on table scheduler.task is '任务表';
+
+comment on column scheduler.task.task_status is '0 Waiting, 1 Sending, 2 Sent, 3 FileDownloadException, 4 CommandExecuteException, 5 Finished';
+
+comment on column scheduler.task.task_sent_time is '客户端成功接收任务的时间';
+
+comment on column scheduler.task.task_expected_finish_time is '预期完成时间, 单位是s';
+
+alter table scheduler.task owner to postgres;
+
+create index task_status_index
+	on scheduler.task (task_status);
+
+--
+-- CREATE TABLE scheduler.task
+-- (
+--     id serial NOT NULL,
+--     task_name character varying(255) COLLATE pg_catalog."default" NOT NULL,
+--     task_cmd text COLLATE pg_catalog."default" default NULL,
+--     task_param text COLLATE pg_catalog."default" default NULL,
+--     task_status smallint not null default 0,
+-- 	task_result_json text COLLATE pg_catalog."default" default NULL,
+-- 	task_sent_time bigint default null,
+--     task_last_client character varying(255) COLLATE pg_catalog."default" default null,
+-- 	task_expected_finish_time bigint NOT NULL,
+-- -- 	task_add_time timestamp(0) with time zone DEFAULT CURRENT_TIMESTAMP,
+--     create_time timestamp(0) with time zone DEFAULT CURRENT_TIMESTAMP,
+-- 	last_update timestamp(0) with time zone DEFAULT CURRENT_TIMESTAMP,
+--     CONSTRAINT task_pkey PRIMARY KEY (id)
+-- )
+-- WITH (
+--     OIDS = FALSE
+-- )
+-- TABLESPACE pg_default;
+--
+-- ALTER TABLE scheduler.task
+--     OWNER to postgres;
+-- COMMENT ON TABLE scheduler.task
+--     IS '任务表';
+--
+-- COMMENT ON COLUMN scheduler.task.task_status
+--     IS '0 Waiting, 1 Sending, 2 Sent, 3 FileDownloadException, 4 CommandExecuteException, 5 Finished';
+--
+-- COMMENT ON COLUMN scheduler.task.task_sent_time
+--     IS '客户端成功接收任务的时间, 单位是s';
+--
+-- COMMENT ON COLUMN scheduler.task.task_expected_finish_time
+--     IS '预期完成时间, 单位是s';
+--
+-- CREATE INDEX task_status_index ON scheduler.task(task_status);
+--
+--
+
+CREATE TABLE scheduler.download
+(
+    task_id varchar(50) not null,
+    task_url character varying(255) COLLATE pg_catalog."default" default NULL,
+    task_md5 character varying(40) COLLATE pg_catalog."default" default NULL,
+	create_time timestamp(0) with time zone DEFAULT CURRENT_TIMESTAMP,
+	last_update timestamp(0) with time zone DEFAULT CURRENT_TIMESTAMP,
+    CONSTRAINT download_pkey PRIMARY KEY (task_id)
+)
+WITH (
+    OIDS = FALSE
+)
+TABLESPACE pg_default;
+
+ALTER TABLE scheduler.download
+    OWNER to postgres;
+
+
+
+
+create table scheduler.task_result
+(
+	task_id varchar(50) not null
+		constraint task_result_pk
+			primary key,
+	content text,
+	create_time timestamp with time zone default CURRENT_TIMESTAMP,
+	last_update timestamp with time zone default CURRENT_TIMESTAMP
+);
+
+comment on table scheduler.task_result is '任务返回结果';
+
+comment on column scheduler.task_result.task_id is '任务id';
+
+alter table scheduler.task_result owner to postgres;
+
+
+

+ 1 - 0
settings.gradle

@@ -31,4 +31,5 @@ include 'datasyn'           // 数据同步
 include 'equip-componet'    // 专用接口
 include 'message-center'    // 消息中心
 include 'revit-algorithm'   // revit模型
+include 'scheduler'         // 调度器