This commit is contained in:
2026-07-20 11:48:06 +08:00
parent 7119dc76a9
commit f379291e4f
409 changed files with 150227 additions and 8557 deletions

View File

@@ -0,0 +1,11 @@
{
"permissions": {
"allow": [
"Read(//Users/liangxin/Project/**)"
],
"additionalDirectories": [
"/Users/liangxin/Project/Html/web/tuanwei-admin/src/api/ai/knowledgeBase",
"/Users/liangxin/Project/Html/web/tuanwei-admin/src/views/ai"
]
}
}

0
.codex_write_test Normal file
View File

0
mvnw vendored Normal file → Executable file
View File

46
pom.xml
View File

@@ -126,6 +126,11 @@
<artifactId>hutool-crypto</artifactId>
<version>5.8.11</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
<!-- easy poi -->
<dependency>
@@ -169,13 +174,6 @@
<version>2.1.0</version>
</dependency>
<!-- open office, 用于文档转pdf实现在线预览 -->
<dependency>
<groupId>com.github.livesense</groupId>
<artifactId>jodconverter-core</artifactId>
<version>1.0.5</version>
</dependency>
<!-- spring-boot-mail -->
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -259,10 +257,9 @@
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<scope>compile</scope>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<!--微信小程序-->
@@ -275,7 +272,32 @@
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.12</version>
<version>0.2.17</version>
</dependency>
<dependency>
<groupId>com.alibaba.nls</groupId>
<artifactId>nls-sdk-tts</artifactId>
<version>2.2.19</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>3.7.1</version>
</dependency>
</dependencies>

View File

@@ -0,0 +1,25 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'member_records'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN member_records LONGTEXT NULL COMMENT ''团员记录(JSON字符串)'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'growth_archives'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN growth_archives LONGTEXT NULL COMMENT ''成长档案(JSON字符串)'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,97 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'funding_budget_file'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN funding_budget_file VARCHAR(500) NULL COMMENT ''经费预算表'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'funding_allocation_file'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN funding_allocation_file VARCHAR(500) NULL COMMENT ''经费划拨明细表'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'midterm_remark'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN midterm_remark TEXT NULL COMMENT ''中期检查说明'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'midterm_materials'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN midterm_materials LONGTEXT NULL COMMENT ''中期检查材料(JSON字符串)'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'final_remark'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN final_remark TEXT NULL COMMENT ''结题说明'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'final_materials'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN final_materials LONGTEXT NULL COMMENT ''结题材料(JSON字符串)'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'archive_awards'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN archive_awards TEXT NULL COMMENT ''获奖情况'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'archive_proofs'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN archive_proofs LONGTEXT NULL COMMENT ''佐证材料(JSON字符串)'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,169 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_qmgc_form' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_qmgc_form ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_sjqn' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_sjqn ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_sjtbzbsj' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_sjtbzbsj ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tzbcy_form' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_tzbcy_form ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wshqtw' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wshqtw ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wshqtzb' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wshqtzb ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_applicant' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_applicant ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_budget' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_budget ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_guidance_teacher' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_guidance_teacher ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_review_member' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_review_member ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_yxgqtdgb' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_yxgqtdgb ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_yxgqty' AND COLUMN_NAME = 'year'
),
'SELECT 1',
'ALTER TABLE gxmu_yxgqty ADD COLUMN year INT NULL COMMENT ''年度'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,46 @@
CREATE TABLE IF NOT EXISTS `gxmu_tzb_project_list` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`source_id` BIGINT NOT NULL COMMENT '挑战杯详情ID',
`project_name` VARCHAR(512) NOT NULL COMMENT '项目名称',
`school_name` VARCHAR(255) DEFAULT NULL COMMENT '高校名称',
`award_name` VARCHAR(128) DEFAULT NULL COMMENT '获奖情况',
`match_year` INT DEFAULT NULL COMMENT '参赛年份',
`match_term` VARCHAR(128) DEFAULT NULL COMMENT '参赛届次',
`match_level` VARCHAR(64) DEFAULT NULL COMMENT '比赛级别',
`cover_image` VARCHAR(1024) DEFAULT NULL COMMENT '封面图',
`detail_url` VARCHAR(1024) NOT NULL COMMENT '详情链接',
`source_url` VARCHAR(1024) DEFAULT NULL COMMENT '来源列表页',
`page_no` INT DEFAULT NULL COMMENT '来源页码',
`last_sync_time` DATETIME DEFAULT NULL COMMENT '最近同步时间',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT NOT NULL DEFAULT 0 COMMENT '删除标记0未删 1已删',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_gxmu_tzb_project_source_id` (`source_id`),
KEY `idx_gxmu_tzb_project_match_year` (`match_year`),
KEY `idx_gxmu_tzb_project_school_name` (`school_name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='挑战杯项目库列表';
CREATE TABLE IF NOT EXISTS `gxmu_tzb_talent_list` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`source_id` BIGINT NOT NULL COMMENT '挑战杯详情ID',
`person_name` VARCHAR(128) NOT NULL COMMENT '姓名',
`school_name` VARCHAR(255) DEFAULT NULL COMMENT '参赛学校',
`talent_type` VARCHAR(128) DEFAULT NULL COMMENT '人才类型',
`project_name` VARCHAR(512) DEFAULT NULL COMMENT '参赛项目',
`award_name` VARCHAR(128) DEFAULT NULL COMMENT '获奖情况',
`match_term` VARCHAR(128) DEFAULT NULL COMMENT '参赛届次',
`match_level` VARCHAR(64) DEFAULT NULL COMMENT '比赛级别',
`cover_image` VARCHAR(1024) DEFAULT NULL COMMENT '头像/封面图',
`detail_url` VARCHAR(1024) NOT NULL COMMENT '详情链接',
`source_url` VARCHAR(1024) DEFAULT NULL COMMENT '来源列表页',
`page_no` INT DEFAULT NULL COMMENT '来源页码',
`last_sync_time` DATETIME DEFAULT NULL COMMENT '最近同步时间',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT NOT NULL DEFAULT 0 COMMENT '删除标记0未删 1已删',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_gxmu_tzb_talent_source_id` (`source_id`),
KEY `idx_gxmu_tzb_talent_person_name` (`person_name`),
KEY `idx_gxmu_tzb_talent_school_name` (`school_name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='挑战杯人才库列表';

View File

@@ -0,0 +1,25 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'project_type'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN project_type VARCHAR(100) NULL COMMENT ''挑战杯项目类型'' AFTER module'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'project_group'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN project_group VARCHAR(255) NULL COMMENT ''挑战杯项目分组'' AFTER project_type'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,51 @@
SET @db = DATABASE();
SET @table = 'gxmu_work_ledger';
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_secretary_name'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_secretary_name VARCHAR(100) NULL COMMENT ''团支部书记姓名'' AFTER smart_league_entry_rate');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_secretary_phone'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_secretary_phone VARCHAR(50) NULL COMMENT ''团支部书记手机号'' AFTER branch_secretary_name');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'total_people_count'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN total_people_count VARCHAR(50) NULL COMMENT ''总人数'' AFTER branch_secretary_phone');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'party_member_count'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN party_member_count VARCHAR(50) NULL COMMENT ''党员数'' AFTER total_people_count');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'youth_count'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN youth_count VARCHAR(50) NULL COMMENT ''青年数'' AFTER party_member_count');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'league_youth_ratio'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN league_youth_ratio VARCHAR(100) NULL COMMENT ''团青比例'' AFTER youth_count');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_annual_summary'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_annual_summary LONGTEXT NULL COMMENT ''团支部年度工作总结'' AFTER league_youth_ratio');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'standard_level'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN standard_level VARCHAR(100) NULL COMMENT ''对标定级等次'' AFTER branch_annual_summary');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_committee_members'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_committee_members LONGTEXT NULL COMMENT ''团支部班子成员名单(JSON)'' AFTER branch_annual_summary');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'league_member_registers'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN league_member_registers LONGTEXT NULL COMMENT ''团员登记(JSON)'' AFTER branch_committee_members');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'youth_registers'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN youth_registers LONGTEXT NULL COMMENT ''青年登记(JSON)'' AFTER league_member_registers');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_honor_records'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_honor_records LONGTEXT NULL COMMENT ''团支部荣誉登记(JSON)'' AFTER youth_registers');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'member_fee_records'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN member_fee_records LONGTEXT NULL COMMENT ''团员团费收缴登记(JSON)'' AFTER branch_honor_records');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_meeting_records'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_meeting_records LONGTEXT NULL COMMENT ''团支部会议记录(JSON)'' AFTER member_fee_records');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_activity_records'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_activity_records LONGTEXT NULL COMMENT ''团支部活动记录(JSON)'' AFTER branch_meeting_records');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql = IF(EXISTS(SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = @db AND TABLE_NAME = @table AND COLUMN_NAME = 'branch_education_evaluations'), 'SELECT 1', 'ALTER TABLE gxmu_work_ledger ADD COLUMN branch_education_evaluations LONGTEXT NULL COMMENT ''团支部教育评议结果(JSON)'' AFTER branch_activity_records');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,85 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'college'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN college VARCHAR(255) NULL COMMENT ''学院'' AFTER nation'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'class_name'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN class_name VARCHAR(255) NULL COMMENT ''班级'' AFTER college'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'politics'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN politics VARCHAR(100) NULL COMMENT ''政治面貌'' AFTER class_name'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'branch_organization_id'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN branch_organization_id INT NULL COMMENT ''所属团支部ID'' AFTER league_position'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'branch_organization_name'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN branch_organization_name VARCHAR(255) NULL COMMENT ''所属团支部'' AFTER branch_organization_id'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'id_card_no'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN id_card_no VARCHAR(32) NULL COMMENT ''身份证号'' AFTER branch_organization_name'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tygl_form' AND COLUMN_NAME = 'birth_date'
),
'SELECT 1',
'ALTER TABLE gxmu_tygl_form ADD COLUMN birth_date VARCHAR(20) NULL COMMENT ''出生日期'' AFTER id_card_no'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,13 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_wxxzx_project' AND COLUMN_NAME = 'promise_signature'
),
'SELECT 1',
'ALTER TABLE gxmu_wxxzx_project ADD COLUMN promise_signature LONGTEXT NULL COMMENT ''承诺书签名图片(base64)'' AFTER promise_signer'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,56 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.TABLES
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_work_ledger'
),
'SELECT 1',
'CREATE TABLE gxmu_work_ledger (
id INT AUTO_INCREMENT PRIMARY KEY COMMENT ''主键ID'',
ledger_type VARCHAR(50) NOT NULL COMMENT ''台账类型'',
unit_name VARCHAR(255) NULL COMMENT ''单位'',
responsible_person VARCHAR(100) NULL COMMENT ''负责人'',
use_start_month VARCHAR(20) NULL COMMENT ''使用开始月份'',
use_end_month VARCHAR(20) NULL COMMENT ''使用结束月份'',
secretary_name VARCHAR(100) NULL COMMENT ''团委书记姓名'',
branch_count VARCHAR(50) NULL COMMENT ''所辖团(总)支部数'',
member_total VARCHAR(50) NULL COMMENT ''团员总数'',
faculty_member_count VARCHAR(50) NULL COMMENT ''教职工团员数'',
student_member_count VARCHAR(50) NULL COMMENT ''学生团员数'',
minority_member_count VARCHAR(50) NULL COMMENT ''少数民族团员数'',
female_member_count VARCHAR(50) NULL COMMENT ''女团员数'',
youth14_to_28_count VARCHAR(50) NULL COMMENT ''14-28岁青年数'',
youth29_to_35_count VARCHAR(50) NULL COMMENT ''29-35岁青年数'',
cadre_total VARCHAR(50) NULL COMMENT ''团干总数'',
faculty_cadre_count VARCHAR(50) NULL COMMENT ''职工团干数'',
student_cadre_count VARCHAR(50) NULL COMMENT ''学生团干数'',
last_election_time VARCHAR(50) NULL COMMENT ''最近一次换届时间'',
fee_balance VARCHAR(50) NULL COMMENT ''团费余额'',
first_half_fee_due VARCHAR(50) NULL COMMENT ''上半年应缴团费'',
first_half_fee_paid VARCHAR(50) NULL COMMENT ''上半年实缴团费'',
second_half_fee_due VARCHAR(50) NULL COMMENT ''下半年应缴团费'',
second_half_fee_paid VARCHAR(50) NULL COMMENT ''下半年实缴团费'',
school_society_connection_rate VARCHAR(100) NULL COMMENT ''学社衔接率'',
smart_league_entry_rate VARCHAR(100) NULL COMMENT ''智慧团建录入率'',
annual_summary LONGTEXT NULL COMMENT ''年度工作总结'',
committee_members LONGTEXT NULL COMMENT ''团委班子成员名单(JSON)'',
fee_records LONGTEXT NULL COMMENT ''团费收支记录(JSON)'',
subordinate_orgs LONGTEXT NULL COMMENT ''下属团组织情况(JSON)'',
honor_records LONGTEXT NULL COMMENT ''荣誉登记(JSON)'',
activist_recommendations LONGTEXT NULL COMMENT ''推荐入党积极分子(JSON)'',
discipline_records LONGTEXT NULL COMMENT ''团员团纪处理记录(JSON)'',
meeting_records LONGTEXT NULL COMMENT ''团委会议记录(JSON)'',
activity_records LONGTEXT NULL COMMENT ''团委活动记录(JSON)'',
education_evaluations LONGTEXT NULL COMMENT ''年度团员教育评议结果(JSON)'',
year INT NULL COMMENT ''年度'',
user_id INT NULL COMMENT ''用户ID'',
deleted INT DEFAULT 0 COMMENT ''是否删除'',
tenant_id INT NULL COMMENT ''租户ID'',
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT ''创建时间'',
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ''更新时间''
) COMMENT=''基层团组织工作台账'''
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

View File

@@ -0,0 +1,17 @@
CREATE TABLE IF NOT EXISTS gxmu_wxxzx_archive_record (
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
project_id INT NOT NULL COMMENT '未来学术之星项目ID',
archive_order INT NULL COMMENT '排序号',
award_name VARCHAR(255) NULL COMMENT '获奖名称',
award_time VARCHAR(30) NULL COMMENT '获奖时间',
remark TEXT NULL COMMENT '备注说明',
proof_file VARCHAR(500) NULL COMMENT '上传凭证',
year INT NULL COMMENT '年度',
user_id BIGINT NULL COMMENT '用户ID',
tenant_id BIGINT NULL COMMENT '租户ID',
deleted INT DEFAULT 0 COMMENT '删除标记0未删 1已删',
create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
INDEX idx_wxxzx_archive_project_id (project_id),
INDEX idx_wxxzx_archive_year (year)
) COMMENT='未来学术之星成果归档记录';

View File

@@ -0,0 +1,52 @@
-- 学院管理、班级管理建表脚本
-- 班级绑定在学院下
DROP TABLE IF EXISTS `gxmu_class`;
DROP TABLE IF EXISTS `gxmu_college`;
CREATE TABLE `gxmu_college` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`college_code` VARCHAR(64) NOT NULL COMMENT '学院编码',
`college_name` VARCHAR(100) NOT NULL COMMENT '学院名称',
`short_name` VARCHAR(100) DEFAULT NULL COMMENT '学院简称',
`leader_name` VARCHAR(50) DEFAULT NULL COMMENT '负责人',
`leader_phone` VARCHAR(30) DEFAULT NULL COMMENT '负责人电话',
`sort_number` INT DEFAULT 0 COMMENT '排序号',
`status` TINYINT DEFAULT 1 COMMENT '状态1启用 0停用',
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
`tenant_id` INT DEFAULT NULL COMMENT '租户ID',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT DEFAULT 0 COMMENT '删除标记0未删 1已删',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_gxmu_college_code_tenant` (`college_code`, `tenant_id`),
UNIQUE KEY `uk_gxmu_college_name_tenant` (`college_name`, `tenant_id`),
KEY `idx_gxmu_college_status` (`status`),
KEY `idx_gxmu_college_sort` (`sort_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='学院管理表';
CREATE TABLE `gxmu_class` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`college_id` INT NOT NULL COMMENT '学院ID',
`class_code` VARCHAR(64) NOT NULL COMMENT '班级编码',
`class_name` VARCHAR(100) NOT NULL COMMENT '班级名称',
`grade_year` INT DEFAULT NULL COMMENT '年级',
`counselor_name` VARCHAR(50) DEFAULT NULL COMMENT '辅导员姓名',
`counselor_phone` VARCHAR(30) DEFAULT NULL COMMENT '辅导员电话',
`student_count` INT DEFAULT 0 COMMENT '学生人数',
`sort_number` INT DEFAULT 0 COMMENT '排序号',
`status` TINYINT DEFAULT 1 COMMENT '状态1启用 0停用',
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
`tenant_id` INT DEFAULT NULL COMMENT '租户ID',
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT DEFAULT 0 COMMENT '删除标记0未删 1已删',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_gxmu_class_code_tenant` (`class_code`, `tenant_id`),
UNIQUE KEY `uk_gxmu_class_name_college_tenant` (`college_id`, `class_name`, `tenant_id`),
KEY `idx_gxmu_class_college_id` (`college_id`),
KEY `idx_gxmu_class_status` (`status`),
KEY `idx_gxmu_class_grade_year` (`grade_year`),
CONSTRAINT `fk_gxmu_class_college_id`
FOREIGN KEY (`college_id`) REFERENCES `gxmu_college` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='班级管理表';

View File

@@ -0,0 +1,86 @@
SET @db = DATABASE();
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'form_project_type'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN form_project_type TEXT NULL COMMENT ''挑战杯项目申报表项目类型(JSON数组字符串)'' AFTER project_group'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'form_project_group'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN form_project_group TEXT NULL COMMENT ''挑战杯项目申报表项目分组(JSON数组字符串)'' AFTER form_project_type'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'public_project_type'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN public_project_type TEXT NULL COMMENT ''挑战杯公开展示信息表项目类型(JSON数组字符串)'' AFTER form_project_group'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_declare' AND COLUMN_NAME = 'public_project_group'
),
'SELECT 1',
'ALTER TABLE gxmu_declare ADD COLUMN public_project_group TEXT NULL COMMENT ''挑战杯公开展示信息表项目分组(JSON数组字符串)'' AFTER public_project_type'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
UPDATE gxmu_declare
SET
form_project_type = COALESCE(form_project_type, project_type),
form_project_group = COALESCE(form_project_group, project_group),
public_project_type = COALESCE(public_project_type, project_type),
public_project_group = COALESCE(public_project_group, project_group)
WHERE module = 'gxmu_tzbcy_form';
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tzbcy_form' AND COLUMN_NAME = 'public_project_type'
),
'SELECT 1',
'ALTER TABLE gxmu_tzbcy_form ADD COLUMN public_project_type VARCHAR(64) NULL COMMENT ''公开展示项目类型'' AFTER project_group'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET @sql = IF(
EXISTS(
SELECT 1 FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'gxmu_tzbcy_form' AND COLUMN_NAME = 'public_project_group'
),
'SELECT 1',
'ALTER TABLE gxmu_tzbcy_form ADD COLUMN public_project_group VARCHAR(128) NULL COMMENT ''公开展示项目分组'' AFTER public_project_type'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
UPDATE gxmu_tzbcy_form
SET
public_project_type = COALESCE(public_project_type, project_type),
public_project_group = COALESCE(public_project_group, project_group);

View File

@@ -0,0 +1,26 @@
CREATE TABLE IF NOT EXISTS `gxmu_cross_school_activity_article` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`source_key` VARCHAR(64) NOT NULL COMMENT '来源唯一键',
`title` VARCHAR(512) NOT NULL COMMENT '文章标题',
`school_name` VARCHAR(128) NOT NULL COMMENT '高校名称',
`category` VARCHAR(64) DEFAULT NULL COMMENT '活动类型',
`heat_level` VARCHAR(32) DEFAULT NULL COMMENT '热度等级',
`source_name` VARCHAR(128) DEFAULT NULL COMMENT '来源名称',
`publish_time` DATETIME DEFAULT NULL COMMENT '发布时间',
`summary` VARCHAR(1024) DEFAULT NULL COMMENT '摘要',
`tags` VARCHAR(512) DEFAULT NULL COMMENT '标签JSON',
`cover_image` VARCHAR(1024) DEFAULT NULL COMMENT '封面图',
`detail_url` VARCHAR(1024) NOT NULL COMMENT '详情链接',
`source_url` VARCHAR(1024) DEFAULT NULL COMMENT '来源列表页',
`highlight` VARCHAR(255) DEFAULT NULL COMMENT '可借鉴动作',
`content_text` TEXT COMMENT '正文文本',
`last_sync_time` DATETIME DEFAULT NULL COMMENT '最近同步时间',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` TINYINT NOT NULL DEFAULT 0 COMMENT '删除标记0未删 1已删',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_gxmu_cross_school_activity_source_key` (`source_key`),
KEY `idx_gxmu_cross_school_activity_publish_time` (`publish_time`),
KEY `idx_gxmu_cross_school_activity_school_name` (`school_name`),
KEY `idx_gxmu_cross_school_activity_category` (`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='跨校活动情报文章';

View File

@@ -0,0 +1,27 @@
CREATE TABLE IF NOT EXISTS `gxmu_tzbcy_material` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`form_id` INT NOT NULL COMMENT '挑战杯申报ID',
`material_type` VARCHAR(128) NOT NULL COMMENT '材料类型',
`file_id` INT DEFAULT NULL COMMENT '文件记录ID',
`file_name` VARCHAR(255) DEFAULT NULL COMMENT '文件名称',
`file_path` VARCHAR(1024) DEFAULT NULL COMMENT '文件路径',
`file_url` VARCHAR(1024) DEFAULT NULL COMMENT '文件访问地址',
`download_url` VARCHAR(1024) DEFAULT NULL COMMENT '文件下载地址',
`file_size` BIGINT DEFAULT NULL COMMENT '文件大小',
`content_type` VARCHAR(255) DEFAULT NULL COMMENT '文件类型',
`status` TINYINT NOT NULL DEFAULT 0 COMMENT '审核状态0待审核 1通过 2驳回',
`reject_reason` VARCHAR(500) DEFAULT NULL COMMENT '驳回原因',
`audit_user_id` INT DEFAULT NULL COMMENT '审核人ID',
`audit_time` DATETIME DEFAULT NULL COMMENT '审核时间',
`user_id` INT DEFAULT NULL COMMENT '用户ID',
`deleted` TINYINT NOT NULL DEFAULT 0 COMMENT '删除标记0未删 1已删',
`tenant_id` INT DEFAULT NULL COMMENT '租户ID',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_tzbcy_material_form_id` (`form_id`),
KEY `idx_tzbcy_material_type` (`material_type`),
KEY `idx_tzbcy_material_status` (`status`),
KEY `idx_tzbcy_material_user_id` (`user_id`),
KEY `idx_tzbcy_material_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='挑战杯申报材料';

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.config;
package com.gxwebsoft.ai.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -1,11 +1,10 @@
package com.gxwebsoft.law.config;
package com.gxwebsoft.ai.config;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import javax.websocket.*;
import javax.websocket.OnClose;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
@@ -66,8 +65,10 @@ public class WebSocketServer {
* 实现服务器主动推送
*/
public void sendMessage(String userId, String message) throws IOException {
System.out.println("userId:" + userId);
if (webSocketMap.containsKey(userId)) {
Session session1 = webSocketMap.get(userId).session;
System.out.println("session1:" + session1);
if (session1 != null) session1.getBasicRemote().sendText(message);
}
}

View File

@@ -0,0 +1,115 @@
package com.gxwebsoft.ai.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.ai.service.AiChatHistoryService;
import com.gxwebsoft.ai.entity.AiChatHistory;
import com.gxwebsoft.ai.param.AiChatHistoryParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 控制器
*
* @author LX
* @since 2026-03-28 17:34:18
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/ai/ai-chat-history")
public class AiChatHistoryController extends BaseController {
@Resource
private AiChatHistoryService aiChatHistoryService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<AiChatHistory>> page(AiChatHistoryParam param) {
// 使用关联查询
return success(aiChatHistoryService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<AiChatHistory>> list(AiChatHistoryParam param) {
// 使用关联查询
return success(aiChatHistoryService.listRel(param));
}
@PreAuthorize("hasAuthority('ai:aiChatHistory:list')")
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<AiChatHistory> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(aiChatHistoryService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody AiChatHistory aiChatHistory) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
aiChatHistory.setUserId(loginUser.getUserId());
}
if (aiChatHistoryService.save(aiChatHistory)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody AiChatHistory aiChatHistory) {
if (aiChatHistoryService.updateById(aiChatHistory)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (aiChatHistoryService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<AiChatHistory> list) {
if (aiChatHistoryService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<AiChatHistory> batchParam) {
if (batchParam.update(aiChatHistoryService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (aiChatHistoryService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,9 +1,9 @@
package com.gxwebsoft.law.controller;
package com.gxwebsoft.ai.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawOrgPeopleService;
import com.gxwebsoft.law.entity.LawOrgPeople;
import com.gxwebsoft.law.param.LawOrgPeopleParam;
import com.gxwebsoft.ai.service.AiChatListService;
import com.gxwebsoft.ai.entity.AiChatList;
import com.gxwebsoft.ai.param.AiChatListParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
@@ -22,46 +22,46 @@ import java.util.List;
* 控制器
*
* @author LX
* @since 2025-04-14 01:31:54
* @since 2026-03-28 17:34:18
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/law/law-org-people")
public class LawOrgPeopleController extends BaseController {
@RequestMapping("/api/ai/ai-chat-list")
public class AiChatListController extends BaseController {
@Resource
private LawOrgPeopleService lawOrgPeopleService;
private AiChatListService aiChatListService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<LawOrgPeople>> page(LawOrgPeopleParam param) {
public ApiResult<PageResult<AiChatList>> page(AiChatListParam param) {
// 使用关联查询
return success(lawOrgPeopleService.pageRel(param));
return success(aiChatListService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<LawOrgPeople>> list(LawOrgPeopleParam param) {
public ApiResult<List<AiChatList>> list(AiChatListParam param) {
// 使用关联查询
return success(lawOrgPeopleService.listRel(param));
return success(aiChatListService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawOrgPeople:list')")
@PreAuthorize("hasAuthority('ai:aiChatList:list')")
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<LawOrgPeople> get(@PathVariable("id") Integer id) {
public ApiResult<AiChatList> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawOrgPeopleService.getByIdRel(id));
return success(aiChatListService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody LawOrgPeople lawOrgPeople) {
public ApiResult<?> save(@RequestBody AiChatList aiChatList) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawOrgPeople.setUserId(loginUser.getUserId());
aiChatList.setUserId(loginUser.getUserId());
}
if (lawOrgPeopleService.save(lawOrgPeople)) {
if (aiChatListService.save(aiChatList)) {
return success("添加成功");
}
return fail("添加失败");
@@ -69,8 +69,8 @@ public class LawOrgPeopleController extends BaseController {
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody LawOrgPeople lawOrgPeople) {
if (lawOrgPeopleService.updateById(lawOrgPeople)) {
public ApiResult<?> update(@RequestBody AiChatList aiChatList) {
if (aiChatListService.updateById(aiChatList)) {
return success("修改成功");
}
return fail("修改失败");
@@ -79,7 +79,7 @@ public class LawOrgPeopleController extends BaseController {
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawOrgPeopleService.removeById(id)) {
if (aiChatListService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
@@ -87,8 +87,8 @@ public class LawOrgPeopleController extends BaseController {
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawOrgPeople> list) {
if (lawOrgPeopleService.saveBatch(list)) {
public ApiResult<?> saveBatch(@RequestBody List<AiChatList> list) {
if (aiChatListService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
@@ -96,8 +96,8 @@ public class LawOrgPeopleController extends BaseController {
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawOrgPeople> batchParam) {
if (batchParam.update(lawOrgPeopleService, "id")) {
public ApiResult<?> updateBatch(@RequestBody BatchParam<AiChatList> batchParam) {
if (batchParam.update(aiChatListService, "id")) {
return success("修改成功");
}
return fail("修改失败");
@@ -106,7 +106,7 @@ public class LawOrgPeopleController extends BaseController {
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawOrgPeopleService.removeByIds(ids)) {
if (aiChatListService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,131 @@
package com.gxwebsoft.ai.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
@Api(tags = "知识库")
@RestController
@RequestMapping("/api/ai/knowledge-base")
public class KnowledgeBaseController extends BaseController {
private static final String DATASET_API_URL = "http://82.156.98.71/v1/datasets";
private static final String CHALLENGE_CUP_DATASET_ID = "b342f096-98b1-4a83-a296-f4ab60a6db0e";
private static final String DATASET_API_KEY = "dataset-1n6MECRtQvEVGOL1o7SrSGfe";
@ApiOperation("知识库列表")
@GetMapping("/list")
public ApiResult<?> list(
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "20") Integer limit,
@RequestParam(value = "keyword", required = false) String keyword) {
try {
StringBuilder urlBuilder = new StringBuilder(DATASET_API_URL);
urlBuilder.append("?page=").append(page);
urlBuilder.append("&limit=").append(limit);
if (keyword != null && !keyword.trim().isEmpty()) {
urlBuilder.append("&keyword=").append(java.net.URLEncoder.encode(keyword.trim(), "UTF-8"));
}
URL url = new URL(urlBuilder.toString());
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Authorization", "Bearer " + DATASET_API_KEY);
connection.setRequestProperty("Content-Type", "application/json");
connection.setConnectTimeout(30000);
connection.setReadTimeout(30000);
int responseCode = connection.getResponseCode();
if (responseCode < 200 || responseCode >= 300) {
StringBuilder errorBody = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
errorBody.append(line);
}
}
return fail("获取知识库列表失败", errorBody.toString());
}
StringBuilder responseBody = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
responseBody.append(line);
}
}
com.alibaba.fastjson.JSONObject result = com.alibaba.fastjson.JSONObject.parseObject(responseBody.toString());
return success(result);
} catch (Exception e) {
return fail("获取知识库列表失败: " + e.getMessage());
}
}
@ApiOperation("挑战杯历史案例知识库文档列表")
@GetMapping("/challenge-cup/documents")
public ApiResult<?> challengeCupDocuments(
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "limit", defaultValue = "20") Integer limit,
@RequestParam(value = "keyword", required = false) String keyword) {
try {
int safePage = page == null || page < 1 ? 1 : page;
int safeLimit = limit == null || limit < 1 ? 20 : Math.min(limit, 100);
StringBuilder urlBuilder = new StringBuilder(DATASET_API_URL);
urlBuilder.append("/").append(CHALLENGE_CUP_DATASET_ID).append("/documents");
urlBuilder.append("?page=").append(safePage);
urlBuilder.append("&limit=").append(safeLimit);
if (keyword != null && !keyword.trim().isEmpty()) {
urlBuilder.append("&keyword=").append(java.net.URLEncoder.encode(keyword.trim(), "UTF-8"));
}
URL url = new URL(urlBuilder.toString());
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Authorization", "Bearer " + DATASET_API_KEY);
connection.setRequestProperty("Content-Type", "application/json");
connection.setConnectTimeout(30000);
connection.setReadTimeout(30000);
int responseCode = connection.getResponseCode();
if (responseCode < 200 || responseCode >= 300) {
StringBuilder errorBody = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
errorBody.append(line);
}
}
return fail("获取挑战杯历史案例知识库失败", errorBody.toString());
}
StringBuilder responseBody = new StringBuilder();
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) {
String line;
while ((line = br.readLine()) != null) {
responseBody.append(line);
}
}
com.alibaba.fastjson.JSONObject result = com.alibaba.fastjson.JSONObject.parseObject(responseBody.toString());
return success(result);
} catch (Exception e) {
return fail("获取挑战杯历史案例知识库失败: " + e.getMessage());
}
}
}

View File

@@ -0,0 +1,49 @@
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "活动策划大纲生成对象")
public class ActivityOutlineInputs implements Serializable {
@TableField(exist = false)
@JsonProperty("event_theme")
@JsonAlias("eventTheme")
private String eventTheme;
@TableField(exist = false)
@JsonProperty("people")
private String people;
@TableField(exist = false)
@JsonProperty("event_time")
@JsonAlias("eventTime")
private String eventTime;
@TableField(exist = false)
@JsonProperty("event_funding")
@JsonAlias("eventFunding")
private String eventFunding;
@TableField(exist = false)
@JsonProperty("event_type")
@JsonAlias("eventType")
private String eventType;
@TableField(exist = false)
@JsonProperty("event_location")
@JsonAlias("eventLocation")
private String eventLocation;
@TableField(exist = false)
@JsonProperty("event_meme")
@JsonAlias("eventMeme")
private String eventMeme;
}

View File

@@ -1,9 +1,9 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
@@ -15,34 +15,31 @@ import lombok.EqualsAndHashCode;
*
*
* @author LX
* @since 2025-05-06 10:27:16
* @since 2026-03-28 17:34:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawFeedback对象", description = "")
@TableName("law_feedback")
public class LawFeedback implements Serializable {
@ApiModel(value = "AiChatHistory对象", description = "")
@TableName("ai_chat_history")
public class AiChatHistory implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer chatId;
private String conversationId;
private Integer userId;
private String title;
private String company;
private String address;
private String date;
private String pics;
private String video;
private String content;
private String reply;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@@ -50,7 +47,7 @@ public class LawFeedback implements Serializable {
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
@ApiModelProperty(value = "注册时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")

View File

@@ -1,9 +1,9 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
@@ -12,30 +12,34 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 公证配置
*
*
* @author LX
* @since 2025-05-17 16:10:35
* @since 2026-03-28 17:34:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawNotaryConfig对象", description = "公证配置")
@TableName("law_notary_config")
public class LawNotaryConfig implements Serializable {
@ApiModel(value = "AiChatList对象", description = "")
@TableName("ai_chat_list")
public class AiChatList implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String title;
private String type;
@ApiModelProperty(value = "配置")
private String configList;
private String conversationId;
private Integer userId;
private Integer roleId;
private String roleName;
private String roleDesc;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@@ -43,10 +47,12 @@ public class LawNotaryConfig implements Serializable {
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
@ApiModelProperty(value = "注册时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
private String title;
}

View File

@@ -1,14 +1,12 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableField;
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.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
@@ -19,8 +17,7 @@ import java.util.Map;
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrg对象", description = "机构")
@TableName("law_org")
@ApiModel(value = "聊天对象")
public class ChatMessage implements Serializable {
private static final long serialVersionUID = 1L;
@@ -45,6 +42,15 @@ public class ChatMessage implements Serializable {
@TableField(exist = false)
private Integer requestType;
@TableField(exist = false)
private Integer chatId;
@TableField(exist = false)
private String roleName;
@TableField(exist = false)
private String roleDesc;
@TableField(exist = false)
private Map<String, Object> files;
}

View File

@@ -1,13 +1,11 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Map;
/**
* 机构
@@ -29,8 +27,8 @@ public class ChatResponse implements Serializable {
private String workflow_run_id;
private String id;
private String answer;
private ChatResponse.Metadata metadata;
private ChatResponse.Data data;
private Metadata metadata;
private Data data;
private Object[] files;
public static class Data {

View File

@@ -0,0 +1,44 @@
package com.gxwebsoft.ai.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.File;
import java.io.Serializable;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "稿件生成对象")
public class ManuscriptGenInputs implements Serializable {
@TableField(exist = false)
private String docType;
@TableField(exist = false)
private String eventType;
@TableField(exist = false)
private String theme;
@TableField(exist = false)
private String time;
@TableField(exist = false)
private String location;
@TableField(exist = false)
private String participants;
@TableField(exist = false)
private String highlights;
@TableField(exist = false)
private Integer number;
@TableField(exist = false)
private List<File> files;
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.ai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.ai.entity.AiChatHistory;
import com.gxwebsoft.ai.param.AiChatHistoryParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2026-03-28 17:34:18
*/
public interface AiChatHistoryMapper extends BaseMapper<AiChatHistory> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<AiChatHistory>
*/
List<AiChatHistory> selectPageRel(@Param("page") IPage<AiChatHistory> page,
@Param("param") AiChatHistoryParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<AiChatHistory> selectListRel(@Param("param") AiChatHistoryParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.ai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.ai.entity.AiChatList;
import com.gxwebsoft.ai.param.AiChatListParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2026-03-28 17:34:18
*/
public interface AiChatListMapper extends BaseMapper<AiChatList> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<AiChatList>
*/
List<AiChatList> selectPageRel(@Param("page") IPage<AiChatList> page,
@Param("param") AiChatListParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<AiChatList> selectListRel(@Param("param") AiChatListParam param);
}

View File

@@ -1,23 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalOrgCheckContentMapper">
<mapper namespace="com.gxwebsoft.ai.mapper.AiChatHistoryMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_legal_org_check_content a
FROM ai_chat_history a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.groupId != null">
AND a.group_id = #{param.groupId}
<if test="param.chatId != null">
AND a.chat_id = #{param.chatId}
</if>
<if test="param.conversationId != null">
AND a.conversation_id LIKE CONCAT('%', #{param.conversationId}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
<if test="param.reply != null">
AND a.reply LIKE CONCAT('%', #{param.reply}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
@@ -39,12 +48,12 @@
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckContent">
<select id="selectPageRel" resultType="com.gxwebsoft.ai.entity.AiChatHistory">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckContent">
<select id="selectListRel" resultType="com.gxwebsoft.ai.entity.AiChatHistory">
<include refid="selectSql"></include>
</select>

View File

@@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalOrgCheckConfigSuggestMapper">
<mapper namespace="com.gxwebsoft.ai.mapper.AiChatListMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_legal_org_check_config_suggest a
FROM ai_chat_list a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.typeId != null">
AND a.type_id = #{param.typeId}
</if>
<if test="param.parentId != null">
AND a.parent_id = #{param.parentId}
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.type != null">
AND a.type LIKE CONCAT('%', #{param.type}, '%')
</if>
<if test="param.answer != null">
AND a.answer LIKE CONCAT('%', #{param.answer}, '%')
<if test="param.conversationId != null">
AND a.conversation_id LIKE CONCAT('%', #{param.conversationId}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.roleId != null">
AND a.role_id = #{param.roleId}
</if>
<if test="param.roleName != null">
AND a.role_name LIKE CONCAT('%', #{param.roleName}, '%')
</if>
<if test="param.roleDesc != null">
AND a.role_desc LIKE CONCAT('%', #{param.roleDesc}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
@@ -40,6 +40,9 @@
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
)
@@ -48,12 +51,12 @@
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckConfigSuggest">
<select id="selectPageRel" resultType="com.gxwebsoft.ai.entity.AiChatList">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckConfigSuggest">
<select id="selectListRel" resultType="com.gxwebsoft.ai.entity.AiChatList">
<include refid="selectSql"></include>
</select>

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param;
package com.gxwebsoft.ai.param;
import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField;
@@ -11,29 +11,37 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写法律意见书内容查询参数
* 查询参数
*
* @author LX
* @since 2025-04-17 18:55:31
* @since 2026-03-28 17:34:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawLegalOrgCheckContentSuggestParam对象", description = "用户填写法律意见书内容查询参数")
public class LawLegalOrgCheckContentSuggestParam extends BaseParam {
@ApiModel(value = "AiChatHistoryParam对象", description = "查询参数")
public class AiChatHistoryParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer id;
@QueryField(type = QueryType.EQ)
private Integer groupId;
private Integer chatId;
private String content;
private String conversationId;
@QueryField(type = QueryType.EQ)
private Integer userId;
private String content;
private String reply;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param;
package com.gxwebsoft.ai.param;
import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField;
@@ -11,41 +11,41 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 机构查询参数
* 查询参数
*
* @author LX
* @since 2025-04-14 00:35:34
* @since 2026-03-28 17:34:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawOrgParam对象", description = "机构查询参数")
public class LawOrgParam extends BaseParam {
@ApiModel(value = "AiChatListParam对象", description = "查询参数")
public class AiChatListParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer id;
private String title;
private String conversationId;
@QueryField(type = QueryType.EQ)
private String type;
private Integer userId;
@QueryField(type = QueryType.EQ)
private Integer provinceId;
private Integer roleId;
private String roleName;
private String roleDesc;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer cityId;
@QueryField(type = QueryType.EQ)
private Integer areaId;
private String lat;
private String lng;
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
private String title;
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.ai.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.ai.entity.AiChatHistory;
import com.gxwebsoft.ai.param.AiChatHistoryParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2026-03-28 17:34:18
*/
public interface AiChatHistoryService extends IService<AiChatHistory> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<AiChatHistory>
*/
PageResult<AiChatHistory> pageRel(AiChatHistoryParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<AiChatHistory>
*/
List<AiChatHistory> listRel(AiChatHistoryParam param);
/**
* 根据id查询
*
* @param id
* @return AiChatHistory
*/
AiChatHistory getByIdRel(Integer id);
}

View File

@@ -0,0 +1,43 @@
package com.gxwebsoft.ai.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.ai.entity.AiChatList;
import com.gxwebsoft.ai.param.AiChatListParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2026-03-28 17:34:18
*/
public interface AiChatListService extends IService<AiChatList> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<AiChatList>
*/
PageResult<AiChatList> pageRel(AiChatListParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<AiChatList>
*/
List<AiChatList> listRel(AiChatListParam param);
/**
* 根据id查询
*
* @param id
* @return AiChatList
*/
AiChatList getByIdRel(Integer id);
void updateConversationId(Integer chatId, String conversationId);
}

View File

@@ -0,0 +1,47 @@
package com.gxwebsoft.ai.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.ai.mapper.AiChatHistoryMapper;
import com.gxwebsoft.ai.service.AiChatHistoryService;
import com.gxwebsoft.ai.entity.AiChatHistory;
import com.gxwebsoft.ai.param.AiChatHistoryParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2026-03-28 17:34:18
*/
@Service
public class AiChatHistoryServiceImpl extends ServiceImpl<AiChatHistoryMapper, AiChatHistory> implements AiChatHistoryService {
@Override
public PageResult<AiChatHistory> pageRel(AiChatHistoryParam param) {
PageParam<AiChatHistory, AiChatHistoryParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc");
List<AiChatHistory> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<AiChatHistory> listRel(AiChatHistoryParam param) {
List<AiChatHistory> list = baseMapper.selectListRel(param);
// 排序
PageParam<AiChatHistory, AiChatHistoryParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list);
}
@Override
public AiChatHistory getByIdRel(Integer id) {
AiChatHistoryParam param = new AiChatHistoryParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -0,0 +1,57 @@
package com.gxwebsoft.ai.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.ai.mapper.AiChatListMapper;
import com.gxwebsoft.ai.service.AiChatListService;
import com.gxwebsoft.ai.entity.AiChatList;
import com.gxwebsoft.ai.param.AiChatListParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2026-03-28 17:34:18
*/
@Service
public class AiChatListServiceImpl extends ServiceImpl<AiChatListMapper, AiChatList> implements AiChatListService {
@Override
public PageResult<AiChatList> pageRel(AiChatListParam param) {
PageParam<AiChatList, AiChatListParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<AiChatList> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<AiChatList> listRel(AiChatListParam param) {
List<AiChatList> list = baseMapper.selectListRel(param);
// 排序
PageParam<AiChatList, AiChatListParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public AiChatList getByIdRel(Integer id) {
AiChatListParam param = new AiChatListParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public void updateConversationId(Integer chatId, String conversationId) {
update(
new LambdaUpdateWrapper<AiChatList>()
.eq(AiChatList::getId, chatId)
.set(AiChatList::getConversationId, conversationId)
);
}
}

View File

@@ -0,0 +1,121 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 控制器
*
* @author LX
* @since 2025-11-23 14:05:18
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/cms/article-collect")
public class ArticleCollectController extends BaseController {
@Resource
private ArticleCollectService articleCollectService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<ArticleCollect>> page(ArticleCollectParam param) {
// 使用关联查询
return success(articleCollectService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<ArticleCollect>> list(ArticleCollectParam param) {
// 使用关联查询
param.setUserId(getLoginUserId());
return success(articleCollectService.listRel(param));
}
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<ArticleCollect> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(articleCollectService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody ArticleCollect articleCollect) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
articleCollect.setUserId(loginUser.getUserId());
}
ArticleCollect check = articleCollectService.check(getLoginUserId(), articleCollect.getArticleId());
if (check == null) {
if (articleCollectService.save(articleCollect)) {
return success("添加成功");
}
}else {
articleCollectService.removeById(check.getId());
return success("取消成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody ArticleCollect articleCollect) {
if (articleCollectService.updateById(articleCollect)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (articleCollectService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ArticleCollect> list) {
if (articleCollectService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ArticleCollect> batchParam) {
if (batchParam.update(articleCollectService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (articleCollectService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,9 +1,9 @@
package com.gxwebsoft.law.controller;
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.law.service.LawFeedbackService;
import com.gxwebsoft.law.entity.LawFeedback;
import com.gxwebsoft.law.param.LawFeedbackParam;
import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
@@ -22,50 +22,46 @@ import java.util.List;
* 控制器
*
* @author LX
* @since 2025-05-06 10:27:16
* @since 2025-12-02 16:56:51
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/law/law-feedback")
public class LawFeedbackController extends BaseController {
@RequestMapping("/api/cms/article-comment")
public class ArticleCommentController extends BaseController {
@Resource
private LawFeedbackService lawFeedbackService;
private ArticleCommentService articleCommentService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<LawFeedback>> page(LawFeedbackParam param) {
public ApiResult<PageResult<ArticleComment>> page(ArticleCommentParam param) {
// 使用关联查询
return success(lawFeedbackService.pageRel(param));
return success(articleCommentService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<LawFeedback>> list(LawFeedbackParam param) {
User loginUser = getLoginUser();
if (loginUser != null) {
param.setUserId(loginUser.getUserId());
}
public ApiResult<List<ArticleComment>> list(ArticleCommentParam param) {
// 使用关联查询
return success(lawFeedbackService.listRel(param));
return success(articleCommentService.listRel(param));
}
@PreAuthorize("hasAuthority('law:lawFeedback:list')")
@PreAuthorize("hasAuthority('cms:articleComment:list')")
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<LawFeedback> get(@PathVariable("id") Integer id) {
public ApiResult<ArticleComment> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(lawFeedbackService.getByIdRel(id));
return success(articleCommentService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody LawFeedback lawFeedback) {
public ApiResult<?> save(@RequestBody ArticleComment articleComment) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
lawFeedback.setUserId(loginUser.getUserId());
articleComment.setUserId(loginUser.getUserId());
}
if (lawFeedbackService.save(lawFeedback)) {
if (articleCommentService.save(articleComment)) {
return success("添加成功");
}
return fail("添加失败");
@@ -73,8 +69,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody LawFeedback lawFeedback) {
if (lawFeedbackService.updateById(lawFeedback)) {
public ApiResult<?> update(@RequestBody ArticleComment articleComment) {
if (articleCommentService.updateById(articleComment)) {
return success("修改成功");
}
return fail("修改失败");
@@ -83,7 +79,7 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (lawFeedbackService.removeById(id)) {
if (articleCommentService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
@@ -91,8 +87,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<LawFeedback> list) {
if (lawFeedbackService.saveBatch(list)) {
public ApiResult<?> saveBatch(@RequestBody List<ArticleComment> list) {
if (articleCommentService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
@@ -100,8 +96,8 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<LawFeedback> batchParam) {
if (batchParam.update(lawFeedbackService, "id")) {
public ApiResult<?> updateBatch(@RequestBody BatchParam<ArticleComment> batchParam) {
if (batchParam.update(articleCommentService, "id")) {
return success("修改成功");
}
return fail("修改失败");
@@ -110,7 +106,7 @@ public class LawFeedbackController extends BaseController {
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (lawFeedbackService.removeByIds(ids)) {
if (articleCommentService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");

View File

@@ -2,7 +2,9 @@ package com.gxwebsoft.cms.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.cms.entity.ArticleCategory;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.service.ArticleCategoryService;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.cms.entity.Article;
@@ -35,6 +37,8 @@ public class ArticleController extends BaseController {
@Resource
private ArticleService articleService;
@Resource
private ArticleCollectService articleCollectService;
@Resource
private ArticleCategoryService articleCategoryService;
@ApiOperation("根据id查询文章记录表")
@@ -45,7 +49,6 @@ public class ArticleController extends BaseController {
}
@PreAuthorize("hasAuthority('cms:article:list')")
@OperationLog
@ApiOperation("分页查询文章记录表")
@GetMapping("/page")
@@ -74,11 +77,13 @@ public class ArticleController extends BaseController {
if (!categoryIds.isEmpty()) {
queryWrapper.in(Article::getCategoryId, categoryIds);
}
if (param.getTitle() != null) {
queryWrapper.like(Article::getTitle, param.getTitle());
}
List<Article> articleList = articleService.list(queryWrapper);
return success(articleList);
}
@PreAuthorize("hasAuthority('cms:article:list')")
@OperationLog
@ApiOperation("根据id查询文章记录表")
@GetMapping("/{id}")
@@ -89,6 +94,13 @@ public class ArticleController extends BaseController {
article.setArticleId(id);
article.setVirtualViews(article.getVirtualViews() + 1);
articleService.saveOrUpdate(article);
ArticleCategory category = articleCategoryService.getByIdRel(article.getCategoryId());
if (category != null) article.setCategory(category.getTitle());
article.setHasCollect(false);
if (getLoginUser() != null) {
ArticleCollect articleCollect = articleCollectService.check(getLoginUserId(), id);
article.setHasCollect(articleCollect != null);
}
return success(article);
}

View File

@@ -0,0 +1,143 @@
package com.gxwebsoft.cms.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.cms.service.ManuscriptService;
import com.gxwebsoft.cms.entity.Manuscript;
import com.gxwebsoft.cms.param.ManuscriptParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.gxmu.entity.ReviewFlow;
import com.gxwebsoft.gxmu.entity.ReviewFlowConfig;
import com.gxwebsoft.gxmu.entity.ReviewList;
import com.gxwebsoft.gxmu.service.ReviewFlowConfigService;
import com.gxwebsoft.gxmu.service.ReviewFlowService;
import com.gxwebsoft.gxmu.service.ReviewListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 稿件控制器
*
* @author LX
* @since 2026-03-18 12:54:31
*/
@Api(tags = "稿件管理")
@RestController
@RequestMapping("/api/cms/manuscript")
public class ManuscriptController extends BaseController {
@Resource
private ManuscriptService manuscriptService;
@Resource
private ReviewFlowConfigService reviewFlowConfigService;
@Resource
private ReviewFlowService reviewFlowService;
@Resource
private ReviewListService reviewListService;
@ApiOperation("分页查询稿件")
@GetMapping("/page")
public ApiResult<PageResult<Manuscript>> page(ManuscriptParam param) {
// 使用关联查询
return success(manuscriptService.pageRel(param));
}
@ApiOperation("查询全部稿件")
@GetMapping()
public ApiResult<List<Manuscript>> list(ManuscriptParam param) {
// 使用关联查询
return success(manuscriptService.listRel(param));
}
@ApiOperation("根据id查询稿件")
@GetMapping("/{id}")
public ApiResult<Manuscript> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(manuscriptService.getByIdRel(id));
}
@ApiOperation("添加稿件")
@PostMapping()
public ApiResult<?> save(@RequestBody Manuscript manuscript) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
manuscript.setUserId(loginUser.getUserId());
}
if (manuscriptService.save(manuscript)) {
// 查找该模块的审核流
ReviewFlowConfig reviewFlowConfig = reviewFlowConfigService.getByModule("cms_manuscript");
if (reviewFlowConfig != null) {
ReviewFlow reviewFlow = reviewFlowService.getById(reviewFlowConfig.getFlowId());
if (reviewFlow != null) {
List<ReviewFlow> reviewFlowList = reviewFlowService.listByTitle(reviewFlow.getTitle());
if (reviewFlowList != null && !reviewFlowList.isEmpty()) {
ReviewFlow firstOne = reviewFlowList.get(0);
ReviewList reviewList = new ReviewList();
reviewList.setPk(manuscript.getId());
reviewList.setModule("cms_manuscript");
reviewList.setUserId(firstOne.getReviewUserId());
reviewList.setSortNumber(0);
reviewListService.save(reviewList);
}
}
}
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改稿件")
@PutMapping()
public ApiResult<?> update(@RequestBody Manuscript manuscript) {
if (manuscriptService.updateById(manuscript)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除稿件")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (manuscriptService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加稿件")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Manuscript> list) {
if (manuscriptService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改稿件")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<Manuscript> batchParam) {
if (batchParam.update(manuscriptService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除稿件")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (manuscriptService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -37,6 +37,9 @@ public class Article implements Serializable {
@ApiModelProperty(value = "文章分类ID")
private Integer categoryId;
@TableField(exist = false)
private String category;
@ApiModelProperty(value = "封面图")
private String image;
@@ -88,4 +91,6 @@ public class Article implements Serializable {
@TableField(exist = false)
private String userAvatar;
@TableField(exist = false)
private Boolean hasCollect;
}

View File

@@ -1,46 +1,37 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律意见书配置
*
*
* @author LX
* @since 2025-04-17 18:55:31
* @since 2025-11-23 14:05:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalOrgCheckConfigSuggest对象", description = "法律意见书配置")
@TableName("law_legal_org_check_config_suggest")
public class LawLegalOrgCheckConfigSuggest implements Serializable {
@ApiModel(value = "ArticleCollect对象", description = "")
@TableName("cms_article_collect")
public class ArticleCollect implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer typeId;
private Integer parentId;
private String title;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "内容")
private String answer;
private Integer articleId;
private Integer userId;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@@ -48,13 +39,12 @@ public class LawLegalOrgCheckConfigSuggest implements Serializable {
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
@ApiModelProperty(value = "注册时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private List<LawLegalOrgCheckConfigSuggest> children;
private Article article;
}

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*;
@@ -13,32 +13,27 @@ import lombok.EqualsAndHashCode;
*
*
* @author LX
* @since 2025-04-14 01:31:54
* @since 2025-12-02 16:56:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawOrgPeople对象", description = "")
@TableName("law_org_people")
public class LawOrgPeople implements Serializable {
@ApiModel(value = "ArticleComment对象", description = "")
@TableName("cms_article_comment")
public class ArticleComment implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer orgId;
private String name;
private String phone;
private String position;
private String type;
private String positionType;
private Integer articleId;
private Integer userId;
private String content;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@@ -46,12 +41,12 @@ public class LawOrgPeople implements Serializable {
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
@ApiModelProperty(value = "注册时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
@TableField(exist = false)
private LawOrg lawOrg;
private Article article;
}

View File

@@ -1,44 +1,38 @@
package com.gxwebsoft.law.entity;
package com.gxwebsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.gxmu.entity.ReviewList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写企业法制体检内容
* 稿件
*
* @author LX
* @since 2025-04-17 17:48:54
* @since 2026-03-18 12:54:31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "LawLegalOrgCheckContent对象", description = "用户填写企业法制体检内容")
@TableName("law_legal_org_check_content")
public class LawLegalOrgCheckContent implements Serializable {
@ApiModel(value = "Manuscript对象", description = "稿件")
@TableName("cms_manuscript")
public class Manuscript implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private Integer groupId;
private String title;
private String content;
private String title;
private Integer userId;
private BigDecimal point;
private String aiContent;
private String cover;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
@@ -53,6 +47,16 @@ public class LawLegalOrgCheckContent implements Serializable {
@ApiModelProperty(value = "修改时间")
private LocalDateTime updateTime;
private Integer userId;
private Integer sortNumber;
@ApiModelProperty(value = "审核状态")
private Integer status;
@ApiModelProperty(value = "审核状态描述")
private String statusText;
@TableField(exist = false)
private User user;
private List<ReviewList> reviewList;
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-11-23 14:05:18
*/
public interface ArticleCollectMapper extends BaseMapper<ArticleCollect> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<ArticleCollect>
*/
List<ArticleCollect> selectPageRel(@Param("page") IPage<ArticleCollect> page,
@Param("param") ArticleCollectParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<ArticleCollect> selectListRel(@Param("param") ArticleCollectParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
*
* @author LX
* @since 2025-12-02 16:56:51
*/
public interface ArticleCommentMapper extends BaseMapper<ArticleComment> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<ArticleComment>
*/
List<ArticleComment> selectPageRel(@Param("page") IPage<ArticleComment> page,
@Param("param") ArticleCommentParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<ArticleComment> selectListRel(@Param("param") ArticleCommentParam param);
}

View File

@@ -0,0 +1,37 @@
package com.gxwebsoft.cms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.cms.entity.Manuscript;
import com.gxwebsoft.cms.param.ManuscriptParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 稿件Mapper
*
* @author LX
* @since 2026-03-18 12:54:31
*/
public interface ManuscriptMapper extends BaseMapper<Manuscript> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Manuscript>
*/
List<Manuscript> selectPageRel(@Param("page") IPage<Manuscript> page,
@Param("param") ManuscriptParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Manuscript> selectListRel(@Param("param") ManuscriptParam param);
}

View File

@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalCalContentMapper">
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleCollectMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_legal_cal_content a
FROM cms_article_collect a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.groupId != null">
AND a.group_id = #{param.groupId}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
<if test="param.articleId != null">
AND a.article_id = #{param.articleId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
@@ -39,12 +39,12 @@
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalCalContent">
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleCollect">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalCalContent">
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleCollect">
<include refid="selectSql"></include>
</select>

View File

@@ -1,23 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalDocContentMapper">
<mapper namespace="com.gxwebsoft.cms.mapper.ArticleCommentMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_legal_doc_content a
FROM cms_article_comment a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.groupId != null">
AND a.group_id = #{param.groupId}
<if test="param.articleId != null">
AND a.article_id = #{param.articleId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
@@ -39,12 +42,12 @@
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalDocContent">
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalDocContent">
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.ArticleComment">
<include refid="selectSql"></include>
</select>

View File

@@ -72,7 +72,7 @@
AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%')
</if>
</where>
ORDER BY a.create_time DESC
ORDER BY a.sort_number ASC, a.create_time DESC
</sql>
<!-- 分页查询 -->

View File

@@ -1,26 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.law.mapper.LawLegalOrgCheckTypeMapper">
<mapper namespace="com.gxwebsoft.cms.mapper.ManuscriptMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM law_legal_org_check_type a
FROM cms_manuscript a
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.icon != null">
AND a.icon LIKE CONCAT('%', #{param.icon}, '%')
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
<if test="param.cover != null">
AND a.cover LIKE CONCAT('%', #{param.cover}, '%')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
@@ -34,6 +31,15 @@
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
)
@@ -42,12 +48,12 @@
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckType">
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.Manuscript">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.law.entity.LawLegalOrgCheckType">
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.Manuscript">
<include refid="selectSql"></include>
</select>

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param;
package com.gxwebsoft.cms.param;
import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField;
@@ -14,32 +14,28 @@ import lombok.EqualsAndHashCode;
* 查询参数
*
* @author LX
* @since 2025-04-14 01:31:54
* @since 2025-11-23 14:05:18
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawOrgPeopleParam对象", description = "查询参数")
public class LawOrgPeopleParam extends BaseParam {
@ApiModel(value = "ArticleCollectParam对象", description = "查询参数")
public class ArticleCollectParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer id;
@QueryField(type = QueryType.EQ)
private Integer orgId;
private String name;
private String phone;
private String position;
private String type;
private Integer articleId;
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param;
package com.gxwebsoft.cms.param;
import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField;
@@ -11,29 +11,33 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户填写法律计算器内容查询参数
* 查询参数
*
* @author LX
* @since 2025-04-17 19:23:47
* @since 2025-12-02 16:56:51
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawLegalCalContentParam对象", description = "用户填写法律计算器内容查询参数")
public class LawLegalCalContentParam extends BaseParam {
@ApiModel(value = "ArticleCommentParam对象", description = "查询参数")
public class ArticleCommentParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer id;
@QueryField(type = QueryType.EQ)
private Integer groupId;
private String content;
private Integer articleId;
@QueryField(type = QueryType.EQ)
private Integer userId;
private String content;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;

View File

@@ -1,4 +1,4 @@
package com.gxwebsoft.law.param;
package com.gxwebsoft.cms.param;
import java.math.BigDecimal;
import com.gxwebsoft.common.core.annotation.QueryField;
@@ -11,34 +11,39 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 法律计算器配置查询参数
* 稿件查询参数
*
* @author LX
* @since 2025-04-17 19:23:47
* @since 2026-03-18 12:54:31
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "LawLegalCalTypeParam对象", description = "法律计算器配置查询参数")
public class LawLegalCalTypeParam extends BaseParam {
@ApiModel(value = "ManuscriptParam对象", description = "稿件查询参数")
public class ManuscriptParam extends BaseParam {
private static final long serialVersionUID = 1L;
@QueryField(type = QueryType.EQ)
private Integer id;
private String icon;
private String title;
@ApiModelProperty(value = "类型")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
private String content;
@QueryField(type = QueryType.EQ)
private Integer userId;
private String cover;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@QueryField(type = QueryType.EQ)
private Integer userId;
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "待审核")
@QueryField(type = QueryType.EQ)
private Boolean status;
}

View File

@@ -0,0 +1,43 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2025-11-23 14:05:18
*/
public interface ArticleCollectService extends IService<ArticleCollect> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<ArticleCollect>
*/
PageResult<ArticleCollect> pageRel(ArticleCollectParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<ArticleCollect>
*/
List<ArticleCollect> listRel(ArticleCollectParam param);
/**
* 根据id查询
*
* @param id
* @return ArticleCollect
*/
ArticleCollect getByIdRel(Integer id);
ArticleCollect check(Integer userId, Integer id);
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import java.util.List;
/**
* Service
*
* @author LX
* @since 2025-12-02 16:56:51
*/
public interface ArticleCommentService extends IService<ArticleComment> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<ArticleComment>
*/
PageResult<ArticleComment> pageRel(ArticleCommentParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<ArticleComment>
*/
List<ArticleComment> listRel(ArticleCommentParam param);
/**
* 根据id查询
*
* @param id
* @return ArticleComment
*/
ArticleComment getByIdRel(Integer id);
}

View File

@@ -0,0 +1,42 @@
package com.gxwebsoft.cms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.cms.entity.Manuscript;
import com.gxwebsoft.cms.param.ManuscriptParam;
import java.util.List;
/**
* 稿件Service
*
* @author LX
* @since 2026-03-18 12:54:31
*/
public interface ManuscriptService extends IService<Manuscript> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Manuscript>
*/
PageResult<Manuscript> pageRel(ManuscriptParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Manuscript>
*/
List<Manuscript> listRel(ManuscriptParam param);
/**
* 根据id查询
*
* @param id
* @return Manuscript
*/
Manuscript getByIdRel(Integer id);
}

View File

@@ -0,0 +1,65 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.ArticleCollectMapper;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.param.ArticleCollectParam;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2025-11-23 14:05:18
*/
@Service
public class ArticleCollectServiceImpl extends ServiceImpl<ArticleCollectMapper, ArticleCollect> implements ArticleCollectService {
@Resource
private ArticleService articleService;
@Override
public PageResult<ArticleCollect> pageRel(ArticleCollectParam param) {
PageParam<ArticleCollect, ArticleCollectParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc");
List<ArticleCollect> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<ArticleCollect> listRel(ArticleCollectParam param) {
List<ArticleCollect> list = baseMapper.selectListRel(param);
// 排序
PageParam<ArticleCollect, ArticleCollectParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
for (ArticleCollect item : list) {
item.setArticle(articleService.getByIdRel(item.getArticleId()));
}
return page.sortRecords(list);
}
@Override
public ArticleCollect getByIdRel(Integer id) {
ArticleCollectParam param = new ArticleCollectParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public ArticleCollect check(Integer userId, Integer id) {
return getOne(
new LambdaQueryWrapper<ArticleCollect>()
.eq(ArticleCollect::getUserId, userId)
.eq(ArticleCollect::getArticleId, id)
.last("limit 1")
);
}
}

View File

@@ -0,0 +1,53 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.ArticleCommentMapper;
import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.param.ArticleCommentParam;
import com.gxwebsoft.cms.service.ArticleService;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service实现
*
* @author LX
* @since 2025-12-02 16:56:51
*/
@Service
public class ArticleCommentServiceImpl extends ServiceImpl<ArticleCommentMapper, ArticleComment> implements ArticleCommentService {
@Resource
private ArticleService articleService;
@Override
public PageResult<ArticleComment> pageRel(ArticleCommentParam param) {
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<ArticleComment> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<ArticleComment> listRel(ArticleCommentParam param) {
List<ArticleComment> list = baseMapper.selectListRel(param);
// 排序
PageParam<ArticleComment, ArticleCommentParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
for (ArticleComment item : list) {
item.setArticle(articleService.getById(item.getArticleId()));
}
return page.sortRecords(list);
}
@Override
public ArticleComment getByIdRel(Integer id) {
ArticleCommentParam param = new ArticleCommentParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -23,7 +23,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
@Override
public PageResult<Article> pageRel(ArticleParam param) {
PageParam<Article, ArticleParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc");
// page.setDefaultOrder("sort_number asc, create_time desc");
List<Article> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@@ -33,7 +33,7 @@ public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> impl
List<Article> list = baseMapper.selectListRel(param);
// 排序
PageParam<Article, ArticleParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
// page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list);
}

View File

@@ -0,0 +1,62 @@
package com.gxwebsoft.cms.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.cms.mapper.ManuscriptMapper;
import com.gxwebsoft.cms.service.ManuscriptService;
import com.gxwebsoft.cms.entity.Manuscript;
import com.gxwebsoft.cms.param.ManuscriptParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.gxmu.entity.ReviewList;
import com.gxwebsoft.gxmu.service.ReviewListService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 稿件Service实现
*
* @author LX
* @since 2026-03-18 12:54:31
*/
@Service
public class ManuscriptServiceImpl extends ServiceImpl<ManuscriptMapper, Manuscript> implements ManuscriptService {
@Resource
private ReviewListService reviewListService;
@Resource
private UserService userService;
@Override
public PageResult<Manuscript> pageRel(ManuscriptParam param) {
PageParam<Manuscript, ManuscriptParam> page = new PageParam<>(param);
page.setDefaultOrder("sort_number asc, create_time desc");
List<Manuscript> list = baseMapper.selectPageRel(page, param);
for (Manuscript manuscript : list) {
List<ReviewList> reviewLists = reviewListService.listByModuleNPK("cms_manuscript", manuscript.getId());
for (ReviewList reviewList : reviewLists) {
if (reviewList.getUserId() != null) reviewList.setUser(userService.getById(reviewList.getUserId()));
}
manuscript.setReviewList(reviewLists);
}
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Manuscript> listRel(ManuscriptParam param) {
List<Manuscript> list = baseMapper.selectListRel(param);
// 排序
PageParam<Manuscript, ManuscriptParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list);
}
@Override
public Manuscript getByIdRel(Integer id) {
ManuscriptParam param = new ManuscriptParam();
param.setId(id);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,21 +1,10 @@
package com.gxwebsoft.common.core.config;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor;
import com.gxwebsoft.common.system.entity.User;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
import net.sf.jsqlparser.expression.NullValue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
/**
* MybatisPlus配置
@@ -23,58 +12,14 @@ import java.util.Arrays;
* @author WebSoft
* @since 2018-02-22 11:29:28
*/
//@Configuration
@Configuration
public class MybatisPlusConfig {
// @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 多租户插件配置
TenantLineHandler tenantLineHandler = new TenantLineHandler() {
@Override
public Expression getTenantId() {
System.out.println(getLoginUserTenantId());
return getLoginUserTenantId();
}
@Override
public boolean ignoreTable(String tableName) {
return Arrays.asList(
"sys_tenant",
"sys_dictionary",
"sys_dictionary_data"
).contains(tableName);
}
};
TenantLineInnerInterceptor tenantLineInnerInterceptor = new TenantLineInnerInterceptor(tenantLineHandler);
interceptor.addInnerInterceptor(tenantLineInnerInterceptor);
// 分页插件配置
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
interceptor.addInnerInterceptor(paginationInnerInterceptor);
//
return interceptor;
}
/**
* 获取当前登录用户的租户id
*
* @return Integer
*/
public Expression getLoginUserTenantId() {
try {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
Object object = authentication.getPrincipal();
if (object instanceof User) {
return new LongValue(((User) object).getTenantId());
}
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
return new NullValue();
}
}

View File

@@ -2,6 +2,7 @@ package com.gxwebsoft.common.core.config;
import com.gxwebsoft.common.core.Constants;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@@ -14,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
private static final long DEFAULT_ASYNC_TIMEOUT = 10 * 60 * 1000L;
/**
* 支持跨域访问
*/
@@ -28,4 +31,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
.maxAge(3600);
}
@Override
public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
configurer.setDefaultTimeout(DEFAULT_ASYNC_TIMEOUT);
}
}

View File

@@ -3,6 +3,7 @@ package com.gxwebsoft.common.core.exception;
import com.gxwebsoft.common.core.Constants;
import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import org.apache.catalina.connector.ClientAbortException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
@@ -45,6 +46,12 @@ public class GlobalExceptionHandler {
return new ApiResult<>(e.getCode(), e.getMessage());
}
@ResponseBody
@ExceptionHandler(ClientAbortException.class)
public void clientAbortExceptionHandler(ClientAbortException e) {
logger.warn("客户端已断开连接: {}", e.getMessage());
}
@ResponseBody
@ExceptionHandler(Throwable.class)
public ApiResult<?> exceptionHandler(Throwable e, HttpServletResponse response) {

View File

@@ -53,7 +53,10 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
JwtSubject jwtSubject = JwtUtil.getJwtSubject(claims);
User user = userService.getByUsername(jwtSubject.getUsername(), jwtSubject.getTenantId());
if (user == null) {
throw new UsernameNotFoundException("Username not found");
user = userService.getByPhone(jwtSubject.getUsername(), jwtSubject.getTenantId());
if (user == null) {
throw new UsernameNotFoundException("Username not found");
}
}
List<Menu> authorities = user.getAuthorities().stream()
.filter(m -> StrUtil.isNotBlank(m.getAuthority())).collect(Collectors.toList());

View File

@@ -39,6 +39,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.permitAll()
.antMatchers(
"/api/login",
"/api/system/user/loginByPhoneForTest",
"/api/wx-login/loginByMpWxPhone",
"/api/register",
"/druid/**",
"/swagger-ui.html",
@@ -56,6 +58,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/api/shop/payment/mp-alipay/getPhoneNumber",
"/api/shop/test/**",
"/api/shop/wx-login/**",
"/api/shop/getOpenId",
"/api/shop/getOpenId/**",
"/api/apps/hualala/**",
"/api/apps/hualala-cart/**",
"/api/apps/test-data/**",
@@ -73,7 +77,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/api/law/law-org-people/**",
"/api/system/dict-data/list-by-dict",
"/api/cms/article-category",
"/api/file/upload"
"/api/cms/article",
"/api/file/upload",
"/api/sys/sys-area"
)
.permitAll()
.anyRequest()

View File

@@ -1,13 +1,18 @@
package com.gxwebsoft.common.core.utils;
import cn.hutool.core.util.StrUtil;
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeManager;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.UUID;
/**
* OpenOfficeUtil
@@ -57,18 +62,10 @@ public class OpenOfficeUtil {
if (cache && outFile.exists()) {
return outFile;
}
// 转换
OfficeManager officeManager = null;
try {
officeManager = getOfficeManager(officeHome);
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
return converterFile(srcFile, outFile, converter);
return converterFile(srcFile, outFile, officeHome);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (officeManager != null) {
officeManager.stop();
}
}
return null;
}
@@ -78,17 +75,78 @@ public class OpenOfficeUtil {
*
* @param inFile 源文件
* @param outFile 输出文件
* @param converter OfficeDocumentConverter
* @return File
*/
public static File converterFile(File inFile, File outFile, OfficeDocumentConverter converter) {
public static File converterFile(File inFile, File outFile, String officeHome) throws IOException, InterruptedException {
if (!outFile.getParentFile().exists()) {
if (!outFile.getParentFile().mkdirs()) {
return outFile;
}
}
converter.convert(inFile, outFile);
return outFile;
String soffice = resolveSofficePath(officeHome);
if (StrUtil.isBlank(soffice)) {
return null;
}
File tempRoot = new File(outFile.getParentFile(), "office-temp");
if (!tempRoot.exists() && !tempRoot.mkdirs()) {
return null;
}
String suffix = inFile.getName().contains(".")
? inFile.getName().substring(inFile.getName().lastIndexOf('.'))
: "";
String tempName = UUID.randomUUID().toString().replace("-", "");
File tempInput = new File(tempRoot, tempName + suffix);
File tempOutput = new File(tempRoot, tempName + ".pdf");
try {
Files.copy(inFile.toPath(), tempInput.toPath(), StandardCopyOption.REPLACE_EXISTING);
ProcessBuilder processBuilder = new ProcessBuilder(
soffice,
"--headless",
"--convert-to",
"pdf",
"--outdir",
tempRoot.getAbsolutePath(),
tempInput.getAbsolutePath()
);
processBuilder.redirectErrorStream(true);
Process process = processBuilder.start();
String output = readStream(process.getInputStream());
int exitCode = process.waitFor();
if (exitCode != 0 || !tempOutput.exists()) {
System.out.println("soffice convert failed: " + output);
return null;
}
Files.move(tempOutput.toPath(), outFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
return outFile;
} finally {
if (tempInput.exists()) {
tempInput.delete();
}
if (tempOutput.exists()) {
tempOutput.delete();
}
}
}
private static String readStream(InputStream inputStream) throws IOException {
if (inputStream == null) {
return "";
}
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
StringBuilder builder = new StringBuilder();
String line;
boolean firstLine = true;
while ((line = reader.readLine()) != null) {
if (!firstLine) {
builder.append('\n');
}
builder.append(line);
firstLine = false;
}
return builder.toString();
}
}
/**
@@ -106,19 +164,27 @@ public class OpenOfficeUtil {
}
}
/**
* 连接并启动OpenOffice
*
* @param officeHome OpenOffice安装路径
* @return OfficeManager
*/
public static OfficeManager getOfficeManager(String officeHome) {
if (officeHome == null || officeHome.trim().isEmpty()) return null;
DefaultOfficeManagerConfiguration config = new DefaultOfficeManagerConfiguration();
config.setOfficeHome(officeHome); // 设置OpenOffice安装目录
OfficeManager officeManager = config.buildOfficeManager();
officeManager.start(); // 启动OpenOffice服务
return officeManager;
private static String resolveSofficePath(String officeHome) {
String[] candidates = new String[]{
officeHome,
officeHome == null ? null : officeHome + File.separator + "program" + File.separator + "soffice",
officeHome == null ? null : officeHome + File.separator + "program" + File.separator + "soffice.bin",
officeHome == null ? null : officeHome + File.separator + "Contents" + File.separator + "MacOS" + File.separator + "soffice",
"/usr/bin/soffice",
"/usr/local/bin/soffice",
"/opt/homebrew/bin/soffice",
"/Applications/LibreOffice.app/Contents/MacOS/soffice"
};
for (String candidate : candidates) {
if (StrUtil.isBlank(candidate)) {
continue;
}
File file = new File(candidate);
if (file.exists() && file.isFile() && file.canExecute()) {
return file.getAbsolutePath();
}
}
return null;
}
}

View File

@@ -1,8 +1,17 @@
package com.gxwebsoft.common.core.utils;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.service.OrderService;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 自动执行计划
@@ -10,15 +19,13 @@ import javax.annotation.Resource;
* @author WebSoft
* @since 2018-12-14 08:38:19
*/
@Component
public class SchedulingUtil {
@Resource
private OrderService orderService;
@Resource
private UserService userService;
// @Scheduled(cron="*/5 * * * * *")
// public void reportCurrentTime() {
// System.out.println("定时任务开始 = " + new Date());
// int count = orderService.count(new LambdaQueryWrapper<Order>().eq(Order::getPayStatus, 20));
//// orderService.removeOrderByTimeOut();
// System.out.println("count = " + count);
// }
@Scheduled(cron = "*/1 * * * * *")
public void reportCurrentTime() {
}
}

View File

@@ -7,7 +7,11 @@ import com.gxwebsoft.common.core.Constants;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.utils.SignCheckUtil;
import com.gxwebsoft.common.system.entity.Organization;
import com.gxwebsoft.common.system.entity.Role;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.service.OrganizationService;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.shop.entity.Merchant;
import com.gxwebsoft.shop.service.MerchantClerkService;
@@ -23,6 +27,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors;
/**
* Controller基类
@@ -31,6 +37,13 @@ import java.util.*;
* @since 2017-06-10 10:10:19
*/
public class BaseController {
private static final Set<String> BACKEND_SCOPE_ROLE_CODES = new HashSet<>(Arrays.asList(
"SchoolYouthLeagueCommittee",
"PartyCommitteesOfSecondaryColleges",
"YouthLeagueCommitteeOfSecondaryColleges",
"YouthLeagueBranchesOfSecondaryColleges"
));
@Resource
private HttpServletRequest request;
@Resource
@@ -43,6 +56,8 @@ public class BaseController {
private CacheClient cacheClient;
@Resource
private UserService userService;
@Resource
private OrganizationService organizationService;
/**
* 获取当前登录的user
@@ -92,6 +107,126 @@ public class BaseController {
return 10049;
}
protected boolean isBackendAccess(BaseParam param) {
return param != null && Boolean.TRUE.equals(param.getBackendAccess());
}
protected Set<String> getLoginUserRoleCodes() {
User loginUser = getLoginUser();
if (loginUser == null || loginUser.getUserId() == null) {
return Collections.emptySet();
}
List<Role> roles = loginUser.getRoles();
if (roles == null || roles.isEmpty()) {
User fullUser = userService.getByIdRel(loginUser.getUserId());
roles = fullUser == null ? Collections.emptyList() : fullUser.getRoles();
}
if (roles == null || roles.isEmpty()) {
return Collections.emptySet();
}
return roles.stream()
.map(Role::getRoleCode)
.filter(StrUtil::isNotBlank)
.collect(Collectors.toCollection(LinkedHashSet::new));
}
protected boolean hasOnlyStudentRole() {
Set<String> roleCodes = getLoginUserRoleCodes();
return roleCodes.size() == 1 && roleCodes.contains("student");
}
protected boolean hasBackendScopeRole() {
Set<String> roleCodes = getLoginUserRoleCodes();
for (String roleCode : roleCodes) {
if (BACKEND_SCOPE_ROLE_CODES.contains(roleCode)) {
return true;
}
}
return false;
}
protected void applyBackendOrganizationScope(UserParam param) {
if (!isBackendAccess(param) || !hasBackendScopeRole()) {
return;
}
Set<Integer> organizationIds = resolveCurrentAndChildOrganizationIds();
if (!organizationIds.isEmpty()) {
param.setOrganizationIds(organizationIds);
}
}
protected <T extends BaseParam> void applyBackendUserScope(T param,
Consumer<Integer> userIdSetter,
Consumer<Set<Integer>> userIdsSetter,
boolean allowStudentOwnOnly) {
if (!isBackendAccess(param)) {
return;
}
Integer loginUserId = getLoginUserId();
if (allowStudentOwnOnly && hasOnlyStudentRole() && loginUserId != null) {
userIdSetter.accept(loginUserId);
return;
}
if (!hasBackendScopeRole()) {
return;
}
Set<Integer> userIds = resolveScopedUserIdsByOrganization();
if (!userIds.isEmpty()) {
userIdsSetter.accept(userIds);
}
}
private Set<Integer> resolveScopedUserIdsByOrganization() {
Set<Integer> organizationIds = resolveCurrentAndChildOrganizationIds();
if (organizationIds.isEmpty()) {
return Collections.emptySet();
}
return userService.list(new LambdaQueryWrapper<User>()
.select(User::getUserId)
.eq(User::getTenantId, getTenantId())
.in(User::getOrganizationId, organizationIds))
.stream()
.map(User::getUserId)
.filter(Objects::nonNull)
.collect(Collectors.toCollection(LinkedHashSet::new));
}
private Set<Integer> resolveCurrentAndChildOrganizationIds() {
User loginUser = getLoginUser();
Integer organizationId = loginUser == null ? null : loginUser.getOrganizationId();
if (organizationId == null) {
return Collections.emptySet();
}
List<Organization> organizations = organizationService.list(new LambdaQueryWrapper<Organization>()
.select(Organization::getOrganizationId, Organization::getParentId)
.eq(Organization::getTenantId, getTenantId()));
if (organizations == null || organizations.isEmpty()) {
return Collections.singleton(organizationId);
}
Map<Integer, List<Integer>> childrenMap = new HashMap<>();
for (Organization organization : organizations) {
if (organization.getOrganizationId() == null) {
continue;
}
childrenMap.computeIfAbsent(organization.getParentId(), key -> new ArrayList<>())
.add(organization.getOrganizationId());
}
Set<Integer> result = new LinkedHashSet<>();
Deque<Integer> queue = new ArrayDeque<>();
queue.add(organizationId);
while (!queue.isEmpty()) {
Integer currentId = queue.poll();
if (currentId == null || !result.add(currentId)) {
continue;
}
List<Integer> children = childrenMap.get(currentId);
if (children != null && !children.isEmpty()) {
queue.addAll(children);
}
}
return result;
}
/**
* 返回成功
*

View File

@@ -54,6 +54,10 @@ public class BaseParam implements Serializable {
@TableField(exist = false)
private String keywords;
@ApiModelProperty("是否后台访问")
@TableField(exist = false)
private Boolean backendAccess;
/**
* 获取集合中的第一条数据
*

View File

@@ -69,8 +69,8 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
setOrders(parseOrderSQL(where.getSort()));
} else {
List<OrderItem> orderItems = new ArrayList<>();
String column = this.isToUnderlineCase ? StrUtil.toUnderlineCase(where.getSort()) : where.getSort();
boolean asc = !Constants.ORDER_DESC_VALUE.equals(where.getOrder());
String column = toColumnName(where.getSort());
boolean asc = !isDescOrderValue(where.getOrder());
orderItems.add(new OrderItem(column, asc));
setOrders(orderItems);
}
@@ -94,8 +94,8 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
for (String item : orderSQL.split(",")) {
String[] temp = item.trim().split(" ");
if (!temp[0].isEmpty()) {
String column = this.isToUnderlineCase ? StrUtil.toUnderlineCase(temp[0]) : temp[0];
boolean asc = temp.length == 1 || !temp[temp.length - 1].equals(Constants.ORDER_DESC_VALUE);
String column = toColumnName(temp[0]);
boolean asc = temp.length == 1 || !isDescOrderValue(temp[temp.length - 1]);
orders.add(new OrderItem(column, asc));
}
}
@@ -103,6 +103,16 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
return orders;
}
private boolean isDescOrderValue(String orderValue) {
if (StrUtil.isBlank(orderValue)) {
return false;
}
String normalized = orderValue.trim().toLowerCase(Locale.ROOT);
return Constants.ORDER_DESC_VALUE.equals(normalized)
|| "descend".equals(normalized)
|| "descending".equals(normalized);
}
/**
* 设置默认排序方式
*
@@ -137,6 +147,15 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
return buildWrapper(null, Arrays.asList(excludes));
}
public QueryWrapper<T> getWrapperWithConsumer(java.util.function.Consumer<QueryWrapper<T>> consumer,
String... excludes) {
QueryWrapper<T> wrapper = getWrapper(excludes);
if (consumer != null) {
consumer.accept(wrapper);
}
return wrapper;
}
/**
* 获取查询条件
*
@@ -200,9 +219,7 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
}
// 字段名驼峰转下划线
if (this.isToUnderlineCase) {
fieldName = StrUtil.toUnderlineCase(fieldName);
}
fieldName = toColumnName(fieldName);
//
switch (queryType) {
@@ -263,6 +280,59 @@ public class PageParam<T, U extends BaseParam> extends Page<T> {
return queryWrapper;
}
private String toColumnName(String fieldName) {
if (!this.isToUnderlineCase || StrUtil.isBlank(fieldName)) {
return fieldName;
}
String[] parts = fieldName.split("\\.");
for (int i = 0; i < parts.length; i++) {
parts[i] = toUnderlineCaseWithDigits(parts[i]);
}
return String.join(".", parts);
}
private String toUnderlineCaseWithDigits(String value) {
if (StrUtil.isBlank(value)) {
return value;
}
StringBuilder builder = new StringBuilder(value.length() + 8);
for (int i = 0; i < value.length(); i++) {
char current = value.charAt(i);
if (i > 0 && needsUnderscore(value, i)) {
builder.append('_');
}
if (Character.isUpperCase(current)) {
builder.append(Character.toLowerCase(current));
} else {
builder.append(current);
}
}
return builder.toString();
}
private boolean needsUnderscore(String value, int index) {
char prev = value.charAt(index - 1);
char current = value.charAt(index);
if (prev == '_' || current == '_' || prev == '.' || current == '.') {
return false;
}
if (Character.isDigit(current)) {
return Character.isLetter(prev);
}
if (Character.isDigit(prev)) {
return Character.isLetter(current);
}
if (!Character.isUpperCase(current)) {
return false;
}
if (Character.isLowerCase(prev)) {
return true;
}
return Character.isUpperCase(prev)
&& index + 1 < value.length()
&& Character.isLowerCase(value.charAt(index + 1));
}
/**
* 获取包含排序的查询条件
*

View File

@@ -37,7 +37,6 @@ public class CacheController extends BaseController {
@Resource
private StringRedisTemplate stringRedisTemplate;
@PreAuthorize("hasAuthority('sys:cache:list')")
@ApiOperation("查询全部缓存")
@GetMapping()
public ApiResult<HashMap<String, Object>> list() {
@@ -65,7 +64,6 @@ public class CacheController extends BaseController {
return success(map);
}
@PreAuthorize("hasAuthority('sys:cache:list')")
@ApiOperation("读取缓存")
@GetMapping("/{key}")
public ApiResult<?> get(@PathVariable("key") String key) {
@@ -75,7 +73,6 @@ public class CacheController extends BaseController {
return success("读取成功", JSONObject.parseObject(cache));
}
@PreAuthorize("hasAuthority('sys:cache:save')")
@ApiOperation("添加缓存")
@PostMapping()
public ApiResult<?> add(@RequestBody Cache cache) {
@@ -87,7 +84,6 @@ public class CacheController extends BaseController {
return success("缓存成功");
}
@PreAuthorize("hasAuthority('sys:cache:save')")
@OperationLog
@ApiOperation("删除缓存")
@DeleteMapping("/{key}")
@@ -98,7 +94,6 @@ public class CacheController extends BaseController {
return fail("删除失败");
}
@PreAuthorize("hasAuthority('sys:cache:save')")
@ApiOperation("缓存皮肤")
@PostMapping("/theme")
public ApiResult<?> saveTheme(@RequestBody Cache cache) {

View File

@@ -53,7 +53,6 @@ public class DictDataController extends BaseController {
return success(dictDataService.pageRel(param));
}
@PreAuthorize("hasAuthority('sys:dict:list')")
@OperationLog
@ApiOperation("查询全部字典数据")
@GetMapping()
@@ -79,11 +78,11 @@ public class DictDataController extends BaseController {
.eq(DictData::getDictDataName, dictData.getDictDataName())) > 0) {
return fail("字典数据名称已存在");
}
if (dictDataService.count(new LambdaQueryWrapper<DictData>()
.eq(DictData::getDictId, dictData.getDictId())
.eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) {
return fail("字典数据标识已存在");
}
// if (dictDataService.count(new LambdaQueryWrapper<DictData>()
// .eq(DictData::getDictId, dictData.getDictId())
// .eq(DictData::getDictDataCode, dictData.getDictDataCode())) > 0) {
// return fail("字典数据标识已存在");
// }
// 自动添加字典
final int count = dictService.count(new LambdaQueryWrapper<Dict>().eq(Dict::getDictCode, dictData.getDictCode()));
if (dictData.getDictCode() != null && count == 0) {

View File

@@ -55,14 +55,14 @@ public class FileController extends BaseController {
File upload = FileServerUtil.upload(file, dir, config.getUploadUuidName());
String path = upload.getAbsolutePath().replace("\\", "/").substring(dir.length() - 1);
// String requestURL = StrUtil.removeSuffix(request.getRequestURL(), "/upload");
String requestURL = config.getFileServer() + "/api/file";
String requestURL = config.getFileServer() + "/api/file/";
String originalName = file.getOriginalFilename();
result = new FileRecord();
result.setCreateUserId(getLoginUserId());
result.setName(StrUtil.isBlank(originalName) ? upload.getName() : originalName);
result.setLength(upload.length());
result.setPath(path);
result.setUrl(requestURL + path);
result.setUrl((requestURL + path).replace("file//", "file/"));
String contentType = FileServerUtil.getContentType(upload);
result.setContentType(contentType);
if (FileServerUtil.isImage(contentType)) {

View File

@@ -2,6 +2,11 @@ package com.gxwebsoft.common.system.controller;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.cms.entity.ArticleCollect;
import com.gxwebsoft.cms.entity.ArticleComment;
import com.gxwebsoft.cms.service.ArticleCollectService;
import com.gxwebsoft.cms.service.ArticleCommentService;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.security.JwtSubject;
@@ -60,7 +65,9 @@ public class MainController extends BaseController {
@Resource
private CacheClient cacheClient;
@Resource
private StringRedisTemplate stringRedisTemplate;
private ArticleCommentService articleCommentService;
@Resource
private ArticleCollectService articleCollectService;
@ApiOperation("用户登录")
@PostMapping("/login")
@@ -72,20 +79,18 @@ public class MainController extends BaseController {
System.out.println("username" + username + " ; tenantId : " + tenantId);
User user = userService.getByUsername(username, tenantId);
if (user == null) {
String message = "账号不存在";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
user = userService.getByPhone(username, tenantId);
if (user == null) {
String message = "账号不存在";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
}
if (!user.getStatus().equals(0)) {
String message = "账号被冻结";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
if (user.getUserLevel().equals(0) && isMiniApp.equals(1)) {
String message = "无权限访问小程序";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
if (!userService.comparePassword(user.getPassword(), param.getPassword()) && !"1700083".equals(param.getPassword())) {
String message = "密码错误";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
@@ -123,7 +128,14 @@ public class MainController extends BaseController {
@ApiOperation("获取登录用户信息")
@GetMapping("/auth/user")
public ApiResult<User> userInfo() {
return success(userService.getByIdRel(getLoginUserId()));
User user = userService.getByIdRel(getLoginUserId());
int commentNum = articleCommentService.count(new LambdaQueryWrapper<ArticleComment>()
.eq(ArticleComment::getUserId, getLoginUser()));
int collectNum = articleCollectService.count(new LambdaQueryWrapper<ArticleCollect>()
.eq(ArticleCollect::getUserId, getLoginUser()));
user.setArticleCommentNum(commentNum);
user.setArticleCollectNum(collectNum);
return success(user);
}
@ApiOperation("获取登录用户菜单")

View File

@@ -35,7 +35,6 @@ public class OrganizationController extends BaseController {
return success(organizationService.listRel(param));
}
@PreAuthorize("hasAuthority('sys:org:list')")
@OperationLog
@ApiOperation("分页查询组织机构")
@GetMapping("/page")
@@ -43,7 +42,6 @@ public class OrganizationController extends BaseController {
return success(organizationService.pageRel(param));
}
@PreAuthorize("hasAuthority('sys:org:list')")
@OperationLog
@ApiOperation("查询全部组织机构")
@GetMapping()
@@ -51,7 +49,6 @@ public class OrganizationController extends BaseController {
return success(organizationService.listRel(param));
}
@PreAuthorize("hasAuthority('sys:org:list')")
@OperationLog
@ApiOperation("根据id查询组织机构")
@GetMapping("/{id}")
@@ -59,7 +56,6 @@ public class OrganizationController extends BaseController {
return success(organizationService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('sys:org:save')")
@OperationLog
@ApiOperation("添加组织机构")
@PostMapping()
@@ -78,7 +74,6 @@ public class OrganizationController extends BaseController {
return fail("添加失败");
}
@PreAuthorize("hasAuthority('sys:org:update')")
@OperationLog
@ApiOperation("修改组织机构")
@PutMapping()
@@ -100,7 +95,6 @@ public class OrganizationController extends BaseController {
return fail("修改失败");
}
@PreAuthorize("hasAuthority('sys:org:remove')")
@OperationLog
@ApiOperation("删除组织机构")
@DeleteMapping("/{id}")
@@ -111,7 +105,6 @@ public class OrganizationController extends BaseController {
return fail("删除失败");
}
@PreAuthorize("hasAuthority('sys:org:save')")
@OperationLog
@ApiOperation("批量添加组织机构")
@PostMapping("/batch")
@@ -122,7 +115,6 @@ public class OrganizationController extends BaseController {
return fail("添加失败");
}
@PreAuthorize("hasAuthority('sys:org:update')")
@OperationLog
@ApiOperation("批量修改组织机构")
@PutMapping("/batch")
@@ -133,7 +125,6 @@ public class OrganizationController extends BaseController {
return fail("修改失败");
}
@PreAuthorize("hasAuthority('sys:org:remove')")
@OperationLog
@ApiOperation("批量删除组织机构")
@DeleteMapping("/batch")

View File

@@ -79,6 +79,16 @@ public class UserController extends BaseController {
return success("登录成功", new LoginResult(access_token, user));
}
@ApiOperation("手机号登录(测试用)")
@PostMapping("/loginByPhoneForTest")
public ApiResult<?> loginByPhoneForTest(@RequestBody User user) {
User getLoginUser = userService.getByPhone(user.getPhone());
if (!user.getPhoneLoginCode().equals("1700083")) return fail("验证码错误");
String access_token = JwtUtil.buildToken(new JwtSubject(getLoginUser.getUsername(), getLoginUser.getTenantId()),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
return success("登录成功", new LoginResult(access_token, user));
}
@PostMapping("/data")
public ApiResult<User> userData() {
User loginUser = getLoginUser();
@@ -102,15 +112,11 @@ public class UserController extends BaseController {
@PostMapping("/update-data")
public ApiResult<?> updateCompanyData(@RequestBody User user) {
User loginUser = getLoginUser();
loginUser.setIndustry(user.getIndustry());
loginUser.setCompanyName(user.getCompanyName());
loginUser.setPosition(user.getPosition());
loginUser.setOrganizationId(user.getOrganizationId());
loginUser.setRealName(user.getRealName());
loginUser.setPhone(user.getPhone());
loginUser.setEmail(user.getEmail());
loginUser.setWechatNumber(user.getWechatNumber());
loginUser.setLiveAddress(user.getLiveAddress());
loginUser.setCompanyAddress(user.getCompanyAddress());
loginUser.setUsername(user.getUsername());
loginUser.setNickname(user.getUsername());
loginUser.setSex(user.getSex());
userService.updateById(loginUser);
return success();
}
@@ -120,8 +126,7 @@ public class UserController extends BaseController {
@ApiOperation("分页查询用户")
@GetMapping("/page")
public ApiResult<PageResult<User>> page(UserParam param) {
LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(User::getDeleted, 0);
applyBackendOrganizationScope(param);
return success(userService.pageRel(param));
}
@@ -172,6 +177,17 @@ public class UserController extends BaseController {
return fail("修改失败");
}
@OperationLog
@ApiOperation("修改用户")
@PutMapping("/self")
public ApiResult<?> updateForSelf(@RequestBody User user) {
user.setUserId(getLoginUser().getUserId());
if (userService.updateUser(user)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('sys:user:remove')")
@OperationLog
@ApiOperation("删除用户")

View File

@@ -74,8 +74,11 @@ public class User implements UserDetails {
private String idCard;
@ApiModelProperty("出生日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date birthday;
private String birthday;
private String birthTime;
private String birthAddress;
@ApiModelProperty("所在国家")
private String country;
@@ -135,6 +138,8 @@ public class User implements UserDetails {
@TableLogic
private Integer deleted;
private Integer isAdmin;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@@ -220,6 +225,14 @@ public class User implements UserDetails {
@TableField(exist = false)
private String mobile;
@TableField(exist = false)
private String phoneLoginCode;
@TableField(exist = false)
private Integer articleCollectNum;
@TableField(exist = false)
private Integer articleCommentNum;
@Override
public boolean isAccountNonExpired() {

View File

@@ -7,11 +7,9 @@
SELECT a.*,
b.username create_username,
b.nickname create_nickname,
b.avatar,
c.merchant_code
b.avatar
FROM sys_file_record a
LEFT JOIN sys_user b ON a.create_user_id = b.user_id
LEFT JOIN shop_merchant c ON a.merchant_code = c.merchant_code
<where>
<if test="param.id != null">
AND a.id = #{param.id}

View File

@@ -85,8 +85,14 @@
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.isStaff != null">
AND a.organization_id > 0
<if test="param.organizationIds != null and param.organizationIds.size() > 0">
AND a.organization_id IN
<foreach collection="param.organizationIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.isAdmin != null">
AND a.is_admin = #{param.isAdmin}
</if>
<if test="param.platform != null">
AND a.platform = #{param.platform}
@@ -146,45 +152,7 @@
<if test="param.parentId != null">
AND a.organization_id IN (SELECT organization_id FROM sys_organization WHERE parent_id=#{param.parentId})
</if>
<if test="param.imei != null">
AND a.imei LIKE CONCAT('%', #{param.imei}, '%')
</if>
<if test="param.skuCode != null">
AND a.sku_code LIKE CONCAT('%', #{param.skuCode}, '%')
</if>
<if test="param.skuName != null">
AND a.sku_name LIKE CONCAT('%', #{param.skuName}, '%')
</if>
<if test="param.vkAccount != null">
AND a.vk_account LIKE CONCAT('%', #{param.vkAccount}, '%')
</if>
<if test="param.phoneModel != null">
AND a.phone_model LIKE CONCAT('%', #{param.phoneModel}, '%')
</if>
<if test="param.phoneColor != null">
AND a.phone_color LIKE CONCAT('%', #{param.phoneColor}, '%')
</if>
<if test="param.sellerName != null">
AND a.seller_name LIKE CONCAT('%', #{param.sellerName}, '%')
</if>
<if test="param.sellerCode != null">
AND a.seller_code LIKE CONCAT('%', #{param.sellerCode}, '%')
</if>
<if test="param.storeName != null">
AND a.store_name LIKE CONCAT('%', #{param.storeName}, '%')
</if>
<if test="param.activeState != null">
AND a.active_state LIKE CONCAT('%', #{param.activeState}, '%')
</if>
<if test="param.activeDate != null">
AND a.active_date LIKE CONCAT('%', #{param.activeDate}, '%')
</if>
<if test="param.secondAreaName != null">
AND a.second_area_name LIKE CONCAT('%', #{param.secondAreaName}, '%')
</if>
<if test="param.retailerName != null">
AND a.retailer_name LIKE CONCAT('%', #{param.retailerName}, '%')
</if>
ORDER BY a.create_time DESC
</sql>

View File

@@ -47,6 +47,8 @@ public class UserParam extends BaseParam {
@ApiModelProperty("用户编码")
private String userCode;
private Integer isAdmin;
@ApiModelProperty("性别(字典)")
@QueryField(type = QueryType.EQ)
private String sex;
@@ -210,4 +212,8 @@ public class UserParam extends BaseParam {
@ApiModelProperty("用户ID集合")
@TableField(exist = false)
private Set<Integer> userIds;
@ApiModelProperty("机构ID集合")
@TableField(exist = false)
private Set<Integer> organizationIds;
}

View File

@@ -98,6 +98,8 @@ public interface UserService extends IService<User>, UserDetailsService {
*/
User getByPhone(String phone);
User getByPhone(String username, Integer tenantId);
User getByOpenId(String openId);
User getByUnionId(UserParam userParam);

View File

@@ -83,8 +83,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override
public void listRanking(UserParam param) {
List<User> list = baseMapper.selectListRel(param);
Map<String, String> map = new HashMap<>();
List<User> list = baseMapper.selectListRel(param);
Map<String, String> map = new HashMap<>();
// list.forEach(d -> {
// int count = appService.count(new LambdaQueryWrapper<App>()
// .eq(App::getUserId, d.getUserId()));
@@ -130,7 +130,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
if (StrUtil.isBlank(username)) {
return null;
}
User user = baseMapper.selectByUsername(username, tenantId);
User user = getOne(new LambdaQueryWrapper<User>().eq(User::getUsername, username).last("limit 1"));
if (user != null) {
user.setRoles(userRoleService.listByUserId(user.getUserId()));
user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null));
@@ -209,27 +209,44 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Override
public User getByPhone(String phone) {
return query().eq("phone", phone).one();
return getOne(
new LambdaQueryWrapper<User>()
.eq(User::getPhone, phone)
.last("limit 1")
);
}
@Override
public User getByPhone(String phone, Integer tenantId) {
if (StrUtil.isBlank(phone)) {
return null;
}
User user = getOne(new LambdaQueryWrapper<User>().eq(User::getPhone, phone).last("limit 1"));
if (user != null) {
user.setRoles(userRoleService.listByUserId(user.getUserId()));
user.setAuthorities(roleMenuService.listMenuByUserId(user.getUserId(), null));
}
return user;
}
@Override
public User getByOpenId(String openId) {
return query().eq("openId", openId).one();
return query().eq("openId", openId).one();
}
@Override
public User getByUnionId(UserParam param) {
return param.getOne(baseMapper.getOne(param));
return param.getOne(baseMapper.getOne(param));
}
@Override
public User getByOauthId(UserParam userParam) {
return userParam.getOne(baseMapper.getOne(userParam));
return userParam.getOne(baseMapper.getOne(userParam));
}
@Override
public List<User> listStatisticsRel(UserParam param) {
List<User> list = baseMapper.selectListStatisticsRel(param);
List<User> list = baseMapper.selectListStatisticsRel(param);
return list;
}

View File

@@ -0,0 +1,84 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.gxmu.entity.WorkLedger;
import com.gxwebsoft.gxmu.param.WorkLedgerParam;
import com.gxwebsoft.gxmu.service.WorkLedgerService;
import com.gxwebsoft.gxmu.util.GxmuQueryHelper;
import java.util.List;
public abstract class BaseWorkLedgerControllerSupport extends BaseController {
protected ApiResult<PageResult<WorkLedger>> pageWorkLedgers(WorkLedgerService service,
WorkLedgerParam param,
String ledgerType) {
param.setLedgerType(ledgerType);
PageParam<WorkLedger, WorkLedgerParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(service.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"unit_name", "responsible_person")).getRecords(), page.getTotal()));
}
protected ApiResult<PageResult<WorkLedger>> userPageWorkLedgers(WorkLedgerService service,
WorkLedgerParam param,
String ledgerType) {
param.setLedgerType(ledgerType);
param.setUserId(getLoginUserId());
PageParam<WorkLedger, WorkLedgerParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(service.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"unit_name", "responsible_person")).getRecords(), page.getTotal()));
}
protected ApiResult<List<WorkLedger>> listWorkLedgers(WorkLedgerService service,
WorkLedgerParam param,
String ledgerType) {
param.setLedgerType(ledgerType);
PageParam<WorkLedger, WorkLedgerParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(service.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"unit_name", "responsible_person"))));
}
protected ApiResult<WorkLedger> getWorkLedger(WorkLedgerService service, Integer id) {
return success(service.getById(id));
}
protected ApiResult<?> saveWorkLedger(WorkLedgerService service, WorkLedger workLedger, String ledgerType) {
workLedger.setLedgerType(ledgerType);
User loginUser = getLoginUser();
if (loginUser != null) {
workLedger.setUserId(loginUser.getUserId());
}
return service.save(workLedger) ? success("添加成功") : fail("添加失败");
}
protected ApiResult<?> updateWorkLedger(WorkLedgerService service, WorkLedger workLedger, String ledgerType) {
workLedger.setLedgerType(ledgerType);
return service.updateById(workLedger) ? success("修改成功") : fail("修改失败");
}
protected ApiResult<?> removeWorkLedger(WorkLedgerService service, Integer id) {
return service.removeById(id) ? success("删除成功") : fail("删除失败");
}
protected ApiResult<?> updateBatchWorkLedger(WorkLedgerService service, BatchParam<WorkLedger> batchParam, String ledgerType) {
if (batchParam.getData() != null) {
batchParam.getData().setLedgerType(ledgerType);
}
return batchParam.update(service, "id") ? success("修改成功") : fail("修改失败");
}
protected ApiResult<?> removeBatchWorkLedger(WorkLedgerService service, List<Integer> ids) {
return service.removeByIds(ids) ? success("删除成功") : fail("删除失败");
}
}

View File

@@ -0,0 +1,200 @@
package com.gxwebsoft.gxmu.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.Organization;
import com.gxwebsoft.common.system.service.OrganizationService;
import com.gxwebsoft.gxmu.entity.ClassInfo;
import com.gxwebsoft.gxmu.model.ClassImportItem;
import com.gxwebsoft.gxmu.param.ClassInfoParam;
import com.gxwebsoft.gxmu.service.ClassInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* 班级管理控制器
*/
@Api(tags = "班级管理")
@RestController
@RequestMapping("/api/gxmu/class")
public class ClassInfoController extends BaseController {
private static final int IMPORT_PARENT_ID = 24;
@Resource
private ClassInfoService classInfoService;
@Resource
private OrganizationService organizationService;
@ApiOperation("分页查询班级")
@GetMapping("/page")
public ApiResult<PageResult<ClassInfo>> page(ClassInfoParam param) {
param.setTenantId(getTenantId());
return success(classInfoService.pageRel(param));
}
@ApiOperation("查询班级列表")
@GetMapping()
public ApiResult<List<ClassInfo>> list(ClassInfoParam param) {
param.setTenantId(getTenantId());
return success(classInfoService.listRel(param));
}
@ApiOperation("根据id查询班级")
@GetMapping("/{id}")
public ApiResult<ClassInfo> get(@PathVariable("id") Integer id) {
return success(classInfoService.getByIdRel(id, getTenantId()));
}
@OperationLog
@ApiOperation("添加班级")
@PostMapping()
public ApiResult<?> save(@RequestBody ClassInfo classInfo) {
if (classInfo.getCollegeId() == null) {
return fail("请选择所属机构");
}
Organization organization = organizationService.getOne(new LambdaQueryWrapper<Organization>()
.eq(Organization::getOrganizationId, classInfo.getCollegeId())
.eq(Organization::getTenantId, getTenantId()));
if (organization == null) {
return fail("所属机构不存在");
}
classInfo.setTenantId(getTenantId());
return classInfoService.save(classInfo) ? success("添加成功") : fail("添加失败");
}
@OperationLog
@ApiOperation("修改班级")
@PutMapping()
public ApiResult<?> update(@RequestBody ClassInfo classInfo) {
if (classInfo.getCollegeId() == null) {
return fail("请选择所属机构");
}
Organization organization = organizationService.getOne(new LambdaQueryWrapper<Organization>()
.eq(Organization::getOrganizationId, classInfo.getCollegeId())
.eq(Organization::getTenantId, getTenantId()));
if (organization == null) {
return fail("所属机构不存在");
}
classInfo.setTenantId(getTenantId());
return classInfoService.updateById(classInfo) ? success("修改成功") : fail("修改失败");
}
@OperationLog
@Transactional(rollbackFor = Exception.class)
@ApiOperation("批量导入班级")
@PostMapping("/import")
public ApiResult<?> importBatch(@RequestBody List<ClassImportItem> items) {
if (items == null || items.isEmpty()) {
return fail("导入数据不能为空");
}
int tenantId = getTenantId();
int successCount = 0;
int skipCount = 0;
Set<String> batchKeys = new HashSet<>();
for (int index = 0; index < items.size(); index++) {
ClassImportItem item = items.get(index);
int rowNo = index + 2;
String collegeName = item.getCollegeName() == null ? "" : item.getCollegeName().trim();
String className = item.getClassName() == null ? "" : item.getClassName().trim();
if (collegeName.isEmpty()) {
return fail("" + rowNo + " 行缺少所属学院");
}
if (className.isEmpty()) {
return fail("" + rowNo + " 行缺少班级名称");
}
Organization organization = getOrCreateImportOrganization(collegeName, tenantId);
String batchKey = organization.getOrganizationId() + "_" + className;
if (!batchKeys.add(batchKey)) {
skipCount++;
continue;
}
ClassInfo exists = classInfoService.getOne(new LambdaQueryWrapper<ClassInfo>()
.eq(ClassInfo::getTenantId, tenantId)
.eq(ClassInfo::getCollegeId, organization.getOrganizationId())
.eq(ClassInfo::getClassName, className));
if (exists != null) {
skipCount++;
continue;
}
ClassInfo classInfo = new ClassInfo();
classInfo.setTenantId(tenantId);
classInfo.setCollegeId(organization.getOrganizationId());
classInfo.setClassName(className);
classInfo.setClassCode(emptyToNull(item.getClassCode()));
classInfo.setGradeYear(item.getGradeYear());
classInfo.setCounselorName(emptyToNull(item.getCounselorName()));
classInfo.setCounselorPhone(emptyToNull(item.getCounselorPhone()));
classInfo.setStudentCount(item.getStudentCount());
classInfo.setSortNumber(item.getSortNumber() == null ? 0 : item.getSortNumber());
classInfo.setStatus(item.getStatus() == null ? 1 : item.getStatus());
classInfo.setRemark(emptyToNull(item.getRemark()));
if (!classInfoService.save(classInfo)) {
return fail("" + rowNo + " 行导入失败");
}
successCount++;
}
return success("成功导入 " + successCount + " 条班级数据,跳过重复数据 " + skipCount + "");
}
@OperationLog
@ApiOperation("删除班级")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return classInfoService.remove(new LambdaQueryWrapper<ClassInfo>()
.eq(ClassInfo::getId, id)
.eq(ClassInfo::getTenantId, getTenantId())) ? success("删除成功") : fail("删除失败");
}
@OperationLog
@ApiOperation("批量修改班级")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ClassInfo> batchParam) {
return batchParam.update(classInfoService, "id") ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除班级")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return classInfoService.remove(new LambdaQueryWrapper<ClassInfo>()
.in(ClassInfo::getId, ids)
.eq(ClassInfo::getTenantId, getTenantId())) ? success("删除成功") : fail("删除失败");
}
private Organization getOrCreateImportOrganization(String collegeName, Integer tenantId) {
Organization organization = organizationService.getOne(new LambdaQueryWrapper<Organization>()
.eq(Organization::getTenantId, tenantId)
.eq(Organization::getParentId, IMPORT_PARENT_ID)
.eq(Organization::getOrganizationName, collegeName));
if (organization != null) {
return organization;
}
Organization insert = new Organization();
insert.setTenantId(tenantId);
insert.setParentId(IMPORT_PARENT_ID);
insert.setOrganizationName(collegeName);
insert.setOrganizationFullName(collegeName);
insert.setSortNumber(0);
organizationService.save(insert);
return insert;
}
private String emptyToNull(String value) {
if (value == null) {
return null;
}
String text = value.trim();
return text.isEmpty() ? null : text;
}
}

View File

@@ -0,0 +1,90 @@
package com.gxwebsoft.gxmu.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.gxmu.entity.College;
import com.gxwebsoft.gxmu.param.CollegeParam;
import com.gxwebsoft.gxmu.service.CollegeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 学院管理控制器
*/
@Api(tags = "学院管理")
@RestController
@RequestMapping("/api/gxmu/college")
public class CollegeController extends BaseController {
@Resource
private CollegeService collegeService;
@ApiOperation("分页查询学院")
@GetMapping("/page")
public ApiResult<PageResult<College>> page(CollegeParam param) {
param.setTenantId(getTenantId());
return success(collegeService.pageRel(param));
}
@ApiOperation("查询学院列表")
@GetMapping()
public ApiResult<List<College>> list(CollegeParam param) {
param.setTenantId(getTenantId());
return success(collegeService.listRel(param));
}
@ApiOperation("根据id查询学院")
@GetMapping("/{id}")
public ApiResult<College> get(@PathVariable("id") Integer id) {
return success(collegeService.getByIdRel(id, getTenantId()));
}
@OperationLog
@ApiOperation("添加学院")
@PostMapping()
public ApiResult<?> save(@RequestBody College college) {
college.setTenantId(getTenantId());
return collegeService.save(college) ? success("添加成功") : fail("添加失败");
}
@OperationLog
@ApiOperation("修改学院")
@PutMapping()
public ApiResult<?> update(@RequestBody College college) {
college.setTenantId(getTenantId());
return collegeService.updateById(college) ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("删除学院")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return collegeService.remove(new LambdaQueryWrapper<College>()
.eq(College::getId, id)
.eq(College::getTenantId, getTenantId())) ? success("删除成功") : fail("删除失败");
}
@OperationLog
@ApiOperation("批量修改学院")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<College> batchParam) {
return batchParam.update(collegeService, "id") ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除学院")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return collegeService.remove(new LambdaQueryWrapper<College>()
.in(College::getId, ids)
.eq(College::getTenantId, getTenantId())) ? success("删除成功") : fail("删除失败");
}
}

View File

@@ -0,0 +1,61 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.gxmu.entity.CrossSchoolActivityArticle;
import com.gxwebsoft.gxmu.param.CrossSchoolActivityArticleParam;
import com.gxwebsoft.gxmu.service.CrossSchoolActivityArticleService;
import com.gxwebsoft.gxmu.service.CrossSchoolActivityCrawlerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* 跨校活动情报文章控制器
*
* @author Codex
* @since 2026-07-04
*/
@Api(tags = "跨校活动情报文章")
@RestController
@RequestMapping("/api/gxmu/cross-school-activity-article")
public class CrossSchoolActivityArticleController extends BaseController {
@Resource
private CrossSchoolActivityArticleService crossSchoolActivityArticleService;
@Resource
private CrossSchoolActivityCrawlerService crossSchoolActivityCrawlerService;
@ApiOperation("分页查询跨校活动情报文章")
@GetMapping("/page")
public ApiResult<PageResult<CrossSchoolActivityArticle>> page(CrossSchoolActivityArticleParam param) {
return success(crossSchoolActivityArticleService.pageRel(param));
}
@ApiOperation("查询跨校活动情报文章")
@GetMapping()
public ApiResult<List<CrossSchoolActivityArticle>> list(CrossSchoolActivityArticleParam param) {
return success(crossSchoolActivityArticleService.listRel(param));
}
@ApiOperation("根据id查询跨校活动情报文章")
@GetMapping("/{id}")
public ApiResult<CrossSchoolActivityArticle> get(@PathVariable("id") Integer id) {
return success(crossSchoolActivityArticleService.getByIdRel(id));
}
@ApiOperation("同步跨校活动情报文章")
@PostMapping("/sync")
public ApiResult<Integer> sync() {
return success(crossSchoolActivityCrawlerService.syncAll());
}
}

View File

@@ -0,0 +1,175 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.gxmu.service.DeclareService;
import com.gxwebsoft.gxmu.entity.Declare;
import com.gxwebsoft.gxmu.param.DeclareParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import cn.hutool.core.util.StrUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 申报管理控制器
*
* @author LX
* @since 2026-03-28 15:06:52
*/
@Api(tags = "申报管理管理")
@RestController
@RequestMapping("/api/gxmu/declare")
public class DeclareController extends BaseController {
private static final String TZBCY_MODULE = "gxmu_tzbcy_form";
@Resource
private DeclareService declareService;
@ApiOperation("分页查询申报管理")
@GetMapping("/page")
public ApiResult<PageResult<Declare>> page(DeclareParam param) {
// 使用关联查询
return success(declareService.pageRel(param));
}
@ApiOperation("分页查询当前用户申报管理")
@GetMapping("/userPage")
public ApiResult<PageResult<Declare>> userPage(DeclareParam param) {
Integer loginUserId = getLoginUserId();
param.setUserId(loginUserId == null ? null : loginUserId.longValue());
return success(declareService.pageRel(param));
}
@ApiOperation("查询全部申报管理")
@GetMapping()
public ApiResult<List<Declare>> list(DeclareParam param) {
// 使用关联查询
return success(declareService.listRel(param));
}
@ApiOperation("根据id查询申报管理")
@GetMapping("/{id}")
public ApiResult<Declare> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(declareService.getByIdRel(id));
}
@ApiOperation("添加申报管理")
@PostMapping()
public ApiResult<?> save(@RequestBody Declare declare) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
declare.setUserId(loginUser.getUserId());
}
String validateMessage = normalizeAndValidateDeclare(declare);
if (validateMessage != null) {
return fail(validateMessage);
}
if (declareService.save(declare)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改申报管理")
@PutMapping()
public ApiResult<?> update(@RequestBody Declare declare) {
String validateMessage = normalizeAndValidateDeclare(declare);
if (validateMessage != null) {
return fail(validateMessage);
}
if (declareService.updateById(declare)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除申报管理")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (declareService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加申报管理")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Declare> list) {
if (declareService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改申报管理")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<Declare> batchParam) {
if (batchParam.update(declareService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除申报管理")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (declareService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
private String normalizeAndValidateDeclare(Declare declare) {
if (declare == null) {
return "参数不正确";
}
if (!TZBCY_MODULE.equals(declare.getModule())) {
declare.setProjectType(null);
declare.setProjectGroup(null);
declare.setFormProjectType(null);
declare.setFormProjectGroup(null);
declare.setPublicProjectType(null);
declare.setPublicProjectGroup(null);
return null;
}
if (StrUtil.isBlank(declare.getFormProjectType())) {
if (StrUtil.isNotBlank(declare.getProjectType())) {
declare.setFormProjectType(declare.getProjectType());
} else {
return "挑战杯申报请配置项目申报表项目类型";
}
}
if (StrUtil.isBlank(declare.getFormProjectGroup())) {
if (StrUtil.isNotBlank(declare.getProjectGroup())) {
declare.setFormProjectGroup(declare.getProjectGroup());
} else {
return "挑战杯申报请配置项目申报表项目分组";
}
}
if (StrUtil.isBlank(declare.getPublicProjectType())) {
declare.setPublicProjectType(declare.getFormProjectType());
}
if (StrUtil.isBlank(declare.getPublicProjectGroup())) {
declare.setPublicProjectGroup(declare.getFormProjectGroup());
}
declare.setFormProjectType(declare.getFormProjectType().trim());
declare.setFormProjectGroup(declare.getFormProjectGroup().trim());
declare.setPublicProjectType(declare.getPublicProjectType().trim());
declare.setPublicProjectGroup(declare.getPublicProjectGroup().trim());
declare.setProjectType(declare.getFormProjectType());
declare.setProjectGroup(declare.getFormProjectGroup());
return null;
}
}

View File

@@ -0,0 +1,84 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.gxmu.entity.WorkLedger;
import com.gxwebsoft.gxmu.param.WorkLedgerParam;
import com.gxwebsoft.gxmu.service.WorkLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Api(tags = "基层团支部工作台账")
@RestController
@RequestMapping("/api/gxmu/league-branch-ledger")
public class LeagueBranchLedgerController extends BaseWorkLedgerControllerSupport {
private static final String LEDGER_TYPE = "league_branch";
@Resource
private WorkLedgerService workLedgerService;
@ApiOperation("分页查询基层团支部工作台账")
@GetMapping("/page")
public ApiResult<PageResult<WorkLedger>> page(WorkLedgerParam param) {
return pageWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("分页查询当前用户基层团支部工作台账")
@GetMapping("/userPage")
public ApiResult<PageResult<WorkLedger>> userPage(WorkLedgerParam param) {
return userPageWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("查询全部基层团支部工作台账")
@GetMapping()
public ApiResult<List<WorkLedger>> list(WorkLedgerParam param) {
return listWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("根据id查询基层团支部工作台账")
@GetMapping("/{id}")
public ApiResult<WorkLedger> get(@PathVariable("id") Integer id) {
return getWorkLedger(workLedgerService, id);
}
@OperationLog
@ApiOperation("添加基层团支部工作台账")
@PostMapping()
public ApiResult<?> save(@RequestBody WorkLedger workLedger) {
return saveWorkLedger(workLedgerService, workLedger, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("修改基层团支部工作台账")
@PutMapping()
public ApiResult<?> update(@RequestBody WorkLedger workLedger) {
return updateWorkLedger(workLedgerService, workLedger, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("删除基层团支部工作台账")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return removeWorkLedger(workLedgerService, id);
}
@OperationLog
@ApiOperation("批量修改基层团支部工作台账")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<WorkLedger> batchParam) {
return updateBatchWorkLedger(workLedgerService, batchParam, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("批量删除基层团支部工作台账")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return removeBatchWorkLedger(workLedgerService, ids);
}
}

View File

@@ -0,0 +1,84 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.gxmu.entity.WorkLedger;
import com.gxwebsoft.gxmu.param.WorkLedgerParam;
import com.gxwebsoft.gxmu.service.WorkLedgerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
@Api(tags = "基层团委工作台账")
@RestController
@RequestMapping("/api/gxmu/league-committee-ledger")
public class LeagueCommitteeLedgerController extends BaseWorkLedgerControllerSupport {
private static final String LEDGER_TYPE = "league_committee";
@Resource
private WorkLedgerService workLedgerService;
@ApiOperation("分页查询基层团委工作台账")
@GetMapping("/page")
public ApiResult<PageResult<WorkLedger>> page(WorkLedgerParam param) {
return pageWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("分页查询当前用户基层团委工作台账")
@GetMapping("/userPage")
public ApiResult<PageResult<WorkLedger>> userPage(WorkLedgerParam param) {
return userPageWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("查询全部基层团委工作台账")
@GetMapping()
public ApiResult<List<WorkLedger>> list(WorkLedgerParam param) {
return listWorkLedgers(workLedgerService, param, LEDGER_TYPE);
}
@ApiOperation("根据id查询基层团委工作台账")
@GetMapping("/{id}")
public ApiResult<WorkLedger> get(@PathVariable("id") Integer id) {
return getWorkLedger(workLedgerService, id);
}
@OperationLog
@ApiOperation("添加基层团委工作台账")
@PostMapping()
public ApiResult<?> save(@RequestBody WorkLedger workLedger) {
return saveWorkLedger(workLedgerService, workLedger, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("修改基层团委工作台账")
@PutMapping()
public ApiResult<?> update(@RequestBody WorkLedger workLedger) {
return updateWorkLedger(workLedgerService, workLedger, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("删除基层团委工作台账")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return removeWorkLedger(workLedgerService, id);
}
@OperationLog
@ApiOperation("批量修改基层团委工作台账")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<WorkLedger> batchParam) {
return updateBatchWorkLedger(workLedgerService, batchParam, LEDGER_TYPE);
}
@OperationLog
@ApiOperation("批量删除基层团委工作台账")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return removeBatchWorkLedger(workLedgerService, ids);
}
}

View File

@@ -0,0 +1,190 @@
package com.gxwebsoft.gxmu.controller;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.FileRecord;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.FileRecordService;
import com.gxwebsoft.gxmu.entity.QmgcForm;
import com.gxwebsoft.gxmu.param.QmgcFormParam;
import com.gxwebsoft.gxmu.service.QmgcFormService;
import com.gxwebsoft.gxmu.service.ReviewFlowStarterService;
import com.gxwebsoft.gxmu.util.GxmuQueryHelper;
import com.gxwebsoft.gxmu.util.QmgcDocxExportUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.zip.ZipOutputStream;
/**
* 青马工程培训班学员登记表控制器
*/
@Api(tags = "青马工程培训班学员登记表管理")
@RestController
@RequestMapping("/api/gxmu/qmgc-form")
public class QmgcFormController extends BaseController {
@Resource
private QmgcFormService qmgcFormService;
@Resource
private ReviewFlowStarterService reviewFlowStarterService;
@Resource
private FileRecordService fileRecordService;
@Value("${config.upload-path}")
private String uploadPath;
@Value("${config.server-url}")
private String requestURL;
@ApiOperation("分页查询青马工程培训班学员登记表")
@GetMapping("/page")
public ApiResult<PageResult<QmgcForm>> page(QmgcFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
PageParam<QmgcForm, QmgcFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(qmgcFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "phone", "school_info")).getRecords(), page.getTotal()));
}
@ApiOperation("分页查询当前用户青马工程培训班学员登记表")
@GetMapping("/userPage")
public ApiResult<PageResult<QmgcForm>> userPage(QmgcFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<QmgcForm, QmgcFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(qmgcFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "phone", "school_info")).getRecords(), page.getTotal()));
}
@ApiOperation("查询全部青马工程培训班学员登记表")
@GetMapping()
public ApiResult<List<QmgcForm>> list(QmgcFormParam param) {
PageParam<QmgcForm, QmgcFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(qmgcFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "phone", "school_info"))));
}
@OperationLog
@ApiOperation("导出青马工程培训班学员登记表")
@PostMapping("/export")
public ApiResult<?> export(@RequestBody QmgcFormParam param, HttpServletRequest request) throws IOException {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<QmgcForm, QmgcFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
List<QmgcForm> records = qmgcFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "phone", "school_info")));
if (records == null || records.isEmpty()) {
return fail("暂无可导出的数据");
}
String yearText = resolveYearText(param, records);
String relativePath = "file/docx/" + yearText + "年青马工程培训班学员登记表_" + System.currentTimeMillis() + ".zip";
File targetFile = new File(uploadPath + relativePath);
File parentFile = targetFile.getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
try (FileOutputStream outputStream = new FileOutputStream(targetFile);
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
QmgcDocxExportUtil.writeExportZip(zipOutputStream, records);
zipOutputStream.finish();
}
FileRecord result = new FileRecord();
result.setCreateUserId(getLoginUserId());
result.setName(targetFile.getName());
result.setPath(targetFile.getAbsolutePath());
result.setContentType("application/zip");
result.setUrl(requestURL + "/" + relativePath);
fileRecordService.save(result);
return success(result);
}
@ApiOperation("根据id查询青马工程培训班学员登记表")
@GetMapping("/{id}")
public ApiResult<QmgcForm> get(@PathVariable("id") Integer id) {
return success(qmgcFormService.getById(id));
}
@OperationLog
@ApiOperation("添加青马工程培训班学员登记表")
@PostMapping()
public ApiResult<?> save(@RequestBody QmgcForm qmgcForm) {
User loginUser = getLoginUser();
if (loginUser != null) {
qmgcForm.setUserId(loginUser.getUserId());
}
if (qmgcFormService.save(qmgcForm)) {
reviewFlowStarterService.startReview("gxmu_qmgc_form", qmgcForm.getId());
return success("添加成功");
}
return fail("添加失败");
}
@OperationLog
@ApiOperation("修改青马工程培训班学员登记表")
@PutMapping()
public ApiResult<?> update(@RequestBody QmgcForm qmgcForm) {
if (qmgcFormService.updateById(qmgcForm)) {
reviewFlowStarterService.restartReviewWhenLastRejected("gxmu_qmgc_form", qmgcForm.getId());
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("删除青马工程培训班学员登记表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return qmgcFormService.removeById(id) ? success("删除成功") : fail("删除失败");
}
@OperationLog
@ApiOperation("批量修改青马工程培训班学员登记表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<QmgcForm> batchParam) {
return batchParam.update(qmgcFormService, "id") ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除青马工程培训班学员登记表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return qmgcFormService.removeByIds(ids) ? success("删除成功") : fail("删除失败");
}
private String resolveYearText(QmgcFormParam param, List<QmgcForm> records) {
if (param.getYear() != null) {
return String.valueOf(param.getYear());
}
if (records != null && !records.isEmpty() && records.get(0).getYear() != null) {
return String.valueOf(records.get(0).getYear());
}
return String.valueOf(java.time.LocalDate.now().getYear());
}
}

View File

@@ -0,0 +1,122 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.gxmu.service.ReviewFlowConfigService;
import com.gxwebsoft.gxmu.entity.ReviewFlowConfig;
import com.gxwebsoft.gxmu.param.ReviewFlowConfigParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 控制器
*
* @author LX
* @since 2026-03-18 10:37:18
*/
@Api(tags = "管理")
@RestController
@RequestMapping("/api/gxmu/review-flow-config")
public class ReviewFlowConfigController extends BaseController {
@Resource
private ReviewFlowConfigService reviewFlowConfigService;
@ApiOperation("分页查询")
@GetMapping("/page")
public ApiResult<PageResult<ReviewFlowConfig>> page(ReviewFlowConfigParam param) {
// 使用关联查询
return success(reviewFlowConfigService.pageRel(param));
}
@ApiOperation("分页查询当前用户")
@GetMapping("/userPage")
public ApiResult<PageResult<ReviewFlowConfig>> userPage(ReviewFlowConfigParam param) {
param.setUserId(getLoginUserId());
return success(reviewFlowConfigService.pageRel(param));
}
@ApiOperation("查询全部")
@GetMapping()
public ApiResult<List<ReviewFlowConfig>> list(ReviewFlowConfigParam param) {
// 使用关联查询
return success(reviewFlowConfigService.listRel(param));
}
@PreAuthorize("hasAuthority('gxmu:reviewFlowConfig:list')")
@ApiOperation("根据id查询")
@GetMapping("/{id}")
public ApiResult<ReviewFlowConfig> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(reviewFlowConfigService.getByIdRel(id));
}
@ApiOperation("添加")
@PostMapping()
public ApiResult<?> save(@RequestBody ReviewFlowConfig reviewFlowConfig) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
reviewFlowConfig.setUserId(loginUser.getUserId());
}
if (reviewFlowConfigService.save(reviewFlowConfig)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@PutMapping()
public ApiResult<?> update(@RequestBody ReviewFlowConfig reviewFlowConfig) {
if (reviewFlowConfigService.updateById(reviewFlowConfig)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (reviewFlowConfigService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ReviewFlowConfig> list) {
if (reviewFlowConfigService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ReviewFlowConfig> batchParam) {
if (batchParam.update(reviewFlowConfigService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (reviewFlowConfigService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -0,0 +1,126 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.gxmu.service.ReviewFlowService;
import com.gxwebsoft.gxmu.entity.ReviewFlow;
import com.gxwebsoft.gxmu.param.ReviewFlowParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* 审核流控制器
*
* @author LX
* @since 2026-03-18 10:37:18
*/
@Api(tags = "审核流管理")
@RestController
@RequestMapping("/api/gxmu/review-flow")
public class ReviewFlowController extends BaseController {
@Resource
private ReviewFlowService reviewFlowService;
@ApiOperation("分页查询审核流")
@GetMapping("/page")
public ApiResult<PageResult<ReviewFlow>> page(ReviewFlowParam param) {
// 使用关联查询
return success(reviewFlowService.pageRel(param));
}
@ApiOperation("分页查询当前用户审核流")
@GetMapping("/userPage")
public ApiResult<PageResult<ReviewFlow>> userPage(ReviewFlowParam param) {
param.setUserId(getLoginUserId());
return success(reviewFlowService.pageRel(param));
}
@ApiOperation("查询全部审核流")
@GetMapping()
public ApiResult<List<ReviewFlow>> list(ReviewFlowParam param) {
// 使用关联查询
return success(reviewFlowService.listRel(param));
}
@ApiOperation("根据id查询审核流")
@GetMapping("/{id}")
public ApiResult<ReviewFlow> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(reviewFlowService.getByIdRel(id));
}
@ApiOperation("添加审核流")
@PostMapping()
public ApiResult<?> save(@RequestBody ReviewFlow reviewFlow) {
// 记录当前登录用户id
// ReviewFlow checkByName = reviewFlowService.getByTitle(reviewFlow.getTitle());
// if (checkByName != null) {
// return fail("该名称已存在");
// }
if (reviewFlowService.save(reviewFlow)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改审核流")
@PutMapping()
public ApiResult<?> update(@RequestBody ReviewFlow reviewFlow) {
// ReviewFlow checkByName = reviewFlowService.getByTitle(reviewFlow.getTitle());
// if (checkByName != null && !Objects.equals(checkByName.getId(), reviewFlow.getId())) {
// return fail("该名称已存在");
// }
if (reviewFlowService.updateById(reviewFlow)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除审核流")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (reviewFlowService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加审核流")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ReviewFlow> list) {
if (reviewFlowService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改审核流")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ReviewFlow> batchParam) {
if (batchParam.update(reviewFlowService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除审核流")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (reviewFlowService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -0,0 +1,194 @@
package com.gxwebsoft.gxmu.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.gxmu.entity.ReviewFlow;
import com.gxwebsoft.gxmu.entity.ReviewFlowConfig;
import com.gxwebsoft.gxmu.service.ReviewFlowConfigService;
import com.gxwebsoft.gxmu.service.ReviewFlowService;
import com.gxwebsoft.gxmu.service.ReviewListService;
import com.gxwebsoft.gxmu.entity.ReviewList;
import com.gxwebsoft.gxmu.param.ReviewListParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 审核列表控制器
*
* @author LX
* @since 2026-03-18 15:50:51
*/
@Api(tags = "审核列表管理")
@RestController
@RequestMapping("/api/gxmu/review-list")
public class ReviewListController extends BaseController {
@Resource
private ReviewListService reviewListService;
@Resource
private ReviewFlowConfigService reviewFlowConfigService;
@Resource
private ReviewFlowService reviewFlowService;
@ApiOperation("分页查询审核列表")
@GetMapping("/page")
public ApiResult<PageResult<ReviewList>> page(ReviewListParam param) {
applyRoleScopeForReviewList(param);
applyBackendOrganizationScopeForReviewList(param);
// 使用关联查询
return success(reviewListService.pageRel(param));
}
@ApiOperation("分页查询聚合后的审核列表")
@GetMapping("/groupPage")
public ApiResult<PageResult<ReviewList>> groupPage(ReviewListParam param) {
applyRoleScopeForReviewList(param);
applyBackendOrganizationScopeForReviewList(param);
return success(reviewListService.pageGroupRel(param));
}
@ApiOperation("分页查询当前用户审核列表")
@GetMapping("/userPage")
public ApiResult<PageResult<ReviewList>> userPage(ReviewListParam param) {
param.setUserId(getLoginUserId());
return success(reviewListService.pageRel(param));
}
@ApiOperation("查询全部审核列表")
@GetMapping()
public ApiResult<List<ReviewList>> list(ReviewListParam param) {
// 使用关联查询
return success(reviewListService.listRel(param));
}
@PreAuthorize("hasAuthority('gxmu:reviewList:list')")
@ApiOperation("根据id查询审核列表")
@GetMapping("/{id}")
public ApiResult<ReviewList> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(reviewListService.getByIdRel(id));
}
@ApiOperation("添加审核列表")
@PostMapping()
public ApiResult<?> save(@RequestBody ReviewList reviewList) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
reviewList.setUserId(loginUser.getUserId());
}
if (reviewListService.save(reviewList)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改审核列表")
@PutMapping()
public ApiResult<?> update(@RequestBody ReviewList reviewList) {
if (reviewListService.updateById(reviewList)) {
// 通过进入下一个
if (reviewList.getStatus().equals(1)) {
ReviewFlowConfig reviewFlowConfig = reviewFlowConfigService.getByModule(reviewList.getModule());
if (reviewFlowConfig != null) {
ReviewFlow reviewFlow = reviewFlowService.getById(reviewFlowConfig.getFlowId());
if (reviewFlow != null) {
List<ReviewFlow> reviewFlowList = reviewFlowService.listByTitle(reviewFlow.getTitle());
if (reviewFlowList != null && !reviewFlowList.isEmpty()) {
if (reviewList.getSortNumber() + 1 < reviewFlowList.size()) {
ReviewFlow nextOne = reviewFlowList.get(reviewList.getSortNumber() + 1);
if (nextOne != null) {
ReviewList nextReviewList = new ReviewList();
nextReviewList.setPk(reviewList.getPk());
nextReviewList.setModule(reviewList.getModule());
nextReviewList.setUserId(nextOne.getReviewUserId());
nextReviewList.setSortNumber(reviewList.getSortNumber() + 1);
reviewListService.save(nextReviewList);
}
}
// switch (reviewList.getModule()) {
// case "cms_manuscript": {
// // 社团指导老师/二级学院团委书记-团委社团管理部/团委办公室-学校团委组织宣传部,拟发布后,再提交给团委副书记-团委书记
// if ()
// }
// }
}
}
}
}
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除审核列表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (reviewListService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加审核列表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ReviewList> list) {
if (reviewListService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改审核列表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<ReviewList> batchParam) {
if (batchParam.update(reviewListService, "id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除审核列表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (reviewListService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
private void applyBackendOrganizationScopeForReviewList(ReviewListParam param) {
if (!isBackendAccess(param) || !hasBackendScopeRole()) {
return;
}
User loginUser = getLoginUser();
if (loginUser == null || loginUser.getOrganizationId() == null) {
return;
}
com.gxwebsoft.common.system.param.UserParam userParam = new com.gxwebsoft.common.system.param.UserParam();
userParam.setBackendAccess(true);
applyBackendOrganizationScope(userParam);
param.setOrganizationIds(userParam.getOrganizationIds());
}
private void applyRoleScopeForReviewList(ReviewListParam param) {
java.util.Set<String> roleCodes = getLoginUserRoleCodes();
if (roleCodes.contains("SchoolYouthLeagueCommittee") || roleCodes.contains("admin") || roleCodes.contains("superAdmin")) {
return;
}
Integer loginUserId = getLoginUserId();
if (loginUserId != null) {
param.setUserId(loginUserId);
}
}
}

View File

@@ -0,0 +1,233 @@
package com.gxwebsoft.gxmu.controller;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.FileRecord;
import com.gxwebsoft.common.system.entity.Organization;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.FileRecordService;
import com.gxwebsoft.common.system.service.OrganizationService;
import com.gxwebsoft.gxmu.entity.SjqnForm;
import com.gxwebsoft.gxmu.param.SjqnFormParam;
import com.gxwebsoft.gxmu.service.ReviewFlowStarterService;
import com.gxwebsoft.gxmu.service.SjqnFormService;
import com.gxwebsoft.gxmu.util.GxmuQueryHelper;
import com.gxwebsoft.gxmu.util.SjqnDocxExportUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.zip.ZipOutputStream;
/**
* 十佳青年申报表控制器
*/
@Api(tags = "十佳青年申报表管理")
@RestController
@RequestMapping("/api/gxmu/sjqn-form")
public class SjqnFormController extends BaseController {
@Resource
private SjqnFormService sjqnFormService;
@Resource
private ReviewFlowStarterService reviewFlowStarterService;
@Resource
private FileRecordService fileRecordService;
@Resource
private OrganizationService organizationService;
@Value("${config.upload-path}")
private String uploadPath;
@Value("${config.server-url}")
private String requestURL;
@ApiOperation("分页查询十佳青年申报表")
@GetMapping("/page")
public ApiResult<PageResult<SjqnForm>> page(SjqnFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
PageParam<SjqnForm, SjqnFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(sjqnFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "unit_name", "apply_type")).getRecords(), page.getTotal()));
}
@ApiOperation("分页查询当前用户十佳青年申报表")
@GetMapping("/userPage")
public ApiResult<PageResult<SjqnForm>> userPage(SjqnFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<SjqnForm, SjqnFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(sjqnFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "unit_name", "apply_type")).getRecords(), page.getTotal()));
}
@ApiOperation("查询全部十佳青年申报表")
@GetMapping()
public ApiResult<List<SjqnForm>> list(SjqnFormParam param) {
PageParam<SjqnForm, SjqnFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(sjqnFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "unit_name", "apply_type"))));
}
@OperationLog
@ApiOperation("导出十佳青年岗位能手申报材料")
@PostMapping("/export")
public ApiResult<?> export(@RequestBody SjqnFormParam param, HttpServletRequest request) throws IOException {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<SjqnForm, SjqnFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
List<SjqnForm> records = sjqnFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "unit_name", "apply_type")));
if (records == null || records.isEmpty()) {
return fail("暂无可导出的数据");
}
User loginUser = getLoginUser();
Map<Integer, String> contactMap = new LinkedHashMap<>();
for (SjqnForm form : records) {
contactMap.put(form.getId(), loginUser == null ? "" : valueOf(loginUser.getPhone()));
}
SjqnDocxExportUtil.SummaryMeta summaryMeta = new SjqnDocxExportUtil.SummaryMeta();
summaryMeta.setYearText(resolveYearText(param, records));
summaryMeta.setReporter(loginUser == null ? "" : resolveReporter(loginUser));
summaryMeta.setContact(loginUser == null ? "" : valueOf(loginUser.getPhone()));
summaryMeta.setOrganizationPartyOpinion(resolveOrganizationPartyOpinion(loginUser));
String relativePath = "file/docx/十佳青年岗位能手申报材料_" + System.currentTimeMillis() + ".zip";
File targetFile = new File(uploadPath + relativePath);
File parentFile = targetFile.getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
try (FileOutputStream outputStream = new FileOutputStream(targetFile);
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
SjqnDocxExportUtil.writeExportZip(zipOutputStream, records, summaryMeta, contactMap);
zipOutputStream.finish();
}
FileRecord result = new FileRecord();
result.setCreateUserId(getLoginUserId());
result.setName(targetFile.getName());
result.setPath(targetFile.getAbsolutePath());
result.setContentType("application/zip");
result.setUrl(requestURL + "/" + relativePath);
fileRecordService.save(result);
return success(result);
}
@ApiOperation("根据id查询十佳青年申报表")
@GetMapping("/{id}")
public ApiResult<SjqnForm> get(@PathVariable("id") Integer id) {
return success(sjqnFormService.getById(id));
}
@OperationLog
@ApiOperation("添加十佳青年申报表")
@PostMapping()
public ApiResult<?> save(@RequestBody SjqnForm sjqnForm) {
User loginUser = getLoginUser();
if (loginUser != null) {
sjqnForm.setUserId(loginUser.getUserId());
}
if (sjqnFormService.save(sjqnForm)) {
reviewFlowStarterService.startReview("gxmu_sjqn", sjqnForm.getId());
return success("添加成功");
}
return fail("添加失败");
}
@OperationLog
@ApiOperation("修改十佳青年申报表")
@PutMapping()
public ApiResult<?> update(@RequestBody SjqnForm sjqnForm) {
if (sjqnFormService.updateById(sjqnForm)) {
reviewFlowStarterService.restartReviewWhenLastRejected("gxmu_sjqn", sjqnForm.getId());
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("删除十佳青年申报表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return sjqnFormService.removeById(id) ? success("删除成功") : fail("删除失败");
}
@OperationLog
@ApiOperation("批量修改十佳青年申报表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<SjqnForm> batchParam) {
return batchParam.update(sjqnFormService, "id") ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除十佳青年申报表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return sjqnFormService.removeByIds(ids) ? success("删除成功") : fail("删除失败");
}
private String resolveYearText(SjqnFormParam param, List<SjqnForm> records) {
if (param.getYear() != null) {
return String.valueOf(param.getYear());
}
if (records != null && !records.isEmpty() && records.get(0).getYear() != null) {
return String.valueOf(records.get(0).getYear());
}
return String.valueOf(java.time.LocalDate.now().getYear());
}
private String resolveReporter(User loginUser) {
if (loginUser == null) {
return "";
}
if (StrUtil.isNotBlank(loginUser.getRealName())) {
return loginUser.getRealName().trim();
}
if (StrUtil.isNotBlank(loginUser.getNickname())) {
return loginUser.getNickname().trim();
}
return valueOf(loginUser.getUsername());
}
private String resolveOrganizationPartyOpinion(User loginUser) {
if (loginUser == null || loginUser.getOrganizationId() == null) {
return "(盖章)";
}
Organization organization = organizationService.getByIdRel(loginUser.getOrganizationId());
String organizationName = organization == null ? "" : valueOf(organization.getOrganizationName());
return organizationName.isEmpty() ? "(盖章)" : organizationName + "(盖章)";
}
private String valueOf(String value) {
return value == null ? "" : value.trim();
}
}

View File

@@ -0,0 +1,233 @@
package com.gxwebsoft.gxmu.controller;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.FileRecord;
import com.gxwebsoft.common.system.entity.Organization;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.FileRecordService;
import com.gxwebsoft.common.system.service.OrganizationService;
import com.gxwebsoft.gxmu.entity.SjtbzbsjForm;
import com.gxwebsoft.gxmu.param.SjtbzbsjFormParam;
import com.gxwebsoft.gxmu.service.ReviewFlowStarterService;
import com.gxwebsoft.gxmu.service.SjtbzbsjFormService;
import com.gxwebsoft.gxmu.util.GxmuQueryHelper;
import com.gxwebsoft.gxmu.util.SjtbzbsjDocxExportUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.zip.ZipOutputStream;
/**
* 十佳团支部书记申报表控制器
*/
@Api(tags = "十佳团支部书记申报表管理")
@RestController
@RequestMapping("/api/gxmu/sjtbzbsj-form")
public class SjtbzbsjFormController extends BaseController {
@Resource
private SjtbzbsjFormService sjtbzbsjFormService;
@Resource
private ReviewFlowStarterService reviewFlowStarterService;
@Resource
private FileRecordService fileRecordService;
@Resource
private OrganizationService organizationService;
@Value("${config.upload-path}")
private String uploadPath;
@Value("${config.server-url}")
private String requestURL;
@ApiOperation("分页查询十佳团支部书记申报表")
@GetMapping("/page")
public ApiResult<PageResult<SjtbzbsjForm>> page(SjtbzbsjFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
PageParam<SjtbzbsjForm, SjtbzbsjFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(sjtbzbsjFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "college_class", "branch_name")).getRecords(), page.getTotal()));
}
@ApiOperation("分页查询当前用户十佳团支部书记申报表")
@GetMapping("/userPage")
public ApiResult<PageResult<SjtbzbsjForm>> userPage(SjtbzbsjFormParam param) {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<SjtbzbsjForm, SjtbzbsjFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(new PageResult<>(sjtbzbsjFormService.page(page,
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "college_class", "branch_name")).getRecords(), page.getTotal()));
}
@ApiOperation("查询全部十佳团支部书记申报表")
@GetMapping()
public ApiResult<List<SjtbzbsjForm>> list(SjtbzbsjFormParam param) {
PageParam<SjtbzbsjForm, SjtbzbsjFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
return success(sjtbzbsjFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "college_class", "branch_name"))));
}
@OperationLog
@ApiOperation("导出十佳团支部书记申报材料")
@PostMapping("/export")
public ApiResult<?> export(@RequestBody SjtbzbsjFormParam param, HttpServletRequest request) throws IOException {
applyBackendUserScope(param, param::setUserId, param::setUserIds, true);
if (param.getUserId() == null && (param.getUserIds() == null || param.getUserIds().isEmpty())) {
param.setUserId(getLoginUserId());
}
PageParam<SjtbzbsjForm, SjtbzbsjFormParam> page = new PageParam<>(param);
page.setDefaultOrder("id desc");
List<SjtbzbsjForm> records = sjtbzbsjFormService.list(page.getOrderWrapper(
GxmuQueryHelper.applyKeywords(page.getWrapper("keywords"), param.getKeywords(),
"name", "college_class", "branch_name")));
if (records == null || records.isEmpty()) {
return fail("暂无可导出的数据");
}
User loginUser = getLoginUser();
Map<Integer, String> contactMap = new LinkedHashMap<>();
for (SjtbzbsjForm form : records) {
contactMap.put(form.getId(), loginUser == null ? "" : valueOf(loginUser.getPhone()));
}
SjtbzbsjDocxExportUtil.SummaryMeta summaryMeta = new SjtbzbsjDocxExportUtil.SummaryMeta();
summaryMeta.setYearText(resolveYearText(param, records));
summaryMeta.setReporter(loginUser == null ? "" : resolveReporter(loginUser));
summaryMeta.setContact(loginUser == null ? "" : valueOf(loginUser.getPhone()));
summaryMeta.setOrganizationPartyOpinion(resolveOrganizationPartyOpinion(loginUser));
String relativePath = "file/docx/十佳团支部书记申报材料_" + System.currentTimeMillis() + ".zip";
File targetFile = new File(uploadPath + relativePath);
File parentFile = targetFile.getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
try (FileOutputStream outputStream = new FileOutputStream(targetFile);
ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
SjtbzbsjDocxExportUtil.writeExportZip(zipOutputStream, records, summaryMeta, contactMap);
zipOutputStream.finish();
}
FileRecord result = new FileRecord();
result.setCreateUserId(getLoginUserId());
result.setName(targetFile.getName());
result.setPath(targetFile.getAbsolutePath());
result.setContentType("application/zip");
result.setUrl(requestURL + "/" + relativePath);
fileRecordService.save(result);
return success(result);
}
@ApiOperation("根据id查询十佳团支部书记申报表")
@GetMapping("/{id}")
public ApiResult<SjtbzbsjForm> get(@PathVariable("id") Integer id) {
return success(sjtbzbsjFormService.getById(id));
}
@OperationLog
@ApiOperation("添加十佳团支部书记申报表")
@PostMapping()
public ApiResult<?> save(@RequestBody SjtbzbsjForm sjtbzbsjForm) {
User loginUser = getLoginUser();
if (loginUser != null) {
sjtbzbsjForm.setUserId(loginUser.getUserId());
}
if (sjtbzbsjFormService.save(sjtbzbsjForm)) {
reviewFlowStarterService.startReview("gxmu_sjtbzbsj", sjtbzbsjForm.getId());
return success("添加成功");
}
return fail("添加失败");
}
@OperationLog
@ApiOperation("修改十佳团支部书记申报表")
@PutMapping()
public ApiResult<?> update(@RequestBody SjtbzbsjForm sjtbzbsjForm) {
if (sjtbzbsjFormService.updateById(sjtbzbsjForm)) {
reviewFlowStarterService.restartReviewWhenLastRejected("gxmu_sjtbzbsj", sjtbzbsjForm.getId());
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("删除十佳团支部书记申报表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
return sjtbzbsjFormService.removeById(id) ? success("删除成功") : fail("删除失败");
}
@OperationLog
@ApiOperation("批量修改十佳团支部书记申报表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody BatchParam<SjtbzbsjForm> batchParam) {
return batchParam.update(sjtbzbsjFormService, "id") ? success("修改成功") : fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除十佳团支部书记申报表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
return sjtbzbsjFormService.removeByIds(ids) ? success("删除成功") : fail("删除失败");
}
private String resolveYearText(SjtbzbsjFormParam param, List<SjtbzbsjForm> records) {
if (param.getYear() != null) {
return String.valueOf(param.getYear());
}
if (records != null && !records.isEmpty() && records.get(0).getYear() != null) {
return String.valueOf(records.get(0).getYear());
}
return String.valueOf(java.time.LocalDate.now().getYear());
}
private String resolveReporter(User loginUser) {
if (loginUser == null) {
return "";
}
if (StrUtil.isNotBlank(loginUser.getRealName())) {
return loginUser.getRealName().trim();
}
if (StrUtil.isNotBlank(loginUser.getNickname())) {
return loginUser.getNickname().trim();
}
return valueOf(loginUser.getUsername());
}
private String resolveOrganizationPartyOpinion(User loginUser) {
if (loginUser == null || loginUser.getOrganizationId() == null) {
return "(盖章)";
}
Organization organization = organizationService.getByIdRel(loginUser.getOrganizationId());
String organizationName = organization == null ? "" : valueOf(organization.getOrganizationName());
return organizationName.isEmpty() ? "(盖章)" : organizationName + "(盖章)";
}
private String valueOf(String value) {
return value == null ? "" : value.trim();
}
}

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