diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5e84851 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM moxm/java:1.8-full + +RUN mkdir -p /dlp-identifyBook + +WORKDIR /dlp-identifyBook + +ARG JAR_FILE=target/dlp-identifyBook.jar + +COPY ${JAR_FILE} dlp-identifyBook.jar + +EXPOSE 5299 + +ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom" + +CMD sleep 60; java -jar dlp-identifyBook.jar $JAVA_OPTS diff --git a/db/dlp_identify_book.sql b/db/dlp_identify_book.sql new file mode 100644 index 0000000..962a930 --- /dev/null +++ b/db/dlp_identify_book.sql @@ -0,0 +1,769 @@ +/* + Navicat Premium Data Transfer + + Source Server : MariaDB + Source Server Type : MariaDB + Source Server Version : 100519 + Source Host : localhost:3308 + Source Schema : dlp_identify_book + + Target Server Type : MariaDB + Target Server Version : 100519 + File Encoding : 65001 + + Date: 01/09/2023 11:45:55 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for b_business_process_record +-- ---------------------------- +DROP TABLE IF EXISTS `b_business_process_record`; +CREATE TABLE `b_business_process_record` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务流程记录ID', + `business_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务ID', + `business_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务名称', + `business_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务类型名称', + `business_status` int(10) NULL DEFAULT NULL COMMENT '业务状态', + `message` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '意见', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '业务流程记录表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_case_event +-- ---------------------------- +DROP TABLE IF EXISTS `b_case_event`; +CREATE TABLE `b_case_event` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `case_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件编号', + `third_party_sys_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '第三方系统(如现勘系统、案事件系统)编号', + `case_name` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '案件名称任务名称', + `case_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件类型', + `happen_time` datetime(0) NULL DEFAULT NULL COMMENT '案发时间', + `case_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案发地详细地点', + `case_area` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案发地行政区划编码(到县一级)', + `case_own_org_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件所属机构', + `case_rank` int(11) NULL DEFAULT 0 COMMENT '案件级别: 0=普通案件, 1=紧急案件, 2=加急案件', + `case_brief` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案情简要', + `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件备注', + `data_sources` int(11) NULL DEFAULT 0 COMMENT '数据来源,表示数据是本系统自己产生,还是来自外部系统,0表示系统自身,1表示来自外部', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '案件、事件' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_case_evidence +-- ---------------------------- +DROP TABLE IF EXISTS `b_case_evidence`; +CREATE TABLE `b_case_evidence` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `evidence_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '本系统物证编号', + `case_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '案件Id', + `third_party_sys_evidence_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '第三方系统(如现勘系统、案事件系统)物证编号', + `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证名称', + `type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证类别:1. 非生物性物证;2. 生物特性物证', + `field_label_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '现场标牌号', + `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证来源', + `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证颜色', + `form` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证性状', + `fund_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证情况之承载物名称, 例如 棉签 2 棵, 粉末 少许', + `fund_quantity` int(11) NULL DEFAULT NULL COMMENT '物证情况之承载物数量, 例如 5 颗, 3包, ', + `fund_unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证情况之承载物单位, 例如 5 颗, 3包', + `quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '物证数量, 例如 3.8 克 或 4.5毫升', + `unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证单位, 例如 3.8 克 或 4.5毫升', + `additional_properties` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加属性, 如:体积3毫升,密码123,型号abc', + `person_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者姓名', + `person_cert` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者证件类型', + `person_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者证件号', + `person_gender` int(11) NULL DEFAULT NULL COMMENT '所有者性别,公安系统编码 1:男 2:女 0:未知', + `person_nationality` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者国籍', + `person_nation` int(11) NULL DEFAULT NULL COMMENT '所有者民族编码,公安系统编码', + `person_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者地址', + `person_age` int(11) NULL DEFAULT NULL COMMENT '所有者年龄', + `pack` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '包装情况:纸袋,纸盒,纸箱,自定义', + `storage_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '存储方法:常规,冷藏,特殊', + `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '描述', + `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + `data_sources` int(11) NULL DEFAULT 0 COMMENT '数据来源,表示数据是本系统自己产生,还是来自外部系统,0表示系统自身,1表示来自外部', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE, + INDEX `FK1_case_id`(`case_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '与案件相关的物证信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_deliverer +-- ---------------------------- +DROP TABLE IF EXISTS `b_deliverer`; +CREATE TABLE `b_deliverer` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `owner_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员拥有者userId', + `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员姓名', + `position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员职务', + `cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员证件名称', + `idnum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员证件编号', + `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检员电话', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `name`(`owner_user_id`, `name`) USING BTREE, + INDEX `owner_user_id`(`owner_user_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '送检员' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_entrustment +-- ---------------------------- +DROP TABLE IF EXISTS `b_entrustment`; +CREATE TABLE `b_entrustment` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '编号', + `case_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '案件Id', + `entrustment_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托编号', + `third_sys_entrust_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '第三方系统中的委托编号', + `entrustment_type` int(11) NULL DEFAULT 0 COMMENT '委托类型: 0=正常司法鉴定委托, 1=案前委托', + `business_type` int(11) NULL DEFAULT 0 COMMENT '业务类型: 0=毒品鉴定 1=.....用于对应到各个检验小组', + `process_instance_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '对应的流程实例Id', + `identification_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理Id, 通过这个可以得到鉴定号', + `entrustment_time` datetime(0) NULL DEFAULT NULL COMMENT '委托日期, 鉴定委托书打印日期', + `submitter` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托提交者, 后期可能会转给其他人user_id', + `submit_time` datetime(0) NULL DEFAULT NULL COMMENT '提交日期, 提交审核的日期', + `client_org_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定委托单位编码', + `client_org_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定委托单位名称', + `client_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '通讯地址', + `client_postcode` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮政编码', + `client_tel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电话号码', + `client_fax` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '传真号码', + `identification_domain` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托鉴定专业', + `identification_org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定机构名称', + `qualitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定性分析', + `quantitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定量分析', + `other_identification_requests` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '其他鉴定要求', + `candidate_drugs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '候选毒品列表(drug 对象的 json array)', + `is_client_specified_method` tinyint(1) NULL DEFAULT NULL COMMENT '是否由委托方指定鉴定方法', + `client_specified_method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托方指定的鉴定方法', + `destructive_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '是否有损检验:0=无损,1=有损', + `other_identification_notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检验的其他说明(鉴定事项确认书中要求, 审核人填写)', + `reidentification` tinyint(1) NULL DEFAULT 0 COMMENT '是否重新鉴定:0=否,1=重新鉴定', + `old_identification_org_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '原鉴定机构', + `old_identification_document` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '原鉴定文书', + `old_identification_result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '原鉴定结果', + `reidentification_reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '重新鉴定理由', + `avoid_identifier` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '回避的鉴定人及回避事由, json 格式', + `specified_identifier` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '指定鉴定人, 委托中指定鉴定人', + `other_agreement` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '其它约定事项,打印在鉴定事项确认书中的\"约定->其他\"', + `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + `check_candidate_user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '候选审核人, user_id列表, 逗号分隔', + `check_claim_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审核任务认领人', + `check_claim_time` datetime(0) NULL DEFAULT NULL COMMENT '审核任务认领时间', + `check_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实际审核人, user_id', + `check_time` datetime(0) NULL DEFAULT NULL COMMENT '审核时间', + `check_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审核意见: (审批通过 审批不通过及原因)', + `check_times` int(11) NOT NULL DEFAULT 0 COMMENT '审核次数记录', + `check_all_identification_material_confirmed` tinyint(1) NOT NULL DEFAULT 0 COMMENT '专业全部物证检验状态: 0=未全部审核 1=已全部审核', + `approve_candidate_user` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '候选审批人, user_id列表, 逗号分隔', + `approve_claim_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批任务认领人', + `approve_claim_time` datetime(0) NULL DEFAULT NULL COMMENT '审批任务认领时间', + `approve_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实际审批人, user_id', + `approve_time` datetime(0) NULL DEFAULT NULL COMMENT '审批时间', + `approve_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批意见: (审批通过 审批不通过及原因)', + `approve_times` int(11) NOT NULL DEFAULT 0 COMMENT '审批次数:该字段在审核通过时初始化, 值为0或1时代表初审, 2代表复审', + `deliver_confirm_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检确认人user_id', + `deliver_confirm_time` datetime(0) NULL DEFAULT NULL COMMENT '送检确认时间', + `deliver_confirm_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检确认意见', + `deliver_time` datetime(0) NULL DEFAULT NULL COMMENT '送检日期', + `deliver_submitter` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检操作提交用户user_id', + `deliverer1_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人1姓名', + `deliverer1_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人1职务', + `deliverer1_cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人1证件名称', + `deliverer1_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人1证件编号', + `deliverer1_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人1电话', + `deliverer2_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人2姓名', + `deliverer2_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人2职务', + `deliverer2_cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人2证件名称', + `deliverer2_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人2证件编号', + `deliverer2_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检人2电话', + `accept_claim_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理任务认领人', + `accept_claim_time` datetime(0) NULL DEFAULT NULL COMMENT '受理任务认领时间', + `accept_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理编号', + `accept_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理人user_id', + `accept_time` datetime(0) NULL DEFAULT NULL COMMENT '受理时间', + `accept_comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理意见', + `identification_items_confirm_printed` tinyint(4) NULL DEFAULT 0 COMMENT '鉴定事项确认书是否已经打印', + `process_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检受理信息, 以 json 格式记录送检受理各环节的文字意见', + `report_receive_mode` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取方式: 0=自取, 1=代领, 2=邮寄', + `report_receiver1_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的 user id', + `report_receiver1_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的姓名', + `report_receiver1_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的职务', + `report_receiver1_cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的证件类型', + `report_receiver1_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的证件号', + `report_receiver1_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人1的电话', + `report_receiver2_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的 user id', + `report_receiver2_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的姓名', + `report_receiver2_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的职务', + `report_receiver2_cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的证件类型', + `report_receiver2_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的证件号', + `report_receiver2_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告领取人2的电话', + `report_sender_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '报告发放人user_id(通常是受理员)', + `report_sent_time` datetime(0) NULL DEFAULT NULL COMMENT '报告发放时间', + `report_receiver1_signature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '报告领取人1领取报告时的签名', + `report_receiver2_signature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '报告领取人2领取报告时的签名', + `sample_receive_mode` int(11) NULL DEFAULT NULL COMMENT '检材领取方式: 0=自取, 1=实验室自行处理', + `sample_receiver1_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '如果检材领取人1是系统用户, 记录userId', + `sample_receiver1_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人1姓名', + `sample_receiver1_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人1职位', + `sample_receiver1_cret` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人1证件类型', + `sample_receiver1_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人1证件号', + `sample_receiver1_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人1电话', + `sample_receiver2_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '如果检材领取人2是系统用户, 记录userId', + `sample_receiver2_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人2姓名', + `sample_receiver2_position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人2职位', + `sample_receiver2_cret` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人2证件类型', + `sample_receiver2_id` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人2证件号', + `sample_receiver2_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材领取人2电话', + `sample_sender_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材发放人, 鉴定机构工作人员user_id', + `sample_sent_time` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材发放时间', + `sample_receiver1_person_signature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '检材领取人1签名', + `sample_receiver2_person_signnature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '检材领取人2签名', + `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态', + `previous_status` int(11) NULL DEFAULT NULL COMMENT '上一个状态', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `entrustment_letter_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托书pdf路径', + `identification_items_confirm_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定事项确认书pdf路径', + `transfer_status` int(11) NULL DEFAULT NULL COMMENT '移交状态, null、 1可移交。2已移交; 记录在另一张移交表', + `transfer_oper_signnature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, + `transfer_get_signnature` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, + `transfer_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `transfer_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `accept_need_professional` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'x需要专业人员受理: 0=不需要 1=需要', + `data_sources` int(11) NULL DEFAULT 0 COMMENT '数据来源,表示数据是本系统自己产生,还是来自外部系统,0表示系统自身,1表示来自外部', + `accept_no_third_sys` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '第三方系统的受理编号', + `entrust_requirement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定要求', + `post_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮寄地址', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_case_id`(`case_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '委托' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_entrustment_bundle +-- ---------------------------- +DROP TABLE IF EXISTS `b_entrustment_bundle`; +CREATE TABLE `b_entrustment_bundle` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'entrustment_id', + `selected_experiment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '\'[]\'' COMMENT '选中的实验, 实验id的json数组', + `approval_result` tinyint(1) NULL DEFAULT NULL COMMENT '审核审批结果: null=未审, 0=审核审批未通过, 1=审核审批已通过', + `submit_date` date NULL DEFAULT NULL COMMENT '提交给文书系统的日期', + `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态: 0=刚创建, 1=已提交给文书系统, 2=文书审核审批通过, 3=已通知委托系统', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '修改人', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '委托与实验关系' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_entrustment_identification_material +-- ---------------------------- +DROP TABLE IF EXISTS `b_entrustment_identification_material`; +CREATE TABLE `b_entrustment_identification_material` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '检材id', + `im_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材编号', + `evidence_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '物证id', + `case_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件id', + `entrustment_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材名称', + `type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材类别:继承所取物证的类别或从物证类别选择', + `type_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材类别名称:继承所取物证的类别或从物证类别选择', + `color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材颜色:继承所取物证颜色或手动填入', + `form` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材性状:继承所取物证性状或从物证性状类别选择', + `form_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材性状:继承所取物证性状或从物证性状类别选择', + `fund_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许', + `fund_quantity` int(11) NULL DEFAULT NULL COMMENT '检材情况之承载物数量, 例如 5 颗, 3包', + `fund_unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材情况之承载物单位, 例如 5 颗, 3包', + `quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '检材数量, 例如 3.8 克 或 4.5毫升', + `unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '计量单位, 例如 3.8 克 或 4.5毫升', + `additional_properties` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加属性, 如:体积3毫升,密码123,型号abc', + `draw_way` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提取方法', + `person_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者姓名', + `person_cert` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者证件类型', + `person_id` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者证件号', + `person_gender` int(11) NULL DEFAULT 0 COMMENT '所有者性别,公安系统编码: 1=男 2=女 0=未知', + `person_nationality` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者国籍', + `person_nation` int(11) NULL DEFAULT NULL COMMENT '所有者民族编码,公安系统编码', + `person_address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者地址', + `person_age` int(11) NULL DEFAULT NULL COMMENT '所有者年龄', + `take1_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人1姓名', + `take1_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人1职务', + `take1_cert` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人1证件名称', + `take1_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人1证件号', + `take1_phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人1联系电话', + `take2_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人2姓名', + `take2_position` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人2职务', + `take2_cert` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人2证件名称', + `take2_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人2证件号', + `take2_phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集人2联系电话', + `take_time` datetime(0) NULL DEFAULT NULL COMMENT '采集日期', + `witness_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '见证人姓名', + `witness_cert` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '见证人证件名称', + `witness_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '见证人证件号', + `pack` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '包装情况:纸袋,纸盒,纸箱,自定义', + `pack_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '包装情况名称:纸袋,纸盒,纸箱,自定义', + `storage_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '存储方法:常规,冷藏,特殊', + `candidate_drugs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '候选毒品列表(drug 对象的 json array)', + `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检材概要', + `check_time` datetime(0) NULL DEFAULT NULL COMMENT '审核时间', + `check_passed` int(11) NULL DEFAULT 0 COMMENT '审核是否通过: 1=审核通过', + `approve_time` datetime(0) NULL DEFAULT NULL COMMENT '审批时间', + `approve_passed` int(11) NULL DEFAULT 0 COMMENT '审批是否通过: 1=审批通过', + `accept_time` datetime(0) NULL DEFAULT NULL COMMENT '受理时间', + `accept_passed` int(11) NULL DEFAULT 0 COMMENT '是否受理: 0=未受理, 1=已受理, -1=不予受理', + `provided_sample1_present` tinyint(1) NULL DEFAULT 1 COMMENT '提供的样本1是否存在, 应该总是存在', + `provided_sample1_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提供的样本1编号', + `provided_sample1_fund_quantity` int(11) NULL DEFAULT NULL COMMENT '提供的样本1承载物数量(重量), 例如 5颗, 3包', + `provided_sample1_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '提供的样本1数量, 例如 3.8 克 或 4.5毫升', + `provided_sample2_present` tinyint(1) NULL DEFAULT 0 COMMENT '提供的样本2是否存在', + `provided_sample2_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提供的样本2编号', + `provided_sample2_fund_quantity` int(11) NULL DEFAULT NULL COMMENT '提供的样本2承载物数量(重量), 例如 5颗, 3包', + `provided_sample2_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '提供的样本2数量, 例如 3.8 克 或 4.5毫升', + `splited_sample` tinyint(1) NULL DEFAULT 0 COMMENT '是否已分样: 0=未分样, 1=已分样', + `sample1_present` tinyint(1) NULL DEFAULT 1 COMMENT '样本1是否存在, 应该总是存在', + `sample1_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本1编号', + `sample1_fund_quantity` int(11) NULL DEFAULT NULL COMMENT '样本1承载物数量(重量), 例如 5颗, 3包', + `sample1_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '样本1数量, 例如 3.8 克 或 4.5毫升', + `sample1_box_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本1盒子 id', + `sample2_present` tinyint(1) NULL DEFAULT 0 COMMENT '样本2是否存在', + `sample2_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本2编号', + `sample2_fund_quantity` int(11) NULL DEFAULT NULL COMMENT '样本2承载物数量(重量), 例如 5颗, 3包', + `sample2_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '样本2数量, 例如 3.8 克 或 4.5毫升', + `sample2_box_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本2盒子 id', + `sample1_repeat_weigh` decimal(10, 4) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '样本1的复秤重量', + `sample2_repeat_weigh` decimal(10, 4) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '样本2的复秤重量', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `analysis_option` int(11) NULL DEFAULT NULL COMMENT '分析项目,代替原来的定性分析,定量分析字段 1.定性分析 2.定量分析 3.定性定量分析 4.关联性判断 5。其他', + `qualitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定性分析', + `quantitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定量分析', + `data_sources` int(11) NULL DEFAULT 0 COMMENT '数据来源,表示数据是本系统自己产生,还是来自外部系统,0表示系统自身,1表示来自外部', + `accept_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材的受理编号', + `order_no` int(11) NULL DEFAULT NULL COMMENT '委托检材顺序号', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_case_id`(`case_id`) USING BTREE, + INDEX `idx_evidence_id`(`evidence_id`) USING BTREE, + INDEX `idx_evidence_no`(`im_no`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '检材信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_experiment +-- ---------------------------- +DROP TABLE IF EXISTS `b_experiment`; +CREATE TABLE `b_experiment` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `method_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检验方法id', + `template_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '模板id', + `business` int(11) NULL DEFAULT NULL COMMENT '业务类型,字典中的dlp.identification.business项', + `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实验名称', + `op_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检验人员id', + `status` int(11) NULL DEFAULT 0 COMMENT '状态: 0=准备中; 1=实验中; 2=实验结束; -1=实验中止', + `finish_date` date NULL DEFAULT NULL COMMENT '实验完成日期', + `comments` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注说明', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '修改人', + PRIMARY KEY (`id`) USING BTREE, + INDEX `create_time`(`create_time`) USING BTREE, + INDEX `create_by`(`create_by`) USING BTREE, + INDEX `template_id`(`template_id`) USING BTREE, + INDEX `op_user_id`(`op_user_id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '实验(检验方法的实例)' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_hair_job +-- ---------------------------- +DROP TABLE IF EXISTS `b_hair_job`; +CREATE TABLE `b_hair_job` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `root_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '根任务id', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务名称', + `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务内容描述说明', + `job_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务编号', + `job_issue_org` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务发布单位', + `job_exec_org` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务执行单位', + `job_from` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务来源', + `expiration_date` datetime(0) NULL DEFAULT NULL COMMENT '任务截止日期', + `start_date` datetime(0) NULL DEFAULT NULL COMMENT '任务开始日期', + `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务备注', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `job_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务类型: 毛发检测/污水检测...', + `xxxjob_identify_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'xxx任务检测类型: 毛发检测:社区戒毒人员检测、公职人员、招考人员。/污水检测:污水处理厂、自然水体、其它水体。...', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '毛发检测任务' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_hair_job_identification_material +-- ---------------------------- +DROP TABLE IF EXISTS `b_hair_job_identification_material`; +CREATE TABLE `b_hair_job_identification_material` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '检材id', + `job_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '任务id', + `job_root_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '根任务id', + `im_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材编号', + `sample1_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'A样编号', + `sample2_no` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'B样编号', + `sample1_box_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'A样盒子', + `sample2_box_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'B样盒子', + `person_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者姓名', + `person_card` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '所有者身份证号', + `person_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '人员类别', + `project_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '项目名称', + `execution_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '社区戒毒人员在社区执行时间是否超过 6 个月', + `drug_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '曾经吸毒种类', + `collector` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采样人', + `collector_group` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采样单位', + `collect_time` datetime(0) NULL DEFAULT NULL COMMENT '采样时间', + `collect_place` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采样地点', + `supervisor` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '监督人员', + `accept_time` datetime(0) NULL DEFAULT NULL COMMENT '受理时间', + `accept_passed` int(11) NULL DEFAULT NULL COMMENT '受理是否通过: 0=未受理, 1=受理通过, -1=受理被拒绝', + `comments` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材名称', + `quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '检材数量', + `sample1_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT 'A样数量', + `sample2_quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT 'B样数量', + `unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '计量单位', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_evidence_no`(`im_no`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '毛发任务的检材信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_identification +-- ---------------------------- +DROP TABLE IF EXISTS `b_identification`; +CREATE TABLE `b_identification` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `identification_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定号,受理号', + `status` int(11) NOT NULL DEFAULT 0 COMMENT '状态: 0=鉴定中,-1=已终止, 1=已结束', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人' +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '鉴定表,一个鉴定可能会有多个委托' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_identification_process +-- ---------------------------- +DROP TABLE IF EXISTS `b_identification_process`; +CREATE TABLE `b_identification_process` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '委托ID', + `inspection_process` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检验过程', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '检验过程' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_identify_book +-- ---------------------------- +DROP TABLE IF EXISTS `b_identify_book`; +CREATE TABLE `b_identify_book` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书消息ID', + `identify_book_relevance_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '父ID', + `bucket_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '桶名称', + `path` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书路径', + `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书文件名(文件名命名规则:鉴定文书 + \"版本号\") ', + `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书版本号(示例:v1.0、v1.1)', + `remarks` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + INDEX `identify_book_relevance001`(`identify_book_relevance_id`) USING BTREE, + CONSTRAINT `identify_book_relevance001` FOREIGN KEY (`identify_book_relevance_id`) REFERENCES `b_identify_book_relevance` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '鉴定文书消息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_identify_book_approve +-- ---------------------------- +DROP TABLE IF EXISTS `b_identify_book_approve`; +CREATE TABLE `b_identify_book_approve` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鉴定文书审核审批ID', + `relevance_business_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务ID', + `year` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '年', + `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '序号', + `annex_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附件类型集合(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书)', + `book_type` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '文书类型:(1:检验报告,2:其它)', + `inspection_report_number` int(10) NULL DEFAULT NULL COMMENT '检验报告数量(单位:份)', + `other_number` int(10) NULL DEFAULT NULL COMMENT '其它数量(单位:份)', + `is_qualified` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '是否合格(1:检验方法、2:检验过程、3:检验图谱、4:检验结果)', + `process_user_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审核人ID', + `process_user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审核人', + `process_time` datetime(0) NULL DEFAULT NULL COMMENT '审核时间', + `process_message` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审核意见', + `approve_user_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批人ID', + `approve_user_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批人', + `approve_time` datetime(0) NULL DEFAULT NULL COMMENT '审批时间', + `approve_message` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '审批意见', + `path` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书审批记录文件路径', + `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书文件名(文件名命名规则:鉴定文书 + \"版本号\"+\"文件类型\") ', + `version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '版本号', + `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '鉴定文书审核审批表 ' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_identify_book_relevance +-- ---------------------------- +DROP TABLE IF EXISTS `b_identify_book_relevance`; +CREATE TABLE `b_identify_book_relevance` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `relevance_business_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联业务ID', + `year` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '年份', + `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '流水号', + `book_status` int(10) NOT NULL COMMENT '鉴定文书业务状态(-1:待制作,0:已制作/重新制作,1:鉴定文书-提交审核,2:鉴定文书-审核通过),-2:鉴定文书-审核未通过,3:鉴定文书-审核退回修改,4:鉴定文书-审批签发成功,-4:鉴定文书-审批拒绝签发,5:鉴定文书-审批签发退回修改,6:鉴定文书-已领取', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '鉴定文书关联中间表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_modify_supplement_apply +-- ---------------------------- +DROP TABLE IF EXISTS `b_modify_supplement_apply`; +CREATE TABLE `b_modify_supplement_apply` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '鉴定文书修改补充申请ID', + `year` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '年', + `serial_number` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '流水号', + `entrustment_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托ID', + `entrust_dept_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托单位', + `identify_book_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书编号', + `entrust_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托人ID', + `entrust_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托人姓名', + `apply_time` datetime(0) NULL DEFAULT NULL COMMENT '申请时间', + `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '修改人ID', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间', + `update_reason` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '修改原因', + `update_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '修改内容', + `entrust_by_sign` longblob NULL COMMENT '委托人签名', + `entrust_by_sign_date` datetime(0) NULL DEFAULT NULL COMMENT '委托人签名日期', + `update_way` int(10) NULL DEFAULT NULL COMMENT '修改方式(1:修改存档文件、2:收回原件,重新出具鉴定文书)', + `update_by_sign` longblob NULL COMMENT '修改人签字', + `update_by_sign_date` datetime(0) NULL DEFAULT NULL COMMENT '修改人签字日期', + `status` int(10) NULL DEFAULT 0 COMMENT '业务状态(1:鉴定文书-提交修改补充申请,2:鉴定文书-修改补充-审核通过,-2:鉴定文书-修改补充-审核未通过,3:鉴定文书-修改补充-审批通过,-3:鉴定文书-修改补充-审批通过)', + `empower_by_sign` longblob NULL COMMENT '授权人签字', + `empower_by_sign_date` datetime(0) NULL DEFAULT NULL COMMENT '授权人签字日期', + `empower_by_sign_opinion` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '授权签字人意见', + `technology_by_sign` longblob NULL COMMENT '技术人员签字', + `technology_by_sign_date` datetime(0) NULL DEFAULT NULL COMMENT '技术人员签字日期', + `technology_by_sign_opinion` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '技术人员签字意见', + `path` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书修改/申请文件路径', + `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定文书修改/申请文件名(文件名命名规则:鉴定文书 + \"版本号\"+\"文件类型\") ', + `remarks` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '鉴定文书修改补充申请表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_receive_identify_book +-- ---------------------------- +DROP TABLE IF EXISTS `b_receive_identify_book`; +CREATE TABLE `b_receive_identify_book` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '领取ID', + `relevance_business_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '关联业务ID', + `receive_way` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '领取方式', + `recipients_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '领取人ID', + `recipients_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '领取人姓名', + `recipients_time` datetime(0) NULL DEFAULT NULL COMMENT '领取人时间', + `operator_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '经办人ID', + `operator_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '经办人姓名', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '领取鉴定文书信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_result_entrustment_qualitative +-- ---------------------------- +DROP TABLE IF EXISTS `b_result_entrustment_qualitative`; +CREATE TABLE `b_result_entrustment_qualitative` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `experiment_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实验id', + `sample_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `sample_no` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本编号,字符串,必填,长度 200', + `material_index` int(11) NOT NULL DEFAULT 0 COMMENT '检材序号, 通常是受理的序号', + `short_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本的简要名称', + `compound` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '化合物,必填,长度 200', + `result` tinyint(1) NULL DEFAULT NULL COMMENT 'negative:未检出,positive:检出', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_experiment_id`(`experiment_id`) USING BTREE, + INDEX `sample_no`(`sample_no`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '委托定性分析检验结果' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_result_entrustment_ration +-- ---------------------------- +DROP TABLE IF EXISTS `b_result_entrustment_ration`; +CREATE TABLE `b_result_entrustment_ration` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `experiment_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '实验id', + `sample_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, + `sample_no` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本编号,字符串,必填,长度 200', + `material_index` int(11) NOT NULL DEFAULT 0 COMMENT '检材序号, 通常是受理的序号', + `compound` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '化合物,必填,长度 200', + `result` double NULL DEFAULT NULL COMMENT '定量结果,必填,长度12, 精度8', + `comments` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注说明', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE, + INDEX `experiment_id`(`experiment_id`) USING BTREE, + INDEX `sample_no`(`sample_no`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '委托定量检验结果' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_sample +-- ---------------------------- +DROP TABLE IF EXISTS `b_sample`; +CREATE TABLE `b_sample` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '样本id', + `identification_material_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '检材id, 对应委托的检材id或毛发任务的检材id或污水任务的检材id', + `sample_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本编号', + `source` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '样本来源: entrustment/hairJob/sewageJob/....', + `entrustment_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '委托id', + `sewage_job_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '污水任务id', + `hair_job_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '毛发任务id', + `qualitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定性分析', + `quantitative_analysis` tinyint(1) NULL DEFAULT 1 COMMENT '定量分析', + `candidate_drugs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '候选毒品列表(drug 对象的 json array)', + `fund_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许', + `fund_quantity` int(11) NULL DEFAULT NULL COMMENT '检材情况之承载物数量, 如 3 颗 或 1包', + `fund_unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '检材情况之承载物单位, 例如 5 颗, 3包', + `quantity` decimal(10, 4) NULL DEFAULT NULL COMMENT '样品数量, 例如 2.3 克 或 3.1 毫升', + `unit` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '计量单位, 例如 3.8 克 或 4.5毫升', + `additional_properties` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '附加属性, 如:体积3毫升,密码123,型号abc', + `draw_way` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提取方法', + `box_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '盒子编号', + `sample_type` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT 'A样还是B样', + `storage_method` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '存储方法:常规,冷藏,特殊', + `accept_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '受理时间, 相当于检验开始时间, 用于比对花了多少时间在检验上', + `status` int(11) NULL DEFAULT NULL COMMENT '状态: 0=已受理,等分配, 1=已分配到检验人员, 2=检验完成', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `holder` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当前持有者', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '样本名称', + `org_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '送检单位ID', + `accept_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '受理编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '检验用的样本' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_taker +-- ---------------------------- +DROP TABLE IF EXISTS `b_taker`; +CREATE TABLE `b_taker` ( + `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `owner_user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员拥有者userId', + `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员姓名', + `position` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员职务', + `cert` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员证件名称', + `idnum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员证件编号', + `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '采集员电话', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + PRIMARY KEY (`id`) USING BTREE, + INDEX `owner_user_id`(`owner_user_id`) USING BTREE, + INDEX `taker_name`(`name`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '采集员' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for b_task_notification +-- ---------------------------- +DROP TABLE IF EXISTS `b_task_notification`; +CREATE TABLE `b_task_notification` ( + `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '消息ID', + `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '消息标题', + `type` int(10) NULL DEFAULT NULL COMMENT '任务类型(1:鉴定文书-审核,2:鉴定文书-审核退回修改,3:鉴定文书-审批,4:鉴定文书-审批退回修改,5:鉴定文书-签发/领取,6:鉴定文书修改/补充-审核,7:鉴定文书修改/补充-审批)', + `business_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务ID', + `submitter_user_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提交人ID', + `submitter_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '提交人姓名', + `submitter_time` datetime(0) NULL DEFAULT NULL COMMENT '提交日期', + `accept_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '鉴定编号', + `case_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '案件名称', + `content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '消息内容', + `transaction_personnel_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '处理人员ID', + `transaction_personnel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '办理人姓名', + `permission_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '办理人权限组', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建者', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `status` int(10) NULL DEFAULT 0 COMMENT '处理状态(0: 待处理,1:已处理,2:退回修改,-1:未通过)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '任务信息表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for examination_methods +-- ---------------------------- +DROP TABLE IF EXISTS `examination_methods`; +CREATE TABLE `examination_methods` ( + `id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '方法实体类id', + `method_name` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法名', + `method_basis` int(5) NULL DEFAULT NULL COMMENT '方法依据', + `method_English_name` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方法英文名', + `standard_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标准号', + `publishing_unit` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发布单位', + `publishing_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间', + `others` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他依据', + `implement_time` datetime(0) NULL DEFAULT NULL COMMENT '实施时间', + `suit_range` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '适用范围', + `normative_references` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '规范性引用文件', + `term_and_definition` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '术语和定义', + `principle` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '原理', + `method_status` int(5) NULL DEFAULT NULL COMMENT '方法当前状态', + `method_type` int(5) NULL DEFAULT NULL COMMENT '方法类型(标准/非标准)', + `reagent` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '试剂', + `instruments_and_equipment` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '仪器和设备', + `quantitative_result_evaluation` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '定量结果评价', + `operation_method` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '操作方法', + `guidelines_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '指导书id', + `expression_of_results` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '结果表述', + `review_time` datetime(0) NULL DEFAULT NULL COMMENT '评审时间', + `reviewer` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评审人', + `review_results` int(5) NULL DEFAULT NULL COMMENT '评审结果', + `review_opinion` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '评审意见', + `create_time` datetime(0) NULL DEFAULT current_timestamp COMMENT '创建时间--录入时间', + `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '创建人--录入人', + `update_time` datetime(0) NULL DEFAULT current_timestamp ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', + `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '更新人', + `annex_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件url', + `annex_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '检验方法' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/db/permission.sql b/db/permission.sql new file mode 100644 index 0000000..a6d15bc --- /dev/null +++ b/db/permission.sql @@ -0,0 +1,17 @@ +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60000', 'root', '鉴定文书管理', '', 60000, 2, '鉴定文书管理', '/book', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:28:23', NULL); +-- START 鉴定文书制作审核审批签发 -- +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60100', '60000', '鉴定文书制作/审核/审批/领取管理', '', 60100, 1, '鉴定文书制作/审核/审批/领取管理', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60110', '60100', '鉴定文书制作/修改', 'IdentifyBookProductionRrSubmissionProcess', 60110, 1, '文书制作/修改(实验人员)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60120', '60100', '鉴定文书审核', 'IdentifyBookSH', 60120, 1, '鉴定文书审核(授权签字人)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60130', '60100', '鉴定文书审批', 'IdentifyBookSP', 60130, 1, '鉴定文书审批(主任)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60140', '60100', '鉴定文书签发/领取', 'IdentifyBookQF', 60140, 1, '鉴定文书签发/领取(实验人员)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); + +-- END 鉴定文书制作审核审批 -- + +-- START 鉴定文书修改补充申请/审核/审批 -- +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60200', '60000', '鉴定文书修改补充申请/审核/审批管理', '', 60200, 1, '鉴定文书修改补充申请/审核/审批管理', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60210', '60200', '鉴定文修改补充申请/提交', 'IdentifyBookModificationAndSupplementationSQ', 60210, 1, '鉴定文修改补充申请/提交(实验人员)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60220', '60200', '鉴定文书修改补充审核', 'IdentifyBookModificationAndSupplementationSH', 60220, 1, '鉴定文书修改补充审核(授权签字人)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +INSERT INTO `dlp_base`.`sys_permission`(`permission_id`, `parent_id`, `name`, `permission`, `sort`, `type`, `comments`, `path`, `icon`, `keep_alive`, `component`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('60230', '60200', '鉴定文书修改补充审批', 'IdentifyBookModificationAndSupplementationSP', 60230, 1, '鉴定文书修改补充审批(主任)', '', 'icon-guanwangfangwen', '0', NULL, '2023-08-25 14:28:23', NULL, '2023-08-25 14:46:29', NULL); +-- END 鉴定文书修改补充申请/审核/审批 -- + diff --git a/db/sql.sql b/db/sql.sql new file mode 100644 index 0000000..c1f36c9 --- /dev/null +++ b/db/sql.sql @@ -0,0 +1,3 @@ +INSERT INTO `dlp_base`.`sys_dictionary`(`id`, `module`, `type`, `sort`, `code`, `label`, `css_class`, `list_class`, `default_value`, `description`, `comments`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('dlp.entrustment.identifyBookApproveTemplate', NULL, 'dlp.entrustment', 0, 'identifyBookApproveTemplate', 'NADL-Shaanxi-CX-22-01-2021鉴定文书审批表001.doc', NULL, NULL, 1, NULL, '鉴定文书审批模板', '2021-12-27 17:22:32', '1', '2023-05-26 00:56:13', '1'); +INSERT INTO `dlp_base`.`sys_dictionary`(`id`, `module`, `type`, `sort`, `code`, `label`, `css_class`, `list_class`, `default_value`, `description`, `comments`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('dlp.entrustment.identifyBookModifySupplementApplyTemplate', NULL, 'dlp.entrustment', 0, 'identifyBookModifySupplementApplyTemplate', 'NADL-Shaanxi-CX-22-02-2021鉴定文书修改补充申请表001.doc', NULL, NULL, 1, NULL, '鉴定文书修改补充申请模板', '2021-12-27 17:22:32', '1', '2023-05-26 00:56:13', '1'); +INSERT INTO `dlp_base`.`sys_dictionary`(`id`, `module`, `type`, `sort`, `code`, `label`, `css_class`, `list_class`, `default_value`, `description`, `comments`, `create_time`, `create_by`, `update_time`, `update_by`) VALUES ('dlp.entrustment.identifyBookTemplate', NULL, 'dlp.entrustment', 0, 'identifyBookTemplate', 'NADL-Shaanxi-CX-22-03-2021国家毒品实验室检验鉴定报告文号和格式模板001.docx', NULL, NULL, 1, NULL, '鉴定文书模板', '2021-12-27 17:22:32', '1', '2023-05-26 00:56:09', '1'); diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8da4038 --- /dev/null +++ b/pom.xml @@ -0,0 +1,269 @@ + + + 4.0.0 + + digital.laboratory.platform + DigitalLaboratoryPlatform + 2022.10.11-snapshots + + dlp-identifyBook + jar + DLP 鉴定文书管理系统 + + 1.8 + 1.8 + 5.7.1 + 2022.10.11-snapshots + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2021.1 + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + 2021.1 + + + + + digital.laboratory.platform + dlp-common-swagger + + + + org.springframework.boot + spring-boot-starter-web + 2.5.5 + + + + digital.laboratory.platform + dlp-common-feign + ${dlp.version} + + + + + digital.laboratory.platform + dlp-common-security + ${dlp.version} + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.springframework.boot + spring-boot-starter-test + test + + + + + digital.laboratory.platform + dlp-common-core + ${dlp.version} + + + + + + + mysql + mysql-connector-java + 8.0.28 + + + + + org.springframework.boot + spring-boot-starter-undertow + + + + + digital.laboratory.platform + dlp-common-log + ${dlp.version} + + + + digital.laboratory.platform + dlp-common-oss + ${dlp.version} + compile + + + + + digital.laboratory.platform + dlp-admin-api + ${dlp.version} + + + digital.laboratory.platform + dlp-common-remote-word2pdf + ${dlp.version} + compile + + + + digital.laboratory.platform + dlp-common-remote-identification + ${dlp.version} + + + + digital.laboratory.platform + dlp-drugtesting-api + ${dlp.version} + + + + com.deepoove + poi-tl + 1.12.0 + + + commons-io + commons-io + 2.11.0 + + + + fr.opensagres.xdocreport + fr.opensagres.poi.xwpf.converter.pdf-gae + 2.0.3 + + + + + com.google.zxing + core + 3.5.0 + + + com.google.zxing + javase + 3.5.0 + + + com.googlecode.json-simple + json-simple + 1.1 + + + + com.aspose + aspose-words + 1.0.1 + + + + org.springframework + spring-test + + + + + digital.laboratory.platform + dlp-othersys-api + ${dlp.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + -Xlint:unchecked + + 3.8.1 + + + org.springframework.boot + spring-boot-maven-plugin + + + io.fabric8 + docker-maven-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + timestamp-property + + timestamp-property + + + timestamp + yyyy-MM-dd HH:mm:ss + zh_CN + Asia/Shanghai + + + + + + + + maven-resources-plugin + 3.1.0 + + + copy-resource-one + install + + copy-resources + + + ${basedir}/../../out + + + ${basedir}/target + + ${project.artifactId}.jar + + + + + + + + + + + + + dev + + + dev + + + + true + + + + + + diff --git a/src/main/java/digital/laboratory/platform/identifybook/DlpIdentifyBookApplication.java b/src/main/java/digital/laboratory/platform/identifybook/DlpIdentifyBookApplication.java new file mode 100644 index 0000000..638577a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/DlpIdentifyBookApplication.java @@ -0,0 +1,22 @@ +package digital.laboratory.platform.identifybook; + +import digital.laboratory.platform.common.feign.annotation.EnableDLPFeignClients; +import digital.laboratory.platform.common.security.annotation.EnableDLPResourceServer; +import digital.laboratory.platform.common.swagger.annotation.EnableDLPSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.scheduling.annotation.EnableAsync; + +@EnableDLPSwagger2 +@EnableDLPFeignClients +@EnableDiscoveryClient +@EnableDLPResourceServer +@SpringBootApplication(scanBasePackages={"digital.laboratory.platform"}) +public class DlpIdentifyBookApplication { + + public static void main(String[] args) { + SpringApplication.run(DlpIdentifyBookApplication.class, args); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/config/ApiPathProperties.java b/src/main/java/digital/laboratory/platform/identifybook/config/ApiPathProperties.java new file mode 100644 index 0000000..eecfd19 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/config/ApiPathProperties.java @@ -0,0 +1,130 @@ +package digital.laboratory.platform.identifybook.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * 贵阳禁毒-情报平台推送数据配置 + */ +@Component +@ConfigurationProperties(prefix = "gyjd.labscare.api") +public class ApiPathProperties { + /** + * api的ip + */ + private String host; + + /** + * 委托书推送的接口 + */ + private String entrustLetter; + + /** + * 确认书推送接口 + */ + private String confirmLetter; + + /** + * 生物检材定性记录 + */ + private String biologyQualitativeRecord; + + /** + * 普通检材定性记录(非红外报告) + */ + private String nonInfraredGeneralQualitativeRecord; + + /** + * 普通检材定性记录(红外报告) + */ + private String infraredGeneralQualitativeRecord; + + /** + * 鉴定报告审批表 + */ + private String appraisalReportApprovalForm; + + /** + * 定性报告 + */ + private String qualitativeReport; + + /** + * 归档报告信息 + */ + private String archiveReportInfo; + + /************************************ Getter Setter 方法 ***********************************/ + /******************************** Getter 方法会拼接上host返回 ***************************/ + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getEntrustLetter() { + return host + entrustLetter; + } + + public void setEntrustLetter(String entrustLetter) { + this.entrustLetter = entrustLetter; + } + + public String getConfirmLetter() { + return host + confirmLetter; + } + + public void setConfirmLetter(String confirmLetter) { + this.confirmLetter = confirmLetter; + } + + public String getBiologyQualitativeRecord() { + return host + biologyQualitativeRecord; + } + + public void setBiologyQualitativeRecord(String biologyQualitativeRecord) { + this.biologyQualitativeRecord = biologyQualitativeRecord; + } + + public String getNonInfraredGeneralQualitativeRecord() { + return host + nonInfraredGeneralQualitativeRecord; + } + + public void setNonInfraredGeneralQualitativeRecord(String nonInfraredGeneralQualitativeRecord) { + this.nonInfraredGeneralQualitativeRecord = nonInfraredGeneralQualitativeRecord; + } + + public String getInfraredGeneralQualitativeRecord() { + return host + infraredGeneralQualitativeRecord; + } + + public void setInfraredGeneralQualitativeRecord(String infraredGeneralQualitativeRecord) { + this.infraredGeneralQualitativeRecord = infraredGeneralQualitativeRecord; + } + + public String getAppraisalReportApprovalForm() { + return host + appraisalReportApprovalForm; + } + + public void setAppraisalReportApprovalForm(String appraisalReportApprovalForm) { + this.appraisalReportApprovalForm = appraisalReportApprovalForm; + } + + public String getQualitativeReport() { + return host + qualitativeReport; + } + + public void setQualitativeReport(String qualitativeReport) { + this.qualitativeReport = qualitativeReport; + } + + public String getArchiveReportInfo() { + return host + archiveReportInfo; + } + + public void setArchiveReportInfo(String archiveReportInfo) { + this.archiveReportInfo = archiveReportInfo; + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/config/FeignOauth2RequestInterceptor.java b/src/main/java/digital/laboratory/platform/identifybook/config/FeignOauth2RequestInterceptor.java new file mode 100644 index 0000000..3fe5409 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/config/FeignOauth2RequestInterceptor.java @@ -0,0 +1,43 @@ +package digital.laboratory.platform.identifybook.config; + +import feign.RequestInterceptor; +import feign.RequestTemplate; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails; + +/** + * Feign 请求拦截器 + * Feign Client 向业务系统发出请求的时候, 把 Token 带上, 以用户自己的身份调用业务系统。 + * 目的是在业务系统中识别用户是谁, 允许或禁止用户进行对应的操作。 + */ + + +@Configuration +public class FeignOauth2RequestInterceptor implements RequestInterceptor { + + private final String AUTHORIZATION_HEADER = "Authorization"; + private final String BEARER_TOKEN_TYPE = "Bearer"; + + @Override + public void apply(RequestTemplate requestTemplate) { +//System.out.println(String.format("======================================================================================")); +//System.out.println(String.format("dlp-admin-service, FeignOauth2RequestInterceptor(), feignTarget().name()=%s target.url=%s url=%s path=%s", requestTemplate.feignTarget().name(), requestTemplate.feignTarget().url(), requestTemplate.url(), requestTemplate.path())); + + SecurityContext securityContext = SecurityContextHolder.getContext(); + Authentication authentication = securityContext.getAuthentication(); + if (authentication != null && authentication.getDetails() instanceof OAuth2AuthenticationDetails) { + OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) authentication.getDetails(); +//System.out.println(String.format("FeignOauth2RequestInterceptor() Authorization, token=%s", details.getTokenValue())); + requestTemplate.header(AUTHORIZATION_HEADER, String.format("%s %s", BEARER_TOKEN_TYPE, details.getTokenValue())); + } + else { +//System.out.println(String.format("authentication=%s", authentication)); + + } +//System.out.println(String.format("======================================================================================")); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/BIdentificationProcessController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/BIdentificationProcessController.java new file mode 100644 index 0000000..5143eb1 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/BIdentificationProcessController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-27 + */ +@RestController +@RequestMapping("//b-identification-process") +public class BIdentificationProcessController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java new file mode 100644 index 0000000..ee6f3f8 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/BusinessProcessRecordController.java @@ -0,0 +1,734 @@ +package digital.laboratory.platform.identifybook.controller; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants; +import digital.laboratory.platform.common.core.util.ClassUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.feign.RemoteGenerateWordService; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.emums.BusinessStatus; +import digital.laboratory.platform.identifybook.emums.PermissionGroupEnum; +import digital.laboratory.platform.identifybook.emums.TaskTypeEnum; +import digital.laboratory.platform.identifybook.entity.*; +import digital.laboratory.platform.identifybook.event.PushDataToLabsCareEvent; +import digital.laboratory.platform.identifybook.handler.AppStartupRunner; +import digital.laboratory.platform.identifybook.req.BusinessProcessRecordREQ; +import digital.laboratory.platform.identifybook.service.*; +import digital.laboratory.platform.identifybook.vo.BusinessProcessRecordVO; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.context.ApplicationContext; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.security.Principal; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + *

+ * 业务流程 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "业务流程-相关接口") +@RequestMapping("/book/businessProcessRecord") +public class BusinessProcessRecordController { + + private final RemoteUserService remoteUserService; + + private final IBusinessProcessRecordService businessProcessRecordService; + private final IIdentifyBookRelevanceService identifyBookRelevanceService; + private final IIdentifyBookApproveService identifyBookApproveService; + private final IEntrustmentService entrustmentService; + + private final IEntrustmentIdentificationMaterialService entrustmentIdentificationMaterialService; + // 根据模板身材word工具服务 + private final RemoteGenerateWordService remoteGenerateWordService; + + private final IModifySupplementApplyService modifySupplementApplyService; + + private final IReceiveIdentifyBookService receiveIdentifyBookService; + + private final ITaskNotificationService taskNotificationService; + + private final ApplicationContext applicationContext; + + @ApiOperation(value = "通过条件分页查询业务流程记录列表", notes = "通过条件分页查询业务流程记录列表") + @PostMapping("/search") + public R> findBusinessProcessRecordPage(@RequestBody BusinessProcessRecordREQ req){ + return R.ok(businessProcessRecordService.page(req.getPage(), null)); + } + + @ApiOperation(value = "根据业务ID查询业务流程记录", notes = "根据业务ID查询业务流程记录") + @PostMapping("/view/{businessId}") + public R> view(@PathVariable(value = "businessId") String businessId){ + List businessProcessRecordList = businessProcessRecordService.list( + new LambdaQueryWrapper() + .eq(BusinessProcessRecord::getBusinessId, businessId) + .orderByAsc(BusinessProcessRecord::getCreateTime)); + return R.ok(businessProcessRecordList); + } + + @ApiOperation(value = "鉴定文书审批退回修改—重新提交", notes = "鉴定文书审批退回修改——重新提交") + @PostMapping("/identifyBookSPTHXGCXTJ") + public R> identifyBookSPTHXGCXTJ(@RequestBody BusinessProcessRecordVO vo, HttpServletRequest request){ + boolean update = identifyBookRelevanceService.update(new LambdaUpdateWrapper() + .set(IdentifyBookRelevance::getBookStatus, vo.getBusinessStatus()) + .eq(IdentifyBookRelevance::getRelevanceBusinessId, vo.getBusinessId())); + if(update){ + // 获取用户消息 + Principal principal = request.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + TaskNotification taskNotification = new TaskNotification(); + BusinessProcessRecord record = new BusinessProcessRecord(); + record.setBusinessId(vo.getBusinessId()); + record.setBusinessName("鉴定文书审批退回修改-重新提交"); + record.setBusinessStatus(Integer.parseInt(vo.getBusinessStatus())); + if (BusinessStatus.JD_WS_SH_TG.getCode().equals(vo.getBusinessStatus())){ + record.setBusinessTypeName(BusinessStatus.JD_WS_SH_TG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : "鉴定文书审批退回修改-重新提交"); + businessProcessRecordService.save(record); + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1); + if(flag){ + + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_SP.getCode()), + TaskTypeEnum.JD_WS_SP.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookSP.getCode()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } + } + } + return R.ok(); + } + + @ApiOperation(value = "鉴定文书(提交/审核/审批/签发)", notes = "鉴定文书(提交/审核/审批/签发)") + @Transactional + @PostMapping("/identifyBookTJSHSPQF") + public R identifyBookTJSHSPQF(@RequestBody BusinessProcessRecordVO vo, HttpServletRequest request){ + boolean update = identifyBookRelevanceService.update(new LambdaUpdateWrapper() + .set(IdentifyBookRelevance::getBookStatus, vo.getBusinessStatus()) + .eq(IdentifyBookRelevance::getRelevanceBusinessId, vo.getBusinessId())); + + if(update){ + // 获取用户消息 + Principal principal = request.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + TaskNotification taskNotification = new TaskNotification(); + BusinessProcessRecord record = new BusinessProcessRecord(); + record.setBusinessId(vo.getBusinessId()); + record.setBusinessName("鉴定文书提交审核审批签发"); + record.setBusinessStatus(Integer.parseInt(vo.getBusinessStatus())); + + if(BusinessStatus.JD_WS_TJ_SH.getCode().equals(vo.getBusinessStatus())){ + + // 提交审核 + record.setBusinessTypeName(BusinessStatus.JD_WS_TJ_SH.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_TJ_SH.getDesc()); + + // 主要处理是否是退回修改的业务 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1); + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_SH.getCode()), + TaskTypeEnum.JD_WS_SH.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookSH.getCode()); + if(!flag){ + + taskNotification.setSubmitterUserId(dlpUser.getId()); + taskNotification.setSubmitterUserName(dlpUser.getName()); + Entrustment entrustment = entrustmentService.getById(vo.getBusinessId()); + taskNotification.setAcceptNo(entrustment.getAcceptNo()); + //CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId()); + taskNotification.setCaseName(entrustment.getCaseName()); + } + + + // 推送任务通知 + commSaveTaskNotification(taskNotification); + + } else if (BusinessStatus.JD_WS_SH_TG.getCode().equals(vo.getBusinessStatus())){ + // 审核通过-保存或更新鉴定文书审审批表 + IdentifyBookApprove one = new IdentifyBookApprove(); + one.setRelevanceBusinessId(vo.getBusinessId()); + one.setProcessUserBy(dlpUser.getId()); + one.setProcessUserName(dlpUser.getName()); + one.setProcessTime(new Date()); + one.setProcessMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : "审核通过"); + one.setAnnexType(vo.getApproveVO().getAnnexType()); + one.setBookType(vo.getApproveVO().getBookType()); + one.setInspectionReportNumber(vo.getApproveVO().getInspectionReportNumber()); + one.setOtherNumber(vo.getApproveVO().getOtherNumber()); + one.setIsQualified(vo.getApproveVO().getIsQualified()); + + identifyBookApproveService.saveOrUpdate(one); + + record.setBusinessTypeName(BusinessStatus.JD_WS_SH_TG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SH_TG.getDesc()); + + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1); + if(flag){ + + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_SP.getCode()), + TaskTypeEnum.JD_WS_SP.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookSP.getCode()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } + + } else if (BusinessStatus.JD_WS_SH_WTG.getCode().equals(vo.getBusinessStatus())){ + // 审核未通过 + record.setBusinessTypeName(BusinessStatus.JD_WS_SH_WTG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SH_WTG.getDesc()); + + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), -1)){ + + } + + } else if (BusinessStatus.JD_WS_SH_TH_XG.getCode().equals(vo.getBusinessStatus())){ + // 审核-退回修改 + record.setBusinessTypeName(BusinessStatus.JD_WS_SH_TH_XG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SH_TH_XG.getDesc()); + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 2); + if(flag){ + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_SH_TH_XG.getCode()), + TaskTypeEnum.JD_WS_SH_TH_XG.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookProductionRrSubmissionProcess.getCode()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } + + } else if (BusinessStatus.JD_WS_SP_QF_TG.getCode().equals(vo.getBusinessStatus())){ + // TODO 审批签发成功--更新鉴定文书并生成鉴定文书审批表 + IdentifyBookApprove one = identifyBookApproveService.list(new LambdaQueryWrapper() + .eq(IdentifyBookApprove::getRelevanceBusinessId, vo.getBusinessId()) + .orderByDesc(IdentifyBookApprove::getCreateTime)).get(0); + + one.setRelevanceBusinessId(vo.getBusinessId()); + one.setApproveUserBy(dlpUser.getId()); + one.setApproveUserName(dlpUser.getName()); + one.setApproveTime(new Date()); + one.setApproveMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : "审批通过"); + this.generateIdentifyBookApprove(one); + + record.setBusinessTypeName(BusinessStatus.JD_WS_SP_QF_TG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SP_QF_TG.getDesc()); + // 审批签发通过-通知鉴定系统 + //remoteIdentificationService.putSetReportApplovalPassed(vo.getBusinessId()); 注释掉以前的通知方式 + + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1); + if(flag){ + + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_QF_LQ.getCode()), + TaskTypeEnum.JD_WS_QF_LQ.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookQF.getCode()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + + // 发布推送事件 + applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), Collections.synchronizedSet(CollUtil.newHashSet(5, 6)))); +// applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 6)); +// applicationContext.publishEvent(new PushDataToLabsCareEvent(this, vo.getBusinessId(), 7)); + } + + } else if (BusinessStatus.JD_WS_SP_QF_WTG.getCode().equals(vo.getBusinessStatus())){ + // 审批签发未通过 + record.setBusinessTypeName(BusinessStatus.JD_WS_SP_QF_WTG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SP_QF_WTG.getDesc()); + + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), -1)){ + + } + + } else if (BusinessStatus.JD_WS_SP_QF_TH_XG.getCode().equals(vo.getBusinessStatus())){ + // 审批签发退回修改 + record.setBusinessTypeName(BusinessStatus.JD_WS_SP_QF_TH_XG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_SP_QF_TH_XG.getDesc()); + + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 2); + if(flag){ + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_SP_TH_XG.getCode()), + TaskTypeEnum.JD_WS_SP_TH_XG.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookProductionRrSubmissionProcess.getCode()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } + + }else if (BusinessStatus.JD_WS_YLQ.getCode().equals(vo.getBusinessStatus())){ + // TODO 领取成功--生成鉴定文书领取信息 + ReceiveIdentifyBook receiveIdentifyBook = new ReceiveIdentifyBook(); + BeanUtil.copyProperties(vo, receiveIdentifyBook); + if (receiveIdentifyBookService.count(Wrappers.lambdaQuery().eq(ReceiveIdentifyBook::getRelevanceBusinessId, vo.getBusinessId())) > 0) { + return R.failed("文书已被领取,请勿重复领取!"); + } + receiveIdentifyBook.setRelevanceBusinessId(vo.getBusinessId()); + receiveIdentifyBook.setOperatorUserId(dlpUser.getId()); + receiveIdentifyBook.setOperatorUserName(dlpUser.getName()); + receiveIdentifyBookService.save(receiveIdentifyBook); + + record.setBusinessTypeName(BusinessStatus.JD_WS_YLQ.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_YLQ.getDesc()); + + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1)){ + + } + + } else { + return R.failed("参数-业务状态未定义,请确认传入的业务状态是否正确或联系管理员!!!"); + } + if(businessProcessRecordService.save(record)){ + return R.ok(); + } + } + return R.failed("系统异常,请联系管理员!!!"); + } + + @ApiOperation(value = "鉴定文书修改/补充(提交/审核/审批)", notes = "鉴定文书修改/补充(提交/审核/审批)") + @Transactional + @PostMapping("/identifyBookModifySupplementTJSHSP") + public R identifyBookModifySupplementTJSHSP(@RequestBody BusinessProcessRecordVO vo, HttpServletRequest request){ + boolean update = modifySupplementApplyService.update(new LambdaUpdateWrapper() + .set(ModifySupplementApply::getStatus, vo.getBusinessStatus()) + .eq(ModifySupplementApply::getId, vo.getId())); + if(update){ + // 获取用户消息 + Principal principal = request.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + TaskNotification taskNotification = new TaskNotification(); + + ModifySupplementApply modifySupplementApply = modifySupplementApplyService.getById(vo.getId()); + BusinessProcessRecord record = new BusinessProcessRecord(); + record.setBusinessId(vo.getBusinessId()); + record.setBusinessName("鉴定文书修改/补充申请"); + record.setBusinessStatus(Integer.parseInt(vo.getBusinessStatus())); + if(BusinessStatus.JD_WS_XG_BC_SQ.getCode().equals(vo.getBusinessStatus())) { + // 提交审核 + record.setBusinessTypeName(BusinessStatus.JD_WS_XG_BC_SQ.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_XG_BC_SQ.getDesc()); + + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_XG_BC_SH.getCode()), + TaskTypeEnum.JD_WS_XG_BC_SH.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookModificationAndSupplementationSH.getCode()); + taskNotification.setSubmitterUserId(dlpUser.getId()); + taskNotification.setSubmitterUserName(dlpUser.getName()); + Entrustment entrustment = entrustmentService.getById(modifySupplementApply.getEntrustmentId()); + taskNotification.setAcceptNo(entrustment.getAcceptNo()); + //CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId()); + //taskNotification.setCaseName(caseEvent.getCaseName()); + taskNotification.setCaseName(entrustment.getCaseName()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } else if (BusinessStatus.JD_WS_XG_BC_SH_TG.getCode().equals(vo.getBusinessStatus())){ + // 审核通过 设置并修改授权审核信息 + modifySupplementApply.setEmpowerBySignDate(new Date()); + modifySupplementApply.setEmpowerBySignOpinion(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : "审核通过"); + modifySupplementApplyService.updateById(modifySupplementApply); + + record.setBusinessTypeName(BusinessStatus.JD_WS_XG_BC_SH_TG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_XG_BC_SH_TG.getDesc()); + + // 修改推送任务通知处理状态 + boolean flag = commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1); + if(flag){ + + // 设置任务通知公共信息 + commSetTaskNotification(taskNotification, vo.getBusinessId(), + Integer.parseInt(TaskTypeEnum.JD_WS_XG_BC_SP.getCode()), + TaskTypeEnum.JD_WS_XG_BC_SP.getDesc(), + record.getMessage(), + PermissionGroupEnum.IdentifyBookModificationAndSupplementationSP.getCode()); + Entrustment entrustment = entrustmentService.getById(modifySupplementApply.getEntrustmentId()); + taskNotification.setCaseName(entrustment.getCaseName()); + // 推送任务通知 + commSaveTaskNotification(taskNotification); + } + } else if (BusinessStatus.JD_WS_XG_BC_SH_WTG.getCode().equals(vo.getBusinessStatus())){ + // 审核未通过 + record.setBusinessTypeName(BusinessStatus.JD_WS_XG_BC_SH_WTG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_XG_BC_SH_WTG.getDesc()); + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), -1)){ + + } + } else if (BusinessStatus.JD_WS_XG_BC_SP_TG.getCode().equals(vo.getBusinessStatus())){ + // 审批通过 设置并修改技术人员审批信息 + modifySupplementApply.setTechnologyBySignDate(new Date()); + modifySupplementApply.setTechnologyBySignOpinion(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : "审核通过"); + // 生成鉴定文书修改补充申请表 + this.generateModifySupplementApply(modifySupplementApply); + record.setBusinessTypeName(BusinessStatus.JD_WS_XG_BC_SP_TG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_XG_BC_SP_TG.getDesc()); + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), 1)){ + } + if(modifySupplementApply.getUpdateWay() == 2){ + // 修改鉴定文书业务状态未 收回原件-重新制作 + identifyBookRelevanceService.update(new LambdaUpdateWrapper() + .set(IdentifyBookRelevance::getBookStatus, BusinessStatus.JD_WS_XG_BC_SH_YJ_CX_ZZ.getCode()) + .eq(IdentifyBookRelevance::getRelevanceBusinessId, modifySupplementApply.getEntrustmentId())); + } + + + } else if (BusinessStatus.JD_WS_XG_BC_SP_WTG.getCode().equals(vo.getBusinessStatus())){ + // 审批未通过 + record.setBusinessTypeName(BusinessStatus.JD_WS_XG_BC_SP_WTG.getDesc()); + record.setMessage(StringUtils.isNotEmpty(vo.getMessage()) ? vo.getMessage() : BusinessStatus.JD_WS_XG_BC_SP_WTG.getDesc()); + // 修改推送任务通知处理状态 + if(commUpdateTaskNotification(taskNotification, dlpUser, vo.getBusinessId(), -1)){ + + } + } else { + return R.failed("参数-业务状态未定义,请确认传入的业务状态是否正确或联系管理员!!!"); + } + if(businessProcessRecordService.save(record)){ + return R.ok(); + } + } + return R.failed("系统异常,请联系管理员!!!"); + } + + //获取鉴定书的处理记录,按ID排序 + @ApiOperation(value ="获取鉴定书的处理记录,按ID desc排序",notes = "获取鉴定书的处理记录,按ID desc排序") + @GetMapping("/getIdentifyBookProcessRecord") + public R getIdentifyBookProcessRecord(String businessId){ + List ret= businessProcessRecordService.list(Wrappers.lambdaQuery() + .eq(BusinessProcessRecord::getBusinessId,businessId) + .orderByDesc(BusinessProcessRecord::getId)); + return R.ok(ret); + } + /** + * TODO 生成鉴定文书审批表并保存 + * @param one 鉴定文书审批表对象 + */ + private void generateIdentifyBookApprove(IdentifyBookApprove one) { + try { + EntrustCaseDTO entrustCaseDTO = entrustmentService.getEntrustCaseDTOById(one.getRelevanceBusinessId()); + IdentifyBookRelevance identifyBookRelevance = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .eq(IdentifyBookRelevance::getRelevanceBusinessId, one.getRelevanceBusinessId())); + + // 模板 +// String templateFileName = "NADL-Shaanxi-CX-22-01-2021鉴定文书审批表001.doc"; + String templateFileName = AppStartupRunner.getCfg("identifyBookApproveTemplate"); + // 文件类型 + String fileType = ".docx"; // 文件类型 + // 文件版本号 + String version = "v1.0"; + // 文件名 + String fileName = "鉴定文书审批表-" + version; + + // 文件路径 + 业务ID +文件名 + String pathFileName = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + one.getRelevanceBusinessId() + "/bookApprove/" + fileName; + + Map parameter = ClassUtils.objectToMap(entrustCaseDTO); + parameter.put("bookYear", identifyBookRelevance.getYear()); + parameter.put("bookSerialNumber", identifyBookRelevance.getSerialNumber()); + one.setYear(identifyBookRelevance.getYear()); + one.setSerialNumber(identifyBookRelevance.getSerialNumber()); + + // 获取样本数量 + long sampleNum = entrustmentIdentificationMaterialService.count(new LambdaQueryWrapper() + .eq(EntrustmentIdentificationMaterial::getEntrustmentId, one.getRelevanceBusinessId())); + parameter.put("sampleNum", sampleNum); + + one.setPath(pathFileName + fileType); + one.setFileName(fileName + fileType); + if(StringUtils.isEmpty(one.getYear())){ + LocalDateTime localDateTime = LocalDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault()); + String year = LocalDateTimeUtil.format(localDateTime, "yyyy"); + List list = identifyBookApproveService.list(new LambdaQueryWrapper() + .eq(IdentifyBookApprove::getYear, year) + .orderByDesc(IdentifyBookApprove::getSerialNumber)); + if(CollectionUtils.isNotEmpty(list)){ + int num = Integer.parseInt(list.get(0).getSerialNumber()); + one.setYear(year); + one.setSerialNumber(StrUtil.fillBefore((num + 1) + "", '0', 5)); + } else { + one.setYear(year); + one.setSerialNumber(StrUtil.fillBefore( "1", '0', 5)); + } + + } + parameter.put("year", one.getYear()); + parameter.put("serialNumber", one.getSerialNumber()); +// parameter.put("identificationRequestsDesc", IdentifyRequireEnum.findEnumByCode(entrustCaseDTO.getIdentificationRequests()).getDesc()); + parameter.put("otherIdentificationRequests", StringUtils.isNotEmpty(entrustCaseDTO.getOtherIdentificationRequests())? "其它:" + entrustCaseDTO.getOtherIdentificationRequests(): ""); + + // 文书类型:(1:检验报告,2:其它) + parameter.put("inspectionReportFlag", false); + parameter.put("otherFlag", false); + if(StringUtils.isNotEmpty(one.getBookType())){ + String[] bookTypeArr = one.getBookType().split(","); + for (String s : bookTypeArr) { + if (Integer.parseInt(s) == 1) { + parameter.put("inspectionReportFlag", true); + parameter.put("inspectionReportNumber", one.getInspectionReportNumber()); + } else if (Integer.parseInt(s) == 2) { + parameter.put("otherFlag", true); + parameter.put("otherNumber", one.getOtherNumber()); + } + } + } + + // 附件(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书) + parameter.put("jyJlFlag", false); + parameter.put("jdSxQrsFlag", false); + parameter.put("jdWtsFlag", false); + parameter.put("jcZpFlag", false); + parameter.put("sjrZjFyjFlag", false); + parameter.put("yJdWsFlag", false); + if(StringUtils.isNotEmpty(one.getAnnexType())){ + String[] annexTypeArr = one.getAnnexType().split(","); + for (String s : annexTypeArr) { + int num = Integer.parseInt(s); + if (num == 1) { + parameter.put("jyJlFlag", true); + } else if (num == 2) { + parameter.put("jdSxQrsFlag", true); + } else if (num == 3) { + parameter.put("jdWtsFlag", true); + } else if (num == 4) { + parameter.put("jcZpFlag", true); + } else if (num == 5) { + parameter.put("sjrZjFyjFlag", true); + } else if (num == 6) { + parameter.put("yJdWsFlag", true); + } + } + } + + // 是否合格(1:检验方法、2:检验过程、3:检验图谱、4:检验结果) + parameter.put("jyFfFlag", false); + parameter.put("jyGcFlag", false); + parameter.put("jyTpFlag", false); + parameter.put("jyJgFlag", false); + if(StringUtils.isNotEmpty(one.getIsQualified())){ + String[] isQualifiedArr = one.getIsQualified().split(","); + for (String s : isQualifiedArr) { + int num = Integer.parseInt(s); + if (num == 1) { + parameter.put("jyFfFlag", true); + } else if (num == 2) { + parameter.put("jyGcFlag", true); + } else if (num == 3) { + parameter.put("jyTpFlag", true); + } else if (num == 4) { + parameter.put("jyJgFlag", true); + } + } + } + // 鉴定文书审核意见 + parameter.put("processMessage", one.getProcessMessage()); + // 鉴定文书审核日期 + parameter.put("processTime", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(one.getProcessTime().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + // 鉴定文书审批意见 + parameter.put("approveMessage", one.getApproveMessage()); + // 鉴定文书审批日期 + parameter.put("approveTime", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(one.getApproveTime().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + // 备注 + parameter.put("remarks", one.getRemarks()); + + // 生成鉴定文书审批表 + R r = remoteGenerateWordService.generateWord(templateFileName, "", pathFileName, fileType, + "", null, false, parameter); + if(r != null && r.getCode() == 0){ + identifyBookApproveService.updateById(one); + } else { + throw new IllegalArgumentException(r.getMsg()); + } + }catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * TODO 生成鉴定文书修改/补充申请表 + * @param modifySupplementApply 修改补充对象 + */ + private void generateModifySupplementApply(ModifySupplementApply modifySupplementApply){ + + try { + IdentifyBookRelevance identifyBookRelevance = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .eq(IdentifyBookRelevance::getRelevanceBusinessId, modifySupplementApply.getEntrustmentId())); + Entrustment entrustment = entrustmentService.getById(modifySupplementApply.getEntrustmentId()); + + Map parameter = ClassUtils.objectToMap(modifySupplementApply); + parameter.put("bookYear", identifyBookRelevance.getYear()); + parameter.put("bookSerialNumber", identifyBookRelevance.getSerialNumber()); + parameter.put("clientOrgName", entrustment.getClientOrgName()); + if(StringUtils.isNotEmpty(modifySupplementApply.getEntrustBy()) && StringUtils.isEmpty(modifySupplementApply.getEntrustUserName())){ + parameter.put("entrustUserName", remoteUserService.innerGetById(modifySupplementApply.getEntrustBy()).getData().getName()); + } else { + parameter.put("entrustUserName", modifySupplementApply.getEntrustUserName()); + } + + if(ObjectUtils.isNotEmpty(modifySupplementApply.getApplyTime())){ + parameter.put("applyTime", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(modifySupplementApply.getApplyTime().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + } +// parameter.put("updateUserName", remoteUserService.innerGetById(modifySupplementApply.getUpdateBy()).getData().getName()); + parameter.put("updateUserName", modifySupplementApply.getUpdateBy()); + if(ObjectUtils.isNotEmpty(modifySupplementApply.getUpdateTime())){ + parameter.put("updateTime", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(modifySupplementApply.getUpdateTime().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + } + + + parameter.put("xgCdWjFlag", false); + parameter.put("shYjCxCjJdWsFlag", false); + if(modifySupplementApply.getUpdateWay() == 1){ + parameter.put("xgCdWjFlag", true); + }else{ + parameter.put("shYjCxCjJdWsFlag", true); + } + if(ObjectUtils.isNotEmpty(modifySupplementApply.getEmpowerBySignDate())){ + parameter.put("empowerBySignDate", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(modifySupplementApply.getEmpowerBySignDate().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + } + if(ObjectUtils.isNotEmpty(modifySupplementApply.getTechnologyBySignDate())){ + parameter.put("technologyBySignDate", LocalDateTimeUtil.format( + LocalDateTime.ofInstant(modifySupplementApply.getTechnologyBySignDate().toInstant(), ZoneId.systemDefault()), "yyyy年MM月dd日")); + } + + + // 获取模板文件名 + String templateFileName = AppStartupRunner.getCfg("identifyBookModifySupplementApplyTemplate"); + // 文件类型 + String fileType = ".docx"; // 文件类型 + // 文件版本号 + String version = "v1.0"; + // 文件名 + String fileName = "鉴定文书修改补充申请-" + version; + + // 文件路径 + 业务ID +文件名 + String pathFileName = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + modifySupplementApply.getEntrustmentId() + "/bookModifyApply/" + fileName; + // 生成鉴定文书审批表 + R r = remoteGenerateWordService.generateWord(templateFileName, "", pathFileName, fileType, + "", null, false, parameter); + if(r != null && r.getCode() == 0){ + modifySupplementApply.setPath(pathFileName + fileType); + modifySupplementApply.setFileName(fileName + fileType); + modifySupplementApplyService.updateById(modifySupplementApply); + } else { + throw new IllegalArgumentException(r.getMsg()); + } + + }catch (Exception e){ + e.printStackTrace(); + } + } + /** + * 设置任务通知公共信息 + * @param taskNotification 任务通知信息 + * @param businessId 业务ID + * @param type 任务类型 + * @param title 任务标题 + * @param content 任务类容 + * @param permissionGroup 任务代办人员组 + */ + private void commSetTaskNotification(TaskNotification taskNotification, String businessId, + int type, String title, String content, String permissionGroup){ + taskNotification.setBusinessId(businessId); + taskNotification.setType(type); + taskNotification.setTitle(title); + taskNotification.setContent(content); + taskNotification.setPermissionGroup(permissionGroup); + } + + /** + * 修改推送任务通知处理状态 + * @param taskNotification 任务通知基本信息 + * @return R + */ + private boolean commUpdateTaskNotification(TaskNotification taskNotification, DLPUser dlpUser, String businessId, int status){ + + // 查询并 更新任务为已处理 + TaskNotification notification = taskNotificationService.getOne(new LambdaQueryWrapper() + .eq(TaskNotification::getBusinessId, businessId) + .eq(TaskNotification::getStatus, 0) + .in(TaskNotification::getPermissionGroup, dlpUser.getPermissions())); + if(ObjectUtils.isNotEmpty(notification)){ + notification.setStatus(status); + notification.setTransactionPersonnelId(dlpUser.getId()); + notification.setTransactionPersonnelName(dlpUser.getName()); + + taskNotification.setSubmitterUserId(notification.getSubmitterUserId()); + taskNotification.setSubmitterUserName(notification.getSubmitterUserName()); + taskNotification.setAcceptNo(notification.getAcceptNo()); + taskNotification.setCaseName(notification.getCaseName()); + return taskNotificationService.updateById(notification); + } + return false; + + } + /** + * 推送任务通知 + * @param taskNotification + * @return + */ + private R commSaveTaskNotification(TaskNotification taskNotification){ + + // 设置任务通知 + boolean save = taskNotificationService.save(taskNotification); + if(!save){ + return R.failed("推送任务通知失败"); + } + return R.ok(); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEventController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEventController.java new file mode 100644 index 0000000..347a5b1 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEventController.java @@ -0,0 +1,23 @@ +package digital.laboratory.platform.identifybook.controller; + + +import digital.laboratory.platform.common.feign.RemoteGenerateWordService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 案件、事件 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/book/caseEvent") +public class CaseEventController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEvidenceController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEvidenceController.java new file mode 100644 index 0000000..6bc63c9 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/CaseEvidenceController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 与案件相关的物证信息 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/caseEvidence") +public class CaseEvidenceController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/DelivererController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/DelivererController.java new file mode 100644 index 0000000..858d94e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/DelivererController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 送检员 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/deliverer") +public class DelivererController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentBundleController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentBundleController.java new file mode 100644 index 0000000..b3f8a0d --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentBundleController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 委托与实验关系 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@RestController +@RequestMapping("/book/b-entrustment-bundle") +public class EntrustmentBundleController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentController.java new file mode 100644 index 0000000..3f4b1c3 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentController.java @@ -0,0 +1,57 @@ +package digital.laboratory.platform.identifybook.controller; + + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 委托 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "委托数据-相关接口") +@RequestMapping("/book/entrustment") +public class EntrustmentController { + + private final IEntrustmentService entrustmentService; + + @ApiOperation(value = "根据委托id查询委托相关详情", notes = "根据委托id查询委托相关详情") + @GetMapping("/view/{entrustId}") + public R view(@PathVariable(value = "entrustId") String entrustId){ + EntrustmentDTO entrustmentDTO = entrustmentService.getEntrustmentDTO(entrustId); + return R.ok(entrustmentDTO); + } + + @ApiOperation(value = "根据条件分页查询委托数据列表", notes = "根据条件分页查询委托数据列表") + @PostMapping("/findEntrustPage") + public R> findEntrustPage(@RequestBody EntrustmentREQ req){ + List list = entrustmentService.list(); + List entrustIdList=new ArrayList<>(); + if(list.size()>0){ + entrustIdList= list.stream().map(s -> s.getId()).collect(Collectors.toList()); + } + entrustmentService.synchronizationTestSysData(entrustIdList);//同步远程数据,同步后的数据不会再同步 + return R.ok(entrustmentService.findEntrustPage(req.getPage(), req)); + } + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentIdentificationMaterialController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentIdentificationMaterialController.java new file mode 100644 index 0000000..b80d6a4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/EntrustmentIdentificationMaterialController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 检材信息 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/entrustmentIdentificationMaterial") +public class EntrustmentIdentificationMaterialController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ExaminationMethodsController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ExaminationMethodsController.java new file mode 100644 index 0000000..0c19d54 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ExaminationMethodsController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 检验方法 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@RestController +@RequestMapping("/book/examinationMethods") +public class ExaminationMethodsController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ExperimentController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ExperimentController.java new file mode 100644 index 0000000..d4de630 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ExperimentController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 实验(检验方法的实例) 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@RestController +@RequestMapping("/book/b-experiment") +public class ExperimentController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobController.java new file mode 100644 index 0000000..7c01747 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 毛发检测任务 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/hairJob") +public class HairJobController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobIdentificationMaterialController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobIdentificationMaterialController.java new file mode 100644 index 0000000..dfe5443 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/HairJobIdentificationMaterialController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 毛发任务的检材信息 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/hairJobIdentificationMaterial") +public class HairJobIdentificationMaterialController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentificationController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentificationController.java new file mode 100644 index 0000000..49ee47a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentificationController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 鉴定表,一个鉴定可能会有多个委托 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/identification") +public class IdentificationController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookApproveController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookApproveController.java new file mode 100644 index 0000000..6445369 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookApproveController.java @@ -0,0 +1,109 @@ +package digital.laboratory.platform.identifybook.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookApproveService; +import digital.laboratory.platform.identifybook.utils.Word2PdfAsposeUtil; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +import javax.activation.MimetypesFileTypeMap; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 鉴定文书审批表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-25 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定文书审批表相关接口") +@RequestMapping("/book/identifyBookApprove") +public class IdentifyBookApproveController { + + private final OssFile ossFile; + private final IIdentifyBookApproveService identifyBookApproveService; + private final IEntrustmentService entrustmentService; + + @ApiOperation(value = "根据委托ID获取鉴定文书审核审批详情", notes = "根据委托ID获取鉴定文书审核审批详情") + @GetMapping("/view/{entrustId}") + public R view(@PathVariable(value = "entrustId") String entrustId, HttpServletResponse response){ + try { + Entrustment entrustment = entrustmentService.getById(entrustId); + List entrustIds = new ArrayList<>(); + List entrustmentList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustment.getIdentificationId()) + .eq(Entrustment::getId, entrustment.getId()) + ); + if(CollectionUtils.isNotEmpty(entrustmentList)){ + entrustIds.addAll(entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList())); + } + List identifyBookApproveList = identifyBookApproveService.list(new LambdaQueryWrapper() + .in(IdentifyBookApprove::getRelevanceBusinessId, entrustIds) + .orderByDesc(IdentifyBookApprove::getCreateTime)); + + return R.ok(CollectionUtils.isNotEmpty(identifyBookApproveList)? identifyBookApproveList.get(0): null); + }catch (Exception e){ + System.out.println("获取鉴定文书审批表异常" + e.getMessage()); + e.printStackTrace(); + } + return R.failed("系统异常!!!"); + } + + @ApiOperation(value = "根据委托ID获取鉴定文书审批表文件", notes = "根据委托ID获取鉴定文书审批表文件") + @GetMapping("/getIdentifyBookApprove/{entrustId}") + public void getIdentifyBookApprove(@PathVariable(value = "entrustId") String entrustId, HttpServletResponse response){ + try { + Entrustment entrustment = entrustmentService.getById(entrustId); + List entrustIds = new ArrayList<>(); + List entrustmentList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustment.getIdentificationId()) + .eq(Entrustment::getId, entrustment.getId()) + ); + if(CollectionUtils.isNotEmpty(entrustmentList)){ + entrustIds.addAll(entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList())); + } + List identifyBookApproveList = identifyBookApproveService.list(new LambdaQueryWrapper() + .in(IdentifyBookApprove::getRelevanceBusinessId, entrustIds) + .orderByDesc(IdentifyBookApprove::getCreateTime)); + // 获取文件并转PDF + ByteArrayOutputStream bosWord = new ByteArrayOutputStream(); + ossFile.fileGet(identifyBookApproveList.get(0).getPath(), bosWord); + ServletOutputStream servletOutputStream = response.getOutputStream(); + byte[] pdfByte = Word2PdfAsposeUtil.docx2pdf(new ByteArrayInputStream(bosWord.toByteArray())); + ByteArrayOutputStream baos = new ByteArrayOutputStream(pdfByte.length); + baos.write(pdfByte, 0, pdfByte.length); + baos.writeTo(servletOutputStream); + String fileName = identifyBookApproveList.get(0).getFileName(); + response.setContentType(new MimetypesFileTypeMap().getContentType(fileName.substring(0, fileName.length() - 5) + ".pdf")); + baos.close(); + }catch (Exception e){ + System.out.println("获取鉴定文书审批表异常" + e.getMessage()); + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java new file mode 100644 index 0000000..c777bf8 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookCommController.java @@ -0,0 +1,238 @@ +package digital.laboratory.platform.identifybook.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants; +import digital.laboratory.platform.common.core.util.ClassUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.feign.RemoteGenerateWordService; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.entity.*; +import digital.laboratory.platform.identifybook.handler.AppStartupRunner; +import digital.laboratory.platform.identifybook.service.*; +import digital.laboratory.platform.identifybook.vo.ExperimentVO; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +/** + *

+ * 鉴定文书-制作/修改 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/22 17:41 + */ +@Slf4j +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定文书-制作/修改-相关接口") +@RequestMapping("/book/identifyBookComm") +public class IdentifyBookCommController { + + + private final OssFile ossFile; + + private final IEntrustmentService entrustmentService; + + private final IIdentifyBookService identifyBookService; + + private final IIdentifyBookRelevanceService identifyBookRelevanceService; + + private final Environment env; + + private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + + + @ApiOperation(value = "根据委托ID制作鉴定文书", notes = "根据委托ID制作鉴定文书") + @ApiImplicitParam(name = "entrustId", value = "委托ID", required = true) + @GetMapping("/makeIdentifyBook/{entrustId}") + public R makeIdentifyBook(@PathVariable(value = "entrustId") String entrustId, HttpServletResponse response) { + EntrustCaseDTO entrustCaseDTO = null; + try { + entrustCaseDTO = identifyBookService.buildIdentifyBook(entrustId); + } catch (Exception e) { + e.printStackTrace(); + return R.failed("生成鉴定文书异常, 请联系系统管理员!!!"); + } + if (entrustCaseDTO == null) { + return R.failed("实验数据不满足生成文书!"); + } else { + return R.ok(entrustCaseDTO, "生成鉴定文书成功!"); + } + } + + @ApiOperation(value = "根据委托ID和修改后的鉴定文书更新鉴定文书", notes = "根据委托ID和修改后的鉴定文书更新鉴定文书") + @ApiImplicitParam(name = "entrustId", value = "委托ID", required = true) + @PostMapping("/updateIdentifyBook/{entrustId}") + public R updateIdentifyBook(@PathVariable(value = "entrustId") String entrustId, + @RequestPart("file") MultipartFile file, HttpServletResponse response) { + try { + Entrustment entrustment = entrustmentService.getById(entrustId); + List stringIdsList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + .eq(Entrustment::getIdentificationId, entrustment.getIdentificationId())) + .stream().map(m -> m.getId()) + .collect(Collectors.toList()); + IdentifyBookRelevance one = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, stringIdsList)); + // 获取最后一个文书版本数据 + IdentifyBook identifyBook = identifyBookService.getMaxVersionIdentifyBook(one.getId()); + + String version = "v" + new BigDecimal(identifyBook.getVersion().substring(1)).add(new BigDecimal("0.1")); // 版本号 + String fileName = "鉴定文书-" + version; + String fileType = ".docx"; // 文件类型 + String identifyBookPathFileName = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + one.getRelevanceBusinessId() + "/book/" + fileName; // 鉴定文书存储路径及文件名 + // 上传文书 + ossFile.fileSave(identifyBookPathFileName + fileType, file.getInputStream()); + // 保存文书相关消息 + boolean b = this.saveIdentifyBookComm(one.getId(), identifyBookPathFileName + fileType, fileName + fileType, version, "修改文书"); + if (b) { +// ossFile.fileGet(identifyBookPathFileName + fileType, response.getOutputStream()); +// response.setContentType(new MimetypesFileTypeMap().getContentType(fileName + fileType)); + String uuid = IdWorker.get32UUID(); + return R.ok(uuid + "#" + identifyBookPathFileName + fileType, "获取文件成功"); + } + } catch (Exception e) { + return R.failed("修改文书上传异常,请联系管理员!!!"); + } + + return R.failed("修改文书上传异常,请联系管理员!!!"); + } + + @ApiOperation(value = "根据委托ID和修改后的鉴定文书更新鉴定文书", notes = "根据委托ID和修改后的鉴定文书更新鉴定文书") + @ApiImplicitParam(name = "entrustId", value = "委托ID", required = true) + @PostMapping("/callBackIdentifyBook/{entrustId}") + public void callBackIdentifyBook(@PathVariable(value = "entrustId") String entrustId, HttpServletRequest request, HttpServletResponse response) { + log.error("entrustId:: " + entrustId); + PrintWriter writer = null; + JSONObject jsonObj = null; + try { + writer = response.getWriter(); + Scanner scanner = new Scanner(request.getInputStream()).useDelimiter("\\A"); + String body = scanner.hasNext() ? scanner.next() : ""; + jsonObj = (JSONObject) new JSONParser().parse(body); + System.out.println(jsonObj); + System.out.println("===saveeditedfile:" + jsonObj.get("status")); + /* + 0 - no document with the key identifier could be found, + 1 - document is being edited, + 2 - document is ready for saving, + 3 - document saving error has occurred, + 4 - document is closed with no changes, + 6 - document is being edited, but the current document state is saved, + 7 - error has occurred while force saving the document. + * */ + if ((long) jsonObj.get("status") == 2) { + + String downloadUri = (String) jsonObj.get("url"); + URL url = new URL(downloadUri); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + InputStream inputStream = connection.getInputStream(); + Entrustment entrustment = entrustmentService.getById(entrustId); + List stringIdsList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + .eq(Entrustment::getIdentificationId, entrustment.getIdentificationId())) + .stream().map(m -> m.getId()) + .collect(Collectors.toList()); + IdentifyBookRelevance one = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, stringIdsList)); + // 获取最后一个文书版本数据 + IdentifyBook identifyBook = identifyBookService.getMaxVersionIdentifyBook(one.getId()); + + String version = "v" + new BigDecimal(identifyBook.getVersion().substring(1)).add(new BigDecimal("0.1")); // 版本号 + String fileName = "鉴定文书-" + version; + String fileType = ".docx"; // 文件类型 + String identifyBookPathFileName = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + one.getRelevanceBusinessId() + "/book/" + fileName; // 鉴定文书存储路径及文件名 + // 上传文书 + ByteArrayOutputStream bosWord = new ByteArrayOutputStream(); + int readPos; + final byte[] bytes_oss = new byte[1024]; + while ((readPos = inputStream.read(bytes_oss)) != -1) { + bosWord.write(bytes_oss, 0, readPos); + } + ByteArrayInputStream baisWord = new ByteArrayInputStream(bosWord.toByteArray()); + boolean b1 = ossFile.fileSave(identifyBookPathFileName + fileType, baisWord); + if (b1) { + // 保存文书相关消息 + this.saveIdentifyBookComm(one.getId(), identifyBookPathFileName + fileType, fileName + fileType, version, "修改文书"); + } + + inputStream.close(); + connection.disconnect(); + } + } catch (IOException e) { + e.printStackTrace(); + } catch (ParseException e) { + e.printStackTrace(); + } + /** + * status = 1,我们给onlyoffice的服务返回{"error":"0"}的信息,这样onlyoffice会认为回调接口是没问题的,这样就可以在线编辑文档了,否则的话会弹出窗口说明 + * 在线编辑还没有关闭,前端有人下载文档时,强制保存最新内容 当status 是6时说明有人在编辑时下载文档 + */ + System.out.println(jsonObj.get("status")); + if ((long) jsonObj.get("status") == 6) { + //处理当文档正在编辑为关闭时,下载文档 + if (((String) jsonObj.get("userdata")).equals("sample userdata")) { + // FileUtil.callBackSaveDocument(jsonObj,filePath,request, response); + } + + System.out.println("====保存失败:"); + writer.write("{\"error\":1}"); + } else { + //执行删除编辑时下载保存的文件: + // FileUtil.deleteTempFile(filePath,request.getParameter("fileName")); + writer.write("{\"error\":0}"); + } + + } + + /** + * 保存鉴定文书相关数据 + * + * @param identifyBookRelevanceId 关联ID + * @param path 文件路径及文件名 + * @param fileName 文件名 + * @param version 版本号 + * @return boolean + */ + private boolean saveIdentifyBookComm(String identifyBookRelevanceId, String path, String fileName, + String version, String remarks) { + IdentifyBook identifyBook = new IdentifyBook(); + identifyBook.setIdentifyBookRelevanceId(identifyBookRelevanceId); + identifyBook.setBucketName(env.getProperty("oss.bucket-name")); + identifyBook.setPath(path); + identifyBook.setFileName(fileName); + identifyBook.setVersion(version); + identifyBook.setRemarks(remarks); + return identifyBookService.save(identifyBook); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookController.java new file mode 100644 index 0000000..959d00f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookController.java @@ -0,0 +1,89 @@ +package digital.laboratory.platform.identifybook.controller; + + +import cn.hutool.core.lang.Assert; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBook; +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.service.IIdentifyBookService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 鉴定文书信息表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定文书详细信息相关接口") +@RequestMapping("/book/identifyBook") +public class IdentifyBookController { + + private final OssFile ossFile; + + private final IIdentifyBookService identifyBookService; + @ApiOperation(value = "根据根据文书ID查看文书", notes = "根据根据文书ID查看文书") + @ApiImplicitParam(name = "bookId", value = "文书ID" , required = true) + @GetMapping("/view/{id}") + public R findBook(@PathVariable(value = "bookId") String bookId){ + try { + + IdentifyBook identifyBook = identifyBookService.getById(bookId); + String uuid= IdWorker.get32UUID(); + return R.ok( uuid+"#"+identifyBook.getPath(), "获取文件成功"); + } catch (Exception e) { + e.printStackTrace(); + } + return R.failed("获取鉴定文书失败"); + } + + @ApiOperation(value = "根据根据文书ID删除文书", notes = "根据根据文书ID删除文书") + @ApiImplicitParam(name = "bookId", value = "文书ID" , required = true) + @DeleteMapping + public R deleteById(@PathVariable(value = "bookId") String bookId){ + try { + IdentifyBook identifyBook = identifyBookService.getById(bookId); + ossFile.fileDelete(identifyBook.getFileName()); + boolean b = identifyBookService.removeById(bookId); + if(b){ + return R.ok(b, "删除成功!!!"); + } + return R.failed(b, "删除失败!!!"); + } catch (Exception e) { + e.printStackTrace(); + } + return R.failed("获取鉴定文书失败"); + } + @PostMapping("/uploadBookAttachment") + @ApiOperation(value = "上传文书的附件,主要包含 鉴定事项确认书(1),委托书(2),检材照片(3),送检人证件照(4),原鉴定情况(5)", notes = "上传文书的附件,主要包含 鉴定事项确认书(1),委托书(2),检材照片(3),送检人证件照(4),原鉴定情况(5)") + public R uploadBookAttachment(String attachType,String businessId ,List file){ + Assert.notBlank(attachType,"附件类型参数不能为空"); + Assert.notBlank(businessId,"业务ID参数不能为空"); + return R.ok(identifyBookService.uploadIdentifyBookAttachment(attachType,file,businessId)); + } + //获取手动上传的文书附件 + @GetMapping("/getUploadBookAttachment") + @ApiOperation(value = "获取手动上传的文书附件,主要包含 鉴定事项确认书(1),委托书(2),检材照片(3),送检人证件照(4),原鉴定情况(5)", notes = "上传文书的附件,主要包含 鉴定事项确认书(1),委托书(2),检材照片(3),送检人证件照(4),原鉴定情况(5)") + public R getAttachment(String businessId,String attachType){ + return R.ok(identifyBookService.getAttachment(businessId,attachType)); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookRelevanceController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookRelevanceController.java new file mode 100644 index 0000000..1741c77 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyBookRelevanceController.java @@ -0,0 +1,123 @@ +package digital.laboratory.platform.identifybook.controller; + + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBook; +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookService; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +import javax.activation.MimetypesFileTypeMap; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 鉴定文书关联中间表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定文书-相关接口") +@RequestMapping("/book/identifyBookRelevance") +public class IdentifyBookRelevanceController { + + private final OssFile ossFile; + + private final IIdentifyBookRelevanceService identifyBookRelevanceService; + private final IIdentifyBookService identifyBookService; + private final IEntrustmentService entrustmentService; + private final RemoteUserService remoteUserService; + + @ApiOperation(value = "根据委托ID获取鉴定文书", notes = "根据委托ID获取鉴定文书") + @ApiImplicitParam(name = "entrustId", value = "委托ID" , required = true) + @GetMapping("/getBook/{entrustId}") + public R getBook(@PathVariable(value = "entrustId") String entrustId, HttpServletResponse response){ + try { + Entrustment entrustment = entrustmentService.getById(entrustId); + List entrustIds = new ArrayList<>(); + List entrustmentList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustment.getIdentificationId()) + .eq(Entrustment::getId, entrustment.getId()) + ); + if(CollectionUtils.isNotEmpty(entrustmentList)){ + entrustIds.addAll(entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList())); + } + IdentifyBookRelevance one = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, entrustIds)); + if (ObjectUtils.isNotEmpty(one)) { + IdentifyBook identifyBook = identifyBookService.getMaxVersionIdentifyBook(one.getId()); + //ossFile.fileGet(identifyBook.getPath(), response.getOutputStream()); + String uuid= IdWorker.get32UUID(); + return R.ok( uuid+"#"+identifyBook.getPath(), "获取文件成功"); + //response.setContentType(new MimetypesFileTypeMap().getContentType(identifyBook.getFileName())); + } + } catch (Exception e) { + e.printStackTrace(); + } + return R.failed("获取鉴定文书失败"); + } + + @ApiOperation(value = "根据委托ID获取鉴定文书制作或修订历史列表", notes = "根据委托ID获取鉴定文书制作或修订历史列表") + @ApiImplicitParam(name = "entrustId", value = "委托ID" , required = true) + @GetMapping("/findBookHistory/{entrustId}") + public R findBookHistory(@PathVariable(value = "entrustId") String entrustId){ + try { + Entrustment entrustment = entrustmentService.getById(entrustId); + List entrustIds = new ArrayList<>(); + List entrustmentList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustment.getIdentificationId()) + .eq(Entrustment::getId,entrustId) + ); + if(CollectionUtils.isNotEmpty(entrustmentList)){ + entrustIds.addAll(entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList())); + } + IdentifyBookRelevance one = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, entrustIds)); + if (ObjectUtils.isNotEmpty(one)) { +// IdentifyBook identifyBook = identifyBookService.getMaxVersionIdentifyBook(one.getId()); + List identifyBookList = identifyBookService.list(new LambdaQueryWrapper() + .eq(IdentifyBook::getIdentifyBookRelevanceId, one.getId()) + .orderByDesc(IdentifyBook::getCreateTime)); + for (IdentifyBook identifyBook: identifyBookList){ + if(StringUtils.isNotEmpty(identifyBook.getCreateBy())){ + identifyBook.setOperateUserName(remoteUserService.innerGetById(identifyBook.getCreateBy()).getData().getName()); + } + + + } + return R.ok(identifyBookList); + } + return R.ok(null, "该委托还未制作文书!!!"); + } catch (Exception e) { + e.printStackTrace(); + } + return R.failed("获取鉴定文书失败"); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyDataCommController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyDataCommController.java new file mode 100644 index 0000000..604b1aa --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/IdentifyDataCommController.java @@ -0,0 +1,238 @@ +package digital.laboratory.platform.identifybook.controller; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.cloud.commons.lang.StringUtils; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.identifybook.entity.*; +import digital.laboratory.platform.identifybook.service.*; +import digital.laboratory.platform.sys.vo.CommonDataVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + *

+ * 鉴定数据-控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/18 16:35 + */ +@Slf4j +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定数据相关接口") +@RequestMapping("/book/identifyDataComm") +public class IdentifyDataCommController { + + /** TODO START 委托相关基础信息 **/ + private final ICaseEventService caseEventService; + private final ICaseEvidenceService caseEvidenceService; + private final IDelivererService delivererService; + private final IEntrustmentService entrustmentService; + private final IEntrustmentIdentificationMaterialService entrustmentIdentificationMaterialService; + private final IHairJobService hairJobService; + private final IHairJobIdentificationMaterialService hairJobIdentificationMaterialService; + private final IIdentificationService identificationService; + private final ISampleService sampleService; + private final ITakerService takerService; + /** TODO END 委托相关基础信息 **/ + + private final IEntrustmentBundleService entrustmentBundleService; + private final IExperimentService experimentService; + private final IExaminationMethodsService examinationMethodsService; + private final IResultEntrustmentQualitativeService resultEntrustmentQualitativeService; + private final IResultEntrustmentRationService resultEntrustmentRationService; + private final IBIdentificationProcessService identificationProcessService; + + private final IIdentifyBookRelevanceService identifyBookRelevanceService; + + + + @ApiOperation(value = "保存委托相关数据", notes = "保存委托相关数据") + @PostMapping("/commonEntrustRelated") + public R commonEntrustRelated(@RequestBody CommonDataVO commonDataVO){ + log.info("委托相关信息{}", commonDataVO); + try { + if(ObjectUtils.isNotEmpty(commonDataVO)){ + // 委托信息 检验过程 鉴定状态表 + if(CollectionUtils.isNotEmpty(commonDataVO.getEntrustmentList())){ + log.info("委托信息:{}", commonDataVO.getEntrustmentList()); + List entrustmentList = BeanUtil.copyToList(commonDataVO.getEntrustmentList(), Entrustment.class); + boolean b = entrustmentService.saveOrUpdateBatch(entrustmentList); + if (b) { + Entrustment entrustment; + if(entrustmentList.size() > 1){ + entrustment = entrustmentList + .stream() + .sorted(Comparator.comparing(Entrustment::getCreateTime)) + .collect(Collectors.toList()).get(0); + } else { + entrustment = entrustmentList.get(0); + } + List stringIDSList = entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList()); + IdentifyBookRelevance identifyBookRelevance = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, stringIDSList)); + if(ObjectUtils.isEmpty(identifyBookRelevance)){ + String[] arrNo = entrustment.getAcceptNo().split("-"); + identifyBookRelevance = new IdentifyBookRelevance(); + identifyBookRelevance.setRelevanceBusinessId(entrustment.getId()); + identifyBookRelevance.setYear(arrNo[0]); + identifyBookRelevance.setSerialNumber(arrNo[1]); + identifyBookRelevance.setBookStatus(-1); + boolean save = identifyBookRelevanceService.save(identifyBookRelevance); + if(!save){ + throw new RuntimeException("保存文书关联消息失败!!!"); + } + } + // 检验过程 + BIdentificationProcess identificationProcess = new BIdentificationProcess(); + identificationProcess.setId(entrustment.getId()); + identificationProcess.setInspectionProcess( + StringUtils.isNotEmpty(commonDataVO.getIdentificationProcess()) ? commonDataVO.getIdentificationProcess() : ""); + boolean saveOrUpdate = identificationProcessService.saveOrUpdate(identificationProcess); + if(!saveOrUpdate){ + throw new RuntimeException("保存文书关联检验过程失败!!!"); + } + log.info("保存或更新委托成功!!!"); + } + + } + // 委托关联案件信息 -- + if(ObjectUtils.isNotEmpty(commonDataVO.getCaseEvent())){ + log.info("委托关联案件信息:{}", commonDataVO.getCaseEvent()); + CaseEvent caseEvent = new CaseEvent(); + BeanUtil.copyProperties(commonDataVO.getCaseEvent(), caseEvent); + boolean b = caseEventService.saveOrUpdate(caseEvent); + if (b) { + log.info("保存或更新案件成功!!!"); + } + } + // 委托案件关联物证 -- + if(CollectionUtils.isNotEmpty(commonDataVO.getCaseEvidence())){ + log.info("委托案件关联物证:{}", commonDataVO.getCaseEvidence()); + List caseEvidenceList = BeanUtil.copyToList(commonDataVO.getCaseEvidence(), CaseEvidence.class); + boolean b = caseEvidenceService.saveOrUpdateBatch(caseEvidenceList); + if (b) { + log.info("保存或更新委托物证成功!!!"); + } + } + // 检材信息 + if(CollectionUtils.isNotEmpty(commonDataVO.getEntrustmentIdentificationMaterial())){ + log.info("检材信息:{}", commonDataVO.getEntrustmentIdentificationMaterial()); + List entrustmentIdentificationMaterialList = + BeanUtil.copyToList(commonDataVO.getEntrustmentIdentificationMaterial(), EntrustmentIdentificationMaterial.class); + boolean b = entrustmentIdentificationMaterialService.saveOrUpdateBatch(entrustmentIdentificationMaterialList); + if (b) { + log.info("保存或更新检材消息成功!!!"); + } + } + // 鉴定表,一个鉴定可能会有多个委托 + if(ObjectUtils.isNotEmpty(commonDataVO.getIdentification())){ + log.info("鉴定表,一个鉴定可能会有多个委托:{}", commonDataVO.getIdentification()); + Identification identification = new Identification(); + BeanUtil.copyProperties(commonDataVO.getIdentification(), identification); + boolean b = identificationService.saveOrUpdate(identification); + if (b) { + log.info("保存或更新鉴定表成功!!!"); + } + } + // 检验用的样本 + if(CollectionUtils.isNotEmpty(commonDataVO.getSample())){ + log.info("检验用的样本:{}", commonDataVO.getSample()); + List copyToList = BeanUtil.copyToList(commonDataVO.getSample(), Map.class); +// List sampleList = BeanUtil.copyToList(commonDataVO.getSample(), Sample.class); + List sampleList = new ArrayList<>(); + for (Map map: copyToList){ + log.info("map.get(sampleInfo): {}",map.get("sampleInfo")); +// sampleList.add(BeanUtil.copyProperties(map.get("sampleInfo"), Sample.class)); + //传递过来的数据中 sampleInfo可能为空 + if(map.get("sampleInfo")!=null){ + sampleList.add(JSON.parseObject(JSON.toJSONString(map.get("sampleInfo")), Sample.class)); + }else{ + log.info("map.get(sampleInfo): {},sampleId={} experimentId={} 这个为空",map.get("sampleInfo"),map.get("sampleId"),map.get("experimentId")); + } + + } + + log.info("检验用的样本sampleList:{}", sampleList); + boolean b = sampleService.saveOrUpdateBatch(sampleList); + log.info("检验用的样本sampleList-当这里么!!!"); + if (b) { + log.info("保存或更新检验用的样本成功!!!"); + } + } + // 委托与实验关系 + if(ObjectUtils.isNotEmpty(commonDataVO.getEntrustmentBundle())){ + log.info("委托与实验关系:{}", commonDataVO.getEntrustmentBundle()); + EntrustmentBundle entrustmentBundle = new EntrustmentBundle(); + BeanUtil.copyProperties(commonDataVO.getEntrustmentBundle(), entrustmentBundle); + boolean b = entrustmentBundleService.saveOrUpdate(entrustmentBundle); + if (b) { + log.info("保存或更新委托与实验关系成功!!!"); + } + } + // 实验列表 + if(CollectionUtils.isNotEmpty(commonDataVO.getExperimentList())){ + log.info("实验列表:{}", commonDataVO.getExperimentList()); + List experimentList = BeanUtil.copyToList(commonDataVO.getExperimentList(), Experiment.class); + boolean b = experimentService.saveOrUpdateBatch(experimentList); + if (b) { + log.info("保存或更新实验列表成功!!!"); + } + } + // 检验方法列表 + if(CollectionUtils.isNotEmpty(commonDataVO.getMethodList())){ + log.info("检验方法列表:{}", commonDataVO.getMethodList()); + List examinationMethodsList = BeanUtil.copyToList(commonDataVO.getMethodList(), ExaminationMethods.class); + boolean b = examinationMethodsService.saveOrUpdateBatch(examinationMethodsList); + if (b) { + log.info("保存或更新检验方法列表成功!!!"); + } + } + // 定性检验结果 + if(CollectionUtils.isNotEmpty(commonDataVO.getResultEntrustmentQualitative())){ + log.info("定性检验结果:{}", commonDataVO.getResultEntrustmentQualitative()); + List resultEntrustmentQualitativeList = + BeanUtil.copyToList(commonDataVO.getResultEntrustmentQualitative(), ResultEntrustmentQualitative.class); + boolean b = resultEntrustmentQualitativeService.saveOrUpdateBatch(resultEntrustmentQualitativeList); + if (b) { + log.info("保存或更新定性检验结果!!!"); + } + } + // 定量检验结果 + if(CollectionUtils.isNotEmpty(commonDataVO.getResultEntrustmentRation())){ + log.info("定量检验结果:{}", commonDataVO.getResultEntrustmentRation()); + List resultEntrustmentRationList = + BeanUtil.copyToList(commonDataVO.getResultEntrustmentRation(), ResultEntrustmentRation.class); + boolean b = resultEntrustmentRationService.saveOrUpdateBatch(resultEntrustmentRationList); + if (b) { + log.info("保存或更新定量检验结果!!!"); + } + } + } + }catch (Exception e){ + e.printStackTrace(); + return R.failed("保存或更新委托及鉴定结果异常,请联系管理员!!!"); + } + + return R.ok(); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ModifySupplementApplyController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ModifySupplementApplyController.java new file mode 100644 index 0000000..2f8fa69 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ModifySupplementApplyController.java @@ -0,0 +1,174 @@ +package digital.laboratory.platform.identifybook.controller; + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.emums.BusinessStatus; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import digital.laboratory.platform.identifybook.entity.ModifySupplementApply; +import digital.laboratory.platform.identifybook.req.ModifySupplementApplyREQ; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IModifySupplementApplyService; +import digital.laboratory.platform.identifybook.utils.Word2PdfAsposeUtil; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.web.bind.annotation.*; + +import javax.activation.MimetypesFileTypeMap; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.security.Principal; +import java.util.Arrays; +import java.util.Date; + +/** + *

+ * 鉴定文书修改补充申请表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "鉴定文书修改补充申请相关接口") +@RequestMapping("/book/modifySupplementApply") +public class ModifySupplementApplyController { + + private final OssFile ossFile; + + private final IModifySupplementApplyService modifySupplementApplyService; + + private final RemoteUserService remoteUserService; + + private final IEntrustmentService entrustmentService; + + @ApiOperation(value = "保存/更新鉴定文书修改补充申请信息", notes = "保存/更新鉴定文书修改补充申请信息") + @PostMapping + public R addOrUpdate(@RequestBody ModifySupplementApply modifySupplementApply, HttpServletRequest request){ + // 获取用户消息 + Principal principal = request.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + // 查询当前是否已经申请并且还没有审批完成的记录 + ModifySupplementApply existInfo = modifySupplementApplyService + .getOne(Wrappers.lambdaQuery() + .eq(ModifySupplementApply::getEntrustmentId, modifySupplementApply.getEntrustmentId()) + .eq(ModifySupplementApply::getApplyBy, dlpUser.getId()) + .notIn(ModifySupplementApply::getStatus, + Arrays.asList(BusinessStatus.JD_WS_XG_BC_SP_TG.getCode(), BusinessStatus.JD_WS_XG_BC_SP_WTG.getCode()))); + if (existInfo != null) { + throw new RuntimeException("当前您有未审批完成的申请,请先处理当前申请!"); + } + Entrustment entrustment = entrustmentService.getById(modifySupplementApply.getEntrustmentId()); + String[] split = entrustment.getAcceptNo().split("-"); + modifySupplementApply.setApplyBy(dlpUser.getId()); + modifySupplementApply.setYear(split[0]); + modifySupplementApply.setSerialNumber(split[1]); + modifySupplementApply.setStatus(0); + modifySupplementApply.setApplyTime(new Date()); + modifySupplementApply.setUpdateTime(new Date()); + if(modifySupplementApplyService.saveOrUpdate(modifySupplementApply)){ + return R.ok(modifySupplementApply); + } + return R.failed("保存或更新失败"); + } + + @ApiOperation(value = "获取当前用户是否有未审批的申请修改记录信息", notes = "获取当前用户是否有未审批的申请修改记录信息") + @GetMapping("/getNotApproveApplyInfo") + public R getNotApproveApplyInfoByUser(@RequestParam String entrustId, HttpServletRequest request){ + // 获取用户消息 + Principal principal = request.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + // 查询当前是否已经申请并且还没有审批完成的记录 + ModifySupplementApply existInfo = modifySupplementApplyService + .getOne(Wrappers.lambdaQuery() + .eq(ModifySupplementApply::getEntrustmentId, entrustId) + .eq(ModifySupplementApply::getApplyBy, dlpUser.getId()) + .notIn(ModifySupplementApply::getStatus, + Arrays.asList(BusinessStatus.JD_WS_XG_BC_SP_TG.getCode(), BusinessStatus.JD_WS_XG_BC_SP_WTG.getCode()))); + // 如果查询为空则new一个实例返回 + return R.ok(existInfo == null ? new ModifySupplementApply() : existInfo); + } + + @ApiOperation(value = "通过鉴定文书修改补充申请ID删除鉴定文书修改补充申请信息", notes = "通过鉴定文书修改补充申请ID删除鉴定文书修改补充申请信息") + @DeleteMapping("/{id}") + public R del(@PathVariable("id") String id){ + if(modifySupplementApplyService.removeById(id)){ + return R.ok(); + } + return R.failed("删除鉴定文书修改补充申请信息失败!!!"); + } + + @ApiOperation(value = "通过鉴定文书修改补充申请ID查询鉴定文书修改补充申请信息", notes = "通过鉴定文书修改补充申请ID查询职鉴定文书修改补充申请信息") + @GetMapping("/view/{id}") + public R view(@PathVariable("id") String id){ + ModifySupplementApply modifySupplementApply = modifySupplementApplyService.getById(id); + if(ObjectUtils.isNotEmpty(modifySupplementApply)){ + if(StringUtils.isNotEmpty(modifySupplementApply.getEntrustBy()) && StringUtils.isEmpty(modifySupplementApply.getEntrustUserName())){ + modifySupplementApply.setEntrustUserName( + remoteUserService.innerGetById(modifySupplementApply.getEntrustBy()).getData().getName()); + } + + return R.ok(modifySupplementApply); + } + return R.failed("查询鉴定文书修改补充申请信息失败"); + } + + @ApiOperation(value = "通过条件分页查询鉴定文书修改补充申请信息", notes = "通过条件分页查询鉴定文书修改补充申请信息") + @PostMapping("/search") + public R> getCareerCredentialsPage(@RequestBody ModifySupplementApplyREQ req){ + IPage modifySupplementApplyIPage = modifySupplementApplyService.page( + req.getPage(), null); + if(CollectionUtils.isNotEmpty(modifySupplementApplyIPage.getRecords())){ + for (ModifySupplementApply modifySupplementApply: modifySupplementApplyIPage.getRecords()) { + if(StringUtils.isNotEmpty(modifySupplementApply.getEntrustBy())){ + modifySupplementApply.setEntrustUserName( + remoteUserService.innerGetById(modifySupplementApply.getEntrustBy()).getData().getName()); + } + } + } + return R.ok(modifySupplementApplyIPage); + } + + @ApiOperation(value = "根据鉴定文书修改补充申请ID获取鉴定文书修改补充申请文件", notes = "根据鉴定文书修改补充申请ID获取鉴定文书修改补充申请文件") + @GetMapping("/getIdentifyBookApprove/{id}") + public R getModifySupplementApplyWord(@PathVariable(value = "id") String id, HttpServletResponse response){ + try { + ModifySupplementApply modifySupplementApply = modifySupplementApplyService.getById(id); + if (ObjectUtils.isNotEmpty(modifySupplementApply) && StringUtils.isNotEmpty(modifySupplementApply.getPath())){ + + ByteArrayOutputStream bosWord = new ByteArrayOutputStream(); + ossFile.fileGet(modifySupplementApply.getPath(), bosWord); +// ossFile.fileGet(modifySupplementApply.getPath(), response.getOutputStream()); + ServletOutputStream servletOutputStream = response.getOutputStream(); + byte[] pdfByte = Word2PdfAsposeUtil.docx2pdf(new ByteArrayInputStream(bosWord.toByteArray())); + ByteArrayOutputStream baos = new ByteArrayOutputStream(pdfByte.length); + baos.write(pdfByte, 0, pdfByte.length); + baos.writeTo(servletOutputStream); + response.setContentType(new MimetypesFileTypeMap().getContentType( + modifySupplementApply.getFileName().substring(0, modifySupplementApply.getFileName().length() - 5) + ".pdf")); +// String uuid= IdWorker.get32UUID(); +// return R.ok( uuid+"#"+modifySupplementApply.getPath(), "获取文件成功"); + } + }catch (Exception e){ + System.out.println("获取鉴定文书审批表异常" + e.getMessage()); + e.printStackTrace(); + } + return R.failed("获取鉴定文书修改补充申请文件失败"); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ReceiveIdentifyBookController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ReceiveIdentifyBookController.java new file mode 100644 index 0000000..2359e9f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ReceiveIdentifyBookController.java @@ -0,0 +1,171 @@ +package digital.laboratory.platform.identifybook.controller; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.dto.ReceiveIdentifyBookDTO; +import digital.laboratory.platform.identifybook.emums.BusinessStatus; +import digital.laboratory.platform.identifybook.entity.CaseEvent; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.EntrustmentIdentificationMaterial; +import digital.laboratory.platform.identifybook.entity.ReceiveIdentifyBook; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; +import digital.laboratory.platform.identifybook.service.ICaseEventService; +import digital.laboratory.platform.identifybook.service.IEntrustmentIdentificationMaterialService; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IReceiveIdentifyBookService; +import digital.laboratory.platform.identifybook.utils.BaseRequest; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + *

+ * 领取鉴定文书信息表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "领取鉴定文书信息-相关接口") +@RequestMapping("/book/receiveIdentifyBook") +public class ReceiveIdentifyBookController { + + private final IEntrustmentService entrustmentService; + + private final ICaseEventService caseEventService; + + private final IEntrustmentIdentificationMaterialService entrustmentIdentificationMaterialService; + + private final IReceiveIdentifyBookService receiveIdentifyBookService; + + @ApiOperation(value = "根据条件分页查询委托数据列表", notes = "根据条件分页查询委托数据列表") + @PostMapping("/findReceiveIdentifyBookPage") + public R> findEntrustPage(@RequestBody EntrustmentREQ req){ + if(req.getBookStatusList().size() == 1){ + if(req.getBookStatusList().get(0).equals("4")){ + IPage entrustPage = entrustmentService.findEntrustPage(req.getPage(), req); + IPage bookDTOIPage = new Page<>(); + bookDTOIPage.setCurrent(entrustPage.getCurrent()); + bookDTOIPage.setPages(entrustPage.getPages()); + bookDTOIPage.setSize(entrustPage.getSize()); + bookDTOIPage.setTotal(entrustPage.getTotal()); + List receiveIdentifyBookDTOList = new ArrayList<>(); + for (EntrustmentDTO entrustmentDTO: entrustPage.getRecords()){ + ReceiveIdentifyBookDTO receiveIdentifyBookDTO = new ReceiveIdentifyBookDTO(); + List stringIDSList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustmentDTO.getIdentificationId()) + .eq(Entrustment::getId, entrustmentDTO.getId()) + ) + .stream().map(m -> m.getId()) + .collect(Collectors.toList()); + receiveIdentifyBookDTO.setEntrustId(entrustmentDTO.getId()); + receiveIdentifyBookDTO.setSampleNum(entrustmentDTO.getMaterialNum()); + BeanUtil.copyProperties(entrustmentDTO, receiveIdentifyBookDTO); + /* List receiveIdentifyBookList = receiveIdentifyBookService.list(new LambdaQueryWrapper() + .in(ReceiveIdentifyBook::getRelevanceBusinessId, stringIDSList)); + if(CollectionUtils.isNotEmpty(receiveIdentifyBookList)){ + BeanUtil.copyProperties(receiveIdentifyBookList.get(0), receiveIdentifyBookDTO); + receiveIdentifyBookDTO.setReceiveId(receiveIdentifyBookList.get(0).getId()); + receiveIdentifyBookDTO.setStatus(2); + } else { + receiveIdentifyBookDTO.setStatus(1); + }*/ + receiveIdentifyBookDTO.setCaseName(entrustmentDTO.getCaseName()); + receiveIdentifyBookDTO.setAcceptNo(entrustmentDTO.getAcceptNo()); + receiveIdentifyBookDTO.setAcceptTime(entrustmentDTO.getAcceptTime()); + receiveIdentifyBookDTO.setStatus(1); + if (StrUtil.isBlank(receiveIdentifyBookDTO.getReceiveWay())) { + receiveIdentifyBookDTO.setReceiveWay(entrustmentDTO.getReportReceiveMode());//优先使用原来的领取方式 + receiveIdentifyBookDTO.setPostAddress(entrustmentDTO.getPostAddress()); + } + receiveIdentifyBookDTOList.add(receiveIdentifyBookDTO); + } + bookDTOIPage.setRecords(receiveIdentifyBookDTOList); + return R.ok(bookDTOIPage); + } else { + BaseRequest request = new BaseRequest<>(); + request.setCurrent(req.getCurrent()); + request.setSize(req.getSize()); + IPage receiveIdentifyBookDTOIPage = + receiveIdentifyBookService.pageReceiveIdentifyBook(request.getPage(), req.getKey()); + if(CollectionUtils.isNotEmpty(receiveIdentifyBookDTOIPage.getRecords())){ + for (ReceiveIdentifyBookDTO receiveIdentifyBookDTO: receiveIdentifyBookDTOIPage.getRecords()){ + Entrustment entrustment = entrustmentService.getById(receiveIdentifyBookDTO.getEntrustId()); + List stringIDSList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + //.eq(Entrustment::getIdentificationId, entrustment.getIdentificationId()) + .eq(Entrustment::getId, entrustment.getId()) + ) + .stream().map(m -> m.getId()) + .collect(Collectors.toList()); + receiveIdentifyBookDTO.setCaseName(entrustment.getCaseName()); + receiveIdentifyBookDTO.setSampleNum(entrustment.getMaterialNum()); + receiveIdentifyBookDTO.setAcceptTime(entrustment.getAcceptTime()); + receiveIdentifyBookDTO.setAcceptNo(entrustment.getAcceptNo()); + receiveIdentifyBookDTO.setStatus(2); + if (StrUtil.isBlank(receiveIdentifyBookDTO.getReceiveWay())) { + receiveIdentifyBookDTO.setReceiveWay(entrustment.getReportReceiveMode());//优先使用原来的领取方式 + receiveIdentifyBookDTO.setPostAddress(entrustment.getPostAddress()); + } + + } + + } + return R.ok(receiveIdentifyBookDTOIPage); + } + } + return R.ok(null,"未查询到数据"); + + } + @ApiOperation(value = "根据委托ID查看发放领取详情", notes = "根据委托ID查看发放领取详情") + @ApiImplicitParam(name = "entrustId", value = "委托ID" , required = true) + @GetMapping("/view/{entrustId}") + public R view(@PathVariable(value = "entrustId") String entrustId){ + Entrustment entrustment = entrustmentService.getById(entrustId); + List stringIDSList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + .eq(Entrustment::getIdentificationId, + entrustment.getIdentificationId())) + .stream().map(m -> m.getId()) + .collect(Collectors.toList()); + List receiveIdentifyBookList = receiveIdentifyBookService.list( + new LambdaQueryWrapper() + .in(ReceiveIdentifyBook::getRelevanceBusinessId, stringIDSList)); + if(CollectionUtils.isNotEmpty(receiveIdentifyBookList)){ + ReceiveIdentifyBookDTO receiveIdentifyBookDTO = new ReceiveIdentifyBookDTO(); + BeanUtil.copyProperties(receiveIdentifyBookList.get(0), receiveIdentifyBookDTO); + CaseEvent caseEvent = caseEventService.getById(entrustment.getCaseId()); + receiveIdentifyBookDTO.setReceiveId(receiveIdentifyBookList.get(0).getId()); + receiveIdentifyBookDTO.setEntrustId(receiveIdentifyBookList.get(0).getRelevanceBusinessId()); + receiveIdentifyBookDTO.setDeliverer1Name(entrustment.getDeliverer1Name()); + receiveIdentifyBookDTO.setDeliverer2Name(entrustment.getDeliverer2Name()); + receiveIdentifyBookDTO.setDeliverTime(entrustment.getDeliverTime()); + receiveIdentifyBookDTO.setIdentificationDomain(entrustment.getIdentificationDomain()); + receiveIdentifyBookDTO.setCaseNo(caseEvent.getCaseNo()); + receiveIdentifyBookDTO.setThirdPartySysNo(caseEvent.getThirdPartySysNo()); + receiveIdentifyBookDTO.setCaseName(caseEvent.getCaseName()); + receiveIdentifyBookDTO.setSampleNum(entrustment.getMaterialNum()); + return R.ok(receiveIdentifyBookDTO); + } + + return R.failed("为获取到相关数据!!!!"); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentQualitativeController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentQualitativeController.java new file mode 100644 index 0000000..174b508 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentQualitativeController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 委托定性分析检验结果 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@RestController +@RequestMapping("/book/resultEntrustmentQualitative") +public class ResultEntrustmentQualitativeController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentRationController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentRationController.java new file mode 100644 index 0000000..5d805a9 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/ResultEntrustmentRationController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 委托定量检验结果 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@RestController +@RequestMapping("/book/resultEntrustmentRation") +public class ResultEntrustmentRationController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/SampleController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/SampleController.java new file mode 100644 index 0000000..c038b74 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/SampleController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 检验用的样本 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/sample") +public class SampleController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/TakerController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/TakerController.java new file mode 100644 index 0000000..fedb49e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/TakerController.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 采集员 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@RestController +@RequestMapping("/book/taker") +public class TakerController { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/TaskNotificationController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/TaskNotificationController.java new file mode 100644 index 0000000..89279d5 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/TaskNotificationController.java @@ -0,0 +1,53 @@ +package digital.laboratory.platform.identifybook.controller; + + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import digital.laboratory.platform.identifybook.req.TaskNotificationREQ; +import digital.laboratory.platform.identifybook.service.ITaskNotificationService; +import digital.laboratory.platform.identifybook.vo.TaskNotificationVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.security.Principal; + +/** + *

+ * 任务信息表 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "审核审批签发-相关接口") +@RequestMapping("/book/taskNotification") +public class TaskNotificationController { + + private final ITaskNotificationService taskNotificationService; + + @ApiOperation(value = "根据条件分页查询任务/任务记录列表", notes = "根据条件分页查询任务/任务记录列表") + @PostMapping("/findTaskNotification") + public R> findTaskNotification(@RequestBody TaskNotificationREQ req, HttpServletRequest theHttpServletRequest){ + // 获取当前登录用户信息 + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + IPage page = taskNotificationService.queryTaskNotificationPage(req, dlpUser); + return R.ok(page); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/controller/commDataStatisticsController.java b/src/main/java/digital/laboratory/platform/identifybook/controller/commDataStatisticsController.java new file mode 100644 index 0000000..c02e3be --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/controller/commDataStatisticsController.java @@ -0,0 +1,108 @@ +package digital.laboratory.platform.identifybook.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.identifybook.emums.BusinessStatus; +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; +import digital.laboratory.platform.identifybook.service.ITaskNotificationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.security.oauth2.provider.OAuth2Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.security.Principal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + *

+ * 公共数据统计 前端控制器 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +@RestController +@RequiredArgsConstructor +@Api( tags = "公共数据统计-相关接口管理") +@RequestMapping("/book/commDataStatistics") +public class commDataStatisticsController { + + private final ITaskNotificationService taskNotificationService; + + private final IEntrustmentService entrustmentService; + + private final IIdentifyBookRelevanceService identifyBookRelevanceService; + + @ApiOperation(value = "综合统计", notes = "综合统计") + @GetMapping("/comprehensiveStatistics") + public R comprehensiveStatistics(HttpServletRequest theHttpServletRequest){ + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + Map mapTotal= new HashMap<>(); + // 鉴定文书列表任务统计 + long countWSLBSum = entrustmentService.countWSLBSum(Stream.of(-1, -2, 3, -4, 5, 7).collect(Collectors.toList())); + // 审核审批签发任务统计 + long countRWSum = taskNotificationService.countRWSum(dlpUser); + // 鉴定文书签发领取任务统计 + long countQFLQSum = identifyBookRelevanceService.count(new LambdaQueryWrapper() + .eq(IdentifyBookRelevance::getBookStatus, BusinessStatus.JD_WS_SP_QF_TG.getCode())); + + mapTotal.put("countWSLBSum", countWSLBSum); + mapTotal.put("countRWSum", countRWSum); + mapTotal.put("countQFLQSum", countQFLQSum); + return R.ok(mapTotal, "countWSLBSum:鉴定文书列表统计结果,countRWSum:审核审批任务统计结果,countQFLQSum:签发领取任务结果"); + + } + + @ApiOperation(value = "审核审批任务统计", notes = "审核审批任务统计") + @GetMapping("/reviewAndApprovalTaskStatistics") + public R reviewAndApprovalTaskStatistics(HttpServletRequest theHttpServletRequest){ + // 获取当前登录用户信息 + Principal principal = theHttpServletRequest.getUserPrincipal(); + DLPUser dlpUser = (DLPUser) ((OAuth2Authentication) principal).getUserAuthentication().getPrincipal(); + + return R.ok(taskNotificationService.countRWSum(dlpUser)); + + } + + @ApiOperation(value = "鉴定文书任务列表/待制作/退回修改任务统计", notes = "鉴定文书任务列表/待制作/退回修改任务统计") + @GetMapping("/identifyBookDZZORTHXGTaskStatistics") + public R identifyBookDZZORTHXGTaskStatistics(){ + Map mapTotal= new HashMap<>(); + // 鉴定文书任务列表/待制作统计 + long countWSLBDZZSum = entrustmentService.countWSLBSum(Stream.of(-1).collect(Collectors.toList())); + // 鉴定文书任务列表/退回修改/补充 + long countWSLBTHXGSum = entrustmentService.countWSLBSum(Stream.of(3, 5).collect(Collectors.toList())); + // 鉴定文书任务列表/重新制作 + long countWSLBCXZZSum = entrustmentService.countWSLBSum(Stream.of(-2, -4, 7).collect(Collectors.toList())); + mapTotal.put("countWSLBDZZSum", countWSLBDZZSum); + mapTotal.put("countWSLBTHXGSum", countWSLBTHXGSum); + mapTotal.put("countWSLBCXZZSum", countWSLBCXZZSum); + + return R.ok(mapTotal, "countWSLBDZZSum:鉴定文书待制作任务统计结果、countWSLBTHXGSum:鉴定文书退回修改任务统计结果、countWSLBCXZZSum:鉴定文书任务列表/重新制作"); + + } + + @ApiOperation(value = "鉴定文书签发待领取任务统计", notes = "鉴定文书签发待领取任务统计") + @GetMapping("/identifyBookQFDLQTaskStatistics") + public R identifyBookQFDLQTaskStatistics(){ + return R.ok(identifyBookRelevanceService.count( + new LambdaQueryWrapper() + .eq(IdentifyBookRelevance::getBookStatus, BusinessStatus.JD_WS_SP_QF_TG.getCode()))); + + } + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustCaseDTO.java b/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustCaseDTO.java new file mode 100644 index 0000000..62a1952 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustCaseDTO.java @@ -0,0 +1,130 @@ +package digital.laboratory.platform.identifybook.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/24 10:15 + */ +@Data +@ApiModel(value = "EntrustCaseDTO对象", description = "封装委托及案件相关属性") +public class EntrustCaseDTO { + + @ApiModelProperty(value = "委托Id") + private String id; + + @ApiModelProperty(value = "委托编号") + private String entrustmentNo; + + @ApiModelProperty(value = "对应的流程实例Id") + private String processInstanceId; + + @ApiModelProperty(value = "受理Id, 通过这个可以得到鉴定号") + private String identificationId; + + @ApiModelProperty(value = "鉴定委托单位名称") + private String clientOrgName; + + @ApiModelProperty(value = "委托鉴定专业") + private String identificationDomain; + + @ApiModelProperty(value = "鉴定机构名称") + private String identificationOrgName; + + @ApiModelProperty(value = "鉴定要求") + private String entrustRequirement; + + @ApiModelProperty(value = "其他鉴定要求") + private String otherIdentificationRequests; + + @ApiModelProperty(value = "是否由委托方指定鉴定方法") + private Boolean isClientSpecifiedMethod; + + @ApiModelProperty(value = "委托方指定的鉴定方法") + private String clientSpecifiedMethod; + + @ApiModelProperty(value = "检验的其他说明(鉴定事项确认书中要求, 审核人填写)") + private String otherIdentificationNotes; + + @ApiModelProperty(value = "送检人1姓名") + private String deliverer1Name; + + @ApiModelProperty(value = "送检人1职务") + private String deliverer1Position; + + @ApiModelProperty(value = "送检人1证件名称") + private String deliverer1Cert; + + @ApiModelProperty(value = "送检人1证件编号") + private String deliverer1Id; + + @ApiModelProperty(value = "送检人1电话") + private String deliverer1Phone; + + @ApiModelProperty(value = "送检人2姓名") + private String deliverer2Name; + + @ApiModelProperty(value = "送检人2职务") + private String deliverer2Position; + + @ApiModelProperty(value = "送检人2证件名称") + private String deliverer2Cert; + + @ApiModelProperty(value = "送检人2证件编号") + private String deliverer2Id; + + @ApiModelProperty(value = "送检人2电话") + private String deliverer2Phone; + + @ApiModelProperty(value = "鉴定编号") + private String identificationNo; + + @ApiModelProperty(value = "受理编号") + private String acceptNo; + + @ApiModelProperty(value = "受理人user_id") + private String acceptUser; + + @ApiModelProperty(value = "受理时间") + private Date acceptTime; + + @ApiModelProperty(value = "受理意见") + private String acceptComments; + + @ApiModelProperty(value = "案件编号") + private String caseNo; + + @ApiModelProperty(value = "第三方系统(如现勘系统、案事件系统)编号") + private String thirdPartySysNo; + + @ApiModelProperty(value = "案件名称任务名称") + private String caseName; + + @ApiModelProperty(value = "案发时间") + private Date happenTime; + + @ApiModelProperty(value = "案发地详细地点") + private String caseAddress; + + @ApiModelProperty(value = "案件所属机构") + private String caseOwnOrgId; + + @ApiModelProperty(value = "案情简要") + private String caseBrief; + + @ApiModelProperty(value = "业务类型:业务类型 10000 委托检验鉴定 10001-NPS案件 10002-毛发案件 20000 任务检验鉴定 20001-毛发任务 20002-污水任务 30000 筛查检验鉴定 30001-筛查") + private Integer businessType; + + @ApiModelProperty(value="原始系统中的委托ID") + private String synEntrustId; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustmentDTO.java b/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustmentDTO.java new file mode 100644 index 0000000..a6e703c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/dto/EntrustmentDTO.java @@ -0,0 +1,54 @@ +package digital.laboratory.platform.identifybook.dto; + +import digital.laboratory.platform.identifybook.entity.Entrustment; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/25 15:27 + */ + +@Data +@ApiModel(value = "EntrustmentDTO对象", description = "封装委托相关属性") +public class EntrustmentDTO extends Entrustment { + + @ApiModelProperty(value = "案件编号") + private String caseNo; + + @ApiModelProperty(value = "案件名称任务名称") + private String caseName; + + @ApiModelProperty(value = "案情简要") + private String caseBrief; + + @ApiModelProperty(value = "鉴定文书年份") + private String year; + + @ApiModelProperty(value = "鉴定文书序号") + private String serialNumber; + + @ApiModelProperty(value = "鉴定文书业务状态(-1:待制作,0:已制作/重新制作,1:鉴定文书-提交审核,2:鉴定文书-审核通过),-2:鉴定文书-审核未通过,3:鉴定文书-审核退回修改,4:鉴定文书-审批签发成功,-4:鉴定文书-审批拒绝签发,5:鉴定文书-审批签发退回修改") + private Integer bookStatus; + + @ApiModelProperty(value = "鉴定人") + private String appraisalUserName; + + @ApiModelProperty(value = "鉴定开始时间") + private String inspectionStartDate; + + @ApiModelProperty(value = "鉴定结束时间") + private String finishDate; + + @ApiModelProperty("补送集合") + private List children; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/dto/ReceiveIdentifyBookDTO.java b/src/main/java/digital/laboratory/platform/identifybook/dto/ReceiveIdentifyBookDTO.java new file mode 100644 index 0000000..6b0ba80 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/dto/ReceiveIdentifyBookDTO.java @@ -0,0 +1,99 @@ +package digital.laboratory.platform.identifybook.dto; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * 领取鉴定文书相关信息 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@Data +@ApiModel(value="ReceiveIdentifyBookDTO对象", description="领取鉴定文书相关信息") +public class ReceiveIdentifyBookDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "委托ID") + private String entrustId; + + /** + * 业务类型: 0=毒品鉴定 1=.....用于对应到各个检验小组 + */ + @ApiModelProperty(value="业务类型: 0=毒品鉴定 1=.....用于对应到各个检验小组") + private Integer businessType; + + @ApiModelProperty(value = "领取ID") + private String receiveId; + + @ApiModelProperty(value = "领取方式") + private String receiveWay; + + @ApiModelProperty(value="邮寄地址") + private String postAddress; + + @ApiModelProperty(value = "领取人ID") + private String recipientsUserId; + + @ApiModelProperty(value = "领取人姓名") + private String recipientsUserName; + + @ApiModelProperty(value = "领取时间") + private Date recipientsTime; + + @ApiModelProperty(value = "经办人ID") + private String operatorUserId; + + @ApiModelProperty(value = "经办人姓名") + private String operatorUserName; + + @ApiModelProperty(value="案件编号") + private String caseNo; + + @ApiModelProperty(value="受理编号") + private String acceptNo; + + @ApiModelProperty(value="第三方系统(如现勘系统、案事件系统)编号") + private String thirdPartySysNo; + + @ApiModelProperty(value="案件名称任务名称") + private String caseName; + + @ApiModelProperty(value="送检人1姓名") + private String deliverer1Name; + + @ApiModelProperty(value="送检人2姓名") + private String deliverer2Name; + + @ApiModelProperty(value="送检日期") + private LocalDateTime deliverTime; + + @ApiModelProperty(value="受理时间") + @JsonFormat(pattern = "yyyy年MM月dd日", timezone = "GMT+8") + private LocalDateTime acceptTime; + + @ApiModelProperty(value="检验项目") + private String identificationDomain; + + @ApiModelProperty(value="检材数量") + private Integer sampleNum; + + @ApiModelProperty(value="领取/发放状态(1:待发放,2:已发放)") + private Integer status; + + @ApiModelProperty(value="原始系统中的委托ID") + private String synEntrustId; + + @ApiModelProperty(value = "鉴定文书业务状态(-1:待制作,0:已制作/重新制作,1:鉴定文书-提交审核,2:鉴定文书-审核通过),-2:鉴定文书-审核未通过,3:鉴定文书-审核退回修改,4:鉴定文书-审批签发成功,-4:鉴定文书-审批拒绝签发,5:鉴定文书-审批签发退回修改,6:鉴定文书-已领取") + private Integer bookStatus; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/AnnexTypeEnum.java b/src/main/java/digital/laboratory/platform/identifybook/emums/AnnexTypeEnum.java new file mode 100644 index 0000000..601f6a3 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/AnnexTypeEnum.java @@ -0,0 +1,43 @@ +package digital.laboratory.platform.identifybook.emums; + +import lombok.Getter; + +import java.util.Arrays; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author ChenJiangBao + * @version 1.0 + * @description: 附件类型集合(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书) + * @date 2025/4/2 10:12 + */ +@Getter +public enum AnnexTypeEnum { + // 附件类型集合(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书) + INSPECTION_RECORD("1", "检验记录(含原始记录,检验图表)"), + IDENTIFICATION_CONFIRMATION("2", "鉴定事项确认书"), + ENTRUST_LETTER("3", "鉴定委托书或鉴定聘请书"), + MATERIAL_PHOTO("4", "检材照片"), + EXAMINER_ID_COPY("5", "送检人证件复印件"), + ORIGINAL_DOCUMENT("6", "原鉴定文书"), + ; + + private final String code; + private final String desc; + + AnnexTypeEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + // 使用 Map 提高查找效率 + private static final Map CODE_MAP = + Arrays.stream(AnnexTypeEnum.values()) + .collect(Collectors.toMap(AnnexTypeEnum::getCode, e -> e)); + + // 根据 code 获取枚举 + public static AnnexTypeEnum fromCode(String code) { + return CODE_MAP.get(code); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/BusinessStatus.java b/src/main/java/digital/laboratory/platform/identifybook/emums/BusinessStatus.java new file mode 100644 index 0000000..d4d1320 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/BusinessStatus.java @@ -0,0 +1,54 @@ +package digital.laboratory.platform.identifybook.emums; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + *

+ * 业务状态枚举 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/12 16:20 + */ +@Getter +@AllArgsConstructor +@ApiModel("业务状态") +public enum BusinessStatus { + JD_WS_YZZ("0", "已制作/重新制作鉴定文书"), + /** START 鉴定文书审核/审批/签发 **/ + JD_WS_TJ_SH("1","鉴定文书-提交审核"), + JD_WS_SH_TG("2","鉴定文书-审核通过"), + JD_WS_SH_WTG("-2","鉴定文书-审核未通过"), + JD_WS_SH_TH_XG("3","鉴定文书-审核退回修改"), + + JD_WS_SP_QF_TG("4","鉴定文书-审批签发成功"), + JD_WS_SP_QF_WTG("-4","鉴定文书-审批签发拒绝"), + JD_WS_SP_QF_TH_XG("5","鉴定文书-审批签发退回修改"), + + JD_WS_YLQ("6","鉴定文书-已领取"), + /** END 年度人员培训计划-提交/审核/审批业务状态 **/ + + /** START 鉴定文书修改/补充申请业务状态 **/ + JD_WS_XG_BC_SQ("1","鉴定文书-提交修改补充申请"), + JD_WS_XG_BC_SH_TG("2","鉴定文书-修改补充-审核通过"), + JD_WS_XG_BC_SH_WTG("-2","鉴定文书-修改补充-审核未通过"), + JD_WS_XG_BC_SP_TG("3","鉴定文书-修改补充-审批通过"), + JD_WS_XG_BC_SP_WTG("-3","鉴定文书-修改补充-审批不通过"), + JD_WS_XG_BC_SH_YJ_CX_ZZ("7","收回原件,重新出具鉴定文书"), + /** END 鉴定文书修改/补充申请业务状态 **/ + ; + + private final String code; + private final String desc; + + public static BusinessStatus findEnumByCode(String code) { + for (BusinessStatus status : BusinessStatus.values()) { + if (status.code.equals(code)) { + return status; + } + } + throw new IllegalArgumentException("code is not support"); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/IdentifyRequireEnum.java b/src/main/java/digital/laboratory/platform/identifybook/emums/IdentifyRequireEnum.java new file mode 100644 index 0000000..0157284 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/IdentifyRequireEnum.java @@ -0,0 +1,38 @@ +package digital.laboratory.platform.identifybook.emums; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + *

+ * 定性/定量分析枚举 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/26 10:40 + */ +@Getter +@AllArgsConstructor +@ApiModel("业务状态") +public enum IdentifyRequireEnum { + + QUALITATIVE_ANALYSIS(1, "对送检检材进行 ”定性“ 检测"), + QUANTITATIVE_ANALYSIS(2, "对送检检材进行 ”定量“ 检测"), + QUANTITATIVE_ANALYSIS_QUANTITATIVE_ANALYSIS(3, "对送检检材进行 ”定性,定量“ 检测"), + RELEVANCE(4, "对送检检材进行 ”关联性“ 检测"), + OTHER(5, "其它") + ; + + private final Integer code; + private final String desc; + + public static IdentifyRequireEnum findEnumByCode(Integer code) { + for (IdentifyRequireEnum requireEnum : IdentifyRequireEnum.values()) { + if (requireEnum.code.equals(code)) { + return requireEnum; + } + } + throw new IllegalArgumentException("code is not support"); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/PermissionGroupEnum.java b/src/main/java/digital/laboratory/platform/identifybook/emums/PermissionGroupEnum.java new file mode 100644 index 0000000..b8095ea --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/PermissionGroupEnum.java @@ -0,0 +1,54 @@ +package digital.laboratory.platform.identifybook.emums; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/8/9 16:20 + */ +@Getter +@AllArgsConstructor +@ApiModel("权限组枚举") +public enum PermissionGroupEnum { + + /** + * 鉴定文书-制作/提交/退回修改(实验人员) + */ + IdentifyBookProductionRrSubmissionProcess("IdentifyBookProductionRrSubmissionProcess", "鉴定文书-制作/提交/退回修改"), + /** + * 鉴定文书-审核(授权签字人) + */ + IdentifyBookSH("IdentifyBookSH", "鉴定文书-审核"), + /** + * 鉴定文书-审批(主任) + */ + IdentifyBookSP("IdentifyBookSP", "鉴定文书-审批(主任)"), + /** + * 鉴定文书-签发((实验人员) + */ + IdentifyBookQF("IdentifyBookQF", "鉴定文书-签发"), + + /** + * 鉴定文书-修改补充申请/提交审核 (实验人员) + */ + IdentifyBookModificationAndSupplementationSQ("IdentifyBookModificationAndSupplementationSQ", "鉴定文书-修改补充申请/提交审核"), + /** + * 鉴定文书-修改补充审核 (授权签字人) + */ + IdentifyBookModificationAndSupplementationSH("IdentifyBookModificationAndSupplementationSH", "鉴定文书-修改补充审核 "), + /** + * 鉴定文书-修改补充审批 (主任) + */ + IdentifyBookModificationAndSupplementationSP("IdentifyBookModificationAndSupplementationSP", "鉴定文书-修改补充审批 ") + ; + + + private final String code; + private final String desc; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/ReceiveWayEnum.java b/src/main/java/digital/laboratory/platform/identifybook/emums/ReceiveWayEnum.java new file mode 100644 index 0000000..df16632 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/ReceiveWayEnum.java @@ -0,0 +1,39 @@ +package digital.laboratory.platform.identifybook.emums; + +import lombok.Getter; + +import java.util.Arrays; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author ChenJiangBao + * @version 1.0 + * @description: 报告领取方式: 0=自取, 1=代领, 2=邮寄 + * @date 2025/4/2 10:12 + */ +@Getter +public enum ReceiveWayEnum { + // 报告领取方式: 0=自取, 1=代领, 2=邮寄 + SELF_PICKUP("0", "自取"), + PROXY_PICKUP("1", "代领"), + MAIL("2", "邮寄"); + + private final String code; + private final String desc; + + ReceiveWayEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + // 使用 Map 提高查找效率 + private static final Map CODE_MAP = + Arrays.stream(ReceiveWayEnum.values()) + .collect(Collectors.toMap(ReceiveWayEnum::getCode, e -> e)); + + // 根据 code 获取枚举 + public static ReceiveWayEnum fromCode(String code) { + return CODE_MAP.get(code); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/TaskTypeEnum.java b/src/main/java/digital/laboratory/platform/identifybook/emums/TaskTypeEnum.java new file mode 100644 index 0000000..8b67bb2 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/TaskTypeEnum.java @@ -0,0 +1,24 @@ +package digital.laboratory.platform.identifybook.emums; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +@ApiModel("任务类型枚举") +public enum TaskTypeEnum { + + JD_WS_SH("1","鉴定文书-审核"), + JD_WS_SH_TH_XG("2","鉴定文书-审核退回修改"), + JD_WS_SP("3","鉴定文书-审批"), + JD_WS_SP_TH_XG("4","鉴定文书-审批退回修改"), + JD_WS_QF_LQ("5","鉴定文书-签发/领取"), + JD_WS_XG_BC_SH("6","鉴定文书修改/补充-审核"), + JD_WS_XG_BC_SP("7","鉴定文书修改/补充-审批") + + ; + + private final String code; + private final String desc; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/emums/UnitEnums.java b/src/main/java/digital/laboratory/platform/identifybook/emums/UnitEnums.java new file mode 100644 index 0000000..0d385e7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/emums/UnitEnums.java @@ -0,0 +1,40 @@ +package digital.laboratory.platform.identifybook.emums; + +import lombok.Getter; + +/** + * 重量/体积单位 枚举 + */ +@Getter +public enum UnitEnums { + + UNIT_SOLID_G("g", "克"), + + UNIT_SOLID_MG("mg", "毫克"), + + UNIT_SOLID_KG("kg", "公斤"), + + UNIT_LIQUID_L("l", "升"), + + UNIT_LIQUID_ML("ml", "毫升"), + ; + + private final String code; + + private final String desc; + + UnitEnums(String code, String desc) { + this.code = code; + this.desc = desc; + } + + // 根据单位获取单位描述,没有就返回原先的字符 + public static String fromUnit(String code) { + for (UnitEnums unitEnums : values()) { + if (unitEnums.getCode().equals(code)) { + return unitEnums.getDesc(); + } + } + return code; + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/AvoidIdentifier.java b/src/main/java/digital/laboratory/platform/identifybook/entity/AvoidIdentifier.java new file mode 100644 index 0000000..c9505f4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/AvoidIdentifier.java @@ -0,0 +1,15 @@ +package digital.laboratory.platform.identifybook.entity; + +import lombok.Data; + +/** + * 回避的鉴定人 + * 作为委托的一个属性, 由委托方指定某些鉴定人需要回避 + */ + +@Data +public class AvoidIdentifier { + String userId; // 用户 Id + String name; // 这是鉴定人的姓名 + String reason; // 回避的原因(事由) +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/BIdentificationProcess.java b/src/main/java/digital/laboratory/platform/identifybook/entity/BIdentificationProcess.java new file mode 100644 index 0000000..aad1c6b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/BIdentificationProcess.java @@ -0,0 +1,36 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-27 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="BIdentificationProcess对象", description="") +public class BIdentificationProcess implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "委托ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "检验过程") + @TableField("inspection_process") + private String inspectionProcess; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/BusinessProcessRecord.java b/src/main/java/digital/laboratory/platform/identifybook/entity/BusinessProcessRecord.java new file mode 100644 index 0000000..1616513 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/BusinessProcessRecord.java @@ -0,0 +1,58 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; + +import java.time.LocalDateTime; +import java.util.Date; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 业务流程记录表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_business_process_record") +@ApiModel(value="BusinessProcessRecord对象", description="业务流程记录表") +public class BusinessProcessRecord implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "业务流程记录ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "业务ID") + private String businessId; + + @ApiModelProperty(value = "业务名称") + private String businessName; + + @ApiModelProperty(value = "业务类型名称") + private String businessTypeName; + + @ApiModelProperty(value = "业务状态") + private Integer businessStatus; + + @ApiModelProperty(value = "意见") + private String message; + + @ApiModelProperty(value = "创建时间") + @TableField(fill = FieldFill.INSERT) + @JSONField( format = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(value = "创建人") + @TableField(fill = FieldFill.INSERT) + private String createBy; + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvent.java b/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvent.java new file mode 100644 index 0000000..30f5477 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvent.java @@ -0,0 +1,113 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; + +import java.time.LocalDateTime; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; + +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 案件、事件 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_case_event") +@ApiModel(value="CaseEvent对象", description="案件、事件") +public class CaseEvent extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value="id") + private String id; + + /** + * 案件编号 + */ + @ApiModelProperty(value="案件编号") + private String caseNo; + + /** + * 第三方系统(如现勘系统、案事件系统)编号 + */ + @ApiModelProperty(value="第三方系统(如现勘系统、案事件系统)编号") + private String thirdPartySysNo; + + /** + * 案件名称任务名称 + */ + @ApiModelProperty(value="案件名称任务名称") + private String caseName; + + /** + * 案件类型 + */ + @ApiModelProperty(value="案件类型") + private String caseType; + + /** + * 案发时间 + */ + @ApiModelProperty(value="案发时间") + private LocalDateTime happenTime; + + /** + * 案发地详细地点 + */ + @ApiModelProperty(value="案发地详细地点") + private String caseAddress; + + /** + * 案发地行政区划编码(到县一级) + */ + @ApiModelProperty(value="案发地行政区划编码(到县一级)") + private String caseArea; + + /** + * 案件所属机构 + */ + @ApiModelProperty(value="案件所属机构") + private String caseOwnOrgId; + + /** + * 案件级别: 0=普通案件, 1=紧急案件, 2=加急案件 + */ + @ApiModelProperty(value="案件级别: 0=普通案件, 1=紧急案件, 2=加急案件") + private Integer caseRank; + + /** + * 案情简要 + */ + @ApiModelProperty(value="案情简要") + private String caseBrief; + + /** + * 案件备注 + */ + @ApiModelProperty(value="案件备注") + private String comments; + + /** + * 数据来源,用于区别数据来自自身系统还是外部系统 + */ + @ApiModelProperty(value="数据来源") + private Integer dataSources; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvidence.java b/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvidence.java new file mode 100644 index 0000000..84c434c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/CaseEvidence.java @@ -0,0 +1,211 @@ +package digital.laboratory.platform.identifybook.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 与案件相关的物证信息 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_case_evidence") +@ApiModel(value="CaseEvidence对象", description="与案件相关的物证信息") +public class CaseEvidence extends BaseEntity { + + /** + * id + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value="id") + private String id; + + /** + * 本系统物证编号 + */ + @ApiModelProperty(value="本系统物证编号") + private String evidenceNo; + + /** + * 案件Id + */ + @ApiModelProperty(value="案件Id") + private String caseId; + + /** + * 第三方系统(如现勘系统、案事件系统)物证编号 + */ + @ApiModelProperty(value="第三方系统(如现勘系统、案事件系统)物证编号") + private String thirdPartySysEvidenceNo; + + /** + * 物证名称 + */ + @ApiModelProperty(value="物证名称") + private String name; + + /** + * 物证类别:1. 非生物性物证;2. 生物特性物证 + */ + @ApiModelProperty(value="物证类别:1. 非生物性物证;2. 生物特性物证") + private String type; + + /** + * 现场标牌号 + */ + @ApiModelProperty(value="现场标牌号") + private String fieldLabelNo; + + /** + * 物证来源 + */ + @ApiModelProperty(value="物证来源") + private String source; + + /** + * 物证颜色 + */ + @ApiModelProperty(value="物证颜色") + private String color; + + /** + * 物证性状 + */ + @ApiModelProperty(value="物证性状") + private String form; + + /** + * 物证情况之承载物名称, 例如 棉签 2 棵, 粉末 少许 + */ + @ApiModelProperty(value="物证情况之承载物名称, 例如 棉签 2 棵, 粉末 少许") + private String fundName; + + /** + * 物证情况之承载物数量, 例如 5 颗, 3包, + */ + @ApiModelProperty(value="物证情况之承载物数量, 例如 5 颗, 3包, ") + private Integer fundQuantity; + + /** + * 物证情况之承载物单位, 例如 5 颗, 3包 + */ + @ApiModelProperty(value="物证情况之承载物单位, 例如 5 颗, 3包") + private String fundUnit; + + /** + * 物证数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value="物证数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal quantity; + + /** + * 物证单位, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value="物证单位, 例如 3.8 克 或 4.5毫升") + private String unit; + + /** + * 附加属性, 如:体积3毫升,密码123,型号abc + */ + @ApiModelProperty(value="附加属性, 如:体积3毫升,密码123,型号abc") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List additionalProperties; + + /** + * 所有者姓名 + */ + @ApiModelProperty(value="所有者姓名") + private String personName; + + /** + * 所有者证件类型 + */ + @ApiModelProperty(value="所有者证件类型") + private String personCert; + + /** + * 所有者证件号 + */ + @ApiModelProperty(value="所有者证件号") + private String personId; + + /** + * 所有者性别,公安系统编码 1:男 2:女 0:未知 + */ + @ApiModelProperty(value="所有者性别,公安系统编码 1:男 2:女 0:未知") + private Integer personGender; + + /** + * 所有者国籍 + */ + @ApiModelProperty(value="所有者国籍") + private String personNationality; + + /** + * 所有者民族编码,公安系统编码 + */ + @ApiModelProperty(value="所有者民族编码,公安系统编码") + private Integer personNation; + + /** + * 所有者地址 + */ + @ApiModelProperty(value="所有者地址") + private String personAddress; + + /** + * 所有者年龄 + */ + @ApiModelProperty(value="所有者年龄") + private Integer personAge; + + /** + * 包装情况:纸袋,纸盒,纸箱,自定义 + */ + @ApiModelProperty(value="包装情况:纸袋,纸盒,纸箱,自定义") + private String pack; + + /** + * 存储方法:常规,冷藏,特殊 + */ + @ApiModelProperty(value="存储方法:常规,冷藏,特殊") + private String storageMethod; + + /** + * 描述 + */ + @ApiModelProperty(value="描述") + private String description; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String comments; + + /** + * 数据来源,用于区别数据来自自身系统还是外部系统 + */ + @ApiModelProperty(value="数据来源") + private Integer dataSources; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Deliverer.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Deliverer.java new file mode 100644 index 0000000..3f478bc --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Deliverer.java @@ -0,0 +1,63 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 送检员 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_deliverer") +@ApiModel(value="Deliverer对象", description="送检员") +public class Deliverer implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "送检员拥有者userId") + private String ownerUserId; + + @ApiModelProperty(value = "送检员姓名") + private String name; + + @ApiModelProperty(value = "送检员职务") + private String position; + + @ApiModelProperty(value = "送检员证件名称") + private String cert; + + @ApiModelProperty(value = "送检员证件编号") + private String idnum; + + @ApiModelProperty(value = "送检员电话") + private String phone; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Entrustment.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Entrustment.java new file mode 100644 index 0000000..88fcfab --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Entrustment.java @@ -0,0 +1,763 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; + +import java.time.LocalDateTime; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import digital.laboratory.platform.sys.entity.DrugLite; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 委托 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_entrustment") +@ApiModel(value="Entrustment对象", description="委托") +public class Entrustment extends BaseEntity { + + /** + * 编号 + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value="编号") + private String id; + + /** + * 案件Id + */ + @ApiModelProperty(value="案件Id") + private String caseId; + /** + * 案件名称 + */ + @ApiModelProperty(value="案件名称") + private String caseName; + + /** + * 案情简要 + */ + @ApiModelProperty(value="案情简要") + private String caseBrief; + + + /** + * 委托编号 + */ + @ApiModelProperty(value="委托编号") + private String entrustmentNo; + + /** + * 委托类型: 0=正常司法鉴定委托, 1=案前委托 + */ + @ApiModelProperty(value="委托类型: 0=正常司法鉴定委托, 1=案前委托") + private Integer entrustmentType; + + /** + * 业务类型: 0=毒品鉴定 1=.....用于对应到各个检验小组 + */ + @ApiModelProperty(value="业务类型: 0=毒品鉴定 1=.....用于对应到各个检验小组") + private Integer businessType; + + /** + * 对应的流程实例Id + */ + @ApiModelProperty(value="对应的流程实例Id") + private String processInstanceId; + + /** + * 受理Id, 通过这个可以得到鉴定号 + */ + @ApiModelProperty(value="受理Id, 通过这个可以得到鉴定号") + private String identificationId; + + /** + * 委托日期, 鉴定委托书打印日期 + */ + @ApiModelProperty(value="委托日期, 鉴定委托书打印日期") + private LocalDateTime entrustmentTime; + + /** + * 委托提交者, 后期可能会转给其他人user_id + */ + @ApiModelProperty(value="委托提交者, 后期可能会转给其他人user_id") + private String submitter; + + /** + * 提交日期, 提交审核的日期 + */ + @ApiModelProperty(value="提交日期, 提交审核的日期") + private LocalDateTime submitTime; + + /** + * 鉴定委托单位编码 + */ + @ApiModelProperty(value="鉴定委托单位编码") + private String clientOrgId; + + /** + * 鉴定委托单位名称 + */ + @ApiModelProperty(value="鉴定委托单位名称") + private String clientOrgName; + + /** + * 通讯地址 + */ + @ApiModelProperty(value="通讯地址") + private String clientAddress; + + /** + * 邮政编码 + */ + @ApiModelProperty(value="邮政编码") + private String clientPostcode; + + /** + * 电话号码 + */ + @ApiModelProperty(value="电话号码") + private String clientTel; + + /** + * 传真号码 + */ + @ApiModelProperty(value="传真号码") + private String clientFax; + + /** + * 委托鉴定专业 + */ + @ApiModelProperty(value="委托鉴定专业") + private String identificationDomain; + + /** + * 鉴定机构名称 + */ + @ApiModelProperty(value="鉴定机构名称") + private String identificationOrgName; + + /** + * 定性分析 + */ + @ApiModelProperty(value="定性分析") + private Boolean qualitativeAnalysis; + + /** + * 定量分析 + */ + @ApiModelProperty(value="定量分析") + private Boolean quantitativeAnalysis; + + /** + * 其他鉴定要求 + */ + @ApiModelProperty(value="其他鉴定要求") + private String otherIdentificationRequests; + + /** + * 候选毒品列表(drug 对象的 json array) + */ + @ApiModelProperty(value="候选毒品列表(drug 对象的 json array)") + //@TableField(typeHandler = JacksonTypeHandler.class) + @TableField(typeHandler = FastjsonTypeHandler.class) + private List candidateDrugs; + + /** + * 是否由委托方指定鉴定方法 + */ + @ApiModelProperty(value="是否由委托方指定鉴定方法") + private Boolean isClientSpecifiedMethod; + + /** + * 委托方指定的鉴定方法 + */ + @ApiModelProperty(value="委托方指定的鉴定方法") + private String clientSpecifiedMethod; + + /** + * 是否有损检验:0=无损,1=有损 + */ + @ApiModelProperty(value="是否有损检验:0=无损,1=有损") + private Boolean destructiveAnalysis; + + /** + * 检验的其他说明(鉴定事项确认书中要求, 审核人填写) + */ + @ApiModelProperty(value="检验的其他说明(鉴定事项确认书中要求, 审核人填写)") + private String otherIdentificationNotes; + + /** + * 是否重新鉴定:0=否,1=重新鉴定 + */ + @ApiModelProperty(value="是否重新鉴定:0=否,1=重新鉴定") + private Boolean reidentification; + + /** + * 原鉴定机构 + */ + @ApiModelProperty(value="原鉴定机构") + private String oldIdentificationOrgName; + + /** + * 原鉴定文书 + */ + @ApiModelProperty(value="原鉴定文书") + private String oldIdentificationDocument; + + /** + * 原鉴定结果 + */ + @ApiModelProperty(value="原鉴定结果") + private String oldIdentificationResult; + + /** + * 重新鉴定理由 + */ + @ApiModelProperty(value="重新鉴定理由") + private String reidentificationReason; + + /** + * 回避的鉴定人及回避事由, json 格式 + */ + @ApiModelProperty(value="回避的鉴定人及回避事由, json 格式") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List avoidIdentifier; + + /** + * 指定鉴定人, 委托中指定鉴定人 + */ + @ApiModelProperty(value="指定鉴定人, 委托中指定鉴定人") + private String specifiedIdentifier; + + /** + * 其它约定事项,打印在鉴定事项确认书中的"约定->其他" + */ + @ApiModelProperty(value="其它约定事项,打印在鉴定事项确认书中的\"约定->其他\"") + private String otherAgreement; + + /** + * 备注 + */ + @ApiModelProperty(value="备注") + private String comments; + + /** + * 候选审核人, user_id列表, 逗号分隔 + */ + @ApiModelProperty(value="候选审核人, user_id列表, 逗号分隔") + private String checkCandidateUser; + + /** + * 审核任务认领人 + */ + @ApiModelProperty(value="审核任务认领人") + private String checkClaimUser; + + /** + * 审核任务认领时间 + */ + @ApiModelProperty(value="审核任务认领时间") + private LocalDateTime checkClaimTime; + + /** + * 实际审核人, user_id + */ + @ApiModelProperty(value="实际审核人, user_id") + private String checkUser; + + /** + * 审核时间 + */ + @ApiModelProperty(value="审核时间") + private LocalDateTime checkTime; + + /** + * 审核意见: (审批通过 审批不通过及原因) + */ + @ApiModelProperty(value="审核意见: (审批通过 审批不通过及原因)") + private String checkComments; + + /** + * 审核次数记录 + */ + @ApiModelProperty(value="审核次数记录") + private Integer checkTimes; + + /** + * 专业全部物证检验状态: 0=未全部审核 1=已全部审核 + */ + @ApiModelProperty(value="专业全部物证检验状态: 0=未全部审核 1=已全部审核") + private Boolean checkAllIdentificationMaterialConfirmed; + + /** + * 候选审批人, user_id列表, 逗号分隔 + */ + @ApiModelProperty(value="候选审批人, user_id列表, 逗号分隔") + private String approveCandidateUser; + + /** + * 审批任务认领人 + */ + @ApiModelProperty(value="审批任务认领人") + private String approveClaimUser; + + /** + * 审批任务认领时间 + */ + @ApiModelProperty(value="审批任务认领时间") + private LocalDateTime approveClaimTime; + + /** + * 实际审批人, user_id + */ + @ApiModelProperty(value="实际审批人, user_id") + private String approveUser; + + /** + * 审批时间 + */ + @ApiModelProperty(value="审批时间") + private LocalDateTime approveTime; + + /** + * 审批意见: (审批通过 审批不通过及原因) + */ + @ApiModelProperty(value="审批意见: (审批通过 审批不通过及原因)") + private String approveComments; + + /** + * 审批次数:该字段在审核通过时初始化, 值为0或1时代表初审, 2代表复审 + */ + @ApiModelProperty(value="审批次数:该字段在审核通过时初始化, 值为0或1时代表初审, 2代表复审") + private Integer approveTimes; + + /** + * 送检确认人user_id + */ + @ApiModelProperty(value="送检确认人user_id") + private String deliverConfirmUser; + + /** + * 送检确认时间 + */ + @ApiModelProperty(value="送检确认时间") + private LocalDateTime deliverConfirmTime; + + /** + * 送检确认意见 + */ + @ApiModelProperty(value="送检确认意见") + private String deliverConfirmComments; + + /** + * 送检日期 + */ + @ApiModelProperty(value="送检日期") + private LocalDateTime deliverTime; + + /** + * 送检操作提交用户user_id + */ + @ApiModelProperty(value="送检操作提交用户user_id") + private String deliverSubmitter; + + // /** + // * 如果送检人1是系统用户, 记录用户id + // */ + // @ApiModelProperty(value="如果送检人1是系统用户, 记录用户id") + // private String deliverer1UserId; + + /** + * 送检人1姓名 + */ + @ApiModelProperty(value="送检人1姓名") + private String deliverer1Name; + + /** + * 送检人1职务 + */ + @ApiModelProperty(value="送检人1职务") + private String deliverer1Position; + + /** + * 送检人1证件名称 + */ + @ApiModelProperty(value="送检人1证件名称") + private String deliverer1Cert; + + /** + * 送检人1证件编号 + */ + @ApiModelProperty(value="送检人1证件编号") + private String deliverer1Id; + + /** + * 送检人1电话 + */ + @ApiModelProperty(value="送检人1电话") + private String deliverer1Phone; + + // /** + // * 如果送检人2是系统用户, 记录用户id + // */ + // @ApiModelProperty(value="如果送检人2是系统用户, 记录用户id") + // private String deliverer2UserId; + + /** + * 送检人2姓名 + */ + @ApiModelProperty(value="送检人2姓名") + private String deliverer2Name; + + /** + * 送检人2职务 + */ + @ApiModelProperty(value="送检人2职务") + private String deliverer2Position; + + /** + * 送检人2证件名称 + */ + @ApiModelProperty(value="送检人2证件名称") + private String deliverer2Cert; + + /** + * 送检人2证件编号 + */ + @ApiModelProperty(value="送检人2证件编号") + private String deliverer2Id; + + /** + * 送检人2电话 + */ + @ApiModelProperty(value="送检人2电话") + private String deliverer2Phone; + + // /** + // * 受理任务认领人 + // */ + // @ApiModelProperty(value="受理任务认领人") + // private String acceptClaimUser; + // + // /** + // * 受理任务认领时间 + // */ + // @ApiModelProperty(value="受理任务认领时间") + // private LocalDateTime acceptClaimTime; + + /** + * 受理编号 + */ + @ApiModelProperty(value="受理编号") + private String acceptNo; + + /** + * 受理人user_id + */ + @ApiModelProperty(value="受理人user_id") + private String acceptUser; + + /** + * 受理时间 + */ + @ApiModelProperty(value="受理时间") + private LocalDateTime acceptTime; + + /** + * 受理意见 + */ + @ApiModelProperty(value="受理意见") + private String acceptComments; + + /** + * 鉴定事项确认书是否已经打印 + */ + @ApiModelProperty(value="鉴定事项确认书是否已经打印") + private Boolean identificationItemsConfirmPrinted; + + + /** + * 送检受理信息, 以 json 格式记录送检受理各环节的文字意见 + */ + @ApiModelProperty(value="送检受理信息, 以 json 格式记录送检受理各环节的文字意见") +// @TableField(typeHandler = JacksonTypeHandler.class) + @TableField(typeHandler = FastjsonTypeHandler.class) + private List processInfo; + + /** + * 报告领取方式: 0=自取, 1=代领, 2=邮寄 + */ + @ApiModelProperty(value="报告领取方式: 0=自取, 1=代领, 2=邮寄") + private String reportReceiveMode; + + /** + * 报告领取人1的 user id + */ + @ApiModelProperty(value="报告领取人1的 user id") + private String reportReceiver1UserId; + + /** + * 报告领取人1的姓名 + */ + @ApiModelProperty(value="报告领取人1的姓名") + private String reportReceiver1Name; + + /** + * 报告领取人1的职务 + */ + @ApiModelProperty(value="报告领取人1的职务") + private String reportReceiver1Position; + + /** + * 报告领取人1的证件类型 + */ + @ApiModelProperty(value="报告领取人1的证件类型") + private String reportReceiver1Cert; + + /** + * 报告领取人1的证件号 + */ + @ApiModelProperty(value="报告领取人1的证件号") + private String reportReceiver1Id; + + /** + * 报告领取人1的电话 + */ + @ApiModelProperty(value="报告领取人1的电话") + private String reportReceiver1Phone; + + /** + * 报告领取人2的 user id + */ + @ApiModelProperty(value="报告领取人2的 user id") + private String reportReceiver2UserId; + + /** + * 报告领取人2的姓名 + */ + @ApiModelProperty(value="报告领取人2的姓名") + private String reportReceiver2Name; + + /** + * 报告领取人2的职务 + */ + @ApiModelProperty(value="报告领取人2的职务") + private String reportReceiver2Position; + + /** + * 报告领取人2的证件类型 + */ + @ApiModelProperty(value="报告领取人2的证件类型") + private String reportReceiver2Cert; + + /** + * 报告领取人2的证件号 + */ + @ApiModelProperty(value="报告领取人2的证件号") + private String reportReceiver2Id; + + /** + * 报告领取人2的电话 + */ + @ApiModelProperty(value="报告领取人2的电话") + private String reportReceiver2Phone; + + /** + * 报告发放人user_id(通常是受理员) + */ + @ApiModelProperty(value="报告发放人user_id(通常是受理员)") + private String reportSenderUserId; + + /** + * 报告发放时间 + */ + @ApiModelProperty(value="报告发放时间") + private LocalDateTime reportSentTime; + + /** + * 报告领取人1领取报告时的签名 + */ + @ApiModelProperty(value="报告领取人1领取报告时的签名") + private String reportReceiver1Signature; + + /** + * 报告领取人2领取报告时的签名 + */ + @ApiModelProperty(value="报告领取人2领取报告时的签名") + private String reportReceiver2Signature; + + /** + * 检材领取方式: 0=自取, 1=实验室自行处理 + */ + @ApiModelProperty(value="检材领取方式: 0=自取, 1=实验室自行处理") + private Integer sampleReceiveMode; + + /** + * 如果检材领取人1是系统用户, 记录userId + */ + @ApiModelProperty(value="如果检材领取人1是系统用户, 记录userId") + private String sampleReceiver1UserId; + + /** + * 检材领取人1姓名 + */ + @ApiModelProperty(value="检材领取人1姓名") + private String sampleReceiver1Name; + + /** + * 检材领取人1职位 + */ + @ApiModelProperty(value="检材领取人1职位") + private String sampleReceiver1Position; + + /** + * 检材领取人1证件类型 + */ + @ApiModelProperty(value="检材领取人1证件类型") + private String sampleReceiver1Cret; + + /** + * 检材领取人1证件号 + */ + @ApiModelProperty(value="检材领取人1证件号") + private String sampleReceiver1Id; + + /** + * 检材领取人1电话 + */ + @ApiModelProperty(value="检材领取人1电话") + private String sampleReceiver1Phone; + + /** + * 如果检材领取人2是系统用户, 记录userId + */ + @ApiModelProperty(value="如果检材领取人2是系统用户, 记录userId") + private String sampleReceiver2UserId; + + /** + * 检材领取人2姓名 + */ + @ApiModelProperty(value="检材领取人2姓名") + private String sampleReceiver2Name; + + /** + * 检材领取人2职位 + */ + @ApiModelProperty(value="检材领取人2职位") + private String sampleReceiver2Position; + + /** + * 检材领取人2证件类型 + */ + @ApiModelProperty(value="检材领取人2证件类型") + private String sampleReceiver2Cret; + + /** + * 检材领取人2证件号 + */ + @ApiModelProperty(value="检材领取人2证件号") + private String sampleReceiver2Id; + + /** + * 检材领取人2电话 + */ + @ApiModelProperty(value="检材领取人2电话") + private String sampleReceiver2Phone; + + /** + * 检材发放人, 鉴定机构工作人员user_id + */ + @ApiModelProperty(value="检材发放人, 鉴定机构工作人员user_id") + private String sampleSenderUserId; + + /** + * 检材发放时间 + */ + @ApiModelProperty(value="检材发放时间") + private String sampleSentTime; + + /** + * 检材领取人1签名 + */ + @ApiModelProperty(value="检材领取人1签名") + private String sampleReceiver1PersonSignature; + + /** + * 检材领取人2签名 + */ + @ApiModelProperty(value="检材领取人2签名") + private String sampleReceiver2PersonSignnature; + + /** + * 状态 + */ + @ApiModelProperty(value="状态") + private Integer status; + + /** + * 上一个状态 + */ + @ApiModelProperty(value="上一个状态") + private Integer previousStatus; + + /** + * 数据来源,用于区别数据来自自身系统还是外部系统 + */ + @ApiModelProperty(value="数据来源") + private Integer dataSources; + + /** + * 第三方数据系统中的委托编号, + */ + @ApiModelProperty(value="禁毒数据平台的委托编号") + private String thirdSysEntrustNo; + + /** + * 第三方系统受理编号, + */ + @ApiModelProperty(value="第三方系统受理编号") + private String acceptNoThirdSys; + /** + * 鉴定要求, + */ + @ApiModelProperty(value="鉴定要求") + private String entrustRequirement; + /** + * 邮寄地址, + */ + @ApiModelProperty(value="邮寄地址") + private String postAddress; + @ApiModelProperty(value="原始系统中的委托ID") + private String synEntrustId; + + @ApiModelProperty(value="检材数量") + private Integer materialNum; + + @ApiModelProperty("是否推送数据到LabsCare的标识," + + "[" + + "EntrustLetter:true 代表推送委托书成功 | " + + "ItemConfirmLetter:true 代表推送鉴定事项确认书成功 | " + + "BiologyQualitativeRecord:true 代表推送生物定性检验记录成功" + + "" + + "]" + + "如果这个字段为空则表示失败,如果两个推送都成功,以英文逗号分隔") + private String pushFlag; + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentBundle.java b/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentBundle.java new file mode 100644 index 0000000..0650d86 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentBundle.java @@ -0,0 +1,64 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 委托与实验关系 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "b_entrustment_bundle", autoResultMap = true) +@ApiModel(value="BEntrustmentBundle对象", description="委托与实验关系") +public class EntrustmentBundle implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "entrustment_id") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value="选中的实验, 实验id的json数组") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List selectedExperiment; + + @ApiModelProperty(value = "审核审批结果: null=未审, 0=审核审批未通过, 1=审核审批已通过") + private Boolean approvalResult; + + @ApiModelProperty(value = "提交给文书系统的日期") + private Date submitDate; + + @ApiModelProperty(value = "状态: 0=刚创建, 1=已提交给文书系统, 2=文书审核审批通过, 3=已通知委托系统") + private Integer status; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "修改人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentIdentificationMaterial.java b/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentIdentificationMaterial.java new file mode 100644 index 0000000..49cde19 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/EntrustmentIdentificationMaterial.java @@ -0,0 +1,538 @@ +package digital.laboratory.platform.identifybook.entity; + +import java.math.BigDecimal; + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; + +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.TableId; +import java.util.List; + +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import digital.laboratory.platform.sys.entity.DrugLite; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 检材信息 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_entrustment_identification_material") +@ApiModel(value="EntrustmentIdentificationMaterial对象", description="检材信息") +public class EntrustmentIdentificationMaterial extends BaseEntity { + + /** + * 检材id + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value = "检材id") + private String id; + + /** + * 检材编号 + */ + @ApiModelProperty(value = "检材编号") + private String imNo; + + /** + * 物证id + */ + @ApiModelProperty(value = "物证id") + private String evidenceId; + + /** + * 案件id + */ + @ApiModelProperty(value = "案件id") + private String caseId; + + /** + * 委托id + */ + @ApiModelProperty(value = "委托id") + private String entrustmentId; + + /** + * 检材名称 + */ + @ApiModelProperty(value = "检材名称") + private String name; + + /** + * 检材类别:继承所取物证的类别或从物证类别选择 + */ + @ApiModelProperty(value = "检材类别:继承所取物证的类别或从物证类别选择") + private String type; + + /** + * 检材类别名称:继承所取物证的类别或从物证类别选择 + * 2023/5/31 在咸阳分中心添加 + */ + @ApiModelProperty(value = "检材类别名称:继承所取物证的类别或从物证类别选择") + private String typeName; + + /** + * 检材颜色:继承所取物证颜色或手动填入 + */ + @ApiModelProperty(value = "检材颜色:继承所取物证颜色或手动填入") + private String color; + + /** + * 检材性状:继承所取物证性状或从物证性状类别选择 + */ + @ApiModelProperty(value = "检材性状:继承所取物证性状或从物证性状类别选择") + private String form; + + /** + * 检材性状:继承所取物证性状或从物证性状类别选择 + * * 2023/5/31 在咸阳分中心添加 + */ + @ApiModelProperty(value = "检材性状名称:继承所取物证性状或从物证性状类别选择") + private String formName; + + /** + * 检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许 + */ + @ApiModelProperty(value = "检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许") + private String fundName; + + /** + * 检材情况之承载物数量, 例如 5 颗, 3包 + */ + @ApiModelProperty(value = "检材情况之承载物数量, 例如 5 颗, 3包") + private Integer fundQuantity; + + /** + * 检材情况之承载物单位, 例如 5 颗, 3包 + */ + @ApiModelProperty(value = "检材情况之承载物单位, 例如 5 颗, 3包") + private String fundUnit; + + /** + * 检材数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "检材数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal quantity; + + /** + * 计量单位, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "计量单位, 例如 3.8 克 或 4.5毫升") + private String unit; + + /** + * 附加属性, 如:体积3毫升,密码123,型号abc + */ + @ApiModelProperty(value = "附加属性, 如:体积3毫升,密码123,型号abc") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List additionalProperties; + + /** + * 提取方法 + */ + @ApiModelProperty(value = "提取方法") + private String drawWay; + + /** + * 所有者姓名 + */ + @ApiModelProperty(value = "所有者姓名") + private String personName; + + /** + * 所有者证件类型 + */ + @ApiModelProperty(value = "所有者证件类型") + private String personCert; + + /** + * 所有者证件号 + */ + @ApiModelProperty(value = "所有者证件号") + private String personId; + + /** + * 所有者性别,公安系统编码: 1=男 2=女 0=未知 + */ + @ApiModelProperty(value = "所有者性别,公安系统编码: 1=男 2=女 0=未知") + private Integer personGender; + + /** + * 所有者国籍 + */ + @ApiModelProperty(value = "所有者国籍") + private String personNationality; + + /** + * 所有者民族编码,公安系统编码 + */ + @ApiModelProperty(value = "所有者民族编码,公安系统编码") + private Integer personNation; + + /** + * 所有者地址 + */ + @ApiModelProperty(value = "所有者地址") + private String personAddress; + + /** + * 所有者年龄 + */ + @ApiModelProperty(value = "所有者年龄") + private Integer personAge; + + /** + * 采集人1姓名 + */ + @ApiModelProperty(value = "采集人1姓名") + private String take1Name; + + /** + * 采集人1职务 + */ + @ApiModelProperty(value = "采集人1职务") + private String take1Position; + + /** + * 采集人1证件名称 + */ + @ApiModelProperty(value = "采集人1证件名称") + private String take1Cert; + + /** + * 采集人1证件号 + */ + @ApiModelProperty(value = "采集人1证件号") + private String take1Id; + + /** + * 采集人1联系电话 + */ + @ApiModelProperty(value = "采集人1联系电话") + private String take1Phone; + + /** + * 采集人2姓名 + */ + @ApiModelProperty(value = "采集人2姓名") + private String take2Name; + + /** + * 采集人2职务 + */ + @ApiModelProperty(value = "采集人2职务") + private String take2Position; + + /** + * 采集人2证件名称 + */ + @ApiModelProperty(value = "采集人2证件名称") + private String take2Cert; + + /** + * 采集人2证件号 + */ + @ApiModelProperty(value = "采集人2证件号") + private String take2Id; + + /** + * 采集人2联系电话 + */ + @ApiModelProperty(value = "采集人2联系电话") + private String take2Phone; + + /** + * 采集日期 + */ + @ApiModelProperty(value = "采集日期") + private LocalDateTime takeTime; + + /** + * 见证人姓名 + */ + @ApiModelProperty(value = "见证人姓名") + private String witnessName; + + /** + * 见证人证件名称 + */ + @ApiModelProperty(value = "见证人证件名称") + private String witnessCert; + + /** + * 见证人证件号 + */ + @ApiModelProperty(value = "见证人证件号") + private String witnessId; + + /** + * 包装情况:纸袋,纸盒,纸箱,自定义 + */ + @ApiModelProperty(value = "包装情况:纸袋,纸盒,纸箱,自定义") + private String pack; + + /** + * 包装情况名称:纸袋,纸盒,纸箱,自定义 + * 2023/5/31 在咸阳分中心添加 + */ + @ApiModelProperty(value = "包装情况名称:纸袋,纸盒,纸箱,自定义") + private String packName; + + /** + * 存储方法:常规,冷藏,特殊 + */ + @ApiModelProperty(value = "存储方法:常规,冷藏,特殊") + private String storageMethod; + + /** + * 候选毒品列表(drug 对象的 json array) + */ + @ApiModelProperty(value = "候选毒品列表(drug 对象的 json array)") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List candidateDrugs; + + /** + * 检材概要 + */ + @ApiModelProperty(value = "检材概要") + private String description; + + /** + * 审核时间 + */ + @ApiModelProperty(value = "审核时间") + private LocalDateTime checkTime; + + /** + * 审核是否通过: 1=审核通过 + */ + @ApiModelProperty(value = "审核是否通过: 1=审核通过") + private Integer checkPassed; + + /** + * 审批时间 + */ + @ApiModelProperty(value = "审批时间") + private LocalDateTime approveTime; + + /** + * 审批是否通过: 1=审批通过 + */ + @ApiModelProperty(value = "审批是否通过: 1=审批通过") + private Integer approvePassed; + + /** + * 受理时间 + */ + @ApiModelProperty(value = "受理时间") + private LocalDateTime acceptTime; + + /** + * 是否受理: 0=未受理, 1=已受理, -1=不予受理 + */ + @ApiModelProperty(value = "是否受理: 0=未受理, 1=已受理, -1=不予受理") + private Integer acceptPassed; + + /** + * 提供的样本1是否存在, 应该总是存在 + */ + // @ApiModelProperty(value="提供的样本1是否存在, 应该总是存在") + // private Boolean providedSample1Present; + + /** + * 提供的样本1编号 + */ + @ApiModelProperty(value = "提供的样本1编号") + private String providedSample1No; + + /** + * 提供的样本1承载物数量(重量), 例如 5颗, 3包 + */ + @ApiModelProperty(value = "提供的样本1承载物数量(重量), 例如 5颗, 3包") + private Integer providedSample1FundQuantity; + + /** + * 提供的样本1数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "提供的样本1数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal providedSample1Quantity; + + /** + * 提供的样本2是否存在 + */ + @ApiModelProperty(value = "提供的样本2是否存在") + private Boolean providedSample2Present; + + /** + * 提供的样本2编号 + */ + @ApiModelProperty(value = "提供的样本2编号") + private String providedSample2No; + + /** + * 提供的样本2承载物数量(重量), 例如 5颗, 3包 + */ + @ApiModelProperty(value = "提供的样本2承载物数量(重量), 例如 5颗, 3包") + private Integer providedSample2FundQuantity; + + /** + * 提供的样本2数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "提供的样本2数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal providedSample2Quantity; + + /** + * 是否已分样: 0=未分样, 1=已分样 + */ + @ApiModelProperty(value = "是否已分样: 0=未分样, 1=已分样") + private Boolean splitedSample; + + /** + * 样本1是否存在, 应该总是存在 + */ + // @ApiModelProperty(value="样本1是否存在, 应该总是存在") + // private Boolean sample1Present; + + /** + * 样本1编号 + */ + @ApiModelProperty(value = "样本1编号") + private String sample1No; + + /** + * 样本1承载物数量(重量), 例如 5颗, 3包 + */ + @ApiModelProperty(value = "样本1承载物数量(重量), 例如 5颗, 3包") + private Integer sample1FundQuantity; + + /** + * 样本1数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "样本1数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal sample1Quantity; + + /** + * 样本1盒子 id + */ + @ApiModelProperty(value = "样本1盒子 id") + private String sample1BoxId; + + /** + * 样本2是否存在 + */ + @ApiModelProperty(value = "样本2是否存在") + private Boolean sample2Present; + + /** + * 样本2编号 + */ + @ApiModelProperty(value = "样本2编号") + private String sample2No; + + /** + * 样本2承载物数量(重量), 例如 5颗, 3包 + */ + @ApiModelProperty(value = "样本2承载物数量(重量), 例如 5颗, 3包") + private Integer sample2FundQuantity; + + /** + * 样本2数量, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value = "样本2数量, 例如 3.8 克 或 4.5毫升") + private BigDecimal sample2Quantity; + + /** + * 样本2盒子 id + */ + @ApiModelProperty(value = "样本2盒子 id") + private String sample2BoxId; + //add by xy 2023-04-15,记录复秤的结果而增加的字段信息 + /** + * 样本1复秤后的重量 + */ + @ApiModelProperty(value = "样本1的复秤重量") + private BigDecimal sample1RepeatWeigh; + /** + * 样本2复秤后的重量 + */ + @ApiModelProperty(value = "样本2的复秤重量") + private BigDecimal sample2RepeatWeigh; + + /** + * 分析项目 定性分析,定量分析,定性定量分析,关联性判断 其他 + * 1.定性分析 2.定量分析 3.定性定量分析 4.关联性判断 5。其他 + */ + private Integer analysisOption; + + /** + * 数据来源,用于区别数据来自自身系统还是外部系统 + */ + @ApiModelProperty(value = "数据来源") + private Integer dataSources; + /** + * 检材受理编号,一般是绑定检材所属的委托的受理编号 + */ + @ApiModelProperty(value = "检材受理编号") + private String acceptNo; + /** + * 打印委托书的时候需要对检材的序号,但是这个时候检材又没有受理,所以添加一个顺序号 + */ + @ApiModelProperty(value = "委托检材顺序号,由系统根据录入顺序生成") + private Integer orderNo; + + public String getOrderNo1() { + return this.orderNo + "号检材"; + } + + public String getSampleCondition() { + if (this.getSample2FundQuantity() != null && this.getSample2FundQuantity() > 0) { + return this.getSample2FundQuantity() + this.getFundUnit(); + } else { + return ""; + } + } + + /** + * 获取检材的描述性编号(简短称呼),如果还没有受理之前,是没有受理编号的,所以未受理之前,使用不了这个函数 + * + * @return + */ + public String getShortNameDes() { + String acceptNo = this.getAcceptNo(); + if (StringUtils.isNotBlank(acceptNo)) { + int seqNo = Integer.parseInt(acceptNo.substring(acceptNo.lastIndexOf("-") + 1)); + return seqNo + "号"; + } else { + return "0号"; + } + } + + /** + * 取检材的序号 + * + * @return + */ + public int getIndex() { + String acceptNo = this.getAcceptNo(); + if (StringUtils.isNotBlank(acceptNo)) { + int seqNo = Integer.parseInt(acceptNo.substring(acceptNo.lastIndexOf("-") + 1)); + return seqNo; + } else { + return 0; + } + } + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/ExaminationMethods.java b/src/main/java/digital/laboratory/platform/identifybook/entity/ExaminationMethods.java new file mode 100644 index 0000000..d908295 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/ExaminationMethods.java @@ -0,0 +1,127 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 检验方法 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("examination_methods") +@ApiModel(value="ExaminationMethods对象", description="检验方法") +public class ExaminationMethods implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "方法实体类id") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "方法名") + private String methodName; + + @ApiModelProperty(value = "方法依据") + private Integer methodBasis; + + @ApiModelProperty(value = "方法英文名") + @TableField("method_English_name") + private String methodEnglishName; + + @ApiModelProperty(value = "标准号") + private String standardNumber; + + @ApiModelProperty(value = "发布单位") + private String publishingUnit; + + @ApiModelProperty(value = "发布时间") + private Date publishingTime; + + @ApiModelProperty(value = "其他依据") + private String others; + + @ApiModelProperty(value = "实施时间") + private Date implementTime; + + @ApiModelProperty(value = "适用范围") + private String suitRange; + + @ApiModelProperty(value = "规范性引用文件") + private String normativeReferences; + + @ApiModelProperty(value = "术语和定义") + private String termAndDefinition; + + @ApiModelProperty(value = "原理") + private String principle; + + @ApiModelProperty(value = "方法当前状态") + private Integer methodStatus; + + @ApiModelProperty(value = "方法类型(标准/非标准)") + private Integer methodType; + + @ApiModelProperty(value = "试剂") + private String reagent; + + @ApiModelProperty(value = "仪器和设备") + private String instrumentsAndEquipment; + + @ApiModelProperty(value = "定量结果评价") + private String quantitativeResultEvaluation; + + @ApiModelProperty(value = "操作方法") + private String operationMethod; + + @ApiModelProperty(value = "指导书id") + private String guidelinesId; + + @ApiModelProperty(value = "结果表述") + private String expressionOfResults; + + @ApiModelProperty(value = "评审时间") + private Date reviewTime; + + @ApiModelProperty(value = "评审人") + private String reviewer; + + @ApiModelProperty(value = "评审结果") + private Integer reviewResults; + + @ApiModelProperty(value = "评审意见") + private String reviewOpinion; + + @ApiModelProperty(value = "创建时间--录入时间") + private Date createTime; + + @ApiModelProperty(value = "创建人--录入人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + @ApiModelProperty(value = "附件url") + private String annexUrl; + + @ApiModelProperty(value = "附件名称") + private String annexName; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Experiment.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Experiment.java new file mode 100644 index 0000000..43afe2c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Experiment.java @@ -0,0 +1,70 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验(检验方法的实例) + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_experiment") +@ApiModel(value="BExperiment对象", description="实验(检验方法的实例)") +public class Experiment implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "检验方法id") + private String methodId; + + @ApiModelProperty(value = "模板id") + private String templateId; + + @ApiModelProperty(value = "业务类型,字典中的dlp.identification.business项") + private Integer business; + + @ApiModelProperty(value = "实验名称") + private String name; + + @ApiModelProperty(value = "检验人员id") + private String opUserId; + + @ApiModelProperty(value = "状态: 0=准备中; 1=实验中; 2=实验结束; -1=实验中止") + private Integer status; + + @ApiModelProperty(value = "实验完成日期") + private Date finishDate; + + @ApiModelProperty(value = "备注说明") + private String comments; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "修改人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/HairJob.java b/src/main/java/digital/laboratory/platform/identifybook/entity/HairJob.java new file mode 100644 index 0000000..ce8ca72 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/HairJob.java @@ -0,0 +1,81 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 毛发检测任务 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_hair_job") +@ApiModel(value="HairJob对象", description="毛发检测任务") +public class HairJob implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "根任务id") + private String rootId; + + @ApiModelProperty(value = "任务名称") + private String name; + + @ApiModelProperty(value = "任务内容描述说明") + private String description; + + @ApiModelProperty(value = "任务编号") + private String jobNo; + + @ApiModelProperty(value = "任务发布单位") + private String jobIssueOrg; + + @ApiModelProperty(value = "任务执行单位") + private String jobExecOrg; + + @ApiModelProperty(value = "任务来源") + private String jobFrom; + + @ApiModelProperty(value = "任务截止日期") + private Date expirationDate; + + @ApiModelProperty(value = "任务开始日期") + private Date startDate; + + @ApiModelProperty(value = "任务备注") + private String comments; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + @ApiModelProperty(value = "任务类型: 毛发检测/污水检测...") + private String jobType; + + @ApiModelProperty(value = "xxx任务检测类型: 毛发检测:社区戒毒人员检测、公职人员、招考人员。/污水检测:污水处理厂、自然水体、其它水体。...") + private String xxxjobIdentifyType; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/HairJobIdentificationMaterial.java b/src/main/java/digital/laboratory/platform/identifybook/entity/HairJobIdentificationMaterial.java new file mode 100644 index 0000000..6c12f46 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/HairJobIdentificationMaterial.java @@ -0,0 +1,125 @@ +package digital.laboratory.platform.identifybook.entity; + +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 毛发任务的检材信息 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_hair_job_identification_material") +@ApiModel(value="HairJobIdentificationMaterial对象", description="毛发任务的检材信息") +public class HairJobIdentificationMaterial implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "检材id") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "任务id") + private String jobId; + + @ApiModelProperty(value = "根任务id") + private String jobRootId; + + @ApiModelProperty(value = "检材编号") + private String imNo; + + @ApiModelProperty(value = "A样编号") + private String sample1No; + + @ApiModelProperty(value = "B样编号") + private String sample2No; + + @ApiModelProperty(value = "A样盒子") + private String sample1BoxId; + + @ApiModelProperty(value = "B样盒子") + private String sample2BoxId; + + @ApiModelProperty(value = "所有者姓名") + private String personName; + + @ApiModelProperty(value = "所有者身份证号") + private String personCard; + + @ApiModelProperty(value = "人员类别") + private String personType; + + @ApiModelProperty(value = "项目名称") + private String projectName; + + @ApiModelProperty(value = "社区戒毒人员在社区执行时间是否超过 6 个月") + private String executionTime; + + @ApiModelProperty(value = "曾经吸毒种类") + private String drugType; + + @ApiModelProperty(value = "采样人") + private String collector; + + @ApiModelProperty(value = "采样单位") + private String collectorGroup; + + @ApiModelProperty(value = "采样时间") + private Date collectTime; + + @ApiModelProperty(value = "采样地点") + private String collectPlace; + + @ApiModelProperty(value = "监督人员") + private String supervisor; + + @ApiModelProperty(value = "受理时间") + private Date acceptTime; + + @ApiModelProperty(value = "受理是否通过: 0=未受理, 1=受理通过, -1=受理被拒绝") + private Integer acceptPassed; + + @ApiModelProperty(value = "备注") + private String comments; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + @ApiModelProperty(value = "检材名称") + private String name; + + @ApiModelProperty(value = "检材数量") + private BigDecimal quantity; + + @ApiModelProperty(value = "A样数量") + private BigDecimal sample1Quantity; + + @ApiModelProperty(value = "B样数量") + private BigDecimal sample2Quantity; + + @ApiModelProperty(value = "计量单位") + private String unit; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/IMAdditionalProperty.java b/src/main/java/digital/laboratory/platform/identifybook/entity/IMAdditionalProperty.java new file mode 100644 index 0000000..863e69c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/IMAdditionalProperty.java @@ -0,0 +1,22 @@ +package digital.laboratory.platform.identifybook.entity; + +import lombok.Data; + +/** + * 检材的附加属性 + */ +@Data +public class IMAdditionalProperty { + String propertyName; // 中文名称: 体积、重量、性状、颜色、品牌、型号、密码等等 + String quantity; // 重量、体积等等的量值, 或型号、密码的值 + String unit; // 仅对有计量单位的属性, 如: 克、毫克、升等等, 品牌、型号、密码等属性没有单位 + + public IMAdditionalProperty() { + + } + public IMAdditionalProperty(String propertyName, String quantity, String unit) { + this.propertyName = propertyName; + this.quantity = quantity; + this.unit = unit; + } +} \ No newline at end of file diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/IMTSampleStatus.java b/src/main/java/digital/laboratory/platform/identifybook/entity/IMTSampleStatus.java new file mode 100644 index 0000000..fe7d204 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/IMTSampleStatus.java @@ -0,0 +1,46 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * 样本的状态 + * 这个字段主要设想为页面显示时可以看见样本的动向 + */ +@Getter +@RequiredArgsConstructor +public enum IMTSampleStatus { + + OUTBOUND(1,"未入库"),//出库 + + INBOUND(2,"已入库"), + + TRANSFER(4,"流转中"),//流转中 + + UNDER_INSPECTION(6,"检验中"), + + TO_BE_DESTROYED(7,"审核通过待销毁"), + + DESTROYED(8,"已销毁"), + + COLLECTING(9,"领用出库中"), + + + RETURN_OUT(10,"已经退还出库"), + + RELEASE(11,"已发布销毁公示,待出库销毁"), + APPLY(12,"申请中"), + + + IDENTIFYING(13,"检验中"), + IDENTIFIED(14,"检验结束"); + + + + @EnumValue//标记数据库存的值是status + private final int status; + @JsonValue//标记返回前端字段 + private final String description; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Identification.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Identification.java new file mode 100644 index 0000000..b8a01c7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Identification.java @@ -0,0 +1,40 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import java.io.Serializable; + +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 鉴定表,一个鉴定可能会有多个委托 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_identification") +@ApiModel(value="Identification对象", description="鉴定表,一个鉴定可能会有多个委托") +public class Identification extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + private String id; + + @ApiModelProperty(value = "鉴定号,受理号") + private String identificationNo; + + @ApiModelProperty(value = "状态: 0=鉴定中,-1=已终止, 1=已结束") + private Integer status; + + + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBook.java b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBook.java new file mode 100644 index 0000000..ff1d6fc --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBook.java @@ -0,0 +1,60 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonFormat; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 鉴定文书消息表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_identify_book") +@ApiModel(value="IdentifyBook对象", description="鉴定文书消息表") +public class IdentifyBook extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "鉴定文书消息ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "父ID") + private String identifyBookRelevanceId; + + @ApiModelProperty(value = "文件桶") + private String bucketName; + + @ApiModelProperty(value = "鉴定文书路径") + private String path; + + @ApiModelProperty(value = "鉴定文书文件名(文件名命名贵州:鉴定文书 + 业务数据编号 + 版本号) ") + private String fileName; + + @ApiModelProperty(value = "鉴定文书版本号(示例:v1.0、v1.1)") + private String version; + + @ApiModelProperty(value = "备注") + private String remarks; + + @ApiModelProperty(value = "制作或修改人") + @TableField(exist = false) + private String operateUserName; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookApprove.java b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookApprove.java new file mode 100644 index 0000000..35c1e87 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookApprove.java @@ -0,0 +1,95 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; + +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 鉴定文书审批表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-25 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_identify_book_approve") +@ApiModel(value="IdentifyBookApprove对象", description="鉴定文书审批表 ") +public class IdentifyBookApprove extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "鉴定文书审核审批表ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "业务ID") + private String relevanceBusinessId; + + @ApiModelProperty(value = "年") + private String year; + + @ApiModelProperty(value = "序号") + private String serialNumber; + + @ApiModelProperty(value = "附件类型集合(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书)注:选择多个示例(1,2,...)其中”,“是英文") + private String annexType; + + @ApiModelProperty(value = "文书类型:(1:检验报告,2:其它)注:选择多个示例(1,2,...)其中”,“是英文") + private String bookType; + + @ApiModelProperty(value = "检验报告数量(单位: 份)") + private Integer inspectionReportNumber; + + @ApiModelProperty(value = "其它数量(单位:份)") + private Integer otherNumber; + + @ApiModelProperty(value = "是否合格(1:检验方法、2:检验过程、3:检验图谱、4:检验结果)注:选择多个示例(1,2,...)其中”,“是英文") + private String isQualified; + + @ApiModelProperty(value = "审核人ID") + private String processUserBy; + + @ApiModelProperty(value = "审核人") + private String processUserName; + + @ApiModelProperty(value = "审核时间") + private Date processTime; + + @ApiModelProperty(value = "审核意见") + private String processMessage; + + @ApiModelProperty(value = "审批人ID") + private String approveUserBy; + + @ApiModelProperty(value = "审批人") + private String approveUserName; + + @ApiModelProperty(value = "审批时间") + private Date approveTime; + + @ApiModelProperty(value = "审批意见") + private String approveMessage; + + @ApiModelProperty(value = "鉴定文书审批记录文件路径") + private String path; + + @ApiModelProperty(value = "鉴定文书文件名(文件名命名规则:鉴定文书 + 版本号 + 文件类型) ") + private String fileName; + + @ApiModelProperty(value = "版本号") + private String version; + + @ApiModelProperty(value = "备注") + private String remarks; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookRelevance.java b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookRelevance.java new file mode 100644 index 0000000..4762b6a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/IdentifyBookRelevance.java @@ -0,0 +1,44 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 鉴定文书关联中间表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_identify_book_relevance") +@ApiModel(value="IdentifyBookRelevance对象", description="鉴定文书关联中间表") +public class IdentifyBookRelevance implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "关联业务ID") + private String relevanceBusinessId; + + @ApiModelProperty(value = "年") + private String year; + + @ApiModelProperty(value = "流水号") + private String serialNumber; + + @ApiModelProperty(value = "鉴定文书业务状态(-1:待制作,0:已制作/重新制作,1:鉴定文书-提交审核,2:鉴定文书-审核通过),-2:鉴定文书-审核未通过,3:鉴定文书-审核退回修改,4:鉴定文书-审批签发成功,-4:鉴定文书-审批拒绝签发,5:鉴定文书-审批签发退回修改,6:鉴定文书-已领取") + private Integer bookStatus; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/ModifySupplementApply.java b/src/main/java/digital/laboratory/platform/identifybook/entity/ModifySupplementApply.java new file mode 100644 index 0000000..9a3a3f0 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/ModifySupplementApply.java @@ -0,0 +1,113 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.sql.Blob; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 鉴定文书修改补充申请表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_modify_supplement_apply") +@ApiModel(value="ModifySupplementApply对象", description="鉴定文书修改补充申请表") +public class ModifySupplementApply implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "鉴定文书修改补充申请ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "年") + private String year; + + @ApiModelProperty(value = "流水号") + private String serialNumber; + + @ApiModelProperty(value = "委托ID", required = true) + private String entrustmentId; + + @ApiModelProperty(value = "委托人ID") + private String entrustBy; + + @ApiModelProperty(value = "申请时间") + private Date applyTime; + + @ApiModelProperty(value = "申请人id") + private String applyBy; + + @ApiModelProperty(value = "修改人") + private String updateBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "修改原因") + private String updateReason; + + @ApiModelProperty(value = "修改内容") + private String updateContent; + + @ApiModelProperty(value = "委托人签名") + private Blob entrustBySign; + + @ApiModelProperty(value = "委托人签名日期") + private Date entrustBySignDate; + + @ApiModelProperty(value = "修改方式(1:修改存档文件、2:收回原件,重新出具鉴定文书)") + private Integer updateWay; + + @ApiModelProperty(value = "修改人签字") + private Blob updateBySign; + + @ApiModelProperty(value = "修改人签字日期") + private Date updateBySignDate; + + @ApiModelProperty(value = "业务状态(1:鉴定文书-提交修改补充申请,2:鉴定文书-修改补充-审核通过,-2:鉴定文书-修改补充-审核未通过,3:鉴定文书-修改补充-审批通过,-3:鉴定文书-修改补充-审批不通过)") + private Integer status; + + @ApiModelProperty(value = "授权人签字") + private Blob empowerBySign; + + @ApiModelProperty(value = "授权人签字日期") + private Date empowerBySignDate; + + @ApiModelProperty(value = "授权签字人意见") + private String empowerBySignOpinion; + + @ApiModelProperty(value = "技术人员签字") + private Blob technologyBySign; + + @ApiModelProperty(value = "技术人员签字日期") + private Date technologyBySignDate; + + @ApiModelProperty(value = "技术人员签字意见") + private String technologyBySignOpinion; + + @ApiModelProperty(value = "鉴定文书修改/申请文件路径") + private String path; + + @ApiModelProperty(value = "鉴定文书修改/申请文件名(文件名命名规则:鉴定文书 + 文件类型) ") + private String fileName; + + @ApiModelProperty(value = "备注") + private String remarks; + + @ApiModelProperty(value = "委托人姓名") + private String entrustUserName; + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/ReceiveIdentifyBook.java b/src/main/java/digital/laboratory/platform/identifybook/entity/ReceiveIdentifyBook.java new file mode 100644 index 0000000..bebdf7b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/ReceiveIdentifyBook.java @@ -0,0 +1,58 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 领取鉴定文书信息表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_receive_identify_book") +@ApiModel(value="ReceiveIdentifyBook对象", description="领取鉴定文书信息表") +public class ReceiveIdentifyBook implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "领取ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "关联业务ID") + private String relevanceBusinessId; + + @ApiModelProperty(value = "领取方式") + private String receiveWay; + + @ApiModelProperty(value="邮寄地址") + private String postAddress; + + @ApiModelProperty(value = "领取人ID") + private String recipientsUserId; + + @ApiModelProperty(value = "领取人姓名") + private String recipientsUserName; + + @ApiModelProperty(value = "领取人时间") + private Date recipientsTime; + + @ApiModelProperty(value = "经办人ID") + private String operatorUserId; + + @ApiModelProperty(value = "经办人姓名") + private String operatorUserName; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentQualitative.java b/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentQualitative.java new file mode 100644 index 0000000..4fb3339 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentQualitative.java @@ -0,0 +1,66 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 委托定性分析检验结果 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_result_entrustment_qualitative") +@ApiModel(value="BResultEntrustmentQualitative对象", description="委托定性分析检验结果") +public class ResultEntrustmentQualitative implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "实验id") + private String experimentId; + + private String sampleId; + + @ApiModelProperty(value = "样本编号,字符串,必填,长度 200") + private String sampleNo; + + @ApiModelProperty(value = "检材序号, 通常是受理的序号") + private Integer materialIndex; + + @ApiModelProperty(value = "样本的简要名称") + private String shortName; + + @ApiModelProperty(value = "化合物,必填,长度 200") + private String compound; + + @ApiModelProperty(value = "negative:未检出,positive:检出") + private Boolean result; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentRation.java b/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentRation.java new file mode 100644 index 0000000..c4c4e17 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/ResultEntrustmentRation.java @@ -0,0 +1,66 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 委托定量检验结果 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_result_entrustment_ration") +@ApiModel(value="BResultEntrustmentRation对象", description="委托定量检验结果") +public class ResultEntrustmentRation implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "实验id") + private String experimentId; + + private String sampleId; + + @ApiModelProperty(value = "样本编号,字符串,必填,长度 200") + private String sampleNo; + + @ApiModelProperty(value = "检材序号, 通常是受理的序号") + private Integer materialIndex; + + @ApiModelProperty(value = "化合物,必填,长度 200") + private String compound; + + @ApiModelProperty(value = "定量结果,必填,长度12, 精度8") + private Double result; + + @ApiModelProperty(value = "备注说明") + private String comments; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Sample.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Sample.java new file mode 100644 index 0000000..0a5ee68 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Sample.java @@ -0,0 +1,196 @@ +package digital.laboratory.platform.identifybook.entity; + +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; + +import java.time.LocalDateTime; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import java.util.List; + +import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import digital.laboratory.platform.sys.entity.DrugLite; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 检验用的样本 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "b_sample", autoResultMap = true) +@ApiModel(value="Sample对象", description="检验用的样本") +public class Sample extends BaseEntity { + + /** + * 样本id + */ + @TableId(value = "id", type = IdType.ASSIGN_UUID) + @ApiModelProperty(value = "样本id") + private String id; + + /** + * 检材id, 对应委托的检材id或毛发任务的检材id或污水任务的检材id + */ + @ApiModelProperty(value = "检材id, 对应委托的检材id或毛发任务的检材id或污水任务的检材id") + private String identificationMaterialId; + + /** + * 样本编号 + */ + @ApiModelProperty(value = "样本编号") + private String sampleNo; + + /** + * 样本来源: entrustment/hairJob/sewageJob/.... + */ + @ApiModelProperty(value = "样本来源: entrustment/hairJob/sewageJob/....") + private String source; + + /** + * 委托id + */ + @ApiModelProperty(value="委托id") + private String entrustmentId; + + /** + * 污水任务id + */ + @ApiModelProperty(value="污水任务id") + private String sewageJobId; + + /** + * 毛发任务id + */ + @ApiModelProperty(value="毛发任务id") + private String hairJobId; + + /** + * 定性分析 + */ + @ApiModelProperty(value="定性分析") + private Boolean qualitativeAnalysis; + + /** + * 定量分析 + */ + @ApiModelProperty(value="定量分析") + private Boolean quantitativeAnalysis; + + /** + * 候选毒品列表(drug 对象的 json array) + */ + @ApiModelProperty(value="候选毒品列表(drug 对象的 json array)") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List candidateDrugs; + + /** + * 检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许 + */ + @ApiModelProperty(value="检材情况之承载物名称, 例如 棉签 2 棵, 粉末 少许") + private String fundName; + + /** + * 检材情况之承载物数量, 如 3 颗 或 1包 + */ + @ApiModelProperty(value="检材情况之承载物数量, 如 3 颗 或 1包") + private Integer fundQuantity; + + /** + * 检材情况之承载物单位, 例如 5 颗, 3包 + */ + @ApiModelProperty(value="检材情况之承载物单位, 例如 5 颗, 3包") + private String fundUnit; + + /** + * 样品数量, 例如 2.3 克 或 3.1 毫升 + */ + @ApiModelProperty(value="样品数量, 例如 2.3 克 或 3.1 毫升") + private BigDecimal quantity; + + /** + * 计量单位, 例如 3.8 克 或 4.5毫升 + */ + @ApiModelProperty(value="计量单位, 例如 3.8 克 或 4.5毫升") + private String unit; + + /** + * 附加属性, 如:体积3毫升,密码123,型号abc + */ + @ApiModelProperty(value="附加属性, 如:体积3毫升,密码123,型号abc") + @TableField(typeHandler = FastjsonTypeHandler.class) + private List additionalProperties; + + /** + * 提取方法 + */ + @ApiModelProperty(value="提取方法") + private String drawWay; + + /** + * 盒子编号 + */ + @ApiModelProperty(value="盒子编号") + private String boxId; + + /** + * A样还是B样 + */ + @ApiModelProperty(value="A样还是B样") + private String sampleType; + + /** + * 存储方法:常规,冷藏,特殊 + */ + @ApiModelProperty(value="存储方法:常规,冷藏,特殊") + private String storageMethod; + + /** + * 受理时间, 相当于检验开始时间, 用于比对花了多少时间在检验上 + */ + @ApiModelProperty(value="受理时间, 相当于检验开始时间, 用于比对花了多少时间在检验上") + private LocalDateTime acceptTime; + + /** + * 状态: 0=已受理,等分配, 1=已分配到检验人员, 2=检验完成 + */ +// @ApiModelProperty(value="状态: 0=已受理,等分配, 1=已分配到检验人员, 2=检验完成") +// private Integer status; + @ApiModelProperty(value = "状态: 0=已受理,等分配, 1=已分配到检验人员, 2=检验完成") + private IMTSampleStatus status; + + /** + * 当前持有者 + */ + @ApiModelProperty(value="当前持有者") + private String holder; + + /** + * 送检单位id + */ + @ApiModelProperty(value="送检单位id") + private String orgId; + + /** + * 样本名称 + */ + @ApiModelProperty(value="样本名称") + private String name; + + @ApiModelProperty(value = "检材受理编号") + private String acceptNo; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/Taker.java b/src/main/java/digital/laboratory/platform/identifybook/entity/Taker.java new file mode 100644 index 0000000..711202d --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/Taker.java @@ -0,0 +1,63 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import java.util.Date; +import com.baomidou.mybatisplus.annotation.TableId; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 采集员 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_taker") +@ApiModel(value="Taker对象", description="采集员") +public class Taker implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "采集员拥有者userId") + private String ownerUserId; + + @ApiModelProperty(value = "采集员姓名") + private String name; + + @ApiModelProperty(value = "采集员职务") + private String position; + + @ApiModelProperty(value = "采集员证件名称") + private String cert; + + @ApiModelProperty(value = "采集员证件编号") + private String idnum; + + @ApiModelProperty(value = "采集员电话") + private String phone; + + @ApiModelProperty(value = "创建时间") + private Date createTime; + + @ApiModelProperty(value = "创建人") + private String createBy; + + @ApiModelProperty(value = "修改时间") + private Date updateTime; + + @ApiModelProperty(value = "更新人") + private String updateBy; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/TaskNotification.java b/src/main/java/digital/laboratory/platform/identifybook/entity/TaskNotification.java new file mode 100644 index 0000000..071e67a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/TaskNotification.java @@ -0,0 +1,75 @@ +package digital.laboratory.platform.identifybook.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.baomidou.mybatisplus.annotation.*; + +import java.util.Date; +import java.io.Serializable; + +import digital.laboratory.platform.common.mybatis.base.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 任务信息表 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("b_task_notification") +@ApiModel(value="TaskNotification对象", description="任务信息表") +public class TaskNotification extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "消息ID") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private String id; + + @ApiModelProperty(value = "消息标题") + private String title; + + @ApiModelProperty(value = "任务类型(1:鉴定文书-审核,2:鉴定文书-审核退回修改,3:鉴定文书-审批,4:鉴定文书-审批退回修改,5:鉴定文书-签发/领取,6:鉴定文书修改/补充-审核,7:鉴定文书修改/补充-审批)") + private Integer type; + + @ApiModelProperty(value = "业务ID") + private String businessId; + + @ApiModelProperty(value = "提交人ID") + private String submitterUserId; + + @ApiModelProperty(value = "提交人姓名") + private String submitterUserName; + + @ApiModelProperty(value = "提交日期") + private Date submitterTime; + + @ApiModelProperty(value = "鉴定编号") + private String acceptNo; + + @ApiModelProperty(value = "案件名称") + private String caseName; + + @ApiModelProperty(value = "消息内容") + private String content; + + @ApiModelProperty(value = "处理人员ID") + private String transactionPersonnelId; + + @ApiModelProperty(value = "办理人姓名") + private String transactionPersonnelName; + + @ApiModelProperty(value = "办理人权限组") + private String permissionGroup; + + @ApiModelProperty(value = "处理状态(0: 待处理,1:已处理,2:退回修改,-1:未通过)") + private Integer status; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/entity/UpdateInfo.java b/src/main/java/digital/laboratory/platform/identifybook/entity/UpdateInfo.java new file mode 100644 index 0000000..d990041 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/entity/UpdateInfo.java @@ -0,0 +1,41 @@ +package digital.laboratory.platform.identifybook.entity; + +import cn.hutool.core.date.DateUtil; +import lombok.Data; + +// 本类的实例对应 Entrustment 对象中的 ProcessInfo 字段。 +@Data +public class UpdateInfo { + String userId; + String userName; + String orgId; + String orgName; + + // @JsonDeserialize(using = LocalDateTimeDeserializer.class) + // @JsonSerialize(using = LocalDateTimeSerializer.class) + //@JSONField(format ="yyyy-MM-dd HH:mm:ss") + //LocalDateTime processTime; + String processTime; // 如果使用 LocalDateTime 类型, 序列化和反序列化的时候老是有格式转换的错误, 我们其实对内容不需要再加工, 直接保存字符串算了 + + String operation; // 动作, 例如: 录入、审核、审批 等 + Integer opCode; // 动作码, 通常: 1=通过, -1=拒绝 + + public UpdateInfo() { + } + + public UpdateInfo(String userId, + String userName, + String orgId, + String orgName, + String operation, + Integer opCode) { + this.userId = userId; + this.userName = userName; + this.orgId = orgId; + this.orgName = orgName; + this.processTime = DateUtil.now(); + this.operation = operation; + this.opCode = opCode; + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/event/PushDataToLabsCareEvent.java b/src/main/java/digital/laboratory/platform/identifybook/event/PushDataToLabsCareEvent.java new file mode 100644 index 0000000..6e3df3e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/event/PushDataToLabsCareEvent.java @@ -0,0 +1,39 @@ +package digital.laboratory.platform.identifybook.event; + +import lombok.Getter; +import org.springframework.context.ApplicationEvent; + +import java.time.Clock; +import java.util.Set; + +/** + * 推送数据到LabsCare 数据平台上的spring 事件 + */ +@Getter +public class PushDataToLabsCareEvent extends ApplicationEvent { + + /** + * 委托id + */ + private final String entrustId; + + /** + * 推送的数据类型, 1 鉴定委托书数据 | 2 鉴定事项确认书数据 | 3 生物检材定性记录报告数据 | 4 普通检材定性记录非红外报告数据 + * 5 鉴定报告审批表数据 | 6 定性报告数据 | 7 归档报告信息数据 + */ + private final Set pushType; + + public PushDataToLabsCareEvent(Object source, String entrustId, Set pushType) { + super(source); + this.entrustId = entrustId; + this.pushType = pushType; + } + + public PushDataToLabsCareEvent(Object source, Clock clock, String entrustId, Set pushType) { + super(source, clock); + this.entrustId = entrustId; + this.pushType = pushType; + } + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/handler/AppStartupRunner.java b/src/main/java/digital/laboratory/platform/identifybook/handler/AppStartupRunner.java new file mode 100644 index 0000000..5c96146 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/handler/AppStartupRunner.java @@ -0,0 +1,67 @@ +package digital.laboratory.platform.identifybook.handler; + +import digital.laboratory.platform.common.core.constant.CommonConstants; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.sys.entity.Dictionary; +import digital.laboratory.platform.sys.feign.RemoteDictionaryService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * App 启动类 + * 当 Spring Application 启动完成后, 会调用这个类的 run() 方法进行一些最后的初始化。 + * 我们在这个方法中从数据库加载一些全局的配置 + * + * @author Zhang Xiaolong + */ + +@Component +@RequiredArgsConstructor +public class AppStartupRunner implements ApplicationRunner { + + private final RemoteDictionaryService remoteDictionaryService; + + public static Map entrustmentConfig = new HashMap<>(); + + public static String getCfg(String code) { + return entrustmentConfig.get(code); + } + + /** + * + * @param args 参数 + * @throws Exception 异常 + * + * // @SysLog("委托受理模块初始化") 这里不能使用 @SysLog(), 因为 SysLog 还没有初始化 + */ + @Override + public void run(ApplicationArguments args) throws Exception { +// BusinessCodeUtils.removeSymbols("x-*/)——0*&……%¥#@xasdf!*&^&%^ 中文、/+)(()\n\\xx\rx"); + + { + // 加载 entrustment 在字典中的配置 + R> r = remoteDictionaryService.getDictionaryByType(CommonConstants.DLP_TYPE_ENTRUSTMENT); + if (Optional.ofNullable(r).isPresent() && (r.getData() != null)) { + List itemList = r.getData(); + for (Dictionary item : itemList) { + entrustmentConfig.put(item.getCode(), item.getLabel()); + } + } + + for (String key : entrustmentConfig.keySet()) { + System.out.println(String.format("entrustmentConfig[%s]=%s", key, entrustmentConfig.get(key))); + } + } + + } + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/listener/PushDataToLabsCareEventListener.java b/src/main/java/digital/laboratory/platform/identifybook/listener/PushDataToLabsCareEventListener.java new file mode 100644 index 0000000..74b4630 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/listener/PushDataToLabsCareEventListener.java @@ -0,0 +1,67 @@ +package digital.laboratory.platform.identifybook.listener; + + +import digital.laboratory.platform.identifybook.event.PushDataToLabsCareEvent; +import digital.laboratory.platform.identifybook.service.PushDataToLabsCareService; +import digital.laboratory.platform.identifybook.threadpool.GlobalThreadPool; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.concurrent.CompletableFuture; + +/** + * 监听有关推送数据到LabsCare 平台的事件, 采用异步 + */ +@Slf4j +@Component +public class PushDataToLabsCareEventListener implements ApplicationListener { + + @Resource + private PushDataToLabsCareService pushDataToLabsCareService; + + /** + * 处理委托数据推送事件 + * + * @param event 委托数据推送事件对象 + */ + @Override + public void onApplicationEvent(PushDataToLabsCareEvent event) { + CompletableFuture.runAsync(() -> { + event.getPushType().forEach(pushType -> { + // 处理不同的推送类型 + switch (pushType) { + case 5: // 推送鉴定报告审批表数据 + try { + pushDataToLabsCareService.pushAppraisalReportApprovalFormData(event.getEntrustId()); + } catch (Exception e) { + log.error("委托id为 {} 的鉴定报告审批表数据推送失败!", event.getEntrustId(), e); + } + break; + case 6: // 推送定性报告数据 + try { + pushDataToLabsCareService.pushQualitativeReportData(event.getEntrustId()); + } catch (Exception e) { + log.error("委托id为 {} 的定性报告数据推送失败!", event.getEntrustId(), e); + } + break; + case 7: // 推送定性报告数据 + try { + pushDataToLabsCareService.pushArchiveReportInfoData(event.getEntrustId()); + } catch (Exception e) { + log.error("委托id为 {} 的归档报告信息数据推送失败!", event.getEntrustId(), e); + } + break; + default: + log.warn("未知的推送类型: {}", event.getPushType()); + break; + } + }); + }, GlobalThreadPool.getInstance()).exceptionally(e -> { + log.error("推送数据到 LabsCare 失败", e); + return null; + }); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/BIdentificationProcessMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/BIdentificationProcessMapper.java new file mode 100644 index 0000000..6ab1add --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/BIdentificationProcessMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.BIdentificationProcess; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-27 + */ +@Mapper +public interface BIdentificationProcessMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/BusinessProcessRecordMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/BusinessProcessRecordMapper.java new file mode 100644 index 0000000..0addabf --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/BusinessProcessRecordMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.BusinessProcessRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 业务流程记录表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Mapper +public interface BusinessProcessRecordMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEventMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEventMapper.java new file mode 100644 index 0000000..da84193 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEventMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.CaseEvent; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 案件、事件 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface CaseEventMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEvidenceMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEvidenceMapper.java new file mode 100644 index 0000000..bfd6968 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/CaseEvidenceMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.CaseEvidence; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 与案件相关的物证信息 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface CaseEvidenceMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/DelivererMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/DelivererMapper.java new file mode 100644 index 0000000..0901fd7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/DelivererMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.Deliverer; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 送检员 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface DelivererMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentBundleMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentBundleMapper.java new file mode 100644 index 0000000..d805d7c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentBundleMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.EntrustmentBundle; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 委托与实验关系 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Mapper +public interface EntrustmentBundleMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentIdentificationMaterialMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentIdentificationMaterialMapper.java new file mode 100644 index 0000000..985ea4b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentIdentificationMaterialMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.EntrustmentIdentificationMaterial; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 检材信息 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface EntrustmentIdentificationMaterialMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentMapper.java new file mode 100644 index 0000000..78f583e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/EntrustmentMapper.java @@ -0,0 +1,34 @@ +package digital.laboratory.platform.identifybook.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + *

+ * 委托 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface EntrustmentMapper extends BaseMapper { + + EntrustCaseDTO getEntrustCaseDTOById(@Param(value = "entrustId") String entrustId); + + IPage findEntrustPage(IPage page, @Param(value = "req") EntrustmentREQ req); + + List findEntrust(@Param(value = "id") String id, @Param(value = "identificationId") String identificationId); + + EntrustmentDTO getEntrustmentDTO(@Param(value = "entrustId") String entrustId); + + long countWSLBSum(@Param("bookStatusList") List bookStatusList); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ExaminationMethodsMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ExaminationMethodsMapper.java new file mode 100644 index 0000000..cdde7ac --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ExaminationMethodsMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.ExaminationMethods; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 检验方法 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Mapper +public interface ExaminationMethodsMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ExperimentMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ExperimentMapper.java new file mode 100644 index 0000000..e0f087f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ExperimentMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.Experiment; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 实验(检验方法的实例) Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Mapper +public interface ExperimentMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobIdentificationMaterialMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobIdentificationMaterialMapper.java new file mode 100644 index 0000000..8d227f1 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobIdentificationMaterialMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.HairJobIdentificationMaterial; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 毛发任务的检材信息 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface HairJobIdentificationMaterialMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobMapper.java new file mode 100644 index 0000000..84b8ec2 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/HairJobMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.HairJob; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 毛发检测任务 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface HairJobMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentificationMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentificationMapper.java new file mode 100644 index 0000000..e9164a8 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentificationMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.Identification; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 鉴定表,一个鉴定可能会有多个委托 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface IdentificationMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookApproveMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookApproveMapper.java new file mode 100644 index 0000000..df1cb33 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookApproveMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 鉴定文书审批表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-25 + */ +@Mapper +public interface IdentifyBookApproveMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookMapper.java new file mode 100644 index 0000000..c2db137 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookMapper.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.IdentifyBook; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 鉴定文书消息表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Mapper +public interface IdentifyBookMapper extends BaseMapper { + + IdentifyBook getMaxVersionIdentifyBook(@Param(value = "fkId") String fkId); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookRelevanceMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookRelevanceMapper.java new file mode 100644 index 0000000..9459baf --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/IdentifyBookRelevanceMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 鉴定文书关联中间表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Mapper +public interface IdentifyBookRelevanceMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ModifySupplementApplyMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ModifySupplementApplyMapper.java new file mode 100644 index 0000000..4187504 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ModifySupplementApplyMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.ModifySupplementApply; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 鉴定文书修改补充申请表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Mapper +public interface ModifySupplementApplyMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ReceiveIdentifyBookMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ReceiveIdentifyBookMapper.java new file mode 100644 index 0000000..ea8b02f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ReceiveIdentifyBookMapper.java @@ -0,0 +1,22 @@ +package digital.laboratory.platform.identifybook.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.identifybook.dto.ReceiveIdentifyBookDTO; +import digital.laboratory.platform.identifybook.entity.ReceiveIdentifyBook; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 领取鉴定文书信息表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@Mapper +public interface ReceiveIdentifyBookMapper extends BaseMapper { + + IPage pageReceiveIdentifyBook(IPage page, @Param(value = "key") String key); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentQualitativeMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentQualitativeMapper.java new file mode 100644 index 0000000..2aa2802 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentQualitativeMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentQualitative; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 委托定性分析检验结果 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Mapper +public interface ResultEntrustmentQualitativeMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentRationMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentRationMapper.java new file mode 100644 index 0000000..7ceeb8c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/ResultEntrustmentRationMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentRation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 委托定量检验结果 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Mapper +public interface ResultEntrustmentRationMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/SampleMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/SampleMapper.java new file mode 100644 index 0000000..2f2f221 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/SampleMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.Sample; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 检验用的样本 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface SampleMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/TakerMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/TakerMapper.java new file mode 100644 index 0000000..f6acf81 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/TakerMapper.java @@ -0,0 +1,18 @@ +package digital.laboratory.platform.identifybook.mapper; + +import digital.laboratory.platform.identifybook.entity.Taker; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 采集员 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Mapper +public interface TakerMapper extends BaseMapper { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/mapper/TaskNotificationMapper.java b/src/main/java/digital/laboratory/platform/identifybook/mapper/TaskNotificationMapper.java new file mode 100644 index 0000000..44bc4a4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/mapper/TaskNotificationMapper.java @@ -0,0 +1,26 @@ +package digital.laboratory.platform.identifybook.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; +import digital.laboratory.platform.identifybook.vo.TaskNotificationVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + *

+ * 任务信息表 Mapper 接口 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +@Mapper +public interface TaskNotificationMapper extends BaseMapper { + IPage queryTaskNotificationPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/req/BusinessProcessRecordREQ.java b/src/main/java/digital/laboratory/platform/identifybook/req/BusinessProcessRecordREQ.java new file mode 100644 index 0000000..21e42e2 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/req/BusinessProcessRecordREQ.java @@ -0,0 +1,21 @@ +package digital.laboratory.platform.identifybook.req; + +import digital.laboratory.platform.identifybook.entity.BusinessProcessRecord; +import digital.laboratory.platform.identifybook.utils.BaseRequest; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/26 0:31 + */ +@Data +@ApiModel(value="BusinessProcessRecordREQ对象", description="封装条件属性") +public class BusinessProcessRecordREQ extends BaseRequest implements Serializable { +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/req/EntrustmentREQ.java b/src/main/java/digital/laboratory/platform/identifybook/req/EntrustmentREQ.java new file mode 100644 index 0000000..d3bda9c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/req/EntrustmentREQ.java @@ -0,0 +1,36 @@ +package digital.laboratory.platform.identifybook.req; + + +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.utils.BaseRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + *

+ * 委托 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Data +@ApiModel(value="EntrustmentREQ对象", description="封装条件属性") +public class EntrustmentREQ extends BaseRequest implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "参数key") + private String key; + + @ApiModelProperty(value = "鉴定委托单位编码") + private String clientOrgId; + + @ApiModelProperty(value = "状态") + private List bookStatusList; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/req/ModifySupplementApplyREQ.java b/src/main/java/digital/laboratory/platform/identifybook/req/ModifySupplementApplyREQ.java new file mode 100644 index 0000000..6a619fd --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/req/ModifySupplementApplyREQ.java @@ -0,0 +1,30 @@ +package digital.laboratory.platform.identifybook.req; + +import digital.laboratory.platform.identifybook.entity.ModifySupplementApply; +import digital.laboratory.platform.identifybook.utils.BaseRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/26 0:08 + */ + +@Data +@ApiModel(value="ModifySupplementApplyREQ对象", description="封装条件属性") +public class ModifySupplementApplyREQ extends BaseRequest implements Serializable { + + @ApiModelProperty(value = "任务模糊查询:(鉴定文书编号/委托人姓名)") + private String key; + + @ApiModelProperty(value = "业务状态(1:鉴定文书-提交修改补充申请,2:鉴定文书-修改补充-审核通过,-2:鉴定文书-修改补充-审核未通过,3:鉴定文书-修改补充-审批通过,-3:鉴定文书-修改补充-审批通过)") + private String status; + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/req/TaskNotificationREQ.java b/src/main/java/digital/laboratory/platform/identifybook/req/TaskNotificationREQ.java new file mode 100644 index 0000000..12fa8b7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/req/TaskNotificationREQ.java @@ -0,0 +1,34 @@ +package digital.laboratory.platform.identifybook.req; + +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import digital.laboratory.platform.identifybook.utils.BaseRequest; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/7/1 14:38 + */ + +@Data +@Accessors(chain = true) +@ApiModel(value = "TaskNotificationREQ对象", description = "封装任务查询条件") +public class TaskNotificationREQ extends BaseRequest { + + @ApiModelProperty(value = "任务模糊查询:(任务标题/任务内容/申请人姓名)") + private String key; + + @ApiModelProperty(value = "任务类型(1:鉴定文书-审核,2:鉴定文书-审核退回修改,3:鉴定文书-审批,4:鉴定文书-审批退回修改,5:鉴定文书-签发/领取,6:鉴定文书修改/补充-审核,7:鉴定文书修改/补充-审批)") + private Integer type; + + @ApiModelProperty(value = "处理状态(0: 待处理,1:已处理,2:退回修改,-1:未通过)") + private List statusList; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/CommonFeignService.java b/src/main/java/digital/laboratory/platform/identifybook/service/CommonFeignService.java new file mode 100644 index 0000000..ee3c5b5 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/CommonFeignService.java @@ -0,0 +1,99 @@ +package digital.laboratory.platform.identifybook.service; + +import com.deepoove.poi.XWPFTemplate; +import digital.laboratory.platform.sys.entity.Area; +import digital.laboratory.platform.sys.entity.SysOrg; +import digital.laboratory.platform.sys.entity.SysUser; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.util.List; +import java.util.Map; + +/** + * 通用的feign请求封装接口服务层接口 + */ +public interface CommonFeignService { + + /** + * 远程调用获取用户机构 + * @param orgId + * @return + */ + SysOrg remoteGetSysOrg(String orgId); + + /** + * 根据权限和机构远程获取用户列表 + * + * @param orgId 组织ID + * @param permission 权限列表 + * @return 用户列表 + */ + List remoteGetUsersByPermission(String orgId, List permission); + + /** + * 通过机构ID远程获取机构所在省市信息 + * + * @param orgId 机构ID + * @return 包含机构所在省市信息的Area对象列表 + * @throws RuntimeException 当根据机构ID获取机构所在省市信息失败时抛出 + */ + List remoteGetProvinceCityInfo(String orgId); + + /** + * 远程调用获取用户信息 + * @param username + * @return + */ + SysUser remoteGetUserByUsername(String username); + + /** + * 远程调用获取用户信息 + * @param userId + * @return + */ + SysUser remoteGetUserById(String userId); + + /** + * 远程调用生成word,并转成pdf + * + * @param template + * @param originalFilename 文件名 + * @param savePath 保存到minio路径 + * @return + * @throws Exception + */ + boolean remoteGenerateWord2PDF(XWPFTemplate template, String originalFilename, String savePath) throws Exception; + + /** + * 远程调用根据文件路径获取文件 + * @param filePath minio上的文件路径 + * @return + * @throws Exception + */ + ByteArrayInputStream remoteGetFile(String filePath) throws Exception; + + /** + * 远程调用根据文件路径获取文件 + * @param filePath minio上的文件路径 + * @param fileName 名称 + * @param httpServletResponse + * @throws Exception + */ + void remoteGetFile(String filePath, String fileName, HttpServletResponse httpServletResponse) throws Exception; + + /** + * 远程调用根据文件路径获取文件列表 + * @param filePath minio上的文件路径 + */ + List remoteGetFileList(String filePath); + + /** + * 远程调用-上传文件 + * @param file 上传的文件对象 + * @param path 上传到minio的位置 + * @return + */ + Map remoteUploadFile(MultipartFile file, String path); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IBIdentificationProcessService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IBIdentificationProcessService.java new file mode 100644 index 0000000..5362280 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IBIdentificationProcessService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.BIdentificationProcess; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-27 + */ +public interface IBIdentificationProcessService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IBusinessProcessRecordService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IBusinessProcessRecordService.java new file mode 100644 index 0000000..cc9289b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IBusinessProcessRecordService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.BusinessProcessRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 业务流程记录表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +public interface IBusinessProcessRecordService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEventService.java b/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEventService.java new file mode 100644 index 0000000..d5f3c0d --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEventService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.CaseEvent; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 案件、事件 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface ICaseEventService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEvidenceService.java b/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEvidenceService.java new file mode 100644 index 0000000..9c0925f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/ICaseEvidenceService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.CaseEvidence; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 与案件相关的物证信息 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface ICaseEvidenceService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IDelivererService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IDelivererService.java new file mode 100644 index 0000000..1dab331 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IDelivererService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.Deliverer; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 送检员 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IDelivererService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentBundleService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentBundleService.java new file mode 100644 index 0000000..f7fa123 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentBundleService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.EntrustmentBundle; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 委托与实验关系 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +public interface IEntrustmentBundleService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentIdentificationMaterialService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentIdentificationMaterialService.java new file mode 100644 index 0000000..ccb74b9 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentIdentificationMaterialService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.EntrustmentIdentificationMaterial; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 检材信息 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IEntrustmentIdentificationMaterialService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentService.java new file mode 100644 index 0000000..0a6248b --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IEntrustmentService.java @@ -0,0 +1,32 @@ +package digital.laboratory.platform.identifybook.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; + +import java.util.List; + +/** + *

+ * 委托 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IEntrustmentService extends IService { + + EntrustCaseDTO getEntrustCaseDTOById(String entrustId); + + IPage findEntrustPage(IPage page, EntrustmentREQ req); + + EntrustmentDTO getEntrustmentDTO(String entrustId); + + long countWSLBSum(List bookStatusList); + + void synchronizationTestSysData(List synedIdList); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IExaminationMethodsService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IExaminationMethodsService.java new file mode 100644 index 0000000..a10360f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IExaminationMethodsService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.ExaminationMethods; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 检验方法 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +public interface IExaminationMethodsService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IExperimentService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IExperimentService.java new file mode 100644 index 0000000..33f024a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IExperimentService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.Experiment; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 实验(检验方法的实例) 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +public interface IExperimentService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobIdentificationMaterialService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobIdentificationMaterialService.java new file mode 100644 index 0000000..8c29f5f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobIdentificationMaterialService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.HairJobIdentificationMaterial; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 毛发任务的检材信息 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IHairJobIdentificationMaterialService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobService.java new file mode 100644 index 0000000..bbf7dfa --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IHairJobService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.HairJob; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 毛发检测任务 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IHairJobService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IIdentificationService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentificationService.java new file mode 100644 index 0000000..8164751 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentificationService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.Identification; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 鉴定表,一个鉴定可能会有多个委托 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface IIdentificationService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookApproveService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookApproveService.java new file mode 100644 index 0000000..f032b19 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookApproveService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 鉴定文核审批表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-25 + */ +public interface IIdentifyBookApproveService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookRelevanceService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookRelevanceService.java new file mode 100644 index 0000000..64a79ef --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookRelevanceService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 鉴定文书关联中间表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +public interface IIdentifyBookRelevanceService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookService.java new file mode 100644 index 0000000..2106a2f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IIdentifyBookService.java @@ -0,0 +1,43 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.entity.IdentifyBook; +import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentQualitative; +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentRation; +import digital.laboratory.platform.identifybook.vo.QualitativeTestResultVo; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +/** + *

+ * 鉴定文书消息表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +public interface IIdentifyBookService extends IService { + + + IdentifyBook getMaxVersionIdentifyBook(String fkId); + //检验结果的描述方式--文字描述--定性分析 + Map> buildTestResultQualitativeVo(List resultEntrustmentQualitativeList); + List testResultRationDes(List resultEntrustmentRationList); + String rationCodeToZhCn(List resultEntrustmentRationList); + String qualitativeCodeToZhCn(List resultEntrustmentQualitativeList); + /** + * 生成鉴定报告 + * + * @param entrustId + * @return + */ + EntrustCaseDTO buildIdentifyBook(String entrustId) throws Exception; + + //上传鉴定归档资料 + List uploadIdentifyBookAttachment(String attachType, List attachFileList,String businessId); + //获取手动上传的文书附件 + String getAttachment(String businessId,String attachType); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IModifySupplementApplyService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IModifySupplementApplyService.java new file mode 100644 index 0000000..26ff172 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IModifySupplementApplyService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.ModifySupplementApply; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 鉴定文书修改补充申请表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +public interface IModifySupplementApplyService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IReceiveIdentifyBookService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IReceiveIdentifyBookService.java new file mode 100644 index 0000000..97a3276 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IReceiveIdentifyBookService.java @@ -0,0 +1,19 @@ +package digital.laboratory.platform.identifybook.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.identifybook.dto.ReceiveIdentifyBookDTO; +import digital.laboratory.platform.identifybook.entity.ReceiveIdentifyBook; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 领取鉴定文书信息表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +public interface IReceiveIdentifyBookService extends IService { + + IPage pageReceiveIdentifyBook(IPage page, String key); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentQualitativeService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentQualitativeService.java new file mode 100644 index 0000000..af57ad1 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentQualitativeService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentQualitative; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 委托定性分析检验结果 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +public interface IResultEntrustmentQualitativeService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentRationService.java b/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentRationService.java new file mode 100644 index 0000000..8c61a99 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/IResultEntrustmentRationService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentRation; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 委托定量检验结果 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +public interface IResultEntrustmentRationService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/ISampleService.java b/src/main/java/digital/laboratory/platform/identifybook/service/ISampleService.java new file mode 100644 index 0000000..ea6d443 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/ISampleService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.Sample; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 检验用的样本 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface ISampleService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/ITakerService.java b/src/main/java/digital/laboratory/platform/identifybook/service/ITakerService.java new file mode 100644 index 0000000..16c9fe5 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/ITakerService.java @@ -0,0 +1,16 @@ +package digital.laboratory.platform.identifybook.service; + +import digital.laboratory.platform.identifybook.entity.Taker; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 采集员 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +public interface ITakerService extends IService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/ITaskNotificationService.java b/src/main/java/digital/laboratory/platform/identifybook/service/ITaskNotificationService.java new file mode 100644 index 0000000..641e6ea --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/ITaskNotificationService.java @@ -0,0 +1,34 @@ +package digital.laboratory.platform.identifybook.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import com.baomidou.mybatisplus.extension.service.IService; +import digital.laboratory.platform.identifybook.req.TaskNotificationREQ; +import digital.laboratory.platform.identifybook.vo.TaskNotificationVO; + +/** + *

+ * 任务信息表 服务类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +public interface ITaskNotificationService extends IService { + /** + * 审核审批任务统计 + * @param dlpUser 当前用户消息 + * @return Object + */ + long countRWSum(DLPUser dlpUser); + + /** + * 分页查询 + * + * @param req + * @param dlpUser + * @return + */ + IPage queryTaskNotificationPage(TaskNotificationREQ req, DLPUser dlpUser); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/PushDataToLabsCareService.java b/src/main/java/digital/laboratory/platform/identifybook/service/PushDataToLabsCareService.java new file mode 100644 index 0000000..2902782 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/PushDataToLabsCareService.java @@ -0,0 +1,28 @@ +package digital.laboratory.platform.identifybook.service; + +/** + * @author ChenJiangBao + * @version 1.0 + * @description: 推送数据到labscare平台接口 + * @date 2025/3/31 9:28 + */ +public interface PushDataToLabsCareService { + + /** + * 推送定性报告数据 + * @param entrustId 委托id + */ + void pushQualitativeReportData(String entrustId); + + /** + * 推送鉴定报告审批表数据 + * @param entrustId 委托id + */ + void pushAppraisalReportApprovalFormData(String entrustId); + + /** + * 推送归档报告信息数据 + * @param entrustId 委托id + */ + void pushArchiveReportInfoData(String entrustId); +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/BIdentificationProcessServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/BIdentificationProcessServiceImpl.java new file mode 100644 index 0000000..acc4649 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/BIdentificationProcessServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.BIdentificationProcess; +import digital.laboratory.platform.identifybook.mapper.BIdentificationProcessMapper; +import digital.laboratory.platform.identifybook.service.IBIdentificationProcessService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-27 + */ +@Service +public class BIdentificationProcessServiceImpl extends ServiceImpl implements IBIdentificationProcessService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/BusinessProcessRecordServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/BusinessProcessRecordServiceImpl.java new file mode 100644 index 0000000..339a690 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/BusinessProcessRecordServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.BusinessProcessRecord; +import digital.laboratory.platform.identifybook.mapper.BusinessProcessRecordMapper; +import digital.laboratory.platform.identifybook.service.IBusinessProcessRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 业务流程记录表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Service +public class BusinessProcessRecordServiceImpl extends ServiceImpl implements IBusinessProcessRecordService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEventServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEventServiceImpl.java new file mode 100644 index 0000000..008ed4f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEventServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.CaseEvent; +import digital.laboratory.platform.identifybook.mapper.CaseEventMapper; +import digital.laboratory.platform.identifybook.service.ICaseEventService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 案件、事件 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class CaseEventServiceImpl extends ServiceImpl implements ICaseEventService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEvidenceServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEvidenceServiceImpl.java new file mode 100644 index 0000000..aa1a0bc --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CaseEvidenceServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.CaseEvidence; +import digital.laboratory.platform.identifybook.mapper.CaseEvidenceMapper; +import digital.laboratory.platform.identifybook.service.ICaseEvidenceService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 与案件相关的物证信息 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class CaseEvidenceServiceImpl extends ServiceImpl implements ICaseEvidenceService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/CommonFeignServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CommonFeignServiceImpl.java new file mode 100644 index 0000000..49ffcd5 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/CommonFeignServiceImpl.java @@ -0,0 +1,262 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.io.file.FileNameUtil; +import cn.hutool.core.util.StrUtil; +import com.deepoove.poi.XWPFTemplate; +import digital.laboratory.platform.common.core.constant.CommonConstants; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.feign.RemoteWord2PDFService; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.service.CommonFeignService; +import digital.laboratory.platform.sys.dto.UserInfo; +import digital.laboratory.platform.sys.entity.Area; +import digital.laboratory.platform.sys.entity.SysOrg; +import digital.laboratory.platform.sys.entity.SysUser; +import digital.laboratory.platform.sys.feign.RemoteOrgService; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import feign.Response; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.output.ByteArrayOutputStream; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.util.Base64; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 通用的feign请求封装接口服务层接口 实现类 + */ +@Slf4j +@Service +public class CommonFeignServiceImpl implements CommonFeignService { + + @Resource + private RemoteOrgService remoteOrgService; + + @Resource + private RemoteUserService remoteUserService; + + @Resource + private RemoteWord2PDFService remoteWord2PDFService; + + @Resource + private OssFile ossFile; + + /** + * 根据用户获取远程系统机构信息 + * + * @param orgId 用户信息 + * @return 对应的远程系统机构信息 + * @throws RuntimeException 如果未找到对应的机构信息,则抛出运行时异常 + */ + @Override + public SysOrg remoteGetSysOrg(String orgId) { + SysOrg sysOrg = null; + R r = remoteOrgService.getByIdWithoutToken(orgId); + if (r != null && r.getCode() == CommonConstants.SUCCESS) { + sysOrg = r.getData(); + } else { + throw new RuntimeException(String.format("没有找到 orgId 为 %s 的机构, 请确认用户所属机构的正确性!", orgId)); + } + return sysOrg; + } + + /** + * 取指定环节可用的用户列表 + * 当流程进行到某个环节的时候, 需要某个用户对这个环节进行处理(通过或不通过)。 + * 这里取可用的用户列表 + *

+ * 涉及到的环境有以下几个: + * 1、创建委托及提交 + * 委托的提交者就是委托的创建者。不存在不通过的可能。 + * 2、审核 + * 审核者有几个条件: (1)必须是鉴定中心的工作人员 (2)必须拥有委托审核权限 + * 3、审批 + * 审核者有几个条件: (1)必须是鉴定中心的工作人员 (2)必须拥有委托审批权限 + * 4、送检确认 + * 送检确认者有几个条件: (1)必须与委托的创建者是同一个机构, 或上级机构的人 (2)必须拥有委托送检确认权限 + * 5、受理 + * 受理者有几个条件: (1)必须是鉴定中心的工作人员 (2)必须拥有委托受理权限 + * + * @return + */ + /** + * 根据权限和机构远程获取用户列表 + * + * @param orgId 组织ID + * @param permission 权限列表 + * @return 用户列表 + */ + @Override + public List remoteGetUsersByPermission(String orgId, List permission) { + R> r = remoteUserService.innerGetUsersByPermission(orgId, permission); + if (r != null && r.getCode() == CommonConstants.SUCCESS) { + return r.getData(); + } else { + throw new RuntimeException(String.format("根据权限 [%s] 和 机构id [%s] 远程获取用户列表!", permission, orgId)); + } + } + + /** + * 通过机构ID远程获取机构所在省市信息 + * + * @param orgId 机构ID + * @return 包含机构所在省市信息的Area对象列表 + * @throws RuntimeException 当根据机构ID获取机构所在省市信息失败时抛出 + */ + @Override + public List remoteGetProvinceCityInfo(String orgId) { + List result = null; + R> r = remoteOrgService.fetchProvinceCityInfoByOrgId(orgId); + if (r != null && r.getCode() == CommonConstants.SUCCESS) { + result = r.getData(); + } else { + throw new RuntimeException("根据机构id获取机构所在省市信息失败!"); + } + return result; + } + + /** + * 远程调用或者用户信息 + * @param username + * @return + */ + @Override + public SysUser remoteGetUserByUsername(String username){ + R info = remoteUserService.innerGetUserInfoByUsername(username); + if (info != null && info.getCode() == CommonConstants.FAIL) { + throw new RuntimeException(String.format("获取用户名为 %s 的用户信息失败!", username)); + } + return info.getData().getSysUser(); + } + + /** + * 远程调用获取用户信息 + * @param userId + * @return + */ + @Override + public SysUser remoteGetUserById(String userId){ + R info = remoteUserService.innerGetById(userId); + if (info != null && info.getCode() == CommonConstants.FAIL) { + throw new RuntimeException(String.format("获取用户名id为 %s 的用户信息失败!", userId)); + } + return info.getData(); + } + + @Override + public boolean remoteGenerateWord2PDF(XWPFTemplate template, String originalFilename, String savePath) throws Exception{ + ByteArrayOutputStream fosWord = new ByteArrayOutputStream(); + template.write(fosWord); + template.close(); + + //------------ + ByteArrayInputStream fisWord = new ByteArrayInputStream(fosWord.toByteArray()); + fosWord.close(); + + MockMultipartFile mockMultipartFile = new MockMultipartFile("file", originalFilename + ".docx", "image/jpg", fisWord); + Response response = remoteWord2PDFService.word2pdf(mockMultipartFile); + fisWord.close(); + + + ByteArrayOutputStream outPDF = new ByteArrayOutputStream(); + IoUtil.copy(response.body().asInputStream(), outPDF, IoUtil.DEFAULT_MIDDLE_BUFFER_SIZE); + ByteArrayInputStream isPDF = new ByteArrayInputStream(outPDF.toByteArray()); + outPDF.close(); + + boolean b = ossFile.fileSave(savePath, isPDF); + + isPDF.close(); + + log.info("转换为 PDF 结束"); + return b; + } + + /** + * 远程调用根据文件路径获取文件 + * @param filePath minio上的文件路径 + * @return + * @throws Exception + */ + @Override + public ByteArrayInputStream remoteGetFile(String filePath) throws Exception { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ossFile.fileGet(filePath, bos); + + byte[] templateArray = bos.toByteArray(); + + ByteArrayInputStream bis = new ByteArrayInputStream(templateArray); + bos.close(); + return bis; + } + + /** + * 远程调用根据文件路径获取文件 + * @param filePath minio上的文件路径 + * @param fileName 名称 + * @param httpServletResponse + * @throws Exception + */ + @Override + public void remoteGetFile(String filePath, String fileName, HttpServletResponse httpServletResponse) throws Exception { + ossFile.fileGet(filePath, httpServletResponse.getOutputStream()); + if (StrUtil.isNotBlank(fileName)) { + httpServletResponse.setContentType(fileName); + } + } + + /** + * 远程调用根据文件路径获取文件列表 + * @param filePath minio上的文件路径 + */ + @Override + public List remoteGetFileList(String filePath) { + if (StrUtil.isNotBlank(filePath)) { + List fileNameList = ossFile.fileList(filePath); + List fileList = fileNameList.stream().map(fileName -> { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + try { + ossFile.fileGet(filePath + "/" + fileName, byteArrayOutputStream); + return Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray()); + } catch (Exception e) { + e.printStackTrace(); + log.error("文件获取失败, 文件路径为: {}", filePath + "/" + fileName); + } + return null; + }).collect(Collectors.toList()); + return fileList; + } else { + throw new RuntimeException("文件路径不能为空!"); + } + } + + /** + * 远程调用-上传文件 + * @param file 上传的文件对象 + * @param path 上传到minio的位置 + * @return + */ + @Override + public Map remoteUploadFile(MultipartFile file, String path) { + boolean r = ossFile.fileUpload(file, path); + if (r) { + HashMap resultData = new HashMap<>(); + resultData.put("fileName", FileNameUtil.getName(file.getOriginalFilename())); + resultData.put("path", path); + log.info("文件上传成功!"); + return resultData; + } else { + String failMsg = String.format("文件名为 %s 的文件上传失败!", file.getOriginalFilename()); + log.error(failMsg); + throw new RuntimeException(failMsg); + } + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/DelivererServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/DelivererServiceImpl.java new file mode 100644 index 0000000..e90c823 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/DelivererServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.Deliverer; +import digital.laboratory.platform.identifybook.mapper.DelivererMapper; +import digital.laboratory.platform.identifybook.service.IDelivererService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 送检员 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class DelivererServiceImpl extends ServiceImpl implements IDelivererService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentBundleServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentBundleServiceImpl.java new file mode 100644 index 0000000..5887fe7 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentBundleServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.EntrustmentBundle; +import digital.laboratory.platform.identifybook.mapper.EntrustmentBundleMapper; +import digital.laboratory.platform.identifybook.service.IEntrustmentBundleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 委托与实验关系 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Service +public class EntrustmentBundleServiceImpl extends ServiceImpl implements IEntrustmentBundleService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentIdentificationMaterialServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentIdentificationMaterialServiceImpl.java new file mode 100644 index 0000000..61a7da5 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentIdentificationMaterialServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.EntrustmentIdentificationMaterial; +import digital.laboratory.platform.identifybook.mapper.EntrustmentIdentificationMaterialMapper; +import digital.laboratory.platform.identifybook.service.IEntrustmentIdentificationMaterialService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 检材信息 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class EntrustmentIdentificationMaterialServiceImpl extends ServiceImpl implements IEntrustmentIdentificationMaterialService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentServiceImpl.java new file mode 100644 index 0000000..6fd0c61 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/EntrustmentServiceImpl.java @@ -0,0 +1,276 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.common.core.constant.CommonConstants; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.mapper.EntrustmentMapper; +import digital.laboratory.platform.identifybook.req.EntrustmentREQ; +import digital.laboratory.platform.identifybook.service.IEntrustmentBundleService; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IExperimentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; +import digital.laboratory.platform.inspetion.api.entity.EntrustInfo; +import digital.laboratory.platform.inspetion.api.feign.RemoteTestToIdentifyService; +import digital.laboratory.platform.inspetion.api.vo.TestRecordVo; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + *

+ * 委托 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class EntrustmentServiceImpl extends ServiceImpl implements IEntrustmentService { + + @Autowired + private IExperimentService experimentService; + @Autowired + private IEntrustmentBundleService entrustmentBundleService; + @Resource + private RemoteUserService remoteUserService; + @Resource + private RemoteTestToIdentifyService remoteTestToIdentifyService; + @Resource + private IIdentifyBookRelevanceService identifyBookRelevanceService; + + private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒"); + + @Override + public void synchronizationTestSysData(List synedIdList) { + R testFinishBusinessData = remoteTestToIdentifyService.getTestFinishBusinessData(synedIdList); + String retData = JSON.toJSONString(testFinishBusinessData.getData()); + + List entrustInfoList = JSONArray.parseArray(retData, EntrustInfo.class); + List bookEntrustList = new ArrayList<>(); + for (EntrustInfo entrustInfo : entrustInfoList) { + Entrustment eg = new Entrustment(); + eg.setId(entrustInfo.getId()); + eg.setSynEntrustId(entrustInfo.getSynEntrustId()); + eg.setDataSources(entrustInfo.getSource());// 0 系统推送,1 检验系统手工录入的 + eg.setBusinessType(Integer.parseInt(entrustInfo.getBusinessType())); + eg.setCaseName(entrustInfo.getCaseName()); + eg.setCaseBrief(entrustInfo.getCaseBrief()); + eg.setAcceptNo(entrustInfo.getAcceptNo()); + eg.setAcceptTime(entrustInfo.getAcceptDate()); + eg.setEntrustmentNo(entrustInfo.getEntrustNo()); + eg.setClientOrgName(entrustInfo.getEntrustDepartment()); + eg.setIdentificationOrgName(entrustInfo.getIdentityDepartment()); + eg.setEntrustRequirement(entrustInfo.getEntrustRequirement()); + //送检人信息 + eg.setDeliverer1Name(entrustInfo.getDeliver1Name()); + eg.setDeliverer1Phone(entrustInfo.getDeliver1Phone()); + eg.setDeliverer1Position(entrustInfo.getDeliver1Position()); + eg.setDeliverer1Cert(entrustInfo.getDeliver1Cert()); + eg.setDeliverer1Id(entrustInfo.getDeliver1No()); + + eg.setDeliverer2Name(entrustInfo.getDeliver2Name()); + eg.setDeliverer2Phone(entrustInfo.getDeliver2Phone()); + eg.setDeliverer2Position(entrustInfo.getDeliver2Position()); + eg.setDeliverer2Cert(entrustInfo.getDeliver2Cert()); + eg.setDeliverer2Id(entrustInfo.getDeliver2No()); + // 检材数量 + eg.setMaterialNum(entrustInfo.getMaterialNum()); + // 设置文书领取方式 + eg.setReportReceiveMode(entrustInfo.getReportReceiveMode()); + eg.setPostAddress(entrustInfo.getPostAddress()); + + //eg.setReportReceiveMode(entrustInfo); + eg.setUpdateBy(entrustInfo.getUpdateBy()); + eg.setUpdateTime(entrustInfo.getUpdateTime()); + eg.setCreateBy(entrustInfo.getCreateBy()); + eg.setCreateTime(entrustInfo.getCreateTime()); + bookEntrustList.add(eg); + } + List identifyBookRelevanceList = new ArrayList<>(); + for (Entrustment entrustment : bookEntrustList) { + IdentifyBookRelevance identifyBookRelevance = identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .eq(IdentifyBookRelevance::getRelevanceBusinessId, entrustment.getId())); + if (ObjectUtils.isEmpty(identifyBookRelevance)) { + String[] arrNo = entrustment.getAcceptNo().split("-"); + identifyBookRelevance = new IdentifyBookRelevance(); + identifyBookRelevance.setRelevanceBusinessId(entrustment.getId()); + identifyBookRelevance.setYear(arrNo[0]); + identifyBookRelevance.setSerialNumber(arrNo[1]); + identifyBookRelevance.setBookStatus(-1); + identifyBookRelevanceList.add(identifyBookRelevance); + } + } + if (bookEntrustList.size() > 0) { + boolean entrustSuccess = this.saveOrUpdateBatch(bookEntrustList);//保存到文书系统的 entrust中 + if (!entrustSuccess) { + throw new RuntimeException("保存委托信息失败!!!"); + } + } + if (identifyBookRelevanceList.size() > 0) { + boolean ibrSuccess = identifyBookRelevanceService.saveBatch(identifyBookRelevanceList); + if (!ibrSuccess) { + throw new RuntimeException("保存文书关联信息失败!!!"); + } + } + } + + @Override + public EntrustCaseDTO getEntrustCaseDTOById(String entrustId) { + return baseMapper.getEntrustCaseDTOById(entrustId); + } + + @Override + public IPage findEntrustPage(IPage page, EntrustmentREQ req) { + IPage entrustPage = baseMapper.findEntrustPage(page, req); +// for (EntrustmentDTO e: entrustPage.getRecords()) { +// List entrustmentDTOList = baseMapper.findEntrust(e.getId(), e.getIdentificationId()); +// +// List stringIDSList = Stream.of(e.getId()).collect(Collectors.toList()); +// +// if(CollectionUtils.isNotEmpty(entrustmentDTOList)){ +// stringIDSList.addAll( +// entrustmentDTOList +// .stream() +// .map(m -> m.getId()) +// .collect(Collectors.toList())); +// e.setChildren(entrustmentDTOList); +// } +// // 根据委托ID获取实验与委托关联消息-取实验信息 +// List entrustmentBundleList = entrustmentBundleService.list(new LambdaQueryWrapper() +// .in(EntrustmentBundle::getId, stringIDSList)); +// List experimentVOList = new ArrayList<>(); +// List experimentAllIds = new ArrayList<>(); +// if(CollectionUtils.isNotEmpty(entrustmentBundleList)){ +// for (EntrustmentBundle entrustmentBundle: entrustmentBundleList){ +// List experimentIds = entrustmentBundle.getSelectedExperiment(); +// experimentAllIds.addAll(experimentIds); +// for (String experimentId : experimentIds) { +// Experiment experiment = experimentService.getById(experimentId); +// ExperimentVO experimentVO = new ExperimentVO(); +// BeanUtil.copyProperties(experiment, experimentVO); +// experimentVO.setOpUserName(remoteUserService.innerGetById(experimentVO.getOpUserId()).getData().getName()); +// experimentVOList.add(experimentVO); +// } +// } +// +// } +// List minStartDateList = experimentVOList.stream().map(m -> m.getCreateTime()).collect(Collectors.toList()); +// List maxEndDateList = experimentVOList.stream().map(m -> m.getFinishDate()).collect(Collectors.toList()); +// e.setAppraisalUserName(experimentVOList.get(0).getOpUserName()); +// e.setInspectionStartDate(sdf.format(Collections.min(minStartDateList))); +// e.setFinishDate(sdf.format(Collections.max(maxEndDateList))); +// } + List records = entrustPage.getRecords(); + if (CollUtil.isNotEmpty(records)) { + List businessIds = records.stream().map(EntrustmentDTO::getId).collect(Collectors.toList()); + R> r = remoteTestToIdentifyService.queryTestRecordInfoByBusinessId(businessIds); + if (r.getCode() == CommonConstants.SUCCESS) { + Map dataMap = r.getData(); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日"); + for (EntrustmentDTO record : records) { + getTestDateAndAppraiser(record, dataMap, dateTimeFormatter); + } + } else { + log.error("==================>>>>>>>>>>>>>>>>>> 获取实验信息失败!"); + } + } + entrustPage.setRecords(records); + return entrustPage; + } + + @Override + public EntrustmentDTO getEntrustmentDTO(String entrustId) { + + EntrustmentDTO entrustmentDTO = baseMapper.getEntrustmentDTO(entrustId); + R> r = remoteTestToIdentifyService.queryTestRecordInfoByBusinessId(Arrays.asList(entrustmentDTO.getId())); + if (r.getCode() == CommonConstants.SUCCESS) { + Map dataMap = r.getData(); + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日"); + getTestDateAndAppraiser(entrustmentDTO, dataMap, dateTimeFormatter); + } else { + log.error("==================>>>>>>>>>>>>>>>>>> 获取实验信息失败!"); + } + return entrustmentDTO; +// +// List entrustmentDTOList = baseMapper.findEntrust(entrustmentDTO.getId(), entrustmentDTO.getIdentificationId()); +// +// List stringIDSList = Stream.of(entrustmentDTO.getId()).collect(Collectors.toList()); +// +// if(CollectionUtils.isNotEmpty(entrustmentDTOList)){ +// +// stringIDSList.addAll( +// entrustmentDTOList +// .stream() +// .map(m -> m.getId()) +// .collect(Collectors.toList())); +// } +// // 根据委托ID获取实验与委托关联消息-取实验信息 +// List entrustmentBundleList = entrustmentBundleService.list(new LambdaQueryWrapper() +// .in(EntrustmentBundle::getId, stringIDSList)); +// List experimentVOList = new ArrayList<>(); +// List experimentAllIds = new ArrayList<>(); +// if(CollectionUtils.isNotEmpty(entrustmentBundleList)){ +// for (EntrustmentBundle entrustmentBundle: entrustmentBundleList){ +// List experimentIds = entrustmentBundle.getSelectedExperiment(); +// experimentAllIds.addAll(experimentIds); +// for (String experimentId : experimentIds) { +// Experiment experiment = experimentService.getById(experimentId); +// ExperimentVO experimentVO = new ExperimentVO(); +// BeanUtil.copyProperties(experiment, experimentVO); +// experimentVO.setOpUserName(remoteUserService.innerGetById(experimentVO.getOpUserId()).getData().getName()); +// experimentVOList.add(experimentVO); +// } +// } +// +// } +// List minStartDateList = experimentVOList.stream().map(m -> m.getCreateTime()).collect(Collectors.toList()); +// List maxEndDateList = experimentVOList.stream().map(m -> m.getFinishDate()).collect(Collectors.toList()); +// entrustmentDTO.setAppraisalUserName(experimentVOList.get(0).getOpUserName()); +// entrustmentDTO.setInspectionStartDate(sdf.format(Collections.min(minStartDateList))); +// entrustmentDTO.setFinishDate(sdf.format(Collections.max(maxEndDateList))); + + + } + + /** + * 提取出检验时间和鉴定人名称 + * + * @param entrustmentDTO + * @param dataMap + * @param dateTimeFormatter + */ + private void getTestDateAndAppraiser(EntrustmentDTO entrustmentDTO, Map dataMap, DateTimeFormatter dateTimeFormatter) { + TestRecordVo testRecordVo = dataMap.get(entrustmentDTO.getId()); + if (testRecordVo != null && testRecordVo.getStatus() == 5) { + entrustmentDTO.setAppraisalUserName(testRecordVo.getTestUserName()); + entrustmentDTO.setInspectionStartDate(testRecordVo.getTestStartDate().format(dateTimeFormatter)); + entrustmentDTO.setFinishDate(testRecordVo.getTestEndDate().format(dateTimeFormatter)); + } else { + log.warn("未从检验鉴定中获取到文书对应的实验信息。"); + } + } + + @Override + public long countWSLBSum(List bookStatusList) { + return baseMapper.countWSLBSum(bookStatusList); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExaminationMethodsServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExaminationMethodsServiceImpl.java new file mode 100644 index 0000000..b4e6868 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExaminationMethodsServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.ExaminationMethods; +import digital.laboratory.platform.identifybook.mapper.ExaminationMethodsMapper; +import digital.laboratory.platform.identifybook.service.IExaminationMethodsService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 检验方法 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Service +public class ExaminationMethodsServiceImpl extends ServiceImpl implements IExaminationMethodsService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExperimentServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExperimentServiceImpl.java new file mode 100644 index 0000000..a8604e1 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ExperimentServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.Experiment; +import digital.laboratory.platform.identifybook.mapper.ExperimentMapper; +import digital.laboratory.platform.identifybook.service.IExperimentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 实验(检验方法的实例) 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Service +public class ExperimentServiceImpl extends ServiceImpl implements IExperimentService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobIdentificationMaterialServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobIdentificationMaterialServiceImpl.java new file mode 100644 index 0000000..bd91bc4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobIdentificationMaterialServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.HairJobIdentificationMaterial; +import digital.laboratory.platform.identifybook.mapper.HairJobIdentificationMaterialMapper; +import digital.laboratory.platform.identifybook.service.IHairJobIdentificationMaterialService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 毛发任务的检材信息 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class HairJobIdentificationMaterialServiceImpl extends ServiceImpl implements IHairJobIdentificationMaterialService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobServiceImpl.java new file mode 100644 index 0000000..435b31d --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/HairJobServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.HairJob; +import digital.laboratory.platform.identifybook.mapper.HairJobMapper; +import digital.laboratory.platform.identifybook.service.IHairJobService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 毛发检测任务 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class HairJobServiceImpl extends ServiceImpl implements IHairJobService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentificationServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentificationServiceImpl.java new file mode 100644 index 0000000..42b0434 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentificationServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.Identification; +import digital.laboratory.platform.identifybook.mapper.IdentificationMapper; +import digital.laboratory.platform.identifybook.service.IIdentificationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 鉴定表,一个鉴定可能会有多个委托 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class IdentificationServiceImpl extends ServiceImpl implements IIdentificationService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookApproveServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookApproveServiceImpl.java new file mode 100644 index 0000000..ceee8b3 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookApproveServiceImpl.java @@ -0,0 +1,34 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import digital.laboratory.platform.common.core.util.ClassUtils; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.EntrustmentIdentificationMaterial; +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.mapper.IdentifyBookApproveMapper; +import digital.laboratory.platform.identifybook.service.IEntrustmentIdentificationMaterialService; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookApproveService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + *

+ * 鉴定文书审批表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-25 + */ +@Service +@RequiredArgsConstructor +public class IdentifyBookApproveServiceImpl extends ServiceImpl implements IIdentifyBookApproveService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookRelevanceServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookRelevanceServiceImpl.java new file mode 100644 index 0000000..f889001 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookRelevanceServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.IdentifyBookRelevance; +import digital.laboratory.platform.identifybook.mapper.IdentifyBookRelevanceMapper; +import digital.laboratory.platform.identifybook.service.IIdentifyBookRelevanceService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 鉴定文书关联中间表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Service +public class IdentifyBookRelevanceServiceImpl extends ServiceImpl implements IIdentifyBookRelevanceService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookServiceImpl.java new file mode 100644 index 0000000..b42c3ea --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/IdentifyBookServiceImpl.java @@ -0,0 +1,543 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.common.core.constant.OSSDirectoryConstants; +import digital.laboratory.platform.common.core.util.ClassUtils; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.feign.RemoteGenerateWordService; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.dto.EntrustCaseDTO; +import digital.laboratory.platform.identifybook.emums.UnitEnums; +import digital.laboratory.platform.identifybook.entity.*; +import digital.laboratory.platform.identifybook.handler.AppStartupRunner; +import digital.laboratory.platform.identifybook.mapper.IdentifyBookMapper; +import digital.laboratory.platform.identifybook.service.*; +import digital.laboratory.platform.identifybook.vo.QualitativeTestResultVo; +import digital.laboratory.platform.inspetion.api.entity.EntrustInfo; +import digital.laboratory.platform.inspetion.api.entity.IdentificationBookDTO; +import digital.laboratory.platform.inspetion.api.feign.RemoteTestToIdentifyService; +import digital.laboratory.platform.sys.feign.RemoteUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 鉴定文书消息表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Service +@Transactional(rollbackFor = Exception.class) +@Slf4j +public class IdentifyBookServiceImpl extends ServiceImpl implements IIdentifyBookService { + + @Resource + private IEntrustmentService entrustmentService;//委托书service + + @Resource + private IIdentifyBookService identifyBookService; + @Resource + private IIdentifyBookRelevanceService identifyBookRelevanceService; + + @Resource + private RemoteUserService remoteUserService; + + @Resource + private RemoteGenerateWordService remoteGenerateWordService; + @Resource + private RemoteTestToIdentifyService remoteTestToIdentifyService; + @Resource + private OssFile ossFile; + //格式化日期 + private SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //环境 + private Environment env; + + @Override + public String getAttachment(String businessId, String attachType) { + String targetPath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + businessId + "/" + attachType + "/" + attachType + ".pdf"; + String indentStr = IdWorker.get32UUID(); + return indentStr + "#" + targetPath; + } + + /** + * 上传文书的附件 + * + * @param attachType + * @param attachFileList + * @return + */ + @Override + public List uploadIdentifyBookAttachment(String attachType, List attachFileList, String businessId) { + String targetPath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + businessId + "/" + attachType; + //根据类型,决定存储的目录 + List fileNames = new ArrayList<>(); + String fileName = attachType + ".pdf"; + attachFileList.forEach(item -> { + boolean isSuccess = ossFile.fileUpload(item, targetPath, fileName); + if (isSuccess) { + String filePath = targetPath + "/" + fileName; + log.info("保存文件 {}", filePath); + fileNames.add(filePath); + } + }); + return fileNames; + } + + @Override + public EntrustCaseDTO buildIdentifyBook(String entrustId) throws Exception { + //获取到制作文书的实验数据 + R identifyBookData = remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustId); + + log.info("从检验鉴定获取的数据信息 ========》》》》》》》 {}", identifyBookData.getData()); + if (ObjectUtils.isEmpty(identifyBookData.getData())) { + return null; + } + //将获取到的数据封装到 identificationBookDTO 中,我们从这个对象中获取需要的数据 + IdentificationBookDTO identificationBookDTO = identifyBookData.getData(); + + EntrustCaseDTO entrustCaseDTO = entrustmentService.getEntrustCaseDTOById(entrustId); + //将鉴定ID相同的其他委托ID取出来,由于存在补送,所以我们需要根据鉴定ID查询出其他委托书的数据 + List entrustmentList = entrustmentService.list(new LambdaQueryWrapper() + .select(Entrustment::getId) + .eq(Entrustment::getIdentificationId, entrustCaseDTO.getIdentificationId()) + .ne(Entrustment::getId, entrustCaseDTO.getId()));//排除自己 + //将这个案件的所有委托ID全部放在一个列表中 + List stringIDSList = new ArrayList<>(); + stringIDSList.add(entrustCaseDTO.getId()); + if (CollectionUtils.isNotEmpty(entrustmentList)) { + stringIDSList.addAll(entrustmentList.stream().map(m -> m.getId()).collect(Collectors.toList())); + } + //定义模板填充参数Map + //Map retTemplateParameter = ClassUtils.objectToMap(entrustCaseDTO); + Map retTemplateParameter = ClassUtils.objectToMap(identificationBookDTO.getEntrustInfo()); + + //retTemplateParameter.put("acceptTime", sdf.format(entrustCaseDTO.getAcceptTime())); + + retTemplateParameter.put("acceptTime", identificationBookDTO.getEntrustInfo().getAcceptDate().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); + //查出鉴定书的状态信息,根据委托ID + IdentifyBookRelevance identifyBookRelevance = + identifyBookRelevanceService.getOne(new LambdaQueryWrapper() + .in(IdentifyBookRelevance::getRelevanceBusinessId, stringIDSList)); + //如果查到鉴定书状态信息表 + if (ObjectUtils.isNotEmpty(identifyBookRelevance)) { + identifyBookRelevance.setBookStatus(0);//改变状态 + //设置模板中用到的参数 + retTemplateParameter.put("year", identifyBookRelevance.getYear()); + retTemplateParameter.put("serialNumber", identifyBookRelevance.getSerialNumber()); + } else { + //如果鉴定信息表中不存在记录,那么我们就创建一个 + // String[] arrNo = entrustCaseDTO.getAcceptNo().split("-");//使用-号来分割 + String[] arrNo = identificationBookDTO.getEntrustInfo().getAcceptNo().split("-");//使用-号来分割 + identifyBookRelevance = new IdentifyBookRelevance(); + identifyBookRelevance.setRelevanceBusinessId(entrustId); + identifyBookRelevance.setYear(arrNo[0]); + identifyBookRelevance.setSerialNumber(arrNo[1]); + identifyBookRelevance.setBookStatus(0); + identifyBookRelevance.setId(IdType.ASSIGN_ID.toString()); + } + + if (ObjectUtils.isNotEmpty(identifyBookRelevance)) { + // 获取最高的一个版本的文书 + IdentifyBook identifyBook = identifyBookService.getMaxVersionIdentifyBook(identifyBookRelevance.getId()); + + String remarks = "制作文书"; + String version = "v1.0"; // 默认版本号 + if (ObjectUtils.isNotEmpty(identifyBook)) { + version = "v" + new BigDecimal(identifyBook.getVersion().substring(1)).add(new BigDecimal("0.1")); + remarks = "重新制作文书"; + } + String fileName = "鉴定文书-" + version; + String fileType = ".docx"; // 文件类型 + //String templateFileName=getIdentifyBookTemplate(entrustCaseDTO); + String templateFileName = getIdentifyBookTemplate(identificationBookDTO.getEntrustInfo()); + log.info("你选择的模板是:{}", templateFileName); + String identifyBookPathFileName = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + identifyBookRelevance.getRelevanceBusinessId() + "/book/" + fileName; // 鉴定文书存储路径及文件名 + String submissionSampleList = "submissionSampleList"; // 送检材料集合名称 + String outcomeSampleList = "outcomeSampleList"; // 检验结果集合名称 + // 获取送检材料集合--将委托书中对应的检材全部取出放到一个List中 +// List entrustmentIdentificationMaterials = entrustmentIdentificationMaterialService +// .list(new LambdaQueryWrapper() +// .in(EntrustmentIdentificationMaterial::getEntrustmentId, stringIDSList) +// .orderByAsc(EntrustmentIdentificationMaterial::getAcceptNo)); + + //retTemplateParameter.put(submissionSampleList, entrustmentIdentificationMaterials);//检材列表 + DecimalFormat df = new DecimalFormat("#.00");// 保留两位小数 + retTemplateParameter.put( + submissionSampleList, + identificationBookDTO.getSampleInfoList().stream().map(item -> { + Map map = new HashMap<>(); + map.put("acceptNo", item.getAcceptNo()); + map.put("sampleName", item.getSampleName()); + map.put("form", item.getForm()); + map.put("quality", df.format(item.getQuality())); + map.put("unit", UnitEnums.fromUnit(item.getUnit())); + return map; + }).collect(Collectors.toList()) + );//检材列表 +// // 根据委托ID,查询出实验数据 +// List experimentIds=new ArrayList<>(); +// List experimentVOList = new ArrayList<>();//实验信息 +// List experimentAllIds = new ArrayList<>();//实验IDs +// List methodIds = new ArrayList<>();//用到的方法IDs +// // +// experimentAllIds.addAll(experimentIds); +// for (String experimentId : experimentIds) { +// Experiment experiment = experimentService.getById(experimentId); +// ExperimentVO experimentVO = new ExperimentVO(); +// BeanUtil.copyProperties(experiment, experimentVO); +// experimentVO.setOpUserName(remoteUserService.innerGetById(experimentVO.getOpUserId()).getData().getName()); +// experimentVO.setCreateUserName(remoteUserService.innerGetById(experimentVO.getCreateBy()).getData().getName()); +// experimentVO.setUpdateUserName(remoteUserService.innerGetById(experimentVO.getUpdateBy()).getData().getName()); +// experimentVOList.add(experimentVO); +// methodIds.add(experiment.getMethodId()); +// } +// // 取方法列表 +// List methodList = examinationMethodsService.list(new LambdaQueryWrapper() +// .in(ExaminationMethods::getId, methodIds)); +// +// //== 取定性结果 +// List resultEntrustmentQualitativeList = resultEntrustmentQualitativeService.list( +// new LambdaQueryWrapper() +// .in(ResultEntrustmentQualitative::getExperimentId, experimentAllIds) +// .orderByAsc(ResultEntrustmentQualitative::getSampleNo)); +// //== 取定量结果 +// List resultEntrustmentRationList = resultEntrustmentRationService.list( +// new LambdaQueryWrapper() +// .in(ResultEntrustmentRation::getExperimentId, experimentAllIds) +// .orderByAsc(ResultEntrustmentRation::getMaterialIndex)); +// // +// List minStartDateList = experimentVOList.stream().map(m -> m.getCreateTime()).collect(Collectors.toList()); +// List maxEndDateList = experimentVOList.stream().map(m -> m.getFinishDate()).collect(Collectors.toList()); + //retTemplateParameter.put("inspectionStartDate", sdf.format(Collections.min(minStartDateList))); // 检验开始日期(格式:xxxx年xx月xx日) + retTemplateParameter.put("inspectionStartDate", identificationBookDTO.getEntrustInfo().getAcceptDate().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); // 检验开始日期(格式:xxxx年xx月xx日) + // + retTemplateParameter.put("inspectionLocation", identificationBookDTO.getEntrustInfo().getIdentityDepartment()); // 检验地点 + // +// String inspectionMethod = ""; +// int i = 1; +// for (ExaminationMethods methods : methodList){ +// if(StringUtils.isEmpty(inspectionMethod)){ // +// inspectionMethod = i + ": " + methods.getMethodName() + " ( " + methods.getStandardNumber() + " )。"; +// } else { +// inspectionMethod =inspectionMethod + "\r\n" + i + ": " + methods.getMethodName() + " ( " + methods.getStandardNumber() + " )。"; +// } +// i++; +// +// } + retTemplateParameter.put("entrustRequirement", identificationBookDTO.getEntrustInfo().getEntrustRequirement()); + retTemplateParameter.put("clientOrgName", identificationBookDTO.getEntrustInfo().getEntrustDepartment()); + retTemplateParameter.put("deliverer1Name", identificationBookDTO.getEntrustInfo().getDeliver1Name()); + retTemplateParameter.put("deliverer2Name", identificationBookDTO.getEntrustInfo().getDeliver2Name()); + retTemplateParameter.put("testResult", identificationBookDTO.getTestResult()); + retTemplateParameter.put("inspectionMethod", identificationBookDTO.getTestMethod()); // 检验方法 + //检验过程 + String testProcessStr = ""; + retTemplateParameter.put("inspectionProcess", identificationBookDTO.getTestProcessDes()); // 检验过程 + // + //retTemplateParameter.put("finishDate", sdf.format(Collections.max(maxEndDateList))); // 实验完成日期(格式:xxxx年xx月xx日) + retTemplateParameter.put("finishDate", identificationBookDTO.getTestFinishDate()); // 实验完成日期(格式:xxxx年xx月xx日) + + retTemplateParameter.put("appraisalUserName", remoteUserService.innerGetById(identificationBookDTO.getTestOptUser()).getData().getName()); // 鉴定人 + retTemplateParameter.put("authorizedSignatory", ""); // 授权签字人 + retTemplateParameter.put("authorizedSignatureDate", ""); // 授权签字人日期 + +// Map objectMap = null; +// List> mapList = new ArrayList<>(); +// for (ResultEntrustmentQualitative entrustmentQualitative : resultEntrustmentQualitativeList){ +// objectMap = new HashMap<>(); +// objectMap.put("materialIndex", entrustmentQualitative.getMaterialIndex()); +// objectMap.put("sampleNo", entrustmentQualitative.getSampleNo()); +// objectMap.put("qualitativeResultFlag", 1); // 定性结果 +// objectMap.put("qualitativeResult", entrustmentQualitative.getResult()? "检出": "未检出"); // 定性结果 +// objectMap.put("qualitativeCompound", entrustmentQualitative.getCompound()); // 定性检出(化合物) +// objectMap.put("rationResultFlag", -1); // 定量结果 +// objectMap.put("rationResult", "/"); // 定量结果 +// objectMap.put("rationCompound", "/"); // 定量检出(化合物) +// objectMap.put("remark", "/"); // 备注 +// mapList.add(objectMap); +// } +// +// for (ResultEntrustmentRation resultEntrustmentRation : resultEntrustmentRationList){ +// boolean flag = true; +// for(Map map: mapList){ +// if(resultEntrustmentRation.getSampleNo().equals(map.get("sampleNo"))){ +// objectMap.put("rationResultFlag", 1); // 定量结果 +// map.put("rationResult", resultEntrustmentRation.getResult()); +// map.put("rationCompound", resultEntrustmentRation.getCompound()); +// flag = false; +// } +// } +// if(flag){ +// objectMap = new HashMap<>(); +// objectMap.put("materialIndex", resultEntrustmentRation.getMaterialIndex()); +// objectMap.put("sampleNo", resultEntrustmentRation.getSampleNo()); +// objectMap.put("qualitativeResultFlag", -1); // 定性结果 +// objectMap.put("qualitativeResult", "/"); // 定性结果 +// objectMap.put("qualitativeCompound", "/"); // 定性检出(化合物) +// objectMap.put("rationResultFlag", 1); // 定量结果 +// objectMap.put("rationResult", resultEntrustmentRation.getResult()); // 定量结果 +// objectMap.put("rationCompound", resultEntrustmentRation.getCompound()); // 定量检出(化合物) +// objectMap.put("remark", "/"); // 备注 +// mapList.add(objectMap); +// } +// } +// +// retTemplateParameter.put(outcomeSampleList, mapList); + + //retTemplateParameter.put("inspectionResult",identifyBookService.qualitativeCodeToZhCn(resultEntrustmentQualitativeList)); + retTemplateParameter.put("inspectionResult", identificationBookDTO.getTestResult()); + + + // 设置集合名称列表 + List listNameCollection = new ArrayList<>(); + listNameCollection.add(submissionSampleList); + listNameCollection.add(outcomeSampleList); + + // 生成文书并上传 + R r = remoteGenerateWordService.generateWord(templateFileName, null, identifyBookPathFileName, fileType, + "", listNameCollection, false, retTemplateParameter); + if (r != null && r.getCode() == 0) { + boolean bss = identifyBookRelevanceService.saveOrUpdate(identifyBookRelevance); + if (!bss) { + throw new RuntimeException("生成文书时,更新业务状态失败!!!。"); + } + // 保存文书相关消息 + boolean b = this.saveIdentifyBookComm(identifyBookRelevance.getId(), identifyBookPathFileName + fileType, + fileName + fileType, version, remarks); + if (b) { + //ossFile.fileGet(identifyBookPathFileName + fileType, response.getOutputStream()); + //response.setContentType(new MimetypesFileTypeMap().getContentType(fileName + fileType)); + String uuid = IdWorker.get32UUID(); + //return R.ok( uuid+"#"+identifyBookPathFileName + fileType, "获取文件成功"); + } + } + } + return entrustCaseDTO; + } + + /** + * 选择模板,根据业务选择模板,可能的业务有,毛发鉴定报告模板,NPS案件的鉴定报告模板 + * + * @param + * @return + */ + private String getIdentifyBookTemplate(EntrustInfo entrustInfo) { + String retTemplateName = ""; + int retBusiness = Integer.parseInt(entrustInfo.getBusinessType()); + switch (retBusiness) { + case 10001: + //NPS + retTemplateName = AppStartupRunner.getCfg("identifyBookTemplate-cg"); + break; + case 10002: + //毛发案件 + retTemplateName = AppStartupRunner.getCfg("identifyBookTemplate-cg"); + break; + case 30011: + retTemplateName = AppStartupRunner.getCfg("identifyBookTemplate"); + break; + case 60211: + retTemplateName = AppStartupRunner.getCfg("identifyBookTemplate-cg"); + break; + case 99900: + retTemplateName = AppStartupRunner.getCfg("identifyBookTemplate-cg"); + break; + } + log.info("获取到的模板是{}", retTemplateName); + return retTemplateName; + } + + /** + * 保存鉴定文书相关数据 + * + * @param identifyBookRelevanceId 关联ID + * @param path 文件路径及文件名 + * @param fileName 文件名 + * @param version 版本号 + * @return boolean + */ + private boolean saveIdentifyBookComm(String identifyBookRelevanceId, String path, String fileName, + String version, String remarks) { + IdentifyBook identifyBook = new IdentifyBook(); + identifyBook.setIdentifyBookRelevanceId(identifyBookRelevanceId); + //identifyBook.setBucketName(env.getProperty("oss.bucket-name")); + identifyBook.setBucketName("dlpfiles"); + identifyBook.setPath(path); + identifyBook.setFileName(fileName); + identifyBook.setVersion(version); + identifyBook.setRemarks(remarks); + return identifyBookService.save(identifyBook); + } + //构建实验信息 + + @Override + public IdentifyBook getMaxVersionIdentifyBook(String fkId) { + return baseMapper.getMaxVersionIdentifyBook(fkId); + } + + @Override + public Map> buildTestResultQualitativeVo(List resultEntrustmentQualitativeList) { + //排序 + Collections.sort(resultEntrustmentQualitativeList, new Comparator() { + @Override + public int compare(ResultEntrustmentQualitative o1, ResultEntrustmentQualitative o2) { + return o1.getMaterialIndex() - o2.getMaterialIndex(); + } + }); + //分组 + Map> groupMap = resultEntrustmentQualitativeList.stream().collect(Collectors.groupingBy(item -> { + return item.getSampleNo() + "_" + item.getResult();//1号检出了xxxx,1号未检出xxxx + })); + Map> testResultMap = new HashMap<>(); + groupMap.forEach((k, v) -> { + List resultAll = null; + String materialCnName = v.get(0).getMaterialIndex() + "号检材"; + String resultFlag = k.substring(k.lastIndexOf("_") + 1); + QualitativeTestResultVo egVo = new QualitativeTestResultVo(); + egVo.setMaterialZhNo(materialCnName); + if (!testResultMap.containsKey(materialCnName)) { + resultAll = new ArrayList<>(); + testResultMap.put(materialCnName, resultAll); + } else { + resultAll = testResultMap.get(materialCnName); + } + if (resultFlag.equals("false")) { + //等于0,说明未检出 + egVo.setDetectedStatus("0"); + List tmpList = new ArrayList<>(); + v.forEach(item -> { + tmpList.add(item.getCompound()); + }); + egVo.setNotDetectedCompoundList(tmpList); + } + if (resultFlag.equals("true")) { + egVo.setDetectedStatus("1"); + List tmpList = new ArrayList<>(); + v.forEach(item -> { + tmpList.add(item.getCompound()); + }); + egVo.setDetectedCompoundList(tmpList); + } + resultAll.add(egVo); + }); + return testResultMap; + } + + @Override + public List testResultRationDes(List resultEntrustmentRationList) { + //先分组 + Map> groupMap = resultEntrustmentRationList.stream().collect(Collectors.groupingBy(item -> { + return item.getSampleNo();//1号检出了xxxx,1号未检出xxxx + })); + List retList = new ArrayList<>(); + groupMap.forEach((k, v) -> { + StringBuffer detectedDes = new StringBuffer();//检出物质的含量描述 + List resultAll = null; + String materialCnName = v.get(0).getMaterialIndex() + "号检材"; + detectedDes.append(materialCnName); + v.forEach(item -> { + detectedDes.append(item.getCompound()).append("含量为").append(item.getResult() * 100).append("‰").append("、"); + }); + detectedDes.delete(detectedDes.length() - 1, detectedDes.length()); + retList.add(detectedDes.toString()); + }); + return retList; + } + + //定性结果翻译为鉴定文书中的文字 + @Override + public String qualitativeCodeToZhCn(List resultEntrustmentQualitativeList) { + //正文格式 + // 1号检材中未检出四氢大麻酚,检出合成大麻素类物质MDMB-4en-PINACA; + //2号检材中未检出四氢大麻酚,检出合成大麻素类物质MDMB-4en-PINACA。 + Map> mpData = buildTestResultQualitativeVo(resultEntrustmentQualitativeList); + StringBuffer retBuf = new StringBuffer(); + //List retDes=new ArrayList<>(); + StringBuffer retDes = new StringBuffer(); + mpData.forEach((k, v) -> { + //先给v排一个顺序 + Collections.sort(v, new Comparator() { + @Override + public int compare(QualitativeTestResultVo o1, QualitativeTestResultVo o2) { + int k1 = Integer.parseInt(o1.getDetectedStatus()); + int k2 = Integer.parseInt(o2.getDetectedStatus()); + return k1 - k2; + } + //排序过后顺序就是先说未检出,再说检出 + }); + v.forEach(item -> { + //因为上面排个序,所以我们先描述未检出的,然后才是检出的 + if (item.getDetectedStatus().equals("1")) { + retBuf.append(k).append("中检出"); + item.getDetectedCompoundList().forEach(compound -> { + retBuf.append(compound).append("、"); + }); + retBuf.delete(retBuf.length() - 1, retBuf.length()); + retBuf.append("。"); + } + + if (item.getDetectedStatus().equals("0")) { + retBuf.append(k).append("中未检出"); + item.getNotDetectedCompoundList().forEach(compound -> { + retBuf.append(compound).append("、"); + }); + retBuf.delete(retBuf.length() - 1, retBuf.length()); + + retBuf.append("。"); + } + //说完 + }); + retBuf.append("\n"); + //retDes.append(retBuf.toString()); + }); + return retBuf.toString(); + } + + //定量结果翻译为鉴定文书中的文字 + @Override + public String rationCodeToZhCn(List resultEntrustmentRationList) { + List retCode = testResultRationDes(resultEntrustmentRationList); + //正文格式:1号检材四氢大麻酚含量为5.00‰,2号检材四氢大麻酚含量为4.09‰。 + StringBuffer retBuf = new StringBuffer(); + retCode.forEach(item -> { + retBuf.append(item).append(","); + }); + retBuf.delete(retBuf.length() + 1, retBuf.length()); + retBuf.append("。"); + return retBuf.toString(); + } + + //获取其他附件的存储目录 + private void getAttachmentPath(String attachType, String businessId) { + String targetPath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + businessId + "/" + attachType + "/"; + switch (attachType) { + case "1": + targetPath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + businessId + "/" + attachType + "/"; + break; + case "2": { + targetPath = OSSDirectoryConstants.IDENTIFY_BOOK_DIRECTORY + "/" + businessId + "/" + attachType + "/"; + } + } + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ModifySupplementApplyServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ModifySupplementApplyServiceImpl.java new file mode 100644 index 0000000..1447dae --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ModifySupplementApplyServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.ModifySupplementApply; +import digital.laboratory.platform.identifybook.mapper.ModifySupplementApplyMapper; +import digital.laboratory.platform.identifybook.service.IModifySupplementApplyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 鉴定文书修改补充申请表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-22 + */ +@Service +public class ModifySupplementApplyServiceImpl extends ServiceImpl implements IModifySupplementApplyService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java new file mode 100644 index 0000000..6db75c4 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/PushDataToLabsCareServiceImpl.java @@ -0,0 +1,477 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import digital.laboratory.platform.common.core.constant.CommonConstants; +import digital.laboratory.platform.common.core.exception.CheckedException; +import digital.laboratory.platform.common.core.util.R; +import digital.laboratory.platform.common.oss.service.OssFile; +import digital.laboratory.platform.identifybook.config.ApiPathProperties; +import digital.laboratory.platform.identifybook.dto.EntrustmentDTO; +import digital.laboratory.platform.identifybook.emums.AnnexTypeEnum; +import digital.laboratory.platform.identifybook.emums.ReceiveWayEnum; +import digital.laboratory.platform.identifybook.entity.Entrustment; +import digital.laboratory.platform.identifybook.entity.IdentifyBookApprove; +import digital.laboratory.platform.identifybook.service.IEntrustmentService; +import digital.laboratory.platform.identifybook.service.IIdentifyBookApproveService; +import digital.laboratory.platform.identifybook.service.PushDataToLabsCareService; +import digital.laboratory.platform.inspetion.api.entity.EntrustInfo; +import digital.laboratory.platform.inspetion.api.entity.IdentificationBookDTO; +import digital.laboratory.platform.inspetion.api.entity.SampleInfo; +import digital.laboratory.platform.inspetion.api.enums.BusinessType; +import digital.laboratory.platform.inspetion.api.feign.RemoteTestToIdentifyService; +import digital.laboratory.platform.othersys.utils.HttpsUtils; +import digital.laboratory.platform.sys.feign.RemoteEntrustmentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.*; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestClientException; + +import javax.annotation.Resource; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @author ChenJiangBao + * @version 1.0 + * @description: 推送数据到labscare平台接口 + * @date 2025/3/31 9:31 + */ +@Slf4j +@Service +public class PushDataToLabsCareServiceImpl implements PushDataToLabsCareService { + + @Resource + private OssFile ossFile; + + @Resource + private IEntrustmentService entrustService; + + @Resource + private IIdentifyBookApproveService identifyBookApproveService; + + @Resource + private RemoteEntrustmentService remoteEntrustmentService; + + @Resource + private RemoteTestToIdentifyService remoteTestToIdentifyService; + + @Resource + private ApiPathProperties apiPathProperties; + + // "#NULL#" 作为空数据的占位符, 对于系统中没有的信息以占位符代替 + public final static String NULL_PLACEHOLDER = "#NULL#"; + + // 鉴定报告审批表标识 + private final static String APPRAISAL_REPORT_APPROVAL_FORM = "AppraisalReportApprovalForm"; + + // 定性报告标识 + private final static String QUALITATIVE_REPORT = "QualitativeReport"; + + // 归档报告信息标识 + private final static String ARCHIVE_REPORT_INFO = "ArchiveReportInfo"; + + /** + * 做一个定时推送,对于推送失败的委托进行重新推送, 每天凌晨3点推送 + */ +// @Scheduled(cron = "30 * * * * ?") // 测试 + @Scheduled(cron = "0 0 3 * * ?") // 每天凌晨 3 点执行 + public void timingPushDataToLabsCare() { + log.info("定时推送数据到LabsCare......"); + // 查询检验鉴定推送失败的委托 + List entrustList = entrustService.list( + Wrappers.lambdaQuery() + .and(wrapper -> wrapper + .eq(Entrustment::getPushFlag, "") + .or() + .isNull(Entrustment::getPushFlag) + .or() + .like(Entrustment::getPushFlag, "false") + ) + ); + if (CollUtil.isEmpty(entrustList)) { + return; + } + + for (Entrustment entrustment : entrustList) { + String pushFlag = entrustment.getPushFlag(); + if (StrUtil.isBlank(pushFlag)) { + pushAppraisalReportApprovalFormData(entrustment.getId()); + pushQualitativeReportData(entrustment.getId()); + } else { + List flagList = StrUtil.split(pushFlag, StrUtil.COMMA).stream().filter(str -> str.contains("false")).collect(Collectors.toList()); + for (String flag : flagList) { + if (flag.contains(APPRAISAL_REPORT_APPROVAL_FORM)) { + pushAppraisalReportApprovalFormData(entrustment.getId()); + } else { + pushQualitativeReportData(entrustment.getId()); + } + } + } + } + } + + /** + * 推送定性报告数据 + * @param entrustId 委托id + */ + @Override + public void pushQualitativeReportData(String entrustId) { + // 根据委托id获取鉴定审批信息 + EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId); + + // 构建jsonObject 参数 + JSONObject jsonObject = buildQualitativeReportJsonPayload(entrustmentDTO); + + String successFlag = QUALITATIVE_REPORT + ":true"; + String failureFlag = QUALITATIVE_REPORT + ":false"; + try { + ResponseEntity response = exchangeRemoteApi(jsonObject, apiPathProperties.getQualitativeReport()); + + if (response.getStatusCode().is2xxSuccessful() && response.getBody().contains("\"status\":200")) { + updatePushFlag(entrustmentDTO, QUALITATIVE_REPORT, successFlag); + log.info("推送定性报告数据成功, 受理编号: {}, 响应: {}", entrustmentDTO.getAcceptNo(), response.getBody()); + } else { + updatePushFlag(entrustmentDTO, QUALITATIVE_REPORT, failureFlag); + log.warn("推送定性报告数据失败, 受理编号: {}, 状态码: {}, 响应: {}", + entrustmentDTO.getAcceptNo(), response.getStatusCode(), response.getBody()); + } + } catch (RestClientException e) { + log.error("推送定性报告数据到 LabsCare 失败, 受理编号: {}", entrustmentDTO.getAcceptNo(), e); + } + } + + /** + * 推送鉴定报告审批表数据 + * @param entrustId 委托id + */ + @Override + public void pushAppraisalReportApprovalFormData(String entrustId) { + // 根据委托id获取鉴定审批信息 + IdentifyBookApprove identifyBookApprove = identifyBookApproveService.getOne(Wrappers.lambdaQuery() + .eq(IdentifyBookApprove::getRelevanceBusinessId, entrustId)); + EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId); + + // 构建jsonObject 参数 + JSONObject jsonObject = buildAppraisalReportApprovalFormJsonPayload(identifyBookApprove, entrustmentDTO); + + String successFlag = APPRAISAL_REPORT_APPROVAL_FORM + ":true"; + String failureFlag = APPRAISAL_REPORT_APPROVAL_FORM + ":false"; + try { + ResponseEntity response = exchangeRemoteApi(jsonObject, apiPathProperties.getAppraisalReportApprovalForm()); + + if (response.getStatusCode().is2xxSuccessful() && response.getBody().contains("\"status\":200")) { + updatePushFlag(entrustmentDTO, APPRAISAL_REPORT_APPROVAL_FORM, successFlag); + log.info("推送鉴定报告审批表报告数据成功, 受理编号: {}, 响应: {}", entrustmentDTO.getAcceptNo(), response.getBody()); + } else { + updatePushFlag(entrustmentDTO, APPRAISAL_REPORT_APPROVAL_FORM, failureFlag); + log.warn("推送鉴定报告审批表报告数据失败, 受理编号: {}, 状态码: {}, 响应: {}", + entrustmentDTO.getAcceptNo(), response.getStatusCode(), response.getBody()); + } + } catch (RestClientException e) { + log.error("推送鉴定报告审批表报告数据到 LabsCare 失败, 受理编号: {}", entrustmentDTO.getAcceptNo(), e); + } + } + + /** + * 推送归档报告信息数据 + * @param entrustId 委托id + */ + @Override + public void pushArchiveReportInfoData(String entrustId) { + + // 获取数据 + EntrustmentDTO entrustmentDTO = entrustService.getEntrustmentDTO(entrustId); + // 构建jsonObject 参数 + JSONObject jsonObject = buildArchiveReportInfoJsonPayload(entrustmentDTO); + + String successFlag = ARCHIVE_REPORT_INFO + ":true"; + String failureFlag = ARCHIVE_REPORT_INFO + ":false"; + try { + ResponseEntity response = exchangeRemoteApi(jsonObject, apiPathProperties.getAppraisalReportApprovalForm()); + + if (response.getStatusCode().is2xxSuccessful() && response.getBody().contains("\"status\":200")) { + updatePushFlag(entrustmentDTO, ARCHIVE_REPORT_INFO, successFlag); + log.info("推送归档报告信息数据成功, 受理编号: {}, 响应: {}", entrustmentDTO.getAcceptNo(), response.getBody()); + } else { + updatePushFlag(entrustmentDTO, ARCHIVE_REPORT_INFO, failureFlag); + log.warn("推送归档报告信息数据失败, 受理编号: {}, 状态码: {}, 响应: {}", + entrustmentDTO.getAcceptNo(), response.getStatusCode(), response.getBody()); + } + } catch (RestClientException e) { + log.error("推送归档报告信息数据到 LabsCare 失败, 受理编号: {}", entrustmentDTO.getAcceptNo(), e); + } + } + + /** + * 构建推送定性报告的json数据 + * + * @param entrustmentDTO 委托信息 + * @return + */ + private JSONObject buildQualitativeReportJsonPayload(EntrustmentDTO entrustmentDTO) { + //获取到制作文书的实验数据 + R identifyBookData= remoteTestToIdentifyService.getIdentifyBookDataByBusinessId(entrustmentDTO.getId()); + IdentificationBookDTO identificationBookDTO = identifyBookData.getData(); + // 对受理编号进行分隔 + EntrustInfo entrustInfo = identificationBookDTO.getEntrustInfo(); + List splitAcceptNo = StrUtil.split(entrustInfo.getAcceptNo(), "-"); + // 根据委托id获取鉴定审批信息 + IdentifyBookApprove identifyBookApprove = identifyBookApproveService.getOne(Wrappers.lambdaQuery() + .eq(IdentifyBookApprove::getRelevanceBusinessId, entrustmentDTO.getId())); + + // 创建 SimpleDateFormat + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + + // 封装推送定性报告数据 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("jcxz", buildMaterialCharacterDesc(identificationBookDTO.getSampleInfoList())); // 检材性状描述 + jsonObject.set("jiandingwenshuhao", String.format("[%s]%s号", splitAcceptNo.get(0), splitAcceptNo.get(1))); // 鉴定文书号 + jsonObject.set("jdyq", entrustInfo.getEntrustRequirement()); // 鉴定要求 + jsonObject.set("jyaq", entrustInfo.getCaseBrief()); // 简要案情 + jsonObject.set("jyy1qm", entrustmentDTO.getAppraisalUserName()); // 检测人 + jsonObject.set("jyyr2qm", entrustmentDTO.getAppraisalUserName()); // 检测人 + jsonObject.set("jyy1zc", NULL_PLACEHOLDER); // 检验人1专业技术资格或职称 + jsonObject.set("jyy2zc", NULL_PLACEHOLDER); // 检验人2专业技术资格或职称 + jsonObject.set("qfrq", sdf.format(identifyBookApprove.getApproveTime())); + jsonObject.set("qrcode", NULL_PLACEHOLDER); // 二维码地址 + jsonObject.set("sjr1List", CollUtil.newArrayList(entrustInfo.getDeliver1Name(), entrustInfo.getDeliver2Name())); // 送检人 + jsonObject.set("slrq", entrustInfo.getAcceptDate().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); + jsonObject.set("wtdw", entrustInfo.getEntrustDepartment()); // 委托单位 + jsonObject.set("zrqm", identifyBookApprove.getProcessUserName()); // 授权签字人 + jsonObject.set("zrzc", NULL_PLACEHOLDER); // 授权签字人专业技术资格或职称 + + // 定性检验报告样品 检测信息 + JSONObject inspectDataInfo = new JSONObject(); + inspectDataInfo.set("dxff", identificationBookDTO.getTestMethod()); + inspectDataInfo.set("jysj", identificationBookDTO.getTestStartDate()); + inspectDataInfo.set("outStr", identificationBookDTO.getTestResult()); + JSONArray gauging = new JSONArray(); + gauging.add(inspectDataInfo); + + // 定性检验报告样品信息 + JSONObject sampleJson = new JSONObject(); + sampleJson.put("gauging", gauging); + JSONArray sampleArrayJSON = new JSONArray(); + sampleArrayJSON.add(sampleJson); + + jsonObject.set("sample", sampleArrayJSON); + return jsonObject; + } + + /** + * 构建推送鉴定审批表的json数据 + * + * @param identifyBookApprove 鉴定文书审批表 + * @param entrustmentDTO 委托信息 + * @return + */ + private JSONObject buildAppraisalReportApprovalFormJsonPayload(IdentifyBookApprove identifyBookApprove, EntrustmentDTO entrustmentDTO) { + // 获取数据 + // 对受理编号进行分隔 + List splitAcceptNo = StrUtil.split(entrustmentDTO.getAcceptNo(), "-"); + // 创建 SimpleDateFormat + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + // 相关材料 + List annexTypeList = StrUtil.split(identifyBookApprove.getAnnexType(), ","); + String annexTypeStr = annexTypeList.stream().map(annexType -> AnnexTypeEnum.fromCode(annexType).getDesc()).collect(Collectors.joining(",")); + + // 封装json数据 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("bzyj", identifyBookApprove.getProcessMessage()); // 授权签字人意见 + jsonObject.set("bzysqqzr", identifyBookApprove.getProcessUserName()); // 授权签字人 + jsonObject.set("jdwsh", String.format("[%s]%s号", splitAcceptNo.get(0), splitAcceptNo.get(1))); // 鉴定文书号 + jsonObject.set("jwbgfws", ReceiveWayEnum.fromCode(entrustmentDTO.getReportReceiveMode()).getDesc() + ":" + identifyBookApprove.getInspectionReportNumber()); + jsonObject.set("jyy1qm", entrustmentDTO.getAppraisalUserName()); // 审批人 + jsonObject.set("qfrq", sdf.format(identifyBookApprove.getApproveTime())); // 格式化日期, 签发日期 + jsonObject.set("sjdw", entrustmentDTO.getClientOrgName()); // 送检单位 + jsonObject.set("sqqzrshrq", sdf.format(identifyBookApprove.getProcessTime())); // 授权人审核日期 + jsonObject.set("tjsprq", sdf.format(identifyBookApprove.getProcessTime())); // 提交审批时间 + jsonObject.set("xgjc", annexTypeStr); // 相关材料 + jsonObject.set("zrqfyj", identifyBookApprove.getApproveMessage()); // 实验室负责人意见 + jsonObject.set("zrqm", identifyBookApprove.getApproveUserName()); // 实验室负责人签字 + jsonObject.set("zzrdxm", NULL_PLACEHOLDER); // 是否资质认定项目 + return jsonObject; + } + + /** + * 构建推送归档报告信息报告的json数据 + * + * @return + */ + private JSONObject buildArchiveReportInfoJsonPayload(EntrustmentDTO entrustmentDTO) { + String entrustId = entrustmentDTO.getId(); + // 1 检验记录 + R inspectRecordR = remoteTestToIdentifyService.inspectRecord(entrustId); + if (inspectRecordR.getCode() == CommonConstants.FAIL) { + throw new CheckedException("检验记录数据获取失败!"); + } + JSONObject inspectRecordData = inspectRecordR.getData(); + + // 2 获取委托书数据 + R entrustLetterR = remoteEntrustmentService.entrustLetter(entrustmentDTO.getSynEntrustId()); + if (entrustLetterR.getCode() == CommonConstants.FAIL) { + throw new CheckedException("获取委托书数据失败!"); + } + JSONObject entrustLetterData = entrustLetterR.getData(); + + // 3 获取鉴定事项确认书数据 + R itemConfirmLetterR = remoteEntrustmentService.itemConfirmLetter(entrustmentDTO.getSynEntrustId()); + if (itemConfirmLetterR.getCode() == CommonConstants.FAIL) { + throw new CheckedException("获取委托书数据失败!"); + } + JSONObject itemConfirmLetterData = itemConfirmLetterR.getData(); + + // 根据委托id获取鉴定审批信息 + IdentifyBookApprove identifyBookApprove = identifyBookApproveService.getOne(Wrappers.lambdaQuery() + .eq(IdentifyBookApprove::getRelevanceBusinessId, entrustId)); + + // 封装推送归档报告信息 + JSONObject jsonObject = new JSONObject(); + if (entrustmentDTO.getBusinessType().equals(BusinessType.BOINT_CASE.getBusinessType())) { + jsonObject.set("shenWuJianCaiDingXingJiLuReportDto", inspectRecordData); + } else { + jsonObject.set("puTongJianCaiDingXingJiLuFeiReportDto", inspectRecordData); + } + jsonObject.set("jianDingWeiTuoShuReportDto", entrustLetterData); + jsonObject.set("jianDingShiXiangQueRenShuReportDto", itemConfirmLetterData); + jsonObject.set("jianDingShenPiReportDto", buildAppraisalReportApprovalFormJsonPayload(identifyBookApprove, entrustmentDTO)); + jsonObject.set("dingXingReportDto", buildQualitativeReportJsonPayload(entrustmentDTO)); + String path = "document/accept" + "/" + entrustId + "/materialPhoto/materialallpic.docx"; + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + + try { + ossFile.fileGet(path, outputStream); // 读取 .docx 文件 + String base64String = Base64.getEncoder().encodeToString(outputStream.toByteArray()); // 转 Base64 + jsonObject.set("jctp", base64String); // 存入 JSON + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + try { + outputStream.close(); // 释放资源 + } catch (IOException ignored) {} + } + return jsonObject; + } + + + /** + * 通过POST请求与远程API进行交互 + * + * @param jsonObject 包含请求数据的JSONObject对象 + * @param url 远程API的URL + * @return ResponseEntity 包含远程API响应数据的ResponseEntity对象 + */ + private ResponseEntity exchangeRemoteApi(JSONObject jsonObject, String url) { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); // 设置为 application/json + HttpEntity requestEntity = new HttpEntity<>(jsonObject, headers); + ResponseEntity response = HttpsUtils + .genRestTemplate() + .exchange( + url, + HttpMethod.POST, + requestEntity, + String.class + ); + return response; + } + + /** + * 更新推送标志 + * + * @param entrust 委托对象 + * @param pushType 推送类型 EntrustLetter 委托书 | ItemConfirmLetter 事项确认书 + * @param newFlag 新的推送标志 + */ + private void updatePushFlag(Entrustment entrust, String pushType, String newFlag) { + List flagList = Optional.ofNullable(StrUtil.split(entrust.getPushFlag(), StrUtil.COMMA)) + .orElse(new ArrayList<>()); + + // 判断是否已有 指定的推送类型,如果有就替换,否则添加 + boolean exists = flagList.stream().anyMatch(flag -> flag.contains(pushType)); + if (exists) { + flagList.replaceAll(flag -> flag.contains(pushType) ? newFlag : flag); + } else { + flagList.add(newFlag); + } + // 更新标识, 防止定时任务那里连续推送数据时推送标识更新出错 + entrust.setPushFlag(String.join(",", flagList)); + // 更新数据库 + entrustService.update(Wrappers.lambdaUpdate() + .eq(Entrustment::getId, entrust.getId()) + .set(Entrustment::getPushFlag, String.join(",", flagList))); + } + + public String buildMaterialCharacterDesc(List sampleInfoList) { + if (CollUtil.isEmpty(sampleInfoList)) { + return StrUtil.EMPTY; + } + + // 按尾号排序(提取编号尾号进行比较) + sampleInfoList.sort(Comparator.comparing(sample -> extractTailNumber(sample.getAcceptNo()))); + + List descriptions = new ArrayList<>(); + int start = -1, prev = -1; + String prevForm = null; + List mergedOrderNos = new ArrayList<>(); + + // 遍历排序后的检材编号,合并相邻且性状相同的编号 + for (SampleInfo sample : sampleInfoList) { + int current = extractTailNumber(sample.getAcceptNo()); // 提取尾号 + String form = sample.getForm(); + + if (start == -1) { // 初始化 + start = prev = current; + prevForm = form; + } else if (current == prev + 1 && form.equals(prevForm)) { + // 只有连续尾号 + 相同性状才能合并 + prev = current; + } else { + // 遇到新性状或不连续尾号,存储前一段描述 + mergedOrderNos.add(formatRange(start, prev) + "检材为" + prevForm); + start = prev = current; + prevForm = form; + } + } + // 处理最后一组数据 + mergedOrderNos.add(formatRange(start, prev) + "检材为" + prevForm); + + // **如果只有一个检材,省略编号** + if (mergedOrderNos.size() == 1 && sampleInfoList.size() == 1) { + return "检材为" + prevForm + "。"; + } + + return String.join(";", mergedOrderNos) + "。"; + } + + /** + * 生成编号范围的字符串 + * + * @param start 起始编号 + * @param end 结束编号 + * @return 生成的范围字符串,例如 "1号至3号" 或 "5号" + */ + private String formatRange(int start, int end) { + return (start == end) ? start + "号" : start + "号至" + end + "号"; + } + + /** + * 提取检材编号的尾号(即最后一个 `-` 之后的数值) + * + * @param orderNo 检材编号(格式:2025-89-13) + * @return 尾号(示例:返回 13) + */ + private int extractTailNumber(String orderNo) { + String[] parts = orderNo.split("-"); + return (parts.length > 0) ? Integer.parseInt(parts[parts.length - 1]) : 0; + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ReceiveIdentifyBookServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ReceiveIdentifyBookServiceImpl.java new file mode 100644 index 0000000..f500e6c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ReceiveIdentifyBookServiceImpl.java @@ -0,0 +1,26 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import digital.laboratory.platform.identifybook.dto.ReceiveIdentifyBookDTO; +import digital.laboratory.platform.identifybook.entity.ReceiveIdentifyBook; +import digital.laboratory.platform.identifybook.mapper.ReceiveIdentifyBookMapper; +import digital.laboratory.platform.identifybook.service.IReceiveIdentifyBookService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 领取鉴定文书信息表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@Service +public class ReceiveIdentifyBookServiceImpl extends ServiceImpl implements IReceiveIdentifyBookService { + + @Override + public IPage pageReceiveIdentifyBook(IPage page, String key) { + return baseMapper.pageReceiveIdentifyBook(page, key); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentQualitativeServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentQualitativeServiceImpl.java new file mode 100644 index 0000000..7636760 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentQualitativeServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentQualitative; +import digital.laboratory.platform.identifybook.mapper.ResultEntrustmentQualitativeMapper; +import digital.laboratory.platform.identifybook.service.IResultEntrustmentQualitativeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 委托定性分析检验结果 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Service +public class ResultEntrustmentQualitativeServiceImpl extends ServiceImpl implements IResultEntrustmentQualitativeService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentRationServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentRationServiceImpl.java new file mode 100644 index 0000000..25f43f9 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/ResultEntrustmentRationServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.ResultEntrustmentRation; +import digital.laboratory.platform.identifybook.mapper.ResultEntrustmentRationMapper; +import digital.laboratory.platform.identifybook.service.IResultEntrustmentRationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 委托定量检验结果 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-17 + */ +@Service +public class ResultEntrustmentRationServiceImpl extends ServiceImpl implements IResultEntrustmentRationService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/SampleServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/SampleServiceImpl.java new file mode 100644 index 0000000..2faf3e0 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/SampleServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.Sample; +import digital.laboratory.platform.identifybook.mapper.SampleMapper; +import digital.laboratory.platform.identifybook.service.ISampleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 检验用的样本 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class SampleServiceImpl extends ServiceImpl implements ISampleService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/TakerServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/TakerServiceImpl.java new file mode 100644 index 0000000..ce9218a --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/TakerServiceImpl.java @@ -0,0 +1,20 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import digital.laboratory.platform.identifybook.entity.Taker; +import digital.laboratory.platform.identifybook.mapper.TakerMapper; +import digital.laboratory.platform.identifybook.service.ITakerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 采集员 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-05-17 + */ +@Service +public class TakerServiceImpl extends ServiceImpl implements ITakerService { + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/service/impl/TaskNotificationServiceImpl.java b/src/main/java/digital/laboratory/platform/identifybook/service/impl/TaskNotificationServiceImpl.java new file mode 100644 index 0000000..73fcbcb --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/service/impl/TaskNotificationServiceImpl.java @@ -0,0 +1,64 @@ +package digital.laboratory.platform.identifybook.service.impl; + +import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import digital.laboratory.platform.common.mybatis.security.service.DLPUser; +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import digital.laboratory.platform.identifybook.mapper.TaskNotificationMapper; +import digital.laboratory.platform.identifybook.req.TaskNotificationREQ; +import digital.laboratory.platform.identifybook.service.ITaskNotificationService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import digital.laboratory.platform.identifybook.vo.TaskNotificationVO; +import org.springframework.stereotype.Service; + +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + *

+ * 任务信息表 服务实现类 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-31 + */ +@Service +public class TaskNotificationServiceImpl extends ServiceImpl implements ITaskNotificationService { + + /** + * 统计待处理任务数量 + * @param dlpUser 当前用户消息 + * @return + */ + @Override + public long countRWSum(DLPUser dlpUser) { + return this.count(new LambdaQueryWrapper() + .in(TaskNotification::getStatus, Stream.of(0).collect(Collectors.toList())) + .in(TaskNotification::getPermissionGroup, dlpUser.getPermissions())); + } + + /** + * 分页查询 + * + * @param req + * @param dlpUser + * @return + */ + @Override + public IPage queryTaskNotificationPage(TaskNotificationREQ req, DLPUser dlpUser) { + return baseMapper.queryTaskNotificationPage(req.getPage(), + new QueryWrapper() + .eq(req.getType() != null && req.getType() > 0, "tn.type", req.getType()) + .in(CollectionUtils.isNotEmpty(req.getStatusList()), "tn.status", req.getStatusList()) + .in("tn.permission_group", dlpUser.getPermissions()) + .and(StringUtils.isNotEmpty(req.getKey()), wrapper -> { + wrapper.like("tn.title", req.getKey()) + .or() + .like("tn.content", req.getKey()); + }) + .orderByDesc("tn.create_time")); + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/threadpool/GlobalThreadPool.java b/src/main/java/digital/laboratory/platform/identifybook/threadpool/GlobalThreadPool.java new file mode 100644 index 0000000..fd25057 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/threadpool/GlobalThreadPool.java @@ -0,0 +1,52 @@ +package digital.laboratory.platform.identifybook.threadpool; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.annotation.PreDestroy; +import java.util.concurrent.*; + +/** + * 定义全局线程池 + */ +@Slf4j +@Component +public class GlobalThreadPool { + + // 定义全局线程池,使用单列模式 + private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor( + 10, // 核心线程数 + 50, // 最大线程数 + 60L, TimeUnit.SECONDS, // 空闲线程存活时间 + new LinkedBlockingQueue(100), // 任务队列 + Executors.defaultThreadFactory(), // 线程工厂 + new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略 + ); + + // 私有化构造方法,防止外部实例化 + private GlobalThreadPool() {} + + // 获取全局线程池实列 + public static ExecutorService getInstance() { + return THREAD_POOL; + } + + // 关闭线程池 + public static void shutdown() { + THREAD_POOL.shutdown(); + } + + // 在应用关闭前执行 + @PreDestroy + public void destroy() { + log.info("Spring 应用关闭,正在关闭线程池..."); + shutdown(); + try { + if (!THREAD_POOL.awaitTermination(60, TimeUnit.SECONDS)) { + THREAD_POOL.shutdownNow(); + } + } catch (InterruptedException e) { + THREAD_POOL.shutdownNow(); + } + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/utils/BaseRequest.java b/src/main/java/digital/laboratory/platform/identifybook/utils/BaseRequest.java new file mode 100644 index 0000000..3cbd3b2 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/utils/BaseRequest.java @@ -0,0 +1,36 @@ +package digital.laboratory.platform.identifybook.utils; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 请求参数基础类、带分页参数 + * @param + */ +@Accessors(chain = true) +@Data +public class BaseRequest implements Serializable { + + private static final long serialVersionUID = -7988331651218446490L; + + @ApiModelProperty(value = "页码", required = true) + private long current; + + @ApiModelProperty(value = "每页显示多少条", required = true) + private long size; + + /** + * 封装分页对象 + * @return + */ + @ApiModelProperty(hidden = true) // 不在swagger接口文档中显示 + public IPage getPage() { + return new Page().setCurrent(this.current).setSize(this.size); + } + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/utils/Word2PdfAsposeUtil.java b/src/main/java/digital/laboratory/platform/identifybook/utils/Word2PdfAsposeUtil.java new file mode 100644 index 0000000..29def2f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/utils/Word2PdfAsposeUtil.java @@ -0,0 +1,106 @@ +package digital.laboratory.platform.identifybook.utils; + +import com.aspose.words.Document; +import com.aspose.words.License; +import com.aspose.words.SaveFormat; +import lombok.extern.slf4j.Slf4j; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +@Slf4j +public class Word2PdfAsposeUtil { + + + public static boolean getLicense() { + boolean result = false; + try { + //InputStream is = Test.class.getClassLoader().getResourceAsStream("\\license.xml"); // license.xml应放在..\WebRoot\WEB-INF\classes路径下 + InputStream is=Thread.currentThread().getContextClassLoader().getResourceAsStream("license.xml"); + License aposeLic = new License(); + aposeLic.setLicense(is); + result = true; + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + public static byte[] docx2pdf(String urlString) throws MalformedURLException { + InputStream inputStream = null; + try { + URL url = new URL(urlString); + URLConnection urlCon = url.openConnection(); + inputStream = urlCon.getInputStream(); + } catch (Exception e){ + return null; + } + + return docx2pdf(inputStream); + } + + public static byte[] docx2pdf(InputStream is) { + if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生 + return null; + } + ByteArrayOutputStream os = new ByteArrayOutputStream(); + byte[] bytes = null; + try { + long old = System.currentTimeMillis(); + Document doc = new Document(is); // Address是将要被转化的word文档 + doc.save(os, SaveFormat.PDF);// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF, + // EPUB, XPS, SWF 相互转换 + bytes = os.toByteArray(); + long now = System.currentTimeMillis(); + System.out.println("pdf转换成功,共耗时:" + ((now - old) / 1000.0) + "秒"); // 转化用时 + } catch (Exception e) { + e.printStackTrace(); + return null; + }finally { + if (os != null) { + try { + os.flush(); + os.close(); + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return bytes; + } + public static ByteArrayOutputStream getPdfByteArrayOutputStream(InputStream is) { + if (!getLicense()) { // 验证License 若不验证则转化出的pdf文档会有水印产生 + return null; + } + ByteArrayOutputStream os = new ByteArrayOutputStream(); + byte[] bytes = null; + try { + long old = System.currentTimeMillis(); + Document doc = new Document(is); // Address是将要被转化的word文档 + doc.save(os, SaveFormat.PDF);// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF, + // EPUB, XPS, SWF 相互转换 + bytes = os.toByteArray(); + long now = System.currentTimeMillis(); + System.out.println("pdf转换成功,共耗时:" + ((now - old) / 1000.0) + "秒"); // 转化用时 + } catch (Exception e) { + e.printStackTrace(); + return null; + }finally { + if (os != null) { + try { + os.flush(); + os.close(); + is.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return os; + } +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/BusinessProcessRecordVO.java b/src/main/java/digital/laboratory/platform/identifybook/vo/BusinessProcessRecordVO.java new file mode 100644 index 0000000..0dc6b4c --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/BusinessProcessRecordVO.java @@ -0,0 +1,55 @@ +package digital.laboratory.platform.identifybook.vo; + +import digital.laboratory.platform.identifybook.entity.ReceiveIdentifyBook; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Date; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/22 10:30 + */ + +@Data +@ApiModel(value = "BusinessProcessRecordVO对象", description = "封装业务流程相关属性") +public class BusinessProcessRecordVO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("鉴定文书修改/补充(提交/审核/审批)关联的id") + private String id; + + @ApiModelProperty(value = "业务ID", required = true) + private String businessId; + + @ApiModelProperty(value = "业务流程状态", required = true) + private String businessStatus; + + @ApiModelProperty(value = "审核审批意见") + private String message; + + @ApiModelProperty("审核审批表-参数对象") + private IdentifyBookApproveVO approveVO; + +// @ApiModelProperty("领取相关属性") +// private ReceiveIdentifyBookVO ReceiveIdentifyBookVO; +// 领取相关属性 + @ApiModelProperty(value = "领取方式") + private String receiveWay; + + @ApiModelProperty(value = "领取人ID") + private String recipientsUserId; + + @ApiModelProperty(value = "领取人姓名") + private String recipientsUserName; + + @ApiModelProperty(value = "领取人时间") + private LocalDateTime recipientsTime; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/ExperimentVO.java b/src/main/java/digital/laboratory/platform/identifybook/vo/ExperimentVO.java new file mode 100644 index 0000000..07892c8 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/ExperimentVO.java @@ -0,0 +1,15 @@ +package digital.laboratory.platform.identifybook.vo; + +import digital.laboratory.platform.identifybook.entity.Experiment; +import lombok.Data; + +@Data +public class ExperimentVO extends Experiment { + String opUserName; // 操作人员姓名 + String createUserName; // 创建人姓名 + String updateUserName; // 更新人姓名 + + String businessName; // 业务名称 +// List balanceList; // 根据 balanceIds 取得的天平列表 + +} \ No newline at end of file diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/IdentifyBookApproveVO.java b/src/main/java/digital/laboratory/platform/identifybook/vo/IdentifyBookApproveVO.java new file mode 100644 index 0000000..da19d4e --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/IdentifyBookApproveVO.java @@ -0,0 +1,37 @@ +package digital.laboratory.platform.identifybook.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023/5/25 20:03 + */ + +@Data +@ApiModel(value = "IdentifyBookApproveVO对象", description = "封装鉴定文书审批相关属性") +public class IdentifyBookApproveVO implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "附件类型集合(1:检验记录(含原始记录,检验图表)、2:鉴定事项确认书、3:鉴定委托书或鉴定聘请书、4:检材照片、5:送检人证件复印件、6:原鉴定文书) 注:选择多个示例(1,2,...)其中”,“是英文") + private String annexType; + + @ApiModelProperty(value = "文书类型:(1:检验报告,2:其它) 注:选择多个示例(1,2)其中”,“是英文") + private String bookType; + + @ApiModelProperty(value = "检验报告数量(单位: 份)") + private Integer inspectionReportNumber; + + @ApiModelProperty(value = "其它数量(单位:份)") + private Integer otherNumber; + + @ApiModelProperty(value = "是否合格(1:检验方法、2:检验过程、3:检验图谱、4:检验结果) 注:选择多个示例(1,2,...)其中”,“是英文") + private String isQualified; +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/QualitativeTestResultVo.java b/src/main/java/digital/laboratory/platform/identifybook/vo/QualitativeTestResultVo.java new file mode 100644 index 0000000..dc62c53 --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/QualitativeTestResultVo.java @@ -0,0 +1,13 @@ +package digital.laboratory.platform.identifybook.vo; + +import lombok.Data; + +import java.util.List; + +@Data +public class QualitativeTestResultVo { + private String materialZhNo; + private String detectedStatus;//是检出还是未检出的数据 + private List detectedCompoundList;//检出的化合物 + private List notDetectedCompoundList;//未检出的化合物 +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/ReceiveIdentifyBookVO.java b/src/main/java/digital/laboratory/platform/identifybook/vo/ReceiveIdentifyBookVO.java new file mode 100644 index 0000000..31b549f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/ReceiveIdentifyBookVO.java @@ -0,0 +1,41 @@ +package digital.laboratory.platform.identifybook.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; +import java.util.Date; + +/** + *

+ * 领取鉴定文书相关信息 + *

+ * + * @author 旌霖科技-www.jinglin.com + * @since 2023-08-30 + */ +@Data +@ApiModel(value="ReceiveIdentifyBookVO对象", description="领取鉴定文书相关信息") +public class ReceiveIdentifyBookVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "领取方式") + private String receiveWay; + + @ApiModelProperty(value = "领取人ID") + private String recipientsUserId; + + @ApiModelProperty(value = "领取人姓名") + private String recipientsUserName; + + @ApiModelProperty(value = "领取人时间") + private Date recipientsTime; + + +} diff --git a/src/main/java/digital/laboratory/platform/identifybook/vo/TaskNotificationVO.java b/src/main/java/digital/laboratory/platform/identifybook/vo/TaskNotificationVO.java new file mode 100644 index 0000000..60b158f --- /dev/null +++ b/src/main/java/digital/laboratory/platform/identifybook/vo/TaskNotificationVO.java @@ -0,0 +1,21 @@ +package digital.laboratory.platform.identifybook.vo; + +import digital.laboratory.platform.identifybook.entity.TaskNotification; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("任务信息表VO类") +public class TaskNotificationVO extends TaskNotification { + + @ApiModelProperty("业务类型") + private String businessType; + + @ApiModelProperty(value="原始系统中的委托ID") + private String synEntrustId; + + @ApiModelProperty(value = "鉴定文书业务状态(-1:待制作,0:已制作/重新制作,1:鉴定文书-提交审核,2:鉴定文书-审核通过),-2:鉴定文书-审核未通过,3:鉴定文书-审核退回修改,4:鉴定文书-审批签发成功,-4:鉴定文书-审批拒绝签发,5:鉴定文书-审批签发退回修改") + private Integer bookStatus; + +} diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt new file mode 100644 index 0000000..fb94131 --- /dev/null +++ b/src/main/resources/banner.txt @@ -0,0 +1,25 @@ +${AnsiColor.BRIGHT_GREEN} + + # # ## # ## ## ## # ## ## # # ## # ## + ## ## ###### # ## # ### ## ## ## # ## # # ######### ######## ## ## + ## ## ## ## ############## # # ## # # ###### ###### ######## ## ## #### # ## # # + ## #### ### ### ## ############# ########### ## ## # ## ## ## ## ## ### ## ########## + ## ##### # # # # ## ## ## # # # ## ## ## ######## ## # # # ## # + # ## ## # # ## ## ## ############## ## ## ## ## ## ### # ## ## # + ## ## ########### # ## ## ## ### # # ## ######## ## ## ####### ##### ## ## + ########## ## # ## ## ## # # ######### ## ######## # ## ## ## ########## + ## ## #### # ## # ## ## ############### ## ## ## # ## # ## ## ## ## ## # + ## ## # ## ###### ### ## ## ####### ## ## ############# ##### ## ## + ########## ## ## ### ## ## ## # ## ######## # # ## # # ## ## + # ## # #### ## ## ## ## ## ######### #### ## ## #### # ## ## + ## ## ## ## #### ## ## ## ## ## ## #### ## ## ## ### ## ## ## # + #### ## ## #### ## ### ## ### ## ## # ## # ## ## ### #### ## ## # + # ### # # ######## ## #### ## # ######## ########## ## #### # # ## ##### + ############# # ##### ## # ## # # # # #### + +鉴定文书管理系统(dlp-identifyBook) + +版本: ${version} +创建: ${timestamp} + +${AnsiColor.DEFAULT} \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..a4e7a01 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,72 @@ +logging: + level: + digital.laboratory.platform.camera.mapper: debug +server: + port: 5230 + +mybatis: + mapper-locations: classpath*:mapper/*.xml + +spring: + application: + name: @artifactId@ + cloud: + nacos: + discovery: + server-addr: ${NACOS_HOST:dlp-nacos}:${NACOS_PORT:8848} + config: + server-addr: ${spring.cloud.nacos.discovery.server-addr} + file-extension: yml + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + profiles: + active: @profiles.active@ + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: dlp + password: 7990016 + url: jdbc:mysql://dlp-mysql:3306/dlp_identify_book?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + + servlet: + multipart: + # 根据实际需求作调整 + # 默认最大上传文件大小为1M, 单个文件大小 + max-file-size: 20MB + # 默认最大请求大小为10M, 总上传的数据大小 + max-request-size: 55MB + +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +# 文件上传相关 支持阿里云、华为云、腾讯、minio +oss: + endpoint: http://dlp-minio:9000 + accessKey: dlp + secretKey: 87990016 + bucket-name: dlpfiles + +config: + activemq: + brokerUrl: tcp://192.168.5.106:61616 + user: admin + password: admin + #true:topic模式,false:queue模式 + pub-sub-domain: true + msgListener: + hardwareTopicName: hardware + +# 贵阳禁毒情报平台推送数据配置 +gyjd: + labscare: + api: + host: http://lc2203.cdn.labscare.com + entrust-letter: /thirdparty/report-generate/jianDingWeiTuoShuReport/v1 + confirm-letter: /thirdparty/report-generate/jianDingShiXiangQueRenShuReport/v1 + biology-qualitative-record: /thirdparty/report-generate/shenWuJianCaiDingXingJiLuReport/v1 + non-infrared-general-qualitative-record: /thirdparty/report-generate/puTongJianCaiDingXingJiLuFeiReport/v1 + infrared-general-qualitative-record: /thirdparty/report-generate/puTongJianCaiDingXingJiLuReport/v1 + appraisal-report-approval-form: /thirdparty/report-generate/jianDingShenPiReport/v1 + qualitative-report: /thirdparty/report-generate/dingXingReport/v1 + archive-report-info: /thirdparty/report-generate/guiDangBaoGaoReport/v1 diff --git a/src/main/resources/license.xml b/src/main/resources/license.xml new file mode 100644 index 0000000..a9d36f8 --- /dev/null +++ b/src/main/resources/license.xml @@ -0,0 +1,14 @@ + + + + + Aspose.Total for Java + Aspose.Words for Java + + Enterprise + 20991231 + 20991231 + 8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7 + + sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU= + diff --git a/src/main/resources/mapper/BIdentificationProcessMapper.xml b/src/main/resources/mapper/BIdentificationProcessMapper.xml new file mode 100644 index 0000000..0f62600 --- /dev/null +++ b/src/main/resources/mapper/BIdentificationProcessMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/BusinessProcessRecordMapper.xml b/src/main/resources/mapper/BusinessProcessRecordMapper.xml new file mode 100644 index 0000000..3c4da26 --- /dev/null +++ b/src/main/resources/mapper/BusinessProcessRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/CaseEventMapper.xml b/src/main/resources/mapper/CaseEventMapper.xml new file mode 100644 index 0000000..3f6f5b1 --- /dev/null +++ b/src/main/resources/mapper/CaseEventMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/CaseEvidenceMapper.xml b/src/main/resources/mapper/CaseEvidenceMapper.xml new file mode 100644 index 0000000..6bd7b0d --- /dev/null +++ b/src/main/resources/mapper/CaseEvidenceMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/DelivererMapper.xml b/src/main/resources/mapper/DelivererMapper.xml new file mode 100644 index 0000000..50639f1 --- /dev/null +++ b/src/main/resources/mapper/DelivererMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/EntrustmentBundleMapper.xml b/src/main/resources/mapper/EntrustmentBundleMapper.xml new file mode 100644 index 0000000..cdd0a87 --- /dev/null +++ b/src/main/resources/mapper/EntrustmentBundleMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/EntrustmentIdentificationMaterialMapper.xml b/src/main/resources/mapper/EntrustmentIdentificationMaterialMapper.xml new file mode 100644 index 0000000..f54ac29 --- /dev/null +++ b/src/main/resources/mapper/EntrustmentIdentificationMaterialMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/EntrustmentMapper.xml b/src/main/resources/mapper/EntrustmentMapper.xml new file mode 100644 index 0000000..9b87514 --- /dev/null +++ b/src/main/resources/mapper/EntrustmentMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + e.*, + ibr.year, + ibr.serial_number, + ibr.book_status + FROM b_entrustment e + LEFT JOIN b_identify_book_relevance ibr ON ibr.relevance_business_id = e.id + + + SELECT + e.id, + e.entrustment_no, + e.process_instance_id, + e.identification_id, + e.client_org_name, + e.identification_domain, + e.identification_org_name, + e.entrust_requirement, + e.other_identification_requests, + e.is_client_specified_method, + e.client_specified_method, + e.other_identification_notes, + e.deliverer1_name, + e.deliverer1_position, + e.deliverer1_cert, + e.deliverer1_id, + e.deliverer1_phone, + e.deliverer2_name, + e.deliverer2_position, + e.deliverer2_cert, + e.deliverer2_id, + e.deliverer2_phone, + e.business_type, + e.syn_entrust_id, + bi.identification_no, + e.accept_no, + e.accept_user, + e.accept_time, + e.accept_comments, + c.case_no, + e.case_name, + c.third_party_sys_no, + c.happen_time, + c.case_address, + c.case_own_org_id, + e.case_brief + FROM b_entrustment e + LEFT JOIN b_identification bi ON bi.id = e.identification_id + LEFT JOIN b_case_event c ON c.id = e.case_id + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/ExaminationMethodsMapper.xml b/src/main/resources/mapper/ExaminationMethodsMapper.xml new file mode 100644 index 0000000..37deae5 --- /dev/null +++ b/src/main/resources/mapper/ExaminationMethodsMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/ExperimentMapper.xml b/src/main/resources/mapper/ExperimentMapper.xml new file mode 100644 index 0000000..ae45ba7 --- /dev/null +++ b/src/main/resources/mapper/ExperimentMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/HairJobIdentificationMaterialMapper.xml b/src/main/resources/mapper/HairJobIdentificationMaterialMapper.xml new file mode 100644 index 0000000..dfdf2fd --- /dev/null +++ b/src/main/resources/mapper/HairJobIdentificationMaterialMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/HairJobMapper.xml b/src/main/resources/mapper/HairJobMapper.xml new file mode 100644 index 0000000..74c5d91 --- /dev/null +++ b/src/main/resources/mapper/HairJobMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/IdentificationMapper.xml b/src/main/resources/mapper/IdentificationMapper.xml new file mode 100644 index 0000000..3dfe92b --- /dev/null +++ b/src/main/resources/mapper/IdentificationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/IdentifyBookApproveMapper.xml b/src/main/resources/mapper/IdentifyBookApproveMapper.xml new file mode 100644 index 0000000..ef69a6a --- /dev/null +++ b/src/main/resources/mapper/IdentifyBookApproveMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/IdentifyBookMapper.xml b/src/main/resources/mapper/IdentifyBookMapper.xml new file mode 100644 index 0000000..040048f --- /dev/null +++ b/src/main/resources/mapper/IdentifyBookMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/src/main/resources/mapper/IdentifyBookRelevanceMapper.xml b/src/main/resources/mapper/IdentifyBookRelevanceMapper.xml new file mode 100644 index 0000000..0046ff1 --- /dev/null +++ b/src/main/resources/mapper/IdentifyBookRelevanceMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/ModifySupplementApplyMapper.xml b/src/main/resources/mapper/ModifySupplementApplyMapper.xml new file mode 100644 index 0000000..cab3314 --- /dev/null +++ b/src/main/resources/mapper/ModifySupplementApplyMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/ReceiveIdentifyBookMapper.xml b/src/main/resources/mapper/ReceiveIdentifyBookMapper.xml new file mode 100644 index 0000000..c8565e9 --- /dev/null +++ b/src/main/resources/mapper/ReceiveIdentifyBookMapper.xml @@ -0,0 +1,36 @@ + + + + + + diff --git a/src/main/resources/mapper/ResultEntrustmentQualitativeMapper.xml b/src/main/resources/mapper/ResultEntrustmentQualitativeMapper.xml new file mode 100644 index 0000000..4f727e1 --- /dev/null +++ b/src/main/resources/mapper/ResultEntrustmentQualitativeMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/ResultEntrustmentRationMapper.xml b/src/main/resources/mapper/ResultEntrustmentRationMapper.xml new file mode 100644 index 0000000..f280627 --- /dev/null +++ b/src/main/resources/mapper/ResultEntrustmentRationMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/SampleMapper.xml b/src/main/resources/mapper/SampleMapper.xml new file mode 100644 index 0000000..83955d5 --- /dev/null +++ b/src/main/resources/mapper/SampleMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/TakerMapper.xml b/src/main/resources/mapper/TakerMapper.xml new file mode 100644 index 0000000..da5d72f --- /dev/null +++ b/src/main/resources/mapper/TakerMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/main/resources/mapper/TaskNotificationMapper.xml b/src/main/resources/mapper/TaskNotificationMapper.xml new file mode 100644 index 0000000..f30a455 --- /dev/null +++ b/src/main/resources/mapper/TaskNotificationMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + SELECT + tn.id, + tn.title, + tn.type, + tn.business_id, + tn.submitter_user_id, + tn.submitter_user_name, + tn.submitter_time, + tn.accept_no, + tn.case_name, + tn.content, + tn.transaction_personnel_id, + tn.transaction_personnel_name, + tn.permission_group, + tn.create_time, + tn.create_by, + tn.update_time, + tn.update_by, + tn.status as status, + e.business_type, + e.syn_entrust_id, + ibr.book_status + FROM `b_task_notification` tn + LEFT JOIN b_entrustment e ON tn.business_id = e.id + LEFT JOIN b_identify_book_relevance ibr ON ibr.relevance_business_id = e.id + + + diff --git a/template/NADL-Shaanxi-CX-22-01-2021鉴定文书审批表001.docx b/template/NADL-Shaanxi-CX-22-01-2021鉴定文书审批表001.docx new file mode 100644 index 0000000..0efb234 --- /dev/null +++ b/template/NADL-Shaanxi-CX-22-01-2021鉴定文书审批表001.docx @@ -0,0 +1,58 @@ + 鉴定文书审批表 + 编号:( ${year} )第 ${serialNumber} 号 + 鉴定文书编号 + 国毒陕鉴字〔 ${bookYear} 〕 ${bookSerialNumber} 号 + 受理编号 + ${acceptNo} + 检材情况 + 缴获物样本 ${sampleNum} 份 + 受理日期 + ${acceptTime} + 鉴定项目 +${identificationDomain} + 委托单位 +${clientOrgName} + 文书数量 +${?inspectionReportFlag}☑️${/}${?inspectionReportFlag==false}☐${/} 检验报告 (${inspectionReportNumber}) 份 ${?otherFlag}☑️${/}${?otherFlag==false}☐${/} 其它: (${otherNumber}) 份 + 附件 +${?jyJlFlag}☑️${/}${?jyJlFlag==false}☐${/}1.检验记录(含原始记录、检验图表) +${?jdSxQrsFlag}☑️${/}${?jdSxQrsFlag==false}☐${/}2.鉴定事项确认书 +${?jdWtsFlag}☑️${/}${?jdWtsFlag==false}☐${/}3.鉴定委托书或鉴定聘请书 +${?jcZpFlag}☑️${/}${?jcZpFlag==false}☐${/}4.检材照片 +${?sjrZjFyjFlag}☑️${/}${?sjrZjFyjFlag==false}☐${/}5.送检人证件复印件 +${?yJdWsFlag}☑️${/}${?yJdWsFlag==false}☐${/}6.原鉴定文书 + 鉴定人签名 + + + + + + + 年 月 日 + + + + + + + 年 月 日 + 授权签字人 + 审核意见 +是否合格:${?jyFfFlag}☑️${/}${?jyFfFlag==false}☐${/}1.检验方法 ${?jyGcFlag}☑️${/}${?jyGcFlag==false}☐${/}2.检验过程 ${?jyTpFlag}☑️${/}${?jyTpFlag==false}☐${/}3.检验谱图 ${?jyJgFlag}☑️${/}${?jyJgFlag==false}☐${/}4.检验结果 + + ${processMessage} + + + + ${processTime} + 最高管理者 + 审批意见 + ${approveMessage} + + + + + ${approveTime} + 备 注 +${remarks} + diff --git a/template/NADL-Shaanxi-CX-22-02-2021鉴定文书修改补充申请表001.docx b/template/NADL-Shaanxi-CX-22-02-2021鉴定文书修改补充申请表001.docx new file mode 100644 index 0000000..0d8f933 --- /dev/null +++ b/template/NADL-Shaanxi-CX-22-02-2021鉴定文书修改补充申请表001.docx @@ -0,0 +1,44 @@ + 鉴定文书修改/补充申请表 + 编号:( ${year} )第 ${serialNumber} 号 + 委托单位 +${clientOrgName} + (签章) + 鉴定文书编号 + 国毒陕鉴字〔 ${bookYear} 〕 ${bookSerialNumber} 号 + 委托人 + ${entrustUserName} + 申请日期 + ${applyTime} + 修改人 + ${updateUserName} + 修改日期 + ${updateTime} + 修改原因 +${updateReason} + 修改内容 +${updateContent} + + + 委托人签名: 年 月 日 + 修改方式 + +${?xgCdWjFlag}☑️${/}${?xgCdWjFlag==false}☐${/} 修改存档文件 ${?shYjCxCjJdWsFlag}☑️${/}${?shYjCxCjJdWsFlag==false}☐${/} 收回原件,重新出具鉴定文书 + + + 修改人签名: 年 月 日 + 授权签字人意见 +${empowerBySignOpinion} + + + + 签名: ${empowerBySignDate} + 技术负责人意见 +${technologyBySignOpinion} + + + + + 签名 : ${technologyBySignDate} + 备 注 +${remarks} + diff --git a/template/NADL-Shaanxi-CX-22-03-2021国家毒品实验室检验鉴定报告文号和格式模板001.docx b/template/NADL-Shaanxi-CX-22-03-2021国家毒品实验室检验鉴定报告文号和格式模板001.docx new file mode 100644 index 0000000..119e14a --- /dev/null +++ b/template/NADL-Shaanxi-CX-22-03-2021国家毒品实验室检验鉴定报告文号和格式模板001.docx @@ -0,0 +1,110 @@ +PK +N@ docProps/PKN@rasdocProps/app.xmlMo0  N~Qm 3P[$5hMn|I>hki>iFV2}n4 QV2=bH֡CBie,fT6TY?H{4W ?"̝x{ mȰˈi;'(؃a-D6<v +*DuũQ.yuA`QP"`d5!vo5~orncqRꦚT`\ b$>3zY^}ϋ_uVT7um"e].5E6%{xJ/PKN@BXt tdocProps/core.xml}J0Pr&i]B *{R(B26)Iug9Lm]Q9&docProps/custom.xmlj0E#v_PhiF%INJ +iZ]w8sf&];rm%3<.cʮ8qMjx!MN+ ;pњ%Ң{~`Rl\ZH +!UŸp[_bg;۞& ;txhYUQIc ?Y$bHA&߁7 d+O0v;hWb $p7 0;L6}1I¦AaG.I%szYQQ <PK +N@word/PKN@5&l jlword/styles.xml]o@=,قׁc#vȥY#'@}y77Ùه# %Gar9xsIG4}?{:ɋHE$RsŤnLe8%E8 =;)1lUY\˘&@h:$_i^JҠRS'Qyߪ ؊eA19$1 JaCPe;`]]. +3i[y@lY8H& P;'˼`))H%oZY?Qj׼wZ7y2aE#̀tNQy>O3:!EC0+,&`qCI^N*%I~ +GQtDZLj2/gcIcW]M +'RfQXG099`X|Bg'؅sk + +bJy]mhBղl[#_*yZ16/g_P_YSG7zCKMaj9d.oCaӜQal0m1-bˢeHESƢiqhk?c#a aakZ,NNԴ/ m,a$[??????ΏaD1U5—;f=nK4D71m +h]aDƐ-f( fHvonԉ} +lbI>o a7Vw _ \ƥitq;&GB!H]3n{.PVo/anB>V]G>B~;mcSؿؔO/z86epѣ $ o'dM&_H f=QL("X{ɬ}fC}:sm_Τ3L}:qOn +)e +k:6C4Y70IXE1yGGX, yc dMX kY7Ț@v1Bs2qCU'o,*:y#O\ F_;:baeMX kY7Ț@#o,X&n8NX =T@uFٓI7&ycQLё7 CX,kY7Ț@&o$ycALPF2qCU'o,*:y#[a`Ƣ$o,;:baeMX kY7Ț@#o,X&n8NX =T@uFٓfuE19IXwt7˚@&o,5yc dGX ycLPqj@&z-h]qF7G*`x%Jp0?!Y +,n|! g Gbzhy\u-sOt25񫴥)w+~ip3vE`1<='% f:KbpK֨'.M,V MIqCYeQ")f τFK"¢`)g20D輐 B~ +80\> L6`2#WRo[9SeAÎ\Cf-2I-)4{X$>w%hW"3H6KY8ʜ} ͹ T{ $~p.ɬvQ^ϳjz;ة_wUN݄/*Aoݶp\SeJ*GO0".a2c٣ak7 Q?~!~dJ|QJ:(5+{v0x:9ufH +Up>`L *F~_e𕛲Tp7j (~ț;6 vt2jEpF? 6ꢪTZj,~o}ۯˑ OGyJ{|)3+Iσ:?2忌(^V~AHQNB|qN<HDTIä{g7X o12]Xyڹ͢o7O_޼6 5(ܪeMi,'?|͇/u?Url  +Ej ^[JSwZrϾ:ǣQPVWxBR +̿Ⱥ@:!6QsWOyEdͪ]Ud=PݭWY|כĩZ;aNVe_'q:\HPKN@<word/settings.xmlYKs8ogؓ줒%c>T eE$EKwS3'Qheq|ń"3W-U^_Lno`rִYʊrk&~׶9U3+unfi\2k^We_?-3ݜ/r"/v?eAL}1jvq^K_7]۱껻|?#+zN[/^ԻlfoQZwQKN<ŸoGK;jz+u _/]@bpI =z:vhySґirV.gUEQ1y Qnq~ `39vhuηje3zcZ>x .;<$W藮ړĕ˶E{-m vP竷UMq3%7r͗϶*GVy)Q=*JO??öZ۾|uj p|1Qm +< D΁]Kk~aVdAU}lwOU7m}]R|@/kl `>[߯ +T}}o?(qIִQgU]q[f0qi> +p5r8W#Xʸ t#p!DT(ҨBZ֟(J?QBMC)1jxfXpFp%Xr?ƕ +pOy$Z $&` +QJ ,I9\AP$B3'& $8e +EQ[f[Yգ"ъV"H,h͈@(4nAID:q6'QfF- 40x 2DfA9Xf!juPYcʼn +ŵ!2$!f D<_wKKu1)0M Px-$ƫ)Rh~1bJ)E#҄b'M84Vi*(ZQH@QeXSPcbE\QJXN Jb 9H1#& +]Ɓ,XkBpA(5&S +eHʩHhR$PBD4N#.#$?hEtXj∄X-!ЩxR!^yXa4d!qc,bq&Ey I$9Nx(0"8R̄phIƷ,RcxV mNaBS)pnH7.tD*. 2X @c4B0ʍ=$hMxn"FEjTsJې;O)JJC`G0&;`wrdMȘ1fXcwrZRDZ:(&"H܄f`G 7IY8B%N'4dÎ<*幧pR1*1#uxݼ,*L(Z' ⩊ۡ2 FSQ@"P$ )ÕFFЫy,HQ + GNg {8jI) /f[H̟ hf7' ]4@aY@EP+" UD&k4w9t@9C9&͍adr쪛W9[8FԝRHrU0>!pG1MZX}hCHH:0` 0߼}kNya:O̳,(SAآ.(Xَq !4U  h!P=+|LΠk8rSc A/do,(_ ^sq8M~-"bVٸ.Q3Y+-_mnEX;qRYDǾLޑp 9 %1Ĥ^iNי)n~`zn2 w97C["%V:WPfO׬+f% rhqJX*F@ɉs&,JFxK=B9\7Lʙ2Mb>ϖ!Cy`XM DO=}ɨ;9;S1BYܙrS86&͘y_D + b"} <3ыɳݷ_w//nl`t]Ӟ0]uH>%ÝяWs'S5VE ++Bfkw[G_ǨUO===Ry+wћ?Gßޖ.=t3-|XPKN@ word/header2.xmlVMkA eƦK7T +"BL&١3$k{AObgJfo{ȡ!?i#Ġ8jٻo# r $D12p]M"`NQBib4bPC% TkH|5*&CP 6-M:Kl؀ZˆM +BP䄊P #$U4ZM@bTR^&bĥ_*FJUzp +pc%q^uWE *Wd`+f~v|/Hئ,#%&#vA-5y iZߋmD p4mR /.BNB1 +bЖ+NwlAP-iO=aL48D͌tq_l:U^+koӑg<lͲSl!Мf/f'_N>۾IG vl(oeQQ?)?J.жfg/di[ izPKN@L–j word/footer1.xmlW]o6}/ ݖũ#. +g- +E$?i[D$m5yju耢/M; 0`hGTN򴿰KIt^$"=\++a`0>%MөڦG>7͵ճiHহyщSۓ܀D@JZ8DdգE{=VDyתَ<1N=,j#2B2e@!Jy +]Ӕiw$+3Q|/0T?݊?ownu|z~y5~a>۾8vmh,6)U$\:Wp`;~qjJ? &R,BA&B'ݡ 霶Z;荪ws%c쪅 B]hVUȐ +.%MN$:ӡS€T:!whwLS`Y c颞X&(s=X7 jeեi#>^΅>ew| Fh ] mǗK"u3~Ց'IO!pbkKbe…^@DfqjQnàP"!7Wv#y!7rzpɮXA 1GU,Y l*t_D[ǛƏу?w{עGފ~ڰ:>3ml&64(۽_$,R9cND1"ݼfYK8IGg69W+|= +)I5HVtwg֫O`]{nٹ˝a~ro!XJXjXv|\ +ĮlG 4f2:eVksulݧOn{(HV9>|bWJ%Vɕ*Z$X`EJT˞2»֤E_ΊZ9#qsRP@PK +N@ word/theme/PKN@Z,word/theme/theme1.xmlYKo7X콕d["Gje].HʎnAr* +(94@KE Р=ԅ4r)Q>Edof>p!WW=Lw ,m˾Ӏ$ZA+'$JCDY[ \E[2 >[Rf[`YS7b&cC~>AiFHEqBߜ"]l-qOX1Hx#N,ctqgnXF4rwCW6J*w'(qlآyTXzc}B3FһO]D)F{$L]Vnyf6 DZi&%.P3H.)L\WHt)!es|@ _βib#$c}Ęq;FIIO(n30 QP-=rwACMJL1oJGk;!i*א4 =KatKU}_  Q:奞WW2+. +( +XT]Pil:3x:YhEI-z*\4WEk v@SS)hf L?;|M2X;BgEX y_DY2.d8O\ "1(IZ~Qj * ,&ʻFnF8fٍ> +]m~qd(w?!;XQQ W<EʓMYHZ$ iLQ@~' +//.׷Ɍpr9E "$J7mq6ypp4> /O08)sRH[-y5s:萏U_#Ll혐d0vL]ԎlhGazn[^./y08xʼ$oyrB(ʂrTI}ceg i-!g $Kf,4^p<5Am^ ̬@X2^쀩nݭ-e~s\5ţTFCsGv6hd_/$M{N- ʜw̆k'\i&!. 2K!4-?gdôpG9 w`Sjw$(|TIe_\G `b̞{AmZ=pρ,lb Wh6> Jp(B^Rd6IFQL70rAz63<֧k#VZnu_noA%zCmS@ ɻOG +ܾԥ2pq ;AA`hBt%.fB:alf &@SU{th,9eّ7TJtrBpY|l׮q% YeHi+)ٴ{}l.9}> A;ż]K!U\%[Xw +ap }޷HG9O v|Xs%mQGҽ`0/{AH%M|^y;{`t?8UN^27'vDZިq'6P;pJƃ VIP-(3 ʵ7ZR )48waj[LC y.)Tߘ3_^=6!5((WITA0 I7l: +uu[q ޙFXXc3?ɷӫ{RνƸ(MH(PLُg&>pB87,F^rm16n Z.M^A:.MPN^]>`ܿAj(s ~52l>w=>Asyqe^Yu:(jzhWn2(,oOE挲A$~dvMat5df;=M{ cvo;ǹ@W1X|_MsYɄ +Fa6 Wf;ȸqzϯ.2PC X[k @VԵw+`[qڝbsgMuQ-׺(;y&a?go@7^Ħt1 ͉n =ɀbx-+DG,>u4sG J{-"G[2װ? ]C-X1ߧwowN0b{=L2ڙi9j/x%C +gr^+O' M,0;B.߄6/)Y/-\׏u +\+h^62JA@m8}D(V BWd SΖ8!,3$q>K~PD WVnn>u&[nߨ|Z.\޻Ux箠[,JqagGͺ 5Vs*׶֪+[ 7j+lظϛ{p#P[܁khƢ,q]}:mb>׬PD֚Hn٣ғy3gTLަ4yG(N"S8A +<y"!΁q}^ '+Ǡ-w=m4JP}Lio""Iw9CY.ip<{JpSDc-Mv}z-`a3`Y Pu[Q9&Fay,⩄Lbr߸~3o>5p 'FVÁ5 +jb+/z;TɢSΔ2 eIu% Ҳ ~Ё +MR;iP0?0)jmu;59wX),LöZ5=96w Ϝ"fhn&/*\oAQjxľh܁#sr{< -5m@}ӫӱj&κ iG/g|}|N/i7`;]_p_ +to%Y*,%PK +N@ +customXml/PKN@pW"customXml/item1.xmlK +0Ec;p ~i-:$O #ɳ +:ùܪݬ!/Q{WSSQA;D6,_H8Pݤ;7ƤQ+-J&lKUP],eMgĥd,_n +L1LWZ yj*;ܼPKN@WcustomXml/itemProps1.xml]NM0/?wOc[ZZez +&)XZJf۞a>a&vǙFg%l0HxE O$GӡW^w3<1੕ڶi4i͓4nx' 4,M; ,lPCBQv7lt7 ŠbE{0of_e!,PKN@v]word/fontTable.xmlWAo60toDru؋^zR82EK=ۀ^z)s^"͟i_쑔lG +ma~"wJDur4ňŇ]V4TJDLUΝ=ȄU]gIuU8-n$D>Mn'$eCv4r,bDAEFm  +bY.x͊*WTkЈ>P +F i}nTcpKY_%@ k'L*5o?& $JA`z ; cJuZvdre@koΏ_}|埀 ?=G߷%Q +hpKWig*,-QHwneD]=lT4!czgM~ɧ>x J=(ڍ{xI^^rי& qV U{@챠hCua+.Vpڶ\z3lx'.)fN+:M]02S +' LgJQPK +N@_rels/PKN@"" _rels/.relsJ1!}7*"loDH}! L}{r2g|szstxm +U Naq "3zCD62{(.>+㝔Y0W!/6$\ɈzU]ikANl;tr(Θ:b!i> rfu>JG1ے7Pay,]1<h|T}i ,iO!z1*XiuY8>!,-ع S|';7PKN@_֙[Content_Types].xml;o0J׊"017`/ +7dW`|`&[@Lڻ.Isy`YB0AVhx{3]* 1*ޜSs(f )&on_>Jc11g侕?#&9& kdocProps/custom.xmlPK +N@word/PK +N@ jKword/_rels/PKN@W?78 Kword/_rels/document.xml.relsPKN@|x *.word/document.xmlPKN@v] Dword/fontTable.xmlPKN@L–j  word/footer1.xmlPKN@R  #word/footer2.xmlPKN@ )ٙ Gword/header1.xmlPKN@  word/header2.xmlPKN@rT @  n?word/numbering.xmlPKN@< ~word/settings.xmlPKN@5&l jl word/styles.xmlPK +N@ 'word/theme/PKN@Z, 'word/theme/theme1.xmlPKQN \ No newline at end of file