{ "title": "归集行业信息-生成站内信消息", "groupId": "cdc-generate-inner-message", "batchSize": 500, "batchIntervalMs": 2000, "kafkaConnections": [ { "name": "kafka-collection", "bootstrapServer": "117.78.39.204:9092" } ], "jdbcConnections": [ { "name": "obpm2-mc-notice-jdbc", "url": "jdbc:mysql://172.20.0.196:3306/obpm2?characterEncoding=UTF-8&serverTimezone=GMT%2B8&allowMultiQueries=true&autoReconnect=true", "userName": "bcx", "password": "Wstestv5qy#2022", "driverClassName": "com.mysql.cj.jdbc.Driver" } ], "topicSubscribers": [ { "uid": "mc-notice_rd_security_station_rail_messages", "topic": "dispatch.binlog-cdc.topic.v2.rd_security_station_rail_messages", "refKafkaName": "kafka-collection", "subscriberContents": [ { "uid": "notice_rd_security_station_rail_messages_notice_01", "title": "将围栏告警信息推送到个人手机app", "refJdbcName": "obpm2-mc-notice-jdbc", "type": "JDBC", "content": "INSERT INTO `mc_notice`(`ID`, `IS_READ`, `SUMMARY`, `TO_USER_ID`, `CREATE_TIME`, `LINK_PARAMS`, `MODULE`, `DOMAIN_ID`, `SUBJECT_TYPE`, `CONTENT`) VALUES (:after.pk_id, 0, '围栏告警通知', :after.employee_id, :after.created_time, '{}', '围栏告警', :after.organization_id, 21, concat('{\"name\":\"',:after.employee_name,'\",\"ruleType\":\"',(case when :after.rail_rule_type=0 then '离开告警' when :after.rail_rule_type=1 then '进入告警' else '进出告警' end),'\",\"railName\":\"',:after.station_rail_name,'\",\"stationName\":\"',:after.rail_reference_name,'\",\"createdTime\":\"',:after.created_time,'\"}')) ON DUPLICATE KEY UPDATE CREATE_TIME=CURRENT_TIMESTAMP" } ] }, { "uid": "mc-notice_police_incidents", "topic": "dispatch.binlog-cdc.topic.v2.police_incidents", "refKafkaName": "kafka-collection", "subscriberContents": [ { "uid": "mc-notice_police_incidents_01", "title": "将线索上报推送到所管辖的民警个人手机app", "refJdbcName": "obpm2-mc-notice-jdbc", "type": "JDBC", "content": "INSERT INTO `mc_notice`(`ID`, `IS_READ`, `SUMMARY`, `TO_USER_ID`, `CREATE_TIME`, `LINK_PARAMS`, `MODULE`, `DOMAIN_ID`, `SUBJECT_TYPE`, `CONTENT`)\nSELECT \n CONCAT(:after.id,'-',r.employee_id),0,'警情通知提醒', r.employee_id,:after.created_time,'{}', '警情通知提醒',:after.organization_id,22,\n\tconcat('{\"id\":\"',:after.id,'\",\"type\":\"',:after.type,'\",\"typeName\":\"',IFNULL(:after.type_name,''),'\",\"content\":\"',IFNULL(:after.reason,''),'\",\"status\":\"',(case when :after.police_status=1 then '处理中' when :after.police_status=2 then '已处理' else '待处理' end),'\",\"createdTime\":\"',:after.created_time,'\"}')\nFROM obpm2.tenant_department_employee_relations r where r.department_id = :after.supervise_depart_id\nON DUPLICATE KEY UPDATE CREATE_TIME=CURRENT_TIMESTAMP" } ] }, { "uid": "cdc-tenant_employee_attendance_records", "topic": "dispatch.binlog-cdc.topic.v2.tenant_employee_attendance_records", "refKafkaName": "kafka-collection", "subscriberContents": [ { "uid": "cdc-tenant_employee_attendance_records_01", "title": "签到同步至应用巡防记录信息", "refJdbcName": "obpm2-mc-notice-jdbc", "type": "JDBC", "content": "INSERT INTO `duty`.`tlk_task_employee_checkin_records`(`ITEM_TASKID`, `ITEM_EMPLOYEEID`, `ITEM_POINTID`, `ID`, `ITEM_OCCUPATIONTYPE`) SELECT :after.reference_number,:after.tenant_employee_id, :after.reference_number_3, :after.id, NULL FROM DUAL WHERE :after.reference_number_3 !='#1' ON DUPLICATE KEY UPDATE ITEM_POINTID=:after.reference_number_3,ITEM_TASKID=:after.reference_number" } ] }, { "uid": "cdc-duty-tlk_patrol_task_employee_relations_points", "topic": "duty.binlog-cdc.topic.v2.tlk_patrol_task_employee_relations", "refKafkaName": "kafka-collection", "subscriberContents": [ { "uid": "cdc-tlk_patrol_task_employee_relations_points_01", "title": "完成巡防任务的时候同步赚取积分信息", "refJdbcName": "obpm2-mc-notice-jdbc", "type": "JDBC", "content": "INSERT INTO `dispatch`.`user_purse_transactions`\n(`reference_type`, `reference_number`, `note`, `points`, `user_purse_id`, `created_time`)\nSELECT 2,CONCAT(t.ID,\"-\",:after.ITEM_EMPLOYEEID),CONCAT('巡防任务: ',IFNULL(t.ITEM_NAME,'')),IFNULL(t.ITEM_POINTS,'0'),(select ee.tenant_user_id from obpm2.tenant_employees ee where ee.id=:after.ITEM_EMPLOYEEID limit 1),CURRENT_TIMESTAMP FROM duty.tlk_patrol_tasks t where t.ID=:after.ITEM_TASKID and :after.ITEM_STATUS='3' and t.ITEM_POINTS REGEXP '^[0-9]+$' ON DUPLICATE KEY UPDATE points=IFNULL(t.ITEM_POINTS,'0');\n insert into `dispatch`.user_purses(id,points,created_time)\n select\n user_purse_id,points,CURRENT_TIMESTAMP\n from (\n select\n user_purse_id,sum(points) as points,CURRENT_TIMESTAMP\n from `dispatch`.user_purse_transactions where user_purse_id in (select ee.tenant_user_id from obpm2.tenant_employees ee where ee.id=:after.ITEM_EMPLOYEEID) group by user_purse_id\n ) as t\n ON DUPLICATE KEY UPDATE points=t.points" } ] } ] }