Browse Source

染色标尺配置相关代码

yangwanyi 3 years ago
parent
commit
84dc0fce44
25 changed files with 2295 additions and 0 deletions
  1. 49 0
      doc/dye-data.sql
  2. 131 0
      doc/dye-schema.sql
  3. 72 0
      src/main/java/com/persagy/dye/constant/DyeConstant.java
  4. 82 0
      src/main/java/com/persagy/dye/controller/DyeBasicController.java
  5. 95 0
      src/main/java/com/persagy/dye/controller/DyeRuleCustomController.java
  6. 94 0
      src/main/java/com/persagy/dye/controller/DyeRuleDefaultController.java
  7. 58 0
      src/main/java/com/persagy/dye/controller/DyeSdkController.java
  8. 18 0
      src/main/java/com/persagy/dye/mapper/DyeBasicMapper.java
  9. 37 0
      src/main/java/com/persagy/dye/mapper/DyeRuleCustomMapper.java
  10. 38 0
      src/main/java/com/persagy/dye/mapper/DyeRuleDefaultMapper.java
  11. 306 0
      src/main/java/com/persagy/dye/pojo/dto/DyeBasic.java
  12. 380 0
      src/main/java/com/persagy/dye/pojo/dto/DyeRuleCustom.java
  13. 380 0
      src/main/java/com/persagy/dye/pojo/dto/DyeRuleDefault.java
  14. 30 0
      src/main/java/com/persagy/dye/pojo/vo/DyeScaleplateVO.java
  15. 24 0
      src/main/java/com/persagy/dye/service/IDyeBasicService.java
  16. 24 0
      src/main/java/com/persagy/dye/service/IDyeRuleCustomService.java
  17. 25 0
      src/main/java/com/persagy/dye/service/IDyeRuleDefaultService.java
  18. 25 0
      src/main/java/com/persagy/dye/service/IDyeSdkService.java
  19. 47 0
      src/main/java/com/persagy/dye/service/impl/DyeBasicServiceImpl.java
  20. 47 0
      src/main/java/com/persagy/dye/service/impl/DyeRuleCustomServiceImpl.java
  21. 47 0
      src/main/java/com/persagy/dye/service/impl/DyeRuleDefaultServiceImpl.java
  22. 160 0
      src/main/java/com/persagy/dye/service/impl/DyeSdkServiceImpl.java
  23. 20 0
      src/main/resources/mapper/DyeBasicMapper.xml
  24. 53 0
      src/main/resources/mapper/DyeRuleCustomMapper.xml
  25. 53 0
      src/main/resources/mapper/DyeRuleDefaultMapper.xml

+ 49 - 0
doc/dye-data.sql

@@ -0,0 +1,49 @@
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('1afa744ee32a45da8af67f704c8c4207', 'YL', 'Pj4403050002', 'cO2', '空气CO2浓度', 'ACSeason-1', '供冷季', '2021-10-26 09:46:57', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('775518f3555242b6af01c41c8b52984b', 'YL', 'Pj4403050002', 'cO', '空气CO浓度', 'ACSeason-1', '供冷季', '2021-10-26 09:48:14', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('80f7672d0da24ddf9485c09738746678', 'YL', 'Pj4403050002', 'rH', '湿度', 'ACSeason-2', '供暖季', '2021-10-26 09:46:33', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('87b5353842234aa88366954eb5dcacba', 'YL', 'Pj4403050002', 'tdb', '温度', 'ACSeason-1', '供冷季', '2021-10-26 09:45:40', '2021-10-26 09:51:54', '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('8a5ec9d1c28d4804b69de317f635752d', 'YL', 'Pj4403050002', 'rH', '湿度', 'ACSeason-1', '供冷季', '2021-10-26 09:46:40', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('8a625b6e64344fd084486f7b20fe7199', 'YL', 'Pj4403050002', 'pM2d5', '空气PM2.5浓度', 'ACSeason-2', '供暖季', '2021-10-26 09:48:48', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('98af9c276010410aa56a8053f678fd8f', 'YL', 'Pj4403050002', 'tdb', '温度', 'ACSeason-3', '过渡季', '2021-10-26 09:45:04', '2021-10-26 09:52:50', '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('c06ead288b0044d0a873743cbb384132', 'YL', 'Pj4403050002', 'cO2', '空气CO2浓度', 'ACSeason-3', '过渡季', '2021-10-26 09:47:20', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('ca48540a47d54e3a8e01413f9a818645', 'YL', 'Pj4403050002', 'cO', '空气CO浓度', 'ACSeason-3', '过渡季', '2021-10-26 09:47:46', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('cdc9ca8bba7b4462a93ee601205b4cdc', 'YL', 'Pj4403050002', 'cO2', '空气CO2浓度', 'ACSeason-2', '供暖季', '2021-10-26 09:47:08', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('e101200c05094f30af34c741b10e7069', 'YL', 'Pj4403050002', 'pM2d5', '空气PM2.5浓度', 'ACSeason-1', '供冷季', '2021-10-26 09:48:41', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('e13d4c9ed86f4662af2f77869da7b9dd', 'YL', 'Pj4403050002', 'pM2d5', '空气PM2.5浓度', 'ACSeason-3', '过渡季', '2021-10-26 09:48:55', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('e3faf2642a5e4bb9ab194bd366352d31', 'YL', 'Pj4403050002', 'cO', '空气CO浓度', 'ACSeason-2', '供暖季', '2021-10-26 09:48:04', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('faf0533dc5464b4898ba07708e40f9e5', 'YL', 'Pj4403050002', 'rH', '湿度', 'ACSeason-3', '过渡季', '2021-10-26 09:46:26', NULL, '423594c93c8f45ee904269f4d8d14743', '0');
+INSERT INTO `calendar-center`.`dye_basic`(`id`, `group_code`, `project_id`, `type_code`, `type_name`, `season_code`, `season_name`, `create_time`, `update_time`, `update_user_id`, `is_delete`) VALUES ('fb7c8df3350747abb098b93c143646d2', 'YL', 'Pj4403050002', 'tdb', '温度', 'ACSeason-2', '供暖季', '2021-10-26 09:45:33', '2021-10-26 09:52:29', '423594c93c8f45ee904269f4d8d14743', '0');
+
+-- 默认染色标尺
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('03e3cfc6c6134505a50e2aaadfd66717', '1afa744ee32a45da8af67f704c8c4207', 99, ')', 1000, '(', '浓度过高', '#FF0000', '2021-10-27 15:17:39', '2021-10-27 15:19:35', '423594c93c8f45ee904269f4d8d14743', '0', 1, 'PPM');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('8bbd77c4a4ff41b499ffd83fc2207d63', '1afa744ee32a45da8af67f704c8c4207', 1000, ']', 800, '[', '达标', '#C5E0B3', '2021-10-27 15:19:15', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 2, 'PPM');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('93a20dd6fdc440ad8b4376c153ae1e19', '1afa744ee32a45da8af67f704c8c4207', 800, ')', -99, '(', '良好', '#00B050', '2021-10-27 15:17:39', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 3, 'PPM');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('1660936da3204bb6b8df5bb0212d771d', '87b5353842234aa88366954eb5dcacba', 99, ')', 27, '(', '高温报警', '#FF0000', '2021-10-27 15:31:02', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 5, '℃');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('51c48b9de8ab417695bd5f65d2a13155', '87b5353842234aa88366954eb5dcacba', 26, ']', 24, '(', '良好', '#00B050', '2021-10-27 15:28:01', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 3, '℃');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('52690df8af524e79941515e4125deeab', '87b5353842234aa88366954eb5dcacba', 23, ')', -99, '(', '低温报警', '#4472C4', '2021-10-27 15:23:49', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 1, '℃');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('61257f9924374c3ca98a97fd84ad2665', '87b5353842234aa88366954eb5dcacba', 27, ']', 26, '(', '高温预警', '#F4B083', '2021-10-27 15:30:13', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 4, '℃');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('f159d0f0964e41949397b60e96345c67', '87b5353842234aa88366954eb5dcacba', 24, ']', 23, '[', '低温预警', '#D9E2F3', '2021-10-27 15:25:44', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 2, '℃');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('5589aa8bfd1141bb9cfd519eba872090', '8a5ec9d1c28d4804b69de317f635752d', 40, ']', -99, '(', '达标', '#C5E0B3', '2021-10-27 15:32:39', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 1, '%');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('9dabc82afd134220a57bf9a899d3ddd5', '8a5ec9d1c28d4804b69de317f635752d', 45, ']', 40, '(', '潮湿预警', '#F4B083', '2021-10-27 15:33:36', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 2, '%');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('e3d49936e1534e7190868c12520bdcdb', '8a5ec9d1c28d4804b69de317f635752d', 99, ')', 45, '(', '潮湿报警', '#FF0000', '2021-10-27 15:34:30', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 3, '%');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('0e7024ae696b44e38dbafacc86c28d18', 'e101200c05094f30af34c741b10e7069', 99, ')', 35, '(', '高', '#FF0000', '2021-10-27 15:17:39', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 1, 'μg/m3 每24小时');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('b0e884ff3a5141a189f4f40b2878b83c', 'e101200c05094f30af34c741b10e7069', 35, ']', 15, '[', '达标', '#C5E0B3', '2021-10-27 15:17:39', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 2, 'μg/m3 每24小时');
+INSERT INTO `calendar-center`.`dye_rule_default`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('bec61d651b184609b4e62b4cc02b60b8', 'e101200c05094f30af34c741b10e7069', 15, ')', -99, '(', '良好', '#00B050', '2021-10-27 15:17:39', NULL, '423594c93c8f45ee904269f4d8d14743', '0', 3, 'μg/m3 每24小时');
+
+
+-- 自定义染色标尺表
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('0aba12a248dd455482754ffd1d1eef85', '98af9c276010410aa56a8053f678fd8f', 99, ')', 27, '(', '很热', '#CC0000', '2021-10-26 10:12:45', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 5, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('14f8e4b7c35d4dbd94cd3efc5de56cf2', '98af9c276010410aa56a8053f678fd8f', 21, ')', -99, '(', '很冷', '#00DDDD', '2021-10-26 10:09:59', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 1, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('263a9cbff1324302a74c3f2911b723ea', 'fb7c8df3350747abb098b93c143646d2', 20, ']', -99, '(', '很冷', '#0066FF', '2021-10-26 10:13:56', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 1, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('3125dbf369e645c8bb0123903a47385e', '98af9c276010410aa56a8053f678fd8f', 27, ']', 25, '[', '热', '#EE7700', '2021-10-26 10:12:04', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 4, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('3d364527444f4589b5cd6ee199f5409f', 'fb7c8df3350747abb098b93c143646d2', 24, ']', 22, '[', '适中', '#008800', '2021-10-26 10:15:41', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 3, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('4f770757f7e347f49e924cb431b14fd3', 'fb7c8df3350747abb098b93c143646d2', 99, ')', 26, '(', '很热', '#FF3333', '2021-10-26 10:16:55', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 5, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('5862006c0cc94c8aacff4678c8c206a6', '87b5353842234aa88366954eb5dcacba', 23, ')', -99, '(', '很冷', '#009FCC', '2021-10-26 10:01:44', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 1, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('67f474e6726c452a89a830a1e77f55ea', '87b5353842234aa88366954eb5dcacba', 24, ']', 23, ']', '冷', '#77DDFF', '2021-10-26 10:04:21', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 2, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('83d8aa7a1a1f469081efcecb712e1faf', '98af9c276010410aa56a8053f678fd8f', 23, ')', 21, '(', '冷', '#BBFFEE', '2021-10-26 10:10:53', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 2, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('8b63db32d8f44fcdb6192419eeca9f56', 'fb7c8df3350747abb098b93c143646d2', 22, ')', 20, '(', '冷', '#00DDDD', '2021-10-26 10:15:11', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 2, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('b94186f6052c4de598ff0010623567fb', '87b5353842234aa88366954eb5dcacba', 99, ')', 27, '(', '很热', '#FF0000', '2021-10-26 10:07:54', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 5, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('cb4b0ec5de6547a9ba638b2230052e02', '87b5353842234aa88366954eb5dcacba', 26, ']', 24, ']', '适中', '#00AA00', '2021-10-26 10:05:44', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 3, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('d190d54b1e7240d8b70dafc3513dab31', '98af9c276010410aa56a8053f678fd8f', 26, ']', 24, '[', '适中', '#55AA00', '2021-10-26 10:11:34', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 3, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('e9714499df1046fd80c533c8048d09fb', 'fb7c8df3350747abb098b93c143646d2', 26, ']', 24, '(', '热', '#FF7744', '2021-10-26 10:16:09', '2021-10-26 10:18:44', '98af9c276010410aa56a8053f678fd8f', '0', 4, NULL);
+-- INSERT INTO `calendar-center`.`dye_rule_custom`(`id`, `basic_id`, `upper_limit`, `upper_symbol`, `lower_limit`, `lower_symbol`, `name`, `color_value`, `create_time`, `update_time`, `update_user_id`, `is_delete`, `order_num`, `num_symbol`) VALUES ('f92e42cadb234c0dbb8c70cfb83574c4', '87b5353842234aa88366954eb5dcacba', 27, ')', 26, '(', '热', '#FF8800', '2021-10-26 10:06:37', NULL, '98af9c276010410aa56a8053f678fd8f', '0', 4, NULL);

+ 131 - 0
doc/dye-schema.sql

@@ -0,0 +1,131 @@
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : 192.168.100.94
+ Source Server Type    : MySQL
+ Source Server Version : 50723
+ Source Host           : 192.168.100.94:9934
+ Source Schema         : calendar-center
+
+ Target Server Type    : MySQL
+ Target Server Version : 50723
+ File Encoding         : 65001
+
+ Date: 27/10/2021 11:47:10
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for dye_rule_custom
+-- ----------------------------
+DROP TABLE IF EXISTS `dye_rule_custom`;
+CREATE TABLE `dye_rule_custom`  (
+  `id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `basic_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '基础表ID',
+  `upper_limit` int(50) NOT NULL COMMENT '上限',
+  `upper_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '上限符号',
+  `lower_limit` int(50) NOT NULL COMMENT '下限',
+  `lower_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '下限符号',
+  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
+  `color_value` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '色值',
+  `create_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改时间',
+  `update_user_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '最后修改人ID',
+  `is_delete` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是否删除(0:否 1:是)',
+  `order_num` int(10) NULL DEFAULT NULL COMMENT '排序',
+  `num_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数值单位符号',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `id`(`id`) USING BTREE COMMENT '主键索引',
+  INDEX `basic_id`(`basic_id`) USING BTREE COMMENT '外键索引',
+  CONSTRAINT `fk_custom` FOREIGN KEY (`basic_id`) REFERENCES `dye_basic` (`id`) ON DELETE RESTRICT ON UPDATE NO ACTION
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '染色规则自定义表' ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;
+
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : 192.168.100.94
+ Source Server Type    : MySQL
+ Source Server Version : 50723
+ Source Host           : 192.168.100.94:9934
+ Source Schema         : calendar-center
+
+ Target Server Type    : MySQL
+ Target Server Version : 50723
+ File Encoding         : 65001
+
+ Date: 27/10/2021 11:47:17
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for dye_rule_default
+-- ----------------------------
+DROP TABLE IF EXISTS `dye_rule_default`;
+CREATE TABLE `dye_rule_default`  (
+  `id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
+  `basic_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '染色基础表ID',
+  `upper_limit` int(50) NOT NULL COMMENT '上限',
+  `upper_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '上限符号',
+  `lower_limit` int(50) NOT NULL COMMENT '下限',
+  `lower_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '下限符号',
+  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
+  `color_value` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '色值',
+  `create_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新时间',
+  `update_user_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '最后更新人ID',
+  `is_delete` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是否删除(0:否  1:是)',
+  `order_num` int(10) NULL DEFAULT NULL COMMENT '排序',
+  `num_symbol` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数值单位符号',
+  PRIMARY KEY (`id`) USING BTREE,
+  UNIQUE INDEX `id`(`id`) USING BTREE COMMENT '主键索引',
+  INDEX `basic_id`(`basic_id`) USING BTREE COMMENT '外键索引',
+  CONSTRAINT `fk_default` FOREIGN KEY (`basic_id`) REFERENCES `dye_basic` (`id`) ON DELETE RESTRICT ON UPDATE NO ACTION
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '默认染色规则' ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;
+
+/*
+ Navicat Premium Data Transfer
+
+ Source Server         : 192.168.100.94
+ Source Server Type    : MySQL
+ Source Server Version : 50723
+ Source Host           : 192.168.100.94:9934
+ Source Schema         : calendar-center
+
+ Target Server Type    : MySQL
+ Target Server Version : 50723
+ File Encoding         : 65001
+
+ Date: 27/10/2021 11:47:02
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for dye_basic
+-- ----------------------------
+DROP TABLE IF EXISTS `dye_basic`;
+CREATE TABLE `dye_basic`  (
+  `id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
+  `group_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '集团编码',
+  `project_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '项目ID',
+  `type_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '染色类型编码,对应rwd_def_funcid的type字段',
+  `type_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '染色类型名称',
+  `season_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '季节编码',
+  `season_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '季节名称',
+  `create_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建时间',
+  `update_time` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '更新时间',
+  `update_user_id` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '最后创建人ID',
+  `is_delete` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '是否删除(0:否 1:是)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '染色基础表' ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 72 - 0
src/main/java/com/persagy/dye/constant/DyeConstant.java

@@ -0,0 +1,72 @@
+package com.persagy.dye.constant;
+
+/**
+ * @description: 染色程序相关常量值
+ * @author: YangWanYi
+ * @create: 2021-10-25 16:10
+ **/
+public class DyeConstant {
+
+    /**
+     * 删除状态
+     */
+    public static final String DELETED = "1";
+
+    /**
+     * 上限
+     */
+    public static final String UPPER_LIMIT = "upperLimit";
+
+    /**
+     * 下限
+     */
+    public static final String LOWER_LIMIT = "lowerLimit";
+
+    /**
+     * 名称
+     */
+    public static final String NAME = "name";
+
+    /**
+     * 色值
+     */
+    public static final String COLOR_VALUE = "colorValue";
+
+    /**
+     * 数值
+     */
+    public static final String NUM_VALUE = "numValue";
+
+    /**
+     * 空间ID
+     */
+    public static final String SPACE_ID = "spaceId";
+
+    /**
+     * 项目ID
+     */
+    public static final String PROJECT_ID = "projectId";
+
+    /**
+     * 集团编码
+     */
+    public static final String GROUP_CODE = "groupCode";
+
+    /**
+     * 染色类型
+     */
+    public static final String TYPE_CODE = "typeCode";
+
+    /**
+     * 实时数值
+     */
+    public static final String REALTIME_NUM = "realTimeNum";
+
+
+    /**
+     * 染色标尺ID(可能是默认标尺ID也可能是自定义标尺ID 主要是给SDK使用)
+     */
+    public static final String DYE_ID = "ID";
+
+
+}

+ 82 - 0
src/main/java/com/persagy/dye/controller/DyeBasicController.java

@@ -0,0 +1,82 @@
+package com.persagy.dye.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.google.common.collect.Lists;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.common.utils.ResponseResult;
+import com.persagy.common.utils.ResponseUtil;
+import com.persagy.dye.pojo.dto.DyeBasic;
+import com.persagy.dye.service.IDyeBasicService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 染色基础表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+
+@Api(tags = "染色基础表")
+@RestController
+@RequestMapping(value = "/dyeBasic", method = RequestMethod.POST)
+public class DyeBasicController {
+
+    @Autowired
+    private IDyeBasicService dyeBasicService;
+
+    /**
+     * 列表查询
+     */
+    @ApiOperation(value = "列表查询")
+    @RequestMapping(value = "queryDyeBasicList")
+    public ResponseResult queryDyeBasicList(@RequestBody DyeBasic dyeBasic) {
+        LambdaQueryWrapper<DyeBasic> queryWrapper = new DyeBasic.BuilderQueryWrapper().builder();
+        List<DyeBasic> list = this.dyeBasicService.list(queryWrapper);
+        if (CollectionUtil.isEmpty(list)) {
+            return ResponseUtil.successResult(Lists.newArrayList(), 0L);
+        }
+        return ResponseUtil.successResult(list, (long) list.size());
+    }
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "保存")
+    @RequestMapping(value = "createDyeBasic")
+    public ResponseResult createDyeBasic(@RequestBody DyeBasic dyeBasic) {
+        dyeBasic.setCreateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        boolean result = this.dyeBasicService.save(dyeBasic);
+        return result ? ResponseUtil.successResult("保存成功") : ResponseUtil.errorResult("保存失败");
+    }
+
+    /**
+     * 更新
+     */
+    @ApiOperation(value = "更新")
+    @RequestMapping(value = "updateDyeBasic")
+    public ResponseResult updateDyeBasic(@RequestBody DyeBasic dyeBasic) {
+        dyeBasic.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        boolean result = this.dyeBasicService.updateById(dyeBasic);
+        return result ? ResponseUtil.successResult("更新成功") : ResponseUtil.errorResult("更新失败");
+    }
+
+    /**
+     * 逻辑删除
+     */
+    @ApiOperation(value = "逻辑删除")
+    @RequestMapping(value = "deleteDyeBasic")
+    public ResponseResult deleteDyeBasic(@RequestParam String dyeBasicId, @RequestParam String updateUserId) {
+        boolean result = this.dyeBasicService.deleteDyeBasicById(dyeBasicId, updateUserId);
+        return result ? ResponseUtil.successResult("删除成功") : ResponseUtil.errorResult("删除失败");
+    }
+
+}

+ 95 - 0
src/main/java/com/persagy/dye/controller/DyeRuleCustomController.java

@@ -0,0 +1,95 @@
+package com.persagy.dye.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.google.common.collect.Lists;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.common.utils.ResponseResult;
+import com.persagy.common.utils.ResponseUtil;
+import com.persagy.dye.pojo.dto.DyeRuleCustom;
+import com.persagy.dye.service.IDyeRuleCustomService;
+import com.persagy.dye.service.impl.DyeSdkServiceImpl;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 染色规则自定义表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+
+@Api(tags = "染色规则自定义表")
+@RestController
+@RequestMapping(value = "/dyeRuleCustom", method = RequestMethod.POST)
+public class DyeRuleCustomController {
+
+    @Autowired
+    private IDyeRuleCustomService dyeRuleCustomService;
+
+    @Autowired
+    private DyeSdkServiceImpl dyeSdkService;
+
+    /**
+     * 列表查询
+     */
+    @ApiOperation(value = "列表查询")
+    @RequestMapping(value = "queryDyeRuleCustomList")
+    public ResponseResult queryDyeRuleCustomList(@RequestBody DyeRuleCustom dyeRuleCustom) {
+        LambdaQueryWrapper<DyeRuleCustom> queryWrapper = new DyeRuleCustom.BuilderQueryWrapper().builder();
+
+        List<DyeRuleCustom> list = this.dyeRuleCustomService.list(queryWrapper.orderByAsc(DyeRuleCustom::getBasicId, DyeRuleCustom::getOrderNum));
+        if (CollectionUtil.isEmpty(list)) {
+            return ResponseUtil.successResult(Lists.newArrayList(), 0L);
+        }
+        for (DyeRuleCustom customRule : list) {
+            customRule.setTempUpperLimit(this.dyeSdkService.replace99ToBoundless(customRule.getUpperLimit() + customRule.getUpperSymbol()));
+            customRule.setTempLowerLimit(this.dyeSdkService.replace99ToBoundless(customRule.getLowerSymbol() + customRule.getLowerLimit()));
+        }
+        return ResponseUtil.successResult(list, (long) list.size());
+    }
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "保存")
+    @RequestMapping(value = "createDyeRuleCustom")
+    public ResponseResult createDyeRuleCustom(@RequestBody DyeRuleCustom dyeRuleCustom) {
+        dyeRuleCustom.setCreateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleCustom.setUpperLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleCustom.getTempUpperLimit()));
+        dyeRuleCustom.setLowerLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleCustom.getTempLowerLimit()));
+        boolean result = this.dyeRuleCustomService.save(dyeRuleCustom);
+        return result ? ResponseUtil.successResult("保存成功") : ResponseUtil.errorResult("保存失败");
+    }
+
+    /**
+     * 更新
+     */
+    @ApiOperation(value = "更新")
+    @RequestMapping(value = "updateDyeRuleCustom")
+    public ResponseResult updateDyeRuleCustom(@RequestBody DyeRuleCustom dyeRuleCustom) {
+        dyeRuleCustom.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleCustom.setUpperLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleCustom.getTempUpperLimit()));
+        dyeRuleCustom.setLowerLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleCustom.getTempLowerLimit()));
+        boolean result = this.dyeRuleCustomService.updateById(dyeRuleCustom);
+        return result ? ResponseUtil.successResult("更新成功") : ResponseUtil.errorResult("更新失败");
+    }
+
+    /**
+     * 逻辑删除
+     */
+    @ApiOperation(value = "逻辑删除")
+    @RequestMapping(value = "deleteDyeRuleCustom")
+    public ResponseResult deleteDyeRuleCustom(@RequestParam String dyeRuleCustomId, @RequestParam String updateUserId) {
+        boolean result = this.dyeRuleCustomService.deleteDyeRuleCustomById(dyeRuleCustomId, updateUserId);
+        return result ? ResponseUtil.successResult("删除成功") : ResponseUtil.errorResult("删除失败");
+    }
+
+}

+ 94 - 0
src/main/java/com/persagy/dye/controller/DyeRuleDefaultController.java

@@ -0,0 +1,94 @@
+package com.persagy.dye.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.google.common.collect.Lists;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.common.utils.ResponseResult;
+import com.persagy.common.utils.ResponseUtil;
+import com.persagy.dye.pojo.dto.DyeRuleDefault;
+import com.persagy.dye.service.IDyeRuleDefaultService;
+import com.persagy.dye.service.impl.DyeSdkServiceImpl;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 默认染色规则
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+
+@Api(tags = "默认染色规则")
+@RestController
+@RequestMapping(value = "/dyeRuleDefault", method = RequestMethod.POST)
+public class DyeRuleDefaultController {
+
+    @Autowired
+    private IDyeRuleDefaultService dyeRuleDefaultService;
+
+    @Autowired
+    private DyeSdkServiceImpl dyeSdkService;
+
+    /**
+     * 列表查询
+     */
+    @ApiOperation(value = "列表查询")
+    @RequestMapping(value = "queryDyeRuleDefaultList")
+    public ResponseResult queryDyeRuleDefaultList(@RequestBody DyeRuleDefault dyeRuleDefault) {
+        LambdaQueryWrapper<DyeRuleDefault> queryWrapper = new DyeRuleDefault.BuilderQueryWrapper().builder();
+        List<DyeRuleDefault> list = this.dyeRuleDefaultService.list(queryWrapper.orderByAsc(DyeRuleDefault::getBasicId, DyeRuleDefault::getOrderNum));
+        if (CollectionUtil.isEmpty(list)) {
+            return ResponseUtil.successResult(Lists.newArrayList(), 0L);
+        }
+        for (DyeRuleDefault defaultRule : list) {
+            defaultRule.setTempUpperLimit(this.dyeSdkService.replace99ToBoundless(defaultRule.getUpperLimit() + defaultRule.getUpperSymbol()));
+            defaultRule.setTempLowerLimit(this.dyeSdkService.replace99ToBoundless(defaultRule.getLowerSymbol() + defaultRule.getLowerLimit()));
+        }
+        return ResponseUtil.successResult(list, (long) list.size());
+    }
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "保存")
+    @RequestMapping(value = "createDyeRuleDefault")
+    public ResponseResult createDyeRuleDefault(@RequestBody DyeRuleDefault dyeRuleDefault) {
+        dyeRuleDefault.setCreateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleDefault.setUpperLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleDefault.getTempUpperLimit()));
+        dyeRuleDefault.setLowerLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleDefault.getTempLowerLimit()));
+        boolean result = this.dyeRuleDefaultService.save(dyeRuleDefault);
+        return result ? ResponseUtil.successResult("保存成功") : ResponseUtil.errorResult("保存失败");
+    }
+
+    /**
+     * 更新
+     */
+    @ApiOperation(value = "更新")
+    @RequestMapping(value = "updateDyeRuleDefault")
+    public ResponseResult updateDyeRuleDefault(@RequestBody DyeRuleDefault dyeRuleDefault) {
+        dyeRuleDefault.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleDefault.setUpperLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleDefault.getTempUpperLimit()));
+        dyeRuleDefault.setLowerLimit(this.dyeSdkService.replaceBoundlessTo99(dyeRuleDefault.getTempLowerLimit()));
+        boolean result = this.dyeRuleDefaultService.updateById(dyeRuleDefault);
+        return result ? ResponseUtil.successResult("更新成功") : ResponseUtil.errorResult("更新失败");
+    }
+
+    /**
+     * 物理删除
+     */
+    @ApiOperation(value = "删除")
+    @RequestMapping(value = "deleteDyeRuleDefault")
+    public ResponseResult deleteDyeRuleDefault(@RequestParam String dyeRuleDefaultId, @RequestParam String updateUserId) {
+        boolean result = this.dyeRuleDefaultService.deleteDyeRuleDefaultById(dyeRuleDefaultId, updateUserId);
+        return result ? ResponseUtil.successResult("删除成功") : ResponseUtil.errorResult("删除失败");
+    }
+
+}

+ 58 - 0
src/main/java/com/persagy/dye/controller/DyeSdkController.java

@@ -0,0 +1,58 @@
+package com.persagy.dye.controller;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.persagy.common.utils.ResponseResult;
+import com.persagy.common.utils.ResponseUtil;
+import com.persagy.dye.pojo.vo.DyeScaleplateVO;
+import com.persagy.dye.service.IDyeSdkService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description: sdk调用染色标尺相关接口
+ * @author: YangWanYi
+ * @create: 2021-10-25 18:16
+ **/
+@Api(tags = "sdk调用相关接口")
+@RestController
+@RequestMapping(value = "/dye/sdk", method = RequestMethod.POST)
+public class DyeSdkController {
+
+    @Autowired
+    private IDyeSdkService dyeSdkService;
+
+
+    /**
+     * 查询空间对应的染色标尺
+     * @param dyeScaleplateVO
+     * @return
+     */
+    @ApiOperation(value = "根据空间查询对应染色标尺")
+    @RequestMapping(value = "listDyeScaleplateWithSpaceIds")
+    public ResponseResult listDyeScaleplateWithSpaceIds(@RequestBody DyeScaleplateVO dyeScaleplateVO) {
+        List<Map<String, Object>> result = this.dyeSdkService.listDyeScaleplateWithSpaceIds(dyeScaleplateVO);
+        return ResponseUtil.successResult(result, CollectionUtil.isEmpty(result) ? 0L : result.size());
+    }
+
+    /**
+     * 查询指定集团、项目和类型的染色标尺列表
+     * @param dyeScaleplateVO
+     * @return
+     */
+    @ApiOperation(value = "查询指定集团、项目和类型的染色标尺列表")
+    @RequestMapping(value = "listDyeScaleplateByType")
+    public ResponseResult listDyeScaleplateByType(@RequestBody DyeScaleplateVO dyeScaleplateVO) {
+        List<Map<String, Object>> result = this.dyeSdkService.listDyeScaleplateByType(dyeScaleplateVO);
+        return ResponseUtil.successResult(result, CollectionUtil.isEmpty(result) ? 0L : result.size());
+    }
+
+
+}

+ 18 - 0
src/main/java/com/persagy/dye/mapper/DyeBasicMapper.java

@@ -0,0 +1,18 @@
+package com.persagy.dye.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.persagy.dye.pojo.dto.DyeBasic;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 染色基础表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+@Mapper
+public interface DyeBasicMapper extends BaseMapper<DyeBasic> {
+
+}

+ 37 - 0
src/main/java/com/persagy/dye/mapper/DyeRuleCustomMapper.java

@@ -0,0 +1,37 @@
+package com.persagy.dye.mapper;
+
+import com.persagy.dye.pojo.vo.DyeScaleplateVO;
+import org.apache.ibatis.annotations.Mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.persagy.dye.pojo.dto.DyeRuleCustom;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 染色规则自定义表
+ * 
+ * @version v1.0.0
+ * @company persagy 
+ * @author yangwanyi
+ * @date 2021-10-25 15:58:56
+ */
+@Mapper
+public interface DyeRuleCustomMapper extends BaseMapper<DyeRuleCustom> {
+
+    /**
+     * 查询指定集团、项目和类型的自定义染色标尺列表
+     * @param dyeScaleplateVO
+     * @return List<DyeRuleCustom>
+     */
+    List<DyeRuleCustom> listDyeRuleCustomByType(DyeScaleplateVO dyeScaleplateVO);
+
+    /**
+     * 获取指定集团、项目和类型和数值的自定义染色标尺
+     * @param dyeScaleplateVO
+     * @param numValue
+     * @return DyeRuleCustom
+     */
+    DyeRuleCustom getDistrictDyeRuleCustom(@Param("dyeScaleplateVO") DyeScaleplateVO dyeScaleplateVO, @Param("numValue") Integer numValue);
+}

+ 38 - 0
src/main/java/com/persagy/dye/mapper/DyeRuleDefaultMapper.java

@@ -0,0 +1,38 @@
+package com.persagy.dye.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.persagy.dye.pojo.dto.DyeRuleDefault;
+import com.persagy.dye.pojo.vo.DyeScaleplateVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 默认染色规则
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+@Mapper
+public interface DyeRuleDefaultMapper extends BaseMapper<DyeRuleDefault> {
+
+    /**
+     * 查询指定集团、项目和类型的默认染色标尺列表
+     *
+     * @param dyeScaleplateVO
+     * @return
+     */
+    List<DyeRuleDefault> listDyeRuleDefaultByType(DyeScaleplateVO dyeScaleplateVO);
+
+    /**
+     * 获取指定集团、项目和类型和数值的默认染色标尺
+     *
+     * @param dyeScaleplateVO
+     * @param numValue
+     * @return DyeRuleDefault
+     */
+    DyeRuleDefault getDistrictDyeRuleDefault(@Param("dyeScaleplateVO") DyeScaleplateVO dyeScaleplateVO, @Param("numValue") Integer numValue);
+}

+ 306 - 0
src/main/java/com/persagy/dye/pojo/dto/DyeBasic.java

@@ -0,0 +1,306 @@
+package com.persagy.dye.pojo.dto;
+
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.persagy.common.model.BaseEntity;
+import com.persagy.common.utils.StringUtil;
+
+
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * 染色基础表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-27 11:39:52
+ */
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@TableName("dye_basic")
+public class DyeBasic extends BaseEntity<DyeBasic> {
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String groupCode;            // 集团编码
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String projectId;            // 项目ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String typeCode;            // 染色类型编码,对应rwd_def_funcid的type字段
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String typeName;            // 染色类型名称
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String seasonCode;            // 季节编码
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String seasonName;            // 季节名称
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String createTime;            // 创建时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateTime;            // 更新时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateUserId;            // 最后创建人ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String isDelete;            // 是否删除(0:否 1:是)
+
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class BuilderQueryWrapper {
+
+        private LambdaQueryWrapper<DyeBasic> queryWrapper = new LambdaQueryWrapper<DyeBasic>();
+
+        public BuilderQueryWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                queryWrapper.eq(DyeBasic::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper groupCodeEq(String groupCode) {
+            if (StringUtil.isNotBlank(groupCode)) {
+                queryWrapper.eq(DyeBasic::getGroupCode, groupCode);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper projectIdEq(String projectId) {
+            if (StringUtil.isNotBlank(projectId)) {
+                queryWrapper.eq(DyeBasic::getProjectId, projectId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper typeCodeEq(String typeCode) {
+            if (StringUtil.isNotBlank(typeCode)) {
+                queryWrapper.eq(DyeBasic::getTypeCode, typeCode);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper typeNameEq(String typeName) {
+            if (StringUtil.isNotBlank(typeName)) {
+                queryWrapper.eq(DyeBasic::getTypeName, typeName);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper seasonCodeEq(String seasonCode) {
+            if (StringUtil.isNotBlank(seasonCode)) {
+                queryWrapper.eq(DyeBasic::getSeasonCode, seasonCode);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper seasonNameEq(String seasonName) {
+            if (StringUtil.isNotBlank(seasonName)) {
+                queryWrapper.eq(DyeBasic::getSeasonName, seasonName);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                queryWrapper.eq(DyeBasic::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                queryWrapper.eq(DyeBasic::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                queryWrapper.eq(DyeBasic::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                queryWrapper.eq(DyeBasic::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public LambdaQueryWrapper<DyeBasic> builder() {
+            return queryWrapper;
+        }
+
+    }
+
+    public static class BuilderUpdateWrapper {
+
+        private LambdaUpdateWrapper<DyeBasic> updateWrapper = new LambdaUpdateWrapper<DyeBasic>();
+
+        public BuilderUpdateWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                updateWrapper.eq(DyeBasic::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper groupCodeEq(String groupCode) {
+            if (StringUtil.isNotBlank(groupCode)) {
+                updateWrapper.eq(DyeBasic::getGroupCode, groupCode);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper projectIdEq(String projectId) {
+            if (StringUtil.isNotBlank(projectId)) {
+                updateWrapper.eq(DyeBasic::getProjectId, projectId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper typeCodeEq(String typeCode) {
+            if (StringUtil.isNotBlank(typeCode)) {
+                updateWrapper.eq(DyeBasic::getTypeCode, typeCode);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper typeNameEq(String typeName) {
+            if (StringUtil.isNotBlank(typeName)) {
+                updateWrapper.eq(DyeBasic::getTypeName, typeName);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper seasonCodeEq(String seasonCode) {
+            if (StringUtil.isNotBlank(seasonCode)) {
+                updateWrapper.eq(DyeBasic::getSeasonCode, seasonCode);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper seasonNameEq(String seasonName) {
+            if (StringUtil.isNotBlank(seasonName)) {
+                updateWrapper.eq(DyeBasic::getSeasonName, seasonName);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                updateWrapper.eq(DyeBasic::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                updateWrapper.eq(DyeBasic::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                updateWrapper.eq(DyeBasic::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                updateWrapper.eq(DyeBasic::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public LambdaUpdateWrapper<DyeBasic> builder() {
+            return updateWrapper;
+        }
+
+    }
+
+    public static class Builder {
+
+        private DyeBasic dyeBasic = new DyeBasic();
+
+        public Builder id(String id) {
+            dyeBasic.setId(id);
+            return this;
+        }
+
+        public Builder groupCode(String groupCode) {
+            dyeBasic.setGroupCode(groupCode);
+            return this;
+        }
+
+        public Builder projectId(String projectId) {
+            dyeBasic.setProjectId(projectId);
+            return this;
+        }
+
+        public Builder typeCode(String typeCode) {
+            dyeBasic.setTypeCode(typeCode);
+            return this;
+        }
+
+        public Builder typeName(String typeName) {
+            dyeBasic.setTypeName(typeName);
+            return this;
+        }
+
+        public Builder seasonCode(String seasonCode) {
+            dyeBasic.setSeasonCode(seasonCode);
+            return this;
+        }
+
+        public Builder seasonName(String seasonName) {
+            dyeBasic.setSeasonName(seasonName);
+            return this;
+        }
+
+        public Builder createTime(String createTime) {
+            dyeBasic.setCreateTime(createTime);
+            return this;
+        }
+
+        public Builder updateTime(String updateTime) {
+            dyeBasic.setUpdateTime(updateTime);
+            return this;
+        }
+
+        public Builder updateUserId(String updateUserId) {
+            dyeBasic.setUpdateUserId(updateUserId);
+            return this;
+        }
+
+        public Builder isDelete(String isDelete) {
+            dyeBasic.setIsDelete(isDelete);
+            return this;
+        }
+
+        public DyeBasic build() {
+            return dyeBasic;
+        }
+
+    }
+}

+ 380 - 0
src/main/java/com/persagy/dye/pojo/dto/DyeRuleCustom.java

@@ -0,0 +1,380 @@
+package com.persagy.dye.pojo.dto;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.persagy.common.model.BaseEntity;
+import com.persagy.common.utils.StringUtil;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * 染色规则自定义表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-27 11:39:52
+ */
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@TableName("dye_rule_custom")
+public class DyeRuleCustom extends BaseEntity<DyeRuleCustom> {
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String basicId;            // 基础表ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer upperLimit;            // 上限
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String upperSymbol;            // 上限符号
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer lowerLimit;            // 下限
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String lowerSymbol;            // 下限符号
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String name;            // 名称
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String colorValue;            // 色值
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String createTime;            // 创建时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateTime;            // 修改时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateUserId;            // 最后修改人ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String isDelete;            // 是否删除(0:否 1:是)
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer orderNum;            // 排序
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String numSymbol;            // 数值单位符号
+
+    /**
+     * 与WEB交互时正无穷符号
+     */
+    @TableField(exist = false)
+    private String tempUpperLimit;
+
+    /**
+     * 与WEB交互时负无穷符号
+     */
+    @TableField(exist = false)
+    private String tempLowerLimit;
+
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class BuilderQueryWrapper {
+
+        private LambdaQueryWrapper<DyeRuleCustom> queryWrapper = new LambdaQueryWrapper<DyeRuleCustom>();
+
+        public BuilderQueryWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                queryWrapper.eq(DyeRuleCustom::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper basicIdEq(String basicId) {
+            if (StringUtil.isNotBlank(basicId)) {
+                queryWrapper.eq(DyeRuleCustom::getBasicId, basicId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper upperLimitEq(Integer upperLimit) {
+            if (null != upperLimit) {
+                queryWrapper.eq(DyeRuleCustom::getUpperLimit, upperLimit);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper upperSymbolEq(String upperSymbol) {
+            if (StringUtil.isNotBlank(upperSymbol)) {
+                queryWrapper.eq(DyeRuleCustom::getUpperSymbol, upperSymbol);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper lowerLimitEq(Integer lowerLimit) {
+            if (null != lowerLimit) {
+                queryWrapper.eq(DyeRuleCustom::getLowerLimit, lowerLimit);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper lowerSymbolEq(String lowerSymbol) {
+            if (StringUtil.isNotBlank(lowerSymbol)) {
+                queryWrapper.eq(DyeRuleCustom::getLowerSymbol, lowerSymbol);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper nameEq(String name) {
+            if (StringUtil.isNotBlank(name)) {
+                queryWrapper.eq(DyeRuleCustom::getName, name);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper colorValueEq(String colorValue) {
+            if (StringUtil.isNotBlank(colorValue)) {
+                queryWrapper.eq(DyeRuleCustom::getColorValue, colorValue);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                queryWrapper.eq(DyeRuleCustom::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                queryWrapper.eq(DyeRuleCustom::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                queryWrapper.eq(DyeRuleCustom::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                queryWrapper.eq(DyeRuleCustom::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper orderNumEq(Integer orderNum) {
+            if (null != orderNum) {
+                queryWrapper.eq(DyeRuleCustom::getOrderNum, orderNum);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper numSymbolEq(String numSymbol) {
+            if (StringUtil.isNotBlank(numSymbol)) {
+                queryWrapper.eq(DyeRuleCustom::getNumSymbol, numSymbol);
+            }
+            return this;
+        }
+
+        public LambdaQueryWrapper<DyeRuleCustom> builder() {
+            return queryWrapper;
+        }
+
+    }
+
+    public static class BuilderUpdateWrapper {
+
+        private LambdaUpdateWrapper<DyeRuleCustom> updateWrapper = new LambdaUpdateWrapper<DyeRuleCustom>();
+
+        public BuilderUpdateWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                updateWrapper.eq(DyeRuleCustom::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper basicIdEq(String basicId) {
+            if (StringUtil.isNotBlank(basicId)) {
+                updateWrapper.eq(DyeRuleCustom::getBasicId, basicId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper upperLimitEq(Integer upperLimit) {
+            if (null != upperLimit) {
+                updateWrapper.eq(DyeRuleCustom::getUpperLimit, upperLimit);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper upperSymbolEq(String upperSymbol) {
+            if (StringUtil.isNotBlank(upperSymbol)) {
+                updateWrapper.eq(DyeRuleCustom::getUpperSymbol, upperSymbol);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper lowerLimitEq(Integer lowerLimit) {
+            if (null != lowerLimit) {
+                updateWrapper.eq(DyeRuleCustom::getLowerLimit, lowerLimit);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper lowerSymbolEq(String lowerSymbol) {
+            if (StringUtil.isNotBlank(lowerSymbol)) {
+                updateWrapper.eq(DyeRuleCustom::getLowerSymbol, lowerSymbol);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper nameEq(String name) {
+            if (StringUtil.isNotBlank(name)) {
+                updateWrapper.eq(DyeRuleCustom::getName, name);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper colorValueEq(String colorValue) {
+            if (StringUtil.isNotBlank(colorValue)) {
+                updateWrapper.eq(DyeRuleCustom::getColorValue, colorValue);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                updateWrapper.eq(DyeRuleCustom::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                updateWrapper.eq(DyeRuleCustom::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                updateWrapper.eq(DyeRuleCustom::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                updateWrapper.eq(DyeRuleCustom::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper orderNumEq(Integer orderNum) {
+            if (null != orderNum) {
+                updateWrapper.eq(DyeRuleCustom::getOrderNum, orderNum);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper numSymbolEq(String numSymbol) {
+            if (StringUtil.isNotBlank(numSymbol)) {
+                updateWrapper.eq(DyeRuleCustom::getNumSymbol, numSymbol);
+            }
+            return this;
+        }
+
+        public LambdaUpdateWrapper<DyeRuleCustom> builder() {
+            return updateWrapper;
+        }
+
+    }
+
+    public static class Builder {
+
+        private DyeRuleCustom dyeRuleCustom = new DyeRuleCustom();
+
+        public Builder id(String id) {
+            dyeRuleCustom.setId(id);
+            return this;
+        }
+
+        public Builder basicId(String basicId) {
+            dyeRuleCustom.setBasicId(basicId);
+            return this;
+        }
+
+        public Builder upperLimit(Integer upperLimit) {
+            dyeRuleCustom.setUpperLimit(upperLimit);
+            return this;
+        }
+
+        public Builder upperSymbol(String upperSymbol) {
+            dyeRuleCustom.setUpperSymbol(upperSymbol);
+            return this;
+        }
+
+        public Builder lowerLimit(Integer lowerLimit) {
+            dyeRuleCustom.setLowerLimit(lowerLimit);
+            return this;
+        }
+
+        public Builder lowerSymbol(String lowerSymbol) {
+            dyeRuleCustom.setLowerSymbol(lowerSymbol);
+            return this;
+        }
+
+        public Builder name(String name) {
+            dyeRuleCustom.setName(name);
+            return this;
+        }
+
+        public Builder colorValue(String colorValue) {
+            dyeRuleCustom.setColorValue(colorValue);
+            return this;
+        }
+
+        public Builder createTime(String createTime) {
+            dyeRuleCustom.setCreateTime(createTime);
+            return this;
+        }
+
+        public Builder updateTime(String updateTime) {
+            dyeRuleCustom.setUpdateTime(updateTime);
+            return this;
+        }
+
+        public Builder updateUserId(String updateUserId) {
+            dyeRuleCustom.setUpdateUserId(updateUserId);
+            return this;
+        }
+
+        public Builder isDelete(String isDelete) {
+            dyeRuleCustom.setIsDelete(isDelete);
+            return this;
+        }
+
+        public Builder orderNum(Integer orderNum) {
+            dyeRuleCustom.setOrderNum(orderNum);
+            return this;
+        }
+
+        public Builder numSymbol(String numSymbol) {
+            dyeRuleCustom.setNumSymbol(numSymbol);
+            return this;
+        }
+
+        public DyeRuleCustom build() {
+            return dyeRuleCustom;
+        }
+
+    }
+}

+ 380 - 0
src/main/java/com/persagy/dye/pojo/dto/DyeRuleDefault.java

@@ -0,0 +1,380 @@
+package com.persagy.dye.pojo.dto;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.persagy.common.model.BaseEntity;
+import com.persagy.common.utils.StringUtil;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * 默认染色规则
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-27 11:39:52
+ */
+@Getter
+@Setter
+@ToString
+@EqualsAndHashCode(callSuper = false)
+@TableName("dye_rule_default")
+public class DyeRuleDefault extends BaseEntity<DyeRuleDefault> {
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String basicId;            // 染色基础表ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer upperLimit;            // 上限
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String upperSymbol;            // 上限符号
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer lowerLimit;            // 下限
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String lowerSymbol;            // 下限符号
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String name;            // 名称
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String colorValue;            // 色值
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String createTime;            // 创建时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateTime;            // 更新时间
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String updateUserId;            // 最后更新人ID
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String isDelete;            // 是否删除(0:否  1:是)
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private Integer orderNum;            // 排序
+
+    @TableField(updateStrategy = FieldStrategy.NOT_EMPTY)
+    private String numSymbol;            // 数值单位符号
+
+    /**
+     * 与WEB交互时正无穷符号
+     */
+    @TableField(exist = false)
+    private String tempUpperLimit;
+
+    /**
+     * 与WEB交互时负无穷符号
+     */
+    @TableField(exist = false)
+    private String tempLowerLimit;
+
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class BuilderQueryWrapper {
+
+        private LambdaQueryWrapper<DyeRuleDefault> queryWrapper = new LambdaQueryWrapper<DyeRuleDefault>();
+
+        public BuilderQueryWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                queryWrapper.eq(DyeRuleDefault::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper basicIdEq(String basicId) {
+            if (StringUtil.isNotBlank(basicId)) {
+                queryWrapper.eq(DyeRuleDefault::getBasicId, basicId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper upperLimitEq(Integer upperLimit) {
+            if (null != upperLimit) {
+                queryWrapper.eq(DyeRuleDefault::getUpperLimit, upperLimit);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper upperSymbolEq(String upperSymbol) {
+            if (StringUtil.isNotBlank(upperSymbol)) {
+                queryWrapper.eq(DyeRuleDefault::getUpperSymbol, upperSymbol);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper lowerLimitEq(Integer lowerLimit) {
+            if (null != lowerLimit) {
+                queryWrapper.eq(DyeRuleDefault::getLowerLimit, lowerLimit);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper lowerSymbolEq(String lowerSymbol) {
+            if (StringUtil.isNotBlank(lowerSymbol)) {
+                queryWrapper.eq(DyeRuleDefault::getLowerSymbol, lowerSymbol);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper nameEq(String name) {
+            if (StringUtil.isNotBlank(name)) {
+                queryWrapper.eq(DyeRuleDefault::getName, name);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper colorValueEq(String colorValue) {
+            if (StringUtil.isNotBlank(colorValue)) {
+                queryWrapper.eq(DyeRuleDefault::getColorValue, colorValue);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                queryWrapper.eq(DyeRuleDefault::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                queryWrapper.eq(DyeRuleDefault::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                queryWrapper.eq(DyeRuleDefault::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                queryWrapper.eq(DyeRuleDefault::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper orderNumEq(Integer orderNum) {
+            if (null != orderNum) {
+                queryWrapper.eq(DyeRuleDefault::getOrderNum, orderNum);
+            }
+            return this;
+        }
+
+        public BuilderQueryWrapper numSymbolEq(String numSymbol) {
+            if (StringUtil.isNotBlank(numSymbol)) {
+                queryWrapper.eq(DyeRuleDefault::getNumSymbol, numSymbol);
+            }
+            return this;
+        }
+
+        public LambdaQueryWrapper<DyeRuleDefault> builder() {
+            return queryWrapper;
+        }
+
+    }
+
+    public static class BuilderUpdateWrapper {
+
+        private LambdaUpdateWrapper<DyeRuleDefault> updateWrapper = new LambdaUpdateWrapper<DyeRuleDefault>();
+
+        public BuilderUpdateWrapper idEq(String id) {
+            if (StringUtil.isNotBlank(id)) {
+                updateWrapper.eq(DyeRuleDefault::getId, id);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper basicIdEq(String basicId) {
+            if (StringUtil.isNotBlank(basicId)) {
+                updateWrapper.eq(DyeRuleDefault::getBasicId, basicId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper upperLimitEq(Integer upperLimit) {
+            if (null != upperLimit) {
+                updateWrapper.eq(DyeRuleDefault::getUpperLimit, upperLimit);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper upperSymbolEq(String upperSymbol) {
+            if (StringUtil.isNotBlank(upperSymbol)) {
+                updateWrapper.eq(DyeRuleDefault::getUpperSymbol, upperSymbol);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper lowerLimitEq(Integer lowerLimit) {
+            if (null != lowerLimit) {
+                updateWrapper.eq(DyeRuleDefault::getLowerLimit, lowerLimit);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper lowerSymbolEq(String lowerSymbol) {
+            if (StringUtil.isNotBlank(lowerSymbol)) {
+                updateWrapper.eq(DyeRuleDefault::getLowerSymbol, lowerSymbol);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper nameEq(String name) {
+            if (StringUtil.isNotBlank(name)) {
+                updateWrapper.eq(DyeRuleDefault::getName, name);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper colorValueEq(String colorValue) {
+            if (StringUtil.isNotBlank(colorValue)) {
+                updateWrapper.eq(DyeRuleDefault::getColorValue, colorValue);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper createTimeEq(String createTime) {
+            if (StringUtil.isNotBlank(createTime)) {
+                updateWrapper.eq(DyeRuleDefault::getCreateTime, createTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateTimeEq(String updateTime) {
+            if (StringUtil.isNotBlank(updateTime)) {
+                updateWrapper.eq(DyeRuleDefault::getUpdateTime, updateTime);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper updateUserIdEq(String updateUserId) {
+            if (StringUtil.isNotBlank(updateUserId)) {
+                updateWrapper.eq(DyeRuleDefault::getUpdateUserId, updateUserId);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper isDeleteEq(String isDelete) {
+            if (StringUtil.isNotBlank(isDelete)) {
+                updateWrapper.eq(DyeRuleDefault::getIsDelete, isDelete);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper orderNumEq(Integer orderNum) {
+            if (null != orderNum) {
+                updateWrapper.eq(DyeRuleDefault::getOrderNum, orderNum);
+            }
+            return this;
+        }
+
+        public BuilderUpdateWrapper numSymbolEq(String numSymbol) {
+            if (StringUtil.isNotBlank(numSymbol)) {
+                updateWrapper.eq(DyeRuleDefault::getNumSymbol, numSymbol);
+            }
+            return this;
+        }
+
+        public LambdaUpdateWrapper<DyeRuleDefault> builder() {
+            return updateWrapper;
+        }
+
+    }
+
+    public static class Builder {
+
+        private DyeRuleDefault dyeRuleDefault = new DyeRuleDefault();
+
+        public Builder id(String id) {
+            dyeRuleDefault.setId(id);
+            return this;
+        }
+
+        public Builder basicId(String basicId) {
+            dyeRuleDefault.setBasicId(basicId);
+            return this;
+        }
+
+        public Builder upperLimit(Integer upperLimit) {
+            dyeRuleDefault.setUpperLimit(upperLimit);
+            return this;
+        }
+
+        public Builder upperSymbol(String upperSymbol) {
+            dyeRuleDefault.setUpperSymbol(upperSymbol);
+            return this;
+        }
+
+        public Builder lowerLimit(Integer lowerLimit) {
+            dyeRuleDefault.setLowerLimit(lowerLimit);
+            return this;
+        }
+
+        public Builder lowerSymbol(String lowerSymbol) {
+            dyeRuleDefault.setLowerSymbol(lowerSymbol);
+            return this;
+        }
+
+        public Builder name(String name) {
+            dyeRuleDefault.setName(name);
+            return this;
+        }
+
+        public Builder colorValue(String colorValue) {
+            dyeRuleDefault.setColorValue(colorValue);
+            return this;
+        }
+
+        public Builder createTime(String createTime) {
+            dyeRuleDefault.setCreateTime(createTime);
+            return this;
+        }
+
+        public Builder updateTime(String updateTime) {
+            dyeRuleDefault.setUpdateTime(updateTime);
+            return this;
+        }
+
+        public Builder updateUserId(String updateUserId) {
+            dyeRuleDefault.setUpdateUserId(updateUserId);
+            return this;
+        }
+
+        public Builder isDelete(String isDelete) {
+            dyeRuleDefault.setIsDelete(isDelete);
+            return this;
+        }
+
+        public Builder orderNum(Integer orderNum) {
+            dyeRuleDefault.setOrderNum(orderNum);
+            return this;
+        }
+
+        public Builder numSymbol(String numSymbol) {
+            dyeRuleDefault.setNumSymbol(numSymbol);
+            return this;
+        }
+
+        public DyeRuleDefault build() {
+            return dyeRuleDefault;
+        }
+
+    }
+}

+ 30 - 0
src/main/java/com/persagy/dye/pojo/vo/DyeScaleplateVO.java

@@ -0,0 +1,30 @@
+package com.persagy.dye.pojo.vo;
+
+import com.persagy.dye.pojo.dto.DyeBasic;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description: 染色标尺与页面交互传参对象(因为涉及两个表传参,所以增加这个对象)
+ * @author: YangWanYi
+ * @create: 2021-10-25 17:26
+ **/
+@Getter
+@Setter
+@ToString
+@ApiModel
+public class DyeScaleplateVO extends DyeBasic {
+
+    @ApiModelProperty(value = "动态监测数据")
+    private List<Map<String, Object>> dynamicArray;
+
+    @ApiModelProperty(value = "参数查询日期")
+    private String queryDate;
+
+}

+ 24 - 0
src/main/java/com/persagy/dye/service/IDyeBasicService.java

@@ -0,0 +1,24 @@
+package com.persagy.dye.service;
+
+import com.persagy.db.service.ISuperService;
+import com.persagy.dye.pojo.dto.DyeBasic;
+
+/**
+ * 染色基础表
+ *
+ * @version v1.0.0
+ * @company persagy
+ * @author yangwanyi
+ * @date 2021-10-25 15:58:56
+ */
+public interface IDyeBasicService extends ISuperService<DyeBasic> {
+
+    /**
+     * 根据主键逻辑删除染色基础表信息
+     * @param dyeBasicId 染色基础表主键
+     * @param updateUserId 修改人ID
+     * @return boolean
+     */
+    boolean deleteDyeBasicById(String dyeBasicId, String updateUserId);
+}
+

+ 24 - 0
src/main/java/com/persagy/dye/service/IDyeRuleCustomService.java

@@ -0,0 +1,24 @@
+package com.persagy.dye.service;
+
+import com.persagy.db.service.ISuperService;
+import com.persagy.dye.pojo.dto.DyeRuleCustom;
+
+/**
+ * 染色规则自定义表
+ * 
+ * @version v1.0.0
+ * @company persagy 
+ * @author yangwanyi
+ * @date 2021-10-25 15:58:56
+ */
+public interface IDyeRuleCustomService extends ISuperService<DyeRuleCustom> {
+
+    /**
+     * 根据主键逻辑删除染色规则自定义表信息
+     * @param dyeRuleCustomId 染色规则自定义表主键
+     * @param updateUserId 修改人ID
+     * @return boolean
+     */
+    boolean deleteDyeRuleCustomById(String dyeRuleCustomId, String updateUserId);
+}
+

+ 25 - 0
src/main/java/com/persagy/dye/service/IDyeRuleDefaultService.java

@@ -0,0 +1,25 @@
+package com.persagy.dye.service;
+
+import com.persagy.db.service.ISuperService;
+import com.persagy.dye.pojo.dto.DyeRuleDefault;
+
+/**
+ * 默认染色规则
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+public interface IDyeRuleDefaultService extends ISuperService<DyeRuleDefault> {
+
+    /**
+     * 根据主键逻辑删除染色规则默认表信息
+     *
+     * @param dyeRuleDefaultId 染色规则默认表主键
+     * @param updateUserId     修改人ID
+     * @return boolean
+     */
+    boolean deleteDyeRuleDefaultById(String dyeRuleDefaultId, String updateUserId);
+}
+

+ 25 - 0
src/main/java/com/persagy/dye/service/IDyeSdkService.java

@@ -0,0 +1,25 @@
+package com.persagy.dye.service;
+
+import com.persagy.dye.pojo.vo.DyeScaleplateVO;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IDyeSdkService {
+
+    /**
+     * 查询空间对应的染色标尺
+     *
+     * @param dyeScaleplateVO
+     * @return List<Map < String, Object>>
+     */
+    List<Map<String, Object>> listDyeScaleplateWithSpaceIds(DyeScaleplateVO dyeScaleplateVO);
+
+    /**
+     * 查询指定集团、项目和类型的染色标尺列表
+     *
+     * @param dyeScaleplateVO
+     * @return List<Map < String, Object>>
+     */
+    List<Map<String, Object>> listDyeScaleplateByType(DyeScaleplateVO dyeScaleplateVO);
+}

+ 47 - 0
src/main/java/com/persagy/dye/service/impl/DyeBasicServiceImpl.java

@@ -0,0 +1,47 @@
+package com.persagy.dye.service.impl;
+
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.db.service.impl.SuperServiceImpl;
+import com.persagy.dye.constant.DyeConstant;
+import com.persagy.dye.mapper.DyeBasicMapper;
+import com.persagy.dye.pojo.dto.DyeBasic;
+import com.persagy.dye.service.IDyeBasicService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * 染色基础表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+@Service
+public class DyeBasicServiceImpl extends SuperServiceImpl<DyeBasicMapper, DyeBasic> implements IDyeBasicService {
+
+    @Autowired
+    private DyeBasicMapper dyeBasicMapper;
+
+    /**
+     * 根据主键逻辑删除染色基础表信息
+     *
+     * @param dyeBasicId   染色基础表主键
+     * @param updateUserId 修改人ID
+     * @return boolean
+     */
+    @Override
+    public boolean deleteDyeBasicById(String dyeBasicId, String updateUserId) {
+        DyeBasic dyeBasic = this.dyeBasicMapper.selectById(dyeBasicId);
+        if (dyeBasic == null) {
+            throw new RuntimeException("要删除的主键为" + dyeBasicId + "的染色基础表数据不存在");
+        }
+        dyeBasic.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeBasic.setUpdateUserId(updateUserId);
+        dyeBasic.setIsDelete(DyeConstant.DELETED);
+        return SqlHelper.retBool(this.dyeBasicMapper.updateById(dyeBasic));
+    }
+}

+ 47 - 0
src/main/java/com/persagy/dye/service/impl/DyeRuleCustomServiceImpl.java

@@ -0,0 +1,47 @@
+package com.persagy.dye.service.impl;
+
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.db.service.impl.SuperServiceImpl;
+import com.persagy.dye.constant.DyeConstant;
+import com.persagy.dye.mapper.DyeRuleCustomMapper;
+import com.persagy.dye.pojo.dto.DyeRuleCustom;
+import com.persagy.dye.service.IDyeRuleCustomService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * 染色规则自定义表
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+@Service
+public class DyeRuleCustomServiceImpl extends SuperServiceImpl<DyeRuleCustomMapper, DyeRuleCustom> implements IDyeRuleCustomService {
+
+    @Autowired
+    private DyeRuleCustomMapper dyeRuleCustomMapper;
+
+    /**
+     * 根据主键逻辑删除染色规则自定义表信息
+     *
+     * @param dyeRuleCustomId 染色规则自定义表主键
+     * @param updateUserId    修改人ID
+     * @return boolean
+     */
+    @Override
+    public boolean deleteDyeRuleCustomById(String dyeRuleCustomId, String updateUserId) {
+        DyeRuleCustom dyeRuleCustom = this.dyeRuleCustomMapper.selectById(dyeRuleCustomId);
+        if (dyeRuleCustom == null) {
+            throw new RuntimeException("要删除的主键为" + dyeRuleCustomId + "的染色规则自定义表数据不存在");
+        }
+        dyeRuleCustom.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleCustom.setUpdateUserId(updateUserId);
+        dyeRuleCustom.setIsDelete(DyeConstant.DELETED);
+        return SqlHelper.retBool(this.dyeRuleCustomMapper.updateById(dyeRuleCustom));
+    }
+}

+ 47 - 0
src/main/java/com/persagy/dye/service/impl/DyeRuleDefaultServiceImpl.java

@@ -0,0 +1,47 @@
+package com.persagy.dye.service.impl;
+
+import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
+import com.persagy.common.utils.DateUtil;
+import com.persagy.db.service.impl.SuperServiceImpl;
+import com.persagy.dye.constant.DyeConstant;
+import com.persagy.dye.mapper.DyeRuleDefaultMapper;
+import com.persagy.dye.pojo.dto.DyeRuleDefault;
+import com.persagy.dye.service.IDyeRuleDefaultService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * 默认染色规则
+ *
+ * @author yangwanyi
+ * @version v1.0.0
+ * @company persagy
+ * @date 2021-10-25 15:58:56
+ */
+@Service
+public class DyeRuleDefaultServiceImpl extends SuperServiceImpl<DyeRuleDefaultMapper, DyeRuleDefault> implements IDyeRuleDefaultService {
+
+    @Autowired
+    private DyeRuleDefaultMapper dyeRuleDefaultMapper;
+
+    /**
+     * 根据主键逻辑删除染色规则默认表信息
+     *
+     * @param dyeRuleDefaultId 染色规则默认表主键
+     * @param updateUserId     修改人ID
+     * @return boolean
+     */
+    @Override
+    public boolean deleteDyeRuleDefaultById(String dyeRuleDefaultId, String updateUserId) {
+        DyeRuleDefault dyeRuleDefault = this.dyeRuleDefaultMapper.selectById(dyeRuleDefaultId);
+        if (dyeRuleDefault == null) {
+            throw new RuntimeException("要删除的主键为" + dyeRuleDefaultId + "的染色规则默认表数据不存在");
+        }
+        dyeRuleDefault.setUpdateTime(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYY_MM_DD_HH_MM_SS));
+        dyeRuleDefault.setUpdateUserId(updateUserId);
+        dyeRuleDefault.setIsDelete(DyeConstant.DELETED);
+        return SqlHelper.retBool(this.dyeRuleDefaultMapper.updateById(dyeRuleDefault));
+    }
+}

+ 160 - 0
src/main/java/com/persagy/dye/service/impl/DyeSdkServiceImpl.java

@@ -0,0 +1,160 @@
+package com.persagy.dye.service.impl;
+
+import com.persagy.common.utils.DateUtil;
+import com.persagy.dye.constant.DyeConstant;
+import com.persagy.dye.mapper.DyeRuleCustomMapper;
+import com.persagy.dye.mapper.DyeRuleDefaultMapper;
+import com.persagy.dye.pojo.dto.DyeRuleCustom;
+import com.persagy.dye.pojo.dto.DyeRuleDefault;
+import com.persagy.dye.pojo.vo.DyeScaleplateVO;
+import com.persagy.dye.service.IDyeSdkService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * @description: SDK染色标尺维护接口
+ * @author: YangWanYi
+ * @create: 2021-10-25 18:08
+ **/
+@Service
+@Slf4j
+public class DyeSdkServiceImpl implements IDyeSdkService {
+
+    @Autowired
+    private DyeRuleCustomMapper dyeRuleCustomMapper;
+
+    @Autowired
+    private DyeRuleDefaultMapper dyeRuleDefaultMapper;
+
+
+    /**
+     * 查询空间对应的染色标尺
+     *
+     * @param dyeScaleplateVO
+     * @return List<Map < String, Object>>
+     */
+    @Override
+    public List<Map<String, Object>> listDyeScaleplateWithSpaceIds(DyeScaleplateVO dyeScaleplateVO) {
+        ArrayList<Map<String, Object>> list = new ArrayList<>();
+        if (!dyeScaleplateVO.getDynamicArray().isEmpty()) {
+            DyeRuleCustom customRule;
+            DyeRuleDefault defaultRule;
+            HashMap<String, Object> resultMap = new HashMap<>();
+            /*
+                1、优先获取自定义的染色标尺,没有再获取默认的
+                2、根据当前日期判断属于哪个季
+             */
+            dyeScaleplateVO.setQueryDate(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYYMMDD));
+            for (Map<String, Object> map : dyeScaleplateVO.getDynamicArray()) {
+                customRule = this.dyeRuleCustomMapper.getDistrictDyeRuleCustom(dyeScaleplateVO, map.get(DyeConstant.REALTIME_NUM) == null ? 0 : Integer.parseInt(String.valueOf(map.get(DyeConstant.REALTIME_NUM))));
+                if (customRule != null) {
+                    resultMap = this.changeProperties(customRule.getUpperLimit() + customRule.getUpperSymbol(), customRule.getLowerSymbol() + customRule.getLowerLimit(), customRule.getName(), customRule.getColorValue(), customRule.getId());
+                } else {
+                    defaultRule = this.dyeRuleDefaultMapper.getDistrictDyeRuleDefault(dyeScaleplateVO, map.get(DyeConstant.REALTIME_NUM) == null ? 0 : Integer.parseInt(String.valueOf(map.get(DyeConstant.REALTIME_NUM))));
+                    if (defaultRule != null) {
+                        resultMap = this.changeProperties(defaultRule.getUpperLimit() + defaultRule.getUpperSymbol(), defaultRule.getLowerSymbol() + defaultRule.getLowerLimit(), defaultRule.getName(), defaultRule.getColorValue(), defaultRule.getId());
+                    }
+                }
+                resultMap.put(DyeConstant.PROJECT_ID, dyeScaleplateVO.getProjectId()); // 项目ID
+                resultMap.put(DyeConstant.GROUP_CODE, dyeScaleplateVO.getGroupCode()); // 集团编码
+                resultMap.put(DyeConstant.TYPE_CODE, dyeScaleplateVO.getTypeCode()); // 染色类型
+                resultMap.put(DyeConstant.SPACE_ID, map.get(DyeConstant.SPACE_ID)); // 空间ID
+                resultMap.put(DyeConstant.REALTIME_NUM, map.get(DyeConstant.REALTIME_NUM)); // 动态检测值
+                list.add(resultMap);
+            }
+        }
+        return list;
+    }
+
+
+    /**
+     * 查询指定集团、项目和类型的染色标尺列表
+     *
+     * @param dyeScaleplateVO
+     * @return List<Map < String, Object>>
+     */
+    @Override
+    public List<Map<String, Object>> listDyeScaleplateByType(DyeScaleplateVO dyeScaleplateVO) {
+        /*
+            1、如果自定义表中没有数据,则获取默认表的数据
+            2、根据当前日期判断属于哪个季
+         */
+        List<Map<String, Object>> list = new ArrayList<>();
+        dyeScaleplateVO.setQueryDate(DateUtil.format(new Date(), DateUtil.FORMAT_DATE_YYYYMMDD));
+        List<DyeRuleCustom> customList = this.dyeRuleCustomMapper.listDyeRuleCustomByType(dyeScaleplateVO);
+        log.debug("com.persagy.dye.service.impl.DyeSdkServiceImpl.listDyeScaleplateByType,自定义染色标尺数据:{}", customList);
+        if (!customList.isEmpty()) {
+            for (DyeRuleCustom customRule : customList) {
+                list.add(this.changeProperties(customRule.getUpperLimit() + customRule.getUpperSymbol(), customRule.getLowerSymbol() + customRule.getLowerLimit(), customRule.getName(), customRule.getColorValue(), customRule.getId()));
+            }
+            return list;
+        }
+        List<DyeRuleDefault> defaultList = this.dyeRuleDefaultMapper.listDyeRuleDefaultByType(dyeScaleplateVO);
+        log.debug("com.persagy.dye.service.impl.DyeSdkServiceImpl.listDyeScaleplateByType,默认染色标尺数据:{}", defaultList);
+        if (!defaultList.isEmpty()) {
+            for (DyeRuleDefault defaultRule : defaultList) {
+                list.add(this.changeProperties(defaultRule.getUpperLimit() + defaultRule.getUpperSymbol(), defaultRule.getLowerSymbol() + defaultRule.getLowerLimit(), defaultRule.getName(), defaultRule.getColorValue(), defaultRule.getId()));
+            }
+        }
+        return list;
+    }
+
+
+    /**
+     * 把两个不同对象转换为前台需要的数据
+     *
+     * @param upperLimit 上限
+     * @param lowerLimit 下限
+     * @param name       名称
+     * @param colorValue 色值
+     * @param id         染色标尺ID(可能是默认标尺ID也可能是自定义标尺ID 主要是给SDK使用)
+     * @return HashMap<String, Object>
+     */
+    private HashMap<String, Object> changeProperties(String upperLimit, String lowerLimit, String name, String colorValue, String id) {
+        HashMap<String, Object> map = new HashMap<>();
+        map.put(DyeConstant.UPPER_LIMIT, this.replace99ToBoundless(upperLimit)); // 上限
+        map.put(DyeConstant.LOWER_LIMIT, this.replace99ToBoundless(lowerLimit)); // 下限
+        map.put(DyeConstant.NAME, name); // 名称
+        map.put(DyeConstant.COLOR_VALUE, colorValue); // 色值
+        map.put(DyeConstant.DYE_ID, id); // 染色标尺ID
+        return map;
+    }
+
+    /**
+     * 把上下限的99替换为∞(数据库存99是为了方便数值对比)
+     *
+     * @param limit 上限或下限
+     * @return String
+     */
+    public String replace99ToBoundless(String limit) {
+        final String numLimit = "99";
+        if (limit.indexOf(numLimit) != -1) {
+            limit = limit.replace(numLimit, "∞");
+            if (limit.indexOf("-") == -1) { // 正无穷拼接加号
+                limit = "+" + limit;
+            }
+        }
+        return limit;
+    }
+
+    /**
+     * 与WEB交互时,把上下限值转换为数值类型(数据库存99是为了方便数值对比)
+     *
+     * @param tempLimit 与WEB交互的上限或下限字段
+     * @return Integer
+     */
+    public Integer replaceBoundlessTo99(String tempLimit) {
+        final String boundless = "∞";
+        if (tempLimit.indexOf(boundless) == -1) {
+            return Integer.valueOf(tempLimit); // 非无穷限值直接转换为数值类型返回
+        }
+        int limitValue = 99; // 无穷限值替换为99
+        if (tempLimit.indexOf("-") != -1) {  // 负无穷限值把99转换为负数
+            limitValue = -limitValue;
+        }
+        return limitValue;
+    }
+}

+ 20 - 0
src/main/resources/mapper/DyeBasicMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.persagy.dye.mapper.DyeBasicMapper">
+
+    <resultMap id="BaseResultMap" type="com.persagy.dye.pojo.dto.DyeBasic">
+        <result column="id" property="id" jdbcType="VARCHAR" />
+        <result column="group_code" property="groupCode" jdbcType="VARCHAR" />
+        <result column="project_id" property="projectId" jdbcType="VARCHAR" />
+        <result column="type_code" property="typeCode" jdbcType="VARCHAR" />
+        <result column="type_name" property="typeName" jdbcType="VARCHAR" />
+        <result column="season_code" property="seasonCode" jdbcType="VARCHAR" />
+        <result column="season_name" property="seasonName" jdbcType="VARCHAR" />
+        <result column="create_time" property="createTime" jdbcType="VARCHAR" />
+        <result column="update_time" property="updateTime" jdbcType="VARCHAR" />
+        <result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
+        <result column="is_delete" property="isDelete" jdbcType="VARCHAR" />
+    </resultMap>
+
+</mapper>

+ 53 - 0
src/main/resources/mapper/DyeRuleCustomMapper.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.persagy.dye.mapper.DyeRuleCustomMapper">
+
+    <resultMap id="BaseResultMap" type="com.persagy.dye.pojo.dto.DyeRuleCustom">
+        <result column="id" property="id" jdbcType="VARCHAR" />
+        <result column="basic_id" property="basicId" jdbcType="VARCHAR" />
+        <result column="upper_limit" property="upperLimit" jdbcType="INTEGER" />
+        <result column="upper_symbol" property="upperSymbol" jdbcType="VARCHAR" />
+        <result column="lower_limit" property="lowerLimit" jdbcType="INTEGER" />
+        <result column="lower_symbol" property="lowerSymbol" jdbcType="VARCHAR" />
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="color_value" property="colorValue" jdbcType="VARCHAR" />
+        <result column="create_time" property="createTime" jdbcType="VARCHAR" />
+        <result column="update_time" property="updateTime" jdbcType="VARCHAR" />
+        <result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
+        <result column="is_delete" property="isDelete" jdbcType="VARCHAR" />
+        <result column="order_num" property="orderNum" jdbcType="INTEGER" />
+        <result column="num_symbol" property="numSymbol" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="listDyeRuleCustomByType" resultMap="BaseResultMap">
+        SELECT *
+        FROM `dye_rule_custom`
+        WHERE basic_id in
+              (SELECT id
+               FROM dye_basic
+               WHERE GROUP_CODE = #{groupCode}
+                 AND PROJECT_ID = #{projectId}
+                 AND type_code = #{typeCode}
+                 AND season_code = (SELECT DICT_CODE FROM `work_calendar_label`  WHERE LABEL_DATE = #{queryDate} AND PROJECT_ID = #{projectId})
+                 AND is_delete = 0)
+          AND is_delete = 0
+        ORDER BY order_num
+    </select>
+
+    <select id="getDistrictDyeRuleCustom" resultMap="BaseResultMap">
+        SELECT *
+        FROM `dye_rule_custom`
+        WHERE basic_id IN (SELECT id
+                           FROM dye_basic
+                           WHERE GROUP_CODE = #{dyeScaleplateVO.groupCode}
+                             AND PROJECT_ID = #{dyeScaleplateVO.projectId}
+                             AND type_code = #{dyeScaleplateVO.typeCode}
+                             AND is_delete = 0
+                             AND season_code = (SELECT DICT_CODE FROM `work_calendar_label`  WHERE LABEL_DATE = #{dyeScaleplateVO.queryDate} AND PROJECT_ID = #{dyeScaleplateVO.projectId}))
+          AND is_delete = 0
+          AND ((upper_symbol = '(' AND upper_limit &gt; #{numValue}) OR (upper_symbol = '[' AND upper_limit &gt;= #{numValue}))
+          AND ((lower_symbol = ')' AND lower_limit &lt; #{numValue}) OR (lower_symbol = ']' AND lower_limit &lt;= #{numValue}))
+        ORDER BY order_num
+    </select>
+</mapper>

+ 53 - 0
src/main/resources/mapper/DyeRuleDefaultMapper.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.persagy.dye.mapper.DyeRuleDefaultMapper">
+
+    <resultMap id="BaseResultMap" type="com.persagy.dye.pojo.dto.DyeRuleDefault">
+        <result column="id" property="id" jdbcType="VARCHAR" />
+        <result column="basic_id" property="basicId" jdbcType="VARCHAR" />
+        <result column="upper_limit" property="upperLimit" jdbcType="INTEGER" />
+        <result column="upper_symbol" property="upperSymbol" jdbcType="VARCHAR" />
+        <result column="lower_limit" property="lowerLimit" jdbcType="INTEGER" />
+        <result column="lower_symbol" property="lowerSymbol" jdbcType="VARCHAR" />
+        <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="color_value" property="colorValue" jdbcType="VARCHAR" />
+        <result column="create_time" property="createTime" jdbcType="VARCHAR" />
+        <result column="update_time" property="updateTime" jdbcType="VARCHAR" />
+        <result column="update_user_id" property="updateUserId" jdbcType="VARCHAR" />
+        <result column="is_delete" property="isDelete" jdbcType="VARCHAR" />
+        <result column="order_num" property="orderNum" jdbcType="INTEGER" />
+        <result column="num_symbol" property="numSymbol" jdbcType="VARCHAR" />
+    </resultMap>
+
+    <select id="listDyeRuleDefaultByType" resultMap="BaseResultMap">
+        SELECT *
+        FROM `dye_rule_default`
+        WHERE basic_id in
+              (SELECT id
+               FROM dye_basic
+               WHERE GROUP_CODE = #{groupCode}
+                 AND PROJECT_ID = #{projectId}
+                 AND type_code = #{typeCode}
+                 AND season_code =  (SELECT DICT_CODE FROM `work_calendar_label`  WHERE LABEL_DATE = #{queryDate} AND PROJECT_ID = #{projectId})
+                 AND is_delete = 0)
+          AND is_delete = 0
+        ORDER BY order_num
+    </select>
+
+    <select id="getDistrictDyeRuleDefault" resultMap="BaseResultMap">
+        SELECT *
+        FROM `dye_rule_default`
+        WHERE basic_id IN (SELECT id
+                           FROM dye_basic
+                           WHERE GROUP_CODE = #{dyeScaleplateVO.groupCode}
+                             AND PROJECT_ID = #{dyeScaleplateVO.projectId}
+                             AND type_code = #{dyeScaleplateVO.typeCode}
+                             AND is_delete = 0
+                             AND season_code = (SELECT DICT_CODE FROM `work_calendar_label`  WHERE LABEL_DATE = #{dyeScaleplateVO.queryDate} AND PROJECT_ID = #{dyeScaleplateVO.projectId}))
+          AND is_delete = 0
+          AND ((upper_symbol = '(' AND upper_limit &gt; #{numValue}) OR (upper_symbol = '[' AND upper_limit &gt;= #{numValue}))
+          AND ((lower_symbol = ')' AND lower_limit &lt; #{numValue}) OR (lower_symbol = ']' AND lower_limit &lt;= #{numValue}))
+        ORDER BY order_num
+    </select>
+</mapper>