Browse Source

去除碳足迹相关,只保留能管与设备管理

thing_master
xiachao 1 year ago
parent
commit
da89843860
  1. 13
      application/pom.xml
  2. BIN
      help/doc/物管理项目结构树.jpg
  3. BIN
      help/doc/物计算.png
  4. BIN
      help/doc/过滤引擎.png
  5. 64
      help/file/TskvEvent.puml
  6. 59
      help/file/tskvAgg-amSumV1.puml
  7. 7168
      help/sql/1ddl_1.0.0.sql
  8. 64829
      help/sql/2dml_1.0.0.sql
  9. 60
      help/sql/3dml_1.0.1.sql
  10. 283
      help/sql/4dml_1.0.2.sql
  11. 312
      help/sql/5dml_1.0.2.sql
  12. 37557
      help/sql/visualv1.sql
  13. 25
      modules/carbon-public/pom.xml
  14. 217
      modules/carbon-public/src/main/java/com/thing/carbon/pub/api/CertificateApi.java
  15. 79
      modules/carbon-public/src/main/java/com/thing/carbon/pub/api/MaterialFactorApi.java
  16. 150
      modules/carbon-public/src/main/java/com/thing/carbon/pub/api/ProductionModelApi.java
  17. 120
      modules/carbon-public/src/main/java/com/thing/carbon/pub/api/ProductionResultApi.java
  18. 12
      modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/ApiConstant.java
  19. 11
      modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/CarbonFactorConstant.java
  20. 15
      modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/PointsConstant.java
  21. 12
      modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/ReportSourceTypeConstant.java
  22. 88
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubCertificateController.java
  23. 105
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubEngEffController.java
  24. 65
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubFootprintLibController.java
  25. 107
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubMaterialFactorController.java
  26. 88
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubPointsLogsController.java
  27. 68
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubPointsRuleController.java
  28. 171
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionModelController.java
  29. 124
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionReportConfigController.java
  30. 134
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionReportController.java
  31. 174
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionResultController.java
  32. 130
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubSupplierController.java
  33. 104
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/IotCarbonEnterpriseAuthController.java
  34. 87
      modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/PubCockpitController.java
  35. 48
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubCertificateDTO.java
  36. 49
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubEngEffDTO.java
  37. 58
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubFootprintInfo.java
  38. 54
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordBaseInfo.java
  39. 71
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordBaseInfoOnYear.java
  40. 23
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordDispose.java
  41. 22
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordMPT.java
  42. 27
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPM.java
  43. 19
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPT.java
  44. 19
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPU.java
  45. 199
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordR.java
  46. 100
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordSimpleAgg.java
  47. 14
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorApiDTO.java
  48. 50
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorDTO.java
  49. 29
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorUseDTO.java
  50. 32
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubPointsLogsDTO.java
  51. 35
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubPointsRuleDTO.java
  52. 19
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionIdName.java
  53. 56
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionModelDTO.java
  54. 36
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionReportConfigDTO.java
  55. 75
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionReportDTO.java
  56. 129
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionResultDTO.java
  57. 74
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionResultReport.java
  58. 52
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierDTO.java
  59. 32
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierDetail.java
  60. 36
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierProduct.java
  61. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnergyInfo.java
  62. 38
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnterpriseInfo.java
  63. 37
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitProductionCarbon.java
  64. 28
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitStatisticsDto.java
  65. 56
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/IotCarbonEnterpriseAuthDTO.java
  66. 40
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/SupplierStatisticsDto.java
  67. 81
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/TranslateRequest.java
  68. 42
      modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/TranslateResponse.java
  69. 67
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubCertificateEntity.java
  70. 78
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubEngEffEntity.java
  71. 85
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubMaterialFactorEntity.java
  72. 40
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubMaterialFactorUseEntity.java
  73. 47
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubPointsLogsEntity.java
  74. 52
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubPointsRuleEntity.java
  75. 89
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionModelEntity.java
  76. 55
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionReportConfigEntity.java
  77. 82
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionReportEntity.java
  78. 173
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionResultEntity.java
  79. 57
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubSupplierEntity.java
  80. 95
      modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/IotCarbonEnterpriseAuthEntity.java
  81. 166
      modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubFilter.java
  82. 33
      modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubFilterConfig.java
  83. 102
      modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubRequestWrapper.java
  84. 65
      modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubResponseWrapper.java
  85. 41
      modules/carbon-public/src/main/java/com/thing/carbon/pub/listener/SupplierCreateListener.java
  86. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubCertificateMapper.java
  87. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubEngEffMapper.java
  88. 20
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubMaterialFactorMapper.java
  89. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubMaterialFactorUseMapper.java
  90. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubPointsLogsMapper.java
  91. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubPointsRuleMapper.java
  92. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionModelMapper.java
  93. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionReportConfigMapper.java
  94. 23
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionReportMapper.java
  95. 14
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionResultMapper.java
  96. 31
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubSupplierMapper.java
  97. 16
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/IotCarbonEnterpriseAuthMapper.java
  98. 19
      modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/PubCockpitMapper.java
  99. 28
      modules/carbon-public/src/main/java/com/thing/carbon/pub/service/CarbonPubCertificateService.java
  100. 17
      modules/carbon-public/src/main/java/com/thing/carbon/pub/service/CarbonPubEngEffService.java

13
application/pom.xml

@ -109,14 +109,6 @@
<groupId>com.thing.modules</groupId>
<artifactId>quartz</artifactId>
</dependency>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>carbon-track</artifactId>
</dependency>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>carbon-public</artifactId>
</dependency>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>equipment</artifactId>
@ -137,10 +129,7 @@
<groupId>com.thing.modules</groupId>
<artifactId>filter-rule</artifactId>
</dependency>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>cqc-service</artifactId>
</dependency>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>visual-design</artifactId>

BIN
help/doc/物管理项目结构树.jpg

Before

Width: 1123  |  Height: 3175  |  Size: 461 KiB

BIN
help/doc/物计算.png

Before

Width: 4812  |  Height: 2127  |  Size: 847 KiB

BIN
help/doc/过滤引擎.png

Before

Width: 3487  |  Height: 2212  |  Size: 776 KiB

64
help/file/TskvEvent.puml

@ -1,64 +0,0 @@
@startuml
'https://plantuml.com/sequence-diagram
participant Events as event
participant DataTransferListener as entrance
participant TsKvEventServiceImpl as eventSvc
participant TsKvService as tskvSvc
participant 其他服务或监听器 as os
== 事件统一入口 ==
event -> entrance: push事件
== 根据主题处理不同事件 ==
entrance -> eventSvc: push【latest】或【history】事件
note over eventSvc: 处理topic包含v1/tskv的事件
note over eventSvc: 【latest】或【history】事件处理
alt #LightBlue latest 事件
eventSvc -> tskvSvc: 【async】saveProtoLatest:将推送来的数据去重、新增最新数据
|||
else #Lavender history 事件
eventSvc -> tskvSvc: saveProtoTsKv:存储所有推送来的数据
eventSvc -> tskvSvc: 【async】saveProtoLatest:将推送来的数据去重、新增最新数据
|||
end
|||
eventSvc -> os: 执行物计算(push CalcLogSaveEvent)
eventSvc -> os: 执行过滤引擎(push FilterLogSaveEvent)
|||
eventSvc -> eventSvc: 读application.yml配置中的属性列表:keys
eventSvc -> eventSvc: 将keys中的每个基础属性添加am后缀,形成新的属性列表amKeys
|||
loop dataProtoList
alt #LightBlue 如果是基础属性,且>0
eventSvc -> eventSvc: 将dataProto添加到dataProtos
|||
else #Lavender 如果是am属性
eventSvc -> eventSvc: 将dataProto添加到amList
|||
else #Gray 其他
eventSvc -> eventSvc: 丢弃
end
end
|||
alt #LightBlue dataProtos非空
eventSvc -> tskvSvc: 【async】amSumProtos(dataProtos);
|||
else #Lavender amList非空
eventSvc -> tskvSvc: hhDdMmYySum(amList);
|||
eventSvc -> os: 峰平谷尖计算(push PeakEvent)
|||
end
|||
@enduml

59
help/file/tskvAgg-amSumV1.puml

@ -1,59 +0,0 @@
@startuml
'https://plantuml.com/activity-diagram-beta
start
note left: TsKvNativeSQL.amSumV1
repeat:forEach protoList
:dataProto;
:初始化参数:\n inter:时间间隔(min 换算成 ms)\n thingCode: 物编码 \n key: 属性编码 \n value: 属性值 \n ts: 数据时间 \n stTs: 基于当前时间计算获取的开始时间 \n enTs: 基于当前时间计算获取的结束时间;
if ((ts - inter) == stTs \n 当前时间可用于统计) then (yes)
: 查询stTs~enTs在每个inter之间的最小值 \n => rowList;
switch(rowList.size)
case (多条)
:计算连续数据的差值\n作为单个am数据值;
:收集am到amList;
case (1条)
:向ts之前查询第一条数据;
if (存在) then (yes)
:与当前数据value计算差值\n作为单个am数据值;
:收集am到amList;
else (false)
:设置am值为0并收集;
:log error;
endif
if (当前时间 > enTs)
:查询ts之后的第一条数据;
:与之前查询出的1条计算差值\n收集到amList;
endif
endswitch
: todo;
else (false)
:将stTs向左移动一个inter的时间\n然后查询新的开始时间~ts之间的数据\n => rowList;
switch(rowList.size)
case (多条)
:计算连续数据的差值\n作为单个am数据值;
:收集am到amList;
case (1条)
:向stTs之前查询第一条数据;
if (存在) then (yes)
:与当前数据value计算差值\n作为单个am数据值;
:收集am到amList;
else (false)
:设置am值为0并收集;
:log error;
endif
if (当前时间 > enTs)
:查询enTs之后的第一条数据;
:与之前查询出的1条计算差值\n收集到amList;
endif
endswitch
endif
repeat while(hasNext?)
if (amList非空) then (yes)
: 存储聚合好的amList数据;
: 将amList推送到数据消费事件中(v1/tskv/latest);
endif
stop
@enduml

7168
help/sql/1ddl_1.0.0.sql
File diff suppressed because it is too large
View File

64829
help/sql/2dml_1.0.0.sql
File diff suppressed because it is too large
View File

60
help/sql/3dml_1.0.1.sql

@ -1,60 +0,0 @@
ALTER TABLE sys_tenant_detail ADD COLUMN if not EXISTS title VARCHAR(255) ;
COMMENT ON COLUMN "public"."sys_tenant_detail"."title" IS '企业标题';
ALTER TABLE iot_thing_source ADD COLUMN if not EXISTS thing_attr_group VARCHAR(255) ;
COMMENT ON COLUMN "public"."iot_thing_source"."thing_attr_group" IS '标签组';
ALTER TABLE iot_thing_source ADD COLUMN if not EXISTS start_status VARCHAR(255) ;
COMMENT ON COLUMN "public"."iot_thing_source"."start_status" IS '属性启用状态';
ALTER TABLE iot_visual_component ADD COLUMN if not EXISTS config text;
COMMENT ON COLUMN "public"."iot_visual_component"."config" IS '部件配置';
INSERT INTO "public"."qrtz_cron_triggers" VALUES ('ThingScheduler', 'TASK_192082754584838144', 'DEFAULT', '0 0/10 * * * ?', 'Asia/Shanghai');
INSERT INTO "public"."qrtz_cron_triggers" VALUES ('ThingScheduler', 'TASK_192082542600519680', 'DEFAULT', '0 1/5 * * * ? *', 'Asia/Shanghai');
INSERT INTO "public"."qrtz_cron_triggers" VALUES ('ThingScheduler', 'TASK_192082651446902784', 'DEFAULT', '0 0/1 * * * ? *', 'Asia/Shanghai');
INSERT INTO "public"."qrtz_job_details" VALUES ('ThingScheduler', 'TASK_192082542600519680', 'DEFAULT', NULL, 'com.thing.quartz.timetask.utils.ScheduleJob', 'f', 'f', 'f', 'f', E'\\254\\355\\000\\005sr\\000\\025org.quartz.JobDataMap\\237\\260\\203\\350\\277\\251\\260\\313\\002\\000\\000xr\\000&org.quartz.utils.StringKeyDirtyFlagMap\\202\\010\\350\\303\\373\\305](\\002\\000\\001Z\\000\\023allowsTransientDataxr\\000\\035org.quartz.utils.DirtyFlagMap\\023\\346.\\255(v\\012\\316\\002\\000\\002Z\\000\\005dirtyL\\000\\003mapt\\000\\017Ljava/util/Map;xp\\001sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\014w\\010\\000\\000\\000\\020\\000\\000\\000\\001t\\000\\015JOB_PARAM_KEYsr\\0002com.thing.quartz.timetask.entity.ScheduleJobEntity\\000\\000\\000\\000\\000\\000\\000\\001\\002\\000\\005L\\000\\010beanNamet\\000\\022Ljava/lang/String;L\\000\\016cronExpressionq\\000~\\000\\011L\\000\\006paramsq\\000~\\000\\011L\\000\\006remarkq\\000~\\000\\011L\\000\\006statust\\000\\023Ljava/lang/Integer;xr\\000*com.thing.common.orm.entity.BaseDateEntity\\025Q\\000\\257\\341\\177a\\350\\002\\000\\005L\\000\\012createDatet\\000\\020Ljava/lang/Long;L\\000\\007creatorq\\000~\\000\\014L\\000\\002idq\\000~\\000\\014L\\000\\012updateDateq\\000~\\000\\014L\\000\\007updaterq\\000~\\000\\014xpsr\\000\\016java.lang.Long;\\213\\344\\220\\314\\217#\\337\\002\\000\\001J\\000\\005valuexr\\000\\020java.lang.Number\\206\\254\\225\\035\\013\\224\\340\\213\\002\\000\\000xp\\000\\000\\001\\221\\351\\377F\\375sq\\000~\\000\\016\\016\\317\\237a\\007\\264V\\001sq\\000~\\000\\016\\002\\252j\\016\\007B\\000\\000q\\000~\\000\\020q\\000~\\000\\021t\\000\\011AlarmTaskt\\000\\0170 1/5 * * * ? *t\\000\\000t\\000\\006\\345\\221\\212\\350\\255\\246sr\\000\\021java.lang.Integer\\022\\342\\240\\244\\367\\201\\2078\\002\\000\\001I\\000\\005valuexq\\000~\\000\\017\\000\\000\\000\\001x\\000');
INSERT INTO "public"."qrtz_job_details" VALUES ('ThingScheduler', 'TASK_192082651446902784', 'DEFAULT', NULL, 'com.thing.quartz.timetask.utils.ScheduleJob', 'f', 'f', 'f', 'f', E'\\254\\355\\000\\005sr\\000\\025org.quartz.JobDataMap\\237\\260\\203\\350\\277\\251\\260\\313\\002\\000\\000xr\\000&org.quartz.utils.StringKeyDirtyFlagMap\\202\\010\\350\\303\\373\\305](\\002\\000\\001Z\\000\\023allowsTransientDataxr\\000\\035org.quartz.utils.DirtyFlagMap\\023\\346.\\255(v\\012\\316\\002\\000\\002Z\\000\\005dirtyL\\000\\003mapt\\000\\017Ljava/util/Map;xp\\001sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\014w\\010\\000\\000\\000\\020\\000\\000\\000\\001t\\000\\015JOB_PARAM_KEYsr\\0002com.thing.quartz.timetask.entity.ScheduleJobEntity\\000\\000\\000\\000\\000\\000\\000\\001\\002\\000\\005L\\000\\010beanNamet\\000\\022Ljava/lang/String;L\\000\\016cronExpressionq\\000~\\000\\011L\\000\\006paramsq\\000~\\000\\011L\\000\\006remarkq\\000~\\000\\011L\\000\\006statust\\000\\023Ljava/lang/Integer;xr\\000*com.thing.common.orm.entity.BaseDateEntity\\025Q\\000\\257\\341\\177a\\350\\002\\000\\005L\\000\\012createDatet\\000\\020Ljava/lang/Long;L\\000\\007creatorq\\000~\\000\\014L\\000\\002idq\\000~\\000\\014L\\000\\012updateDateq\\000~\\000\\014L\\000\\007updaterq\\000~\\000\\014xpsr\\000\\016java.lang.Long;\\213\\344\\220\\314\\217#\\337\\002\\000\\001J\\000\\005valuexr\\000\\020java.lang.Number\\206\\254\\225\\035\\013\\224\\340\\213\\002\\000\\000xp\\000\\000\\001\\221\\351\\377\\254\\\\sq\\000~\\000\\016\\016\\317\\237a\\007\\264V\\001sq\\000~\\000\\016\\002\\252j''_\\002\\000\\000q\\000~\\000\\020q\\000~\\000\\021t\\000\\010CalcTaskt\\000\\0170 0/1 * * * ? *t\\000\\000t\\000\\011\\347\\211\\251\\350\\256\\241\\347\\256\\227sr\\000\\021java.lang.Integer\\022\\342\\240\\244\\367\\201\\2078\\002\\000\\001I\\000\\005valuexq\\000~\\000\\017\\000\\000\\000\\001x\\000');
INSERT INTO "public"."qrtz_job_details" VALUES ('ThingScheduler', 'TASK_192082754584838144', 'DEFAULT', NULL, 'com.thing.quartz.timetask.utils.ScheduleJob', 'f', 'f', 'f', 'f', E'\\254\\355\\000\\005sr\\000\\025org.quartz.JobDataMap\\237\\260\\203\\350\\277\\251\\260\\313\\002\\000\\000xr\\000&org.quartz.utils.StringKeyDirtyFlagMap\\202\\010\\350\\303\\373\\305](\\002\\000\\001Z\\000\\023allowsTransientDataxr\\000\\035org.quartz.utils.DirtyFlagMap\\023\\346.\\255(v\\012\\316\\002\\000\\002Z\\000\\005dirtyL\\000\\003mapt\\000\\017Ljava/util/Map;xp\\001sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\014w\\010\\000\\000\\000\\020\\000\\000\\000\\001t\\000\\015JOB_PARAM_KEYsr\\0002com.thing.quartz.timetask.entity.ScheduleJobEntity\\000\\000\\000\\000\\000\\000\\000\\001\\002\\000\\005L\\000\\010beanNamet\\000\\022Ljava/lang/String;L\\000\\016cronExpressionq\\000~\\000\\011L\\000\\006paramsq\\000~\\000\\011L\\000\\006remarkq\\000~\\000\\011L\\000\\006statust\\000\\023Ljava/lang/Integer;xr\\000*com.thing.common.orm.entity.BaseDateEntity\\025Q\\000\\257\\341\\177a\\350\\002\\000\\005L\\000\\012createDatet\\000\\020Ljava/lang/Long;L\\000\\007creatorq\\000~\\000\\014L\\000\\002idq\\000~\\000\\014L\\000\\012updateDateq\\000~\\000\\014L\\000\\007updaterq\\000~\\000\\014xpsr\\000\\016java.lang.Long;\\213\\344\\220\\314\\217#\\337\\002\\000\\001J\\000\\005valuexr\\000\\020java.lang.Number\\206\\254\\225\\035\\013\\224\\340\\213\\002\\000\\000xp\\000\\000\\001\\221\\352\\000\\014jsq\\000~\\000\\016\\016\\317\\237a\\007\\264V\\001sq\\000~\\000\\016\\002\\252j?b\\202\\000\\000q\\000~\\000\\020q\\000~\\000\\021t\\000\\017ThingStatusTaskt\\000\\0160 0/10 * * * ?t\\000\\000t\\000\\017\\350\\256\\276\\345\\244\\207\\345\\234\\250\\347\\246\\273\\347\\272\\277sr\\000\\021java.lang.Integer\\022\\342\\240\\244\\367\\201\\2078\\002\\000\\001I\\000\\005valuexq\\000~\\000\\017\\000\\000\\000\\001x\\000');
INSERT INTO "public"."qrtz_locks" VALUES ('ThingScheduler', 'STATE_ACCESS');
INSERT INTO "public"."qrtz_locks" VALUES ('ThingScheduler', 'TRIGGER_ACCESS');
INSERT INTO "public"."qrtz_scheduler_state" VALUES ('ThingScheduler', 'pro-tb31726133564891', 1726210701477, 15000);
INSERT INTO "public"."qrtz_triggers" VALUES ('ThingScheduler', 'TASK_192082754584838144', 'DEFAULT', 'TASK_192082754584838144', 'DEFAULT', NULL, 1726210800000, 1726210200000, 5, 'WAITING', 'CRON', 1726207757000, 0, NULL, 2, '');
INSERT INTO "public"."qrtz_triggers" VALUES ('ThingScheduler', 'TASK_192082542600519680', 'DEFAULT', 'TASK_192082542600519680', 'DEFAULT', NULL, 1726210860000, 1726210560000, 5, 'WAITING', 'CRON', 1726207706000, 0, NULL, 2, '');
INSERT INTO "public"."qrtz_triggers" VALUES ('ThingScheduler', 'TASK_192082651446902784', 'DEFAULT', 'TASK_192082651446902784', 'DEFAULT', NULL, 1726210740000, 1726210680000, 5, 'WAITING', 'CRON', 1726207732000, 0, NULL, 2, '');
DROP TABLE IF EXISTS "public"."iot_carbon_unit_dict";
CREATE TABLE "public"."iot_carbon_unit_dict" (
"id" int8 NOT NULL,
"p_name" varchar(255) COLLATE "pg_catalog"."default",
"p_code" varchar(255) COLLATE "pg_catalog"."default",
"c_name" varchar(255) COLLATE "pg_catalog"."default",
"c_code" varchar(255) COLLATE "pg_catalog"."default"
)
;
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (1, '质量单位', 'A', 'kg', 'kg');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (2, '质量单位', 'A', 't', 't');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (3, '质量单位', 'A', 'ton', 'ton');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (4, '质量单位', 'A', 'oz', 'oz');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (5, '容量单位', 'B', '', '');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (6, '容量单位', 'B', 'L', 'L');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (7, '容量单位', 'B', 'ft³', 'ft³');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (8, '面积单位', 'C', '', '');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (9, '面积单位', 'C', 'ha', 'ha');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (10, '面积单位', 'C', 'a', 'a');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (11, '面积单位', 'C', 'mile²', 'mile²');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (12, '面积单位', 'C', 'ft²', 'ft²');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (13, '长度单位', 'D', 'm', 'm');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (14, '长度单位', 'D', 'n mile', 'n mile');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (15, '长度单位', 'D', 'mile', 'mile');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (16, '长度单位', 'D', 'ft', 'ft');
INSERT INTO "public"."iot_carbon_unit_dict" VALUES (17, '长度单位', 'D', 'in', 'in');
ALTER TABLE "public"."iot_carbon_unit_dict" ADD CONSTRAINT "iot_carbon_uint_dict_pkey" PRIMARY KEY ("id");

283
help/sql/4dml_1.0.2.sql

@ -1,283 +0,0 @@
INSERT INTO "public"."iot_group_info" VALUES (196836405161361408, '设备组', 'thing', '001', '', 0, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1727341116035, 1067246875800000001, 1727341116035, 1);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741546094592, 'A29', '有功电度', 'kWh', 900, NULL, 'increase', NULL, NULL, NULL, 0, 1, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573630, 1067246875800000001, 1727338573630);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741546094593, 'A29_METER', '读表值', 'kWh', 900, NULL, 'increase', NULL, NULL, NULL, 0, 2, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573630, 1067246875800000001, 1727338573630);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741554483200, 'A29am', '刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 61, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741554483201, 'A29yy', '年用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 62, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741554483202, 'A29dd', '日用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 63, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741554483203, 'A29hh', '时用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 64, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677504, 'A29mm', '月用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 65, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677505, 'A29_normalam', '平刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 66, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573633, 1067246875800000001, 1727338573633);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677506, 'A29_normaldd', '平日用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 67, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677507, 'A29_normalhh', '平时用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 68, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677508, 'A29_normalmm', '平月用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 69, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677509, 'A29_peakam', '峰刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 70, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677510, 'A29_valleyam', '谷刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 71, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677511, 'A29_valleydd', '谷日数据', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 72, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677512, 'A29_valleyhh', '谷时用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 73, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677513, 'A29_valleymm', '谷月数据', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 74, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677514, 'A29_peakmm', '峰月用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 75, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677515, 'tce_A29hh', '时用电折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 76, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573634, 1067246875800000001, 1727338573634);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677516, 'tce_A29dd', '日用电折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 77, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677517, 'A29_rushdd', '尖日用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 78, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677518, 'A29_rushhh', '尖时用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 79, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677519, 'A29_rusham', '尖刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 80, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677520, 'A29_peakhh', '峰时用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 81, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677521, 'A29_peakdd', '峰日用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 82, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677522, 'A29_rushmm', '尖月用电', 'kWh', NULL, NULL, 'region', NULL, NULL, NULL, 0, 83, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677523, 'tce_A29mm', '月用电折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 84, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677524, 'CO2_A29am', '刻用电碳排', 'kgCO₂', 900, NULL, 'region', NULL, NULL, NULL, 0, 85, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677525, 'CO2_A29hh', '时用电碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 86, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573635, 1067246875800000001, 1727338573635);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677526, 'CO2_A29yy', '年用电碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 87, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573636, 1067246875800000001, 1727338573636);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677527, 'CO2_A29dd', '日用电碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 88, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573636, 1067246875800000001, 1727338573636);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677528, 'tce_A29am', '刻用电折标煤', 'kgce', 900, NULL, 'region', NULL, NULL, NULL, 0, 89, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573636, 1067246875800000001, 1727338573636);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677529, 'CO2_A29mm', '月用电碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 90, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573636, 1067246875800000001, 1727338573636);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741558677530, 'tce_A29yy', '年用电折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 91, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573636, 1067246875800000001, 1727338573636);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426240, 'A2', 'B相电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 270, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426241, 'A8', 'A相电流', 'A', 900, NULL, 'instant', NULL, NULL, NULL, 0, 271, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426242, 'A3', 'C相电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 272, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426243, 'A4', 'AB线电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 273, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426244, 'A5', 'BC线电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 274, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426245, 'A6', 'CA线电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 275, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426246, 'A9', 'B相电流', 'A', 900, NULL, 'instant', NULL, NULL, NULL, 0, 276, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426247, 'A10', 'C相电流', 'A', 900, NULL, 'instant', NULL, NULL, NULL, 0, 277, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573643, 1067246875800000001, 1727338573643);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426248, 'A1', 'A相电压', 'V', 900, NULL, 'instant', NULL, NULL, NULL, 0, 278, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426249, 'A16', '总负荷', 'kW', 900, NULL, 'instant', NULL, NULL, NULL, 0, 279, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426250, 'A14', 'B相有功功率', 'kW', 900, NULL, 'instant', NULL, NULL, NULL, 0, 280, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426251, 'A19', 'C相无功功率', 'kVar', 900, NULL, 'instant', NULL, NULL, NULL, 0, 281, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426252, 'A21', 'A相功率因数', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 282, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426253, 'A22', 'B相功率因数', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 283, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426254, 'A17', 'A相无功功率', 'kVar', 900, NULL, 'instant', NULL, NULL, NULL, 0, 284, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912923, 'P2', '累计质量', 't', 900, NULL, 'increase', NULL, NULL, NULL, 0, 251, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441818, 1067246875800000001, 1724654441818);
INSERT INTO "public"."iot_thing_dict" VALUES (159140976351289344, 'A29', '正向有功电量', 'kWh', 900, '', 'default', '', '', NULL, 0, 1, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1718353825458, 1067246875800000001, 1718353825458);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426255, 'A20', '总无功功率', 'kVar', 900, NULL, 'instant', NULL, NULL, NULL, 0, 285, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426256, 'A15', 'C相有功功率', 'kW', 900, NULL, 'instant', NULL, NULL, NULL, 0, 286, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426257, 'A13', 'A相有功功率', 'kW', 900, NULL, 'instant', NULL, NULL, NULL, 0, 287, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426258, 'A18', 'B相无功功率', 'kVar', 900, NULL, 'instant', NULL, NULL, NULL, 0, 288, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741596426259, 'A24', '总功率因数', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 289, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573644, 1067246875800000001, 1727338573644);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741600620544, 'A23', 'C相功率因数', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 290, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573645, 1067246875800000001, 1727338573645);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741600620545, 'A7', '电压不平衡度', '%', 900, NULL, 'instant', NULL, NULL, NULL, 0, 291, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573645, 1067246875800000001, 1727338573645);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261244198915, 'B1', '水瞬时流量', 't', 900, NULL, 'instant', NULL, NULL, NULL, 0, 66, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485423788032, 'N4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 251, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466240, 1067246875800000001, 1727339466240);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485423788033, 'N2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 252, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466240, 1067246875800000001, 1727339466240);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370944, 'N2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 120, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370945, 'N2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 121, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370946, 'N2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 122, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370947, 'N2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 123, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370948, 'N4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 124, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370949, 'N4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 125, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370950, 'N4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 126, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485436370951, 'N4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 127, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466243, 1067246875800000001, 1727339466243);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485453148160, 'N1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 304, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466247, 1067246875800000001, 1727339466247);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485453148161, 'N5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 305, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466247, 1067246875800000001, 1727339466247);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485453148162, 'N6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 306, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466247, 1067246875800000001, 1727339466247);
INSERT INTO "public"."iot_thing_dict" VALUES (196829485453148163, 'N3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 307, NULL, '液化气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339466247, 1067246875800000001, 1727339466247);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675847, 'T4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 155, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238353453056, 'T6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 316, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884171, 1067246875800000001, 1727339884171);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238353453057, 'T5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 317, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884171, 1067246875800000001, 1727339884171);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238353453058, 'T1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 318, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884171, 1067246875800000001, 1727339884171);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238353453059, 'T3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 319, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884171, 1067246875800000001, 1727339884171);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585472, 'C2dd', '日用气', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 162, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585473, 'C6dd', '日用气', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 163, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585474, 'C6yy', '年用气', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 164, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585475, 'C6mm', '月用气', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 165, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354518, 'G3', '瞬时工况流量', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 89, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381907, 1067246875800000001, 1724654381907);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585476, 'C2hh', '时用气', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 166, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585477, 'C6am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 167, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354522, 'G6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 93, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381908, 1067246875800000001, 1724654381908);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585478, 'C2mm', '月用气', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 168, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354524, 'G5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 95, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381908, 1067246875800000001, 1724654381908);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585479, 'tce_C6hh', '时用气折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 169, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585480, 'tce_C6mm', '月用气折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 170, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585481, 'tce_C6am', '刻用气折标煤', 'kgce', 900, NULL, 'region', NULL, NULL, NULL, 0, 171, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106725, 1067246875800000001, 1727340106725);
INSERT INTO "public"."iot_thing_dict" VALUES (160941049441685506, 'A29_peakam', '峰刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 60, NULL, '尖峰谷平计算属性组', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1718782996327, 1067246875800000001, 1718782996327);
INSERT INTO "public"."iot_thing_dict" VALUES (160941049441685505, 'A29_rusham', '尖刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 59, NULL, '尖峰谷平计算属性组', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1718782996327, 1067246875800000001, 1718782996327);
INSERT INTO "public"."iot_thing_dict" VALUES (160941049441685504, 'A29_valleyam', '谷刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 58, NULL, '尖峰谷平计算属性组', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1718782996327, 1067246875800000001, 1718782996327);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261244198914, 'B2yy', '年用水', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 65, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261244198913, 'B2am', '水刻用量', 't', 900, NULL, 'region', NULL, NULL, NULL, 0, 64, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261244198912, 'B2mm', '月用水', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 63, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261240004609, 'B2dd', '日用水', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 62, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261240004608, 'B2hh', '时用水', '', NULL, NULL, 'region', NULL, NULL, NULL, 0, 61, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354519, 'H2', '累计用量', NULL, 900, NULL, 'increase', NULL, NULL, NULL, 0, 90, NULL, '煤炭', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381907, 1067246875800000001, 1724654381907);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354527, 'G4', '累计工况流量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 98, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381908, 1067246875800000001, 1724654381908);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354529, 'G2', '累计标况流量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 100, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381908, 1067246875800000001, 1724654381908);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840404512768, 'Q4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 252, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550874, 1067246875800000001, 1727339550874);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840404512769, 'Q2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 253, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550874, 1067246875800000001, 1727339550874);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095680, 'Q2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 127, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095681, 'Q2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 128, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095682, 'Q4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 129, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095683, 'Q4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 130, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095684, 'Q2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 131, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354538, 'G1', '瞬时标况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 109, NULL, '二氧化碳', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381909, 1067246875800000001, 1724654381909);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095685, 'Q4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 132, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095686, 'Q4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 133, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840417095687, 'Q2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 134, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550877, 1067246875800000001, 1727339550877);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840433872896, 'Q1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 307, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550881, 1067246875800000001, 1727339550881);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840433872897, 'Q5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 308, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550881, 1067246875800000001, 1727339550881);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840433872898, 'Q6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 309, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550881, 1067246875800000001, 1727339550881);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585482, 'C6hh', '时用气', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 172, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585483, 'C2am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 173, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585484, 'CO2_C6hh', '时用气碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 174, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585485, 'CO2_C6mm', '月用气碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 175, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585486, 'CO2_C6yy', '年用气碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 176, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585487, 'CO2_C6dd', '日用气碳排', 'kgCO₂', NULL, NULL, 'region', NULL, NULL, NULL, 0, 177, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585488, 'CO2_C6am', '刻用气碳排', 'kgCO₂', 900, NULL, 'region', NULL, NULL, NULL, 0, 178, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585489, 'tce_C6yy', '年用气折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 179, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171812585490, 'tce_C6dd', '日用气折标煤', 'kgce', NULL, NULL, 'region', NULL, NULL, NULL, 0, 180, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106726, 1067246875800000001, 1727340106726);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171829362688, 'C6', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 257, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106729, 1067246875800000001, 1727340106729);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171829362689, 'C2', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 258, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106730, 1067246875800000001, 1727340106730);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171841945600, 'C3', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 322, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106732, 1067246875800000001, 1727340106732);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171841945601, 'C4', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 323, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106732, 1067246875800000001, 1727340106732);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171841945602, 'C1', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 324, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106732, 1067246875800000001, 1727340106732);
INSERT INTO "public"."iot_thing_dict" VALUES (196832171841945603, 'C5', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 325, NULL, '天然气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340106732, 1067246875800000001, 1727340106732);
INSERT INTO "public"."iot_thing_dict" VALUES (196829840433872899, 'Q3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 310, NULL, '氩气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339550881, 1067246875800000001, 1727339550881);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354570, 'E3hh', '时用蒸汽', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 141, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381911, 1067246875800000001, 1724654381911);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354564, 'E3', '蒸汽', 'Nm³', NULL, NULL, 'increase', NULL, NULL, NULL, 0, 135, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381910, 1067246875800000001, 1724654381910);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354563, 'E3am', '刻用蒸汽', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 134, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381910, 1067246875800000001, 1724654381910);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354561, 'E3mm', '月用蒸汽', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 132, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381910, 1067246875800000001, 1724654381910);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354560, 'E3yy', '年用蒸汽', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 131, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381910, 1067246875800000001, 1724654381910);
INSERT INTO "public"."iot_thing_dict" VALUES (185567425461354571, 'E3dd', '日用蒸汽', 'Nm³', NULL, NULL, 'region', NULL, NULL, NULL, 0, 142, NULL, '蒸汽', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654381911, 1067246875800000001, 1724654381911);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912836, 'U1', '质量流量', 't/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 164, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912848, 'U7', '密度', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 176, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912850, 'U6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 178, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912852, 'U3', '体积流量', 'm3/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 180, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912854, 'U5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 182, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912855, 'U2', '累计质量', 't', 900, NULL, 'increase', NULL, NULL, NULL, 0, 183, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912840, 'U4', '体积累计', 'm3', 900, NULL, 'increase', NULL, NULL, NULL, 0, 168, NULL, '柴油', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441816, 1067246875800000001, 1724654441816);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758079815680, 'D2', '标况累积量', 'Nm³/h', 900, NULL, 'increase', NULL, NULL, NULL, 0, 258, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246502, 1067246875800000001, 1727340246502);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758079815681, 'D4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 259, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246502, 1067246875800000001, 1727340246502);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398592, 'D2dd', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 180, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398593, 'D2am', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 181, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398594, 'D4am', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 182, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398595, 'D4dd', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 183, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398596, 'D2hh', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 184, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398597, 'D2mm', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 185, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398598, 'D4mm', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 186, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758092398599, 'D4hh', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 187, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246505, 1067246875800000001, 1727340246505);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758104981504, 'D1', '瞬时流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 325, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246508, 1067246875800000001, 1727340246508);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758104981505, 'D3', '瞬时流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 326, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246508, 1067246875800000001, 1727340246508);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758104981506, 'D6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 327, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246508, 1067246875800000001, 1727340246508);
INSERT INTO "public"."iot_thing_dict" VALUES (196832758104981507, 'D5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 328, NULL, '压缩空气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727340246508, 1067246875800000001, 1727340246508);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912902, 'P7', '密度', NULL, 900, NULL, 'instant', NULL, NULL, NULL, 0, 230, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441817, 1067246875800000001, 1724654441817);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912917, 'P6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 245, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441817, 1067246875800000001, 1724654441817);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912920, 'P5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 248, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441818, 1067246875800000001, 1724654441818);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912922, 'P1', '质量流量', 't/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 250, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441818, 1067246875800000001, 1724654441818);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912913, 'P4', '体积累计', 'm3', 900, NULL, 'increase', NULL, NULL, NULL, 0, 241, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441817, 1067246875800000001, 1724654441817);
INSERT INTO "public"."iot_thing_dict" VALUES (185567676737912924, 'P3', '体积流量', 'm3/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 252, NULL, '压力', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654441818, 1067246875800000001, 1724654441818);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405113020416, 'R2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 253, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685511, 1067246875800000001, 1727339685511);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405113020417, 'R4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 254, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685511, 1067246875800000001, 1727339685511);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409024, 'R4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 134, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685513, 1067246875800000001, 1727339685513);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409025, 'R2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 135, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685513, 1067246875800000001, 1727339685513);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409026, 'R2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 136, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685513, 1067246875800000001, 1727339685513);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409027, 'R4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 137, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685513, 1067246875800000001, 1727339685513);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409028, 'R4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 138, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685513, 1067246875800000001, 1727339685513);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409029, 'R2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 139, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685514, 1067246875800000001, 1727339685514);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409030, 'R2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 140, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685514, 1067246875800000001, 1727339685514);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405121409031, 'R4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 141, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685514, 1067246875800000001, 1727339685514);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405133991936, 'R5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 310, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685516, 1067246875800000001, 1727339685516);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405133991937, 'R6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 311, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685517, 1067246875800000001, 1727339685517);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405133991938, 'R3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 312, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685517, 1067246875800000001, 1727339685517);
INSERT INTO "public"."iot_thing_dict" VALUES (196830405133991939, 'R1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 313, NULL, '高炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339685517, 1067246875800000001, 1727339685517);
INSERT INTO "public"."iot_thing_dict" VALUES (196825741600620546, 'A11', '电流不平衡度', '%', 900, NULL, 'instant', NULL, NULL, NULL, 0, 292, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338573645, 1067246875800000001, 1727338573645);
INSERT INTO "public"."iot_thing_dict" VALUES (185915914661789696, 'A29_normal', '平用电', 'kWh', 900, '', 'default', '', '', NULL, 1, 271, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1724737468206, 1067246875800000001, 1724737468206);
INSERT INTO "public"."iot_thing_dict" VALUES (185920318425137152, 'A29_peak', '峰用电', 'kWh', 900, '', 'default', '', '', NULL, 1, 272, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1724738518145, 1067246875800000001, 1724738518145);
INSERT INTO "public"."iot_thing_dict" VALUES (185920399496839168, 'A29_rush', '尖用电', 'kWh', 900, '', 'default', '', '', NULL, 1, 273, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1724738537474, 1067246875800000001, 1724738537474);
INSERT INTO "public"."iot_thing_dict" VALUES (185920552140144640, 'A29_valley', '谷用电', 'kWh', 900, '', 'default', '', '', NULL, 1, 274, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1724738573867, 1067246875800000001, 1724738573867);
INSERT INTO "public"."iot_thing_dict" VALUES (160941049441685507, 'A29_normalam', '平刻用电', 'kWh', 900, NULL, 'region', NULL, NULL, NULL, 0, 61, NULL, '尖峰谷平计算属性组', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1718782996327, 1067246875800000001, 1718782996327);
INSERT INTO "public"."iot_thing_dict" VALUES (186604471944609792, 'B2', '水价格', 't', 900, '', 'default', '', '', NULL, 1, 275, '', '用量价格组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1724901633056, 1067246875800000001, 1724901633056);
INSERT INTO "public"."iot_thing_dict" VALUES (185566261244198916, 'B2', '水用量', 't', 900, NULL, 'increase', NULL, NULL, NULL, 0, 67, NULL, '', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1724654104335, 1067246875800000001, 1724654104335);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935084965888, 'W4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 107, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335029, 1067246875800000001, 1727339335029);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935084965889, 'W2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 108, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335030, 1067246875800000001, 1727339335030);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548800, 'W2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 113, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548801, 'W4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 114, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548802, 'W4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 115, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548803, 'W4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 116, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548804, 'W4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 117, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548805, 'W2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 118, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548806, 'W2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 119, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935097548807, 'W2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 120, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335032, 1067246875800000001, 1727339335032);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935110131712, 'W6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 301, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335036, 1067246875800000001, 1727339335036);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935110131713, 'W5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 302, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335036, 1067246875800000001, 1727339335036);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935110131714, 'W1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 303, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335036, 1067246875800000001, 1727339335036);
INSERT INTO "public"."iot_thing_dict" VALUES (196828935110131715, 'W3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 304, NULL, '液体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339335036, 1067246875800000001, 1727339335036);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596861587456, 'V2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 256, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969646, 1067246875800000001, 1727339969646);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596861587457, 'V4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 257, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969646, 1067246875800000001, 1727339969646);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976064, 'V2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 155, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976065, 'V4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 156, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976066, 'V2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 157, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976067, 'V4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 158, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976068, 'V2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 159, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (159150664639909888, 'A29am', '电量', 'kWh', 90, '', 'region', '', '', NULL, 0, 3, '', '碳计算能源属性组', NULL, NULL, '', 1001, 1001, 1001, 1067246875800000001, 1718356135326, 1067246875800000001, 1718356135326);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800707190784, 'S2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 254, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779828, 1067246875800000001, 1727339779828);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800707190785, 'S4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 255, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779828, 1067246875800000001, 1727339779828);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579392, 'S4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 141, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579393, 'S2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 142, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579394, 'S4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 143, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579395, 'S2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 144, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579396, 'S4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 145, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579397, 'S2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 146, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579398, 'S2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 147, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800715579399, 'S4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 148, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779830, 1067246875800000001, 1727339779830);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800728162304, 'S1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 313, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779833, 1067246875800000001, 1727339779833);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800728162305, 'S3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 314, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779833, 1067246875800000001, 1727339779833);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800728162306, 'S6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 315, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779833, 1067246875800000001, 1727339779833);
INSERT INTO "public"."iot_thing_dict" VALUES (196830800728162307, 'S5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 316, NULL, '焦炉煤气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339779833, 1067246875800000001, 1727339779833);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976069, 'V2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 160, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969648, 1067246875800000001, 1727339969648);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976070, 'V4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 161, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969649, 1067246875800000001, 1727339969649);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596869976071, 'V4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 162, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969649, 1067246875800000001, 1727339969649);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596882558976, 'V5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 319, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969651, 1067246875800000001, 1727339969651);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596882558977, 'V6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 320, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969651, 1067246875800000001, 1727339969651);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596882558978, 'V1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 321, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969651, 1067246875800000001, 1727339969651);
INSERT INTO "public"."iot_thing_dict" VALUES (196831596882558979, 'V3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 322, NULL, '气体介质', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339969651, 1067246875800000001, 1727339969651);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238328287232, 'T2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 255, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884165, 1067246875800000001, 1727339884165);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238328287233, 'T4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 256, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884165, 1067246875800000001, 1727339884165);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675840, 'T4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 148, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675841, 'T4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 149, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675842, 'T2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 150, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675843, 'T2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 151, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675844, 'T2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 152, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675845, 'T2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 153, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196831238336675846, 'T4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 154, NULL, '丙烷', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339884168, 1067246875800000001, 1727339884168);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617920, 'J4mm', '月用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 91, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617921, 'J2am', '刻用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 92, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617922, 'J2dd', '日用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 93, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617923, 'J2mm', '月用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 94, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617924, 'J2hh', '时用气', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 95, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617925, 'J4hh', '时用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 96, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617926, 'J4am', '刻用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 97, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879437, 1067246875800000001, 1727338879437);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024193617927, 'J4dd', '日用气', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 98, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879438, 1067246875800000001, 1727338879438);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024206200832, 'J2', '标况累计量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 90, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879440, 1067246875800000001, 1727338879440);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024206200833, 'J4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 91, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879440, 1067246875800000001, 1727338879440);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024222978048, 'J1', '标况流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 292, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879444, 1067246875800000001, 1727338879444);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024222978049, 'J3', '工况流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 293, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879444, 1067246875800000001, 1727338879444);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024222978050, 'J5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 294, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879445, 1067246875800000001, 1727338879445);
INSERT INTO "public"."iot_thing_dict" VALUES (196827024222978051, 'J6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 295, NULL, '氢气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338879445, 1067246875800000001, 1727338879445);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505720688640, 'I4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 91, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994242, 1067246875800000001, 1727338994242);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505720688641, 'I2', '标况累积量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 92, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994242, 1067246875800000001, 1727338994242);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077248, 'I2mm', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 98, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994244, 1067246875800000001, 1727338994244);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077249, 'I2am', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 99, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994244, 1067246875800000001, 1727338994244);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077250, 'I2dd', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 100, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994244, 1067246875800000001, 1727338994244);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077251, 'I2hh', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 101, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994245, 1067246875800000001, 1727338994245);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077252, 'I4hh', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 102, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994245, 1067246875800000001, 1727338994245);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077253, 'I4am', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 103, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994245, 1067246875800000001, 1727338994245);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077254, 'I4mm', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 104, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994245, 1067246875800000001, 1727338994245);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505729077255, 'I4dd', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 105, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994245, 1067246875800000001, 1727338994245);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505745854464, 'I5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 295, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994248, 1067246875800000001, 1727338994248);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505745854465, 'I1', '瞬时流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 296, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994249, 1067246875800000001, 1727338994249);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505745854466, 'I3', '瞬时流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 297, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994249, 1067246875800000001, 1727338994249);
INSERT INTO "public"."iot_thing_dict" VALUES (196827505745854467, 'I6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 298, NULL, '氧气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727338994249, 1067246875800000001, 1727338994249);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525760, 'F2mm', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 105, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525761, 'F4hh', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 106, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525763, 'F4am', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 108, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525764, 'F4dd', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 109, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525765, 'F4mm', '工况累计量', '', 900, NULL, 'region', NULL, NULL, NULL, 0, 110, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525766, 'F2am', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 111, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127523, 1067246875800000001, 1727339127523);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525767, 'F2dd', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 112, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127523, 1067246875800000001, 1727339127523);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525768, 'F2hh', '标况累积量', 'Nm³', 900, NULL, 'region', NULL, NULL, NULL, 0, 113, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127523, 1067246875800000001, 1727339127523);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064754302976, 'F2', '标况累积量', 'Nm³', 900, NULL, 'increase', NULL, NULL, NULL, 0, 100, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127526, 1067246875800000001, 1727339127526);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064766885888, 'F3', '瞬时流量', 'm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 298, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127529, 1067246875800000001, 1727339127529);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064766885889, 'F5', '温度', '', 900, NULL, 'instant', NULL, NULL, NULL, 0, 299, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127530, 1067246875800000001, 1727339127530);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064766885890, 'F1', '瞬时流量', 'Nm³/h', 900, NULL, 'instant', NULL, NULL, NULL, 0, 300, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127530, 1067246875800000001, 1727339127530);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064766885891, 'F6', '压力', 'MPa', 900, NULL, 'instant', NULL, NULL, NULL, 0, 301, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127530, 1067246875800000001, 1727339127530);
INSERT INTO "public"."iot_thing_dict" VALUES (196828064737525762, 'F4', '工况累计量', '', 900, NULL, 'increase', NULL, NULL, NULL, 0, 107, NULL, '氮气', NULL, NULL, NULL, 1001, 1001, 1001, 1067246875800000001, 1727339127522, 1067246875800000001, 1727339127522);

312
help/sql/5dml_1.0.2.sql

@ -1,312 +0,0 @@
-- ============================================================================================
-- 网关组件
DROP TABLE IF EXISTS "public"."gateway_component";
create table public.gateway_component
(
id bigint primary key,
name varchar(100),
type varchar(255),
description varchar(500)
);
comment on table public.gateway_component is '网关组件';
comment on column public.gateway_component.id is '主键';
comment on column public.gateway_component.name is '组件名称';
comment on column public.gateway_component.type is '组件类型';
comment on column public.gateway_component.description is '组件描述';
-- 网关组件配置
DROP TABLE IF EXISTS "public"."gateway_component_config";
create table public.gateway_component_config
(
id bigint not null
primary key,
cmpt_id bigint,
cmpt_type varchar(100),
cmpt_cfg_name varchar(255),
cmpt_cfg_context text,
max_instance_num integer,
active boolean,
tenant_code bigint,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.gateway_component_config is '网关组件配置';
comment on column public.gateway_component_config.id is '主键';
comment on column public.gateway_component_config.cmpt_id is '组件id';
comment on column public.gateway_component_config.cmpt_type is '组件类型';
comment on column public.gateway_component_config.cmpt_cfg_name is '组件配置名称';
comment on column public.gateway_component_config.cmpt_cfg_context is '组件配置内容';
comment on column public.gateway_component_config.max_instance_num is '最大实例运行数';
comment on column public.gateway_component_config.active is '是否启用';
-- 网关组件配置详情(数据主题、通道、寄存器地址位等)
DROP TABLE IF EXISTS "public"."gateway_component_config_detail";
create table public.gateway_component_config_detail
(
id bigint primary key,
cfg_id bigint,
detail_context varchar(500),
debug boolean,
read_write integer,
remark varchar(2000),
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.gateway_component_config_detail is '网关配置详情(数据主题、通道、寄存器地址位等)';
comment on column public.gateway_component_config_detail.id is '主键';
comment on column public.gateway_component_config_detail.cfg_id is '通讯配置主键';
comment on column public.gateway_component_config_detail.detail_context is '配置详情';
comment on column public.gateway_component_config_detail.debug is '是否调试';
comment on column public.gateway_component_config_detail.read_write is '类型(0-读; 1-写; 2-读写)';
comment on column public.gateway_component_config_detail.remark is '备注';
comment on column public.gateway_component_config_detail.creator is '创建者';
comment on column public.gateway_component_config_detail.create_date is '创建时间';
comment on column public.gateway_component_config_detail.updater is '更新者';
comment on column public.gateway_component_config_detail.update_date is '更新时间';
-- 网关组件实例
DROP TABLE IF EXISTS "public"."gateway_component_instance";
create table public.gateway_component_instance
(
id bigint primary key,
cmpt_id bigint,
cmpt_type varchar(255),
cmpt_cfg_id bigint,
instance_ip varchar(50),
instance_name varchar(100),
instance_status varchar(100),
start_time bigint,
dead_dur bigint
);
comment on table public.gateway_component_instance is '网关组件实例';
comment on column public.gateway_component_instance.id is '主键';
comment on column public.gateway_component_instance.cmpt_id is '组件id';
comment on column public.gateway_component_instance.cmpt_type is '组件类型';
comment on column public.gateway_component_instance.cmpt_cfg_id is '组件配置id';
comment on column public.gateway_component_instance.instance_ip is '实例ip';
comment on column public.gateway_component_instance.instance_name is '实例名称';
comment on column public.gateway_component_instance.instance_status is '实例状态:STARTING, WAITING, RUNNING, RESTARTING, STOP';
comment on column public.gateway_component_instance.start_time is '实例启动时间';
comment on column public.gateway_component_instance.dead_dur is '实例宕机时长';
-- 网关组件数据接入日志
DROP TABLE IF EXISTS "public"."gateway_component_log";
create table public.gateway_component_log
(
id bigint not null
primary key,
cmpt_cfg_id bigint,
cmpt_cfg_detail_id bigint,
addr varchar(255),
input_msg varchar,
output_msg varchar,
error_msg varchar,
origin varchar(50),
debug boolean,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.gateway_component_log is '网关组件数据接入日志';
comment on column public.gateway_component_log.id is '主键';
comment on column public.gateway_component_log.cmpt_cfg_id is '组件配置id';
comment on column public.gateway_component_log.cmpt_cfg_detail_id is '组件配置详情id';
comment on column public.gateway_component_log.addr is '通道';
comment on column public.gateway_component_log.input_msg is '原始数据';
comment on column public.gateway_component_log.output_msg is '转换后数据';
comment on column public.gateway_component_log.error_msg is '错误消息';
comment on column public.gateway_component_log.origin is '数据来源';
comment on column public.gateway_component_log.debug is '是否调试模式日志';
comment on column public.gateway_component_log.creator is '创建者';
comment on column public.gateway_component_log.create_date is '创建时间';
comment on column public.gateway_component_log.updater is '更新者';
comment on column public.gateway_component_log.update_date is '更新时间';
-- 网关设备控制
DROP TABLE IF EXISTS "public"."gateway_device_control";
create table public.gateway_device_control
(
id bigint not null,
name varchar(255),
thing_name varchar(50),
thing_code varchar(50),
attr_name varchar(50),
attr_code varchar(50),
cmpt_type varchar(50),
cmpt_cfg_id bigint,
cmpt_cfg_detail_id bigint,
query_msg varchar(5000),
ctl_body varchar,
ctl_type varchar(5),
ctl_json varchar(10240),
user_list varchar(2550),
tenant_code bigint,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.gateway_device_control is '设备控制';
comment on column public.gateway_device_control.id is '主键';
comment on column public.gateway_device_control.name is '控制名称';
comment on column public.gateway_device_control.thing_name is '物名称';
comment on column public.gateway_device_control.thing_code is '物编码';
comment on column public.gateway_device_control.attr_name is '属性名称';
comment on column public.gateway_device_control.attr_code is '属性编码';
comment on column public.gateway_device_control.cmpt_cfg_id is '组件配置id';
comment on column public.gateway_device_control.cmpt_cfg_detail_id is '组件配置详情id';
comment on column public.gateway_device_control.query_msg is '查询参数';
comment on column public.gateway_device_control.ctl_body is '控制逻辑';
comment on column public.gateway_device_control.ctl_type is '控制类型,1图,2切换,3数值';
comment on column public.gateway_device_control.ctl_json is ' 控制样式json';
comment on column public.gateway_device_control.user_list is '用户列表,多个用户以英文逗号分割';
comment on column public.gateway_device_control.tenant_code is '所属企业(租户code)';
comment on column public.gateway_device_control.company_id is '企业详情id';
comment on column public.gateway_device_control.dept_id is '部门id';
comment on column public.gateway_device_control.creator is '创建者';
comment on column public.gateway_device_control.create_date is '创建时间';
comment on column public.gateway_device_control.updater is '更新者';
comment on column public.gateway_device_control.update_date is '更新时间';
-- ============================================================================================
-- 设备自动控制配置
DROP TABLE IF EXISTS "public"."iot_device_auto_control_config";
create table public.iot_device_auto_control_config
(
id bigint primary key,
filter_rule_id bigint,
control_id bigint,
remark varchar(255),
msg_push_id bigint,
tenant_code bigint,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.iot_device_auto_control_config is '设备自动控制配置';
comment on column public.iot_device_auto_control_config.id is '主键';
comment on column public.iot_device_auto_control_config.filter_rule_id is '过滤规则id';
comment on column public.iot_device_auto_control_config.control_id is '控制指令id,gateway_device_control表主键';
comment on column public.iot_device_auto_control_config.remark is '备注';
comment on column public.iot_device_auto_control_config.msg_push_id is '消息推送设置主键';
comment on column public.iot_device_auto_control_config.creator is '创建者';
comment on column public.iot_device_auto_control_config.create_date is '创建时间';
comment on column public.iot_device_auto_control_config.updater is '更新者';
comment on column public.iot_device_auto_control_config.update_date is '更新时间';
-- ============================================================================================
-- 新告警配置
DROP TABLE IF EXISTS "public"."alert_config";
create table public.alert_config
(
id bigint primary key,
filter_rule_id bigint,
alert_name varchar(255),
alert_type varchar(255),
alert_level varchar(255),
alert_content text,
repeat boolean,
remark varchar(255),
begin_time bigint,
end_time bigint,
msg_push_id bigint,
tenant_code bigint,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.alert_config is '通用告警配置';
comment on column public.alert_config.id is '主键';
comment on column public.alert_config.filter_rule_id is '过滤规则id';
comment on column public.alert_config.alert_name is '告警名称';
comment on column public.alert_config.alert_type is '告警类型';
comment on column public.alert_config.alert_level is '告警等级';
comment on column public.alert_config.alert_content is '告警内容';
comment on column public.alert_config.repeat is '是否可重复';
comment on column public.alert_config.remark is '备注';
comment on column public.alert_config.begin_time is '告警起始时间';
comment on column public.alert_config.end_time is '告警结束时间';
comment on column public.alert_config.msg_push_id is '消息推送设置主键';
comment on column public.alert_config.creator is '创建者';
comment on column public.alert_config.create_date is '创建时间';
comment on column public.alert_config.updater is '更新者';
comment on column public.alert_config.update_date is '更新时间';
-- 新告警操作日志
DROP TABLE IF EXISTS "public"."alert_dispose_log";
create table public.alert_dispose_log
(
id bigint primary key,
alert_log_id bigint,
describe varchar,
status varchar(25),
images varchar,
dispose_result varchar(255),
creator bigint,
create_date bigint,
updater bigint,
update_date bigint
);
comment on table public.alert_dispose_log is '告警处理日志';
comment on column public.alert_dispose_log.alert_log_id is '告警记录';
comment on column public.alert_dispose_log.describe is '问题描述';
comment on column public.alert_dispose_log.status is '处理状态:0-待处理,1-处理中,2-已处理';
comment on column public.alert_dispose_log.images is '图片列表';
comment on column public.alert_dispose_log.dispose_result is '处理结果';
-- 新告警日志
DROP TABLE IF EXISTS "public"."alert_log";
create table public.alert_log
(
id bigint primary key,
config_id bigint,
content varchar,
status varchar(25),
alert_time bigint,
dispose_time bigint,
dispose_user_id bigint,
tenant_code bigint,
company_id bigint,
dept_id bigint,
creator bigint,
create_date bigint,
updater bigint,
update_date bigint,
constraint alert_log_inx_cfg_id_time
unique (config_id, alert_time)
);
comment on table public.alert_log is '告警日志';
comment on column public.alert_log.id is '主键';
comment on column public.alert_log.config_id is '告警配置id';
comment on column public.alert_log.content is '告警内容+过滤规则公式';
comment on column public.alert_log.status is '处理状态:0-待处理,1-处理中,2-已处理';
comment on column public.alert_log.alert_time is '告警时间';
comment on column public.alert_log.dispose_time is '处理时间';
comment on column public.alert_log.dispose_user_id is '处理人';

37557
help/sql/visualv1.sql
File diff suppressed because it is too large
View File

25
modules/carbon-public/pom.xml

@ -1,25 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.thing</groupId>
<artifactId>modules</artifactId>
<version>5.1</version>
</parent>
<groupId>com.thing.modules</groupId>
<artifactId>carbon-public</artifactId>
<packaging>jar</packaging>
<name>ThingBI Server Modules carbon-public</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.thing.modules</groupId>
<artifactId>carbon-track</artifactId>
</dependency>
</dependencies>
</project>

217
modules/carbon-public/src/main/java/com/thing/carbon/pub/api/CertificateApi.java

@ -1,217 +0,0 @@
package com.thing.carbon.pub.api;
import com.alibaba.fastjson.JSONObject;
import com.mybatisflex.core.query.QueryWrapper;
import com.thing.carbon.pub.constant.ApiConstant;
import com.thing.carbon.pub.constant.PointsConstant;
import com.thing.carbon.pub.constant.ReportSourceTypeConstant;
import com.thing.carbon.pub.dto.CarbonPubPointsRuleDTO;
import com.thing.carbon.pub.entity.CarbonPubPointsLogsEntity;
import com.thing.carbon.pub.entity.CarbonPubProductionModelEntity;
import com.thing.carbon.pub.entity.CarbonPubProductionReportEntity;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.*;
import com.thing.carbontrack.certification.dto.CarbonStageValue;
import com.thing.carbontrack.certification.dto.IotCarbonCertificateDTO;
import com.thing.carbontrack.certification.dto.SimpleProductInfo;
import com.thing.carbontrack.certification.entity.IotCarbonCertificateEntity;
import com.thing.carbontrack.certification.service.IotCarbonCertificateService;
import com.thing.carbontrack.production.entity.IotCarbonProductionVarietyEntity;
import com.thing.carbontrack.production.service.IotCarbonProductionVarietyService;
import com.thing.common.core.utils.DateTimeUtils;
import com.thing.common.core.web.response.Result;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author siyang
* @date 2024/5/16 11:50
* @description 国网数据服务接口碳足迹证书
*/
@RestController
@RequestMapping("v2/carbon/pub/certificate")
@RequiredArgsConstructor
public class CertificateApi {
private final CarbonPubPointsRuleService ruleService;
private final CarbonPubPointsLogsService logsService;
private final CarbonPubSupplierService supplierService;
private final IotCarbonCertificateService certificateService;
private final IotCarbonProductionVarietyService productionService;
private final CarbonPubProductionModelService productionModelService;
private final CarbonPubProductionReportService reportService;
/**
* 同步碳足迹证书
*/
@PostMapping("sync")
public Result<Void> sync(@RequestBody IotCarbonCertificateDTO certificate, HttpServletRequest request) {
CarbonPubSupplierEntity supplier =
(CarbonPubSupplierEntity) request.getAttribute(ApiConstant.SUPPLIER);
Long tenantCode = supplier.getCode();
// saveOrUpdateProduct(certificate, tenantCode);
saveOrUpdateProductModel(certificate, tenantCode);
saveOrUpdateCertificate(certificate, tenantCode);
boolean createSuccess = updateOrCreateReport(certificate, tenantCode);
if(!createSuccess){
return new Result<>();
}
CarbonPubPointsRuleDTO pointsRule = ruleService.getFirst();
supplierService.plusPointOn(tenantCode, pointsRule.getFootprintCertifyPoints());
logsService.save(
new CarbonPubPointsLogsEntity()
.setPoints(pointsRule.getFootprintCertifyPoints())
.setType(PointsConstant.CERTIFICATE)
.setTenantCode(tenantCode)
.setCreateTime(System.currentTimeMillis()));
return new Result<>();
}
private void saveOrUpdateProduct(IotCarbonCertificateDTO certificate, Long tenantCode){
Long productId = certificate.getProductId();
IotCarbonProductionVarietyEntity product =
productionService.getOne(
QueryWrapper.create()
.eq(IotCarbonProductionVarietyEntity::getId, productId)
.eq(IotCarbonProductionVarietyEntity::getTenantCode, tenantCode)
.limit(1));
SimpleProductInfo productInfo = certificate.getProductInfo();
IotCarbonProductionVarietyEntity productEntity = productInfo.toProductEntity(tenantCode);
productEntity.setId(productId);
productEntity.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
if (Objects.isNull(product)) {
productionService.save(productEntity);
} else {
productionService.updateById(productEntity);
}
}
private void saveOrUpdateProductModel(IotCarbonCertificateDTO certificate, Long tenantCode){
Long productId = certificate.getProductId();
CarbonPubProductionModelEntity model =
productionModelService.getOne(
QueryWrapper.create()
.eq(CarbonPubProductionModelEntity::getProductId, productId)
.eq(CarbonPubProductionModelEntity::getTenantCode, tenantCode)
.limit(1));
SimpleProductInfo productInfo = certificate.getProductInfo();
CarbonPubProductionModelEntity productEntity = convertProductModel(productInfo, tenantCode);
productEntity.setProductId(productId);
productEntity.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
if (Objects.isNull(model)) {
productionModelService.save(productEntity);
} else {
productEntity.setId(model.getId());
productionModelService.updateById(productEntity);
}
}
private void saveOrUpdateCertificate(IotCarbonCertificateDTO certificate, Long tenantCode) {
IotCarbonCertificateEntity entity = certificate.toEntity();
entity.setShared(1);
entity.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
certificateService.saveOrUpdate(entity);
}
private boolean updateOrCreateReport(IotCarbonCertificateDTO certificate, Long tenantCode) {
// 各阶段生命周期占比
List<CarbonStageValue> stagePercentList = certificate.getStagePercentList();
if (CollectionUtils.isEmpty(stagePercentList)) {
return false;
}
Map<String, BigDecimal> stagePercentMap =
stagePercentList.stream()
.collect(
Collectors.toMap(
CarbonStageValue::getName, CarbonStageValue::getValue));
String stagePercentJson = JSONObject.toJSONString(stagePercentMap);
// 查询历史记录
SimpleProductInfo productInfo = certificate.getProductInfo();
CarbonPubProductionReportEntity oldReport =
reportService.getOne(
QueryWrapper.create()
.eq(CarbonPubProductionReportEntity::getProductId, certificate.getProductId())
.eq(CarbonPubProductionReportEntity::getBoundaryType, 3)
.eq(CarbonPubProductionReportEntity::getTenantCode, tenantCode)
.eq(CarbonPubProductionReportEntity::getBoundaryStart, new Date(certificate.getBoundaryStart()))
.eq(CarbonPubProductionReportEntity::getBoundaryEnd, new Date(certificate.getBoundaryEnd()))
.limit(1));
// 更新报告
if(Objects.nonNull(oldReport)){
oldReport.setTotalCarbon(certificate.getCarbonVal());
oldReport.setStagePercentJson(stagePercentJson);
reportService.updateById(oldReport);
return false;
}
// 生成报告编号
String reportCodePrefix = "LRD-ECO-%s%s";
LocalDateTime now = LocalDateTime.now();
LocalDateTime validEndTime = now.plusYears(1).minusDays(1);
String timeStr =
now.getYear()
+ addZeroPrefix(now.getMonthValue(), 2)
+ addZeroPrefix(now.getDayOfMonth(), 2);
String reportCode = String.format(reportCodePrefix, timeStr, addZeroPrefix(1, 3));
// 创建报告
CarbonPubProductionReportEntity report =
new CarbonPubProductionReportEntity()
.setProductId(certificate.getProductId())
.setBoundary(productInfo.getBoundary())
.setBoundaryType(3)
.setBoundaryStart(new Date(certificate.getBoundaryStart()))
.setBoundaryEnd(new Date(certificate.getBoundaryEnd()))
.setValidEndTime(DateTimeUtils.parse(validEndTime))
.setTotalCarbon(certificate.getCarbonVal())
.setCompanyName(certificate.getCompanyName())
.setReportCode(reportCode)
.setSourceType(ReportSourceTypeConstant.CERTIFICATE_UPLOAD)
.setStagePercentJson(stagePercentJson);
report.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
reportService.save(report);
return true;
}
private String addZeroPrefix(Integer num, int length){
return StringUtils.leftPad(num.toString(), length, "0");
}
private CarbonPubProductionModelEntity convertProductModel(SimpleProductInfo productInfo, Long tenantCode){
CarbonPubProductionModelEntity model = new CarbonPubProductionModelEntity();
model.setProductCode(productInfo.getProductCode())
.setProductModel(productInfo.getProductModel())
.setProductName(productInfo.getProductName())
.setFunctionUnit(productInfo.getFunctionUnit())
.setIndustryType(productInfo.getIndustryType())
.setIndustryCategory(productInfo.getProductCategory())
.setProductType(productInfo.getProductType());
model.setTenantCode(tenantCode).setCompanyId(tenantCode).setDeptId(tenantCode);
return model;
}
}

79
modules/carbon-public/src/main/java/com/thing/carbon/pub/api/MaterialFactorApi.java

@ -1,79 +0,0 @@
package com.thing.carbon.pub.api;
import com.thing.carbon.pub.constant.ApiConstant;
import com.thing.carbon.pub.constant.CarbonFactorConstant;
import com.thing.carbon.pub.dto.CarbonPubMaterialFactorApiDTO;
import com.thing.carbon.pub.dto.CarbonPubMaterialFactorDTO;
import com.thing.carbon.pub.dto.CarbonPubPointsRuleDTO;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.CarbonPubMaterialFactorService;
import com.thing.carbon.pub.service.CarbonPubPointsRuleService;
import com.thing.common.core.utils.ConvertUtils;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @author siyang
* @date 2024/5/16 11:50
* @description 国网数据服务接口碳排因子
*/
@RestController
@RequestMapping("v2/carbon/pub/material/factor")
@RequiredArgsConstructor
public class MaterialFactorApi {
private final CarbonPubPointsRuleService ruleService;
private final CarbonPubMaterialFactorService factorService;
/**
* 碳排因子分页查询
* 参数定义参考{@link com.thing.carbon.pub.controller.CarbonPubMaterialFactorController#page}
*/
@GetMapping("page")
public Result<PageData<CarbonPubMaterialFactorApiDTO>> factorPage(@RequestParam Map<String, Object> params, HttpServletRequest request) {
CarbonPubSupplierEntity supplier = (CarbonPubSupplierEntity) request.getAttribute(ApiConstant.SUPPLIER);
Integer points = supplier.getPoints();
PageData<CarbonPubMaterialFactorApiDTO> page = factorService.getPageData(params, CarbonPubMaterialFactorApiDTO.class);
// 非详情接口不给看碳排因子值
page.getList()
.forEach(
e -> {
e.setFactor(null);
e.setPoints(points);
if (CarbonFactorConstant.CHANGE_SOURCE_NAME) {
e.setSourceName(CarbonFactorConstant.SOURCE_NAME);
}
});
return new Result<PageData<CarbonPubMaterialFactorApiDTO>>().ok(page);
}
/**
* 查看碳排因子详情
*/
@GetMapping("detail")
public Result<CarbonPubMaterialFactorApiDTO> factorDetail(@RequestParam Map<String, Object> params, HttpServletRequest request) {
String materialFactorId = MapUtils.getString(params, "materialFactorId");
CarbonPubSupplierEntity supplier = (CarbonPubSupplierEntity)request.getAttribute(ApiConstant.SUPPLIER);
Long tenantCode = supplier.getCode();
CarbonPubMaterialFactorDTO dto = factorService.handleDetail(materialFactorId, tenantCode);
CarbonPubMaterialFactorApiDTO factor = ConvertUtils.sourceToTarget(dto, CarbonPubMaterialFactorApiDTO.class);
if (CarbonFactorConstant.CHANGE_SOURCE_NAME) {
factor.setSourceName(CarbonFactorConstant.SOURCE_NAME);
}
CarbonPubPointsRuleDTO pointsRule = ruleService.getFirst();
factor.setPoints(supplier.getPoints() - pointsRule.getFactorUsePoints());
return new Result<CarbonPubMaterialFactorApiDTO>().ok(factor);
}
}

150
modules/carbon-public/src/main/java/com/thing/carbon/pub/api/ProductionModelApi.java

@ -1,150 +0,0 @@
package com.thing.carbon.pub.api;
import com.mybatisflex.core.query.QueryWrapper;
import com.thing.carbon.pub.constant.ApiConstant;
import com.thing.carbon.pub.constant.PointsConstant;
import com.thing.carbon.pub.dto.CarbonPubPointsRuleDTO;
import com.thing.carbon.pub.dto.CarbonPubProductionModelDTO;
import com.thing.carbon.pub.entity.CarbonPubPointsLogsEntity;
import com.thing.carbon.pub.entity.CarbonPubProductionModelEntity;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.CarbonPubPointsLogsService;
import com.thing.carbon.pub.service.CarbonPubPointsRuleService;
import com.thing.carbon.pub.service.CarbonPubProductionModelService;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.carbontrack.bom.service.IotCarbonBomService;
import com.thing.carbontrack.production.service.IotCarbonProductionVarietyService;
import com.thing.carbontrack.steps.service.IotCarbonProcessStepsService;
import com.thing.common.core.utils.ConvertUtils;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author siyang
* @date 2024/5/16 14:44
* @description 国网数据服务接口产品工艺模型
*/
@RestController
@RequestMapping("v2/carbon/pub/production/model")
@RequiredArgsConstructor
public class ProductionModelApi {
private final CarbonPubPointsRuleService ruleService;
private final CarbonPubPointsLogsService logsService;
private final CarbonPubSupplierService supplierService;
private final CarbonPubProductionModelService modelService;
private final IotCarbonProductionVarietyService productionVarietyService;
private final IotCarbonBomService bomService;
private final IotCarbonProcessStepsService processStepsService;
/**
* 获取工艺模型的所有一级行业分类
*/
@GetMapping("industry/types")
public Result<List<String>> modelIndustryTypes(){
return new Result<List<String>>().ok(modelService.getIndustryTypes());
}
/**
* 产品工艺模型二级分类查询
* 参考{@link com.thing.carbon.pub.controller.CarbonPubProductionModelController#types}
*/
@GetMapping("industry/categories")
public Result<List<String>> modelTypes(@RequestParam Map<String, Object> params){
List<String> types = modelService.getIndustryCategories(params);
return new Result<List<String>>().ok(types);
}
/**
* 产品工艺模型分页查询
* 参考{@link com.thing.carbon.pub.controller.CarbonPubProductionModelController#page}
*/
@GetMapping("page")
public Result<PageData<CarbonPubProductionModelDTO>> modelPage(@RequestParam Map<String, Object> params){
params.putIfAbsent("orderField", "create_date");
params.put("showInCommunity", 1);
PageData<CarbonPubProductionModelDTO> page = modelService.getSimplePageData(params);
return new Result<PageData<CarbonPubProductionModelDTO>>().ok(page);
}
/**
* 产品工艺模型详情
* 参考{@link com.thing.carbon.pub.controller.CarbonPubProductionModelController#get}
*/
@GetMapping("detail")
public Result<CarbonPubProductionModelDTO> modelDetail(@RequestParam Map<String, Object> params, HttpServletRequest request){
Long id = MapUtils.getLong(params, "id");
String code = MapUtils.getString(params, "code");
String name = MapUtils.getString(params, "name");
CarbonPubProductionModelEntity entity =
modelService.getOne(
QueryWrapper.create()
.eq(CarbonPubProductionModelEntity::getId, id, Objects::nonNull)
.eq(CarbonPubProductionModelEntity::getProductCode, code, Objects::nonNull)
.eq(CarbonPubProductionModelEntity::getProductName, name, Objects::nonNull)
.limit(1));
if (Objects.isNull(entity)) {
return new Result<>();
}
CarbonPubSupplierEntity supplier = (CarbonPubSupplierEntity)request.getAttribute(ApiConstant.SUPPLIER);
CarbonPubProductionModelDTO detail = modelService.handleDetail(entity, supplier.getCode());
modelService.plusDownloadCount(entity.getId());
return new Result<CarbonPubProductionModelDTO>().ok(detail);
}
/**
* 上传产品工艺模型
* 参考{@link com.thing.carbon.pub.controller.CarbonPubProductionModelController#save}
*/
@PostMapping("upload")
public Result<Void> modelUpload(@RequestBody CarbonPubProductionModelDTO dto, HttpServletRequest request){
CarbonPubSupplierEntity supplier = (CarbonPubSupplierEntity)request.getAttribute(ApiConstant.SUPPLIER);
Long tenantCode = supplier.getCode();
CarbonPubProductionModelEntity oldModel = modelService.getByProductId(dto.getProductId(), tenantCode);
CarbonPubProductionModelEntity newModel =
ConvertUtils.sourceToTarget(dto, CarbonPubProductionModelEntity.class)
.setShowInCommunity(1);
if (Objects.isNull(oldModel)) {
newModel.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
modelService.syncModel(newModel, tenantCode);
modelService.save(newModel);
// 首次上传积分++
CarbonPubPointsRuleDTO pointsRule = ruleService.getFirst();
supplierService.plusPointOn(tenantCode, pointsRule.getModelSharedPoints());
// 积分记录
logsService.save(
new CarbonPubPointsLogsEntity()
.setPoints(pointsRule.getModelSharedPoints())
.setType(PointsConstant.SHARE_MODEL)
.setTenantCode(tenantCode)
.setCreateTime(System.currentTimeMillis()));
} else {
Long productId = productionVarietyService.getIdByCodeName(dto.getProductCode(), dto.getProductName(), tenantCode);
newModel.setTenantCode(tenantCode)
.setDeptId(tenantCode)
.setCompanyId(tenantCode)
.setId(oldModel.getId());
modelService.updateById(newModel);
productionVarietyService.updateWithJson(newModel.getProductJson(), productId, tenantCode);
bomService.saveOrUpdateWithJson(newModel.getMaterialJson(), productId);
processStepsService.saveOrUpdateWithJson(newModel.getProcessJson(), productId);
}
return new Result<>();
}
}

120
modules/carbon-public/src/main/java/com/thing/carbon/pub/api/ProductionResultApi.java

@ -1,120 +0,0 @@
package com.thing.carbon.pub.api;
import com.mybatisflex.core.query.QueryWrapper;
import com.thing.carbon.pub.constant.ApiConstant;
import com.thing.carbon.pub.constant.PointsConstant;
import com.thing.carbon.pub.dto.CarbonPubPointsRuleDTO;
import com.thing.carbon.pub.dto.CarbonPubProductionResultDTO;
import com.thing.carbon.pub.entity.CarbonPubPointsLogsEntity;
import com.thing.carbon.pub.entity.CarbonPubProductionResultEntity;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.CarbonPubPointsLogsService;
import com.thing.carbon.pub.service.CarbonPubPointsRuleService;
import com.thing.carbon.pub.service.CarbonPubProductionResultService;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.common.core.utils.ConvertUtils;
import com.thing.common.core.web.response.Result;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
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.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author siyang
* @date 2024/5/16 14:44
* @description 国网数据服务接口产品工艺模型
*/
@RestController
@RequestMapping("v2/carbon/pub/production/result")
@RequiredArgsConstructor
public class ProductionResultApi {
private final CarbonPubPointsRuleService ruleService;
private final CarbonPubPointsLogsService logsService;
private final CarbonPubSupplierService supplierService;
private final CarbonPubProductionResultService resultService;
/** 同步生产结果 */
@PostMapping("sync")
public Result<Void> syncProductResult(@RequestBody List<CarbonPubProductionResultDTO> dtoList, HttpServletRequest request) {
if (CollectionUtils.isEmpty(dtoList)) {
return new Result<>();
}
// 获取当前企业在国网侧系统中的租户编码
CarbonPubSupplierEntity supplier =
(CarbonPubSupplierEntity) request.getAttribute(ApiConstant.SUPPLIER);
Long tenantCode = supplier.getCode();
Set<Long> oriIds = dtoList.stream().map(CarbonPubProductionResultDTO::getOriId).collect(Collectors.toSet());
Set<Long> productIds = dtoList.stream().map(CarbonPubProductionResultDTO::getProductId).collect(Collectors.toSet());
// 基于产品id和原始记录id判断是否存在存在更新不存在插入
List<CarbonPubProductionResultEntity> oldList =
resultService.list(
QueryWrapper.create()
.in(CarbonPubProductionResultEntity::getOriId, oriIds)
.in(CarbonPubProductionResultEntity::getProductId, productIds)
.eq(CarbonPubProductionResultEntity::getTenantCode, tenantCode));
// 已存在的数据按原始记录id和产品id分组
Map<String, CarbonPubProductionResultEntity> uniqueTagMap =
oldList.stream()
.collect(
Collectors.toMap(
e -> e.getOriId() + "_" + e.getProductId(),
Function.identity()));
// 新上传的数据也按原始记录id和产品id分组true数据库中已存在 false数据库中不存在
dtoList.stream()
.collect(
Collectors.groupingBy(
e -> uniqueTagMap.containsKey(e.getOriId() + "_" + e.getProductId())))
.forEach((exist, groupList) -> {
List<CarbonPubProductionResultEntity> entities = ConvertUtils.sourceToTarget(groupList, CarbonPubProductionResultEntity.class);
entities.forEach(e -> e.setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode));
if(exist) {
List<CarbonPubProductionResultEntity> updateList =
entities.stream()
.map(
e -> {
CarbonPubProductionResultEntity oldOne = uniqueTagMap.get(e.getOriId() + "_" + e.getProductId());
CarbonPubProductionResultEntity newOne = ConvertUtils.sourceToTarget(e, CarbonPubProductionResultEntity.class);
newOne.setId(oldOne.getId()).setTenantCode(tenantCode).setDeptId(tenantCode).setCompanyId(tenantCode);
return newOne;
})
.toList();
resultService.updateBatch(updateList);
} else {
resultService.saveBatch(entities);
CarbonPubProductionResultEntity first = entities.get(0);
// 积分++
CarbonPubPointsRuleDTO pointsRule = ruleService.getFirst();
boolean shareResult = Objects.equals(first.getResultType(), "1");
supplierService.plusPointOn(
tenantCode,
shareResult
? pointsRule.getResultSharedPoints() * entities.size()
: pointsRule.getProcessSharedPoints() * entities.size());
// 积分记录
logsService.save(
new CarbonPubPointsLogsEntity()
.setPoints(shareResult ? pointsRule.getResultSharedPoints() : pointsRule.getProcessSharedPoints())
.setType(shareResult ? PointsConstant.SHARE_RESULT : PointsConstant.SHARE_PROCESS)
.setTenantCode(tenantCode)
.setCreateTime(System.currentTimeMillis()));
}
});
return new Result<>();
}
}

12
modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/ApiConstant.java

@ -1,12 +0,0 @@
package com.thing.carbon.pub.constant;
/**
* @author siyang
* @date 2024/5/21 15:29
*/
public interface ApiConstant {
String ACCESS_TOKEN = "accessToken";
String TIMESTAMP = "timestamp";
String SIGN = "sign";
String SUPPLIER = "supplier";
}

11
modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/CarbonFactorConstant.java

@ -1,11 +0,0 @@
package com.thing.carbon.pub.constant;
/**
* @author siyang
* @date 2024/7/22 09:15
* @description 碳排因子常量
*/
public interface CarbonFactorConstant {
Boolean CHANGE_SOURCE_NAME = false;
String SOURCE_NAME = "碳排因子库";
}

15
modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/PointsConstant.java

@ -1,15 +0,0 @@
package com.thing.carbon.pub.constant;
/**
* @author siyang
* @date 2024/6/17 17:25
* @description
*/
public interface PointsConstant {
String SHARE_MODEL = "模型共享";
String MODEL_CLICK = "模型点击";
String SHARE_RESULT = "结果数据共享";
String SHARE_PROCESS = "过程数据共享";
String CERTIFICATE = "碳足迹认证";
String FACTOR_USE = "消费碳足迹因子";
}

12
modules/carbon-public/src/main/java/com/thing/carbon/pub/constant/ReportSourceTypeConstant.java

@ -1,12 +0,0 @@
package com.thing.carbon.pub.constant;
/**
* @author siyang
* @date 2024/7/10 15:52
* @description
*/
public interface ReportSourceTypeConstant {
String FILL_IN = "填报";
String COLLECT = "实采";
String CERTIFICATE_UPLOAD = "证书上传";
}

88
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubCertificateController.java

@ -1,88 +0,0 @@
package com.thing.carbon.pub.controller;//package com.thing.carbon.pub.controller;
//
//import com.thing.common.core.annotation.LogOperation;
//import com.thing.common.core.constants.Constant;
//import com.thing.common.core.validator.AssertUtils;
//import com.thing.common.core.validator.ValidatorUtils;
//import com.thing.common.core.validator.group.DefaultGroup;
//import com.thing.common.core.validator.group.UpdateGroup;
//import com.thing.common.core.web.response.PageData;
//import com.thing.common.core.web.response.Result;
//import com.thing.carbon.pub.dto.CarbonPubCertificateDTO;
//import com.thing.carbon.pub.service.CarbonPubCertificateService;
//
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.Parameters;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import lombok.RequiredArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//import java.util.Map;
//
///**
//* 碳足迹证书
//*
//* @author sys dev@lrd.com
//* @since 5.1 2024-05-23
//*/
//@RestController
//@RequestMapping("v2/carbon/internal/certificate")
//@Tag(name="碳足迹证书-国网侧")
//@RequiredArgsConstructor
//public class CarbonPubCertificateController {
//
// private final CarbonPubCertificateService carbonPubCertificateService;
//
// @GetMapping("page")
// @Operation(summary="分页")
// @Parameters({
// @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
// @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
// @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
// @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
// @Parameter(name = "productName", description = "产品名称"),
// @Parameter(name = "certificationOrg", description = "认证机构"),
// })
// public Result<PageData<CarbonPubCertificateDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
// PageData<CarbonPubCertificateDTO> page = carbonPubCertificateService.handlePage(params);
// return new Result<PageData<CarbonPubCertificateDTO>>().ok(page);
// }
//
// @GetMapping("{id}")
// @Operation(summary="信息")
// public Result<CarbonPubCertificateDTO> get(@PathVariable("id") Long id){
// CarbonPubCertificateDTO data = carbonPubCertificateService.handleDetail(id);
// return new Result<CarbonPubCertificateDTO>().ok(data);
// }
//
// @PostMapping
// @Operation(summary="保存")
// @LogOperation("保存")
// public Result<Void> save(@RequestBody CarbonPubCertificateDTO productionCertificate){
// carbonPubCertificateService.handleSave(productionCertificate);
// return new Result<>();
// }
//
// @PutMapping
// @Operation(summary="修改")
// @LogOperation("修改")
// public Result<Void> update(@RequestBody CarbonPubCertificateDTO dto){
// //效验数据
// ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
// carbonPubCertificateService.handleUpdate(dto);
// return new Result<>();
// }
//
// @DeleteMapping
// @Operation(summary="删除")
// @LogOperation("删除")
// public Result<Void> delete(@RequestBody Long[] ids){
// //效验数据
// AssertUtils.isArrayEmpty(ids, "id");
// carbonPubCertificateService.handleDelete(List.of(ids));
// return new Result<>();
// }
//
//}

105
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubEngEffController.java

@ -1,105 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubEngEffDTO;
import com.thing.carbon.pub.service.CarbonPubEngEffService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 设备能效标准
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-06-11
*/
@RestController
@RequestMapping("v2/carbon/internal/eng/eff")
@Tag(name="设备能效标准")
@RequiredArgsConstructor
public class CarbonPubEngEffController {
private final CarbonPubEngEffService carbonPubEngEffService;
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "keywords", description = "搜索关键字"),
@Parameter(name = "productType", description = "产品类别"),
@Parameter(name = "productName", description = "产品名称"),
})
public Result<PageData<CarbonPubEngEffDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubEngEffDTO> page = carbonPubEngEffService.getPageData(params, CarbonPubEngEffDTO.class);
return new Result<PageData<CarbonPubEngEffDTO>>().ok(page);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<CarbonPubEngEffDTO> get(@PathVariable("id") Long id){
CarbonPubEngEffDTO data = carbonPubEngEffService.getByIdAs(id, CarbonPubEngEffDTO.class);
return new Result<CarbonPubEngEffDTO>().ok(data);
}
@GetMapping("history/records")
@Operation(summary="各字段历史记录")
@Parameters({
@Parameter(name = "field", description = "product_type(产品类别), product_name(产品名称), eff_kpi(能效指标); unit(单位); top_category(一级分类); sub_category(二级分类); category_info(分类详情)", required = true) ,
@Parameter(name = "productType", description = "产品类型") ,
})
public Result<List<String>> targetFieldHistoryRecords(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
String field = MapUtils.getString(params, "field");
String productType = MapUtils.getString(params, "productType");
List<String> list = carbonPubEngEffService.getTargetFieldHistoryRecords(field, productType);
return new Result<List<String>>().ok(list);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubEngEffDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubEngEffService.saveDto(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubEngEffDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubEngEffService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubEngEffService.batchDelete(ids);
return new Result<>();
}
}

65
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubFootprintLibController.java

@ -1,65 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubFootprintInfo;
import com.thing.carbon.pub.service.CarbonPubFootprintLibService;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
import java.util.Set;
/**
* @author siyang
* @date 2024/5/27 10:26
* @description 产品碳足迹库控制器
*/
@RestController
@RequestMapping("v2/carbon/internal/footprint/lib")
@Tag(name = "产品碳足迹库")
@RequiredArgsConstructor
public class CarbonPubFootprintLibController {
private final CarbonPubFootprintLibService carbonPubFootprintLibService;
@GetMapping("industry/types")
@Operation(summary = "行业大类列表")
public Result<Set<String>> industryTypes() {
Set<String> types = carbonPubFootprintLibService.getIndustryTypes();
return new Result<Set<String>>().ok(types);
}
@GetMapping("industry/categories")
@Operation(summary = "行业子类列表")
@Parameters({@Parameter(name = "industryType", description = "行业分类")})
public Result<Set<String>> industryCategories(@Parameter(hidden = true) @RequestParam Map<String, Object> params) {
Set<String> types = carbonPubFootprintLibService.getIndustryCategories(params);
return new Result<Set<String>>().ok(types);
}
@GetMapping("page")
@Operation(summary = "分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true),
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true),
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段"),
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "keywords", description = "关键词"),
@Parameter(name = "industryType", description = "行业一级分类"),
@Parameter(name = "industryCategory", description = "行业二级分类"),
@Parameter(name = "sourceType", description = "碳足迹数据源:填报、实采、证书上传"),
})
public Result<PageData<CarbonPubFootprintInfo>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params) {
PageData<CarbonPubFootprintInfo> page = carbonPubFootprintLibService.handlePage(params);
return new Result<PageData<CarbonPubFootprintInfo>>().ok(page);
}
}

107
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubMaterialFactorController.java

@ -1,107 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubMaterialFactorDTO;
import com.thing.carbon.pub.service.CarbonPubMaterialFactorService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import com.thing.sys.security.context.UserContext;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Set;
/**
* 碳排因子库
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-11
*/
@RestController
@RequestMapping("v2/carbon/internal/material/factor")
@Tag(name="碳排因子库")
@RequiredArgsConstructor
public class CarbonPubMaterialFactorController {
private final CarbonPubMaterialFactorService carbonPubMaterialFactorService;
@GetMapping("history/records")
@Operation(summary="各字段历史记录")
@Parameters({
@Parameter(name = "field", description = "source_name(数据源); geo_full_cn(地区); industry_cn(行业类型)", required = true) ,
})
public Result<Set<String>> targetFieldHistoryRecords(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
String field = MapUtils.getString(params, "field");
Set<String> list = carbonPubMaterialFactorService.targetFieldHistoryRecords(field);
return new Result<Set<String>>().ok(list);
}
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "productName", description = "产品名称,支持中英文模糊搜索"),
@Parameter(name = "year", description = "年份"),
@Parameter(name = "sourceName", description = "数据源名称"),
@Parameter(name = "geoFullCn", description = "地理位置"),
@Parameter(name = "industryCn", description = "行业"),
})
public Result<PageData<CarbonPubMaterialFactorDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
params.putIfAbsent("orderField", "hot_score");
PageData<CarbonPubMaterialFactorDTO> page = carbonPubMaterialFactorService.handlePage(params);
return new Result<PageData<CarbonPubMaterialFactorDTO>>().ok(page);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<CarbonPubMaterialFactorDTO> get(@PathVariable("id") String id){
Long tenantCode = UserContext.getRealTenantCode();
CarbonPubMaterialFactorDTO data = carbonPubMaterialFactorService.handleDetail(id, tenantCode);
return new Result<CarbonPubMaterialFactorDTO>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubMaterialFactorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubMaterialFactorService.saveDto(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubMaterialFactorDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubMaterialFactorService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubMaterialFactorService.batchDelete(ids);
return new Result<>();
}
}

88
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubPointsLogsController.java

@ -1,88 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubPointsLogsDTO;
import com.thing.carbon.pub.service.CarbonPubPointsLogsService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 积分增减记录
*
* @author xc
* @since 3.0 2024-06-17
*/
@RestController
@RequestMapping("v2/carbon/internal/points/log")
@Tag(name="积分增减记录")
@RequiredArgsConstructor
public class CarbonPubPointsLogsController {
private final CarbonPubPointsLogsService carbonPubPointsLogsService;
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "tenantCode", description = "企业编码", required = true)
})
public Result<PageData<CarbonPubPointsLogsDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubPointsLogsDTO> page = carbonPubPointsLogsService.getPageData(params, CarbonPubPointsLogsDTO.class);
return new Result<PageData<CarbonPubPointsLogsDTO>>().ok(page);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<CarbonPubPointsLogsDTO> get(@PathVariable("id") Long id){
CarbonPubPointsLogsDTO data = carbonPubPointsLogsService.getByIdAs(id, CarbonPubPointsLogsDTO.class);
return new Result<CarbonPubPointsLogsDTO>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubPointsLogsDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubPointsLogsService.saveDto(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubPointsLogsDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubPointsLogsService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubPointsLogsService.batchDelete(ids);
return new Result<>();
}
}

68
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubPointsRuleController.java

@ -1,68 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubPointsRuleDTO;
import com.thing.carbon.pub.service.CarbonPubPointsRuleService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
/**
* 碳足迹积分规则, 只有一条
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@RestController
@RequestMapping("v2/carbon/internal/points/rule")
@Tag(name="碳足迹积分规则")
@RequiredArgsConstructor
public class CarbonPubPointsRuleController {
private final CarbonPubPointsRuleService carbonPubPointsRuleService;
@GetMapping
@Operation(summary="信息")
public Result<CarbonPubPointsRuleDTO> get(){
CarbonPubPointsRuleDTO rule = carbonPubPointsRuleService.getFirst();
return new Result<CarbonPubPointsRuleDTO>().ok(rule);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubPointsRuleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubPointsRuleService.saveDto(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubPointsRuleDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubPointsRuleService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubPointsRuleService.batchDelete(ids);
return new Result<>();
}
}

171
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionModelController.java

@ -1,171 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubProductionIdName;
import com.thing.carbon.pub.dto.CarbonPubProductionModelDTO;
import com.thing.carbon.pub.entity.CarbonPubProductionModelEntity;
import com.thing.carbon.pub.service.CarbonPubProductionModelService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.exception.SysException;
import com.thing.common.core.utils.ConvertUtils;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import com.thing.sys.security.context.UserContext;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 产品详情
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@RestController
@RequestMapping("v2/carbon/internal/production/model")
@Tag(name="产品工艺模型-国网侧")
@RequiredArgsConstructor
public class CarbonPubProductionModelController {
private final CarbonPubProductionModelService carbonPubProductionModelService;
@GetMapping("industry/types")
@Operation(summary="行业一级分类列表")
public Result<List<String>> industryTypes(){
List<String> types = carbonPubProductionModelService.getIndustryTypes();
return new Result<List<String>>().ok(types);
}
@GetMapping("industry/categories")
@Operation(summary="行业二级分类列表")
@Parameters({
@Parameter(name = "industryTpe", description = "行业一级分类")
})
public Result<List<String>> types(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
List<String> types = carbonPubProductionModelService.getIndustryCategories(params);
return new Result<List<String>>().ok(types);
}
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "keywords", description = "关键词"),
@Parameter(name = "industryType", description = "一级行业分类"),
@Parameter(name = "industryCategory", description = "二级行业分类"),
})
public Result<PageData<CarbonPubProductionModelDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
params.putIfAbsent("orderField", "create_date");
params.put("showInCommunity", 1);
PageData<CarbonPubProductionModelDTO> page = carbonPubProductionModelService.getSimplePageData(params);
return new Result<PageData<CarbonPubProductionModelDTO>>().ok(page);
}
@GetMapping("page/mine")
@Operation(summary="我的分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "industryCategory", description = "行业分类"),
@Parameter(name = "productType", description = "产品类型")
})
public Result<PageData<CarbonPubProductionModelDTO>> myPage(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
params.putIfAbsent("orderField", "create_date");
Boolean isAdmin = UserContext.isAdmin();
if(!isAdmin){
params.put("tenantCode", UserContext.getTenantCode());
}
PageData<CarbonPubProductionModelDTO> page = carbonPubProductionModelService.getSimplePageData(params);
return new Result<PageData<CarbonPubProductionModelDTO>>().ok(page);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<CarbonPubProductionModelDTO> get(@PathVariable("id") Long id){
Long tenantCode = UserContext.getTenantCode();
CarbonPubProductionModelEntity entity = carbonPubProductionModelService.getById(id);
CarbonPubProductionModelDTO data = carbonPubProductionModelService.handleDetail(entity, tenantCode);
return new Result<CarbonPubProductionModelDTO>().ok(data);
}
@GetMapping("simple/list")
@Operation(summary="简要信息")
public Result<List<CarbonPubProductionIdName>> simpleList(){
Long tenantCode = UserContext.getRealTenantCode();
List<CarbonPubProductionIdName> data = carbonPubProductionModelService.getSimpleList(tenantCode);
return new Result<List<CarbonPubProductionIdName>>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubProductionModelDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
CarbonPubProductionModelEntity entity = ConvertUtils.sourceToTarget(dto, CarbonPubProductionModelEntity.class);
entity.setShowInCommunity(0);
carbonPubProductionModelService.save(entity);
return new Result<>();
}
@PostMapping("download")
@Operation(summary="下载(添加到我的收藏)")
@LogOperation("下载(添加到我的收藏)")
public Result<Void> download(@RequestBody CarbonPubProductionModelDTO dto){
if(Objects.isNull(dto.getId())){
throw new SysException("下载错误,请稍后重试");
}
carbonPubProductionModelService.download(dto.getId());
return new Result<>();
}
@PostMapping("copy")
@Operation(summary="复制")
@LogOperation("复制")
public Result<Void> copy(@RequestBody CarbonPubProductionModelDTO dto){
if(Objects.isNull(dto.getId())){
throw new SysException("无法复制");
}
carbonPubProductionModelService.copy(dto.getId());
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubProductionModelDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubProductionModelService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubProductionModelService.batchDelete(ids);
return new Result<>();
}
}

124
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionReportConfigController.java

@ -1,124 +0,0 @@
package com.thing.carbon.pub.controller;
import com.mybatisflex.core.query.QueryWrapper;
import com.thing.carbon.pub.dto.CarbonPubProductionReportConfigDTO;
import com.thing.carbon.pub.entity.CarbonPubProductionReportConfigEntity;
import com.thing.carbon.pub.service.CarbonPubProductionReportConfigService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.exception.SysException;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import com.thing.sys.security.context.UserContext;
import com.thing.sys.tenant.entity.SysTenantDetailEntity;
import com.thing.sys.tenant.service.SysTenantDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.Objects;
/**
* 碳足迹报告配置
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-27
*/
@RestController
@RequestMapping("v2/carbon/internal/production/report/config")
@Tag(name="碳足迹报告配置【公共服务侧】")
@RequiredArgsConstructor
public class CarbonPubProductionReportConfigController {
private final CarbonPubProductionReportConfigService carbonPubProductionReportConfigService;
private final SysTenantDetailService sysTenantDetailService;
@Value("${carbon.pub.tenantTag}")
private String pubTenantTag;
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
})
public Result<PageData<CarbonPubProductionReportConfigDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubProductionReportConfigDTO> page = carbonPubProductionReportConfigService.getPageData(params, CarbonPubProductionReportConfigDTO.class);
return new Result<PageData<CarbonPubProductionReportConfigDTO>>().ok(page);
}
@GetMapping("detail")
@Operation(summary="详情")
@Parameters({
@Parameter(name = "id", description = "id") ,
@Parameter(name = "productId", description = "产品id,与tenantCode同时使用") ,
@Parameter(name = "boundaryType", description = "数据边界类型:1-自然月;2-自然年;3-自定义"),
@Parameter(name = "tenantCode", description = "租户编码,与productId同时使用")
})
public Result<CarbonPubProductionReportConfigDTO> detail(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
Long id = MapUtils.getLong(params, "id");
if(Objects.nonNull(id)){
CarbonPubProductionReportConfigDTO data = carbonPubProductionReportConfigService.getByIdAs(id, CarbonPubProductionReportConfigDTO.class);
return new Result<CarbonPubProductionReportConfigDTO>().ok(data);
}
Long productId = MapUtils.getLong(params, "productId");
Integer boundaryType = MapUtils.getInteger(params, "boundaryType");
Long tenantCode = MapUtils.getLong(params, "tenantCode");
CarbonPubProductionReportConfigDTO data =
carbonPubProductionReportConfigService.getOneAs(
QueryWrapper.create()
.eq(CarbonPubProductionReportConfigEntity::getProductId, productId)
.eq(CarbonPubProductionReportConfigEntity::getTenantCode, tenantCode)
.eq(CarbonPubProductionReportConfigEntity::getBoundaryType, boundaryType, Objects::nonNull),
CarbonPubProductionReportConfigDTO.class);
return new Result<CarbonPubProductionReportConfigDTO>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubProductionReportConfigDTO dto){
checkTenantCode(dto.getTenantCode());
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubProductionReportConfigService.handleSave(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubProductionReportConfigDTO dto){
checkTenantCode(dto.getTenantCode());
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubProductionReportConfigService.updateDto(dto);
return new Result<>();
}
private void checkTenantCode(Long tenantCode) {
Boolean admin = UserContext.isAdmin();
Long currentTenantCode = UserContext.getRealTenantCode();
SysTenantDetailEntity tenant = sysTenantDetailService.getById(currentTenantCode);
// 不是管理员也不是公共服务侧租户那就只能修改自己的内容
if (!admin || !tenant.getName().contains(pubTenantTag)) {
if (!Objects.equals(tenantCode, currentTenantCode)) {
throw new SysException("权限不足");
}
}
}
}

134
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionReportController.java

@ -1,134 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubProductionReportConfigDTO;
import com.thing.carbon.pub.dto.CarbonPubProductionReportDTO;
import com.thing.carbon.pub.service.CarbonPubProductionReportService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 产品碳足迹报告
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@RestController
@RequestMapping("v2/carbon/internal/production/report")
@Tag(name="产品碳足迹报告【公共服务侧】")
@RequiredArgsConstructor
public class CarbonPubProductionReportController {
private final CarbonPubProductionReportService carbonPubProductionReportService;
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "productIds", description = "产品id列表,按逗号分隔"),
@Parameter(name = "start", description = "报告日期范围开始: yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "end", description = "报告日期范围结束: yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "tenantCode", description = "租户编码"),
})
public Result<PageData<CarbonPubProductionReportDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubProductionReportDTO> page = carbonPubProductionReportService.getPageData(params, CarbonPubProductionReportDTO.class);
return new Result<PageData<CarbonPubProductionReportDTO>>().ok(page);
}
@GetMapping("list")
@Operation(summary="列表")
@Parameters({
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "productIds", description = "产品id列表,按逗号分隔"),
@Parameter(name = "start", description = "报告日期范围开始: yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "end", description = "报告日期范围结束: yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "tenantCode", description = "租户编码"),
})
public Result<List<CarbonPubProductionReportDTO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
Long tenantCode = MapUtils.getLong(params, "tenantCodes");
if (Objects.isNull(tenantCode)) {
return new Result<List<CarbonPubProductionReportDTO>>().ok(List.of());
}
List<CarbonPubProductionReportDTO> list = carbonPubProductionReportService.listAs(params, CarbonPubProductionReportDTO.class);
return new Result<List<CarbonPubProductionReportDTO>>().ok(list);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<CarbonPubProductionReportDTO> get(@PathVariable("id") Long id){
Map<String, Object> params = new HashMap<>(1);
params.put("id", id);
List<CarbonPubProductionReportDTO> reports = carbonPubProductionReportService.listAs(params, CarbonPubProductionReportDTO.class);
CarbonPubProductionReportDTO data = reports.get(0);
data.refreshCarbon();
return new Result<CarbonPubProductionReportDTO>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubProductionReportDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
carbonPubProductionReportService.handleSave(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubProductionReportDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubProductionReportService.handleUpdate(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubProductionReportService.batchDelete(ids);
return new Result<>();
}
@PostMapping("generate/view")
@Operation(summary="生成报告预览")
@LogOperation("生成报告预览")
public Result<CarbonPubProductionReportDTO> generateReport(@RequestBody CarbonPubProductionReportConfigDTO config){
CarbonPubProductionReportDTO data = carbonPubProductionReportService.generateReport(config);
String reportCode =
carbonPubProductionReportService.generateReportCode(
null, data.getBoundaryStart(), data.getBoundaryEnd());
data.setReportCode(reportCode);
return new Result<CarbonPubProductionReportDTO>().ok(data);
}
}

174
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubProductionResultController.java

@ -1,174 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.*;
import com.thing.carbon.pub.service.CarbonPubProductionResultService;
import com.thing.common.core.enumeration.CarbonLifecycleEnum;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
* 生产记录核算结果
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@RestController
@RequestMapping("v2/carbon/internal/production/result")
@Tag(name="生产记录核算结果-国网侧")
@RequiredArgsConstructor
public class CarbonPubProductionResultController {
private final CarbonPubProductionResultService carbonPubProductionResultService;
@GetMapping("simple/result")
@Operation(summary="批次产品碳足迹-简单汇总")
@Parameters({
@Parameter(name = "productIds", description = "产品Id列表,按逗号分隔", required = true),
@Parameter(name = "start", description = "开始时间:yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "end", description = "结束时间: yyyy-MM-dd HH:mm:ss"),
@Parameter(name = "boundary", description = "核算边界:1-摇篮到大门,2-摇篮到坟墓"),
@Parameter(name = "resultType", description = "结果类型:1-结果数据 2-过程数据"),
@Parameter(name = "tenantCodes", description = "租户编码"),
})
public Result<List<CarbonPubLibRecordSimpleAgg>> getSimpleAggResult(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
String tenantCodes = MapUtils.getString(params, "tenantCodes");
if (StringUtils.isBlank(tenantCodes)) {
return new Result<List<CarbonPubLibRecordSimpleAgg>>().ok(Collections.emptyList());
}
List<Long> tenantCodeList =
Arrays.stream(tenantCodes.split(",")).map(s -> Long.parseLong(s.trim())).toList();
String productIdStr = MapUtils.getString(params, "productIds");
if (StringUtils.isBlank(productIdStr)) {
return new Result<List<CarbonPubLibRecordSimpleAgg>>().ok(Collections.emptyList());
}
String[] productIdArr = productIdStr.split(",");
List<Long> productIds = new ArrayList<>();
for (String s : productIdArr) {
productIds.add(Long.parseLong(s.trim()));
}
String start = MapUtils.getString(params, "start");
String end = MapUtils.getString(params, "end");
String boundary = MapUtils.getString(params, "boundary");
String resultType = MapUtils.getString(params, "resultType");
List<CarbonPubLibRecordSimpleAgg> res =
carbonPubProductionResultService.getSimpleAggResult(
productIds, start, end, boundary, resultType, tenantCodeList);
return new Result<List<CarbonPubLibRecordSimpleAgg>>().ok(res);
}
@GetMapping("single/lot/detail")
@Operation(summary="批次产品碳足迹-单批次各生命周期数据")
@Parameters({
@Parameter(name = "productId", description = "产品Id", required = true),
@Parameter(name = "prCode", description = "生产编号", required = true),
@Parameter(name = "dataType", description = "展示数据类型:0-基础信息, 1-原材料采购与运输, 2-生产制造, 3-产品运输, 4-产品使用, 5-废弃处理"),
@Parameter(name = "tenantCode", description = "租户编码", required = true),
})
public Result<Object> getSingleLotDetail(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
Long productId = MapUtils.getLong(params, "productId");
String prCode = MapUtils.getString(params, "prCode");
Integer dataType = Optional.ofNullable(MapUtils.getInteger(params, "dataType")).orElse(0);
Long tenantCode = MapUtils.getLong(params, "tenantCode");
if (Objects.isNull(productId) || Objects.isNull(prCode) || Objects.isNull(tenantCode)) {
throw new IllegalArgumentException("缺少参数");
}
if (Objects.equals(dataType, 0)) {
CarbonPubLibRecordBaseInfo res = carbonPubProductionResultService.getDetailOfBaseInfo(productId, prCode, tenantCode);
return new Result<>().ok(res);
}
CarbonLifecycleEnum carbonLifecycle = CarbonLifecycleEnum.match(dataType);
switch (carbonLifecycle) {
case MATERIAL_PURCHASE_TRANSPORT -> {
CarbonPubLibRecordMPT res = carbonPubProductionResultService.getDetailOfMPT(productId, prCode, null, null, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_MANUFACTURE -> {
CarbonPubLibRecordPM res = carbonPubProductionResultService.getDetailOfPM(productId, prCode, null, null, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_TRANSPORT -> {
CarbonPubLibRecordPT res = carbonPubProductionResultService.getDetailOfPT(productId, prCode, null, null, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_USAGE -> {
CarbonPubLibRecordPU res = carbonPubProductionResultService.getDetailOfPU(productId, prCode, null, null, tenantCode);
return new Result<>().ok(res);
}
case DISPOSE -> {
CarbonPubLibRecordDispose res = carbonPubProductionResultService.getDetailOfDispose(productId, prCode, null, null, tenantCode);
return new Result<>().ok(res);
}
default -> {
return null;
}
}
}
@GetMapping("batch/lot/detail")
@Operation(summary="批次产品碳足迹-多批次各生命周期数据")
@Parameters({
@Parameter(name = "productId", description = "产品Id", required = true),
@Parameter(name = "start", description = "开始时间"),
@Parameter(name = "end", description = "结束时间"),
@Parameter(name = "dataType", description = "展示数据类型:0-基础信息, 1-原材料采购与运输, 2-生产制造, 3-产品运输, 4-产品使用, 5-废弃处理", required = true),
@Parameter(name = "tenantCode", description = "租户编码"),
})
public Result<Object> getBatchLotDetail(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
Long productId = MapUtils.getLong(params, "productId");
String start = MapUtils.getString(params, "start");
String end = MapUtils.getString(params, "end");
Integer dataType = Optional.ofNullable(MapUtils.getInteger(params, "dataType")).orElse(0);
Long tenantCode = MapUtils.getLong(params, "tenantCode");
if (Objects.isNull(productId) || Objects.isNull(tenantCode)) {
throw new IllegalArgumentException("缺少参数");
}
if (Objects.equals(dataType, 0)) {
CarbonPubLibRecordBaseInfoOnYear res = carbonPubProductionResultService.getDetailOfBaseInfoOnYear(productId, tenantCode);
return new Result<>().ok(res);
}
CarbonLifecycleEnum carbonLifecycle = CarbonLifecycleEnum.match(dataType);
switch (carbonLifecycle) {
case MATERIAL_PURCHASE_TRANSPORT -> {
CarbonPubLibRecordMPT res = carbonPubProductionResultService.getDetailOfMPT(productId, null, start, end, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_MANUFACTURE -> {
CarbonPubLibRecordPM res = carbonPubProductionResultService.getDetailOfPM(productId, null, start, end, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_TRANSPORT -> {
CarbonPubLibRecordPT res = carbonPubProductionResultService.getDetailOfPT(productId, null, start, end, tenantCode);
return new Result<>().ok(res);
}
case PRODUCT_USAGE -> {
CarbonPubLibRecordPU res = carbonPubProductionResultService.getDetailOfPU(productId, null, start, end, tenantCode);
return new Result<>().ok(res);
}
case DISPOSE -> {
CarbonPubLibRecordDispose res = carbonPubProductionResultService.getDetailOfDispose(productId, null, start, end, tenantCode);
return new Result<>().ok(res);
}
default -> {
return null;
}
}
}
}

130
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/CarbonPubSupplierController.java

@ -1,130 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubSupplierDTO;
import com.thing.carbon.pub.dto.CarbonPubSupplierDetail;
import com.thing.carbon.pub.dto.CarbonPubSupplierProduct;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import com.thing.sys.biz.dto.SysRegionDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
* 产品碳足迹供应商
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@RestController
@RequestMapping("v2/carbon/internal/supplier")
@Tag(name="产品碳足迹供应商")
@RequiredArgsConstructor
public class CarbonPubSupplierController {
private final CarbonPubSupplierService carbonPubSupplierService;
@GetMapping("region/list")
@Operation(summary="获取地区列表")
public Result<List<SysRegionDTO>> getRegionList(){
List<SysRegionDTO> list = carbonPubSupplierService.getRegionList();
return new Result<List<SysRegionDTO>>().ok(list);
}
@GetMapping("product/types")
@Operation(summary="获取产品列表")
public Result<Set<String>> getProductTypes(){
Set<String> list = carbonPubSupplierService.getProductTypes(null);
return new Result<Set<String>>().ok(list);
}
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "productType", description = "产品类型"),
@Parameter(name = "name", description = "供应商名称(模糊查询)"),
@Parameter(name = "regionId", description = "地区id"),
})
public Result<PageData<CarbonPubSupplierDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubSupplierDTO> page = carbonPubSupplierService.handlePage(params);
return new Result<PageData<CarbonPubSupplierDTO>>().ok(page);
}
@GetMapping("detail/summary")
@Operation(summary="汇总信息")
@Parameters({
@Parameter(name = "id", description = "供应商id", required = true),
})
public Result<CarbonPubSupplierDetail> detailSummary(@RequestParam Map<String, Object> params){
CarbonPubSupplierDetail data = carbonPubSupplierService.handleDetailSummary(params);
return new Result<CarbonPubSupplierDetail>().ok(data);
}
@GetMapping("detail/product")
@Operation(summary="产品信息")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = "id", description = "供应商id", required = true),
})
public Result<PageData<CarbonPubSupplierProduct>> detailProduct(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubSupplierProduct> data = carbonPubSupplierService.handleDetailProduct(params);
return new Result<PageData<CarbonPubSupplierProduct>>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Void> save(@RequestBody CarbonPubSupplierDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
// 默认碳足迹积分
if (Objects.isNull(dto.getPoints())) {
dto.setPoints(100);
}
carbonPubSupplierService.saveDto(dto);
return new Result<>();
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody CarbonPubSupplierDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
carbonPubSupplierService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
carbonPubSupplierService.batchDelete(ids);
return new Result<>();
}
}

104
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/IotCarbonEnterpriseAuthController.java

@ -1,104 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.IotCarbonEnterpriseAuthDTO;
import com.thing.carbon.pub.service.IotCarbonEnterpriseAuthService;
import com.thing.common.core.annotation.LogOperation;
import com.thing.common.core.constants.Constant;
import com.thing.common.core.validator.AssertUtils;
import com.thing.common.core.validator.ValidatorUtils;
import com.thing.common.core.validator.group.AddGroup;
import com.thing.common.core.validator.group.DefaultGroup;
import com.thing.common.core.validator.group.UpdateGroup;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 企业注册
*
* @author xc
* @since 3.0 2024-07-09
*/
@RestController
@RequestMapping("v2/enterprisee/iotcarbonenterpriseauth")
@Tag(name="企业注册")
@RequiredArgsConstructor
public class IotCarbonEnterpriseAuthController {
private final IotCarbonEnterpriseAuthService iotCarbonEnterpriseAuthService;
@GetMapping("page")
@Operation(summary="分页")
@Parameters({
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)"),
@Parameter(name = "status", description = "状态"),
@Parameter(name = "tenantName", description = "企业名称")
})
public Result<PageData<IotCarbonEnterpriseAuthDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<IotCarbonEnterpriseAuthDTO> page = iotCarbonEnterpriseAuthService.getPageData(params, IotCarbonEnterpriseAuthDTO.class);
return new Result<PageData<IotCarbonEnterpriseAuthDTO>>().ok(page);
}
@GetMapping("{id}")
@Operation(summary="信息")
public Result<IotCarbonEnterpriseAuthDTO> get(@PathVariable("id") Long id){
IotCarbonEnterpriseAuthDTO data = iotCarbonEnterpriseAuthService.getByIdAs(id, IotCarbonEnterpriseAuthDTO.class);
return new Result<IotCarbonEnterpriseAuthDTO>().ok(data);
}
@PostMapping
@Operation(summary="保存")
@LogOperation("保存")
public Result<Object> save(@RequestBody IotCarbonEnterpriseAuthDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
dto.setUpdateTime(System.currentTimeMillis());
return iotCarbonEnterpriseAuthService.saveIotCarbonEnterpriseAuthDTO(dto);
}
@PutMapping
@Operation(summary="修改")
@LogOperation("修改")
public Result<Void> update(@RequestBody IotCarbonEnterpriseAuthDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
dto.setUpdateTime(System.currentTimeMillis());
iotCarbonEnterpriseAuthService.updateDto(dto);
return new Result<>();
}
@DeleteMapping
@Operation(summary="删除")
@LogOperation("删除")
public Result<Void> delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
iotCarbonEnterpriseAuthService.batchDelete(ids);
return new Result<>();
}
@PostMapping("examine")
@Operation(summary="审核")
public Result<Void> examine(@RequestBody IotCarbonEnterpriseAuthDTO dto){
dto.setUpdateTime(System.currentTimeMillis());
if(dto.getStatus().equals("2")){
//审核通过
iotCarbonEnterpriseAuthService.doSaveTenant(dto);
}else {
//审核不通过
iotCarbonEnterpriseAuthService.sendMsg(dto);
}
return new Result<>();
}
}

87
modules/carbon-public/src/main/java/com/thing/carbon/pub/controller/PubCockpitController.java

@ -1,87 +0,0 @@
package com.thing.carbon.pub.controller;
import com.thing.carbon.pub.dto.CarbonPubSupplierProduct;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import com.thing.carbon.pub.dto.CockpitStatisticsDto;
import com.thing.carbon.pub.dto.SupplierStatisticsDto;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.carbon.pub.service.PubCockpitService;
import com.thing.carbontrack.screen.dto.SimpleProductionCarbon;
import com.thing.common.core.web.response.PageData;
import com.thing.common.core.web.response.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 公共服务侧大屏看板
*
* @author xc
* @since 3.0 2024-07-09
*/
@RestController
@RequestMapping("v2/pub/cockpit")
@Tag(name="公共服务侧大屏看板")
@RequiredArgsConstructor
public class PubCockpitController {
@Autowired
private PubCockpitService pubCockpitService;
@Autowired
private CarbonPubSupplierService carbonPubSupplierService;
@GetMapping("list")
@Operation(summary="左上角和地图得企业列表")
public Result<List<CockpitEnterpriseInfo>> list(){
List<CockpitEnterpriseInfo> list = pubCockpitService.cockpitEnterpriseInfoList();
return new Result<List<CockpitEnterpriseInfo>>().ok(list);
}
@GetMapping("statistics")
@Operation(summary="中间六个统计")
public Result<CockpitStatisticsDto> statistics(){
CockpitStatisticsDto statisticsDto = pubCockpitService.statistics();
return new Result<CockpitStatisticsDto>().ok(statisticsDto);
}
@GetMapping("productList")
@Operation(summary="右上角。企业产品碳足迹列表")
@Parameters({
@Parameter(name = "id", description = "左侧列表选中得企业id", required = true),
})
public Result<PageData<CarbonPubSupplierProduct>> detailProduct(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
PageData<CarbonPubSupplierProduct> data = carbonPubSupplierService.handleDetailProduct(params);
return new Result<PageData<CarbonPubSupplierProduct>>().ok(data);
}
@GetMapping("supplierStatistics")
@Operation(summary="左下角,企业八个统计")
@Parameters({
@Parameter(name = "code", description = "左侧列表选中得企业code", required = true),
})
public Result<SupplierStatisticsDto> supplierStatistics(@Parameter(hidden = true) @RequestParam Map<String, Object> params){
SupplierStatisticsDto data = pubCockpitService.supplierStatistics(params);
return new Result<SupplierStatisticsDto>().ok(data);
}
@GetMapping("trend/{productId}")
@Operation(summary = "右下角,产品碳足迹趋势,传入右上角选中的产品id")
public Result<List<SimpleProductionCarbon>> getCarbonTrend(
@PathVariable("productId") Long productId) {
List<SimpleProductionCarbon> data = pubCockpitService.getCarbonTrend(productId);
return new Result<List<SimpleProductionCarbon>>().ok(data);
}
}

48
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubCertificateDTO.java

@ -1,48 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 碳足迹证书
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-23
*/
@Data
@Schema(description = "碳足迹证书")
public class CarbonPubCertificateDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "数据主键id")
private Long id;
@Schema(description = "产品id")
private Long productId;
@Schema(description = "数据时间边界开始")
private Long boundaryStart;
@Schema(description = "数据时间边界截止")
private Long boundaryEnd;
@Schema(description = "认证机构")
private String certificationOrg;
@Schema(description = "核查标准")
private String verificationStd;
@Schema(description = "产品碳足迹值,单位kce")
private BigDecimal carbonVal;
@Schema(description = "生命周期各阶段占比json")
private String stagePercentJson;
@Schema(description = "证书url")
private String certificateUrl;
@Schema(description = "发证日期")
private Long certificateStart;
@Schema(description = "证书到期时间")
private Long certificateEnd;
@Schema(description = "产品信息json")
private String productJson;
}

49
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubEngEffDTO.java

@ -1,49 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 设备能效标准
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-06-11
*/
@Data
@Schema(description = "设备能效标准")
public class CarbonPubEngEffDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "数据主键id")
private Long id;
@Schema(description = "产品类别")
private String productType;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "能效指标")
private String effKpi;
@Schema(description = "单位")
private String unit;
@Schema(description = "一级分类")
private String topCategory;
@Schema(description = "二级分类")
private String subCategory;
@Schema(description = "分类详情")
private String categoryInfo;
@Schema(description = "先进水平")
private String advLevel;
@Schema(description = "节能水平")
private String engSavingLevel;
@Schema(description = "准入水平")
private String admissionLevel;
@Schema(description = "参考标准")
private String referenceStd;
@Schema(description = "设备图片")
private String deviceUrl;
@Schema(description = "设备备注")
private String remark;
}

58
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubFootprintInfo.java

@ -1,58 +0,0 @@
package com.thing.carbon.pub.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Objects;
/**
* @author siyang
* @date 2024/5/27 10:19
* @description 产品碳足迹基础信息
*/
@Data
@Schema(description = "碳足迹信息")
public class CarbonPubFootprintInfo {
@Schema(description = "报告id")
private String reportId;
@Schema(description = "企业名称")
private String companyName;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品型号")
private String productModel;
@Schema(description = "功能单位")
private String functionUnit;
@Schema(description = "碳足迹值")
private String totalCarbon;
@Schema(description = "数据边界类型:1-自然月;2-自然年;3-自定义")
private Integer boundaryType;
@Schema(description = "是否展示结果:0-不展示,1-展示")
private Integer showResult;
@Schema(description = "发布时间")
private Long createDate;
@Schema(description = "有效期截止日")
private Long validEndTime;
@JsonIgnore
private String productJson;
public void refreshCarbon() {
if (Objects.equals(showResult, 0)) {
setTotalCarbon(null);
}
}
}

54
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordBaseInfo.java

@ -1,54 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Map;
import java.util.Optional;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-基础信息
*/
@Data
@Schema(description = "产品碳足迹库-记录-基础信息")
public class CarbonPubLibRecordBaseInfo {
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品编号(料号)")
private String productCode;
@Schema(description = "工单编号")
private String prCode;
@Schema(description = "生产工时")
private Integer prDur;
@Schema(description = "完工时间")
private String finishTime;
@Schema(description = "批次产量")
private Integer num;
@Schema(description = "产品碳足迹总值")
private BigDecimal carbonTotal;
@Schema(description = "产品碳足迹各生命周期的值")
private Map<String, BigDecimal> carbonLifeCycleMap;
public Integer getPrDur() {
return Optional.ofNullable(prDur).orElse(0);
}
public Integer getNum() {
return Optional.ofNullable(num).orElse(0);
}
public BigDecimal getCarbonTotal() {
return Optional.ofNullable(carbonTotal).orElse(BigDecimal.ZERO);
}
}

71
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordBaseInfoOnYear.java

@ -1,71 +0,0 @@
package com.thing.carbon.pub.dto;
import com.thing.carbontrack.pub.dto.ProductJsonBean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Map;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-基础信息
*/
@Data
@Schema(description = "产品碳足迹库-记录-基础信息")
public class CarbonPubLibRecordBaseInfoOnYear {
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "所属行业")
private String industryType;
@Schema(description = "产品分类")
private String productType;
@Schema(description = "产品尺寸")
private String productionSize;
@Schema(description = "产品重量")
private BigDecimal productionWeight;
@Schema(description = "功能单位")
private String functionUnit;
private String productUrl;
@Schema(description = "核算边界:1.摇篮到大门,2摇篮到坟墓")
private String boundary;
@Schema(description = "今年平均产品碳足迹")
private Map<String, BigDecimal> carbonAvgMap;
@Schema(description = "今年最大产品碳足迹")
private Map<String, BigDecimal> carbonMaxMap;
@Schema(description = "今年最小产品碳足迹")
private Map<String, BigDecimal> carbonMinMap;
public static CarbonPubLibRecordBaseInfoOnYear init(ProductJsonBean production) {
CarbonPubLibRecordBaseInfoOnYear res = new CarbonPubLibRecordBaseInfoOnYear();
res.setProductName(production.getName());
res.setIndustryType(production.getIndustry());
res.setProductType(production.getIndustrySub());
res.setProductionSize(production.getPSize());
res.setProductionWeight(production.getPWeight());
res.setFunctionUnit(production.getFUnit());
res.setBoundary(production.getBoundary());
res.setProductUrl(production.getUrl());
return res;
}
public static CarbonPubLibRecordBaseInfoOnYear init(ProductJsonBean production, Long productId) {
CarbonPubLibRecordBaseInfoOnYear info = init(production);
info.setProductId(productId);
return info;
}
}

23
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordDispose.java

@ -1,23 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-废弃处理
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "产品碳足迹库-记录-废弃处理")
public class CarbonPubLibRecordDispose {
@Schema(description = "基础信息列表")
List<CarbonPubLibRecordR> baseInfoList;
}

22
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordMPT.java

@ -1,22 +0,0 @@
package com.thing.carbon.pub.dto;
import com.thing.carbontrack.productionResult.dto.MptDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-原材料获取与运输
*/
@Data
@Schema(description = "产品碳足迹库-记录-原材料获取与运输")
public class CarbonPubLibRecordMPT {
@Schema(description = "基础信息")
private List<CarbonPubLibRecordR> baseInfoList;
@Schema(description = "详情")
private List<MptDetail> details;
}

27
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPM.java

@ -1,27 +0,0 @@
package com.thing.carbon.pub.dto;
import com.thing.carbontrack.productionResult.dto.PIndirectDetail;
import com.thing.carbontrack.productionResult.dto.PmProcessDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-生产制造
*/
@Data
@Schema(description = "产品碳足迹库-记录-生产制造")
public class CarbonPubLibRecordPM {
@Schema(description = "基础信息列表")
private List<CarbonPubLibRecordR> baseInfoList;
@Schema(description = "生产消耗详情")
private List<PmProcessDetail> productDetails;
@Schema(description = "公摊消耗详情")
private List<PIndirectDetail> shareDetails;
}

19
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPT.java

@ -1,19 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-产品运输
*/
@Data
@Schema(description = "产品碳足迹库-记录-产品运输")
public class CarbonPubLibRecordPT {
@Schema(description = "基础信息列表")
List<CarbonPubLibRecordR> baseInfoList;
}

19
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordPU.java

@ -1,19 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author siyang
* @date 2024/5/29 15:08
* @description 产品碳足迹库-记录-产品使用
*/
@Data
@Schema(description = "产品碳足迹库-记录-产品使用")
public class CarbonPubLibRecordPU {
@Schema(description = "基础信息列表")
List<CarbonPubLibRecordR> baseInfoList;
}

199
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordR.java

@ -1,199 +0,0 @@
package com.thing.carbon.pub.dto;
import com.alibaba.fastjson.JSONArray;
import com.thing.carbon.pub.entity.CarbonPubProductionResultEntity;
import com.thing.common.core.utils.AggUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.Objects;
/**
* @author siyang
* @date 2024/6/5 14:51
* @description 产品碳足迹库-记录-生产核算结果
*/
@Data
@NoArgsConstructor
@SuppressWarnings("Duplicates")
@Schema(description = "产品碳足迹库-记录-生产核算结果")
public class CarbonPubLibRecordR {
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品编码")
private String productCode;
@Schema(description = "产品型号")
private String productModel;
@Schema(description = "产品重量")
private BigDecimal productWeight;
@Schema(description = "产品功能单位")
private String functionUnit;
@Schema(description = "产品重量单位")
private String weightUnit;
@Schema(description = "工单号")
private String prCode;
@Schema(description = "生产时长,单位:h")
private Integer prDur;
@Schema(description = "生产数量")
private Integer num;
@Schema(description = "成品(良品)数量")
private Integer finalNum;
@Schema(description = "开工时间: yyyy—MM-dd")
private String startTime;
@Schema(description = "完工时间: yyyy—MM-dd")
private String finishTime;
@Schema(description = "能源品种")
private String evName;
@Schema(description = "能源品种id|运输方式id")
private Long evId;
@Schema(description = "碳排类型")
private String carbonType;
@Schema(description = "碳排放 kgCO2e")
private BigDecimal carbon;
@Schema(description = "平均碳排放 kgCO2e")
private BigDecimal carbonAvg;
@Schema(description = "能耗,注:在carbonType=1时,该字段表示运输碳排")
private BigDecimal usage;
@Schema(description = "能耗平均用量,注:在carbonType=1时,该字段表示平均运输碳排")
private BigDecimal usageAvg;
@Schema(description = "目前仅用于产品运输页,用于标识合并时是否聚合数据(前端逻辑)")
private Long groupId;
@Schema(description = "使用年限")
private Integer life;
@Schema(description = "核算详情")
private JSONArray details;
/* ---------------------- 废弃运输 ---------------------- */
@Schema(description = "废弃运输类型id")
private Long fqEvId;
@Schema(description = "废弃运输类型名称")
private String fqEvName;
@Schema(description = "废弃运输里程")
private BigDecimal fqUsage;
@Schema(description = "废弃运输里程平均值")
private BigDecimal fqUsageAvg;
@Schema(description = "废弃运输碳排")
private BigDecimal fqCarbon;
@Schema(description = "废弃运输碳排平均值")
private BigDecimal fqCarbonAvg;
public CarbonPubLibRecordR(CarbonPubProductionResultEntity result) {
if (Objects.nonNull(result)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
this.productName = result.getProductName();
this.productCode = result.getProductCode();
this.productModel = result.getProductModel();
this.productWeight = result.getProductWeight();
this.functionUnit = result.getFunctionUnit();
this.weightUnit = result.getWeightUnit();
this.prCode = result.getPrCode();
this.prDur = result.getPrDur();
this.num = result.getNum();
this.finalNum = result.getFinalNum();
this.startTime = sdf.format(result.getStartTime());
this.finishTime = sdf.format(result.getFinishTime());
this.evId = result.getEvId();
this.evName = result.getEvName();
this.carbonType = result.getCarbonType();
this.carbon = result.getCarbon();
this.carbonAvg = result.getCarbonAvg();
this.usage = result.getUsage();
this.usageAvg = result.getUsageAvg();
this.groupId = result.getGroupId();
this.life = result.getLife();
this.fqEvId = result.getFqEvId();
this.fqEvName = result.getFqEvName();
this.fqUsage = result.getFqUsage();
this.fqUsageAvg = result.getFqUsageAvg();
this.fqCarbon = result.getFqCarbon();
this.fqCarbonAvg = result.getFqCarbonAvg();
if (StringUtils.isNotBlank(result.getJson())) {
this.details = JSONArray.parseArray(result.getJson());
}
}
}
public CarbonPubLibRecordR add(CarbonPubLibRecordR other){
if (!Objects.equals(getProductCode(), other.getProductCode())) {
return this;
}
setNum(AggUtil.sum(getNum(), other.getNum()));
setFinalNum(AggUtil.sum(getFinalNum(), other.getFinalNum()));
setPrDur(AggUtil.sum(getPrDur(), other.getPrDur()));
setCarbon(AggUtil.sum(getCarbon(), other.getCarbon()));
setUsage(AggUtil.sum(getUsage(), other.getUsage()));
setFqUsage(AggUtil.sum(getFqUsage(), other.getFqUsage()));
setFqCarbon(AggUtil.sum(getFqCarbon(), other.getFqCarbon()));
getDetails().addAll(other.getDetails());
return this;
}
public CarbonPubLibRecordR refreshAvg() {
refreshCarbonAvg();
refreshFqCarbonAvg();
refreshUsageAvg();
refreshFqUsageAvg();
return this;
}
public CarbonPubLibRecordR refreshCarbonAvg() {
setCarbonAvg(divide(getCarbon(), BigDecimal.valueOf(getFinalNum())));
return this;
}
public CarbonPubLibRecordR refreshUsageAvg() {
setUsageAvg(divide(getUsage(), BigDecimal.valueOf(getFinalNum())));
return this;
}
public void refreshFqCarbonAvg() {
setFqCarbonAvg(divide(getFqCarbon(), BigDecimal.valueOf(getFinalNum())));
}
public void refreshFqUsageAvg() {
setFqUsageAvg(divide(getFqUsage(), BigDecimal.valueOf(getFinalNum())));
}
public CarbonPubLibRecordR clearDetail() {
setDetails(null);
return this;
}
private static BigDecimal divide(BigDecimal value, BigDecimal count) {
if (Objects.isNull(value)) {
return null;
}
return value.divide(count, 2, RoundingMode.HALF_UP);
}
}

100
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubLibRecordSimpleAgg.java

@ -1,100 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author siyang
* @date 2024/6/5 14:51
* @description 产品碳足迹库-简单聚合结果
*/
@Data
@NoArgsConstructor
@Schema(description = "产品碳足迹库-简单聚合结果")
public class CarbonPubLibRecordSimpleAgg {
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品型号")
private String productModel;
@Schema(description = "产品功能单位")
private String functionUnit;
@Schema(description = "工单号")
private String prCode;
@Schema(description = "完工时间: yyyy-MM-dd HH:mm:ss")
private String finishTime;
@Schema(description = "生产数量")
private Integer num;
@Schema(description = "核算边界")
private String boundary;
@Schema(description = "数据类型")
private String resultType;
@Schema(description = "碳足迹值,kgCO2e")
private BigDecimal carbon;
public CarbonPubLibRecordSimpleAgg(List<CarbonPubProductionResultDTO> resultDTOList) {
CarbonPubProductionResultDTO resultDTO = resultDTOList.get(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
this.productId = resultDTO.getProductId();
this.productName = resultDTO.getProductName();
this.productModel = resultDTO.getProductModel();
this.functionUnit = resultDTO.getFunctionUnit();
this.prCode = resultDTO.getPrCode();
this.finishTime = sdf.format(resultDTO.getFinishTime());
this.num = resultDTO.getFinalNum();
this.boundary = resultDTO.getBoundary();
this.resultType = resultDTO.getResultType();
this.carbon = calculateCarbon(resultDTOList);
}
@SuppressWarnings("Duplicates")
private BigDecimal calculateCarbon(List<CarbonPubProductionResultDTO> resultDTOList) {
if(CollectionUtils.isEmpty(resultDTOList)){
return BigDecimal.ZERO;
}
Map<String, CarbonPubProductionResultDTO> carbonTypeMap =
resultDTOList.stream()
.collect(
Collectors.toMap(
CarbonPubProductionResultDTO::getCarbonType,
Function.identity(),
(v1, v2) -> v1));
CarbonPubProductionResultDTO resultOfType1 = Optional.ofNullable(carbonTypeMap.get("1")).orElse(new CarbonPubProductionResultDTO());
CarbonPubProductionResultDTO resultOfType2 = Optional.ofNullable(carbonTypeMap.get("2")).orElse(new CarbonPubProductionResultDTO());
CarbonPubProductionResultDTO resultOfType3 = Optional.ofNullable(carbonTypeMap.get("3")).orElse(new CarbonPubProductionResultDTO());
CarbonPubProductionResultDTO resultOfType4 = Optional.ofNullable(carbonTypeMap.get("4")).orElse(new CarbonPubProductionResultDTO());
CarbonPubProductionResultDTO resultOfType5 = Optional.ofNullable(carbonTypeMap.get("5")).orElse(new CarbonPubProductionResultDTO());
CarbonPubProductionResultDTO resultOfType6 = Optional.ofNullable(carbonTypeMap.get("6")).orElse(new CarbonPubProductionResultDTO());
return resultOfType1.getCarbonAvg()
.add(resultOfType1.getUsageAvg())
.add(resultOfType2.getCarbonAvg())
.add(resultOfType3.getCarbonAvg())
.add(resultOfType4.getCarbonAvg())
.add(resultOfType5.getCarbonAvg())
.add(resultOfType6.getCarbonAvg())
.add(resultOfType6.getFqCarbonAvg());
}
}

14
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorApiDTO.java

@ -1,14 +0,0 @@
package com.thing.carbon.pub.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/** 碳排因子库api接口返回对象 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CarbonPubMaterialFactorApiDTO extends CarbonPubMaterialFactorDTO {
@Serial private static final long serialVersionUID = 573873391021835356L;
private Integer points;
}

50
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorDTO.java

@ -1,50 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 碳排因子库
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-11
*/
@Data
@Schema(description = "碳排因子库")
public class CarbonPubMaterialFactorDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private String id;
@Schema(description = "地理位置简称")
private String geoShort;
@Schema(description = "地理位置全称")
private String geoFull;
@Schema(description = "地理位置全程(中文)")
private String geoFullCn;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品名称(中文)")
private String productNameCn;
@Schema(description = "产品单位")
private String productUnit;
@Schema(description = "碳排因子")
private BigDecimal factor;
@Schema(description = "参考单元")
private Integer refCount;
@Schema(description = "碳排因子库名称")
private String sourceName;
@Schema(description = "开始年份")
private String startYear;
@Schema(description = "截止年份")
private String endYear;
@Schema(description = "行业")
private String industry;
@Schema(description = "行业(中文)")
private String industryCn;
}

29
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubMaterialFactorUseDTO.java

@ -1,29 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 原材料碳排因子库使用记录
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-17
*/
@Data
@Schema(description = "原材料碳排因子库使用记录")
public class CarbonPubMaterialFactorUseDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
@Schema(description = "碳排因子库主键")
private String materialFactorId;
@Schema(description = "使用该因子的企业租户编码")
private Long tenantCode;
@Schema(description = "碳排因子下载时间")
private Long useTime;
}

32
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubPointsLogsDTO.java

@ -1,32 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 积分增减记录
*
* @author xc
* @since 3.0 2024-06-17
*/
@Data
@Schema(description = "积分增减记录")
public class CarbonPubPointsLogsDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "主键id")
private Long id;
@Schema(description = "类型,中文描述")
private String type;
@Schema(description = "增减积分值")
private Integer points;
@Schema(description = "供应商编码")
private Long tenantCode;
@Schema(description = "创建时间")
private Long createTime;
}

35
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubPointsRuleDTO.java

@ -1,35 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 碳足迹积分规则
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Schema(description = "碳足迹积分规则")
public class CarbonPubPointsRuleDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
@Schema(description = "模型共享积分")
private Integer modelSharedPoints;
@Schema(description = "模型点击积分")
private Integer modelClickPoints;
@Schema(description = "结果数据共享积分")
private Integer resultSharedPoints;
@Schema(description = "过程数据共享积分")
private Integer processSharedPoints;
@Schema(description = "碳足迹认证积分")
private Integer footprintCertifyPoints;
@Schema(description = "碳足迹因子首次使用消耗积分")
private Integer factorUsePoints;
}

19
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionIdName.java

@ -1,19 +0,0 @@
package com.thing.carbon.pub.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author siyang
* @date 2024/6/11 11:48
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CarbonPubProductionIdName {
private Long productId;
private String productName;
private Long tenantCode;
private String companyName;
}

56
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionModelDTO.java

@ -1,56 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 产品详情
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Schema(description = "产品详情")
public class CarbonPubProductionModelDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品编码")
private String productCode;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品型号")
private String productModel;
@Schema(description = "产品图片")
private String url;
@Schema(description = "功能单位")
private String functionUnit;
@Schema(description = "产品基本信息json")
private String productJson;
@Schema(description = "原料信息json")
private String materialJson;
@Schema(description = "产品工艺工序json")
private String processJson;
@Schema(description = "工序预览图url")
private String stepsUrl;
@Schema(description = "工序图的坐标json")
private String stepsJson;
@Schema(description = "行业一级分类,企业详情的industry_type")
private String industryType;
@Schema(description = "行业二级分类,企业详情的industry_category")
private String industryCategory;
@Schema(description = "产品类型")
private String productType;
@Schema(description = "下载次数")
private Integer downloadCount;
@Schema(description = "发布时间")
private Long createDate;
@Schema(description = "最后更新时间")
private Long updateDate;
}

36
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionReportConfigDTO.java

@ -1,36 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 碳足迹报告配置
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-27
*/
@Data
@Schema(description = "碳足迹报告配置")
public class CarbonPubProductionReportConfigDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "数据主键id")
private Long id;
@Schema(description = "企业租户编码")
private Long tenantCode;
@Schema(description = "产品id")
private Long productId;
@Schema(description = "数据边界类型:1-自然月;2-自然年;3-自定义")
private Integer boundaryType;
@Schema(description = "数据边界开始时间:只有自定义边界才有值")
private Long boundaryStart;
@Schema(description = "数据边界结束时间:只有自定义边界才有值")
private Long boundaryEnd;
@Schema(description = "是否展示结果")
private Integer showResult;
}

75
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionReportDTO.java

@ -1,75 +0,0 @@
package com.thing.carbon.pub.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.thing.common.core.utils.DateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
/**
* 产品碳足迹报告
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-28
*/
@Data
@Schema(description = "产品碳足迹报告")
public class CarbonPubProductionReportDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品模型")
private String productModel;
@Schema(description = "碳足报告配置id")
private Long configId;
@Schema(description = "功能单位")
private String functionUnit;
@Schema(description = "系统边界类型:1-摇篮到大门,2-摇篮到坟墓")
private String boundary;
@Schema(description = "数据边界类型:1-自然月;2-自然年;3-自定义")
private Integer boundaryType;
@Schema(description = "数据边界开始时间")
@JsonFormat(pattern = DateTimeUtils.DATE_TIME_PATTERN_STR)
private Date boundaryStart;
@Schema(description = "数据边界结束时间")
@JsonFormat(pattern = DateTimeUtils.DATE_TIME_PATTERN_STR)
private Date boundaryEnd;
@Schema(description = "碳足迹值")
private BigDecimal totalCarbon;
@Schema(description = "各阶段碳足迹占比")
private String stagePercentJson;
@Schema(description = "其他扩展数据")
private String extra;
@Schema(description = "发布时间")
private Long createDate;
@Schema(description = "报告有效期")
private Long validEndTime;
@Schema(description = "是否在碳足迹库展示结果:0-不展示,1-展示")
private Integer showResult;
@Schema(description = "企业名称")
private String companyName;
@Schema(description = "证书编号")
private String reportCode;
@Schema(description = "报告来源类型:填报、实采、证书上传")
private String sourceType;
@Schema(description = "企业编码")
private Long tenantCode;
public void refreshCarbon() {
if (Objects.equals(showResult, 0)) {
setTotalCarbon(null);
}
}
}

129
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionResultDTO.java

@ -1,129 +0,0 @@
package com.thing.carbon.pub.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Optional;
/**
* 生产记录核算结果
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Schema(description = "生产记录核算结果")
public class CarbonPubProductionResultDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "数据主键id")
private Long id;
@Schema(description = "原始数据id")
private Long oriId;
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品编码")
private String productCode;
@Schema(description = "产品型号")
private String productModel;
@Schema(description = "产品重量")
private BigDecimal productWeight;
@Schema(description = "功能单位")
private String functionUnit;
@Schema(description = "重量单位")
private String weightUnit;
@Schema(description = "生产记录编码")
private String prCode;
@Schema(description = "生产耗时,单位:h")
private Integer prDur;
@Schema(description = "生产数量")
private Integer num;
@Schema(description = "成品数量")
private Integer finalNum;
@Schema(description = "开工时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
@Schema(description = "完工时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date finishTime;
@Schema(description = "能源品种id")
private Long evId;
@Schema(description = "能源品种名称")
private String evName;
@Schema(description = "能耗总用量")
private BigDecimal usage;
@Schema(description = "能耗平均用量")
private BigDecimal usageAvg;
@Schema(description = "总能耗")
private BigDecimal tce;
@Schema(description = "总碳排")
private BigDecimal carbon;
@Schema(description = "平均碳排")
private BigDecimal carbonAvg;
@Schema(description = "碳排类型 1 原料 2 原料运输 3 产品生产 4 产品公摊/间接 5 产品运输 6 产品使用 7 产品废弃处理")
private String carbonType;
@Schema(description = "同步数据类型 1-结果数据 2-过程数据")
private String resultType;
@Schema(description = "系统边界: 1-摇篮到大门,2-摇篮到坟墓")
private String boundary;
@Schema(description = "详情json,一个类型,一个能源,形成一个详情json")
private String json;
@Schema(description = "产品运输的时候")
private Long groupId;
@Schema(description = "废弃运输里程")
private BigDecimal fqUsage;
@Schema(description = "废弃运输碳排")
private BigDecimal fqCarbon;
@Schema(description = "废弃运输里程平均值")
private BigDecimal fqUsageAvg;
@Schema(description = "废弃运输碳排平均值")
private BigDecimal fqCarbonAvg;
@Schema(description = "废弃运输类型id")
private Long fqEvId;
@Schema(description = "废弃运输类型名称")
private String fqEvName;
@Schema(description = "使用年限")
private Integer life;
@Schema(description = "数据来源类型: 1-实采, 2-填报")
private String sourceType;
public BigDecimal getCarbonAvg() {
return Optional.ofNullable(carbonAvg).orElse(BigDecimal.ZERO);
}
public BigDecimal getUsageAvg() {
return Optional.ofNullable(usageAvg).orElse(BigDecimal.ZERO);
}
public BigDecimal getFqCarbonAvg() {
return Optional.ofNullable(fqCarbonAvg).orElse(BigDecimal.ZERO);
}
public Integer getPrDur() {
return Optional.ofNullable(prDur).orElse(0);
}
public Integer getNum() {
return Optional.ofNullable(num).orElse(0);
}
public BigDecimal getCarbon() {
return Optional.ofNullable(carbon).orElse(BigDecimal.ZERO);
}
}

74
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubProductionResultReport.java

@ -1,74 +0,0 @@
package com.thing.carbon.pub.dto;
import lombok.Data;
import java.math.BigDecimal;
import static java.math.RoundingMode.HALF_UP;
/**
* @author siyang
* @date 2024/5/31 09:28
* @description 数据库查询结果从result表聚合出的report数据
*/
@Data
public class CarbonPubProductionResultReport {
/** 系统边界类型:1-摇篮到大门,2-摇篮到坟墓 */
private String boundary;
/** 碳足迹总值 */
private BigDecimal totalCarbon;
/** 碳足迹:原料获取阶段 */
private BigDecimal mptCarbon;
/** 碳足迹:生产制造阶段 */
private BigDecimal pmCarbon;
/** 碳足迹:产品运输阶段 */
private BigDecimal ptCarbon;
/** 碳足迹:产品使用阶段 */
private BigDecimal puCarbon;
/** 碳足迹:废弃处理阶段 */
private BigDecimal disposeCarbon;
/** 企业名称 */
private String companyName;
/** 数据源类型 */
private String sourceType;
public BigDecimal summingCarbon() {
BigDecimal totalCarbon =
mptCarbon.add(pmCarbon).add(ptCarbon).add(puCarbon).add(disposeCarbon);
setTotalCarbon(totalCarbon.setScale(4, HALF_UP));
return this.totalCarbon;
}
public BigDecimal calcMptPercent() {
return calcPercent(mptCarbon);
}
public BigDecimal calcPmPercent() {
return calcPercent(pmCarbon);
}
public BigDecimal calcPtPercent() {
return calcPercent(ptCarbon);
}
public BigDecimal calcPuPercent() {
return calcPercent(puCarbon);
}
public BigDecimal calcDisposePercent() {
return calcPercent(disposeCarbon);
}
private BigDecimal calcPercent(BigDecimal carbonVal) {
return carbonVal.divide(totalCarbon, 4, HALF_UP).multiply(BigDecimal.valueOf(100));
}
}

52
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierDTO.java

@ -1,52 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 产品碳足迹供应商
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Schema(description = "产品碳足迹供应商")
public class CarbonPubSupplierDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private Long id;
@Schema(description = "供应商名称")
private String name;
@Schema(description = "供应商编码(tenant_code)")
private Long code;
@Schema(description = "供应商令牌")
private String accessToken;
@Schema(description = "地区id(sys_region表id)")
private Long regionId;
@Schema(description = "产品分类,按逗号分隔")
private String productType;
@Schema(description = "剩余积分")
private Integer points;
@Schema(description = "碳足迹记录数量")
private Long recordsCount;
@Schema(description = "租户编码")
private Long tenantCode;
@Schema(description = "企业id")
private Long companyId;
@Schema(description = "部门id")
private Long deptId;
@Schema(description = "创建人")
private Long creator;
@Schema(description = "创建时间")
private Long createDate;
@Schema(description = "更新人")
private Long updater;
@Schema(description = "更新时间")
private Long updateDate;
private String supplierJson;
}

32
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierDetail.java

@ -1,32 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Set;
/**
* @author siyang
* @date 2024/6/18 10:11
* @description 供应商碳足迹详情
*/
@Data
@Schema(description = "供应商碳足迹详情")
public class CarbonPubSupplierDetail {
@Schema(description = "企业名称")
private String companyName;
@Schema(description = "租户编码")
private Long tenantCode;
@Schema(description = "产品类型")
private Set<String> productTypes;
@Schema(description = "平均碳足迹")
private BigDecimal avgCarbon;
@Schema(description = "碳足迹记录数量")
private Long recordsCount;
}

36
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CarbonPubSupplierProduct.java

@ -1,36 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author siyang
* @date 2024/6/18 10:11
* @description 供应商产品信息碳足迹详情
*/
@Data
@Schema(description = "供应商产品信息")
public class CarbonPubSupplierProduct {
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "产品类型")
private String productModel;
@Schema(description = "功能单位")
private String functionUnit;
@Schema(description = "核算边界")
private String boundary;
@Schema(description = "当前产品碳足迹记录数量")
private Long recordsCount;
@Schema(description = "当前产品平均碳足迹")
private BigDecimal avgCarbon;
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnergyInfo.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "能源数据实时采集-数采模块 数采设备类型名称 电,天然气等")
public class CockpitEnergyInfo {
@Schema(description = "数采设备类型")
private String name;
@Schema(description = "数量")
private Long number;
}

38
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitEnterpriseInfo.java

@ -1,38 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 企业列表详情
*/
@Data
@Schema(description = "国网侧驾驶舱企业信息")
public class CockpitEnterpriseInfo {
@Schema(description = "企业id,供应商id")
private Long id;
@Schema(description = "企业名称")
private String name;
@Schema(description = "企业编码 也就是tenant_code")
private String code;
@Schema(description = "企业区域id")
private String regionId;
@Schema(description = "碳足迹结果数量")
private String recordsCount;
@Schema(description = "产品数量")
private String productCount;
@Schema(description = "经纬度原始值")
private String lngLatStr;
@Schema(description = "经度")
private String lng;
@Schema(description = "纬度")
private String lat;
@Schema(description = "产品分类")
private String productType;
@Schema(description = "平均产品碳足迹")
private BigDecimal avgCarBon;
}

37
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitProductionCarbon.java

@ -1,37 +0,0 @@
package com.thing.carbon.pub.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.thing.common.core.utils.DateTimeUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author siyang
* @date 2024/6/27 09:38
* @description 简单产品碳足迹
*/
@Data
@Schema(description = "简单产品碳足迹")
public class CockpitProductionCarbon {
@Schema(description = "产品id")
private Long productId;
@Schema(description = "产品名称")
private String productName;
@Schema(description = "批次号")
private String prCode;
@Schema(description = "碳足迹值")
private BigDecimal carbon;
@Schema(description = "工单日期")
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
@JsonFormat(pattern = DateTimeUtils.DATE_TIME_PATTERN_STR)
private Date prDate;
}

28
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/CockpitStatisticsDto.java

@ -1,28 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 国网侧驾驶舱中间六个统计信息
*/
@Data
@Schema(description = "国网侧驾驶舱中间六个统计信息")
public class CockpitStatisticsDto {
@Schema(description = "服务企业数")
private Long enterprisesCount;
@Schema(description = "服务产品数")
private Long productsCount;
@Schema(description = "工艺模型数")
private Long processCount;
@Schema(description = "碳足迹结果")
private Long carbonReportCount;
@Schema(description = "排放因子库调用次数")
private Long carbonLibCount;
@Schema(description = "累计产品碳足迹背景数据")
private Long carbonCount;
}

56
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/IotCarbonEnterpriseAuthDTO.java

@ -1,56 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
/**
* 企业注册
*
* @author xc
* @since 3.0 2024-07-09
*/
@Data
@Schema(description = "企业注册")
public class IotCarbonEnterpriseAuthDTO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Schema(description = "id")
private Long id;
@Schema(description = "用户账号")
private String username;
@Schema(description = "用户密码")
private String password;
@Schema(description = "企业名称")
private String tenantName;
@Schema(description = "行业门类编码")
private String industryCategory;
@Schema(description = "行业大类编码")
private String industryType;
@Schema(description = "区域编码")
private String regionCode;
@Schema(description = "详细地址")
private String address;
@Schema(description = "经纬度")
private String lngLat;
@Schema(description = "统一社会信用编码")
private String corporationCode;
@Schema(description = "营业执照扫描件")
private String businessLicense;
@Schema(description = "联系人")
private String contact;
@Schema(description = "联系电话")
private String contactNumber;
@Schema(description = "企业邮箱")
private String email;
@Schema(description = "审核状态 1待审核,2审核通过,3审核不通过")
private String status;
@Schema(description = "审核意见")
private String opinion;
@Schema(description = "更新时间")
private Long updateTime;
}

40
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/SupplierStatisticsDto.java

@ -1,40 +0,0 @@
package com.thing.carbon.pub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
@Schema(description = "国网侧驾驶舱左下角 企业统计信息")
public class SupplierStatisticsDto {
@Schema(description = "碳排因子库调用次数")
private Long carbonLibCount;
@Schema(description = "工艺模型调用次数")
private Long processCount;
@Schema(description = "计算结果共享条数")
private Long computedShareCount;
@Schema(description = "工艺模型共享条数")
private Long processShareCount;
@Schema(description = "能源数据实时采集-数采模块")
private List<CockpitEnergyInfo> cockpitEnergyInfo;
@Schema(description = "生产系统对接套数")
private Long systemCount= 1L;
@Schema(description = "对接数据量条数")
private Long dataCount;
}

81
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/TranslateRequest.java

@ -1,81 +0,0 @@
package com.thing.carbon.pub.dto;
import com.thing.common.core.rest.dto.ApiRequest;
import com.thing.common.core.utils.EncryptUtils;
import com.thing.common.core.utils.RandomUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serial;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author siyang
* @date 2024/5/11 15:03
* @description 百度翻译请求
*/
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class TranslateRequest extends ApiRequest {
@Serial private static final long serialVersionUID = -2149110530712711761L;
private String url = "http://api.fanyi.baidu.com/api/trans/vip/translate";
private String appId = "20240510002047650";
private String apiSecret = "oN16vuXmn5dYAMuZ4nlm";
/** 需要翻译的字符:单次请求长度控制在 6000 bytes以内 */
private String query;
/** 原语言:en */
private String from;
/** 翻译语言:zh */
private String to;
/**
* 签名<br>
* Step1. 拼接字符串1<br>
* 拼接appid=2015063000000001+q=apple+salt=1435660288+密钥=12345678得到字符串12015063000000001apple143566028812345678
* <br>
* Step2. 计算签名对字符串1做MD5加密<br>
* sign=MD5(2015063000000001apple143566028812345678)得到sign=f89f9594663708c1605f3d736d01d2d4<br>
*/
private String sign;
public TranslateRequest(String query, String from, String to) {
this.query = query;
this.from = from;
this.to = to;
}
@Override
public Map<String, Object> getHeader() {
return null;
}
@Override
public Map<String, Object> getBody() {
// 不要修改map参数添加的顺序
Map<String, Object> params = new LinkedHashMap<>();
params.put("appid", appId);
params.put("q", query);
params.put("salt", RandomUtils.getRandomString());
params.put("sign", calculateSign(params));
params.put("from", from);
params.put("to", to);
return params;
}
private String calculateSign(Map<String, Object> requestMap) {
StringBuilder params = new StringBuilder();
requestMap.forEach((k, v) -> params.append(v));
params.append(apiSecret);
return EncryptUtils.md5Encrypt(params.toString()).toLowerCase();
}
}

42
modules/carbon-public/src/main/java/com/thing/carbon/pub/dto/TranslateResponse.java

@ -1,42 +0,0 @@
package com.thing.carbon.pub.dto;
import com.thing.common.core.rest.dto.ApiResponse;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.util.List;
/**
* @author siyang
* @date 2024/5/11 15:03
* @description 百度翻译请求响应
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TranslateResponse extends ApiResponse {
@Serial private static final long serialVersionUID = 4069046173619534611L;
private String from;
private String to;
private List<Result> trans_result;
private String error_code;
private String error_msg;
@Data
public static class Result {
/** 原数据 */
private String src;
/** 翻译结果 */
private String dst;
}
@Override
public boolean failed() {
return StringUtils.isNotBlank(error_code);
}
}

67
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubCertificateEntity.java

@ -1,67 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 碳足迹证书
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_certificate")
public class CarbonPubCertificateEntity extends BaseInfoEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 产品id
*/
private Long productId;
/**
* 数据时间边界开始
*/
private Long boundaryStart;
/**
* 数据时间边界截止
*/
private Long boundaryEnd;
/**
* 认证机构
*/
private String certificationOrg;
/**
* 核查标准
*/
private String verificationStd;
/**
* 产品碳足迹值单位kce
*/
private BigDecimal carbonVal;
/**
* 生命周期各阶段占比json
*/
private String stagePercentJson;
/**
* 证书url
*/
private String certificateUrl;
/**
* 发证日期
*/
private Long certificateStart;
/**
* 证书到期时间
*/
private Long certificateEnd;
}

78
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubEngEffEntity.java

@ -1,78 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 设备能效标准
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-06-11
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_eng_eff")
public class CarbonPubEngEffEntity extends BaseInfoEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 产品类别
*/
private String productType;
/**
* 产品类别
*/
private String productName;
/**
* 能效指标
*/
private String effKpi;
/**
* 单位
*/
private String unit;
/**
* 一级分类
*/
private String topCategory;
/**
* 二级分类
*/
private String subCategory;
/**
* 分类详情
*/
private String categoryInfo;
/**
* 先进水平
*/
private String advLevel;
/**
* 节能水平
*/
private String engSavingLevel;
/**
* 准入水平
*/
private String admissionLevel;
/**
* 参考标准
*/
private String referenceStd;
/**
* 设备图片
*/
private String deviceUrl;
/**
* 设备备注
*/
private String remark;
}

85
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubMaterialFactorEntity.java

@ -1,85 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 碳排因子库
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-11
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_material_factor")
public class CarbonPubMaterialFactorEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private String id;
/**
* 地理位置简称
*/
private String geoShort;
/**
* 地理位置全称
*/
private String geoFull;
/**
* 地理位置全程中文
*/
private String geoFullCn;
/**
* 产品名称
*/
private String productName;
/**
* 产品名称中文
*/
private String productNameCn;
/**
* 产品单位
*/
private String productUnit;
/**
* 碳排因子
*/
private BigDecimal factor;
/**
* 参考单元
*/
private Integer refCount;
/**
* 排放因子库名称
*/
private String sourceName;
/**
* 因子热度单独查询次数
*/
private Integer hotScore;
/**
* 开始年份
*/
private String startYear;
/**
* 截止年份
*/
private String endYear;
/**
* 行业
*/
private String industry;
/**
* 行业中文
*/
private String industryCn;
}

40
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubMaterialFactorUseEntity.java

@ -1,40 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 原材料碳排因子库使用记录
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-17
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_material_factor_use")
public class CarbonPubMaterialFactorUseEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Long id;
/**
* 碳排因子库主键
*/
private String materialFactorId;
/**
* 使用该因子的企业租户编码
*/
private Long tenantCode;
/**
* 碳排因子下载时间
*/
private Long useTime;
}

47
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubPointsLogsEntity.java

@ -1,47 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 积分增减记录
*
* @author xc
* @since 3.0 2024-06-17
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_points_logs")
public class CarbonPubPointsLogsEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Id
private Long id;
/**
* 类型中文描述
*/
private String type;
/**
* 增减积分值
*/
private Integer points;
/**
* 供应商编码
*/
private Long tenantCode;
/**
* 创建时间
*/
private Long createTime;
}

52
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubPointsRuleEntity.java

@ -1,52 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 碳足迹积分规则
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_points_rule")
public class CarbonPubPointsRuleEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Long id;
/**
* 模型共享积分
*/
private Integer modelSharedPoints;
/**
* 模型点击积分
*/
private Integer modelClickPoints;
/**
* 结果数据共享积分
*/
private Integer resultSharedPoints;
/**
* 过程数据共享积分
*/
private Integer processSharedPoints;
/**
* 碳足迹认证积分
*/
private Integer footprintCertifyPoints;
/**
* 碳足迹因子首次使用消耗积分
*/
private Integer factorUsePoints;
}

89
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionModelEntity.java

@ -1,89 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 产品详情
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_production_model")
public class CarbonPubProductionModelEntity extends BaseInfoEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 产品id
*/
private Long productId;
/**
* 产品编码
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 产品型号
*/
private String productModel;
/**
* 产品图片
*/
private String url;
/**
* 功能单位
*/
private String functionUnit;
/**
* 产品基本信息json
*/
private String productJson;
/**
* 原料信息json
*/
private String materialJson;
/**
* 产品工艺工序json
*/
private String processJson;
/**
* 工序预览图url
*/
private String stepsUrl;
/**
* 工序图的坐标json
*/
private String stepsJson;
/**
* 行业一级分类企业详情的industry_type
*/
private String industryType;
/**
* 行业二级分类企业详情的industry_category
*/
private String industryCategory;
/**
* 产品类型
*/
private String productType;
/**
* 下载次数
*/
private Integer downloadCount;
/**
* 模型是否在社区展示0-不展示1-展示
*/
private Integer showInCommunity;
}

55
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionReportConfigEntity.java

@ -1,55 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 碳足迹报告配置
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-27
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_production_report_config")
public class CarbonPubProductionReportConfigEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 数据主键id
*/
@Id
private Long id;
/**
* 企业租户编码
*/
private Long tenantCode;
/**
* 产品id
*/
private Long productId;
/**
* 数据边界类型1-自然月2-自然年3-自定义
*/
private Integer boundaryType;
/**
* 数据边界开始时间只有自定义边界才有值
*/
private Long boundaryStart;
/**
* 数据边界结束时间只有自定义边界才有值
*/
private Long boundaryEnd;
/**
* 是否展示结果
*/
private Integer showResult;
}

82
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionReportEntity.java

@ -1,82 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseInfoEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 产品碳足迹报告
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-28
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_production_report")
public class CarbonPubProductionReportEntity extends BaseInfoEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 产品id
*/
private Long productId;
/**
* 碳足报告配置id
*/
private Long configId;
/**
* 系统边界类型1-摇篮到大门2-摇篮到坟墓
*/
private String boundary;
/**
* 数据边界类型1-自然月2-自然年3-自定义
*/
private Integer boundaryType;
/**
* 数据边界开始时间
*/
private Date boundaryStart;
/**
* 数据边界结束时间
*/
private Date boundaryEnd;
/**
* 报告有效期
*/
private Long validEndTime;
/**
* 碳足迹总值
*/
private BigDecimal totalCarbon;
/**
* 各阶段碳足迹占比
*/
private String stagePercentJson;
/**
* 企业名称
*/
private String companyName;
/**
* 证书编号
*/
private String reportCode;
/**
* 报告来源类型填报实采证书上传
*/
private String sourceType;
/**
* 是否在碳足迹库展示结果0-不展示1-展示
*/
private Integer showResult;
}

173
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubProductionResultEntity.java

@ -1,173 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Table;
import com.thing.common.orm.entity.BaseInfoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 生产记录核算结果
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_production_result")
public class CarbonPubProductionResultEntity extends BaseInfoEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 原始数据id
*/
private Long oriId;
/**
* 产品id
*/
private Long productId;
/**
* 产品名称
*/
private String productName;
/**
* 产品编码
*/
private String productCode;
/**
* 产品型号
*/
private String productModel;
/**
* 产品重量
*/
private BigDecimal productWeight;
/**
* 功能单位
*/
private String functionUnit;
/**
* 产品重量计量单位
*/
private String weightUnit;
/**
* 生产记录编码
*/
private String prCode;
/**
* 生产耗时单位h
*/
private Integer prDur;
/**
* 生产数量
*/
private Integer num;
/**
* 成品数量
*/
private Integer finalNum;
/**
* 能源品种id
*/
private Long evId;
/**
* 能源品种名称
*/
private String evName;
/**
* 能耗总用量
*/
private BigDecimal usage;
/**
* 能耗平均用量
*/
private BigDecimal usageAvg;
/**
* 总碳排
*/
private BigDecimal carbon;
/**
* 平均碳排
*/
private BigDecimal carbonAvg;
/**
* 总能耗
*/
private BigDecimal tce;
/**
* 碳排类型
* 1 原料
* 2 原料运输
* 3 产品生产
* 4 产品公摊/间接
* 5 产品运输
* 6 产品使用
* 7 产品废弃处理
*/
private String carbonType;
/**
* 结果类型1-结果数据 2-过程数据
*/
private String resultType;
/**
* 系统边界 1-摇篮到大门2-摇篮到坟墓
*/
private String boundary;
/**
* 开始日期
*/
private Date startTime;
/**
* 完工日期
*/
private Date finishTime;
/**
* 详情json一个类型一个能源形成一个详情json
*/
private String json;
/**
* 产品运输的时候提交的数据组id 同一组数据 数量只聚合一次
*/
private Long groupId;
/**
* 废弃运输里程
*/
private BigDecimal fqUsage;
/**
* 废弃运输碳排
*/
private BigDecimal fqCarbon;
/**
* 废弃运输里程平均值不平均= 废弃运输里程
*/
private BigDecimal fqUsageAvg;
/**
* 废弃运输碳排平均值
*/
private BigDecimal fqCarbonAvg;
/**
* 废弃运输类型id
*/
private Long fqEvId;
/**
* 废弃运输类型名称
*/
private String fqEvName;
/**
* 使用年限
*/
private Integer life;
/**
* 数据来源类型: 1-实采 2-填报
*/
private String sourceType;
}

57
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/CarbonPubSupplierEntity.java

@ -1,57 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 产品碳足迹供应商
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("carbon_pub_supplier")
public class CarbonPubSupplierEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Long id;
/**
* 供应商名称
*/
private String name;
/**
* 供应商编码tenant_code
*/
private Long code;
/**
* 供应商令牌
*/
private String accessToken;
/**
* 地区idsys_region表id
*/
private Long regionId;
/**
* 产品分类按逗号分隔
*/
private String productType;
/**
* 剩余积分
*/
private Integer points;
private String supplierJson;
}

95
modules/carbon-public/src/main/java/com/thing/carbon/pub/entity/IotCarbonEnterpriseAuthEntity.java

@ -1,95 +0,0 @@
package com.thing.carbon.pub.entity;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serial;
import java.io.Serializable;
/**
* 企业注册
*
* @author xc
* @since 3.0 2024-07-09
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
@Table("iot_carbon_enterprise_auth")
public class IotCarbonEnterpriseAuthEntity implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
private Long id;
/**
* 用户账号
*/
private String username;
/**
* 用户密码
*/
private String password;
/**
* 企业名称
*/
private String tenantName;
/**
* 行业门类
*/
private String industryCategory;
/**
* 行业大类
*/
private String industryType;
/**
* 区域编码
*/
private String regionCode;
/**
* 详细地址
*/
private String address;
/**
* 经纬度
*/
private String lngLat;
/**
* 统一社会信用编码
*/
private String corporationCode;
/**
* 营业执照扫描件
*/
private String businessLicense;
/**
* 联系人
*/
private String contact;
/**
* 联系电话
*/
private String contactNumber;
/**
* 企业邮箱
*/
private String email;
/**
* 审核状态
*/
private String status;
/**
* 审核意见
*/
private String opinion;
@Schema(description = "更新时间")
private Long updateTime;
}

166
modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubFilter.java

@ -1,166 +0,0 @@
package com.thing.carbon.pub.filter;
import com.alibaba.fastjson.JSONObject;
import com.thing.carbon.pub.constant.ApiConstant;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.common.core.enumeration.RsaKeyType;
import com.thing.common.core.utils.EncryptUtils;
import com.thing.common.core.web.response.Result;
import jakarta.servlet.*;
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.apache.shiro.web.servlet.ShiroHttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
/**
* @author siyang
* @date 2024/5/13 15:02
* @description 国网接口请求过滤器
*/
@Slf4j
@RequiredArgsConstructor
public class CarbonPubFilter implements Filter {
private final String apiSecret;
private final CarbonPubSupplierService carbonPubSupplierService;
private final Result<String> missingTokenError = new Result<String>().error(400, "Invalid parameter:缺少accessToken");
private final Result<String> invalidTokenError = new Result<String>().error(400, "Invalid parameter:非法token");
private final Result<String> missingTsError = new Result<String>().error(400, "Invalid parameter: 缺少timestamp");
private final Result<String> invalidTsError = new Result<String>().error(400, "Invalid parameter: 请求已过期");
private final Result<String> missingSignError = new Result<String>().error(400, "Invalid parameter: 缺少sign");
private final Result<String> unAuthedError = new Result<String>().error(401, "签名验证失败");
@Override
@SneakyThrows
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
CarbonPubRequestWrapper requestWrapper = new CarbonPubRequestWrapper((ShiroHttpServletRequest) request);
CarbonPubResponseWrapper responseWrapper = new CarbonPubResponseWrapper((ShiroHttpServletResponse) response);
String accessToken = request.getParameter(ApiConstant.ACCESS_TOKEN);
String timestamp = request.getParameter(ApiConstant.TIMESTAMP);
String sign = request.getParameter(ApiConstant.SIGN);
// 校验
if (!valid(requestWrapper, response, accessToken, timestamp, sign)) {
return;
}
// post请求需要对请求体解密
if (isPost(requestWrapper)) {
String requestBody = requestWrapper.getBody();
String decryptedBody = decryptRequest(requestBody);
requestWrapper.setBody(decryptedBody);
}
chain.doFilter(requestWrapper, responseWrapper);
// 响应结果处理
byte[] content = responseWrapper.getContent();
if (content.length == 0) {
return;
}
String originalResponseData = new String(content, StandardCharsets.UTF_8);
ServletOutputStream out = response.getOutputStream();
// post请求和错误的响应信息不需要加密
String finalResponse =
isPost(requestWrapper) || isFailed(originalResponseData)
? originalResponseData
: encryptResponse(originalResponseData);
out.write(finalResponse.getBytes(StandardCharsets.UTF_8));
out.flush();
out.close();
}
private boolean valid(
CarbonPubRequestWrapper requestWrapper,
ServletResponse response,
String accessToken,
String timestamp,
String sign) {
// 1. token验证
if (StringUtils.isBlank(accessToken)) {
writeResponse(response, missingTokenError);
return false;
} else {
CarbonPubSupplierEntity supplier = carbonPubSupplierService.getByAccessToken(accessToken);
if (Objects.isNull(supplier)) {
writeResponse(response, invalidTokenError);
return false;
}
requestWrapper.setAttribute(ApiConstant.SUPPLIER, supplier);
}
// 2. 时间戳验证
if (StringUtils.isBlank(timestamp)) {
writeResponse(response, missingTsError);
return false;
} else {
long now = System.currentTimeMillis();
long requestTime = Long.parseLong(timestamp);
long oneDayDurationMillis = 24 * 60 * 60 * 1000L;
if (Math.abs(now - requestTime) > oneDayDurationMillis) {
writeResponse(response, invalidTsError);
return false;
}
}
// 3. 签名验证
if (StringUtils.isBlank(sign)) {
writeResponse(response, missingSignError);
return false;
} else {
String secretStr = accessToken + "." + apiSecret + "." + timestamp;
String calcSign = EncryptUtils.md5Encrypt(secretStr).toUpperCase();
if(!Objects.equals(sign, calcSign)){
writeResponse(response, unAuthedError);
return false;
}
}
return true;
}
@SneakyThrows
private void writeResponse(ServletResponse response, Result<String> error) {
response.setContentType("application/json; charset=UTF-8");
response.getWriter().write(JSONObject.toJSONString(error));
response.flushBuffer();
}
private String decryptRequest(String requestBody) {
JSONObject jsonBody = JSONObject.parseObject(requestBody);
String encryptedAesKey = jsonBody.getString("encryptedAesKey");
String data = jsonBody.getString("data");
String pemPrivateRsaKey = EncryptUtils.getPemRsaKeyFromResource(RsaKeyType.PRIVATE);
String aesKey = EncryptUtils.rsaDecrypt(encryptedAesKey, pemPrivateRsaKey);
return EncryptUtils.aesDecrypt(data, aesKey);
}
private String encryptResponse(String originalResponseData) {
String aesKey = EncryptUtils.createAesKey(192);
String encryptContent = EncryptUtils.aesEncrypt(originalResponseData, aesKey);
String pemPublicRsaKey = EncryptUtils.getPemRsaKeyFromResource(RsaKeyType.PUBLIC);
String encryptedAesKey = EncryptUtils.rsaEncrypt(aesKey, pemPublicRsaKey);
JSONObject json = new JSONObject();
json.put("encryptedAesKey", encryptedAesKey);
json.put("data", encryptContent);
return json.toString();
}
private boolean isFailed(String response){
JSONObject responseJson = JSONObject.parseObject(response);
return !Objects.equals(responseJson.getInteger("code"), 0);
}
private boolean isPost(HttpServletRequest request) {
return request.getMethod().equalsIgnoreCase("POST");
}
}

33
modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubFilterConfig.java

@ -1,33 +0,0 @@
package com.thing.carbon.pub.filter;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author siyang
* @date 2024/5/13 16:25
* @description 国网侧请求过滤器配置
*/
@Configuration
@RequiredArgsConstructor
public class CarbonPubFilterConfig {
@Value("${carbon.api.secret}")
private String apiSecret;
private final CarbonPubSupplierService carbonPubSupplierService;
@Bean
public FilterRegistrationBean<CarbonPubFilter> carbonPubFilter() {
FilterRegistrationBean<CarbonPubFilter> filterRegistration = new FilterRegistrationBean<>();
filterRegistration.setFilter(new CarbonPubFilter(apiSecret, carbonPubSupplierService));
filterRegistration.setName("carbonPubFilter");
filterRegistration.addUrlPatterns("/v2/carbon/pub/*");
filterRegistration.setOrder(Integer.MAX_VALUE - 50);
return filterRegistration;
}
}

102
modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubRequestWrapper.java

@ -1,102 +0,0 @@
package com.thing.carbon.pub.filter;
import jakarta.servlet.ReadListener;
import jakarta.servlet.ServletInputStream;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequestWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
@Slf4j
public class CarbonPubRequestWrapper extends HttpServletRequestWrapper {
private String requestBody;
public CarbonPubRequestWrapper(HttpServletRequest request) {
super(request);
requestBody = getBodyString(request);
}
@Override
public ServletInputStream getInputStream() {
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(requestBody.getBytes(StandardCharsets.UTF_8));
return new ServletInputStream() {
@Override
public boolean isReady() {
return false;
}
@Override
public int readLine(byte[] b, int off, int len) throws IOException {
return super.readLine(b, off, len);
}
@Override
public boolean isFinished() {
return false;
}
@Override
public void setReadListener(ReadListener readListener) {}
@Override
public int read() {
return byteArrayInputStream.read();
}
};
}
@Override
public Map<String, String[]> getParameterMap() {
Map<String, String[]> parameterMap = super.getParameterMap();
parameterMap.forEach(
(name, values) -> {
if (values.length > 0) {
for (int i = 0; i < values.length; i++) {
if (values[i] == null) {
continue;
}
values[i] = URLDecoder.decode(values[i], StandardCharsets.UTF_8);
}
}
});
return parameterMap;
}
@Override
public BufferedReader getReader() {
return new BufferedReader(new InputStreamReader(this.getInputStream()));
}
public String getBody() {
return this.requestBody;
}
public void setBody(String body) {
this.requestBody = body;
}
/**
* 获取请求Body
*
* @param request request
* @return String
*/
public String getBodyString(final ServletRequest request) {
try {
return IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8);
} catch (IOException e) {
log.error("", e);
throw new RuntimeException(e);
}
}
}

65
modules/carbon-public/src/main/java/com/thing/carbon/pub/filter/CarbonPubResponseWrapper.java

@ -1,65 +0,0 @@
package com.thing.carbon.pub.filter;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.WriteListener;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponseWrapper;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public class CarbonPubResponseWrapper extends HttpServletResponseWrapper {
private final ByteArrayOutputStream buffer;
private final ServletOutputStream out;
/**
* Constructs a response adaptor wrapping the given response.
*
* @param response The response to be wrapped
* @throws IllegalArgumentException if the response is null
*/
public CarbonPubResponseWrapper(HttpServletResponse response) {
super(response);
buffer = new ByteArrayOutputStream();
out = new WrapperOutputStream(buffer);
}
@Override
public ServletOutputStream getOutputStream() {
return out;
}
@Override
public void flushBuffer() throws IOException {
if (out != null) {
out.flush();
}
}
public byte[] getContent() throws IOException {
flushBuffer();
return buffer.toByteArray();
}
static class WrapperOutputStream extends ServletOutputStream {
private final ByteArrayOutputStream bos;
public WrapperOutputStream(ByteArrayOutputStream bos) {
this.bos = bos;
}
@Override
public void write(int b) {
bos.write(b);
}
@Override
public boolean isReady() {
return false;
}
@Override
public void setWriteListener(WriteListener writeListener) {}
}
}

41
modules/carbon-public/src/main/java/com/thing/carbon/pub/listener/SupplierCreateListener.java

@ -1,41 +0,0 @@
package com.thing.carbon.pub.listener;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.carbon.pub.service.CarbonPubSupplierService;
import com.thing.common.core.utils.RandomUtils;
import com.thing.event.TenantDetailSavedEvent;
import com.thing.sys.tenant.entity.SysTenantDetailEntity;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
* @author siyang
* @date 2024/6/3 09:49
* @description
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class SupplierCreateListener {
private final CarbonPubSupplierService supplierService;
@EventListener(TenantDetailSavedEvent.class)
public void onTenantSavedEvent(TenantDetailSavedEvent event) {
SysTenantDetailEntity tenantDetail = event.getTenantDetail();
if (Objects.isNull(tenantDetail)) {
return;
}
CarbonPubSupplierEntity supplier = new CarbonPubSupplierEntity();
supplier.setName(tenantDetail.getName())
.setCode(tenantDetail.getId())
.setAccessToken(RandomUtils.getRandomString(10))
.setPoints(100)
.setRegionId(Long.parseLong(tenantDetail.getRegionCode()));
supplierService.save(supplier);
}
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubCertificateMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubCertificateEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 碳足迹证书
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-23
*/
@Mapper
public interface CarbonPubCertificateMapper extends PowerBaseMapper<CarbonPubCertificateEntity> {
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubEngEffMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubEngEffEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 设备能效标准
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-06-11
*/
@Mapper
public interface CarbonPubEngEffMapper extends PowerBaseMapper<CarbonPubEngEffEntity> {
}

20
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubMaterialFactorMapper.java

@ -1,20 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubMaterialFactorEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* 碳排因子库
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-11
*/
@Mapper
public interface CarbonPubMaterialFactorMapper extends PowerBaseMapper<CarbonPubMaterialFactorEntity> {
@Select("SELECT sum(hot_score) FROM carbon_pub_material_factor")
Long selectCarbonLibCount();
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubMaterialFactorUseMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubMaterialFactorUseEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 原材料碳排因子库使用记录
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-17
*/
@Mapper
public interface CarbonPubMaterialFactorUseMapper extends PowerBaseMapper<CarbonPubMaterialFactorUseEntity> {
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubPointsLogsMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubPointsLogsEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 积分增减记录
*
* @author xc
* @since 3.0 2024-06-17
*/
@Mapper
public interface CarbonPubPointsLogsMapper extends PowerBaseMapper<CarbonPubPointsLogsEntity> {
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubPointsRuleMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubPointsRuleEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 碳足迹积分规则
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Mapper
public interface CarbonPubPointsRuleMapper extends PowerBaseMapper<CarbonPubPointsRuleEntity> {
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionModelMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubProductionModelEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品详情
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Mapper
public interface CarbonPubProductionModelMapper extends PowerBaseMapper<CarbonPubProductionModelEntity> {
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionReportConfigMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubProductionReportConfigEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 碳足迹报告配置
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-05-27
*/
@Mapper
public interface CarbonPubProductionReportConfigMapper extends PowerBaseMapper<CarbonPubProductionReportConfigEntity> {
}

23
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionReportMapper.java

@ -1,23 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubProductionModelEntity;
import com.thing.carbon.pub.entity.CarbonPubProductionReportEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 产品碳足迹报告
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Mapper
public interface CarbonPubProductionReportMapper extends PowerBaseMapper<CarbonPubProductionReportEntity> {
List<CarbonPubProductionModelEntity> getAllModels(@Param("tenantCode") Long tenantCode);
Long selectProductsCount();
}

14
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubProductionResultMapper.java

@ -1,14 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.CarbonPubProductionResultEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 生产记录核算结果
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Mapper
public interface CarbonPubProductionResultMapper extends PowerBaseMapper<CarbonPubProductionResultEntity> {}

31
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/CarbonPubSupplierMapper.java

@ -1,31 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.dto.CarbonPubSupplierDTO;
import com.thing.carbon.pub.entity.CarbonPubSupplierEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 产品碳足迹供应商
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-15
*/
@Mapper
public interface CarbonPubSupplierMapper extends PowerBaseMapper<CarbonPubSupplierEntity> {
List<CarbonPubSupplierDTO> selectBy(@Param("params") Map<String, Object> params);
long countBy(@Param("params") Map<String, Object> params);
BigDecimal avgCarbonOfAllProduct(
@Param("tenantCode") Long tenantCode,
@Param("start") Date start,
@Param("end") Date end);
}

16
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/IotCarbonEnterpriseAuthMapper.java

@ -1,16 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.entity.IotCarbonEnterpriseAuthEntity;
import com.thing.common.orm.mapper.PowerBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 企业注册
*
* @author xc
* @since 3.0 2024-07-09
*/
@Mapper
public interface IotCarbonEnterpriseAuthMapper extends PowerBaseMapper<IotCarbonEnterpriseAuthEntity> {
}

19
modules/carbon-public/src/main/java/com/thing/carbon/pub/mapper/PubCockpitMapper.java

@ -1,19 +0,0 @@
package com.thing.carbon.pub.mapper;
import com.thing.carbon.pub.dto.CockpitEnterpriseInfo;
import com.thing.carbon.pub.dto.CockpitEnergyInfo;
import com.thing.carbontrack.screen.dto.SimpleProductionCarbon;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface PubCockpitMapper {
List<CockpitEnterpriseInfo> cockpitEnterpriseInfoList();
List<CockpitEnergyInfo> supplierStatistics(Long tenantCode);
List<SimpleProductionCarbon> getCarbonTrend(Long productId);
}

28
modules/carbon-public/src/main/java/com/thing/carbon/pub/service/CarbonPubCertificateService.java

@ -1,28 +0,0 @@
package com.thing.carbon.pub.service;
import com.thing.carbon.pub.dto.CarbonPubCertificateDTO;
import com.thing.carbon.pub.entity.CarbonPubCertificateEntity;
import com.thing.common.core.web.response.PageData;
import com.thing.common.orm.service.IBaseService;
import java.util.List;
import java.util.Map;
/**
* 碳足迹证书
*
* @author sys dev@lrd.com
* @since 5.1 2024-05-23
*/
public interface CarbonPubCertificateService extends IBaseService<CarbonPubCertificateEntity> {
PageData<CarbonPubCertificateDTO> handlePage(Map<String, Object> params);
CarbonPubCertificateDTO handleDetail(Long id);
void handleSave(CarbonPubCertificateDTO dto);
void handleUpdate(CarbonPubCertificateDTO dto);
void handleDelete(List<Long> ids);
}

17
modules/carbon-public/src/main/java/com/thing/carbon/pub/service/CarbonPubEngEffService.java

@ -1,17 +0,0 @@
package com.thing.carbon.pub.service;
import com.thing.carbon.pub.entity.CarbonPubEngEffEntity;
import com.thing.common.orm.service.IBaseService;
import java.util.List;
/**
* 设备能效标准
*
* @author sys 2337720667@qq.com
* @since 5.1 2024-06-11
*/
public interface CarbonPubEngEffService extends IBaseService<CarbonPubEngEffEntity> {
List<String> getTargetFieldHistoryRecords(String field, String productType);
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save