feat: 综合业务模块功能补充与实体拓展
- feat(sales): 新增招投标、销售合同、诉讼管理业务线及相关实体,增加合同回款定时提醒任务
- feat(collaborativeApproval): 新增宽带与通信管理、房屋租赁管理审批流程支持
- feat(device): 新增设备状态变更记录与维修备件管理功能
- feat(project): 新增项目配置(ProjectConfig)及附件分组功能
- fix(approve): 优化财务报销(FinReimbursement)相关逻辑与映射
- fix(quality): 完善质量检验参数(QualityInspectParam)及检测标准配置
- fix(device): 修复设备台账、设备维修与保养的数据映射及任务逻辑
| | |
| | | !*/build/*.java
|
| | | !*/build/*.html
|
| | | !*/build/*.xml
|
| | |
|
| | | /graphify-out
|
| | | /src/graphify-out
|
| | | /build_graph.py
|
| | | /gen_subagents.py
|
| | | /subagents_args.json
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ALTER TABLE `sales_ledger` |
| | | ADD COLUMN `project_id` BIGINT COMMENT '项ç®IDï¼å
³è项ç®ç®¡çï¼', |
| | | ADD COLUMN `year` INT COMMENT '年份ï¼èªå¨åç¾è®¢æ¥æï¼', |
| | | ADD COLUMN `signing_unit_id` BIGINT COMMENT 'ç¾ååä½IDï¼ç»ç»æ¶æï¼', |
| | | ADD COLUMN `office_id` BIGINT COMMENT 'åäºå¤IDï¼ç»ç»æ¶æï¼', |
| | | ADD COLUMN `group_leader_id` BIGINT COMMENT 'ç»è´è´£äººIDï¼åå·¥ï¼', |
| | | ADD COLUMN `is_invoice` TINYINT(1) DEFAULT 0 COMMENT 'æ¯å¦å¼å票ï¼1æ¯ 0å¦ï¼', |
| | | ADD COLUMN `bid_price` DECIMAL(15,2) COMMENT '䏿 价', |
| | | ADD COLUMN `is_bid` TINYINT(1) DEFAULT 0 COMMENT 'æ¯å¦ä¸æ ï¼1æ¯ 0å¦ï¼', |
| | | ADD COLUMN `unbid_reason` VARCHAR(500) COMMENT 'æªä¸æ åå ', |
| | | ADD COLUMN `contract_original_return_date` DATE COMMENT 'ååå件约å®åä¼ æ¥æ'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- æææ 管ç表 |
| | | DROP TABLE IF EXISTS `bidding_management`; |
| | | CREATE TABLE `bidding_management` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®ID', |
| | | `project_id` bigint(20) DEFAULT NULL COMMENT 'æå±é¡¹ç®ID', |
| | | `project_name` varchar(255) DEFAULT NULL COMMENT 'æå±é¡¹ç®åç§°', |
| | | `bid_doc_name` varchar(255) DEFAULT NULL COMMENT 'æ 书åç§°', |
| | | `tender_unit` varchar(255) DEFAULT NULL COMMENT 'ææ åä½', |
| | | `bid_unit` varchar(255) DEFAULT NULL COMMENT 'ææ åä½', |
| | | `tender_date` date DEFAULT NULL COMMENT 'ææ æ¥æ', |
| | | `bid_date` date DEFAULT NULL COMMENT 'ææ æ¥æ', |
| | | `bid_doc_fee` decimal(18,2) DEFAULT NULL COMMENT 'æ 书款éé¢', |
| | | `bid_doc_fee_status` varchar(50) DEFAULT NULL COMMENT 'æ ä¹¦æ¬¾ç¶æ', |
| | | `bid_doc_fee_status_change_date` date DEFAULT NULL COMMENT 'æ ä¹¦æ¬¾ç¶æåæ´æ¥æ', |
| | | `bid_deposit` decimal(18,2) DEFAULT NULL COMMENT 'ææ ä¿è¯ééé¢', |
| | | `bid_result` varchar(50) DEFAULT NULL COMMENT 'æææ ç»æ', |
| | | `tenant_id` bigint(20) DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint(20) DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='æææ 管ç表'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- 宽带ä¸é信管ç主表 |
| | | DROP TABLE IF EXISTS `broadband_communication`; |
| | | CREATE TABLE `broadband_communication` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `area` varchar(100) NOT NULL COMMENT 'åºå', |
| | | `office` varchar(100) NOT NULL COMMENT 'åäºå¤', |
| | | `resident_staff` varchar(100) NOT NULL COMMENT 'é©»ç人å', |
| | | `address` varchar(255) NOT NULL COMMENT 'å°å', |
| | | `install_date` date NOT NULL COMMENT 'å®è£
æ¥æ', |
| | | `install_fee` decimal(18,2) DEFAULT '0.00' COMMENT 'å®è£
è´¹', |
| | | `payment_cycle` int(11) NOT NULL COMMENT 'ç¼´è´¹å¨æ(ææ°ï¼1/3/6/12)', |
| | | `payment_method` varchar(50) NOT NULL COMMENT 'ç¼´è´¹æ¹å¼', |
| | | `prepaid_amount` decimal(18,2) DEFAULT '0.00' COMMENT 'é¢åéé¢', |
| | | `monthly_fee` decimal(18,2) DEFAULT '0.00' COMMENT 'æèµè´¹', |
| | | `package_content` varchar(500) DEFAULT NULL COMMENT 'å¥é¤å
容', |
| | | `next_payment_date` date DEFAULT NULL COMMENT '䏿¬¡ç¼´è´¹æ¥æ', |
| | | `create_user` int(11) DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int(11) DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int(11) DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint(20) DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='宽带ä¸é信管ç表'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- æ¿å±ç§èµä¸»è¡¨ |
| | | DROP TABLE IF EXISTS `house_lease`; |
| | | CREATE TABLE `house_lease` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `office` varchar(100) NOT NULL COMMENT 'åäºå¤', |
| | | `user_name` varchar(100) NOT NULL COMMENT '使ç¨äºº', |
| | | `resident_staff` varchar(100) NOT NULL COMMENT 'é©»ç人å', |
| | | `address` varchar(255) NOT NULL COMMENT 'å°å', |
| | | `rent_start_date` date NOT NULL COMMENT 'èµ·ç§æ¶é´', |
| | | `contract_start_date` date NOT NULL COMMENT 'ååèµ·ç§æ¥', |
| | | `contract_end_date` date NOT NULL COMMENT 'ååå°ææ¥', |
| | | `tenant` varchar(100) NOT NULL COMMENT 'æ¿ç§äºº', |
| | | `party_a` varchar(100) NOT NULL COMMENT 'ååç²æ¹', |
| | | `phone` varchar(20) DEFAULT NULL COMMENT 'çµè¯', |
| | | `area` decimal(18,2) DEFAULT NULL COMMENT 'é¢ç§¯', |
| | | `payment_method` varchar(50) NOT NULL COMMENT 'æ¯ä»æ¹å¼', |
| | | `deposit` decimal(18,2) DEFAULT NULL COMMENT 'æ¼é', |
| | | `rent` decimal(18,2) NOT NULL COMMENT 'ç§éï¼å
/æï¼', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='æ¿å±ç§èµç®¡ç主表'; |
| | | |
| | | -- æ¿å±ç§èµè´¹ç¨å表 |
| | | DROP TABLE IF EXISTS `house_lease_cost`; |
| | | CREATE TABLE `house_lease_cost` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `lease_id` bigint(20) NOT NULL COMMENT 'ç§èµè¡¨ID', |
| | | `month` varchar(7) NOT NULL COMMENT 'æä»½ (YYYY-MM)', |
| | | `rent` decimal(18,2) DEFAULT '0.00' COMMENT 'æ¿ç§', |
| | | `water_electricity` decimal(18,2) DEFAULT '0.00' COMMENT 'æ°´çµ', |
| | | `property` decimal(18,2) DEFAULT '0.00' COMMENT 'ç©ä¸', |
| | | `express` decimal(18,2) DEFAULT '0.00' COMMENT 'å¿«é', |
| | | `broadband` decimal(18,2) DEFAULT '0.00' COMMENT '宽带', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`), |
| | | UNIQUE KEY `idx_lease_month` (`lease_id`, `month`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='æ¿å±ç§èµç®¡çè´¹ç¨å表'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | CREATE TABLE `project_management_config` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `contract_return_reminder_days` int(11) DEFAULT '3' COMMENT 'ååå件约å®åä¼ æåæé天æ°', |
| | | `create_user` int(11) DEFAULT NULL COMMENT 'åå»ºç¨æ·', |
| | | `create_user_name` varchar(64) DEFAULT NULL COMMENT 'åå»ºç¨æ·åç§°', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int(11) DEFAULT NULL COMMENT 'æ´æ°ç¨æ·', |
| | | `update_user_name` varchar(64) DEFAULT NULL COMMENT 'æ´æ°ç¨æ·åç§°', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` bigint(20) DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint(20) DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项ç®ç®¡çé
置表'; |
| | | |
| | | INSERT INTO `project_management_config` (`id`, `contract_return_reminder_days`) VALUES (1, 3); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- åå管ç主表 |
| | | DROP TABLE IF EXISTS `sales_contract`; |
| | | CREATE TABLE `sales_contract` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `contract_no` varchar(100) NOT NULL COMMENT 'ååç¼å·', |
| | | `sign_date` date NOT NULL COMMENT 'ç¾è®¢æ¶é´', |
| | | `signing_unit` varchar(255) NOT NULL COMMENT 'ç¾çº¦åä½ç®ç§°', |
| | | `contract_period` varchar(100) DEFAULT NULL COMMENT 'ç¾çº¦å¨æ', |
| | | `archive_status` varchar(50) NOT NULL COMMENT 'åæ¡£ç¶æ', |
| | | `archive_remark` varchar(500) DEFAULT NULL COMMENT 'åæ¡£æ
åµè¯´æ', |
| | | `performance_bond` decimal(18,2) DEFAULT NULL COMMENT '履约ä¿è¯é', |
| | | `warranty_deposit` decimal(18,2) DEFAULT NULL COMMENT 'è´¨ä¿éæ
åµ', |
| | | `output_value` decimal(18,2) DEFAULT NULL COMMENT '产å¼ï¼èªå¨æ±æ»ï¼', |
| | | `received_amount` decimal(18,2) DEFAULT NULL COMMENT '已忬¾éé¢', |
| | | `settlement_count` int(11) DEFAULT NULL COMMENT 'ç»ç®æ¬¡æ°', |
| | | `receivable_amount` decimal(18,2) DEFAULT NULL COMMENT 'åºæ¶éé¢', |
| | | `payable_ratio` varchar(50) DEFAULT NULL COMMENT 'åºä»æ¯ä¾', |
| | | `node_receivable` decimal(18,2) DEFAULT NULL COMMENT 'ååèç¹åºæ¶', |
| | | `payment_nodes` varchar(255) DEFAULT NULL COMMENT 'åå约å®ä»æ¬¾èç¹', |
| | | `settlement_record` text COMMENT 'ç»ç®è®°å½', |
| | | `invoice_requirement` varchar(255) DEFAULT NULL COMMENT 'å¼ç¥¨è¦æ±', |
| | | `last_invoice_date` date DEFAULT NULL COMMENT 'æè¿ä¸æ¬¡å¼ç¥¨æ¶é´', |
| | | `invoiced_amount` decimal(18,2) DEFAULT NULL COMMENT 'å·²å¼ç¥¨éé¢', |
| | | `penalty_agreement` text COMMENT 'è¿çº¦é约å®', |
| | | `remark` text COMMENT 'æ
åµè¯´æ', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='éå®åå主表'; |
| | | |
| | | -- åå产åæç»è¡¨ |
| | | DROP TABLE IF EXISTS `sales_contract_product`; |
| | | CREATE TABLE `sales_contract_product` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `contract_id` bigint(20) NOT NULL COMMENT 'å
³èéå®åå ID', |
| | | `product_category` varchar(100) DEFAULT NULL COMMENT '产å大类', |
| | | `specification_model` varchar(100) DEFAULT NULL COMMENT 'è§æ ¼åå·', |
| | | `product_model_id` bigint(20) DEFAULT NULL COMMENT 'è§æ ¼åå· ID', |
| | | `tax_inclusive_unit_price` decimal(18,2) DEFAULT NULL COMMENT 'å«ç¨åä»·', |
| | | `agreed_quantity` decimal(18,2) DEFAULT NULL COMMENT '约å®/æä¼°ç¨é', |
| | | `contract_unit` varchar(50) DEFAULT NULL COMMENT 'åå计éåä½', |
| | | `shipped_quantity` decimal(18,2) DEFAULT NULL COMMENT 'å·²åè´§æ°é', |
| | | `output_value` decimal(18,2) DEFAULT NULL COMMENT '产å¼', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`), |
| | | KEY `idx_contract_id` (`contract_id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='éå®åå产åæç»è¡¨'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- è¯è®¼ç®¡ç表 |
| | | DROP TABLE IF EXISTS `sales_lawsuit`; |
| | | CREATE TABLE `sales_lawsuit` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `case_no` varchar(100) NOT NULL COMMENT 'æ¡ä»¶ç¼å·', |
| | | `project_id` bigint(20) NOT NULL COMMENT 'æå±é¡¹ç® ID', |
| | | `project_name` varchar(255) DEFAULT NULL COMMENT 'æå±é¡¹ç®åç§°', |
| | | `contract_id` bigint(20) NOT NULL COMMENT 'å
³èéå®åå ID', |
| | | `contract_no` varchar(100) DEFAULT NULL COMMENT 'ååç¼å·', |
| | | `lawsuit_status` varchar(50) NOT NULL COMMENT 'è¯è®¼ç¶æ', |
| | | `filing_date` date NOT NULL COMMENT 'ç«æ¡æ¶é´', |
| | | `lawyer` varchar(100) DEFAULT NULL COMMENT 'æ¿åå¾å¸/æ³å¡è´è´£äºº', |
| | | `hearing_date` date DEFAULT NULL COMMENT 'å¼åºæ¶é´', |
| | | `claim_amount` decimal(18,2) DEFAULT NULL COMMENT 'è¯è®¼æ çéé¢', |
| | | `judgment_summary` text COMMENT 'å¤å³ç»ææè¦', |
| | | `progress_remark` text COMMENT 'è¯è®¼è¿å±å¤æ³¨', |
| | | `create_user` int DEFAULT NULL COMMENT 'å建è
', |
| | | `create_time` timestamp NULL DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int DEFAULT NULL COMMENT 'æ´æ°è
', |
| | | `update_time` timestamp NULL DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` int DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `dept_id` bigint DEFAULT NULL COMMENT 'é¨é¨ID', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='è¯è®¼ç®¡ç主表'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | CREATE TABLE `sales_ledger_contract_rel` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `sales_ledger_id` bigint(20) NOT NULL COMMENT 'éå®å°è´¦ID', |
| | | `contract_id` bigint(20) NOT NULL COMMENT 'ååID', |
| | | `create_user` int(11) DEFAULT NULL COMMENT 'åå»ºç¨æ·', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` int(11) DEFAULT NULL COMMENT 'æ´æ°ç¨æ·', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`), |
| | | KEY `idx_sales_ledger_id` (`sales_ledger_id`), |
| | | KEY `idx_contract_id` (`contract_id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='éå®å°è´¦ä¸ååå
³è表'; |
| | |
| | | <version>${thumbnailator.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>e-iceblue</groupId>
|
| | | <artifactId>spire.doc.free</artifactId>
|
| | | <version>5.2.0</version>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | |
| | | <enabled>true</enabled>
|
| | | </releases>
|
| | | </repository>
|
| | | <repository>
|
| | | <id>com.e-iceblue</id>
|
| | | <name>e-iceblue</name>
|
| | | <url>https://repo.e-iceblue.cn/repository/maven-public/</url>
|
| | | </repository>
|
| | | </repositories>
|
| | |
|
| | | <pluginRepositories>
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ALTER TABLE `p_fuel_record` ADD COLUMN `dept_id` bigint(20) DEFAULT NULL COMMENT 'æå±é¨é¨'; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | CREATE TABLE IF NOT EXISTS `p_vehicle_info` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主é®', |
| | | `plate_number` varchar(50) NOT NULL COMMENT '车çå·', |
| | | `dept_id` bigint(20) DEFAULT NULL COMMENT 'æå±éå®å¢éï¼é¨é¨IDï¼', |
| | | `user_id` bigint(20) DEFAULT NULL COMMENT '责任人IDï¼ç¨æ·IDï¼', |
| | | `vehicle_status` varchar(20) DEFAULT 'NORMAL' COMMENT '车è¾ç¶æ(NORMAL:å¨ç¨, IDLE:é²ç½®, REPAIR:ç»´ä¿®)', |
| | | `property_ownership` varchar(50) DEFAULT NULL COMMENT 'äº§æææ', |
| | | `inspection_expire_date` date DEFAULT NULL COMMENT 'å¹´æ£å°ææ¥æ', |
| | | `insurance_expire_date` date DEFAULT NULL COMMENT 'ä¿é©å°ææ¥æ', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `create_user` bigint(20) DEFAULT NULL COMMENT 'å建人', |
| | | `create_time` datetime DEFAULT NULL COMMENT 'å建æ¶é´', |
| | | `update_user` bigint(20) DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `tenant_id` varchar(20) DEFAULT NULL COMMENT 'ç§æ·ID', |
| | | `del_flag` char(1) DEFAULT '0' COMMENT 'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼', |
| | | PRIMARY KEY (`id`), |
| | | UNIQUE KEY `idx_plate_number` (`plate_number`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='è½¦è¾æ¡£æ¡è¡¨'; |
| | | |
| | | CREATE TABLE IF NOT EXISTS `p_vehicle_cost` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT, |
| | | `vehicle_id` bigint(20) NOT NULL COMMENT '车è¾ID', |
| | | `cost_type` varchar(20) NOT NULL COMMENT 'è´¹ç¨ç±»å(MAINTENANCE:ä¿å
», INSPECTION:å¹´æ£, INSURANCE:ä¿é©, REPAIR:ç»´ä¿®)', |
| | | `amount` decimal(10,2) NOT NULL COMMENT 'è´¹ç¨éé¢', |
| | | `cost_date` date NOT NULL COMMENT 'åçæ¥æ', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨/详æ
', |
| | | `create_user` bigint(20) DEFAULT NULL, |
| | | `create_time` datetime DEFAULT NULL, |
| | | `update_user` bigint(20) DEFAULT NULL, |
| | | `update_time` datetime DEFAULT NULL, |
| | | `tenant_id` varchar(20) DEFAULT NULL, |
| | | `del_flag` char(1) DEFAULT '0', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='车è¾è´¹ç¨è®°å½è¡¨'; |
| | | |
| | | CREATE TABLE IF NOT EXISTS `p_fuel_card` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT, |
| | | `card_number` varchar(100) NOT NULL COMMENT 'å æ²¹å¡å·', |
| | | `dept_id` bigint(20) DEFAULT NULL COMMENT 'æå±å¢é(é¨é¨ID)', |
| | | `issuer` varchar(100) DEFAULT NULL COMMENT 'åå¡åä½', |
| | | `initial_balance` decimal(10,2) DEFAULT '0.00' COMMENT 'æåä½é¢', |
| | | `current_balance` decimal(10,2) DEFAULT '0.00' COMMENT 'å½åå©ä½ä½é¢', |
| | | `status` varchar(20) DEFAULT 'ACTIVE' COMMENT 'ç¶æ(ACTIVE:æ£å¸¸, CANCELLED:注é)', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `create_user` bigint(20) DEFAULT NULL, |
| | | `create_time` datetime DEFAULT NULL, |
| | | `update_user` bigint(20) DEFAULT NULL, |
| | | `update_time` datetime DEFAULT NULL, |
| | | `tenant_id` varchar(20) DEFAULT NULL, |
| | | `del_flag` char(1) DEFAULT '0', |
| | | PRIMARY KEY (`id`), |
| | | UNIQUE KEY `idx_card_number` (`card_number`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='å æ²¹å¡ç®¡ç表'; |
| | | |
| | | CREATE TABLE IF NOT EXISTS `p_fuel_record` ( |
| | | `id` bigint(20) NOT NULL AUTO_INCREMENT, |
| | | `fuel_date` date NOT NULL COMMENT 'å æ²¹æ¥æ', |
| | | `amount` decimal(10,2) NOT NULL COMMENT 'å æ²¹éé¢', |
| | | `liters` decimal(10,2) NOT NULL COMMENT 'å æ²¹åæ°', |
| | | `vehicle_id` bigint(20) NOT NULL COMMENT 'å æ²¹è½¦è¾ID', |
| | | `fuel_card_id` bigint(20) NOT NULL COMMENT 'å æ²¹å¡ID', |
| | | `start_mileage` decimal(12,2) DEFAULT NULL COMMENT 'èµ·å§å
¬éæ°', |
| | | `end_mileage` decimal(12,2) DEFAULT NULL COMMENT 'ç»æå
¬éæ°', |
| | | `invoice_no` varchar(100) DEFAULT NULL COMMENT 'å票å·ç ', |
| | | `remark` varchar(500) DEFAULT NULL COMMENT '夿³¨', |
| | | `create_user` bigint(20) DEFAULT NULL, |
| | | `create_time` datetime DEFAULT NULL, |
| | | `update_user` bigint(20) DEFAULT NULL, |
| | | `update_time` datetime DEFAULT NULL, |
| | | `tenant_id` varchar(20) DEFAULT NULL, |
| | | `del_flag` char(1) DEFAULT '0', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='å æ²¹è®°å½è¡¨'; |
| | |
| | | .createIndex(PineconeServerlessIndexConfig.builder() |
| | | .cloud("AWS") |
| | | .region("us-east-1") |
| | | .dimension(embeddingModel.dimension()) |
| | | .dimension(1536) // 临æ¶åæ»ç»´åº¦(qwenä¸è¬æ¯1536)ï¼é¿å
项ç®å¯å¨æ¶è°ç¨APIå¯¼è´æ¬ è´¹æ¥é |
| | | .build()) |
| | | .build(); |
| | | } |
| | | } |
| | | } |
| | |
| | | //å®¡æ¹æµç¨ |
| | | private List<ApprovalTask> tasks; |
| | | |
| | | @com.ruoyi.framework.aspectj.lang.annotation.Excel(name = "å½å±é¨é¨") |
| | | private String deptName; |
| | | |
| | | //审æ¹è®°å½ |
| | | private List<ApprovalRecord> records; |
| | | private List<StorageBlobVO> storageBlobVOList; |
| | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public R delete(@RequestBody List<Long> ids) { |
| | | return R.ok(finReimbursementService.delete(ids)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @Operation(summary = "导åºè´¹ç¨æ¥éæ°æ®") |
| | | public void export(HttpServletResponse response, FinReimbursementDto finReimbursementDto) { |
| | | List<FinReimbursementVo> list = finReimbursementService.list(finReimbursementDto); |
| | | ExcelUtil<FinReimbursementVo> util = new ExcelUtil<FinReimbursementVo>(FinReimbursementVo.class); |
| | | util.exportExcel(response, list, "è´¹ç¨æ¥éæ°æ®"); |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¥éå主表 Mapper æ¥å£ |
| | |
| | | public interface FinReimbursementMapper extends BaseMapper<FinReimbursement> { |
| | | |
| | | IPage<FinReimbursementVo> listPage(@Param("ew") FinReimbursementDto finReimbursementDto, Page<FinReimbursementVo> page); |
| | | |
| | | List<FinReimbursementVo> list(@Param("ew") FinReimbursementDto finReimbursementDto); |
| | | } |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | |
| | | * æ¥éåå· |
| | | */ |
| | | @Schema(description = "æ¥éåå·") |
| | | @Excel(name = "æ¥éåå·") |
| | | private String billNo; |
| | | |
| | | /** |
| | |
| | | * è´¹ç¨ç±»åï¼å·®æ
è´¹/åå
¬éè´/ä¸å¡æå¾
/交éè´¹/é讯费/å
¶ä» |
| | | */ |
| | | @Schema(description = "è´¹ç¨ç±»åï¼å·®æ
è´¹/åå
¬éè´/ä¸å¡æå¾
/交éè´¹/é讯费/å
¶ä»") |
| | | @Excel(name = "è´¹ç¨ç±»å") |
| | | private String expenseType; |
| | | |
| | | /** |
| | |
| | | * åå·¥ç¼å· |
| | | */ |
| | | @Schema(description = "åå·¥ç¼å·") |
| | | @Excel(name = "ç³è¯·äººç¼å·") |
| | | private String applicantCode; |
| | | |
| | | /** |
| | | * åå·¥å§å |
| | | */ |
| | | @Schema(description = "åå·¥å§å") |
| | | @Excel(name = "ç³è¯·äººå§å") |
| | | private String applicantName; |
| | | |
| | | /** |
| | |
| | | * æ¥éåå |
| | | */ |
| | | @Schema(description = "æ¥éåå ") |
| | | @Excel(name = "æ¥éåå ") |
| | | private String reason; |
| | | |
| | | /** |
| | | * ç³è¯·éé¢ |
| | | */ |
| | | @Schema(description = "ç³è¯·éé¢") |
| | | @Excel(name = "æ¥ééé¢") |
| | | private BigDecimal applyAmount; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Schema(description = "æç»æ±æ»éé¢") |
| | | private BigDecimal detailTotalAmount; |
| | | |
| | | /** |
| | | * 仿¬¾æ¹ |
| | | */ |
| | | @Schema(description = "仿¬¾æ¹") |
| | | @Excel(name = "仿¬¾æ¹") |
| | | private String payer; |
| | | |
| | | /** |
| | | * æ¶æ¬¾äºº |
| | |
| | | * åæ®ç¶æï¼DRAFT-è稿ï¼IN_APPROVAL-审æ¹ä¸ï¼APPROVED-审æ¹éè¿ï¼REJECTED-审æ¹é©³åï¼WITHDRAWN-å·²æ¤åï¼PAID-已仿¬¾ |
| | | */ |
| | | @Schema(description = "åæ®ç¶æï¼DRAFT-è稿ï¼IN_APPROVAL-审æ¹ä¸ï¼APPROVED-审æ¹éè¿ï¼REJECTED-审æ¹é©³åï¼WITHDRAWN-å·²æ¤åï¼PAID-已仿¬¾") |
| | | @Excel(name = "åæ®ç¶æ") |
| | | private String billStatus; |
| | | |
| | | /** |
| | |
| | | * å建æ¶é´ |
| | | */ |
| | | @Schema(description = "å建æ¶é´") |
| | | @Excel(name = "ç³è¯·æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | |
| | | IPage<FinReimbursementVo> listPage(FinReimbursementDto finReimbursementDto, Page<FinReimbursementVo> page); |
| | | |
| | | List<FinReimbursementVo> list(FinReimbursementDto finReimbursementDto); |
| | | |
| | | Boolean add(FinReimbursementDto finReimbursementDto); |
| | | |
| | | FinReimbursementVo detail(Long id); |
| | |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.staff.mapper.HolidayApplicationMapper; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.device.pojo.DeviceStatusChangeRecord; |
| | | import com.ruoyi.device.service.IDeviceStatusChangeRecordService; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final EnterpriseNewsMapper enterpriseNewsMapper; |
| | | private final EnterpriseNewsScopeDeptMapper enterpriseNewsScopeDeptMapper; |
| | | private final ApprovalTemplateNodeApproverMapper approvalTemplateNodeApproverMapper; |
| | | private final IDeviceStatusChangeRecordService deviceStatusChangeRecordService; |
| | | private final IDeviceLedgerService deviceLedgerService; |
| | | |
| | | @Override |
| | | public R listPage(Page<ApprovalInstanceVo> page, ApprovalInstanceDto approvalInstanceDto) { |
| | |
| | | approvalInstanceDto.setInstanceNo(instanceNo); |
| | | approvalInstanceDto.setStatus("PENDING"); |
| | | approvalInstanceDto.setCurrentLevel(1); |
| | | |
| | | if (approvalInstanceDto.getApplicantId() == null) { |
| | | approvalInstanceDto.setApplicantId(SecurityUtils.getUserId()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | if (loginUser != null && loginUser.getUser() != null) { |
| | | approvalInstanceDto.setApplicantName(loginUser.getUser().getNickName()); |
| | | } |
| | | } |
| | | |
| | | // æ ¡éªè®¾å¤ç¶æåæ´å®¡æ¹ï¼å¦æè¯¥è®¾å¤å·²ææ£å¨å®¡æ¹çä»»å¡ï¼æ æ³å次è¿è¡å®¡æ¹ |
| | | if (TypeEnums.DEVICE_STATUS_CHANGE_APPROVAL.getCode().equals(approvalInstanceDto.getBusinessType())) { |
| | | Long deviceId = approvalInstanceDto.getBusinessId(); |
| | | |
| | | long pendingCount = deviceStatusChangeRecordService.count(Wrappers.<DeviceStatusChangeRecord>lambdaQuery() |
| | | .eq(DeviceStatusChangeRecord::getDeviceId, deviceId) |
| | | .eq(DeviceStatusChangeRecord::getApprovalStatus, "PENDING") |
| | | .eq(DeviceStatusChangeRecord::getDeleted, 0) |
| | | ); |
| | | if (pendingCount > 0) { |
| | | throw new ServiceException("该设å¤å·²ææ£å¨è¿è¡çç¶æåæ´å®¡æ¹ï¼æ æ³å次æäº¤"); |
| | | } |
| | | |
| | | DeviceLedger device = deviceLedgerService.getById(deviceId); |
| | | if (device == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨"); |
| | | } |
| | | |
| | | Integer targetStatus = null; |
| | | String reason = ""; |
| | | if (StringUtils.hasText(approvalInstanceDto.getFormConfig())) { |
| | | try { |
| | | JSONObject formObj = JSONObject.parseObject(approvalInstanceDto.getFormConfig()); |
| | | if (formObj.containsKey("targetStatus")) { |
| | | targetStatus = formObj.getInteger("targetStatus"); |
| | | } else if (formObj.containsKey("status")) { |
| | | targetStatus = formObj.getInteger("status"); |
| | | } |
| | | if (formObj.containsKey("reason")) { |
| | | reason = formObj.getString("reason"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("è§£æç¶æåæ´è¡¨å失败", e); |
| | | } |
| | | } |
| | | |
| | | DeviceStatusChangeRecord record = new DeviceStatusChangeRecord(); |
| | | record.setDeviceId(deviceId); |
| | | record.setOriginalStatus(Integer.valueOf(device.getStatus())); |
| | | record.setTargetStatus(targetStatus); |
| | | record.setReason(reason); |
| | | record.setApprovalStatus("PENDING"); |
| | | deviceStatusChangeRecordService.save(record); |
| | | |
| | | // ç»å®å°å
³èè®°å½çä¸»é® |
| | | approvalInstanceDto.setBusinessId(record.getId()); |
| | | } |
| | | |
| | | boolean saved = this.save(approvalInstanceDto); |
| | | if (!saved) { |
| | | return false; |
| | |
| | | ); |
| | | //å®¡æ¹æç»çå¤ç |
| | | if ("REJECTED".equals(approveAction)) { |
| | | return rejectCurrentNode(instance, currentNode, now); |
| | | return rejectCurrentNode(instance, currentNode, approvalInstanceDto.getApproveComment(), now); |
| | | } |
| | | if (!approveProcessConfigNodeUtils.canProceedToNextLevel(instance.getId(), currentNode.getApproveType())) { |
| | | return R.ok("å®¡æ¹æåï¼çå¾
å
¶ä»å®¡æ¹äººå¤ç"); |
| | |
| | | currentInstance.setStatus("APPROVED"); |
| | | currentInstance.setFinishTime(LocalDateTime.now()); |
| | | this.updateById(currentInstance); |
| | | handleBusinessAfterApprovalFinished(currentInstance); |
| | | handleBusinessAfterApprovalFinished(currentInstance, null); |
| | | return R.ok("审æ¹å·²å®æ"); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | private R rejectCurrentNode(ApprovalInstance instance, ApprovalInstanceNode currentNode, LocalDateTime now) { |
| | | private R rejectCurrentNode(ApprovalInstance instance, ApprovalInstanceNode currentNode, String approveComment, LocalDateTime now) { |
| | | if (!updateCurrentNodeStatus(currentNode.getId(), "REJECTED", now)) { |
| | | return R.ok("å½åèç¹å·²å¤ç宿"); |
| | | } |
| | |
| | | instance.setFinishTime(now); |
| | | this.updateById(instance); |
| | | // ç»ä¸å¤çä¸å¡ç¶ææ´æ° |
| | | handleBusinessAfterApprovalFinished(instance); |
| | | handleBusinessAfterApprovalFinished(instance, approveComment); |
| | | return R.ok("审æ¹å·²é©³å"); |
| | | } |
| | | |
| | |
| | | instance.setStatus("APPROVED"); |
| | | instance.setFinishTime(now); |
| | | this.updateById(instance); |
| | | handleBusinessAfterApprovalFinished(instance); |
| | | handleBusinessAfterApprovalFinished(instance, null); |
| | | return R.ok("审æ¹å·²å®æ"); |
| | | } |
| | | |
| | |
| | | ); |
| | | } |
| | | |
| | | private void handleBusinessAfterApprovalFinished(ApprovalInstance instance) { |
| | | private void handleBusinessAfterApprovalFinished(ApprovalInstance instance, String rejectReason) { |
| | | String status = instance.getStatus(); |
| | | Long businessType = instance.getBusinessType(); |
| | | if (TypeEnums.PURCHASE_APPROVAL.getCode().equals(businessType)) { |
| | |
| | | } |
| | | if (TypeEnums.ENTERPRISE_NEWS_APPROVAL.getCode().equals(businessType)) { |
| | | handleNewsApprovalFinished(instance, status); |
| | | return; |
| | | } |
| | | if (TypeEnums.DEVICE_STATUS_CHANGE_APPROVAL.getCode().equals(businessType)) { |
| | | handleDeviceStatusChangeApprovalFinished(instance, status, rejectReason); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | private void handleDeviceStatusChangeApprovalFinished(ApprovalInstance instance, String status, String rejectReason) { |
| | | if (instance == null || instance.getBusinessId() == null) { |
| | | return; |
| | | } |
| | | DeviceStatusChangeRecord record = deviceStatusChangeRecordService.getById(instance.getBusinessId()); |
| | | if (record == null) { |
| | | return; |
| | | } |
| | | if ("APPROVED".equals(status)) { |
| | | record.setApprovalStatus("APPROVED"); |
| | | if (record.getTargetStatus() != null) { |
| | | DeviceLedger device = new DeviceLedger(); |
| | | device.setId(record.getDeviceId()); |
| | | device.setStatus(String.valueOf(record.getTargetStatus())); |
| | | deviceLedgerService.updateById(device); |
| | | } |
| | | } else if ("REJECTED".equals(status)) { |
| | | record.setApprovalStatus("REJECTED"); |
| | | if (rejectReason != null) { |
| | | record.setRejectReason(rejectReason); |
| | | } |
| | | } else if ("PENDING".equals(status)) { |
| | | record.setApprovalStatus("PENDING"); |
| | | } |
| | | deviceStatusChangeRecordService.updateById(record); |
| | | } |
| | | |
| | | private void handleReimbursementApprovalFinished(ApprovalInstance instance, String status) { |
| | |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.project.system.service.ISysDeptService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final FinReimbursementDetailMapper finReimbursementDetailMapper; |
| | | private final FileUtil fileUtil; |
| | | private final ISysNoticeService sysNoticeService; |
| | | private final ISysDeptService sysDeptService; |
| | | @Override |
| | | public IPage<FinReimbursementVo> listPage(FinReimbursementDto finReimbursementDto, Page<FinReimbursementVo> page) { |
| | | IPage<FinReimbursementVo> finReimbursementVoIPage = finReimbursementMapper.listPage(finReimbursementDto, page); |
| | |
| | | }); |
| | | |
| | | return finReimbursementVoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<FinReimbursementVo> list(FinReimbursementDto finReimbursementDto) { |
| | | return finReimbursementMapper.list(finReimbursementDto); |
| | | } |
| | | |
| | | @Override |
| | |
| | | vo.setDeptId(reimbursement.getDeptId()); |
| | | vo.setDeleted(reimbursement.getDeleted()); |
| | | |
| | | if (reimbursement.getDeptId() != null) { |
| | | SysDept dept = sysDeptService.selectDeptById(reimbursement.getDeptId()); |
| | | if (dept != null) { |
| | | vo.setDeptName(dept.getDeptName()); |
| | | } |
| | | } |
| | | |
| | | vo.setDetails(finReimbursementDetailMapper.selectList( |
| | | new LambdaQueryWrapper<FinReimbursementDetail>() |
| | | .eq(FinReimbursementDetail::getReimbursementId, reimbursement.getId()) |
| | |
| | | INSPECTION_TASK("inspection_task"), |
| | | PDA_VERSION("pda_version"), |
| | | SALES_LEDGER("sales_ledger"), |
| | | SALES_LAWSUIT("sales_lawsuit"), |
| | | SUPPLIER_MANAGE("supplier_manage"), |
| | | APPROVAL_PROCESS("approval_process"), |
| | | QR_CODE_SCAN_RECORDS("qr_code_scan_records"), |
| | |
| | | import com.ruoyi.basic.vo.CustomerVo; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsDetailsVo; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsVo; |
| | | import com.ruoyi.sales.vo.ProjectTransactionsVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å®¢æ·æ¡£æ¡Mapperæ¥å£ |
| | |
| | | |
| | | List<CustomerVo> list(@Param("c") CustomerDto customer, @Param("loginUserId") Long loginUserId); |
| | | |
| | | IPage<CustomerTransactionsVo> customewTransactions(Page page, @Param("customerName") String customerName); |
| | | IPage<ProjectTransactionsVo> projectTransactions(Page page, @Param("projectName") String projectName, @Param("customerName") String customerName, @Param("contractName") String contractName); |
| | | |
| | | IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, @Param("customerId") Long customerId); |
| | | IPage<CustomerTransactionsVo> customewTransactions(Page page, @Param("projectId") Long projectId, @Param("customerName") String customerName, @Param("contractName") String contractName); |
| | | |
| | | IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, @Param("projectId") Long projectId, @Param("customerId") Long customerId, @Param("contractName") String contractName); |
| | | |
| | | Map<String, Object> transactionsSummary(); |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsDetailsVo; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsVo; |
| | | import com.ruoyi.sales.vo.ProjectTransactionsVo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param page |
| | | * @param customerName |
| | | * @return |
| | | */ |
| | | IPage<CustomerTransactionsVo> customewTransactions(Page page, String customerName); |
| | | */ IPage<ProjectTransactionsVo> projectTransactions(Page page, String projectName, String customerName, String contractName); |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·å¾æ¥æç»å表 |
| | | * @param page |
| | | * @param customerId |
| | | * @return |
| | | */ |
| | | IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, Long customerId); |
| | | IPage<CustomerTransactionsVo> customewTransactions(Page page, Long projectId, String customerName, String contractName); |
| | | |
| | | IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, Long projectId, Long customerId, String contractName); |
| | | |
| | | Map<String, Object> transactionsSummary(); |
| | | } |
| | |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsDetailsVo; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsVo; |
| | | import com.ruoyi.sales.vo.ProjectTransactionsVo; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CustomerTransactionsVo> customewTransactions(Page page, String customerName) { |
| | | return customerMapper.customewTransactions(page, customerName); |
| | | public IPage<ProjectTransactionsVo> projectTransactions(Page page, String projectName, String customerName, String contractName) { |
| | | return customerMapper.projectTransactions(page, projectName, customerName, contractName); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, Long customerId) { |
| | | return customerMapper.customewTransactionsDetails(page, customerId); |
| | | public IPage<CustomerTransactionsVo> customewTransactions(Page page, Long projectId, String customerName, String contractName) { |
| | | return customerMapper.customewTransactions(page, projectId, customerName, contractName); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<CustomerTransactionsDetailsVo> customewTransactionsDetails(Page page, Long projectId, Long customerId, String contractName) { |
| | | return customerMapper.customewTransactionsDetails(page, projectId, customerId, contractName); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> transactionsSummary() { |
| | | return customerMapper.transactionsSummary(); |
| | | } |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.dto.BroadbandCommunicationDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.BroadbandCommunication; |
| | | import com.ruoyi.collaborativeApproval.service.BroadbandCommunicationService; |
| | | import com.ruoyi.collaborativeApproval.vo.BroadbandCommunicationVO; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/broadband") |
| | | public class BroadbandCommunicationController { |
| | | |
| | | @Autowired |
| | | private BroadbandCommunicationService broadbandCommunicationService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<BroadbandCommunication> page, BroadbandCommunicationDTO dto) { |
| | | IPage<BroadbandCommunicationVO> result = broadbandCommunicationService.listPage(page, dto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam("id") Long id) { |
| | | return AjaxResult.success(broadbandCommunicationService.getDetail(id)); |
| | | } |
| | | |
| | | @PostMapping("/addOrUpdate") |
| | | public AjaxResult addOrUpdate(@RequestBody BroadbandCommunicationDTO dto) { |
| | | boolean success = broadbandCommunicationService.addOrUpdate(dto); |
| | | if (success) { |
| | | return AjaxResult.success("æä½æå"); |
| | | } |
| | | return AjaxResult.error("æä½å¤±è´¥"); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | boolean success = broadbandCommunicationService.deleteByIds(ids); |
| | | if (success) { |
| | | return AjaxResult.success("å 餿å"); |
| | | } |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.dto.HouseLeaseDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import com.ruoyi.collaborativeApproval.service.HouseLeaseService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡ç Controller |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/houseLease") |
| | | @RequiredArgsConstructor |
| | | @Tag(name = "æ¿å±ç§èµç®¡ç", description = "æ¿å±ç§èµç¸å
³æ¥å£") |
| | | public class HouseLeaseController { |
| | | |
| | | private final HouseLeaseService houseLeaseService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page<HouseLease> page, HouseLeaseDTO houseLeaseDTO) { |
| | | return AjaxResult.success(houseLeaseService.listPage(page, houseLeaseDTO)); |
| | | } |
| | | |
| | | @GetMapping("/getDetail") |
| | | @Operation(summary = "æ¥è¯¢è¯¦æ
ï¼å«è´¹ç¨å表ï¼") |
| | | public AjaxResult getDetail(@RequestParam("id") Long id) { |
| | | return AjaxResult.success(houseLeaseService.getDetail(id)); |
| | | } |
| | | |
| | | @PostMapping("/addOrUpdate") |
| | | @Operation(summary = "æ°å¢/ä¿®æ¹ï¼å«è´¹ç¨å表ï¼") |
| | | public AjaxResult addOrUpdate(@RequestBody HouseLeaseDTO houseLeaseDTO) { |
| | | return AjaxResult.success(houseLeaseService.addOrUpdate(houseLeaseDTO)); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(houseLeaseService.removeByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @Operation(summary = "å¯¼åºæ°æ®") |
| | | public void export(HttpServletResponse response, HouseLeaseDTO houseLeaseDTO) { |
| | | List<HouseLease> list = houseLeaseService.getList(houseLeaseDTO); |
| | | ExcelUtil<HouseLease> util = new ExcelUtil<>(HouseLease.class); |
| | | util.exportExcel(response, list, "æ¿å±ç§èµæ°æ®"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class BroadbandCommunicationDTO { |
| | | |
| | | private Long id; |
| | | |
| | | private String area; |
| | | |
| | | private String office; |
| | | |
| | | private String residentStaff; |
| | | |
| | | private String address; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate installDate; |
| | | |
| | | private BigDecimal installFee; |
| | | |
| | | private Integer paymentCycle; |
| | | |
| | | private String paymentMethod; |
| | | |
| | | private BigDecimal prepaidAmount; |
| | | |
| | | private BigDecimal monthlyFee; |
| | | |
| | | private String packageContent; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate nextPaymentDate; |
| | | |
| | | /** |
| | | * normal: æ£å¸¸ (>15天) |
| | | * expiring: å³å°å°æ (0~15天) |
| | | * overdue: 已龿 (<0天) |
| | | */ |
| | | private String warnStatus; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµè¯·æ± DTO |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLeaseDTO extends HouseLease { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * è´¹ç¨æç»å表 (å表) |
| | | */ |
| | | private List<HouseLeaseCost> costList; |
| | | |
| | | /** |
| | | * å°æé¢è¦ç¶æï¼normal(æ£å¸¸), expiring(å³å°å°æ 0-30天), overdue(已龿 <0天) |
| | | * ä»
ç¨ä½å表æ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | private String warnStatus; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.BroadbandCommunication; |
| | | |
| | | public interface BroadbandCommunicationMapper extends BaseMapper<BroadbandCommunication> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡çè´¹ç¨å表 Mapper æ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Mapper |
| | | public interface HouseLeaseCostMapper extends BaseMapper<HouseLeaseCost> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡ç Mapper æ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Mapper |
| | | public interface HouseLeaseMapper extends BaseMapper<HouseLease> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("broadband_communication") |
| | | public class BroadbandCommunication { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private String area; |
| | | |
| | | private String office; |
| | | |
| | | private String residentStaff; |
| | | |
| | | private String address; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate installDate; |
| | | |
| | | private BigDecimal installFee; |
| | | |
| | | private Integer paymentCycle; |
| | | |
| | | private String paymentMethod; |
| | | |
| | | private BigDecimal prepaidAmount; |
| | | |
| | | private BigDecimal monthlyFee; |
| | | |
| | | private String packageContent; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate nextPaymentDate; |
| | | |
| | | private String delFlag; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡ç主表对象 house_lease |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | @TableName("house_lease") |
| | | public class HouseLease { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** åäºå¤ */ |
| | | @Excel(name = "åäºå¤") |
| | | private String office; |
| | | |
| | | /** 使ç¨äºº */ |
| | | @Excel(name = "使ç¨äºº") |
| | | private String userName; |
| | | |
| | | /** é©»ç人å */ |
| | | @Excel(name = "é©»ç人å") |
| | | private String residentStaff; |
| | | |
| | | /** å°å */ |
| | | @Excel(name = "å°å") |
| | | private String address; |
| | | |
| | | /** èµ·ç§æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "èµ·ç§æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate rentStartDate; |
| | | |
| | | /** ååèµ·ç§æ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ååèµ·ç§æ¥", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate contractStartDate; |
| | | |
| | | /** ååå°ææ¥ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ååå°ææ¥", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate contractEndDate; |
| | | |
| | | /** æ¿ç§äºº */ |
| | | @Excel(name = "æ¿ç§äºº") |
| | | private String tenant; |
| | | |
| | | /** ååç²æ¹ */ |
| | | @Excel(name = "ååç²æ¹") |
| | | private String partyA; |
| | | |
| | | /** çµè¯ */ |
| | | @Excel(name = "çµè¯") |
| | | private String phone; |
| | | |
| | | /** é¢ç§¯ */ |
| | | @Excel(name = "é¢ç§¯") |
| | | private BigDecimal area; |
| | | |
| | | /** æ¯ä»æ¹å¼ */ |
| | | @Excel(name = "æ¯ä»æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | /** æ¼é */ |
| | | @Excel(name = "æ¼é") |
| | | private BigDecimal deposit; |
| | | |
| | | /** ç§éï¼å
/æï¼ */ |
| | | @Excel(name = "ç§éï¼å
/æï¼") |
| | | private BigDecimal rent; |
| | | |
| | | /** 夿³¨ */ |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** å建è
*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** ç§æ·ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | /** é¨é¨ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡çè´¹ç¨å表对象 house_lease_cost |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Data |
| | | @TableName("house_lease_cost") |
| | | public class HouseLeaseCost { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** ç§èµè¡¨ID */ |
| | | private Long leaseId; |
| | | |
| | | /** æä»½ (YYYY-MM) */ |
| | | private String month; |
| | | |
| | | /** æ¿ç§ */ |
| | | private BigDecimal rent; |
| | | |
| | | /** æ°´çµ */ |
| | | private BigDecimal waterElectricity; |
| | | |
| | | /** ç©ä¸ */ |
| | | private BigDecimal property; |
| | | |
| | | /** å¿«é */ |
| | | private BigDecimal express; |
| | | |
| | | /** 宽带 */ |
| | | private BigDecimal broadband; |
| | | |
| | | /** 夿³¨ */ |
| | | private String remark; |
| | | |
| | | /** å建è
*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** ç§æ·ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | /** é¨é¨ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.collaborativeApproval.dto.BroadbandCommunicationDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.BroadbandCommunication; |
| | | import com.ruoyi.collaborativeApproval.vo.BroadbandCommunicationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface BroadbandCommunicationService extends IService<BroadbandCommunication> { |
| | | |
| | | IPage<BroadbandCommunicationVO> listPage(Page<BroadbandCommunication> page, BroadbandCommunicationDTO dto); |
| | | |
| | | BroadbandCommunicationVO getDetail(Long id); |
| | | |
| | | boolean addOrUpdate(BroadbandCommunicationDTO dto); |
| | | |
| | | boolean deleteByIds(List<Long> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡çè´¹ç¨å表 Service æ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface HouseLeaseCostService extends IService<HouseLeaseCost> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.collaborativeApproval.dto.HouseLeaseDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import com.ruoyi.collaborativeApproval.vo.HouseLeaseVO; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡ç Service æ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface HouseLeaseService extends IService<HouseLease> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page å页对象 |
| | | * @param houseLeaseDTO æ¥è¯¢æ¡ä»¶ |
| | | * @return åé¡µç»æ |
| | | */ |
| | | Page<HouseLeaseVO> listPage(Page<HouseLease> page, HouseLeaseDTO houseLeaseDTO); |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 (ç¨äºå¯¼åº) |
| | | * |
| | | * @param houseLeaseDTO æ¥è¯¢æ¡ä»¶ |
| | | * @return åè¡¨ç»æ |
| | | */ |
| | | List<HouseLease> getList(HouseLeaseDTO houseLeaseDTO); |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯¦æ
|
| | | * |
| | | * @param id ç§èµID |
| | | * @return 详æ
VO |
| | | */ |
| | | HouseLeaseVO getDetail(Long id); |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | | * |
| | | * @param houseLeaseDTO æ°æ® |
| | | * @return æ¯å¦æå |
| | | */ |
| | | boolean addOrUpdate(HouseLeaseDTO houseLeaseDTO); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.collaborativeApproval.dto.BroadbandCommunicationDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.BroadbandCommunicationMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.BroadbandCommunication; |
| | | import com.ruoyi.collaborativeApproval.service.BroadbandCommunicationService; |
| | | import com.ruoyi.collaborativeApproval.vo.BroadbandCommunicationVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class BroadbandCommunicationServiceImpl extends ServiceImpl<BroadbandCommunicationMapper, BroadbandCommunication> implements BroadbandCommunicationService { |
| | | |
| | | @Override |
| | | public IPage<BroadbandCommunicationVO> listPage(Page<BroadbandCommunication> page, BroadbandCommunicationDTO dto) { |
| | | LambdaQueryWrapper<BroadbandCommunication> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(BroadbandCommunication::getDelFlag, "0"); |
| | | |
| | | if (StringUtils.isNotBlank(dto.getArea())) { |
| | | queryWrapper.like(BroadbandCommunication::getArea, dto.getArea()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getOffice())) { |
| | | queryWrapper.like(BroadbandCommunication::getOffice, dto.getOffice()); |
| | | } |
| | | if (StringUtils.isNotBlank(dto.getResidentStaff())) { |
| | | queryWrapper.like(BroadbandCommunication::getResidentStaff, dto.getResidentStaff()); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(dto.getWarnStatus())) { |
| | | LocalDate today = LocalDate.now(); |
| | | if ("expiring".equals(dto.getWarnStatus())) { |
| | | // å³å°å°æ: nextPaymentDate å¨ä»å¤©å°15天ä¹åä¹é´ï¼ä¸ä¸å
æ¬å°äºä»å¤© |
| | | LocalDate future15 = today.plusDays(15); |
| | | queryWrapper.ge(BroadbandCommunication::getNextPaymentDate, today) |
| | | .le(BroadbandCommunication::getNextPaymentDate, future15); |
| | | } else if ("overdue".equals(dto.getWarnStatus())) { |
| | | // 已龿: nextPaymentDate < ä»å¤© |
| | | queryWrapper.lt(BroadbandCommunication::getNextPaymentDate, today); |
| | | } else if ("normal".equals(dto.getWarnStatus())) { |
| | | // æ£å¸¸: nextPaymentDate > 15天ä¹å |
| | | LocalDate future15 = today.plusDays(15); |
| | | queryWrapper.gt(BroadbandCommunication::getNextPaymentDate, future15); |
| | | } |
| | | } |
| | | |
| | | queryWrapper.orderByDesc(BroadbandCommunication::getCreateTime); |
| | | |
| | | IPage<BroadbandCommunication> p = this.page(page, queryWrapper); |
| | | return p.convert(this::convertToVO); |
| | | } |
| | | |
| | | @Override |
| | | public BroadbandCommunicationVO getDetail(Long id) { |
| | | BroadbandCommunication entity = this.getById(id); |
| | | if (entity != null && "0".equals(entity.getDelFlag())) { |
| | | return convertToVO(entity); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addOrUpdate(BroadbandCommunicationDTO dto) { |
| | | BroadbandCommunication entity = new BroadbandCommunication(); |
| | | BeanUtils.copyProperties(dto, entity); |
| | | |
| | | // Calculate nextPaymentDate automatically if installDate and paymentCycle are present |
| | | if (entity.getInstallDate() != null && entity.getPaymentCycle() != null) { |
| | | entity.setNextPaymentDate(entity.getInstallDate().plusMonths(entity.getPaymentCycle())); |
| | | } |
| | | |
| | | if (entity.getId() == null) { |
| | | return this.save(entity); |
| | | } else { |
| | | return this.updateById(entity); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean deleteByIds(List<Long> ids) { |
| | | if (ids != null && !ids.isEmpty()) { |
| | | return this.removeByIds(ids); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private BroadbandCommunicationVO convertToVO(BroadbandCommunication entity) { |
| | | BroadbandCommunicationVO vo = new BroadbandCommunicationVO(); |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.collaborativeApproval.mapper.HouseLeaseCostMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | import com.ruoyi.collaborativeApproval.service.HouseLeaseCostService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡çè´¹ç¨å表 Service ä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class HouseLeaseCostServiceImpl extends ServiceImpl<HouseLeaseCostMapper, HouseLeaseCost> implements HouseLeaseCostService { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.collaborativeApproval.dto.HouseLeaseDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.HouseLeaseMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | import com.ruoyi.collaborativeApproval.service.HouseLeaseCostService; |
| | | import com.ruoyi.collaborativeApproval.service.HouseLeaseService; |
| | | import com.ruoyi.collaborativeApproval.vo.HouseLeaseVO; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµç®¡ç Service ä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class HouseLeaseServiceImpl extends ServiceImpl<HouseLeaseMapper, HouseLease> implements HouseLeaseService { |
| | | |
| | | private final HouseLeaseCostService houseLeaseCostService; |
| | | |
| | | @Override |
| | | public Page<HouseLeaseVO> listPage(Page<HouseLease> page, HouseLeaseDTO houseLeaseDTO) { |
| | | LambdaQueryWrapper<HouseLease> lqw = Wrappers.lambdaQuery(); |
| | | |
| | | if (StringUtils.isNotBlank(houseLeaseDTO.getOffice())) { |
| | | lqw.like(HouseLease::getOffice, houseLeaseDTO.getOffice()); |
| | | } |
| | | if (StringUtils.isNotBlank(houseLeaseDTO.getUserName())) { |
| | | lqw.like(HouseLease::getUserName, houseLeaseDTO.getUserName()); |
| | | } |
| | | |
| | | // å¤çå°æé¢è¦ç¶æ |
| | | String warnStatus = houseLeaseDTO.getWarnStatus(); |
| | | if (StringUtils.isNotBlank(warnStatus)) { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate in30Days = today.plusDays(30); |
| | | |
| | | if ("overdue".equals(warnStatus)) { |
| | | // 已龿: ååå°ææ¥ < ä»å¤© |
| | | lqw.lt(HouseLease::getContractEndDate, today); |
| | | } else if ("expiring".equals(warnStatus)) { |
| | | // å³å°å°æ: 0 <= ååå°ææ¥ - ä»å¤© <= 30 |
| | | lqw.ge(HouseLease::getContractEndDate, today) |
| | | .le(HouseLease::getContractEndDate, in30Days); |
| | | } else if ("normal".equals(warnStatus)) { |
| | | // æ£å¸¸: ååå°ææ¥ > ä»å¤© + 30天 |
| | | lqw.gt(HouseLease::getContractEndDate, in30Days); |
| | | } |
| | | } |
| | | |
| | | lqw.orderByDesc(HouseLease::getCreateTime); |
| | | |
| | | Page<HouseLease> entityPage = this.page(page, lqw); |
| | | |
| | | // è½¬æ¢æVOå页对象 |
| | | Page<HouseLeaseVO> voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal()); |
| | | List<HouseLeaseVO> voRecords = entityPage.getRecords().stream() |
| | | .map(entity -> BeanUtil.copyProperties(entity, HouseLeaseVO.class)) |
| | | .collect(Collectors.toList()); |
| | | voPage.setRecords(voRecords); |
| | | |
| | | return voPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<HouseLease> getList(HouseLeaseDTO houseLeaseDTO) { |
| | | LambdaQueryWrapper<HouseLease> lqw = Wrappers.lambdaQuery(); |
| | | |
| | | if (StringUtils.isNotBlank(houseLeaseDTO.getOffice())) { |
| | | lqw.like(HouseLease::getOffice, houseLeaseDTO.getOffice()); |
| | | } |
| | | if (StringUtils.isNotBlank(houseLeaseDTO.getUserName())) { |
| | | lqw.like(HouseLease::getUserName, houseLeaseDTO.getUserName()); |
| | | } |
| | | |
| | | // å¤çå°æé¢è¦ç¶æ |
| | | String warnStatus = houseLeaseDTO.getWarnStatus(); |
| | | if (StringUtils.isNotBlank(warnStatus)) { |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate in30Days = today.plusDays(30); |
| | | |
| | | if ("overdue".equals(warnStatus)) { |
| | | lqw.lt(HouseLease::getContractEndDate, today); |
| | | } else if ("expiring".equals(warnStatus)) { |
| | | lqw.ge(HouseLease::getContractEndDate, today) |
| | | .le(HouseLease::getContractEndDate, in30Days); |
| | | } else if ("normal".equals(warnStatus)) { |
| | | lqw.gt(HouseLease::getContractEndDate, in30Days); |
| | | } |
| | | } |
| | | |
| | | lqw.orderByDesc(HouseLease::getCreateTime); |
| | | |
| | | return this.list(lqw); |
| | | } |
| | | |
| | | @Override |
| | | public HouseLeaseVO getDetail(Long id) { |
| | | HouseLease houseLease = this.getById(id); |
| | | if (houseLease == null) { |
| | | return null; |
| | | } |
| | | |
| | | HouseLeaseVO vo = BeanUtil.copyProperties(houseLease, HouseLeaseVO.class); |
| | | |
| | | // æ¥è¯¢å表 |
| | | List<HouseLeaseCost> costList = houseLeaseCostService.list( |
| | | Wrappers.<HouseLeaseCost>lambdaQuery() |
| | | .eq(HouseLeaseCost::getLeaseId, id) |
| | | .orderByAsc(HouseLeaseCost::getMonth) |
| | | ); |
| | | vo.setCostList(costList); |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addOrUpdate(HouseLeaseDTO houseLeaseDTO) { |
| | | HouseLease houseLease = BeanUtil.copyProperties(houseLeaseDTO, HouseLease.class); |
| | | |
| | | // 1. ä¿å主表 |
| | | this.saveOrUpdate(houseLease); |
| | | |
| | | // 2. å¤çå表 (å
¨å å
¨ææ¨¡å¼) |
| | | // å 餿§æ°æ® |
| | | houseLeaseCostService.remove( |
| | | Wrappers.<HouseLeaseCost>lambdaQuery() |
| | | .eq(HouseLeaseCost::getLeaseId, houseLease.getId()) |
| | | ); |
| | | |
| | | // æå
¥æ°æ°æ® |
| | | List<HouseLeaseCost> costList = houseLeaseDTO.getCostList(); |
| | | if (costList != null && !costList.isEmpty()) { |
| | | for (HouseLeaseCost cost : costList) { |
| | | cost.setId(null); // ç¡®ä¿æ¯æ°å¢ |
| | | cost.setLeaseId(houseLease.getId()); |
| | | } |
| | | houseLeaseCostService.saveBatch(costList); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class BroadbandCommunicationVO { |
| | | |
| | | private Long id; |
| | | |
| | | private String area; |
| | | |
| | | private String office; |
| | | |
| | | private String residentStaff; |
| | | |
| | | private String address; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate installDate; |
| | | |
| | | private BigDecimal installFee; |
| | | |
| | | private Integer paymentCycle; |
| | | |
| | | private String paymentMethod; |
| | | |
| | | private BigDecimal prepaidAmount; |
| | | |
| | | private BigDecimal monthlyFee; |
| | | |
| | | private String packageContent; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate nextPaymentDate; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLease; |
| | | import com.ruoyi.collaborativeApproval.pojo.HouseLeaseCost; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æ¿å±ç§èµååº VO |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class HouseLeaseVO extends HouseLease { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * è´¹ç¨æç»å表 (å表) |
| | | */ |
| | | private List<HouseLeaseCost> costList; |
| | | } |
| | |
| | | OVERTIME_APPROVAL(15L, "å ç审æ¹"), |
| | | TRAVEL_REIMBURSEMENT_APPROVAL(16L, "åºå·®æ¥é审æ¹"), |
| | | EXPENSE_APPROVAL(17L, "è´¹ç¨å®¡æ¹"), |
| | | ENTERPRISE_NEWS_APPROVAL(18L, "ä¼ä¸æ°é»å®¡æ¹"); |
| | | ENTERPRISE_NEWS_APPROVAL(18L, "ä¼ä¸æ°é»å®¡æ¹"), |
| | | DEVICE_STATUS_CHANGE_APPROVAL(19L, "设å¤ç¶æåæ´å®¡æ¹"); |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import com.ruoyi.device.pojo.DeviceStatusChangeRecord; |
| | | import com.ruoyi.device.service.IDeviceStatusChangeRecordService; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @Tag(name = "设å¤ç¶æåæ´è®°å½") |
| | | @RestController |
| | | @RequestMapping("/device/statusChangeRecord") |
| | | public class DeviceStatusChangeRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IDeviceStatusChangeRecordService deviceStatusChangeRecordService; |
| | | |
| | | @Operation(summary = "å页æ¥è¯¢è®¾å¤ç¶æåæ´è®°å½") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<DeviceStatusChangeRecord> page, DeviceStatusChangeRecord record) { |
| | | IPage<DeviceStatusChangeRecord> pageList = deviceStatusChangeRecordService.selectPageList(page, record); |
| | | return AjaxResult.success(pageList); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "设å¤ç¼å·") |
| | | private String uniqueCode; |
| | | |
| | | @Schema(description = "åºåç¼å·") |
| | | private String factoryNumber; |
| | | |
| | | @Schema(description = "å¶é åå") |
| | | private String manufacturer; |
| | | |
| | | @Schema(description = "èµäº§åå¼") |
| | | private BigDecimal originalAssetValue; |
| | | |
| | | @Schema(description = "è´ç½®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate purchaseDate; |
| | | |
| | | @Schema(description = "å¯ç¨æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate activationDate; |
| | | |
| | | @Schema(description = "ä¸»è¦ææ¯åæ°") |
| | | private String technicalParameters; |
| | | |
| | | @Schema(description = "主è¦ç¨é") |
| | | private String mainPurpose; |
| | | |
| | | @Schema(description = "责任人") |
| | | private String responsiblePerson; |
| | | |
| | | @Schema(description = "å»ºæ¡£æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate filingDate; |
| | | |
| | | /** |
| | | * 设å¤éä»¶(ç¨äºæ¥æ¶) |
| | | */ |
| | |
| | | /** |
| | | * å½å
¥äºº |
| | | */ |
| | | @Excel(name = "å½å
¥äºº",sort = 9) |
| | | @Excel(name = "å½å
¥äºº",sort = 10) |
| | | private String createUser; |
| | | |
| | | @Excel(name = "设å¤ç¼å·", sort = 11) |
| | | private String uniqueCode; |
| | | |
| | | @Excel(name = "åºåç¼å·", sort = 12) |
| | | private String factoryNumber; |
| | | |
| | | @Excel(name = "å¶é åå", sort = 13) |
| | | private String manufacturer; |
| | | |
| | | @Excel(name = "èµäº§åå¼", sort = 14) |
| | | private BigDecimal originalAssetValue; |
| | | |
| | | @Excel(name = "è´ç½®æ¥æ", sort = 15, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date purchaseDate; |
| | | |
| | | @Excel(name = "å¯ç¨æ¥æ", sort = 16, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date activationDate; |
| | | |
| | | @Excel(name = "ä¸»è¦ææ¯åæ°", sort = 17) |
| | | private String technicalParameters; |
| | | |
| | | @Excel(name = "主è¦ç¨é", sort = 18) |
| | | private String mainPurpose; |
| | | |
| | | @Excel(name = "责任人", sort = 19) |
| | | private String responsiblePerson; |
| | | |
| | | @Excel(name = "å»ºæ¡£æ¥æ", sort = 20, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date filingDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DeviceRepairSparePartMapper extends BaseMapper<DeviceRepairSparePart> { |
| | | |
| | | @Select("SELECT d.*, s.name as spare_part_name FROM device_repair_spare_part d LEFT JOIN spare_parts s ON d.spare_part_id = s.id WHERE d.source_id = #{sourceId} AND d.source_type = #{sourceType}") |
| | | List<DeviceRepairSparePart> selectListWithPartName(Long sourceId, Integer sourceType); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.device.pojo.DeviceStatusChangeRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface DeviceStatusChangeRecordMapper extends BaseMapper<DeviceStatusChangeRecord> { |
| | | } |
| | |
| | | */ |
| | | private String supplierName; |
| | | |
| | | @Schema(description = "设å¤ç¼å·") |
| | | private String uniqueCode; |
| | | |
| | | @Schema(description = "åºåç¼å·") |
| | | private String factoryNumber; |
| | | |
| | | @Schema(description = "å¶é åå") |
| | | private String manufacturer; |
| | | |
| | | @Schema(description = "èµäº§åå¼") |
| | | private BigDecimal originalAssetValue; |
| | | |
| | | @Schema(description = "è´ç½®æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate purchaseDate; |
| | | |
| | | @Schema(description = "å¯ç¨æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate activationDate; |
| | | |
| | | @Schema(description = "ä¸»è¦ææ¯åæ°") |
| | | private String technicalParameters; |
| | | |
| | | @Schema(description = "主è¦ç¨é") |
| | | private String mainPurpose; |
| | | |
| | | @Schema(description = "责任人") |
| | | private String responsiblePerson; |
| | | |
| | | @Schema(description = "å»ºæ¡£æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate filingDate; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | |
| | | @Schema(description = "ä¿å
»ç»æ 0 ç»´ä¿® 1 å®å¥½") |
| | | private String maintenanceResult; |
| | | |
| | | @Schema(description = "ä¿å
»ç±»å") |
| | | private String maintenanceType; |
| | | |
| | | @Schema(description = "å·¥ä½å
容æè¿°") |
| | | private String workContent; |
| | | |
| | | @Schema(description = "è¿è¡ç¶åµ") |
| | | private String runningStatus; |
| | | |
| | | @Schema(description = "å®é
æ§è¡äººID") |
| | | private Long executorId; |
| | | |
| | | @Schema(description = "ç¶æ 0 å¾
ä¿å
» 1 å®ç» 2 失败") |
| | | private Integer status; |
| | | |
| | |
| | | @Schema(description = "éªæ¶å¤æ³¨") |
| | | private String acceptanceRemark; |
| | | |
| | | @Schema(description = "æ¥ä¿®ç±»åï¼åå
¸å¼ï¼") |
| | | private String repairType; |
| | | |
| | | @Schema(description = "åå åæ") |
| | | private String reasonAnalysis; |
| | | |
| | | @Schema(description = "å¤çæªæ½") |
| | | private String handlingMeasures; |
| | | |
| | | @Schema(description = "ç¶æ 0 å¾
ç»´ä¿® 1å®ç» 2 失败") |
| | | // 0:å¾
ç»´ä¿® 1:å®ç» 2:失败 3:å¾
éªæ¶ |
| | | private Integer status; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("device_repair_spare_part") |
| | | public class DeviceRepairSparePart { |
| | | |
| | | @Schema(description = "主é®ID") |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @Schema(description = "æ¥æºIDï¼æ¥ä¿®åIDæä¿å
»åIDï¼") |
| | | private Long sourceId; |
| | | |
| | | @Schema(description = "æ¥æºç±»åï¼1-æ¥ä¿®ï¼2-ä¿å
»") |
| | | private Integer sourceType; |
| | | |
| | | @Schema(description = "é
ä»¶ID") |
| | | private Long sparePartId; |
| | | |
| | | @Schema(description = "ä½¿ç¨æ°é") |
| | | private Integer quantity; |
| | | |
| | | @Schema(description = "é
ä»¶åç§°ï¼éè¡¨åæ®µï¼") |
| | | @TableField(exist = false) |
| | | private String sparePartName; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @Schema(description = "å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @Schema(description = "æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @Schema(description = "ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("device_status_change_record") |
| | | public class DeviceStatusChangeRecord implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | private Long deviceId; |
| | | private Integer originalStatus; |
| | | private Integer targetStatus; |
| | | private String reason; |
| | | private String rejectReason; |
| | | private String approvalStatus; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | private Integer deleted; |
| | | } |
| | |
| | | @Excel(name = "夿³¨") |
| | | private String remarks; |
| | | |
| | | @Schema(description = "ä¿å
»ç±»å") |
| | | private String maintenanceType; |
| | | |
| | | @Schema(description = "æ§è¡äººID") |
| | | private Long executorId; |
| | | |
| | | @Schema(description = "å½å
¥äººid") |
| | | private Long registrantId; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IDeviceRepairSparePartService extends IService<DeviceRepairSparePart> { |
| | | |
| | | List<DeviceRepairSparePart> getListWithPartName(Long sourceId, Integer sourceType); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.device.pojo.DeviceStatusChangeRecord; |
| | | |
| | | public interface IDeviceStatusChangeRecordService extends IService<DeviceStatusChangeRecord> { |
| | | IPage<DeviceStatusChangeRecord> selectPageList(Page<DeviceStatusChangeRecord> page, DeviceStatusChangeRecord record); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.LocalDate; |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | |
| | | } |
| | | DeviceLedger deviceLedger = new DeviceLedger(); |
| | | BeanUtils.copyProperties(deviceLedgerDto, deviceLedger); |
| | | |
| | | if (StringUtils.isEmpty(deviceLedger.getUniqueCode())) { |
| | | String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | LambdaQueryWrapper<DeviceLedger> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.likeRight(DeviceLedger::getUniqueCode, "SB" + dateStr); |
| | | queryWrapper.orderByDesc(DeviceLedger::getUniqueCode); |
| | | queryWrapper.last("limit 1"); |
| | | DeviceLedger lastRecord = this.getOne(queryWrapper); |
| | | int sequence = 1; |
| | | if (lastRecord != null && StringUtils.isNotEmpty(lastRecord.getUniqueCode()) && lastRecord.getUniqueCode().length() >= 13) { |
| | | String lastSeqStr = lastRecord.getUniqueCode().substring(10); |
| | | try { |
| | | sequence = Integer.parseInt(lastSeqStr) + 1; |
| | | } catch (NumberFormatException ignored) {} |
| | | } |
| | | deviceLedger.setUniqueCode("SB" + dateStr + String.format("%03d", sequence)); |
| | | } |
| | | |
| | | if (this.count(new LambdaQueryWrapper<DeviceLedger>().eq(DeviceLedger::getUniqueCode, deviceLedger.getUniqueCode())) > 0) { |
| | | return AjaxResult.error("设å¤ç¼å·å·²åå¨ï¼" + deviceLedger.getUniqueCode()); |
| | | } |
| | | |
| | | boolean save = this.save(deviceLedger); |
| | | if (save){ |
| | | if (deviceLedgerDto.getStorageBlobDTOs() != null) { |
| | |
| | | |
| | | @Override |
| | | public AjaxResult updateDeviceLedger(DeviceLedgerDto deviceLedgerDto) { |
| | | if (StringUtils.isNotEmpty(deviceLedgerDto.getUniqueCode())) { |
| | | if (this.count(new LambdaQueryWrapper<DeviceLedger>() |
| | | .eq(DeviceLedger::getUniqueCode, deviceLedgerDto.getUniqueCode()) |
| | | .ne(DeviceLedger::getId, deviceLedgerDto.getId())) > 0) { |
| | | return AjaxResult.error("设å¤ç¼å·å·²åå¨ï¼" + deviceLedgerDto.getUniqueCode()); |
| | | } |
| | | } |
| | | |
| | | DeviceLedger deviceLedger = new DeviceLedger(); |
| | | BeanUtils.copyProperties(deviceLedgerDto, deviceLedger); |
| | | if (this.updateById(deviceLedger)) { |
| | |
| | | public Boolean importData(MultipartFile file) throws IOException { |
| | | ExcelUtil<DeviceLedgerExeclDto> util = new ExcelUtil<DeviceLedgerExeclDto>(DeviceLedgerExeclDto.class); |
| | | List<DeviceLedgerExeclDto> userList = util.importExcel(file.getInputStream()); |
| | | |
| | | String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | LambdaQueryWrapper<DeviceLedger> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.likeRight(DeviceLedger::getUniqueCode, "SB" + dateStr); |
| | | queryWrapper.orderByDesc(DeviceLedger::getUniqueCode); |
| | | queryWrapper.last("limit 1"); |
| | | DeviceLedger lastRecord = this.getOne(queryWrapper); |
| | | |
| | | // åºå¯¹Java lambda表达å¼å
åéå¿
é¡»æ¯finalçé®é¢ï¼ç¨æ°ç»æç±»çæåå
裹 |
| | | final int[] maxSequence = {0}; |
| | | if (lastRecord != null && StringUtils.isNotEmpty(lastRecord.getUniqueCode()) && lastRecord.getUniqueCode().length() >= 13) { |
| | | String lastSeqStr = lastRecord.getUniqueCode().substring(10); |
| | | try { |
| | | maxSequence[0] = Integer.parseInt(lastSeqStr); |
| | | } catch (NumberFormatException ignored) {} |
| | | } |
| | | |
| | | List<String> importUniqueCodes = new ArrayList<>(); |
| | | |
| | | userList.forEach(c -> { |
| | | DeviceLedger deviceLedger = new DeviceLedger(); |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(c.getCreateUser()); |
| | |
| | | deviceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | } |
| | | BeanUtils.copyProperties(c,deviceLedger); |
| | | |
| | | if (StringUtils.isEmpty(deviceLedger.getUniqueCode())) { |
| | | maxSequence[0]++; |
| | | deviceLedger.setUniqueCode("SB" + dateStr + String.format("%03d", maxSequence[0])); |
| | | } |
| | | if (importUniqueCodes.contains(deviceLedger.getUniqueCode())) { |
| | | throw new RuntimeException("导å
¥æä»¶ä¸åå¨éå¤ç设å¤ç¼å·ï¼" + deviceLedger.getUniqueCode()); |
| | | } |
| | | if (this.count(new LambdaQueryWrapper<DeviceLedger>().eq(DeviceLedger::getUniqueCode, deviceLedger.getUniqueCode())) > 0) { |
| | | throw new RuntimeException("设å¤ç¼å·å·²åå¨ï¼" + deviceLedger.getUniqueCode()); |
| | | } |
| | | importUniqueCodes.add(deviceLedger.getUniqueCode()); |
| | | // éè¿å«ç¨åä»·ãæ°éãç¨ç计ç®å«ç¨æ»ä»·ï¼ä¸å«ç¨æ»ä»· |
| | | deviceLedger.setTaxIncludingPriceTotal(c.getTaxIncludingPriceUnit()); |
| | | deviceLedger.setNumber(BigDecimal.ONE); |
| | |
| | | if (deviceLedger.getTaxIncludingPriceTotal() != null && c.getTaxRate() != null) { |
| | | deviceLedger.setUnTaxIncludingPriceTotal(deviceLedger.getTaxIncludingPriceTotal().divide(BigDecimal.ONE.add(c.getTaxRate()), 2, RoundingMode.HALF_UP)); |
| | | } |
| | | |
| | | if (c.getPurchaseDate() != null) { |
| | | deviceLedger.setPurchaseDate(DateUtils.toLocalDate(c.getPurchaseDate())); |
| | | } |
| | | if (c.getActivationDate() != null) { |
| | | deviceLedger.setActivationDate(DateUtils.toLocalDate(c.getActivationDate())); |
| | | } |
| | | if (c.getFilingDate() != null) { |
| | | deviceLedger.setFilingDate(DateUtils.toLocalDate(c.getFilingDate())); |
| | | } |
| | | |
| | | deviceLedgerMapper.insert(deviceLedger); |
| | | }); |
| | | |
| | |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SparePartsRequisitionRecord; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsRequisitionRecordService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.ruoyi.device.service.IDeviceRepairSparePartService; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private final DeviceMaintenanceMapper deviceMaintenanceMapper; |
| | | private final SparePartsMapper sparePartsMapper; |
| | | private final SparePartsRequisitionRecordService sparePartsRequisitionRecordService; |
| | | private final IDeviceRepairSparePartService deviceRepairSparePartService; |
| | | private final FileUtil fileUtil; |
| | | |
| | | @Override |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateDeviceDeviceMaintenance(DeviceMaintenanceDto deviceMaintenance) { |
| | | DeviceMaintenance oldDeviceMaintenance = this.getById(deviceMaintenance.getId()); |
| | | |
| | | // æ¸
çæ§çå¤ä»¶ä½¿ç¨è®°å½ï¼é²æ¢éå¤ç´¯è®¡ |
| | | deviceRepairSparePartService.remove(new QueryWrapper<DeviceRepairSparePart>() |
| | | .eq("source_id", deviceMaintenance.getId()) |
| | | .eq("source_type", 2)); |
| | | |
| | | // å¤çå¤ä»¶ä½¿ç¨æ
åµ |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(deviceMaintenance.getSparePartsUseList())) { |
| | | List<Long> sparePartIds = new ArrayList<>(); |
| | |
| | | record.setSparePartsId(sparePartUse.getId()); |
| | | record.setQuantity(sparePartUse.getQuantity()); |
| | | sparePartsRequisitionRecordService.save(record); |
| | | |
| | | // æå
¥è®°å½å° device_repair_spare_part |
| | | DeviceRepairSparePart partRecord = new DeviceRepairSparePart(); |
| | | partRecord.setSourceId(deviceMaintenance.getId()); |
| | | partRecord.setSourceType(2); // 2 ä¿å
» |
| | | partRecord.setSparePartId(sparePartUse.getId()); |
| | | partRecord.setQuantity(sparePartUse.getQuantity()); |
| | | deviceRepairSparePartService.save(partRecord); |
| | | } else { |
| | | return AjaxResult.error("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | } |
| | |
| | | public DeviceMaintenanceVo detailById(Long id) { |
| | | DeviceMaintenanceVo vo = deviceMaintenanceMapper.detailById(id); |
| | | vo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByRecordTypeAndRecordId(RecordTypeEnum.DEVICE_MAINTENANCE, id)); |
| | | List<DeviceRepairSparePart> parts = deviceRepairSparePartService.getListWithPartName(id, 2); |
| | | vo.setSparePartsUseListDetails(parts); |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.dto.DeviceDefectRecordDto; |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.approve.pojo.KnowledgeBase; |
| | | import com.ruoyi.approve.service.KnowledgeBaseService; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | import com.ruoyi.device.service.IDeviceRepairSparePartService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SparePartsRequisitionRecord; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsRequisitionRecordService; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | private final IDeviceLedgerService deviceLedgerService; |
| | | private final SparePartsMapper sparePartsMapper; |
| | | private final SparePartsRequisitionRecordService sparePartsRequisitionRecordService; |
| | | private final IDeviceRepairSparePartService deviceRepairSparePartService; |
| | | private final KnowledgeBaseService knowledgeBaseService; |
| | | private final FileUtil fileUtil; |
| | | |
| | | private static final int STATUS_PENDING_REPAIR = 0; |
| | |
| | | || oldDeviceRepair.getStatus() != STATUS_COMPLETED)) { |
| | | return AjaxResult.error("请å
æäº¤éªæ¶å®¡æ¹ï¼éªæ¶éè¿åæå¯å®ç»"); |
| | | } |
| | | // æ¸
çæ§çå¤ä»¶ä½¿ç¨è®°å½ï¼é²æ¢éå¤ç´¯è®¡ |
| | | deviceRepairSparePartService.remove(new QueryWrapper<DeviceRepairSparePart>() |
| | | .eq("source_id", deviceRepairDto.getId()) |
| | | .eq("source_type", 1)); |
| | | |
| | | // å¤çå¤ä»¶ä½¿ç¨æ
åµ |
| | | if (CollectionUtils.isNotEmpty(deviceRepairDto.getSparePartsUseList())) { |
| | | List<Long> sparePartIds = new ArrayList<>(); |
| | |
| | | record.setSparePartsId(sparePartUse.getId()); |
| | | record.setQuantity(sparePartUse.getQuantity()); |
| | | sparePartsRequisitionRecordService.save(record); |
| | | |
| | | // æå
¥è®°å½å° device_repair_spare_part |
| | | DeviceRepairSparePart partRecord = new DeviceRepairSparePart(); |
| | | partRecord.setSourceId(deviceRepairDto.getId()); |
| | | partRecord.setSourceType(1); // 1 æ¥ä¿® |
| | | partRecord.setSparePartId(sparePartUse.getId()); |
| | | partRecord.setQuantity(sparePartUse.getQuantity()); |
| | | deviceRepairSparePartService.save(partRecord); |
| | | } else { |
| | | return AjaxResult.error("å¤ä»¶ " + spareParts.getName() + " æ°éä¸è¶³"); |
| | | } |
| | |
| | | update.setAcceptanceRemark(deviceRepairDto.getAcceptanceRemark()); |
| | | update.setStatus(STATUS_COMPLETED); |
| | | if (this.updateById(update)) { |
| | | try { |
| | | DeviceLedger deviceLedger = deviceLedgerService.getById(oldDeviceRepair.getDeviceLedgerId()); |
| | | List<DeviceRepairSparePart> parts = deviceRepairSparePartService.getListWithPartName(deviceRepairDto.getId(), 1); |
| | | |
| | | String sparePartsInfo = ""; |
| | | if (CollectionUtils.isNotEmpty(parts)) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (DeviceRepairSparePart p : parts) { |
| | | sb.append(p.getSparePartName()).append("(").append(p.getQuantity()).append("个) "); |
| | | } |
| | | sparePartsInfo = " é
ä»¶ä½¿ç¨æ
åµ: " + sb.toString(); |
| | | } |
| | | |
| | | KnowledgeBase kb = new KnowledgeBase(); |
| | | String typeName = deviceLedger.getType(); |
| | | String deviceModel = deviceLedger.getDeviceModel(); |
| | | String repairTypeStr = oldDeviceRepair.getRepairType(); |
| | | String repairTypeLabel = DictUtils.getDictLabel("device_repair_type", repairTypeStr); |
| | | if (StringUtils.isBlank(repairTypeLabel)) { |
| | | repairTypeLabel = "ç»´ä¿®"; |
| | | } |
| | | |
| | | kb.setTitle((typeName != null ? typeName : "设å¤") + "_" + (deviceModel != null ? deviceModel : "") + " ç " + repairTypeLabel + "è®°å½"); |
| | | kb.setScenario("设å¤ç»´ä¿®"); |
| | | kb.setType("è§£å³æ¹æ¡"); |
| | | |
| | | String remarkStr = oldDeviceRepair.getRemark() == null ? "" : oldDeviceRepair.getRemark(); |
| | | kb.setProblem(String.format("设å¤å·: %s, 设å¤åç§°: %s, æ
éæè¿°: %s", |
| | | deviceLedger.getUniqueCode(), deviceLedger.getDeviceName(), |
| | | remarkStr)); |
| | | |
| | | String reasonStr = oldDeviceRepair.getReasonAnalysis() == null ? "" : oldDeviceRepair.getReasonAnalysis(); |
| | | String handlingStr = oldDeviceRepair.getHandlingMeasures() == null ? "" : oldDeviceRepair.getHandlingMeasures(); |
| | | kb.setSolution(String.format("åå åæ: %s. å¤çæªæ½: %s.%s", |
| | | reasonStr, handlingStr, sparePartsInfo)); |
| | | kb.setCreator(oldDeviceRepair.getMaintenanceName()); |
| | | |
| | | knowledgeBaseService.save(kb); |
| | | } catch(Exception e) { |
| | | log.error("ä¿åç¥è¯åºå¤±è´¥", e); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error("éªæ¶å®¡æ¹å¤±è´¥"); |
| | |
| | | public DeviceRepairVo detailById(Long id) { |
| | | DeviceRepairVo vo = deviceRepairMapper.detailById(id); |
| | | vo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByRecordTypeAndRecordId(RecordTypeEnum.DEVICE_REPAIR, id)); |
| | | List<DeviceRepairSparePart> parts = deviceRepairSparePartService.getListWithPartName(id, 1); |
| | | vo.setSparePartsUseListDetails(parts); |
| | | return vo; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.device.mapper.DeviceRepairSparePartMapper; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | import com.ruoyi.device.service.IDeviceRepairSparePartService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DeviceRepairSparePartServiceImpl extends ServiceImpl<DeviceRepairSparePartMapper, DeviceRepairSparePart> implements IDeviceRepairSparePartService { |
| | | |
| | | @Override |
| | | public List<DeviceRepairSparePart> getListWithPartName(Long sourceId, Integer sourceType) { |
| | | return baseMapper.selectListWithPartName(sourceId, sourceType); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.device.mapper.DeviceStatusChangeRecordMapper; |
| | | import com.ruoyi.device.pojo.DeviceStatusChangeRecord; |
| | | import com.ruoyi.device.service.IDeviceStatusChangeRecordService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DeviceStatusChangeRecordServiceImpl extends ServiceImpl<DeviceStatusChangeRecordMapper, DeviceStatusChangeRecord> implements IDeviceStatusChangeRecordService { |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public IPage<DeviceStatusChangeRecord> selectPageList(Page<DeviceStatusChangeRecord> page, DeviceStatusChangeRecord record) { |
| | | LambdaQueryWrapper<DeviceStatusChangeRecord> wrapper = Wrappers.lambdaQuery(); |
| | | if (record.getDeviceId() != null) { |
| | | wrapper.eq(DeviceStatusChangeRecord::getDeviceId, record.getDeviceId()); |
| | | } |
| | | wrapper.eq(DeviceStatusChangeRecord::getDeleted, 0); |
| | | wrapper.orderByDesc(DeviceStatusChangeRecord::getCreateTime); |
| | | |
| | | IPage<DeviceStatusChangeRecord> result = this.page(page, wrapper); |
| | | List<DeviceStatusChangeRecord> records = result.getRecords(); |
| | | if (records != null && !records.isEmpty()) { |
| | | for (DeviceStatusChangeRecord r : records) { |
| | | if (r.getCreateUser() != null) { |
| | | SysUser user = sysUserMapper.selectUserById(r.getCreateUser()); |
| | | if (user != null) { |
| | | r.setCreateUserName(user.getNickName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.DayOfWeek; |
| | |
| | | |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Autowired |
| | | private ISysNoticeService sysNoticeService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | |
| | | // 2. å建并ä¿åå·¡æ£ä»»å¡è®°å½ - è¿å°±æ¯æ¨æä¾ç代ç åºè¯¥æ¾çä½ç½® |
| | | DeviceMaintenance deviceMaintenance = createInspectionTask(timingTask); |
| | | deviceMaintenanceService.save(deviceMaintenance); |
| | | |
| | | // ç»æ§è¡äººåéç³»ç»éç¥ |
| | | if (timingTask.getExecutorId() != null) { |
| | | SysNotice notice = new SysNotice(); |
| | | notice.setNoticeTitle("æ°ä¿å
»ä»»å¡æé"); |
| | | notice.setNoticeType("1"); // 1 éç¥ |
| | | notice.setNoticeContent("æ¨æä¸ä¸ªæ°ç设å¤ä¿å
»ä»»å¡éè¦æ§è¡ï¼è®¾å¤åç§°ï¼" + timingTask.getTaskName()); |
| | | notice.setStatus("0"); // æ£å¸¸ |
| | | notice.setConsigneeId(timingTask.getExecutorId()); |
| | | notice.setSenderId(0L); // 0代表系ç»åé |
| | | notice.setTenantId(timingTask.getTenantId()); |
| | | sysNoticeService.insertNotice(notice); |
| | | } |
| | | |
| | | // 3. æ´æ°å®æ¶ä»»å¡çæ§è¡æ¶é´ |
| | | if (!tasks.isEmpty()) { |
| | |
| | | inspectionTask.setDeviceLedgerId(timingTask.getTaskId()); |
| | | inspectionTask.setMaintenancePlanTime(LocalDateTime.now()); |
| | | inspectionTask.setMaintenanceActuallyName(timingTask.getMaintenancePerson()); |
| | | inspectionTask.setExecutorId(timingTask.getExecutorId()); |
| | | inspectionTask.setMaintenanceType(timingTask.getMaintenanceType()); |
| | | inspectionTask.setFrequencyType(timingTask.getFrequencyType()); |
| | | inspectionTask.setFrequencyDetail(timingTask.getFrequencyDetail()); |
| | | inspectionTask.setTenantId(timingTask.getTenantId()); |
| | |
| | | |
| | | @Schema(description = "ä¿å
»å¾çå表") |
| | | private List<StorageBlobVO> storageBlobVOs; |
| | | |
| | | @Schema(description = "使ç¨å¤ä»¶è¯¦æ
å表") |
| | | private List<com.ruoyi.device.pojo.DeviceRepairSparePart> sparePartsUseListDetails; |
| | | } |
| | |
| | | |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.pojo.DeviceRepairSparePart; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | @Schema(description = "ç»´ä¿®æ¶é´å符串") |
| | | private String maintenanceTimeStr; |
| | | |
| | | @Schema(description = "å¤çæªæ½") |
| | | private String handlingMeasures; |
| | | |
| | | @Schema(description = "å¤ä»¶ä½¿ç¨è¯¦æ
å表") |
| | | private List<DeviceRepairSparePart> sparePartsUseListDetails; |
| | | |
| | | private List<StorageBlobVO> storageBlobVOs; |
| | | } |
| | |
| | | @Schema(description = "æ£å®äºº") |
| | | private Long userId; |
| | | |
| | | @Schema(description = "溯æº/æ ¸æ¥ç±»å") |
| | | private String traceabilityType; |
| | | |
| | | @Schema(description = "宿½æºæ") |
| | | private String implementingAgency; |
| | | |
| | | @Schema(description = "è¯ä¹¦ç¼å·") |
| | | private String certificateNumber; |
| | | |
| | | @Schema(description = "æ ¸å¿ç»æ") |
| | | private String coreResult; |
| | | |
| | | @Schema(description = "ç»æç¡®è®¤") |
| | | private String resultConfirmation; |
| | | |
| | | @Schema(description = "确认人id") |
| | | private Long confirmerId; |
| | | |
| | | @Schema(description = "确认人") |
| | | private String confirmerName; |
| | | |
| | | @Schema(description = "æææè³") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date validUntil; |
| | | } |
| | |
| | | @Schema(description = "æææï¼åä½å¤©ï¼") |
| | | private Integer valid; |
| | | |
| | | @Schema(description = "溯æº/æ ¸æ¥ç±»å") |
| | | @Excel(name = "溯æº/æ ¸æ¥ç±»å") |
| | | private String traceabilityType; |
| | | |
| | | @Schema(description = "宿½æºæ") |
| | | @Excel(name = "宿½æºæ") |
| | | private String implementingAgency; |
| | | |
| | | @Schema(description = "è¯ä¹¦ç¼å·") |
| | | @Excel(name = "è¯ä¹¦ç¼å·") |
| | | private String certificateNumber; |
| | | |
| | | @Schema(description = "æ ¸å¿ç»æ") |
| | | @Excel(name = "æ ¸å¿ç»æ") |
| | | private String coreResult; |
| | | |
| | | @Schema(description = "ç»æç¡®è®¤") |
| | | @Excel(name = "ç»æç¡®è®¤") |
| | | private String resultConfirmation; |
| | | |
| | | @Schema(description = "æææè³") |
| | | @Excel(name = "æææè³", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date validUntil; |
| | | |
| | | @Schema(description = "确认人id") |
| | | private Long confirmerId; |
| | | |
| | | @Schema(description = "确认人") |
| | | @Excel(name = "确认人") |
| | | private String confirmerName; |
| | | |
| | | |
| | | /** |
| | | * ç¶æï¼1-ææ 2-é¾æï¼ |
| | |
| | | measuringInstrumentLedgerRecord.setValid(req.getValid()); |
| | | measuringInstrumentLedgerRecord.setUserId(req.getUserId()); |
| | | measuringInstrumentLedgerRecord.setUserName(sysUser.getUserName()); |
| | | |
| | | // Set the new fields |
| | | measuringInstrumentLedgerRecord.setTraceabilityType(req.getTraceabilityType()); |
| | | measuringInstrumentLedgerRecord.setImplementingAgency(req.getImplementingAgency()); |
| | | measuringInstrumentLedgerRecord.setCertificateNumber(req.getCertificateNumber()); |
| | | measuringInstrumentLedgerRecord.setCoreResult(req.getCoreResult()); |
| | | measuringInstrumentLedgerRecord.setResultConfirmation(req.getResultConfirmation()); |
| | | measuringInstrumentLedgerRecord.setConfirmerId(req.getConfirmerId()); |
| | | measuringInstrumentLedgerRecord.setConfirmerName(req.getConfirmerName()); |
| | | measuringInstrumentLedgerRecord.setValidUntil(req.getValidUntil()); |
| | | |
| | | measuringInstrumentLedgerRecordMapper.insert(measuringInstrumentLedgerRecord); |
| | | // å°è´¦ç»å®ä¸æ¬¡ |
| | | // if(!CollectionUtils.isEmpty(req.getTempFileIds())){ |
| | |
| | | import com.ruoyi.projectManagement.vo.SaveInfoStageVo; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import com.ruoyi.projectManagement.vo.AttachmentGroupVo; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @GetMapping("/attachments/{id}") |
| | | @Operation(summary = "ææ¡£å½æ¡£ï¼è·åé¡¹ç®ææéä»¶") |
| | | public AjaxResult getAttachments(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(infoService.getProjectAttachments(id)); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.pojo.ProjectConfig; |
| | | import com.ruoyi.projectManagement.service.ProjectConfigService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/projectManagement/config") |
| | | @Tag(name = "项ç®ç®¡çé
置表") |
| | | @RequiredArgsConstructor |
| | | public class ProjectConfigController { |
| | | |
| | | private final ProjectConfigService projectConfigService; |
| | | |
| | | @GetMapping |
| | | @Operation(summary = "è·åå
¨å±é
ç½®") |
| | | public AjaxResult getConfig() { |
| | | return AjaxResult.success(projectConfigService.getGlobalConfig()); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Operation(summary = "ä¿®æ¹å
¨å±é
ç½®") |
| | | public AjaxResult updateConfig(@RequestBody ProjectConfig projectConfig) { |
| | | projectConfigService.updateGlobalConfig(projectConfig); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.projectManagement.pojo.ProjectConfig; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ProjectConfigMapper extends BaseMapper<ProjectConfig> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 项ç®ç®¡çé
置表 |
| | | */ |
| | | @Data |
| | | @TableName("project_management_config") |
| | | @Schema(description = "项ç®ç®¡çé
置对象") |
| | | public class ProjectConfig implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ååå件约å®åä¼ æåæéå¤©æ° |
| | | */ |
| | | @Schema(description = "ååå件约å®åä¼ æåæé天æ°") |
| | | @TableField("contract_return_reminder_days") |
| | | private Integer contractReturnReminderDays; |
| | | |
| | | @Schema(description = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "æ´æ°ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @Schema(description = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @Schema(description = "é¨é¨ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | } |
| | |
| | | private Integer status; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "åå»ºç¨æ·") |
| | |
| | | |
| | | |
| | | InfoVo getInfoById(@NotNull Long id); |
| | | |
| | | /** |
| | | * è·å项ç®ä¸ææéä»¶ |
| | | * @param id 项ç®id |
| | | * @return éä»¶ææ¨¡ååç»çéå |
| | | */ |
| | | java.util.List<com.ruoyi.projectManagement.vo.AttachmentGroupVo> getProjectAttachments(@NotNull Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.projectManagement.pojo.ProjectConfig; |
| | | |
| | | public interface ProjectConfigService extends IService<ProjectConfig> { |
| | | |
| | | /** |
| | | * è·åå
¨å±é
ç½®ï¼å¦ä¸åå¨åè¿å带æé»è®¤å¼çå®ä¾ï¼ |
| | | */ |
| | | ProjectConfig getGlobalConfig(); |
| | | |
| | | /** |
| | | * æ´æ°å
¨å±é
ç½® |
| | | */ |
| | | void updateGlobalConfig(ProjectConfig projectConfig); |
| | | } |
| | |
| | | import com.ruoyi.projectManagement.vo.ListInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import com.ruoyi.projectManagement.vo.AttachmentGroupVo; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.baomidou.mybatisplus.extension.toolkit.Db; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.basic.dto.StorageAttachmentDTO; |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.service.StorageAttachmentService; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import com.ruoyi.sales.service.ISalesLawsuitService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final ContractInfoHandleService contractInfoHandleService; |
| | | private final ShippingAddressHandleService shippingAddressHandleService; |
| | | private final ISalesLedgerService salesLedgerService; |
| | | private final StorageAttachmentService storageAttachmentService; |
| | | private final ISalesLawsuitService salesLawsuitService; |
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public List<AttachmentGroupVo> getProjectAttachments(Long id) { |
| | | List<AttachmentGroupVo> result = new java.util.ArrayList<>(); |
| | | |
| | | // 项ç®ç®¡çéä»¶ |
| | | StorageAttachmentDTO infoDto = new StorageAttachmentDTO(); |
| | | infoDto.setRecordType(RecordTypeEnum.INFO.getType()); |
| | | infoDto.setRecordId(id); |
| | | List<StorageBlobVO> infoFiles = storageAttachmentService.list(infoDto); |
| | | if (infoFiles != null && !infoFiles.isEmpty()) { |
| | | result.add(new AttachmentGroupVo("项ç®ç®¡ç", infoFiles)); |
| | | } |
| | | |
| | | // éå®å°è´¦éä»¶ |
| | | List<SalesLedger> ledgers = salesLedgerService.list(Wrappers.<SalesLedger>lambdaQuery().eq(SalesLedger::getProjectId, id)); |
| | | if (ledgers != null && !ledgers.isEmpty()) { |
| | | List<StorageBlobVO> ledgerFiles = new java.util.ArrayList<>(); |
| | | for (SalesLedger ledger : ledgers) { |
| | | StorageAttachmentDTO dto = new StorageAttachmentDTO(); |
| | | dto.setRecordType(RecordTypeEnum.SALES_LEDGER.getType()); |
| | | dto.setRecordId(ledger.getId()); |
| | | List<StorageBlobVO> files = storageAttachmentService.list(dto); |
| | | if (files != null && !files.isEmpty()) { |
| | | ledgerFiles.addAll(files); |
| | | } |
| | | } |
| | | if (!ledgerFiles.isEmpty()) { |
| | | result.add(new AttachmentGroupVo("éå®å°è´¦", ledgerFiles)); |
| | | } |
| | | } |
| | | |
| | | // è¯è®¼ç®¡çéä»¶ |
| | | List<SalesLawsuit> lawsuits = salesLawsuitService.list(Wrappers.<SalesLawsuit>lambdaQuery().eq(SalesLawsuit::getProjectId, id)); |
| | | if (lawsuits != null && !lawsuits.isEmpty()) { |
| | | List<StorageBlobVO> lawsuitFiles = new java.util.ArrayList<>(); |
| | | for (SalesLawsuit lawsuit : lawsuits) { |
| | | StorageAttachmentDTO dto = new StorageAttachmentDTO(); |
| | | dto.setRecordType(RecordTypeEnum.SALES_LAWSUIT.getType()); |
| | | dto.setRecordId(lawsuit.getId()); |
| | | List<StorageBlobVO> files = storageAttachmentService.list(dto); |
| | | if (files != null && !files.isEmpty()) { |
| | | lawsuitFiles.addAll(files); |
| | | } |
| | | } |
| | | if (!lawsuitFiles.isEmpty()) { |
| | | result.add(new AttachmentGroupVo("è¯è®¼ç®¡ç", lawsuitFiles)); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.projectManagement.mapper.ProjectConfigMapper; |
| | | import com.ruoyi.projectManagement.pojo.ProjectConfig; |
| | | import com.ruoyi.projectManagement.service.ProjectConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | public class ProjectConfigServiceImpl extends ServiceImpl<ProjectConfigMapper, ProjectConfig> implements ProjectConfigService { |
| | | |
| | | @Override |
| | | public ProjectConfig getGlobalConfig() { |
| | | ProjectConfig config = this.getById(1L); |
| | | if (config == null) { |
| | | config = new ProjectConfig(); |
| | | config.setId(1L); |
| | | config.setContractReturnReminderDays(3); |
| | | this.save(config); |
| | | } |
| | | return config; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateGlobalConfig(ProjectConfig projectConfig) { |
| | | projectConfig.setId(1L); // å¼ºå¶æ´æ° ID=1 çè®°å½ |
| | | this.saveOrUpdate(projectConfig); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Schema(description = "é件彿¡£åç»å¯¹è±¡") |
| | | public class AttachmentGroupVo { |
| | | |
| | | @Schema(description = "模ååç§°(å¦ï¼é¡¹ç®ç®¡çãéå®å°è´¦ç)") |
| | | private String moduleName; |
| | | |
| | | @Schema(description = "模åå
对åºçéä»¶å表") |
| | | private List<StorageBlobVO> files; |
| | | |
| | | public AttachmentGroupVo() { |
| | | } |
| | | |
| | | public AttachmentGroupVo(String moduleName, List<StorageBlobVO> files) { |
| | | this.moduleName = moduleName; |
| | | this.files = files; |
| | | } |
| | | } |
| | |
| | | |
| | | private String createUserName; // å建人åç§° |
| | | private String updateUserName; // æ´æ°äººåç§° |
| | | // éå®ååæ»æ° |
| | | private Integer salesContractCount; |
| | | // å
¨é¨é¶æ®µä¿¡æ¯ |
| | | private List<PlanStageDto> planStage; |
| | | } |
| | |
| | | public void down(HttpServletResponse response, @RequestBody QualityInspect qualityInspect) { |
| | | qualityInspectService.down(response, qualityInspect); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½PDF |
| | | * |
| | | * @param response |
| | | * @param qualityInspect |
| | | */ |
| | | @PostMapping("/downPdf") |
| | | @Operation(summary = "ä¸è½½æ£éªPDF") |
| | | @Log(title = "ä¸è½½æ£éªPDF", businessType = BusinessType.OTHER) |
| | | public void downPdf(HttpServletResponse response, @RequestBody QualityInspect qualityInspect) { |
| | | qualityInspectService.downPdf(response, qualityInspect); |
| | | } |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | private String controlValue; |
| | | |
| | | /** |
| | | * åæ°ç±»å(0-æå, 1-æ°å) |
| | | */ |
| | | @Excel(name = "åæ°ç±»å") |
| | | private Integer parameterType; |
| | | |
| | | /** |
| | | * æå¤§å¼ |
| | | */ |
| | | @Excel(name = "æå¤§å¼") |
| | | private BigDecimal maxValue; |
| | | |
| | | /** |
| | | * æå°å¼ |
| | | */ |
| | | @Excel(name = "æå°å¼") |
| | | private BigDecimal minValue; |
| | | |
| | | /** |
| | | * æ£éªå¼ |
| | | */ |
| | | @Excel(name = "æ£éªå¼") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | |
| | | @Schema(description = "å
æ§å¼") |
| | | private String controlValue; |
| | | |
| | | @Schema(description = "åæ°ç±»å(0-æå, 1-æ°å)") |
| | | private Integer parameterType; |
| | | |
| | | @Schema(description = "æå¤§å¼") |
| | | private BigDecimal maxValue; |
| | | |
| | | @Schema(description = "æå°å¼") |
| | | private BigDecimal minValue; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | |
| | | R autoSubmit(Long id); |
| | | |
| | | void down(HttpServletResponse response, QualityInspect qualityInspect); |
| | | |
| | | void downPdf(HttpServletResponse response, QualityInspect qualityInspect); |
| | | } |
| | |
| | | for (QualityInspectParam detail : paramList) { |
| | | detail.setIndex(index); |
| | | index++; |
| | | |
| | | if (detail.getParameterType() != null && detail.getParameterType() == 1) { |
| | | String min = detail.getMinValue() != null ? detail.getMinValue().stripTrailingZeros().toPlainString() : ""; |
| | | String max = detail.getMaxValue() != null ? detail.getMaxValue().stripTrailingZeros().toPlainString() : ""; |
| | | detail.setStandardValue(min + "~" + max); |
| | | } |
| | | } |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx"); |
| | | Configure configure = Configure.builder() |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void downPdf(HttpServletResponse response, QualityInspect qualityInspect) { |
| | | QualityInspect inspect = qualityInspectMapper.selectById(qualityInspect.getId()); |
| | | String inspectType = ""; |
| | | switch (inspect.getInspectType()) { |
| | | case 0: |
| | | inspectType = "åæææ£éª"; |
| | | break; |
| | | case 1: |
| | | inspectType = "è¿ç¨æ£éª"; |
| | | break; |
| | | case 2: |
| | | inspectType = "åºåæ£éª"; |
| | | break; |
| | | } |
| | | List<QualityInspectParam> paramList = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, inspect.getId())); |
| | | int index = 1; |
| | | for (QualityInspectParam detail : paramList) { |
| | | detail.setIndex(index); |
| | | index++; |
| | | |
| | | if (detail.getParameterType() != null && detail.getParameterType() == 1) { |
| | | String min = detail.getMinValue() != null ? detail.getMinValue().stripTrailingZeros().toPlainString() : ""; |
| | | String max = detail.getMaxValue() != null ? detail.getMaxValue().stripTrailingZeros().toPlainString() : ""; |
| | | detail.setStandardValue(min + "~" + max); |
| | | } |
| | | } |
| | | InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx"); |
| | | Configure configure = Configure.builder() |
| | | .bind("paramList", new HackLoopTableRenderPolicy()) |
| | | .build(); |
| | | String finalInspectType = inspectType; |
| | | XWPFTemplate template = XWPFTemplate.compile(inputStream, configure).render( |
| | | new HashMap<String, Object>() {{ |
| | | put("inspect", inspect); |
| | | put("inspectType", finalInspectType); |
| | | put("paramList", paramList); |
| | | }}); |
| | | |
| | | try { |
| | | // å
å°æ¨¡æ¿åå
¥å° ByteArrayOutputStream ä¸ |
| | | java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); |
| | | template.write(bos); |
| | | bos.flush(); |
| | | bos.close(); |
| | | inputStream.close(); |
| | | |
| | | // ä½¿ç¨ Spire.Doc 读å docx æ°æ®æµå¹¶è½¬ä¸º PDF |
| | | java.io.ByteArrayInputStream bis = new java.io.ByteArrayInputStream(bos.toByteArray()); |
| | | com.spire.doc.Document document = new com.spire.doc.Document(bis); |
| | | |
| | | response.setContentType("application/pdf"); |
| | | String fileName = URLEncoder.encode("æ£éªæ¥å", "UTF-8"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".pdf"); |
| | | |
| | | java.io.OutputStream os = response.getOutputStream(); |
| | | document.saveToStream(os, com.spire.doc.FileFormat.PDF); |
| | | os.flush(); |
| | | os.close(); |
| | | bis.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int updateQualityInspect(QualityInspectDto qualityInspectDto) { |
| | | if (ObjectUtils.isNotNull(qualityInspectDto.getQualityInspectParams())) { |
| | | qualityInspectParamService.remove(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, qualityInspectDto.getId())); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.BiddingManagementDto; |
| | | import com.ruoyi.sales.pojo.BiddingManagement; |
| | | import com.ruoyi.sales.service.IBiddingManagementService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æææ 管çController |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sales/bidding") |
| | | @AllArgsConstructor |
| | | @Tag(name = "æææ 管ç") |
| | | public class BiddingManagementController extends BaseController { |
| | | |
| | | private final IBiddingManagementService biddingManagementService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ 管çå表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Operation(summary = "æ¥è¯¢æææ 管çå表(å页)") |
| | | public AjaxResult listPage(Page<BiddingManagement> page, BiddingManagementDto dto) { |
| | | IPage<BiddingManagement> iPage = biddingManagementService.selectBiddingManagementList(page, dto); |
| | | return AjaxResult.success(iPage); |
| | | } |
| | | |
| | | /** |
| | | * è·åæææ 管ç详ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/getDetail") |
| | | @Operation(summary = "è·åæææ 管ç详ç»ä¿¡æ¯") |
| | | public AjaxResult getDetail(@RequestParam("id") Long id) { |
| | | return AjaxResult.success(biddingManagementService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹æææ 管ç |
| | | */ |
| | | @Log(title = "æææ 管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdate") |
| | | @Operation(summary = "æ°å¢æä¿®æ¹æææ 管ç") |
| | | public AjaxResult addOrUpdate(@RequestBody BiddingManagementDto dto) { |
| | | return toAjax(biddingManagementService.addOrUpdateBiddingManagement(dto)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤æææ ç®¡ç |
| | | */ |
| | | @Log(title = "æææ 管ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | @Operation(summary = "å é¤æææ ç®¡ç") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return toAjax(biddingManagementService.deleteBiddingManagementByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæææ ç®¡çå表 |
| | | */ |
| | | @Log(title = "æææ 管ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @Operation(summary = "å¯¼åºæææ ç®¡ç") |
| | | public void export(HttpServletResponse response, BiddingManagementDto dto) { |
| | | List<BiddingManagement> list = biddingManagementService.selectBiddingManagementList(dto); |
| | | ExcelUtil<BiddingManagement> util = new ExcelUtil<>(BiddingManagement.class); |
| | | util.exportExcel(response, list, "æææ ç®¡çæ°æ®"); |
| | | } |
| | | } |
| | |
| | | return metricStatisticsService.statisticsTable(statisticsTableDto); |
| | | } |
| | | |
| | | @GetMapping("/projectTransactions") |
| | | @Operation(summary = "è¥é管ç--客æ·å¾æ¥-é¡¹ç®æ±æ»") |
| | | public R projectTransactions(Page page, String projectName, String customerName, String contractName) { |
| | | return R.ok(customerService.projectTransactions(page, projectName, customerName, contractName)); |
| | | } |
| | | |
| | | @GetMapping("/customewTransactions") |
| | | @Log(title = "客æ·å¾æ¥", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "客æ·å¾æ¥") |
| | | public R customewTransactions(Page page, String customerName) { |
| | | return R.ok(customerService.customewTransactions(page,customerName)); |
| | | @Operation(summary = "è¥é管ç--客æ·å¾æ¥-å®¢æ·æ±æ»") |
| | | public R customewTransactions(Page page, Long projectId, String customerName, String contractName) { |
| | | return R.ok(customerService.customewTransactions(page, projectId, customerName, contractName)); |
| | | } |
| | | |
| | | @GetMapping("/customewTransactionsDetails") |
| | | @Log(title = "客æ·å¾æ¥æç»", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "客æ·å¾æ¥æç»") |
| | | public R customewTransactionsDetails(Page page, Long customerId) { |
| | | return R.ok(customerService.customewTransactionsDetails(page,customerId)); |
| | | @Operation(summary = "è¥é管ç--客æ·å¾æ¥æç»-åå级") |
| | | public R customewTransactionsDetails(Page page, Long projectId, Long customerId, String contractName) { |
| | | return R.ok(customerService.customewTransactionsDetails(page, projectId, customerId, contractName)); |
| | | } |
| | | |
| | | @GetMapping("/transactionsSummary") |
| | | @Operation(summary = "è¥é管ç--客æ·å¾æ¥-å¤§çæ»è§") |
| | | public R transactionsSummary() { |
| | | return R.ok(customerService.transactionsSummary()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.SalesContractDTO; |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import com.ruoyi.sales.service.ISalesContractService; |
| | | import com.ruoyi.sales.vo.SalesContractVO; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éå®åå Controller |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sales/contract") |
| | | public class SalesContractController extends BaseController { |
| | | |
| | | @Resource |
| | | private ISalesContractService salesContractService; |
| | | |
| | | /** |
| | | * æ¥è¯¢éå®ååå页å表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<SalesContract> page, SalesContractDTO dto) { |
| | | return AjaxResult.success(salesContractService.listPage(page, dto)); |
| | | } |
| | | |
| | | /** |
| | | * è·åéå®åå详æ
|
| | | */ |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam("id") Long id) { |
| | | return salesContractService.getDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢éå®ååä¸å页å表 |
| | | */ |
| | | @GetMapping("/listNoPage") |
| | | public AjaxResult listNoPage(SalesContractDTO dto) { |
| | | return AjaxResult.success(salesContractService.selectList(dto)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹éå®åå |
| | | */ |
| | | @Log(title = "éå®åå", businessType = BusinessType.INSERT) |
| | | @PostMapping("/addOrUpdate") |
| | | public AjaxResult addOrUpdate(@RequestBody SalesContractDTO dto) { |
| | | return salesContractService.addOrUpdate(dto); |
| | | } |
| | | |
| | | /** |
| | | * å é¤éå®åå |
| | | */ |
| | | @Log(title = "éå®åå", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | return salesContractService.del(ids); |
| | | } |
| | | |
| | | /** |
| | | * 导åºéå®åå |
| | | */ |
| | | @Log(title = "éå®åå", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SalesContractDTO dto) { |
| | | List<SalesContract> list = salesContractService.selectList(dto); |
| | | ExcelUtil<SalesContract> util = new ExcelUtil<>(SalesContract.class); |
| | | util.exportExcel(response, list, "éå®ååæ°æ®"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.SalesLawsuitDTO; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import com.ruoyi.sales.service.ISalesLawsuitService; |
| | | import com.ruoyi.sales.vo.SalesLawsuitVO; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è¯è®¼ç®¡ç Controller |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sales/lawsuit") |
| | | public class SalesLawsuitController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ISalesLawsuitService salesLawsuitService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è¯è®¼å表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<SalesLawsuit> page, SalesLawsuitDTO dto) { |
| | | return AjaxResult.success(salesLawsuitService.listPage(page, dto)); |
| | | } |
| | | |
| | | /** |
| | | * è¯è®¼è¯¦æ
åæ¾ |
| | | */ |
| | | @GetMapping("/getDetail") |
| | | public AjaxResult getDetail(@RequestParam("id") Long id) { |
| | | return salesLawsuitService.getDetail(id); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ææ´æ°è¯è®¼ |
| | | */ |
| | | @PostMapping("/addOrUpdate") |
| | | public AjaxResult addOrUpdate(@RequestBody SalesLawsuitDTO dto) { |
| | | return salesLawsuitService.addOrUpdate(dto); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤è¯è®¼ |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | return salesLawsuitService.del(ids); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¯è®¼è®°å½ |
| | | */ |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SalesLawsuitDTO dto) { |
| | | List<SalesLawsuit> list = salesLawsuitService.selectList(dto); |
| | | ExcelUtil<SalesLawsuit> util = new ExcelUtil<>(SalesLawsuit.class); |
| | | util.exportExcel(response, list, "è¯è®¼æ°æ®"); |
| | | } |
| | | } |
| | |
| | | if (byId == null) { |
| | | return AjaxResult.error("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | if ("å®¡æ ¸éè¿".equals(byId.getStatus()) && !"å·²åè´§".equals(req.getStatus())) { |
| | | // Note: If the request is from outbound management trying to change status to "å·²åè´§", it's allowed. |
| | | // But if it's a normal edit, it's blocked. We just check if it's already å®¡æ ¸éè¿ and they are updating other fields. |
| | | return AjaxResult.error("å·²å®¡æ ¸éè¿ï¼ä¸è½ç¼è¾åè´§ä¿¡æ¯"); |
| | | } |
| | | boolean update = shippingInfoService.updateById(req); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | |
| | | for (Long id : ids) { |
| | | ShippingInfo byId = shippingInfoService.getById(id); |
| | | if (byId != null && ("å·²åè´§".equals(byId.getStatus()) || "å®¡æ ¸éè¿".equals(byId.getStatus()))) { |
| | | return AjaxResult.error("åå¨å·²åè´§æå®¡æ ¸éè¿ç产åï¼ä¸è½å é¤"); |
| | | } |
| | | } |
| | | return shippingInfoService.delete(ids) ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/export") |
| | | @Operation(summary = "导åºåè´§ä¿¡æ¯") |
| | | public void export(HttpServletResponse response) { |
| | | List<ShippingInfo> list = shippingInfoMapper.listAll(); |
| | | public void export(HttpServletResponse response, ShippingInfo req) { |
| | | List<ShippingInfo> list = shippingInfoMapper.listAll(req); |
| | | ExcelUtil<ShippingInfo> util = new ExcelUtil<ShippingInfo>(ShippingInfo.class); |
| | | util.exportExcel(response, list, "åè´§ä¿¡æ¯"); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class BiddingManagementDto { |
| | | private Long id; |
| | | |
| | | private Long projectId; |
| | | |
| | | private String projectName; |
| | | |
| | | private String bidDocName; |
| | | |
| | | private String tenderUnit; |
| | | |
| | | private String bidUnit; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date tenderDate; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date bidDate; |
| | | |
| | | private String bidDateStart; |
| | | |
| | | private String bidDateEnd; |
| | | |
| | | private BigDecimal bidDocFee; |
| | | |
| | | private String bidDocFeeStatus; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date bidDocFeeStatusChangeDate; |
| | | |
| | | private BigDecimal bidDeposit; |
| | | |
| | | private String bidResult; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import com.ruoyi.sales.pojo.SalesContractProduct; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SalesContractDTO extends SalesContract { |
| | | |
| | | /** |
| | | * 产åæç»å表 |
| | | */ |
| | | private List<SalesContractProduct> productList; |
| | | |
| | | /** |
| | | * ç¾è®¢æ¶é´ï¼æ¥è¯¢å¼å§æ¶é´ï¼ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate signDateStart; |
| | | |
| | | /** |
| | | * ç¾è®¢æ¶é´ï¼æ¥è¯¢ç»ææ¶é´ï¼ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate signDateEnd; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SalesLawsuitDTO extends SalesLawsuit { |
| | | |
| | | /** |
| | | * éä»¶å表 |
| | | */ |
| | | private List<StorageBlobDTO> storageBlobDTOs; |
| | | |
| | | /** |
| | | * ç«æ¡æ¶é´ï¼æ¥è¯¢å¼å§æ¶é´ï¼ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate filingDateStart; |
| | | |
| | | /** |
| | | * ç«æ¡æ¶é´ï¼æ¥è¯¢ç»ææ¶é´ï¼ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate filingDateEnd; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | private List<StorageBlobDTO> storageBlobDTOs; |
| | | private List<StorageBlobVO> StorageBlobVOs; |
| | | |
| | | @Schema(description = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @Schema(description = "年份") |
| | | private Integer year; |
| | | |
| | | @Schema(description = "ç¾ååä½ID") |
| | | private Long signingUnitId; |
| | | |
| | | @Schema(description = "åäºå¤ID") |
| | | private Long officeId; |
| | | |
| | | @Schema(description = "ç»è´è´£äººID") |
| | | private Long groupLeaderId; |
| | | |
| | | @Schema(description = "æ¯å¦å¼å票(1æ¯ 0å¦)") |
| | | private Integer isInvoice; |
| | | |
| | | @Schema(description = "䏿 价") |
| | | private BigDecimal bidPrice; |
| | | |
| | | @Schema(description = "æ¯å¦ä¸æ (1æ¯ 0å¦)") |
| | | private Integer isBid; |
| | | |
| | | @Schema(description = "æªä¸æ åå ") |
| | | private String unbidReason; |
| | | |
| | | @Schema(description = "ååå件约å®åä¼ æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate contractOriginalReturnDate; |
| | | |
| | | @Schema(description = "å
³èååIDå表") |
| | | private List<Long> associatedContractIds; |
| | | } |
| | |
| | | private String approveUserIds; |
| | | |
| | | private Long templateId; |
| | | |
| | | @Schema(description = "项ç®åç§°") |
| | | private String projectName; |
| | | } |
| | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | @TableField(exist = false) |
| | | private List<CommonFile> commonFileList; |
| | | |
| | | @Schema(description = "éè´§åå·éå") |
| | | @TableField(exist = false) |
| | | private List<String> returnNoList; |
| | | |
| | | @Schema(description = "éè´§åå·å符串") |
| | | @TableField(exist = false) |
| | | private String returnNos; |
| | | |
| | | private String specificationModel; |
| | | |
| | | private String productName; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.BiddingManagement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * æææ 管çMapperæ¥å£ |
| | | */ |
| | | @Mapper |
| | | public interface BiddingManagementMapper extends BaseMapper<BiddingManagement> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * éå®åå Mapper æ¥å£ |
| | | */ |
| | | @Mapper |
| | | public interface SalesContractMapper extends BaseMapper<SalesContract> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesContractProduct; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * éå®åå产åæç» Mapper æ¥å£ |
| | | */ |
| | | @Mapper |
| | | public interface SalesContractProductMapper extends BaseMapper<SalesContractProduct> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * è¯è®¼ç®¡ç Mapper æ¥å£ |
| | | */ |
| | | @Mapper |
| | | public interface SalesLawsuitMapper extends BaseMapper<SalesLawsuit> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerContractRel; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * éå®å°è´¦ä¸ååå
³è表Mapperæ¥å£ |
| | | */ |
| | | @Mapper |
| | | public interface SalesLedgerContractRelMapper extends BaseMapper<SalesLedgerContractRel> { |
| | | |
| | | } |
| | |
| | | public interface ShippingInfoMapper extends BaseMapper<ShippingInfo> { |
| | | IPage<ShippingInfoDto> listPage(Page page, @Param("req") ShippingInfo req); |
| | | |
| | | List<ShippingInfo> listAll(); |
| | | List<ShippingInfo> listAll(@Param("req") ShippingInfo req); |
| | | |
| | | List<ShippingProductVo> getReturnManagementDtoById(@Param("shippingId")Long shippingId); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * æææ 管ç对象 bidding_management |
| | | */ |
| | | @TableName(value = "bidding_management") |
| | | @Data |
| | | public class BiddingManagement implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æå±é¡¹ç®ID |
| | | */ |
| | | private Long projectId; |
| | | |
| | | /** |
| | | * æå±é¡¹ç®åç§° |
| | | */ |
| | | @Excel(name = "æå±é¡¹ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** |
| | | * æ 书åç§° |
| | | */ |
| | | @Excel(name = "æ 书åç§°") |
| | | private String bidDocName; |
| | | |
| | | /** |
| | | * ææ åä½ |
| | | */ |
| | | @Excel(name = "ææ åä½") |
| | | private String tenderUnit; |
| | | |
| | | /** |
| | | * ææ åä½ |
| | | */ |
| | | @Excel(name = "ææ åä½") |
| | | private String bidUnit; |
| | | |
| | | /** |
| | | * ææ æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ææ æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date tenderDate; |
| | | |
| | | /** |
| | | * ææ æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ææ æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date bidDate; |
| | | |
| | | /** |
| | | * æ 书款éé¢ |
| | | */ |
| | | @Excel(name = "æ 书款éé¢") |
| | | private BigDecimal bidDocFee; |
| | | |
| | | /** |
| | | * æ ä¹¦æ¬¾ç¶æ |
| | | */ |
| | | @Excel(name = "æ ä¹¦æ¬¾ç¶æ") |
| | | private String bidDocFeeStatus; |
| | | |
| | | /** |
| | | * æ ä¹¦æ¬¾ç¶æåæ´æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ ä¹¦æ¬¾ç¶æåæ´æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date bidDocFeeStatusChangeDate; |
| | | |
| | | /** |
| | | * ææ ä¿è¯ééé¢ |
| | | */ |
| | | @Excel(name = "ææ ä¿è¯ééé¢") |
| | | private BigDecimal bidDeposit; |
| | | |
| | | /** |
| | | * æææ ç»æ |
| | | */ |
| | | @Excel(name = "æææ ç»æ") |
| | | private String bidResult; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * é¨é¨ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ |
| | | */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * éå®åå主表å®ä½ |
| | | */ |
| | | @Data |
| | | @TableName("sales_contract") |
| | | public class SalesContract { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** ååç¼å· */ |
| | | @Excel(name = "ååç¼å·") |
| | | private String contractNo; |
| | | |
| | | /** ç¾è®¢æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç¾è®¢æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate signDate; |
| | | |
| | | /** ç¾çº¦åä½ç®ç§° */ |
| | | @Excel(name = "ç¾çº¦åä½ç®ç§°") |
| | | private String signingUnit; |
| | | |
| | | /** ç¾çº¦å¨æ */ |
| | | @Excel(name = "ç¾çº¦å¨æ") |
| | | private String contractPeriod; |
| | | |
| | | /** åæ¡£ç¶æ */ |
| | | @Excel(name = "åæ¡£ç¶æ") |
| | | private String archiveStatus; |
| | | |
| | | /** åæ¡£æ
åµè¯´æ */ |
| | | @Excel(name = "åæ¡£æ
åµè¯´æ") |
| | | private String archiveRemark; |
| | | |
| | | /** 履约ä¿è¯é */ |
| | | @Excel(name = "履约ä¿è¯é") |
| | | private BigDecimal performanceBond; |
| | | |
| | | /** è´¨ä¿éæ
åµ */ |
| | | @Excel(name = "è´¨ä¿éæ
åµ") |
| | | private BigDecimal warrantyDeposit; |
| | | |
| | | /** 产å¼ï¼èªå¨æ±æ»ï¼ */ |
| | | @Excel(name = "产å¼") |
| | | private BigDecimal outputValue; |
| | | |
| | | /** 已忬¾éé¢ */ |
| | | @Excel(name = "已忬¾éé¢") |
| | | private BigDecimal receivedAmount; |
| | | |
| | | /** ç»ç®æ¬¡æ° */ |
| | | @Excel(name = "ç»ç®æ¬¡æ°") |
| | | private Integer settlementCount; |
| | | |
| | | /** åºæ¶éé¢ */ |
| | | @Excel(name = "åºæ¶éé¢") |
| | | private BigDecimal receivableAmount; |
| | | |
| | | /** åºä»æ¯ä¾ */ |
| | | @Excel(name = "åºä»æ¯ä¾") |
| | | private String payableRatio; |
| | | |
| | | /** ååèç¹åºæ¶ */ |
| | | @Excel(name = "ååèç¹åºæ¶") |
| | | private BigDecimal nodeReceivable; |
| | | |
| | | /** åå约å®ä»æ¬¾èç¹ */ |
| | | @Excel(name = "åå约å®ä»æ¬¾èç¹") |
| | | private String paymentNodes; |
| | | |
| | | /** ç»ç®è®°å½ */ |
| | | @Excel(name = "ç»ç®è®°å½") |
| | | private String settlementRecord; |
| | | |
| | | /** å¼ç¥¨è¦æ± */ |
| | | @Excel(name = "å¼ç¥¨è¦æ±") |
| | | private String invoiceRequirement; |
| | | |
| | | /** æè¿ä¸æ¬¡å¼ç¥¨æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æè¿ä¸æ¬¡å¼ç¥¨æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate lastInvoiceDate; |
| | | |
| | | /** å·²å¼ç¥¨éé¢ */ |
| | | @Excel(name = "å·²å¼ç¥¨éé¢") |
| | | private BigDecimal invoicedAmount; |
| | | |
| | | /** è¿çº¦éçº¦å® */ |
| | | @Excel(name = "è¿çº¦é约å®") |
| | | private String penaltyAgreement; |
| | | |
| | | /** æ
åµè¯´æ */ |
| | | @Excel(name = "æ
åµè¯´æ") |
| | | private String remark; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** å建è
*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** ç§æ·ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | /** é¨é¨ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * éå®åå产åæç»è¡¨å®ä½ |
| | | */ |
| | | @Data |
| | | @TableName("sales_contract_product") |
| | | public class SalesContractProduct { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** å
³èéå®åå ID */ |
| | | private Long contractId; |
| | | |
| | | /** 产å大类 */ |
| | | private String productCategory; |
| | | |
| | | /** è§æ ¼åå· */ |
| | | private String specificationModel; |
| | | |
| | | /** è§æ ¼åå· ID */ |
| | | private Long productModelId; |
| | | |
| | | /** å«ç¨åä»· */ |
| | | private BigDecimal taxInclusiveUnitPrice; |
| | | |
| | | /** 约å®/æä¼°ç¨é */ |
| | | private BigDecimal agreedQuantity; |
| | | |
| | | /** åå计éåä½ */ |
| | | private String contractUnit; |
| | | |
| | | /** å·²åè´§æ°é */ |
| | | private BigDecimal shippedQuantity; |
| | | |
| | | /** äº§å¼ */ |
| | | private BigDecimal outputValue; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** å建è
*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** ç§æ·ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | /** é¨é¨ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * è¯è®¼ç®¡ç 主表å®ä½ |
| | | */ |
| | | @Data |
| | | @TableName("sales_lawsuit") |
| | | public class SalesLawsuit { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** æ¡ä»¶ç¼å· */ |
| | | @Excel(name = "æ¡ä»¶ç¼å·") |
| | | private String caseNo; |
| | | |
| | | /** æå±é¡¹ç® ID */ |
| | | private Long projectId; |
| | | |
| | | /** æå±é¡¹ç®åç§° */ |
| | | @Excel(name = "æå±é¡¹ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** å
³èéå®åå ID */ |
| | | private Long contractId; |
| | | |
| | | /** ååç¼å· */ |
| | | @Excel(name = "ååç¼å·") |
| | | private String contractNo; |
| | | |
| | | /** è¯è®¼ç¶æ */ |
| | | @Excel(name = "è¯è®¼ç¶æ") |
| | | private String lawsuitStatus; |
| | | |
| | | /** ç«æ¡æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç«æ¡æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate filingDate; |
| | | |
| | | /** æ¿åå¾å¸/æ³å¡è´è´£äºº */ |
| | | @Excel(name = "æ¿åå¾å¸/æ³å¡è´è´£äºº") |
| | | private String lawyer; |
| | | |
| | | /** å¼åºæ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¼åºæ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate hearingDate; |
| | | |
| | | /** è¯è®¼æ çéé¢ */ |
| | | @Excel(name = "è¯è®¼æ çéé¢") |
| | | private BigDecimal claimAmount; |
| | | |
| | | /** å¤å³ç»ææè¦ */ |
| | | @Excel(name = "å¤å³ç»ææè¦") |
| | | private String judgmentSummary; |
| | | |
| | | /** è¯è®¼è¿å±å¤æ³¨ */ |
| | | @Excel(name = "è¯è®¼è¿å±å¤æ³¨") |
| | | private String progressRemark; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** å建è
*/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** æ´æ°æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** æ´æ°è
*/ |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** ç§æ·ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | |
| | | /** é¨é¨ID */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | /** å 餿 å¿ */ |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éå®å°è´¦å¯¹è±¡ sales_ledger |
| | |
| | | @TableField(exist = false) |
| | | private Boolean hasProductionRecord; |
| | | |
| | | @Schema(description = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @Schema(description = "年份") |
| | | @Excel(name = "年份") |
| | | private Integer year; |
| | | |
| | | @Schema(description = "ç¾ååä½ID") |
| | | private Long signingUnitId; |
| | | |
| | | @Schema(description = "åäºå¤ID") |
| | | private Long officeId; |
| | | |
| | | @Schema(description = "ç»è´è´£äººID") |
| | | private Long groupLeaderId; |
| | | |
| | | @Schema(description = "æ¯å¦å¼å票(1æ¯ 0å¦)") |
| | | private Integer isInvoice; |
| | | |
| | | @Schema(description = "䏿 价") |
| | | @Excel(name = "䏿 价") |
| | | private BigDecimal bidPrice; |
| | | |
| | | @Schema(description = "æ¯å¦ä¸æ (1æ¯ 0å¦)") |
| | | private Integer isBid; |
| | | |
| | | @Schema(description = "æªä¸æ åå ") |
| | | private String unbidReason; |
| | | |
| | | @Schema(description = "ååå件约å®åä¼ æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "ååå件约å®åä¼ æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate contractOriginalReturnDate; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "å
³èååIDå表") |
| | | private List<Long> associatedContractIds; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * éå®å°è´¦ä¸ååå
³è表å®ä½ |
| | | */ |
| | | @Data |
| | | @TableName("sales_ledger_contract_rel") |
| | | public class SalesLedgerContractRel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ä¸»é® */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** éå®å°è´¦ID */ |
| | | private Long salesLedgerId; |
| | | |
| | | /** ååID */ |
| | | private Long contractId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| | |
| | | private String deliveryPeriod; |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @ApiModelProperty(value = "æ¥ä»·æ»éé¢") |
| | | @Excel(name = "æ¥ä»·éé¢") |
| | | private BigDecimal totalAmount; |
| | |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "åè´§åæ®ï¼ææ¬ï¼") |
| | | @Excel(name = "åè´§åæ®") |
| | | private String shippingDocument; |
| | | |
| | | @Schema(description = "æ¯å¦å¯¹è´¦ï¼å¾éæ¡ï¼0å¦ 1æ¯ï¼") |
| | | @Excel(name = "æ¯å¦å¯¹è´¦") |
| | | private Integer isReconciled; |
| | | |
| | | @Schema(description = "对账å彿¡£æ
åµï¼ææ¬åï¼") |
| | | @Excel(name = "对账å彿¡£æ
åµ") |
| | | private String statementArchivingStatus; |
| | | |
| | | @Schema(description = "æ¯å¦ç»ç®ï¼å¾éæ¡ï¼0å¦ 1æ¯ï¼") |
| | | @Excel(name = "æ¯å¦ç»ç®") |
| | | private Integer isSettled; |
| | | |
| | | @Schema(description = "ç»ç®å彿¡£æ
åµï¼ææ¬åï¼") |
| | | @Excel(name = "ç»ç®å彿¡£æ
åµ") |
| | | private String settlementArchivingStatus; |
| | | |
| | | @Schema(description = "æ¯å¦å·²å¼ç¥¨ï¼å¾éæ¡ï¼0å¦ 1æ¯ï¼") |
| | | @Excel(name = "æ¯å¦å·²å¼ç¥¨") |
| | | private Integer isInvoiced; |
| | | |
| | | @Schema(description = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "项ç®åç§°") |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "å¼å§åè´§æ¥æ") |
| | | private String beginShippingDate; |
| | | |
| | | @TableField(exist = false) |
| | | @Schema(description = "ç»æåè´§æ¥æ") |
| | | private String endShippingDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.dto.BiddingManagementDto; |
| | | import com.ruoyi.sales.pojo.BiddingManagement; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æææ 管çServiceæ¥å£ |
| | | */ |
| | | public interface IBiddingManagementService extends IService<BiddingManagement> { |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ 管çå表 (å页) |
| | | * |
| | | * @param page å页对象 |
| | | * @param dto æ¥è¯¢æ¡ä»¶ |
| | | * @return æææ 管çéå |
| | | */ |
| | | IPage<BiddingManagement> selectBiddingManagementList(Page<BiddingManagement> page, BiddingManagementDto dto); |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ 管çå表 (ä¸å页) |
| | | * |
| | | * @param dto æ¥è¯¢æ¡ä»¶ |
| | | * @return æææ 管çéå |
| | | */ |
| | | List<BiddingManagement> selectBiddingManagementList(BiddingManagementDto dto); |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹æææ 管ç |
| | | * |
| | | * @param dto æææ 管çä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int addOrUpdateBiddingManagement(BiddingManagementDto dto); |
| | | |
| | | /** |
| | | * æ¹éå é¤æææ ç®¡ç |
| | | * |
| | | * @param ids éè¦å é¤çIDæ°ç» |
| | | * @return ç»æ |
| | | */ |
| | | int deleteBiddingManagementByIds(Long[] ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.SalesContractDTO; |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import com.ruoyi.sales.vo.SalesContractVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éå®åå Service æ¥å£ |
| | | */ |
| | | public interface ISalesContractService extends IService<SalesContract> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ååå表 |
| | | */ |
| | | IPage<SalesContractVO> listPage(Page<SalesContract> page, SalesContractDTO dto); |
| | | |
| | | /** |
| | | * è·ååå详æ
ï¼å«æç»ï¼ |
| | | */ |
| | | AjaxResult getDetail(Long id); |
| | | |
| | | /** |
| | | * æ°å¢ææ´æ°åå |
| | | */ |
| | | AjaxResult addOrUpdate(SalesContractDTO dto); |
| | | |
| | | /** |
| | | * å é¤åå |
| | | */ |
| | | AjaxResult del(List<Long> ids); |
| | | |
| | | /** |
| | | * å¯¼åºæ¥è¯¢å表 (æ å页) |
| | | */ |
| | | List<SalesContract> selectList(SalesContractDTO dto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.SalesLawsuitDTO; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import com.ruoyi.sales.vo.SalesLawsuitVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è¯è®¼ç®¡ç Service æ¥å£ |
| | | */ |
| | | public interface ISalesLawsuitService extends IService<SalesLawsuit> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | */ |
| | | IPage<SalesLawsuitVO> listPage(Page<SalesLawsuit> page, SalesLawsuitDTO dto); |
| | | |
| | | /** |
| | | * è·å详æ
|
| | | */ |
| | | AjaxResult getDetail(Long id); |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | | */ |
| | | AjaxResult addOrUpdate(SalesLawsuitDTO dto); |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | AjaxResult del(List<Long> ids); |
| | | |
| | | /** |
| | | * å¯¼åºæ¥è¯¢å表 (æ å页) |
| | | */ |
| | | List<SalesLawsuit> selectList(SalesLawsuitDTO dto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.sales.dto.BiddingManagementDto; |
| | | import com.ruoyi.sales.mapper.BiddingManagementMapper; |
| | | import com.ruoyi.sales.pojo.BiddingManagement; |
| | | import com.ruoyi.sales.service.IBiddingManagementService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æææ 管çServiceä¸å¡å±å¤ç |
| | | */ |
| | | @Service |
| | | public class BiddingManagementServiceImpl extends ServiceImpl<BiddingManagementMapper, BiddingManagement> implements IBiddingManagementService { |
| | | |
| | | @Override |
| | | public IPage<BiddingManagement> selectBiddingManagementList(Page<BiddingManagement> page, BiddingManagementDto dto) { |
| | | LambdaQueryWrapper<BiddingManagement> queryWrapper = buildQueryWrapper(dto); |
| | | queryWrapper.orderByDesc(BiddingManagement::getCreateTime); |
| | | return this.page(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<BiddingManagement> selectBiddingManagementList(BiddingManagementDto dto) { |
| | | LambdaQueryWrapper<BiddingManagement> queryWrapper = buildQueryWrapper(dto); |
| | | queryWrapper.orderByDesc(BiddingManagement::getCreateTime); |
| | | return this.list(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public int addOrUpdateBiddingManagement(BiddingManagementDto dto) { |
| | | BiddingManagement biddingManagement = new BiddingManagement(); |
| | | BeanUtils.copyProperties(dto, biddingManagement); |
| | | |
| | | if (biddingManagement.getId() == null) { |
| | | return this.save(biddingManagement) ? 1 : 0; |
| | | } else { |
| | | return this.updateById(biddingManagement) ? 1 : 0; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int deleteBiddingManagementByIds(Long[] ids) { |
| | | return this.removeByIds(Arrays.asList(ids)) ? ids.length : 0; |
| | | } |
| | | |
| | | private LambdaQueryWrapper<BiddingManagement> buildQueryWrapper(BiddingManagementDto dto) { |
| | | LambdaQueryWrapper<BiddingManagement> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (dto != null) { |
| | | queryWrapper.like(StringUtils.isNotEmpty(dto.getProjectName()), BiddingManagement::getProjectName, dto.getProjectName()) |
| | | .like(StringUtils.isNotEmpty(dto.getTenderUnit()), BiddingManagement::getTenderUnit, dto.getTenderUnit()) |
| | | .eq(StringUtils.isNotEmpty(dto.getBidResult()), BiddingManagement::getBidResult, dto.getBidResult()) |
| | | .ge(StringUtils.isNotEmpty(dto.getBidDateStart()), BiddingManagement::getBidDate, dto.getBidDateStart()) |
| | | .le(StringUtils.isNotEmpty(dto.getBidDateEnd()), BiddingManagement::getBidDate, dto.getBidDateEnd()); |
| | | } |
| | | return queryWrapper; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.sales.dto.SalesContractDTO; |
| | | import com.ruoyi.sales.mapper.SalesContractMapper; |
| | | import com.ruoyi.sales.mapper.SalesContractProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import com.ruoyi.sales.pojo.SalesContractProduct; |
| | | import com.ruoyi.sales.service.ISalesContractService; |
| | | import com.ruoyi.sales.vo.SalesContractVO; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * éå®åå Service å®ç° |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SalesContractServiceImpl extends ServiceImpl<SalesContractMapper, SalesContract> implements ISalesContractService { |
| | | |
| | | @Resource |
| | | private SalesContractProductMapper salesContractProductMapper; |
| | | |
| | | @Override |
| | | public IPage<SalesContractVO> listPage(Page<SalesContract> page, SalesContractDTO dto) { |
| | | LambdaQueryWrapper<SalesContract> queryWrapper = buildQueryWrapper(dto); |
| | | IPage<SalesContract> iPage = this.page(page, queryWrapper); |
| | | |
| | | IPage<SalesContractVO> voPage = iPage.convert(item -> { |
| | | return BeanUtil.copyProperties(item, SalesContractVO.class); |
| | | }); |
| | | |
| | | return voPage; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult getDetail(Long id) { |
| | | SalesContract contract = this.getById(id); |
| | | if (contract == null) { |
| | | return AjaxResult.error("ååæ°æ®ä¸åå¨"); |
| | | } |
| | | SalesContractVO vo = BeanUtil.copyProperties(contract, SalesContractVO.class); |
| | | |
| | | // è·åæç» |
| | | LambdaQueryWrapper<SalesContractProduct> productQuery = new LambdaQueryWrapper<>(); |
| | | productQuery.eq(SalesContractProduct::getContractId, id); |
| | | List<SalesContractProduct> productList = salesContractProductMapper.selectList(productQuery); |
| | | vo.setProductList(productList); |
| | | |
| | | return AjaxResult.success(vo); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult addOrUpdate(SalesContractDTO dto) { |
| | | SalesContract contract = BeanUtil.copyProperties(dto, SalesContract.class); |
| | | boolean isUpdate = contract.getId() != null; |
| | | |
| | | List<SalesContractProduct> productList = dto.getProductList(); |
| | | if (productList == null) { |
| | | productList = new ArrayList<>(); |
| | | } |
| | | |
| | | // éæ°è®¡ç®å产åç产å¼ï¼å¹¶æ±æ»ååæ»äº§å¼ |
| | | BigDecimal totalOutputValue = BigDecimal.ZERO; |
| | | for (SalesContractProduct product : productList) { |
| | | BigDecimal price = product.getTaxInclusiveUnitPrice() != null ? product.getTaxInclusiveUnitPrice() : BigDecimal.ZERO; |
| | | BigDecimal shipped = product.getShippedQuantity() != null ? product.getShippedQuantity() : BigDecimal.ZERO; |
| | | BigDecimal productOutputValue = price.multiply(shipped); |
| | | product.setOutputValue(productOutputValue); |
| | | |
| | | totalOutputValue = totalOutputValue.add(productOutputValue); |
| | | } |
| | | contract.setOutputValue(totalOutputValue); |
| | | |
| | | if (isUpdate) { |
| | | this.updateById(contract); |
| | | |
| | | // 差鿴æ°é»è¾ |
| | | handleProductListUpdate(contract.getId(), productList); |
| | | } else { |
| | | this.save(contract); |
| | | |
| | | // æ¹éæå
¥æç» |
| | | for (SalesContractProduct product : productList) { |
| | | product.setContractId(contract.getId()); |
| | | salesContractProductMapper.insert(product); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å¤ç产åæç»çå·®éæ´æ° |
| | | */ |
| | | private void handleProductListUpdate(Long contractId, List<SalesContractProduct> newList) { |
| | | // è·åæ°æ®åºä¸æ§çæç»å表 |
| | | LambdaQueryWrapper<SalesContractProduct> productQuery = new LambdaQueryWrapper<>(); |
| | | productQuery.eq(SalesContractProduct::getContractId, contractId); |
| | | List<SalesContractProduct> oldList = salesContractProductMapper.selectList(productQuery); |
| | | |
| | | Map<Long, SalesContractProduct> oldMap = oldList.stream() |
| | | .collect(Collectors.toMap(SalesContractProduct::getId, p -> p)); |
| | | |
| | | // éåæ°å表è¿è¡æå
¥ææ´æ° |
| | | for (SalesContractProduct newProduct : newList) { |
| | | newProduct.setContractId(contractId); |
| | | if (newProduct.getId() != null && oldMap.containsKey(newProduct.getId())) { |
| | | // æ´æ° |
| | | salesContractProductMapper.updateById(newProduct); |
| | | oldMap.remove(newProduct.getId()); // ä» Map ä¸ç§»é¤ï¼å©ä¸çå°±æ¯éè¦å é¤ç |
| | | } else { |
| | | // æ°å¢ |
| | | newProduct.setId(null); // é²å¾¡æ§å¤ç |
| | | salesContractProductMapper.insert(newProduct); |
| | | } |
| | | } |
| | | |
| | | // å é¤å¨å端å表ä¸ä¸åå¨çæ§è®°å½ |
| | | if (!oldMap.isEmpty()) { |
| | | salesContractProductMapper.deleteBatchIds(oldMap.keySet()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // å é¤ä¸»è¡¨ |
| | | this.removeByIds(ids); |
| | | |
| | | // 级èå é¤å表 |
| | | LambdaQueryWrapper<SalesContractProduct> delQuery = new LambdaQueryWrapper<>(); |
| | | delQuery.in(SalesContractProduct::getContractId, ids); |
| | | salesContractProductMapper.delete(delQuery); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<SalesContract> selectList(SalesContractDTO dto) { |
| | | return this.list(buildQueryWrapper(dto)); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºæ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | private LambdaQueryWrapper<SalesContract> buildQueryWrapper(SalesContractDTO dto) { |
| | | LambdaQueryWrapper<SalesContract> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (dto == null) { |
| | | return queryWrapper; |
| | | } |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getContractNo()), SalesContract::getContractNo, dto.getContractNo()); |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getSigningUnit()), SalesContract::getSigningUnit, dto.getSigningUnit()); |
| | | queryWrapper.eq(StringUtils.isNotBlank(dto.getArchiveStatus()), SalesContract::getArchiveStatus, dto.getArchiveStatus()); |
| | | queryWrapper.ge(dto.getSignDateStart() != null, SalesContract::getSignDate, dto.getSignDateStart()); |
| | | queryWrapper.le(dto.getSignDateEnd() != null, SalesContract::getSignDate, dto.getSignDateEnd()); |
| | | |
| | | queryWrapper.orderByDesc(SalesContract::getCreateTime); |
| | | return queryWrapper; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.sales.dto.SalesLawsuitDTO; |
| | | import com.ruoyi.sales.mapper.SalesLawsuitMapper; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import com.ruoyi.sales.service.ISalesLawsuitService; |
| | | import com.ruoyi.sales.vo.SalesLawsuitVO; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * è¯è®¼ç®¡ç Service å®ç° |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SalesLawsuitServiceImpl extends ServiceImpl<SalesLawsuitMapper, SalesLawsuit> implements ISalesLawsuitService { |
| | | |
| | | @Resource |
| | | private FileUtil fileUtil; |
| | | |
| | | @Override |
| | | public IPage<SalesLawsuitVO> listPage(Page<SalesLawsuit> page, SalesLawsuitDTO dto) { |
| | | LambdaQueryWrapper<SalesLawsuit> queryWrapper = buildQueryWrapper(dto); |
| | | IPage<SalesLawsuit> iPage = this.page(page, queryWrapper); |
| | | |
| | | IPage<SalesLawsuitVO> voPage = iPage.convert(item -> { |
| | | SalesLawsuitVO vo = BeanUtil.copyProperties(item, SalesLawsuitVO.class); |
| | | return vo; |
| | | }); |
| | | |
| | | return voPage; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult getDetail(Long id) { |
| | | SalesLawsuit lawsuit = this.getById(id); |
| | | if (lawsuit == null) { |
| | | return AjaxResult.error("æ°æ®ä¸åå¨"); |
| | | } |
| | | SalesLawsuitVO vo = BeanUtil.copyProperties(lawsuit, SalesLawsuitVO.class); |
| | | |
| | | // ç»è£
éä»¶ |
| | | List<StorageBlobVO> storageBlobVOs = fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId( |
| | | ApplicationTypeEnum.FILE, |
| | | RecordTypeEnum.SALES_LAWSUIT, |
| | | id |
| | | ); |
| | | vo.setStorageBlobVOs(storageBlobVOs != null ? storageBlobVOs : new ArrayList<>()); |
| | | |
| | | return AjaxResult.success(vo); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult addOrUpdate(SalesLawsuitDTO dto) { |
| | | SalesLawsuit lawsuit = BeanUtil.copyProperties(dto, SalesLawsuit.class); |
| | | boolean isUpdate = lawsuit.getId() != null; |
| | | |
| | | if (isUpdate) { |
| | | this.updateById(lawsuit); |
| | | log.info("TODO: åæ¥æ´æ°é¡¹ç®æ¶é´è½´ä¸å¯¹åºçè¯è®¼äºä»¶èç¹ (projectId: {}, lawsuitId: {})", lawsuit.getProjectId(), lawsuit.getId()); |
| | | } else { |
| | | this.save(lawsuit); |
| | | log.info("TODO: å¨é¡¹ç®æ¶é´è½´ä¸è¿½å 䏿¡è¯è®¼èç¹ (projectId: {}, lawsuitId: {})", lawsuit.getProjectId(), lawsuit.getId()); |
| | | } |
| | | |
| | | // å¤çéä»¶ |
| | | List<StorageBlobDTO> storageBlobDTOs = dto.getStorageBlobDTOs(); |
| | | if (storageBlobDTOs == null) { |
| | | storageBlobDTOs = new ArrayList<>(); |
| | | } |
| | | fileUtil.saveStorageAttachment( |
| | | ApplicationTypeEnum.FILE, |
| | | RecordTypeEnum.SALES_LAWSUIT, |
| | | lawsuit.getId(), |
| | | storageBlobDTOs |
| | | ); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return AjaxResult.error("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | List<SalesLawsuit> lawsuits = this.listByIds(ids); |
| | | |
| | | this.removeByIds(ids); |
| | | |
| | | for (SalesLawsuit lawsuit : lawsuits) { |
| | | log.info("TODO: åæ¥ç§»é¤é¡¹ç®æ¶é´è½´ä¸å¯¹åºçè¯è®¼äºä»¶èç¹ (projectId: {}, lawsuitId: {})", lawsuit.getProjectId(), lawsuit.getId()); |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<SalesLawsuit> selectList(SalesLawsuitDTO dto) { |
| | | return this.list(buildQueryWrapper(dto)); |
| | | } |
| | | |
| | | /** |
| | | * æå»ºæ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | private LambdaQueryWrapper<SalesLawsuit> buildQueryWrapper(SalesLawsuitDTO dto) { |
| | | LambdaQueryWrapper<SalesLawsuit> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (dto == null) { |
| | | return queryWrapper; |
| | | } |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getCaseNo()), SalesLawsuit::getCaseNo, dto.getCaseNo()); |
| | | queryWrapper.eq(dto.getProjectId() != null, SalesLawsuit::getProjectId, dto.getProjectId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getProjectName()), SalesLawsuit::getProjectName, dto.getProjectName()); |
| | | queryWrapper.eq(dto.getContractId() != null, SalesLawsuit::getContractId, dto.getContractId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getContractNo()), SalesLawsuit::getContractNo, dto.getContractNo()); |
| | | queryWrapper.eq(StringUtils.isNotBlank(dto.getLawsuitStatus()), SalesLawsuit::getLawsuitStatus, dto.getLawsuitStatus()); |
| | | queryWrapper.like(StringUtils.isNotBlank(dto.getLawyer()), SalesLawsuit::getLawyer, dto.getLawyer()); |
| | | queryWrapper.ge(dto.getFilingDateStart() != null, SalesLawsuit::getFilingDate, dto.getFilingDateStart()); |
| | | queryWrapper.le(dto.getFilingDateEnd() != null, SalesLawsuit::getFilingDate, dto.getFilingDateEnd()); |
| | | |
| | | queryWrapper.orderByDesc(SalesLawsuit::getCreateTime); |
| | | return queryWrapper; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import com.ruoyi.sales.mapper.SalesLedgerContractRelMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedgerContractRel; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | /** |
| | | * éå®å°è´¦Serviceä¸å¡å±å¤ç |
| | |
| | | private final FileUtil fileUtil; |
| | | private final AccountInvoiceApplicationMapper accountInvoiceApplicationMapper; |
| | | private final AccountSalesCollectionMapper accountSalesCollectionMapper; |
| | | private final SalesLedgerContractRelMapper salesLedgerContractRelMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(salesLedgerDto.getId()); |
| | | if (salesLedger == null) { |
| | | throw new BaseException("å°è´¦ä¸åå¨"); |
| | | } |
| | | |
| | | // æ¥è¯¢å
³èçåå |
| | | List<SalesLedgerContractRel> rels = salesLedgerContractRelMapper.selectList( |
| | | new LambdaQueryWrapper<SalesLedgerContractRel>().eq(SalesLedgerContractRel::getSalesLedgerId, salesLedger.getId()) |
| | | ); |
| | | if (!CollectionUtils.isEmpty(rels)) { |
| | | List<Long> contractIds = rels.stream().map(SalesLedgerContractRel::getContractId).collect(Collectors.toList()); |
| | | salesLedger.setAssociatedContractIds(contractIds); |
| | | } |
| | | |
| | | // 2. æ¥è¯¢å表 |
| | |
| | | // å é¤åè´§å°è´¦è®°å½ |
| | | List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>() |
| | | .in(ShippingInfo::getSalesLedgerId, idList)); |
| | | if (CollectionUtils.isNotEmpty(shippingInfos)) { |
| | | if (CollUtil.isNotEmpty(shippingInfos)) { |
| | | shippingInfoServiceImpl.delete(shippingInfos.stream().map(ShippingInfo::getId).collect(Collectors.toList())); |
| | | } |
| | | // å é¤é件表 |
| | |
| | | // å é¤çäº§ç®¡æ§æ°æ® |
| | | //æ¥è¯¢ç产æ¥å·¥id |
| | | ArrayList<Long> mainIdList = productionProductMainService.listMain(idList); |
| | | if (CollectionUtils.isNotEmpty(mainIdList)) { |
| | | if (CollUtil.isNotEmpty(mainIdList)) { |
| | | mainIdList.stream().forEach(mainId -> { |
| | | productionProductMainService.removeProductMain(mainId); |
| | | }); |
| | |
| | | salesLedgerMapper.updateById(salesLedger); |
| | | } |
| | | |
| | | // å¤çå
³èååæ°æ® |
| | | salesLedgerContractRelMapper.delete( |
| | | new LambdaQueryWrapper<SalesLedgerContractRel>().eq(SalesLedgerContractRel::getSalesLedgerId, salesLedger.getId()) |
| | | ); |
| | | if (!CollectionUtils.isEmpty(salesLedgerDto.getAssociatedContractIds())) { |
| | | for (Long contractId : salesLedgerDto.getAssociatedContractIds()) { |
| | | SalesLedgerContractRel rel = new SalesLedgerContractRel(); |
| | | rel.setSalesLedgerId(salesLedger.getId()); |
| | | rel.setContractId(contractId); |
| | | salesLedgerContractRelMapper.insert(rel); |
| | | } |
| | | } |
| | | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | | List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); |
| | |
| | | import com.ruoyi.approve.mapper.ApprovalTemplateMapper; |
| | | import com.ruoyi.approve.pojo.ApprovalTemplate; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.pojo.ApprovalInstance; |
| | | import com.ruoyi.approve.service.ApprovalInstanceService; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | |
| | | import com.ruoyi.sales.dto.ShippingApproveDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.dto.ShippingProductDetailDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.mapper.ShippingProductDetailMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.pojo.ShippingProductDetail; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.stream.Collectors; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | |
| | | private final StockUtils stockUtils; |
| | | |
| | |
| | | IPage<ShippingInfoDto> listPage = shippingInfoMapper.listPage(page, req); |
| | | listPage.getRecords().forEach(item -> { |
| | | item.setStorageBlobVOs(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.IMAGE, RecordTypeEnum.SHIPPING_INFO, item.getId())); |
| | | if (item.getReturnNos() != null && !item.getReturnNos().isEmpty()) { |
| | | item.setReturnNoList(java.util.Arrays.asList(item.getReturnNos().split(","))); |
| | | } else { |
| | | item.setReturnNoList(new java.util.ArrayList<>()); |
| | | } |
| | | }); |
| | | return listPage; |
| | | } |
| | |
| | | stockUtils.deleteStockOutRecord(shippingInfo.getId(), StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode()); |
| | | } |
| | | } |
| | | |
| | | // å é¤å·¥ä½æµå®ä¾ |
| | | List<ApprovalInstance> approvalInstances = approvalInstanceService.list(new LambdaQueryWrapper<ApprovalInstance>() |
| | | .in(ApprovalInstance::getBusinessId, ids) |
| | | .eq(ApprovalInstance::getBusinessType, 7L) |
| | | ); |
| | | if(!approvalInstances.isEmpty()){ |
| | | approvalInstanceService.delete( |
| | | approvalInstances.stream() |
| | | .map(ApprovalInstance::getId) |
| | | .collect(Collectors.toList()) |
| | | ); |
| | | } |
| | | |
| | | //å é¤åè´§æç» |
| | | shippingProductDetailMapper.delete(new LambdaQueryWrapper<ShippingProductDetail>().in(ShippingProductDetail::getShippingInfoId, ids)); |
| | | |
| | |
| | | // å
ä¿ååè´§åï¼åå起审æ¹ï¼æ å®¡æ ¸äººèªå¨éè¿æ¶éè¦æåè´§ç¼å·åååè´§ç¶æã |
| | | req.setShippingNo(sh); |
| | | req.setStatus("å¾
å®¡æ ¸"); |
| | | // Fetch projectId from SalesLedger |
| | | if (req.getSalesLedgerId() != null) { |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(req.getSalesLedgerId()); |
| | | if (salesLedger != null && salesLedger.getProjectId() != null) { |
| | | req.setProjectId(salesLedger.getProjectId()); |
| | | } |
| | | } |
| | | |
| | | boolean save = this.add(req); |
| | | // åè´§å®¡æ¹ |
| | | ApprovalTemplate approvalTemplate = approvalTemplateMapper.selectOne( |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.task; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.project.system.domain.SysNotice; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.projectManagement.vo.InfoVo; |
| | | import com.ruoyi.projectManagement.pojo.ProjectConfig; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | | import com.ruoyi.projectManagement.service.ProjectConfigService; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * éå®å°è´¦-ååå件约å®åä¼ æ¥æé¢è¦ä»»å¡ |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class ContractReturnReminderTask { |
| | | |
| | | private final ProjectConfigService projectConfigService; |
| | | private final ISalesLedgerService salesLedgerService; |
| | | private final InfoService infoService; |
| | | private final ISysNoticeService sysNoticeService; |
| | | |
| | | // æ¯å¤©ä¸å 8 ç¹æ§è¡ |
| | | @Scheduled(cron = "0 0 8 * * ?") |
| | | public void processReminders() { |
| | | log.info("å¼å§æ§è¡ï¼åååä»¶åä¼ é¢è¦æ«æ"); |
| | | ProjectConfig config = projectConfigService.getGlobalConfig(); |
| | | Integer reminderDays = config.getContractReturnReminderDays(); |
| | | if (reminderDays == null) { |
| | | reminderDays = 3; |
| | | } |
| | | |
| | | LocalDate targetDate = LocalDate.now().plusDays(reminderDays); |
| | | |
| | | // æ¥è¯¢ç¬¦åæ¡ä»¶çéå®å°è´¦ |
| | | List<SalesLedger> ledgers = salesLedgerService.list(Wrappers.<SalesLedger>lambdaQuery() |
| | | .eq(SalesLedger::getContractOriginalReturnDate, targetDate)); |
| | | |
| | | if (ledgers == null || ledgers.isEmpty()) { |
| | | log.info("仿¥æ éè¦é¢è¦çåååä¼ è®°å½"); |
| | | return; |
| | | } |
| | | |
| | | log.info("åç° {} æ¡é¢è¦è®°å½", ledgers.size()); |
| | | |
| | | for (SalesLedger ledger : ledgers) { |
| | | if (ledger.getProjectId() == null) { |
| | | continue; |
| | | } |
| | | InfoVo projectInfo = infoService.getInfoById(ledger.getProjectId()); |
| | | if (projectInfo != null && projectInfo.getInfo() != null && projectInfo.getInfo().getManagerId() != null) { |
| | | sendNotice(ledger, projectInfo); |
| | | } |
| | | } |
| | | log.info("åååä»¶åä¼ é¢è¦æ«æç»æ"); |
| | | } |
| | | |
| | | private void sendNotice(SalesLedger ledger, InfoVo projectInfo) { |
| | | SysNotice notice = new SysNotice(); |
| | | notice.setNoticeTitle("åååä»¶åä¼ é¢è¦"); |
| | | notice.setNoticeType("1"); // 1为éç¥ |
| | | String content = String.format("项ç®ã%sãå
³èçéå®å°è´¦ï¼%sï¼çååå件约å®åä¼ æ¥æï¼%sï¼å³å°å°æï¼è¯·åæ¶å¤çï¼", |
| | | projectInfo.getInfo().getTitle(), |
| | | ledger.getSalesContractNo(), |
| | | ledger.getContractOriginalReturnDate().toString()); |
| | | notice.setNoticeContent(content); |
| | | notice.setStatus("0"); // æ£å¸¸ |
| | | notice.setConsigneeId(projectInfo.getInfo().getManagerId()); |
| | | // å¯ä»¥è®¾ç½® senderId 为系ç»ç®¡çå (ä¾å¦ 1L) |
| | | notice.setSenderId(1L); |
| | | |
| | | try { |
| | | sysNoticeService.save(notice); |
| | | } catch (Exception e) { |
| | | log.error("åéé¢è¦éç¥å¤±è´¥: salesLedgerId={}, error={}", ledger.getId(), e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Schema(description = "éè´§éé¢") |
| | | private BigDecimal returnAmount; |
| | | |
| | | @Schema(description = "å¼ç¥¨éé¢") |
| | | private BigDecimal invoiceAmount; |
| | | |
| | | @Schema(description = "æ¯å¦å款è¶
æ¶") |
| | | private Boolean isPaymentTimeout; |
| | | |
| | | } |
| | |
| | | @Schema(description = "客æ·ID") |
| | | private Long customerId; |
| | | |
| | | @Schema(description = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @Schema(description = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | |
| | | @Schema(description = "éè´§éé¢") |
| | | private BigDecimal returnAmount; |
| | | |
| | | @Schema(description = "å¼ç¥¨éé¢") |
| | | private BigDecimal invoiceAmount; |
| | | |
| | | @Schema(description = "ååæ»æ°") |
| | | private Integer contractCount; |
| | | |
| | | @Schema(description = "è¶
æååæ°") |
| | | private Integer overdueCount; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @Schema(name = "ProjectTransactionsVo", description = "è¥é管ç--客æ·å¾æ¥-项ç®å±çº§(è¿å)") |
| | | public class ProjectTransactionsVo { |
| | | |
| | | @Schema(description = "项ç®ID") |
| | | private Long projectId; |
| | | |
| | | @Schema(description = "项ç®ç¼å·") |
| | | private String projectNo; |
| | | |
| | | @Schema(description = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @Schema(description = "ååæ»éé¢") |
| | | private BigDecimal contractAmounts; |
| | | |
| | | @Schema(description = "æ¶æ¬¾éé¢") |
| | | private BigDecimal receiptPaymentAmount; |
| | | |
| | | @Schema(description = "åºæ¶éé¢") |
| | | private BigDecimal receiptableAmount; |
| | | |
| | | @Schema(description = "éè´§éé¢") |
| | | private BigDecimal returnAmount; |
| | | |
| | | @Schema(description = "å¼ç¥¨éé¢") |
| | | private BigDecimal invoiceAmount; |
| | | |
| | | @Schema(description = "å
³èå®¢æ·æ°") |
| | | private Integer customerCount; |
| | | |
| | | @Schema(description = "ååæ»æ°") |
| | | private Integer contractCount; |
| | | |
| | | @Schema(description = "è¶
æååæ°") |
| | | private Integer overdueCount; |
| | | |
| | | @Schema(description = "项ç®ç¶æ (0è¿è¡ä¸ 1已宿ç)") |
| | | private Integer status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.vo; |
| | | |
| | | import com.ruoyi.sales.pojo.SalesContract; |
| | | import com.ruoyi.sales.pojo.SalesContractProduct; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SalesContractVO extends SalesContract { |
| | | |
| | | /** |
| | | * 产åæç»å表 |
| | | */ |
| | | private List<SalesContractProduct> productList; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.vo; |
| | | |
| | | import com.ruoyi.basic.dto.StorageBlobVO; |
| | | import com.ruoyi.sales.pojo.SalesLawsuit; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SalesLawsuitVO extends SalesLawsuit { |
| | | |
| | | /** |
| | | * éä»¶åæ¾å表 |
| | | */ |
| | | private List<StorageBlobVO> storageBlobVOs; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.controller; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | import com.ruoyi.vehicle.service.FuelCardService; |
| | | import com.ruoyi.vehicle.mapper.FuelCardMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vehicle/fuelCard") |
| | | public class FuelCardController { |
| | | @Autowired |
| | | private FuelCardService fuelCardService; |
| | | @Autowired |
| | | private FuelCardMapper fuelCardMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<FuelCard> page, FuelCard query) { |
| | | IPage<FuelCard> pageInfo = fuelCardMapper.selectFuelCardPage(page, query); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | @GetMapping("/listAll") |
| | | public AjaxResult listAll() { |
| | | LambdaQueryWrapper<FuelCard> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.orderByDesc(FuelCard::getId); |
| | | List<FuelCard> list = fuelCardService.list(wrapper); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody FuelCard entity) { |
| | | if (entity.getInitialBalance() != null) { |
| | | entity.setCurrentBalance(entity.getInitialBalance()); |
| | | } |
| | | return AjaxResult.success(fuelCardService.save(entity)); |
| | | } |
| | | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody FuelCard entity) { |
| | | return AjaxResult.success(fuelCardService.updateById(entity)); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Long id) { |
| | | return AjaxResult.success(fuelCardService.removeById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.vehicle.pojo.FuelCardRecharge; |
| | | import com.ruoyi.vehicle.service.IFuelCardRechargeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vehicle/fuelCardRecharge") |
| | | public class FuelCardRechargeController { |
| | | |
| | | @Autowired |
| | | private IFuelCardRechargeService fuelCardRechargeService; |
| | | |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Page<FuelCardRecharge> page, @RequestParam("cardId") Long cardId) { |
| | | IPage<FuelCardRecharge> pageList = fuelCardRechargeService.selectRechargePage(page, cardId); |
| | | return AjaxResult.success(pageList); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody FuelCardRecharge recharge) { |
| | | if (recharge.getCardId() == null || recharge.getRechargeAmount() == null || recharge.getRechargeDate() == null) { |
| | | return AjaxResult.error("åæ°ä¸å®æ´"); |
| | | } |
| | | fuelCardRechargeService.addRecharge(recharge); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Long id) { |
| | | fuelCardRechargeService.deleteRecharge(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.controller; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.vehicle.pojo.FuelRecord; |
| | | import com.ruoyi.vehicle.service.FuelRecordService; |
| | | import com.ruoyi.vehicle.mapper.FuelRecordMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vehicle/fuelRecord") |
| | | public class FuelRecordController { |
| | | @Autowired |
| | | private FuelRecordService fuelRecordService; |
| | | @Autowired |
| | | private FuelRecordMapper fuelRecordMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<FuelRecord> page, FuelRecord query, String beginDate, String endDate) { |
| | | IPage<FuelRecord> pageInfo = fuelRecordMapper.selectFuelRecordPage(page, query, beginDate, endDate); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody FuelRecord entity) { |
| | | return AjaxResult.success(fuelRecordService.saveRecord(entity)); |
| | | } |
| | | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody FuelRecord entity) { |
| | | return AjaxResult.success(fuelRecordService.updateRecord(entity)); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Long id) { |
| | | return AjaxResult.success(fuelRecordService.removeRecordById(id)); |
| | | } |
| | | @PostMapping("/submit/{id}") |
| | | public AjaxResult submit(@PathVariable Long id) { |
| | | try { |
| | | fuelRecordService.submitRecord(id); |
| | | return AjaxResult.success(); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/revoke/{id}") |
| | | public AjaxResult revoke(@PathVariable Long id) { |
| | | try { |
| | | fuelRecordService.revokeRecord(id); |
| | | return AjaxResult.success(); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.vehicle.pojo.VehicleCost; |
| | | import com.ruoyi.vehicle.service.VehicleCostService; |
| | | import com.ruoyi.vehicle.mapper.VehicleCostMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vehicle/cost") |
| | | public class VehicleCostController { |
| | | @Autowired |
| | | private VehicleCostService vehicleCostService; |
| | | |
| | | @Autowired |
| | | private VehicleCostMapper vehicleCostMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<VehicleCost> page, VehicleCost query) { |
| | | LambdaQueryWrapper<VehicleCost> wrapper = new LambdaQueryWrapper<>(); |
| | | if (query.getVehicleId() != null) { |
| | | wrapper.eq(VehicleCost::getVehicleId, query.getVehicleId()); |
| | | } |
| | | if (StringUtils.hasText(query.getCostType())) { |
| | | wrapper.eq(VehicleCost::getCostType, query.getCostType()); |
| | | } |
| | | wrapper.orderByDesc(VehicleCost::getCostDate); |
| | | IPage<VehicleCost> pageInfo = vehicleCostService.page(page, wrapper); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | @GetMapping("/summaryByMonth") |
| | | public AjaxResult summaryByMonth() { |
| | | return AjaxResult.success(vehicleCostMapper.summaryByMonth()); |
| | | } |
| | | |
| | | @GetMapping("/summaryByVehicle") |
| | | public AjaxResult summaryByVehicle() { |
| | | return AjaxResult.success(vehicleCostMapper.summaryByVehicle()); |
| | | } |
| | | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody VehicleCost entity) { |
| | | return AjaxResult.success(vehicleCostService.save(entity)); |
| | | } |
| | | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody VehicleCost entity) { |
| | | return AjaxResult.success(vehicleCostService.updateById(entity)); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Long id) { |
| | | return AjaxResult.success(vehicleCostService.removeById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.controller; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.vehicle.pojo.VehicleInfo; |
| | | import com.ruoyi.vehicle.service.VehicleInfoService; |
| | | import com.ruoyi.vehicle.mapper.VehicleInfoMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import java.time.LocalDate; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/vehicle/info") |
| | | public class VehicleInfoController { |
| | | @Autowired |
| | | private VehicleInfoService vehicleInfoService; |
| | | @Autowired |
| | | private VehicleInfoMapper vehicleInfoMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page<VehicleInfo> page, VehicleInfo query) { |
| | | IPage<VehicleInfo> pageInfo = vehicleInfoMapper.selectVehiclePage(page, query); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | @GetMapping("/warningList") |
| | | public AjaxResult warningList() { |
| | | LocalDate nextMonth = LocalDate.now().plusDays(30); |
| | | LambdaQueryWrapper<VehicleInfo> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.le(VehicleInfo::getInspectionExpireDate, nextMonth).or().le(VehicleInfo::getInsuranceExpireDate, nextMonth); |
| | | List<VehicleInfo> list = vehicleInfoService.list(wrapper); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody VehicleInfo entity) { |
| | | return AjaxResult.success(vehicleInfoService.save(entity)); |
| | | } |
| | | |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody VehicleInfo entity) { |
| | | return AjaxResult.success(vehicleInfoService.updateById(entity)); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Long id) { |
| | | return AjaxResult.success(vehicleInfoService.removeById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | @Mapper |
| | | public interface FuelCardMapper extends BaseMapper<FuelCard> { |
| | | IPage<FuelCard> selectFuelCardPage(Page<FuelCard> page, @Param("query") FuelCard query); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.vehicle.pojo.FuelCardRecharge; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface FuelCardRechargeMapper extends BaseMapper<FuelCardRecharge> { |
| | | IPage<FuelCardRecharge> selectRechargePage(Page<FuelCardRecharge> page, @Param("cardId") Long cardId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.vehicle.pojo.FuelRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | @Mapper |
| | | public interface FuelRecordMapper extends BaseMapper<FuelRecord> { |
| | | IPage<FuelRecord> selectFuelRecordPage(Page<FuelRecord> page, @Param("query") FuelRecord query, @Param("beginDate") String beginDate, @Param("endDate") String endDate); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.vehicle.pojo.VehicleCost; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface VehicleCostMapper extends BaseMapper<VehicleCost> { |
| | | |
| | | @Select("SELECT DATE_FORMAT(cost_date, '%Y-%m') as month, cost_type as costType, sum(amount) as totalAmount " + |
| | | "FROM p_vehicle_cost WHERE del_flag = '0' GROUP BY DATE_FORMAT(cost_date, '%Y-%m'), cost_type") |
| | | List<Map<String, Object>> summaryByMonth(); |
| | | |
| | | @Select("SELECT v.plate_number as plateNumber, c.cost_type as costType, sum(c.amount) as totalAmount " + |
| | | "FROM p_vehicle_cost c LEFT JOIN p_vehicle_info v ON c.vehicle_id = v.id " + |
| | | "WHERE c.del_flag = '0' GROUP BY v.plate_number, c.cost_type") |
| | | List<Map<String, Object>> summaryByVehicle(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.vehicle.pojo.VehicleInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | @Mapper |
| | | public interface VehicleInfoMapper extends BaseMapper<VehicleInfo> { |
| | | IPage<VehicleInfo> selectVehiclePage(Page<VehicleInfo> page, @Param("query") VehicleInfo query); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("p_fuel_card") |
| | | public class FuelCard { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private String cardNumber; |
| | | private Long deptId; |
| | | private String issuer; |
| | | private BigDecimal initialBalance; |
| | | private BigDecimal currentBalance; |
| | | private String status; |
| | | private String remark; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String tenantId; |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("p_fuel_card_recharge") |
| | | public class FuelCardRecharge { |
| | | |
| | | @TableId |
| | | private Long id; |
| | | |
| | | private Long cardId; |
| | | |
| | | private BigDecimal rechargeAmount; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date rechargeDate; |
| | | |
| | | private String remark; |
| | | |
| | | private String delFlag; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @TableField(exist = false) |
| | | private String createUserName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("p_fuel_record") |
| | | public class FuelRecord { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private LocalDate fuelDate; |
| | | private BigDecimal amount; |
| | | private BigDecimal liters; |
| | | private Long vehicleId; |
| | | private Long fuelCardId; |
| | | private Long deptId; |
| | | private BigDecimal startMileage; |
| | | private BigDecimal endMileage; |
| | | private String invoiceNo; |
| | | private String remark; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | @TableField(exist = false) |
| | | private String plateNumber; |
| | | @TableField(exist = false) |
| | | private String cardNumber; |
| | | |
| | | |
| | | private String status; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String tenantId; |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("p_vehicle_cost") |
| | | public class VehicleCost { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private Long vehicleId; |
| | | private String costType; |
| | | private BigDecimal amount; |
| | | private LocalDate costDate; |
| | | private String remark; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String tenantId; |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("p_vehicle_info") |
| | | public class VehicleInfo { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | private String plateNumber; |
| | | private String propertyOwnership; |
| | | private Long deptId; |
| | | private Long userId; |
| | | private String vehicleStatus; |
| | | private LocalDate inspectionExpireDate; |
| | | private LocalDate insuranceExpireDate; |
| | | private String remark; |
| | | |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private String tenantId; |
| | | @TableLogic |
| | | private String delFlag; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | |
| | | public interface FuelCardService extends IService<FuelCard> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.vehicle.pojo.FuelRecord; |
| | | |
| | | public interface FuelRecordService extends IService<FuelRecord> { |
| | | boolean saveRecord(FuelRecord record); |
| | | boolean updateRecord(FuelRecord record); |
| | | boolean removeRecordById(Long id); |
| | | |
| | | // æäº¤è®°å½å¹¶æ£æ¬¾ |
| | | boolean submitRecord(Long id); |
| | | |
| | | // æ¤åè®°å½å¹¶é款 |
| | | boolean revokeRecord(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.vehicle.pojo.FuelCardRecharge; |
| | | |
| | | public interface IFuelCardRechargeService extends IService<FuelCardRecharge> { |
| | | IPage<FuelCardRecharge> selectRechargePage(Page<FuelCardRecharge> page, Long cardId); |
| | | void addRecharge(FuelCardRecharge recharge); |
| | | void deleteRecharge(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.vehicle.pojo.VehicleCost; |
| | | |
| | | public interface VehicleCostService extends IService<VehicleCost> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.vehicle.pojo.VehicleInfo; |
| | | |
| | | public interface VehicleInfoService extends IService<VehicleInfo> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.vehicle.mapper.FuelCardMapper; |
| | | import com.ruoyi.vehicle.mapper.FuelCardRechargeMapper; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | import com.ruoyi.vehicle.pojo.FuelCardRecharge; |
| | | import com.ruoyi.vehicle.service.IFuelCardRechargeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | public class FuelCardRechargeServiceImpl extends ServiceImpl<FuelCardRechargeMapper, FuelCardRecharge> implements IFuelCardRechargeService { |
| | | |
| | | @Autowired |
| | | private FuelCardMapper fuelCardMapper; |
| | | |
| | | @Override |
| | | public IPage<FuelCardRecharge> selectRechargePage(Page<FuelCardRecharge> page, Long cardId) { |
| | | return baseMapper.selectRechargePage(page, cardId); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addRecharge(FuelCardRecharge recharge) { |
| | | // ä¿åå
å¼è®°å½ |
| | | recharge.setDelFlag("0"); |
| | | this.save(recharge); |
| | | |
| | | // æ´æ°å æ²¹å¡ä½é¢ |
| | | FuelCard card = fuelCardMapper.selectById(recharge.getCardId()); |
| | | if (card != null && card.getCurrentBalance() != null) { |
| | | card.setCurrentBalance(card.getCurrentBalance().add(recharge.getRechargeAmount())); |
| | | fuelCardMapper.updateById(card); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteRecharge(Long id) { |
| | | FuelCardRecharge recharge = this.getById(id); |
| | | if (recharge != null && "0".equals(recharge.getDelFlag())) { |
| | | // é»è¾å é¤ |
| | | recharge.setDelFlag("2"); |
| | | this.updateById(recharge); |
| | | |
| | | // æ£åä½é¢ |
| | | FuelCard card = fuelCardMapper.selectById(recharge.getCardId()); |
| | | if (card != null && card.getCurrentBalance() != null) { |
| | | card.setCurrentBalance(card.getCurrentBalance().subtract(recharge.getRechargeAmount())); |
| | | fuelCardMapper.updateById(card); |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.vehicle.mapper.FuelCardMapper; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | import com.ruoyi.vehicle.service.FuelCardService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class FuelCardServiceImpl extends ServiceImpl<FuelCardMapper, FuelCard> implements FuelCardService { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.vehicle.mapper.FuelRecordMapper; |
| | | import com.ruoyi.vehicle.pojo.FuelCard; |
| | | import com.ruoyi.vehicle.pojo.FuelRecord; |
| | | import com.ruoyi.vehicle.pojo.VehicleInfo; |
| | | import com.ruoyi.vehicle.service.FuelCardService; |
| | | import com.ruoyi.vehicle.service.FuelRecordService; |
| | | import com.ruoyi.vehicle.service.VehicleInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | public class FuelRecordServiceImpl extends ServiceImpl<FuelRecordMapper, FuelRecord> implements FuelRecordService { |
| | | |
| | | @Autowired |
| | | private FuelCardService fuelCardService; |
| | | |
| | | @Autowired |
| | | private VehicleInfoService vehicleInfoService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveRecord(FuelRecord record) { |
| | | // å¦ææ²¡æä¼ å
¥é¨é¨ï¼å°è¯ä»å æ²¹å¡æè½¦è¾ç»§æ¿ |
| | | if (record.getDeptId() == null) { |
| | | if (record.getFuelCardId() != null) { |
| | | FuelCard card = fuelCardService.getById(record.getFuelCardId()); |
| | | if (card != null && card.getDeptId() != null) { |
| | | record.setDeptId(card.getDeptId()); |
| | | } |
| | | } else if (record.getVehicleId() != null) { |
| | | VehicleInfo vehicle = vehicleInfoService.getById(record.getVehicleId()); |
| | | if (vehicle != null && vehicle.getDeptId() != null) { |
| | | record.setDeptId(vehicle.getDeptId()); |
| | | } |
| | | } |
| | | } |
| | | record.setStatus("0"); // é»è®¤è稿 |
| | | return this.save(record); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateRecord(FuelRecord record) { |
| | | FuelRecord oldRecord = this.getById(record.getId()); |
| | | if (oldRecord != null && "1".equals(oldRecord.getStatus())) { |
| | | throw new RuntimeException("å·²æäº¤çè®°å½æ æ³ä¿®æ¹"); |
| | | } |
| | | return this.updateById(record); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean removeRecordById(Long id) { |
| | | FuelRecord oldRecord = this.getById(id); |
| | | if (oldRecord != null && "1".equals(oldRecord.getStatus())) { |
| | | throw new RuntimeException("å·²æäº¤çè®°å½æ æ³å é¤"); |
| | | } |
| | | return this.removeById(id); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean submitRecord(Long id) { |
| | | FuelRecord record = this.getById(id); |
| | | if (record == null) return false; |
| | | if ("1".equals(record.getStatus())) { |
| | | throw new RuntimeException("该记å½å·²ç»æäº¤"); |
| | | } |
| | | |
| | | record.setStatus("1"); |
| | | boolean updated = this.updateById(record); |
| | | |
| | | if (updated && record.getFuelCardId() != null && record.getAmount() != null) { |
| | | FuelCard card = fuelCardService.getById(record.getFuelCardId()); |
| | | if (card != null) { |
| | | card.setCurrentBalance(card.getCurrentBalance().subtract(record.getAmount())); |
| | | fuelCardService.updateById(card); |
| | | } |
| | | } |
| | | return updated; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean revokeRecord(Long id) { |
| | | FuelRecord record = this.getById(id); |
| | | if (record == null) return false; |
| | | if ("0".equals(record.getStatus())) { |
| | | throw new RuntimeException("èç¨¿ç¶ææ 鿤å"); |
| | | } |
| | | |
| | | record.setStatus("0"); |
| | | boolean updated = this.updateById(record); |
| | | |
| | | if (updated && record.getFuelCardId() != null && record.getAmount() != null) { |
| | | FuelCard card = fuelCardService.getById(record.getFuelCardId()); |
| | | if (card != null) { |
| | | card.setCurrentBalance(card.getCurrentBalance().add(record.getAmount())); |
| | | fuelCardService.updateById(card); |
| | | } |
| | | } |
| | | return updated; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.vehicle.mapper.VehicleCostMapper; |
| | | import com.ruoyi.vehicle.pojo.VehicleCost; |
| | | import com.ruoyi.vehicle.service.VehicleCostService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class VehicleCostServiceImpl extends ServiceImpl<VehicleCostMapper, VehicleCost> implements VehicleCostService { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.vehicle.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.vehicle.mapper.VehicleInfoMapper; |
| | | import com.ruoyi.vehicle.pojo.VehicleInfo; |
| | | import com.ruoyi.vehicle.service.VehicleInfoService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class VehicleInfoServiceImpl extends ServiceImpl<VehicleInfoMapper, VehicleInfo> implements VehicleInfoService { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /Users/mac/txkj/product-inventory/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEW |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9003 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://localhost:3306/product-inventory-management-new-pro?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: root@2026 |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://114.132.189.42:9028/chat_memory_db |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 127.0.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: root@2026 |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: xpAVjhCjQDaDB7mjPAzMDSbQWXNu2zYkTdDNUsPMS5Xx8QMmQVYN7n74eZrYJxDJ |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | # æä»¶ä¸ä¼ é
ç½® |
| | | file: |
| | | temp-dir: /Users/mac/txkj/product-inventory/file/temp/uploads # 临æ¶ç®å½ |
| | | upload-dir: /Users/mac/txkj/product-inventory/file/prod/uploads # æ£å¼ç®å½ |
| | | path: /Users/mac/txkj/product-inventory/file # ä¸ä¼ ç®å½ |
| | | urlPrefix: /prod-api/common # 龿¥åç¼ |
| | | domain: http://1.15.17.182:9049 # åååç¼ |
| | | expired: 120 # è¿ææ¶é´(åä½:åé) |
| | | useLimit: 10 # ä½¿ç¨æ¬¡æ° |
| | | compress: true # æ¯å¦å缩 |
| | | needCompressSize: 10MB # å缩éå¼ |
| | | compressQuality: 0.5 # å缩质é(0.0-1.0) |
| | |
| | | main: |
| | | allow-circular-references: true |
| | | profiles: |
| | | active: dev |
| | | active: local |
| | | |
| | | # Pinecone åéæ°æ®åºé
ç½® |
| | | pinecone: |
| | |
| | | <select id="listPage" resultType="com.ruoyi.approve.bean.vo.FinReimbursementVo"> |
| | | select fin_reimbursement.*, |
| | | fin_reimbursement_travel.start_time , |
| | | fin_reimbursement_travel.end_time |
| | | fin_reimbursement_travel.end_time, |
| | | sys_dept.dept_name as deptName |
| | | from |
| | | fin_reimbursement |
| | | left join fin_reimbursement_travel on fin_reimbursement.id = fin_reimbursement_travel.reimbursement_id |
| | | left join sys_dept on fin_reimbursement.dept_id = sys_dept.dept_id |
| | | <where> |
| | | <if test="ew.billNo != null and ew.billNo != ''"> |
| | | bill_no like concat('%',#{ew.billNo},'%') |
| | |
| | | and create_time >= #{ew.createTimeStart} |
| | | and create_time <= #{ew.createTimeEnd} |
| | | </if> |
| | | <if test="ew.deptId != null"> |
| | | and fin_reimbursement.dept_id = #{ew.deptId} |
| | | </if> |
| | | <if test="ew.expenseType != null and ew.expenseType != ''"> |
| | | and fin_reimbursement.expense_type = #{ew.expenseType} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="list" resultType="com.ruoyi.approve.bean.vo.FinReimbursementVo"> |
| | | select fin_reimbursement.*, |
| | | fin_reimbursement_travel.start_time , |
| | | fin_reimbursement_travel.end_time, |
| | | sys_dept.dept_name as deptName |
| | | from |
| | | fin_reimbursement |
| | | left join fin_reimbursement_travel on fin_reimbursement.id = fin_reimbursement_travel.reimbursement_id |
| | | left join sys_dept on fin_reimbursement.dept_id = sys_dept.dept_id |
| | | <where> |
| | | <if test="ew.billNo != null and ew.billNo != ''"> |
| | | bill_no like concat('%',#{ew.billNo},'%') |
| | | </if> |
| | | <if test="ew.applicantName != null and ew.applicantName != ''"> |
| | | and applicant_name like concat('%',#{ew.applicantName},'%') |
| | | </if> |
| | | <if test="ew.applicantCode != null and ew.applicantCode != ''"> |
| | | and applicant_code like concat('%',#{ew.applicantCode},'%') |
| | | </if> |
| | | <if test="ew.createTimeStart != null and ew.createTimeStart !='' and ew.createTimeEnd != null and ew.createTimeEnd != ''"> |
| | | and create_time >= #{ew.createTimeStart} |
| | | and create_time <= #{ew.createTimeEnd} |
| | | </if> |
| | | <if test="ew.deptId != null"> |
| | | and fin_reimbursement.dept_id = #{ew.deptId} |
| | | </if> |
| | | <if test="ew.expenseType != null and ew.expenseType != ''"> |
| | | and fin_reimbursement.expense_type = #{ew.expenseType} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </where> |
| | | order by c.id desc |
| | | </select> |
| | | <select id="customewTransactions" resultType="com.ruoyi.sales.vo.CustomerTransactionsVo"> |
| | | select T1.customer_id, |
| | | c.customer_name, |
| | | <select id="projectTransactions" resultType="com.ruoyi.sales.vo.ProjectTransactionsVo"> |
| | | select T1.project_id AS projectId, |
| | | IFNULL(p.title, 'æªåç±»') AS projectName, |
| | | p.no AS projectNo, |
| | | p.status AS status, |
| | | T1.contractAmounts AS contractAmounts, |
| | | IFNULL(T2.receiptPaymentAmount, 0) AS receiptPaymentAmount, |
| | | T1.contractAmounts - IFNULL(T2.receiptPaymentAmount, 0) - IFNULL(T4.returnAmount, 0) AS receiptableAmount, |
| | | IFNULL(T4.returnAmount, 0) AS returnAmount |
| | | from (select customer_id, sum(contract_amount) as contractAmounts from sales_ledger group by customer_id) T1 |
| | | left join (select customer_id, sum(collection_amount) as receiptPaymentAmount from account_sales_collection group by customer_id) T2 on T1.customer_id = T2.customer_id |
| | | IFNULL(T4.returnAmount, 0) AS returnAmount, |
| | | IFNULL(T5.invoiceAmount, 0) AS invoiceAmount, |
| | | IFNULL(T6.contractCount, 0) AS contractCount, |
| | | IFNULL(T6.customerCount, 0) AS customerCount, |
| | | IFNULL(T6.overdueCount, 0) AS overdueCount |
| | | from (select IFNULL(project_id, -1) as project_id, sum(contract_amount) as contractAmounts from sales_ledger group by IFNULL(project_id, -1)) T1 |
| | | left join project_management_info p on T1.project_id = p.id |
| | | left join ( |
| | | select |
| | | sl.customer_id, |
| | | IFNULL(sl.project_id, -1) as project_id, |
| | | sum(ascc.collection_amount) as receiptPaymentAmount |
| | | from account_sales_collection ascc |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, ascc.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | WHERE sor.record_type='13' and sor.approval_status=1 |
| | | group by IFNULL(sl.project_id, -1) |
| | | ) T2 on T1.project_id = T2.project_id |
| | | left join ( |
| | | select |
| | | IFNULL(sl.project_id, -1) as project_id, |
| | | sum(rm.refund_amount) as returnAmount |
| | | from return_management rm |
| | | left join shipping_info si on rm.shipping_id = si.id |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where rm.status=1 |
| | | group by sl.customer_id |
| | | ) T4 on T4.customer_id=T1.customer_id |
| | | group by IFNULL(sl.project_id, -1) |
| | | ) T4 on T4.project_id = T1.project_id |
| | | left join ( |
| | | select |
| | | IFNULL(sl.project_id, -1) as project_id, |
| | | sum(asi.tax_inclusive_price) as invoiceAmount |
| | | from account_sales_invoice asi |
| | | left join account_invoice_application aia on asi.account_invoice_application_id = aia.id |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, aia.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | left join sales_ledger sl on s.sales_ledger_id = sl.id |
| | | where asi.status=0 |
| | | group by IFNULL(sl.project_id, -1) |
| | | ) T5 on T5.project_id = T1.project_id |
| | | left join ( |
| | | select IFNULL(sl.project_id, -1) as project_id, |
| | | count(sl.id) as contractCount, |
| | | count(distinct sl.customer_id) as customerCount, |
| | | sum(case when DATEDIFF(NOW(), sl.execution_date) > 30 and IFNULL(T1_rcpt.receiptPaymentAmount, 0) < sl.contract_amount then 1 else 0 end) as overdueCount |
| | | from sales_ledger sl |
| | | left join ( |
| | | select sl_in.id, sum(ascc.collection_amount) as receiptPaymentAmount |
| | | from account_sales_collection ascc |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, ascc.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl_in ON s.sales_ledger_id = sl_in.id |
| | | WHERE sor.record_type='13' and sor.approval_status=1 |
| | | group by sl_in.id |
| | | ) T1_rcpt on T1_rcpt.id = sl.id |
| | | group by IFNULL(sl.project_id, -1) |
| | | ) T6 on T6.project_id = T1.project_id |
| | | <where> |
| | | <if test="projectName!=null and projectName!=''"> |
| | | AND IFNULL(p.title, 'æªåç±»') LIKE CONCAT('%', #{projectName}, '%') |
| | | </if> |
| | | <if test="customerName!=null and customerName!=''"> |
| | | AND EXISTS ( |
| | | select 1 from sales_ledger sl2 |
| | | left join customer c on sl2.customer_id = c.id |
| | | where IFNULL(sl2.project_id, -1) = T1.project_id |
| | | and c.customer_name like concat('%', #{customerName}, '%') |
| | | ) |
| | | </if> |
| | | <if test="contractName!=null and contractName!=''"> |
| | | AND EXISTS ( |
| | | select 1 from sales_ledger sl3 |
| | | where IFNULL(sl3.project_id, -1) = T1.project_id |
| | | and sl3.sales_contract_no like concat('%', #{contractName}, '%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by CASE WHEN T1.project_id = -1 THEN 1 ELSE 0 END DESC, T1.project_id desc |
| | | </select> |
| | | <select id="customewTransactions" resultType="com.ruoyi.sales.vo.CustomerTransactionsVo"> |
| | | select T1.customer_id, |
| | | T1.project_id AS projectId, |
| | | c.customer_name, |
| | | T1.contractAmounts AS contractAmounts, |
| | | IFNULL(T2.receiptPaymentAmount, 0) AS receiptPaymentAmount, |
| | | T1.contractAmounts - IFNULL(T2.receiptPaymentAmount, 0) - IFNULL(T4.returnAmount, 0) AS receiptableAmount, |
| | | IFNULL(T4.returnAmount, 0) AS returnAmount, |
| | | IFNULL(T5.invoiceAmount, 0) AS invoiceAmount, |
| | | IFNULL(T6.contractCount, 0) AS contractCount, |
| | | IFNULL(T6.overdueCount, 0) AS overdueCount |
| | | from ( |
| | | select customer_id, IFNULL(project_id, -1) as project_id, sum(contract_amount) as contractAmounts |
| | | from sales_ledger |
| | | <where> |
| | | <if test="projectId!=null"> |
| | | and IFNULL(project_id, -1) = #{projectId} |
| | | </if> |
| | | </where> |
| | | group by customer_id, IFNULL(project_id, -1) |
| | | ) T1 |
| | | left join ( |
| | | select |
| | | sl.customer_id, IFNULL(sl.project_id, -1) as project_id, |
| | | sum(ascc.collection_amount) as receiptPaymentAmount |
| | | from account_sales_collection ascc |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, ascc.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | WHERE sor.record_type='13' and sor.approval_status=1 |
| | | group by sl.customer_id, IFNULL(sl.project_id, -1) |
| | | ) T2 on T1.customer_id = T2.customer_id and T1.project_id = T2.project_id |
| | | left join ( |
| | | select |
| | | sl.customer_id, IFNULL(sl.project_id, -1) as project_id, |
| | | sum(rm.refund_amount) as returnAmount |
| | | from return_management rm |
| | | left join shipping_info si on rm.shipping_id = si.id |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where rm.status=1 |
| | | group by sl.customer_id, IFNULL(sl.project_id, -1) |
| | | ) T4 on T4.customer_id = T1.customer_id and T4.project_id = T1.project_id |
| | | left join ( |
| | | select |
| | | sl.customer_id, IFNULL(sl.project_id, -1) as project_id, |
| | | sum(asi.tax_inclusive_price) as invoiceAmount |
| | | from account_sales_invoice asi |
| | | left join account_invoice_application aia on asi.account_invoice_application_id = aia.id |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, aia.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | left join sales_ledger sl on s.sales_ledger_id = sl.id |
| | | where asi.status=0 |
| | | group by sl.customer_id, IFNULL(sl.project_id, -1) |
| | | ) T5 on T5.customer_id = T1.customer_id and T5.project_id = T1.project_id |
| | | left join ( |
| | | select sl.customer_id, IFNULL(sl.project_id, -1) as project_id, |
| | | count(sl.id) as contractCount, |
| | | sum(case when DATEDIFF(NOW(), sl.execution_date) > 30 and IFNULL(T1_rcpt.receiptPaymentAmount, 0) < sl.contract_amount then 1 else 0 end) as overdueCount |
| | | from sales_ledger sl |
| | | left join ( |
| | | select sl_in.id, sum(ascc.collection_amount) as receiptPaymentAmount |
| | | from account_sales_collection ascc |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, ascc.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl_in ON s.sales_ledger_id = sl_in.id |
| | | WHERE sor.record_type='13' and sor.approval_status=1 |
| | | group by sl_in.id |
| | | ) T1_rcpt on T1_rcpt.id = sl.id |
| | | group by sl.customer_id, IFNULL(sl.project_id, -1) |
| | | ) T6 on T6.customer_id = T1.customer_id and T6.project_id = T1.project_id |
| | | left join customer c on T1.customer_id = c.id |
| | | <where> |
| | | <if test="customerName!=null and customerName!=''"> |
| | | AND c.customer_name LIKE CONCAT('%', #{customerName}, '%') |
| | | </if> |
| | | <if test="contractName!=null and contractName!=''"> |
| | | AND EXISTS ( |
| | | select 1 from sales_ledger sl3 |
| | | where sl3.customer_id = T1.customer_id |
| | | and IFNULL(sl3.project_id, -1) = T1.project_id |
| | | and sl3.sales_contract_no like concat('%', #{contractName}, '%') |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by T1.customer_id desc |
| | |
| | | sl.contract_amount AS contract_amount, |
| | | IFNULL(T1.receiptPaymentAmount, 0) AS receiptPaymentAmount, |
| | | sl.contract_amount - IFNULL(T1.receiptPaymentAmount, 0) - IFNULL(T3.returnAmount, 0) AS receiptableAmount, |
| | | IFNULL(T3.returnAmount, 0) AS returnAmount |
| | | IFNULL(T3.returnAmount, 0) AS returnAmount, |
| | | IFNULL(T5.invoiceAmount, 0) AS invoiceAmount, |
| | | CASE |
| | | WHEN DATEDIFF(NOW(), sl.execution_date) > 30 AND IFNULL(T1.receiptPaymentAmount, 0) < sl.contract_amount THEN 1 |
| | | ELSE 0 |
| | | END AS isPaymentTimeout |
| | | from sales_ledger sl |
| | | left join ( |
| | | select |
| | |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | WHERE sor.record_type='13' |
| | | and sor.approval_status=1 |
| | | group by sl.id |
| | | group by sl.id |
| | | )T1 on T1.id = sl.id |
| | | left join ( |
| | | select sl.id, |
| | |
| | | where rm.status=1 |
| | | group by sl.id |
| | | )T3 on T3.id = sl.id |
| | | left join ( |
| | | select |
| | | sl.id, |
| | | sum(asi.tax_inclusive_price) as invoiceAmount |
| | | from account_sales_invoice asi |
| | | left join account_invoice_application aia on asi.account_invoice_application_id = aia.id |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, aia.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | left join sales_ledger sl on s.sales_ledger_id = sl.id |
| | | where asi.status=0 |
| | | group by sl.id |
| | | ) T5 on T5.id = sl.id |
| | | where sl.customer_id = #{customerId} |
| | | <if test="projectId!=null"> |
| | | and IFNULL(sl.project_id, -1) = #{projectId} |
| | | </if> |
| | | <if test="contractName!=null and contractName!=''"> |
| | | and sl.sales_contract_no like concat('%', #{contractName}, '%') |
| | | </if> |
| | | order by sl.id desc |
| | | </select> |
| | | |
| | | <select id="transactionsSummary" resultType="java.util.Map"> |
| | | select count(distinct IFNULL(sl.project_id, -1)) as totalProjects, |
| | | count(distinct sl.customer_id) as totalCustomers, |
| | | count(sl.id) as totalContracts, |
| | | IFNULL(sum(sl.contract_amount), 0) as totalAmount, |
| | | IFNULL(sum(case when DATEDIFF(NOW(), sl.execution_date) > 30 and IFNULL(rcpt.receiptPaymentAmount, 0) < sl.contract_amount then 1 else 0 end), 0) as totalOverdueCount |
| | | from sales_ledger sl |
| | | left join ( |
| | | select sl_in.id, sum(ascc.collection_amount) as receiptPaymentAmount |
| | | from account_sales_collection ascc |
| | | left join stock_out_record sor on FIND_IN_SET(sor.id, ascc.stock_out_record_ids) > 0 |
| | | left join shipping_info s on sor.record_id = s.id |
| | | LEFT JOIN sales_ledger sl_in ON s.sales_ledger_id = sl_in.id |
| | | WHERE sor.record_type='13' and sor.approval_status=1 |
| | | group by sl_in.id |
| | | ) rcpt on rcpt.id = sl.id |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.collaborativeApproval.mapper.BroadbandCommunicationMapper"> |
| | | |
| | | </mapper> |
| | |
| | | <select id="queryPage" resultType="com.ruoyi.device.dto.DeviceLedgerDto"> |
| | | SELECT |
| | | dl.id, |
| | | dl.unique_code, |
| | | dl.factory_number, |
| | | dl.manufacturer, |
| | | dl.original_asset_value, |
| | | dl.purchase_date, |
| | | dl.activation_date, |
| | | dl.technical_parameters, |
| | | dl.main_purpose, |
| | | dl.responsible_person, |
| | | dl.filing_date, |
| | | dl.device_name, |
| | | dl.device_model, |
| | | dl.supplier_name, |
| | |
| | | FROM device_ledger dl |
| | | left join sys_user su on dl.create_user = su.user_id |
| | | <where> |
| | | <!-- 设å¤ç¼å· --> |
| | | <if test="deviceLedger.uniqueCode != null and deviceLedger.uniqueCode != ''"> |
| | | AND unique_code LIKE CONCAT('%', #{deviceLedger.uniqueCode}, '%') |
| | | </if> |
| | | |
| | | <!-- 设å¤åç§° --> |
| | | <if test="deviceLedger.deviceName != null and deviceLedger.deviceName != ''"> |
| | | AND device_name LIKE CONCAT('%', #{deviceLedger.deviceName}, '%') |
| | |
| | | dr.acceptance_time, |
| | | dr.acceptance_remark, |
| | | dr.status, |
| | | dr.repair_type, |
| | | dr.reason_analysis, |
| | | dr.handling_measures, |
| | | dr.spare_parts_ids, |
| | | dr.create_time, |
| | | dr.update_time, |
| | | dr.create_user, |
| | |
| | | dr.acceptance_time, |
| | | dr.acceptance_remark, |
| | | dr.status, |
| | | dr.repair_type, |
| | | dr.reason_analysis, |
| | | dr.handling_measures, |
| | | dr.spare_parts_ids, |
| | | dr.create_time, |
| | | dr.update_time, |
| | | dr.create_user, |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.device.mapper.DeviceStatusChangeRecordMapper"> |
| | | </mapper> |
| | |
| | | t2.model, |
| | | t1.valid, |
| | | t1.record_date, |
| | | t1.entry_date |
| | | t1.entry_date, |
| | | t1.traceability_type, |
| | | t1.implementing_agency, |
| | | t1.certificate_number, |
| | | t1.core_result, |
| | | t1.result_confirmation, |
| | | t1.confirmer_id, |
| | | t1.confirmer_name, |
| | | t1.valid_until |
| | | FROM |
| | | measuring_instrument_ledger_record t1 |
| | | left join measuring_instrument_ledger t2 on t1.measuring_instrument_ledger_id = t2.id |
| | |
| | | t2.model, |
| | | t1.valid, |
| | | t1.record_date, |
| | | t1.entry_date |
| | | t1.entry_date, |
| | | t1.traceability_type, |
| | | t1.implementing_agency, |
| | | t1.certificate_number, |
| | | t1.core_result, |
| | | t1.result_confirmation, |
| | | t1.confirmer_id, |
| | | t1.confirmer_name, |
| | | t1.valid_until |
| | | FROM |
| | | measuring_instrument_ledger_record t1 |
| | | left join measuring_instrument_ledger t2 on t1.measuring_instrument_ledger_id = t2.id |
| | |
| | | remark,attachment |
| | | </sql> |
| | | <resultMap id="ListInfoVoMap" type="com.ruoyi.projectManagement.vo.ListInfoVo"> |
| | | |
| | | <result column="plan_stage" |
| | | property="planStage" |
| | | typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/> |
| | | |
| | | </resultMap> |
| | | <select id="searchListInfo" resultMap="ListInfoVoMap"> |
| | | select t1.*, t2.name as project_management_plan_name,t3.title as projectManagementInfoParentName |
| | | select t1.*, t2.name as project_management_plan_name,t3.title as projectManagementInfoParentName, |
| | | IFNULL(t4.sales_contract_count, 0) as salesContractCount |
| | | from project_management_info as t1 |
| | | left join project_management_plan as t2 on t1.project_management_plan_id = t2.id |
| | | left join project_management_info as t3 on t1.project_management_info_parent_id = t3.id |
| | | left join ( |
| | | SELECT project_id, COUNT(DISTINCT sales_contract_no) AS sales_contract_count |
| | | FROM sales_ledger |
| | | WHERE sales_contract_no IS NOT NULL AND sales_contract_no != '' |
| | | GROUP BY project_id |
| | | ) as t4 on t1.id = t4.project_id |
| | | where t1.is_delete = 0 |
| | | <if test="vo.noOrName != null and vo.noOrName != ''"> |
| | | and ( t1.no like concat('%', #{vo.noOrName}, '%') OR t1.title like concat('%', #{vo.noOrName}, '%') ) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.sales.mapper.BiddingManagementMapper"> |
| | | |
| | | <resultMap type="BiddingManagement" id="BiddingManagementResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="projectId" column="project_id" /> |
| | | <result property="projectName" column="project_name" /> |
| | | <result property="bidDocName" column="bid_doc_name" /> |
| | | <result property="tenderUnit" column="tender_unit" /> |
| | | <result property="bidUnit" column="bid_unit" /> |
| | | <result property="tenderDate" column="tender_date" /> |
| | | <result property="bidDate" column="bid_date" /> |
| | | <result property="bidDocFee" column="bid_doc_fee" /> |
| | | <result property="bidDocFeeStatus" column="bid_doc_fee_status" /> |
| | | <result property="bidDocFeeStatusChangeDate" column="bid_doc_fee_status_change_date" /> |
| | | <result property="bidDeposit" column="bid_deposit" /> |
| | | <result property="bidResult" column="bid_result" /> |
| | | <result property="tenantId" column="tenant_id" /> |
| | | <result property="deptId" column="dept_id" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectBiddingManagementVo"> |
| | | select id, project_id, project_name, bid_doc_name, tender_unit, bid_unit, tender_date, bid_date, bid_doc_fee, bid_doc_fee_status, bid_doc_fee_status_change_date, bid_deposit, bid_result, tenant_id, dept_id, del_flag, create_by, create_time, update_by, update_time, remark from bidding_management |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | | T1.project_name, |
| | | T1.project_id, |
| | | T1.year, |
| | | T1.signing_unit_id, |
| | | T1.office_id, |
| | | T1.group_leader_id, |
| | | T1.is_invoice, |
| | | T1.bid_price, |
| | | T1.is_bid, |
| | | T1.unbid_reason, |
| | | T1.contract_original_return_date, |
| | | T1.entry_date, |
| | | T1.salesman, |
| | | T1.customer_id, |
| | |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | <where> |
| | | <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' "> |
| | | T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | | AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | | </if> |
| | | <if test="salesLedgerDto.projectId != null"> |
| | | AND T1.project_id = #{salesLedgerDto.projectId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | T1.sales_contract_no, |
| | | T1.customer_contract_no, |
| | | T1.project_name, |
| | | T1.project_id, |
| | | T1.year, |
| | | T1.signing_unit_id, |
| | | T1.office_id, |
| | | T1.group_leader_id, |
| | | T1.is_invoice, |
| | | T1.bid_price, |
| | | T1.is_bid, |
| | | T1.unbid_reason, |
| | | T1.contract_original_return_date, |
| | | T1.entry_date, |
| | | T1.salesman, |
| | | T1.customer_id, |
| | |
| | | <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' "> |
| | | AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | | </if> |
| | | <if test="salesLedgerDto.projectId != null"> |
| | | AND T1.project_id = #{salesLedgerDto.projectId} |
| | | </if> |
| | | <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' "> |
| | | AND T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%') |
| | | </if> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.sales.mapper.SalesQuotationMapper"> |
| | | <select id="listPage" resultType="com.ruoyi.sales.dto.SalesQuotationDto"> |
| | | SELECT t1.* |
| | | SELECT t1.*, p.title as projectName |
| | | FROM sales_quotation t1 |
| | | LEFT JOIN project_management_info p ON t1.project_id = p.id |
| | | <where> |
| | | <if test="salesQuotationDto.quotationNo != null and salesQuotationDto.quotationNo != '' "> |
| | | AND t1.quotation_no LIKE CONCAT('%',#{salesQuotationDto.quotationNo},'%') |
| | | </if> |
| | | <if test="salesQuotationDto.customer != null and salesQuotationDto.customer != '' "> |
| | | AND t1.customer = #{salesQuotationDto.customer} |
| | | AND t1.customer LIKE CONCAT('%',#{salesQuotationDto.customer},'%') |
| | | </if> |
| | | <if test="salesQuotationDto.status != null and salesQuotationDto.status != '' "> |
| | | AND t1.status = #{salesQuotationDto.status} |
| | | </if> |
| | | <if test="salesQuotationDto.projectId != null"> |
| | | AND t1.project_id = #{salesQuotationDto.projectId} |
| | | </if> |
| | | </where> |
| | | order by t1.id desc |
| | | </select> |
| | |
| | | s.create_user, |
| | | s.update_user, |
| | | s.tenant_id, |
| | | s.shipping_document, |
| | | s.is_reconciled, |
| | | s.statement_archiving_status, |
| | | s.is_settled, |
| | | s.settlement_archiving_status, |
| | | s.is_invoiced, |
| | | s.project_id, |
| | | sl.project_name as projectName, |
| | | sl.sales_contract_no, |
| | | pm.model as specification_model, |
| | | pm.unit, |
| | | p.product_name, |
| | | sl.customer_name, |
| | | spd.totalQuantity, |
| | | sor.outboundBatches |
| | | sor.outboundBatches, |
| | | rm_agg.returnNos |
| | | FROM shipping_info s |
| | | LEFT JOIN (select shipping_info_id,sum(quantity) totalQuantity from shipping_product_detail GROUP BY shipping_info_id) spd ON spd.shipping_info_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | |
| | | from stock_out_record |
| | | where record_type='13'and approval_status=1 |
| | | group by record_id)sor on sor.record_id= s.id |
| | | left join (select shipping_id, GROUP_CONCAT(DISTINCT return_no SEPARATOR ',') AS returnNos |
| | | from return_management |
| | | group by shipping_id) rm_agg on rm_agg.shipping_id = s.id |
| | | WHERE 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | |
| | | </if> |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.projectId != null"> |
| | | AND s.project_id = #{req.projectId} |
| | | </if> |
| | | <if test="req.beginShippingDate != null and req.beginShippingDate != ''"> |
| | | AND DATE(s.shipping_date) >= DATE(#{req.beginShippingDate}) |
| | | </if> |
| | | <if test="req.endShippingDate != null and req.endShippingDate != ''"> |
| | | AND DATE(s.shipping_date) <= DATE(#{req.endShippingDate}) |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | |
| | | s.create_user, |
| | | s.update_user, |
| | | s.tenant_id, |
| | | s.shipping_document, |
| | | s.is_reconciled, |
| | | s.statement_archiving_status, |
| | | s.is_settled, |
| | | s.settlement_archiving_status, |
| | | s.is_invoiced, |
| | | s.project_id, |
| | | sl.project_name as projectName, |
| | | sl.sales_contract_no, |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | WHERE 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.shippingCarNumber != null and req.shippingCarNumber != ''"> |
| | | AND s.shipping_car_number LIKE CONCAT('%',#{req.shippingCarNumber},'%') |
| | | </if> |
| | | <if test="req.shippingNo != null and req.shippingNo != ''"> |
| | | AND s.shipping_no LIKE CONCAT('%',#{req.shippingNo},'%') |
| | | </if> |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.projectId != null"> |
| | | AND s.project_id = #{req.projectId} |
| | | </if> |
| | | <if test="req.beginShippingDate != null and req.beginShippingDate != ''"> |
| | | AND DATE(s.shipping_date) >= DATE(#{req.beginShippingDate}) |
| | | </if> |
| | | <if test="req.endShippingDate != null and req.endShippingDate != ''"> |
| | | AND DATE(s.shipping_date) <= DATE(#{req.endShippingDate}) |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.bean.vo.ShippingProductVo"> |
| | | SELECT distinct |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.vehicle.mapper.FuelCardMapper"> |
| | | <select id="selectFuelCardPage" resultType="com.ruoyi.vehicle.pojo.FuelCard"> |
| | | SELECT c.*, d.dept_name as deptName |
| | | FROM p_fuel_card c |
| | | LEFT JOIN sys_dept d ON c.dept_id = d.dept_id |
| | | WHERE c.del_flag = '0' |
| | | <if test="query.cardNumber != null and query.cardNumber != ''"> |
| | | AND c.card_number LIKE concat('%', #{query.cardNumber}, '%') |
| | | </if> |
| | | <if test="query.deptId != null"> |
| | | AND (c.dept_id = #{query.deptId} OR c.dept_id IN (SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{query.deptId}, ancestors))) |
| | | </if> |
| | | ORDER BY c.id DESC |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.vehicle.mapper.FuelCardRechargeMapper"> |
| | | <select id="selectRechargePage" resultType="com.ruoyi.vehicle.pojo.FuelCardRecharge"> |
| | | SELECT r.*, u.nick_name as createUserName |
| | | FROM p_fuel_card_recharge r |
| | | LEFT JOIN sys_user u ON r.create_user = u.user_id |
| | | WHERE r.del_flag = '0' |
| | | <if test="cardId != null"> |
| | | AND r.card_id = #{cardId} |
| | | </if> |
| | | ORDER BY r.recharge_date DESC, r.create_time DESC |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.vehicle.mapper.FuelRecordMapper"> |
| | | <select id="selectFuelRecordPage" resultType="com.ruoyi.vehicle.pojo.FuelRecord"> |
| | | SELECT r.*, d.dept_name as deptName, v.plate_number as plateNumber, c.card_number as cardNumber |
| | | FROM p_fuel_record r |
| | | LEFT JOIN sys_dept d ON r.dept_id = d.dept_id |
| | | LEFT JOIN p_vehicle_info v ON r.vehicle_id = v.id |
| | | LEFT JOIN p_fuel_card c ON r.fuel_card_id = c.id |
| | | WHERE r.del_flag = '0' |
| | | <if test="query.vehicleId != null"> |
| | | AND r.vehicle_id = #{query.vehicleId} |
| | | </if> |
| | | <if test="query.fuelCardId != null"> |
| | | AND r.fuel_card_id = #{query.fuelCardId} |
| | | </if> |
| | | <if test="query.deptId != null"> |
| | | AND (r.dept_id = #{query.deptId} OR r.dept_id IN (SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{query.deptId}, ancestors))) |
| | | </if> |
| | | <if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''"> |
| | | AND r.fuel_date BETWEEN #{beginDate} AND #{endDate} |
| | | </if> |
| | | |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND r.status = #{query.status} |
| | | </if> |
| | | ORDER BY r.fuel_date DESC |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.vehicle.mapper.VehicleCostMapper"> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ruoyi.vehicle.mapper.VehicleInfoMapper"> |
| | | <select id="selectVehiclePage" resultType="com.ruoyi.vehicle.pojo.VehicleInfo"> |
| | | SELECT v.*, d.dept_name as deptName, u.nick_name as userName |
| | | FROM p_vehicle_info v |
| | | LEFT JOIN sys_dept d ON v.dept_id = d.dept_id |
| | | LEFT JOIN sys_user u ON v.user_id = u.user_id |
| | | WHERE v.del_flag = '0' |
| | | <if test="query.plateNumber != null and query.plateNumber != ''"> |
| | | AND v.plate_number LIKE concat('%', #{query.plateNumber}, '%') |
| | | </if> |
| | | <if test="query.deptId != null"> |
| | | AND (v.dept_id = #{query.deptId} OR v.dept_id IN (SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{query.deptId}, ancestors))) |
| | | </if> |
| | | <if test="query.vehicleStatus != null and query.vehicleStatus != ''"> |
| | | AND v.vehicle_status = #{query.vehicleStatus} |
| | | </if> |
| | | ORDER BY |
| | | CASE WHEN |
| | | (v.inspection_expire_date IS NOT NULL AND DATEDIFF(v.inspection_expire_date, NOW()) <= 30) |
| | | OR |
| | | (v.insurance_expire_date IS NOT NULL AND DATEDIFF(v.insurance_expire_date, NOW()) <= 30) |
| | | THEN 0 ELSE 1 END, |
| | | v.create_time DESC |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ALTER TABLE fin_reimbursement ADD COLUMN payer VARCHAR(50) DEFAULT NULL COMMENT '仿¬¾æ¹' AFTER detail_total_amount; |