Compare commits
	
		
			68 Commits
		
	
	
		
			5f3ae0f9f1
			...
			dev
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 87e1cb7473 | |||
| c456ae215f | |||
| 091d7bfc0e | |||
| c9f80fe498 | |||
| 7a3deba52a | |||
| eb015fcecc | |||
| d9fab2a4a2 | |||
| 7f125b4548 | |||
| 88dcecc88c | |||
| 5458329252 | |||
| c4e275f5a8 | |||
| f8f89fd96e | |||
| b8ffa41a30 | |||
| f99cd08d57 | |||
| 45cae080a0 | |||
| 84a8f49e95 | |||
| e725991ece | |||
| c2a06a729c | |||
| 4a5e50a7a2 | |||
| 9b30a7bcec | |||
| ec383e44db | |||
| d3909f131f | |||
| a444d4c953 | |||
| 3c01ec861b | |||
| 365cf00644 | |||
| 4faff3b0bc | |||
| 866f2336c3 | |||
| e4132ea540 | |||
| 53208c36cf | |||
| 8f2a3e6e50 | |||
| b67a7d5370 | |||
| 07509c8e15 | |||
| e6c58a64ac | |||
| abb6b8c13a | |||
| de492728bc | |||
| 82fa732db6 | |||
| 275d640263 | |||
| 7e47b8a74f | |||
| d4301da0ec | |||
| fe5b5473dd | |||
| 0126d44761 | |||
| dbefd88e41 | |||
| 9a3b7ebe54 | |||
| 81be4a862c | |||
| 43f2db9f7e | |||
| abefa90408 | |||
| 08f48b7817 | |||
| 6b8ace60d4 | |||
| b997dd5f00 | |||
| 6174743858 | |||
| 82d55d7188 | |||
| aec5eacd0b | |||
| a320b85965 | |||
| b61a7c153d | |||
| fb9b01cf34 | |||
| 32f134873a | |||
| f4220be9d6 | |||
| 8252fd7216 | |||
| 57855f4307 | |||
| 6784eafe6e | |||
| 0b42c1d6a6 | |||
| 4b37a7327f | |||
| 0287f1e4ce | |||
| 5d8af1cab8 | |||
| 123896f08b | |||
| a8a198b51f | |||
| f00b98714a | |||
| 4ff87f3996 | 
| @ -66,27 +66,27 @@ spring: | ||||
|           #          username: xinnengyuan | ||||
|           #          password: mEZPC5Sdf3r2HENi | ||||
|           # 从库数据源 | ||||
|         slave: | ||||
|           lazy: true | ||||
|           type: ${spring.datasource.type} | ||||
|           driverClassName: com.mysql.cj.jdbc.Driver | ||||
|           url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|           username: zmkgc | ||||
|           password: nWKDKRNRT48tFBdh | ||||
|         slave1: | ||||
|           lazy: true | ||||
|           type: ${spring.datasource.type} | ||||
|           driverClassName: com.mysql.cj.jdbc.Driver | ||||
|           url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|           username: zmkgprod | ||||
|           password: MaY8nehwWkJriWPm | ||||
|         slave2: | ||||
|           lazy: true | ||||
|           type: ${spring.datasource.type} | ||||
|           driverClassName: com.mysql.cj.jdbc.Driver | ||||
|           url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|           username: zmkgc | ||||
|           password: nWKDKRNRT48tFBdh | ||||
| #        slave: | ||||
|       #          lazy: true | ||||
|       #          type: ${spring.datasource.type} | ||||
|       #          driverClassName: com.mysql.cj.jdbc.Driver | ||||
|       #          url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|       #          username: zmkgc | ||||
|       #          password: nWKDKRNRT48tFBdh | ||||
|       #        slave1: | ||||
|       #          lazy: true | ||||
|       #          type: ${spring.datasource.type} | ||||
|       #          driverClassName: com.mysql.cj.jdbc.Driver | ||||
|       #          url: jdbc:mysql://192.168.110.2:13386/zmkgprod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|       #          username: zmkgprod | ||||
|       #          password: MaY8nehwWkJriWPm | ||||
|       #        slave2: | ||||
|       #          lazy: true | ||||
|       #          type: ${spring.datasource.type} | ||||
|       #          driverClassName: com.mysql.cj.jdbc.Driver | ||||
|       #          url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true | ||||
|       #          username: zmkgc | ||||
|       #          password: nWKDKRNRT48tFBdh | ||||
|       #        slave: | ||||
|       #          lazy: true | ||||
|       #          type: ${spring.datasource.type} | ||||
|  | ||||
| @ -281,14 +281,16 @@ springdoc: | ||||
|       packages-to-scan: org.dromara.gps | ||||
|     - group: 24.招标模块 | ||||
|       packages-to-scan: org.dromara.tender | ||||
|     #    - group: 25.app版本模块 | ||||
|     #      packages-to-scan: org.dromara.app | ||||
|     - group: 29.app版本模块 | ||||
|       packages-to-scan: org.dromara.app | ||||
|     - group: 25.数据迁移模块 | ||||
|       packages-to-scan: org.dromara.transferData | ||||
|     - group: 26.netty消息模块 | ||||
|       packages-to-scan: org.dromara.websocket | ||||
|     - group: 27.新中大模块 | ||||
|       packages-to-scan: org.dromara.xzd | ||||
|     - group: 28.车辆模块 | ||||
|       packages-to-scan: org.dromara.vehicle | ||||
| # knife4j的增强配置,不需要增强可以不配 | ||||
| knife4j: | ||||
|   enable: true | ||||
| @ -306,12 +308,13 @@ xss: | ||||
|     - /project/project | ||||
|     - /xzd/contractDetails/** | ||||
|     - /xzd/contractChange/** | ||||
|     - /comprehensive/csContractChange/** | ||||
|     - /comprehensive/csContractInformation/** | ||||
|     - /hetongbiangeng/** | ||||
|     - /fenbaohetongbiangg/** | ||||
|     - /fenbaohetongxinxi/** | ||||
|     - /contractManagement/** | ||||
|     - /xzd/comprehensive/csContractChange/** | ||||
|     - /xzd/comprehensive/csContractInformation/** | ||||
|     - /xzd/hetongbiangeng/** | ||||
|     - /xzd/fenbaohetongjungong/** | ||||
|     - /xzd/fenbaohetongbiangg/** | ||||
|     - /xzd/fenbaohetongxinxi/** | ||||
|     - /xzd/contractManagement/** | ||||
|  | ||||
| # 全局线程池相关配置 | ||||
| # 如使用JDK21请直接使用虚拟线程 不要开启此配置 | ||||
|  | ||||
| @ -0,0 +1,99 @@ | ||||
| package org.dromara.test; | ||||
|  | ||||
| import jakarta.annotation.Resource; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.materials.domain.MatMaterialIssue; | ||||
| import org.dromara.materials.domain.MatMaterialReceive; | ||||
| import org.dromara.materials.domain.MatMaterials; | ||||
| import org.dromara.materials.domain.MatMaterialsInventory; | ||||
| import org.dromara.materials.domain.enums.MatMaterialsInventoryOutPutEnum; | ||||
| import org.dromara.materials.service.IMatMaterialIssueService; | ||||
| import org.dromara.materials.service.IMatMaterialReceiveService; | ||||
| import org.dromara.materials.service.IMatMaterialsInventoryService; | ||||
| import org.dromara.materials.service.IMatMaterialsService; | ||||
| import org.junit.jupiter.api.Test; | ||||
| import org.springframework.boot.test.context.SpringBootTest; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-30 15:58 | ||||
|  */ | ||||
| @Slf4j | ||||
| @SpringBootTest | ||||
| public class MaterialsTest { | ||||
|  | ||||
|     /** | ||||
|      * 长顺项目id | ||||
|      */ | ||||
|     private static final Long PROJECT_ID = 1897161054676336641L; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatMaterialsService materialsService; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatMaterialsInventoryService materialsInventoryService; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatMaterialReceiveService materialReceiveService; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatMaterialIssueService materialIssueService; | ||||
|  | ||||
|     @Test | ||||
|     void test() { | ||||
|         List<MatMaterials> materials = materialsService.lambdaQuery() | ||||
|             .eq(MatMaterials::getProjectId, PROJECT_ID) | ||||
|             .list(); | ||||
|         Set<Long> materialIds = materials.stream().map(MatMaterials::getId).collect(Collectors.toSet()); | ||||
|         List<MatMaterialsInventory> inventoryList = materialsInventoryService.lambdaQuery() | ||||
|             .in(MatMaterialsInventory::getMaterialsId, materialIds) | ||||
|             .eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue()) | ||||
|             .list(); | ||||
|         Map<String, List<MatMaterials>> map = materials.stream() | ||||
|             .collect(Collectors.groupingBy(MatMaterials::getFormCode)); | ||||
|  | ||||
|  | ||||
|         for (MatMaterials material : materials) { | ||||
|             String formCode = material.getFormCode(); | ||||
|             // 查看入库数据 | ||||
|             MatMaterialReceive receive = materialReceiveService.lambdaQuery() | ||||
|                 .eq(MatMaterialReceive::getFormCode, formCode) | ||||
|                 .one(); | ||||
|             // 查看出库数据 | ||||
| /*            List<MatMaterialsInventory> inventoryList = materialsInventoryService.lambdaQuery() | ||||
|                 .eq(MatMaterialsInventory::getMaterialsId, material.getId()) | ||||
|                 .eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue()) | ||||
|                 .list(); | ||||
|             if (CollUtil.isEmpty(inventoryList)) { | ||||
|                 continue; | ||||
|             }*/ | ||||
|             // 创建领料出库数据 | ||||
|             List<MatMaterialIssue> issueList = inventoryList.stream().map(inventory -> { | ||||
|                 MatMaterialIssue issue = new MatMaterialIssue(); | ||||
|                 issue.setProjectId(PROJECT_ID); | ||||
|                 issue.setMaterialSource("2"); | ||||
|                 issue.setFormCode(receive.getFormCode()); | ||||
|                 issue.setProjectName(receive.getProjectName()); | ||||
|                 issue.setMaterialName(receive.getMaterialName()); | ||||
|                 issue.setOrderingUnit(receive.getOrderingUnit()); | ||||
|                 issue.setSupplierUnit(receive.getSupplierUnit()); | ||||
|                 issue.setIssueUnit(inventory.getRecipient()); | ||||
|                 issue.setIssueUnitId(inventory.getRecipientId()); | ||||
|                 issue.setShipper(inventory.getShipper()); | ||||
| //                issue.setStorageUnit(); | ||||
|                 issue.setCertCount(0); | ||||
|                 issue.setReportCount(0); | ||||
|                 issue.setTechDocCount(0); | ||||
|                 issue.setLicenseCount(0); | ||||
|                 log.info("领料出库数据:{}", issue); | ||||
|                 log.info("============================="); | ||||
|                 return issue; | ||||
|             }).toList(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -3,8 +3,12 @@ package org.dromara.app.controller; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.app.domain.SysPackage; | ||||
| import org.dromara.app.domain.bo.SysPackageBo; | ||||
| import org.dromara.app.domain.vo.SysPackageVo; | ||||
| import org.dromara.app.service.SysPackageServiceImpl; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.system.domain.vo.SysOssVo; | ||||
| import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| @ -26,6 +30,14 @@ public class SysPackageController { | ||||
|     @Autowired | ||||
|     private SysPackageServiceImpl sysPackageService; | ||||
|  | ||||
|     /** | ||||
|      * 获取列表 | ||||
|      */ | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<SysPackageVo> list(SysPackageBo bo, PageQuery pageQuery) { | ||||
|         return sysPackageService.queryPageList(bo, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取最新版本 | ||||
|      */ | ||||
| @ -42,7 +54,7 @@ public class SysPackageController { | ||||
|      * 上传最新安装包及版本 | ||||
|      */ | ||||
|     @GetMapping("/uploadNewVersion") | ||||
|     public R<SysPackage> uploadNewVersion(String version, String type, MultipartFile file) { | ||||
|     public R<SysPackage> uploadNewVersion(String version, String type, MultipartFile file, String context) { | ||||
|         String originalFileName = "apk/package/app-release.apk"; | ||||
|  | ||||
|         // 先查询最新记录 | ||||
| @ -57,11 +69,11 @@ public class SysPackageController { | ||||
|         } | ||||
|  | ||||
|         // 分离事务:再处理数据库操作 | ||||
|         return handleDatabaseOperations(version, type, upload, list); | ||||
|         return handleDatabaseOperations(version, type, upload, list, context); | ||||
|     } | ||||
|  | ||||
|     @Transactional | ||||
|     public R<SysPackage> handleDatabaseOperations(String version, String type, SysOssVo upload, List<SysPackage> existingPackages) { | ||||
|     public R<SysPackage> handleDatabaseOperations(String version, String type, SysOssVo upload, List<SysPackage> existingPackages, String context) { | ||||
|         try { | ||||
|             // 先删除旧文件记录 | ||||
|             if (existingPackages != null && !existingPackages.isEmpty()) { | ||||
| @ -78,6 +90,7 @@ public class SysPackageController { | ||||
|             sysPackage.setFileId(upload.getOssId()); | ||||
|             sysPackage.setFileUrl(upload.getUrl()); | ||||
|             sysPackage.setType(type); | ||||
|             sysPackage.setContext(context); | ||||
|  | ||||
|             boolean save = sysPackageService.save(sysPackage); | ||||
|             if (!save) { | ||||
|  | ||||
| @ -30,4 +30,9 @@ public class SysPackage extends BaseEntity { | ||||
|  | ||||
|     private String fileUrl; | ||||
|  | ||||
|     /** | ||||
|      * 更新内容 | ||||
|      */ | ||||
|     private String context; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -0,0 +1,32 @@ | ||||
| package org.dromara.app.domain.bo; | ||||
|  | ||||
|  | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
| import org.dromara.xzd.domain.XzdContractDetails; | ||||
|  | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @AutoMapper(target = XzdContractDetails.class, reverseConvertGenerate = false) | ||||
| public class SysPackageBo extends BaseEntity { | ||||
|  | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 0安卓1苹果2鸿蒙 | ||||
|      */ | ||||
|     private String type; | ||||
|  | ||||
|     private String version; | ||||
|  | ||||
|     private Long fileId; | ||||
|  | ||||
|     private String fileUrl; | ||||
|  | ||||
|     /** | ||||
|      * 更新内容 | ||||
|      */ | ||||
|     private String context; | ||||
| } | ||||
| @ -27,4 +27,9 @@ public class SysPackageVo { | ||||
|  | ||||
|     @ExcelProperty("安装包地址") | ||||
|     private String fileUrl; | ||||
|  | ||||
|     /** | ||||
|      * 更新内容 | ||||
|      */ | ||||
|     private String context; | ||||
| } | ||||
|  | ||||
| @ -1,10 +1,24 @@ | ||||
| package org.dromara.app.service; | ||||
|  | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import org.dromara.app.domain.SysPackage; | ||||
| import org.dromara.app.domain.bo.SysPackageBo; | ||||
| import org.dromara.app.domain.vo.SysPackageVo; | ||||
| import org.dromara.app.mapper.SysPackageMapper; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
| @Service | ||||
| public class SysPackageServiceImpl extends ServiceImpl<SysPackageMapper, SysPackage> { | ||||
|  | ||||
|     public TableDataInfo<SysPackageVo> queryPageList(SysPackageBo bo, PageQuery pageQuery) { | ||||
| //        LambdaQueryWrapper<SysPackage> lqw = buildQueryWrapper(bo); | ||||
|         Page<SysPackageVo> result = baseMapper.selectVoPage(pageQuery.build(), new LambdaQueryWrapper<>()); | ||||
| //        setValue(result.getRecords()); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -318,11 +318,13 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB | ||||
|                 .reduce(BigDecimal.ZERO, BigDecimal::add); | ||||
|         } | ||||
|         map.put("remainingQuantity",quantity.subtract(reduce)); | ||||
|         map.put("specification",busBillofquantities.getSpecification()); | ||||
|         map.put("suppliespriceId",limitListId); | ||||
|         if (busBillofquantities != null) { | ||||
|             map.put("specification",busBillofquantities.getSpecification()); | ||||
|             map.put("unit",busBillofquantities.getUnit()); | ||||
|             map.put("remark",busBillofquantities.getRemark()); | ||||
|             map.put("name",busBillofquantities.getName()); | ||||
|         } | ||||
|         return map; | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -0,0 +1,93 @@ | ||||
| package org.dromara.common.utils; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 接口错误码匹配工具(用户展示用) | ||||
|  */ | ||||
| public class ErrorCodeMatcher { | ||||
|  | ||||
|     private static final Map<String, String> ERROR_MAP = new HashMap<>(); | ||||
|  | ||||
|     static { | ||||
|         // 基础错误码 | ||||
|         ERROR_MAP.put("1", "抱歉,出现未知错误,请您重试。若问题持续,请联系管理员。"); | ||||
|         ERROR_MAP.put("2", "服务暂时不可用,请稍后重试。若多次尝试仍有问题,请联系管理员。"); | ||||
|         ERROR_MAP.put("3", "调用的接口不存在,请检查请求地址是否正确(建议避免特殊字符,如手动输入重试)。"); | ||||
|         ERROR_MAP.put("4", "当前集群请求量超限,请稍后再试。持续异常请联系管理员。"); | ||||
|         ERROR_MAP.put("6", "暂无该接口调用权限,请联系管理员开通相关权限。"); | ||||
|         ERROR_MAP.put("14", "鉴权失败,请检查密钥是否正确,或联系管理员协助处理。"); | ||||
|         ERROR_MAP.put("17", "今日免费额度已用完。如需继续使用,请联系管理员获取更多资源。"); | ||||
|         ERROR_MAP.put("18", "请求频率超限(QPS限制)。如需提高限制,请联系管理员咨询。"); | ||||
|         ERROR_MAP.put("19", "总请求量已达限额,请联系管理员获取更多资源。"); | ||||
|         ERROR_MAP.put("100", "访问令牌无效,请联系管理员重新获取。"); | ||||
|         ERROR_MAP.put("110", "访问令牌无效(有效期30天),请联系管理员更新。"); | ||||
|         ERROR_MAP.put("111", "访问令牌已过期,请联系管理员重新获取。"); | ||||
|  | ||||
|         // 216xxx系列错误码 | ||||
|         ERROR_MAP.put("216100", "请求中包含无效参数,请检查后重新提交。"); | ||||
|         ERROR_MAP.put("216101", "缺少必要的请求参数,请核对后补充完整。"); | ||||
|         ERROR_MAP.put("216102", "请求的服务暂不支持,请检查调用地址是否正确,或联系管理员确认。"); | ||||
|         ERROR_MAP.put("216103", "部分参数长度超限,请缩短后重新尝试。"); | ||||
|         ERROR_MAP.put("216110", "应用ID不存在,请核对是否为正确ID,或联系管理员确认。"); | ||||
|         ERROR_MAP.put("216200", "上传的图片为空,请检查图片是否正确上传。"); | ||||
|         ERROR_MAP.put("216201", "图片格式不支持,目前仅支持PNG、JPG、JPEG、BMP格式,请转码后重试。"); | ||||
|         ERROR_MAP.put("216202", "图片大小不符合要求,请参考接口文档的限制重新上传,或联系管理员咨询。"); | ||||
|         ERROR_MAP.put("216205", "请求体过大(base64编码后需小于10M),请压缩内容后重试。"); | ||||
|         ERROR_MAP.put("216306", "文件上传失败,请检查请求参数是否符合要求。"); | ||||
|         ERROR_MAP.put("216307", "图片解析失败,若多次尝试仍有问题,请联系管理员。"); | ||||
|         ERROR_MAP.put("216308", "PDF页码参数超过实际页数,请核对后修改。"); | ||||
|         ERROR_MAP.put("216401", "请求提交失败,请稍后重试。"); | ||||
|         ERROR_MAP.put("216402", "获取结果失败,请稍后重试或检查任务状态。"); | ||||
|         ERROR_MAP.put("216603", "无法获取PDF页数,请检查文件是否完整或编码是否正确。"); | ||||
|         ERROR_MAP.put("216604", "请求总量已达限额,请联系管理员获取更多额度。"); | ||||
|         ERROR_MAP.put("216630", "识别失败,请重试。若问题持续,请联系管理员。"); | ||||
|         ERROR_MAP.put("216631", "银行卡识别失败,请确保上传的是银行卡正面完整清晰的图片(异形卡可能无法识别)。"); | ||||
|         ERROR_MAP.put("216633", "身份证识别失败,请确保上传的是身份证完整清晰的图片(非身份证或模糊图片无法识别)。"); | ||||
|         ERROR_MAP.put("216634", "检测失败,请重试。若持续异常,请联系管理员。"); | ||||
|         ERROR_MAP.put("216600", "企业核验服务请求失败,请重试。持续问题请联系管理员(适用于工商信息查询、要素核验等)。"); | ||||
|         ERROR_MAP.put("216601", "企业核验查询成功,但未找到相关结果,请确认信息是否正确后重试。"); | ||||
|         ERROR_MAP.put("216602", "企业核验服务超时,请稍后重试。持续问题请联系管理员。"); | ||||
|  | ||||
|         // 282xxx系列错误码 | ||||
|         ERROR_MAP.put("282000", "服务器内部错误。若使用通用文字识别,可能因图片文字过多导致超时,建议分割图片后重试;其他情况可稍后再试,持续问题请联系管理员。"); | ||||
|         ERROR_MAP.put("282003", "请求缺少必要参数,请核对后补充。"); | ||||
|         ERROR_MAP.put("282005", "批量任务处理出错,请根据具体错误提示排查。"); | ||||
|         ERROR_MAP.put("282006", "批量任务数量超限,单次最多处理10个任务,请减少数量后重试。"); | ||||
|         ERROR_MAP.put("282100", "图片压缩转码失败,请更换图片后重试。"); | ||||
|         ERROR_MAP.put("282102", "未检测到可识别的卡证/票据,请确保图片包含清晰完整的目标(非卡证或模糊图片无法识别)。"); | ||||
|         ERROR_MAP.put("282103", "卡证/票据识别失败,请确保图片包含清晰完整的目标(非对应类型或模糊图片无法识别)。"); | ||||
|         ERROR_MAP.put("282110", "图片URL不存在,请核对地址后重新提交。"); | ||||
|         ERROR_MAP.put("282111", "图片URL格式错误,请检查是否符合接口要求的格式。"); | ||||
|         ERROR_MAP.put("282112", "图片URL下载超时,可能因图片过大(超过3M)、地址无效或存在防盗链。建议更换图片地址或下载后直接上传。"); | ||||
|         ERROR_MAP.put("282113", "图片URL返回无效内容,请检查地址是否正确。"); | ||||
|         ERROR_MAP.put("282114", "图片URL长度不符合要求(需1-1024字节),请修改后重试。"); | ||||
|         ERROR_MAP.put("282134", "增值税发票验真失败,可能因系统维护,建议次日再试。持续问题请联系管理员。"); | ||||
|         ERROR_MAP.put("282808", "请求ID不存在,请核对ID是否正确。"); | ||||
|         ERROR_MAP.put("282809", "返回结果格式错误(需为excel或json),请稍后重试。"); | ||||
|         ERROR_MAP.put("282810", "图像识别失败,请重试。若问题持续,请联系管理员。"); | ||||
|         ERROR_MAP.put("282160", "行驶证核验资源超限,请联系管理员咨询。"); | ||||
|         ERROR_MAP.put("282161", "行驶证核验请求过于频繁,请稍后再试。"); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 根据错误码获取用户友好的错误信息 | ||||
|      * @param errorCode 错误码(字符串/整数) | ||||
|      * @return 优化后的错误提示,未匹配时返回"未知错误(错误码:xxx)" | ||||
|      */ | ||||
|     public static String getFriendlyMessage(String errorCode) { | ||||
|         return ERROR_MAP.getOrDefault(errorCode, "未知错误(错误码:" + errorCode + "),请重试或联系管理员。"); | ||||
|     } | ||||
|  | ||||
|     public static String getFriendlyMessage(int errorCode) { | ||||
|         return getFriendlyMessage(String.valueOf(errorCode)); | ||||
|     } | ||||
|  | ||||
|     // 测试示例 | ||||
|     public static void main(String[] args) { | ||||
|         System.out.println(getFriendlyMessage(1)); // 输出:抱歉,出现未知错误,请您重试... | ||||
|         System.out.println(getFriendlyMessage("216201")); // 输出:图片格式不支持,目前仅支持PNG... | ||||
|         System.out.println(getFriendlyMessage(9999)); // 输出:未知错误(错误码:9999)... | ||||
|     } | ||||
| } | ||||
| @ -3,6 +3,7 @@ package org.dromara.common.utils.baiduUtil; | ||||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||||
| import com.fasterxml.jackson.databind.ObjectMapper; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.utils.ErrorCodeMatcher; | ||||
| import org.dromara.common.utils.baiduUtil.entity.face.ComparisonRes; | ||||
| import org.dromara.common.utils.baiduUtil.entity.face.HumanFaceReq; | ||||
| import org.dromara.common.utils.baiduUtil.entity.face.HumanFaceRes; | ||||
| @ -208,8 +209,7 @@ public class BaiDuFace { | ||||
|  | ||||
|         // 8. 处理API返回错误 | ||||
|         if (comparisonRep.getErrorCode() != 0) { | ||||
|             throw new RuntimeException("人脸对比失败:" + comparisonRep.getErrorMsg() | ||||
|                 + "(错误码:" + comparisonRep.getErrorCode() + ")"); | ||||
|             throw new RuntimeException("人脸对比失败:" + ErrorCodeMatcher.getFriendlyMessage(comparisonRep.getErrorCode())); | ||||
|         } | ||||
|  | ||||
|         // 9. 校验对比结果 | ||||
|  | ||||
| @ -36,7 +36,7 @@ public class SubConstructionUserAuthenticationReq implements Serializable { | ||||
|     private String phone; | ||||
|  | ||||
|     /** | ||||
|      * 0:保密 1:男 2女 | ||||
|      * 0男1女2未知 | ||||
|      */ | ||||
|     @NotBlank(message = "性别不能为空") | ||||
|     private String sex; | ||||
|  | ||||
| @ -0,0 +1,159 @@ | ||||
| package org.dromara.dataTransmission; | ||||
|  | ||||
| import cn.hutool.crypto.asymmetric.KeyType; | ||||
| import cn.hutool.crypto.asymmetric.RSA; | ||||
| import cn.hutool.http.HttpUtil; | ||||
| import com.alibaba.fastjson2.JSONObject; | ||||
| import org.dromara.common.redis.utils.RedisUtils; | ||||
|  | ||||
| import javax.crypto.Cipher; | ||||
| import java.net.URI; | ||||
| import java.net.http.HttpClient; | ||||
| import java.net.http.HttpRequest; | ||||
| import java.net.http.HttpResponse; | ||||
| import java.nio.charset.StandardCharsets; | ||||
| import java.security.KeyFactory; | ||||
| import java.security.PublicKey; | ||||
| import java.security.spec.X509EncodedKeySpec; | ||||
| import java.time.Duration; | ||||
| import java.util.Base64; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import org.springframework.http.HttpHeaders; | ||||
| import org.springframework.stereotype.Component; | ||||
| import java.io.ByteArrayOutputStream; | ||||
|  | ||||
|  | ||||
| @Component | ||||
| public class TokenUtils { | ||||
|  | ||||
|     // Token过期时间:25分钟(与Redis存储过期时间保持一致) | ||||
|     private static final long TOKEN_EXPIRE_SECONDS = 1500; | ||||
|     // HTTP请求超时时间:10秒 | ||||
|     private static final Duration HTTP_TIMEOUT = Duration.ofSeconds(10); | ||||
|     //通用字符 | ||||
|     private static final String USER_NAME = "username"; | ||||
|     private static final String PASSWORD = "password"; | ||||
|     private static final String PUBLIC_KEY = "publicKey"; | ||||
|     private static final String URL = "url"; | ||||
|  | ||||
|     //clientId | ||||
|     public static final String CLARITYPM = "claritypm"; | ||||
|  | ||||
|     //接口信息及参数 | ||||
|     private static final Map<String, Map<String, String>> tokenMap = new HashMap<>(){ | ||||
|         { | ||||
|             put(CLARITYPM, new HashMap<>(){{ | ||||
|                 put(URL, "https://claritypm.powerchina.cn/neSmartsite-api/loginCli"); | ||||
|                 put(USER_NAME, "zhangweiwei"); | ||||
|                 put(PASSWORD, "Hkrsoft@#2023"); | ||||
|                 put(PUBLIC_KEY, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCoaejbjbttHyHuEzHL8lIX5GZZ6zIYrqJpEDlPM4V5LHn19rSAYp2FyAr8y5Ctny9uUdaYbkoFiVQgxWrAYo4X/3O0OFDsowE25FMOLQY0Mn5B6CvVR7Sdt3DqzIzM1tUnJCIbVGNfDMgxLrLwFN8RvOW8MPlB6LgOvlGMDbj+OQIDAQAB"); | ||||
|             }}); | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     //字段参数 | ||||
|     private static final Map<String, Map<String, String>> paramMap = new HashMap<>(){ | ||||
|         { | ||||
|             put(CLARITYPM, new HashMap<>(){{ | ||||
|  | ||||
|                 put(USER_NAME, "username"); | ||||
|                 put(PASSWORD, "password"); | ||||
|             }}); | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     /** | ||||
|      * 优先从Redis获取Token,不存在则调用接口获取并存储 | ||||
|      * @param clientId 客户端ID | ||||
|      * @return 有效的Token字符串 | ||||
|      * @throws Exception 当获取过程发生异常时抛出 | ||||
|      */ | ||||
|     public static String getToken(String clientId) throws Exception { | ||||
|         // 1. 定义Redis中的Token键名 | ||||
| //        String redisKey = "data_auth:token:" + clientId; | ||||
| // | ||||
| //        // 2. 尝试从Redis获取Token | ||||
| //        String token = RedisUtils.getCacheObject(redisKey); | ||||
| //        if (token != null && !token.isBlank()) { | ||||
| //            // 缓存命中,直接返回 | ||||
| //            return token; | ||||
| //        } | ||||
|  | ||||
|         // 3. 缓存未命中,调用接口获取Token | ||||
|         Map<String, String> map = tokenMap.get(clientId); | ||||
|         String token = fetchTokenFromApi(clientId,map.get(URL), map.get(USER_NAME), rsaEncrypt(map.get(PASSWORD),map.get(PUBLIC_KEY))); | ||||
|  | ||||
|         // 4. 存储到Redis(设置25分钟过期) | ||||
| //        RedisUtils.setCacheObject(redisKey, token,Duration.ofSeconds(TOKEN_EXPIRE_SECONDS) ); | ||||
|  | ||||
|         return token; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 从接口获取Token的内部方法 | ||||
|      */ | ||||
|     private static String fetchTokenFromApi(String clientId, String authUrl, String username, String encryptedPassword) throws Exception { | ||||
|         // 构建JSON请求体(包含加密后的密码) | ||||
|         // 1. 构建请求头(与原 Go 代码一致的头信息) | ||||
| //        Map<String, String> headers = new HashMap<>(); | ||||
| //        headers.put(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8"); | ||||
| //        headers.put("User-Agent", "Mozilla/5.0"); | ||||
| //        headers.put(HttpHeaders.ACCEPT, "application/json"); | ||||
| //        headers.put("Origin", "https://claritypm.powerchina.cn"); | ||||
| //        headers.put("Referer", "https://claritypm.powerchina.cn/"); | ||||
|  | ||||
|         // 2. 构建请求体(保持你的原有逻辑) | ||||
|         Map<String, String> map = paramMap.get(clientId); | ||||
|         JSONObject requestBody = new JSONObject(); | ||||
|         requestBody.put(map.get(USER_NAME), username); // 从 map 中获取接口要求的用户名参数名 | ||||
|         requestBody.put(map.get(PASSWORD), encryptedPassword); // 加密后的密码 | ||||
|         String jsonBody = requestBody.toJSONString(); | ||||
|         System.out.println("请求体:" + jsonBody); | ||||
|  | ||||
|         // 3. 带 Header 发送 POST 请求(Hutool HttpUtil 重载方法) | ||||
|         String post = HttpUtil.createPost(authUrl) | ||||
| //            .addHeaders(headers) // 设置所有请求头 | ||||
|             .body(jsonBody) // 设置请求体 | ||||
|             .execute() // 执行请求 | ||||
|             .body(); // 获取响应体 | ||||
|  | ||||
|         System.out.println("响应结果:" + post); | ||||
|         // 3. 解析响应(核心解析逻辑) | ||||
|         JSONObject responseJson = JSONObject.parseObject(post); | ||||
|         int code = responseJson.getIntValue("code"); | ||||
|         String msg = responseJson.getString("msg"); | ||||
|         String token = responseJson.getString("token"); | ||||
|  | ||||
|         // 4. 校验响应有效性 | ||||
|         if (code != 200) { | ||||
|             throw new RuntimeException("获取 Token 失败,响应信息:" + msg + ",状态码:" + code); | ||||
|         } | ||||
|         if (token == null || token.trim().isEmpty()) { | ||||
|             throw new RuntimeException("响应中未包含有效 Token,响应内容:" + post); | ||||
|         } | ||||
|  | ||||
|         return token; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * RSA公钥加密(核心加密方法) | ||||
|      * @param content 待加密内容(原始密码) | ||||
|      * @param publicKeyStr 公钥字符串(Base64编码) | ||||
|      * @return 加密后的Base64字符串 | ||||
|      * @throws Exception 加密过程异常 | ||||
|      */ | ||||
|     public static String rsaEncrypt(String content, String publicKeyStr) throws Exception { | ||||
|         RSA rsa = new RSA(null, publicKeyStr); | ||||
|         byte[] encryptedBytes = rsa.encrypt(content, KeyType.PublicKey); | ||||
|         return Base64.getEncoder().encodeToString(encryptedBytes); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public static void main(String[] args) throws Exception { | ||||
|         String claritypm = getToken(CLARITYPM); | ||||
|         System.out.println(claritypm); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,79 @@ | ||||
| package org.dromara.dataTransmission.claritypm; | ||||
|  | ||||
|  | ||||
| import org.dromara.dataTransmission.TokenUtils; | ||||
| import org.dromara.dataTransmission.claritypm.dto.RealUser; | ||||
| import org.springframework.stereotype.Component; | ||||
| import cn.hutool.http.HttpUtil; | ||||
| import com.alibaba.fastjson.JSON; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.HashMap; | ||||
|  | ||||
| @Component | ||||
| public class ClaritypmClient { | ||||
|  | ||||
|     // 接口地址 | ||||
|     private static final String INSERT_REAL_USER_URL = "https://claritypm.powerchina.cn/neSmartsite-api/realUser/tiandong/insertRealUser"; | ||||
|  | ||||
|     @Autowired | ||||
|     private TokenUtils tokenUtils; // 依赖之前的Token获取服务 | ||||
|  | ||||
|     /** | ||||
|      * 批量新增实名制用户信息 | ||||
|      * @param userList 用户信息列表(建议单次不超过10条) | ||||
|      * @return 接口响应结果(JSON格式) | ||||
|      * @throws Exception 调用异常 | ||||
|      */ | ||||
|     public static String batchInsertRealUser(List<RealUser> userList) throws Exception { | ||||
|         // 1. 校验列表大小(建议不超过10条) | ||||
|         if (userList == null || userList.isEmpty()) { | ||||
|             throw new IllegalArgumentException("用户列表不能为空"); | ||||
|         } | ||||
|         if (userList.size() > 10) { | ||||
|             throw new IllegalArgumentException("单次批量新增不能超过10条数据"); | ||||
|         } | ||||
|  | ||||
|         // 2. 获取Token(从之前的TokenService获取) | ||||
|         String token = TokenUtils.getToken(TokenUtils.CLARITYPM); | ||||
|         if ( token.trim().isEmpty()) { | ||||
|             throw new RuntimeException("获取Token失败,无法调用接口"); | ||||
|         } | ||||
|  | ||||
|         // 3. 构建请求头(包含Token认证) | ||||
|         Map<String, String> headers = new HashMap<>(); | ||||
|         headers.put("Content-Type", "application/json; charset=UTF-8"); | ||||
|         headers.put("User-Agent", "Mozilla/5.0"); | ||||
|         headers.put("Accept", "application/json"); | ||||
|         headers.put("Origin", "https://claritypm.powerchina.cn"); | ||||
|         headers.put("Referer", "https://claritypm.powerchina.cn/"); | ||||
|         headers.put("Authorization", "Bearer " + token); // 假设接口使用Bearer Token认证 | ||||
|  | ||||
|         // 4. 构建请求体(JSONArray格式) | ||||
|         JSONArray requestBody = JSONArray.parseArray(JSON.toJSONString(userList)); | ||||
|         String jsonBody = requestBody.toJSONString(); | ||||
|         System.out.println("批量新增用户请求体:" + jsonBody); | ||||
|  | ||||
|         // 5. 发送POST请求 | ||||
|         String response = HttpUtil.createPost(INSERT_REAL_USER_URL) | ||||
|             .addHeaders(headers) | ||||
|             .body(jsonBody) | ||||
|             .execute() | ||||
|             .body(); | ||||
|         System.out.println("批量新增用户响应:" + response); | ||||
|  | ||||
|         // 6. 解析响应(根据实际响应结构调整,此处假设与登录接口类似) | ||||
|         JSONObject responseJson = JSONObject.parseObject(response); | ||||
|         int code = responseJson.getIntValue("code"); | ||||
|         String msg = responseJson.getString("msg"); | ||||
|         if (code != 200) { | ||||
|             throw new RuntimeException("批量新增用户失败:" + msg + "(状态码:" + code + ")"); | ||||
|         } | ||||
|  | ||||
|         return response; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,92 @@ | ||||
| package org.dromara.dataTransmission.claritypm.dto; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.time.LocalDate; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 实名制用户信息实体类(对应接口参数) | ||||
|  */ | ||||
| @Data | ||||
| public class RealUser { | ||||
|     // 人员姓名(必填) | ||||
|     private String userName; | ||||
|  | ||||
|     // 是否班组长(非必填,0-否 1-是) | ||||
|     private String classManagerFlag; | ||||
|  | ||||
|     // 手机号码(必填) | ||||
|     private String phone; | ||||
|  | ||||
|     // 性别(必填,1.男 2.女 3.未知) | ||||
|     private String sex; | ||||
|  | ||||
|     // 证件类型(必填,0.身份证) | ||||
|     private String cardType; | ||||
|  | ||||
|     // 证件号码(必填,身份证号码) | ||||
|     private String cardNumber; | ||||
|  | ||||
|     // 人员类型(必填,0.作业人员 1.管理人员) | ||||
|     private String userType; | ||||
|  | ||||
|     // 发证机关(非必填) | ||||
|     private String cardDept; | ||||
|  | ||||
|     // 民族(非必填) | ||||
|     private String nation; | ||||
|  | ||||
|     // 生日(非必填,datetime格式) | ||||
|     private LocalDate birthday; | ||||
|  | ||||
|     // 住址(非必填) | ||||
|     private String address; | ||||
|  | ||||
|     // 头像(非必填,http地址) | ||||
|     private String avatar; | ||||
|  | ||||
|     // 采集相片(非必填,http地址) | ||||
|     private String pic; | ||||
|  | ||||
|     // 安全教育表(非必填,http地址) | ||||
|     private String safetyEdu; | ||||
|  | ||||
|     // 技术交底表(非必填,http地址) | ||||
|     private String technology; | ||||
|  | ||||
|     // 证件有效期始(非必填,datetime格式) | ||||
|     private LocalDate cardStartTime; | ||||
|  | ||||
|     // 证件有效期至(非必填,datetime格式) | ||||
|     private LocalDate cardEndTime; | ||||
|  | ||||
|     // 学历(非必填,1-9对应小学至其他) | ||||
|     private String studyLevel; | ||||
|  | ||||
|     // 政治面貌(非必填,0-3对应党员至民主党派) | ||||
|     private String politicsType; | ||||
|  | ||||
|     // 购买保险(非必填,0-否 1-是) | ||||
|     private String insuranceFlag; | ||||
|  | ||||
|     // 重大病史(非必填,0-否 1-是) | ||||
|     private String diseaseFlag; | ||||
|  | ||||
|     // 劳动合同(非必填,0-未签订 1-已签订) | ||||
|     private String laborContractFlag; | ||||
|  | ||||
|     // 紧急联系人(非必填) | ||||
|     private String contacts; | ||||
|  | ||||
|     // 紧急联系人电话(非必填) | ||||
|     private String contactsPhone; | ||||
|  | ||||
|     // 婚姻状况(非必填,0-3对应未婚至丧偶) | ||||
|     private String marryRemark; | ||||
|  | ||||
|     // 企业名称(非必填) | ||||
|     private String companyName; | ||||
|  | ||||
|  | ||||
| } | ||||
| @ -23,7 +23,10 @@ import org.dromara.facility.constant.FacRedisKeyConstant; | ||||
| import org.dromara.facility.domain.FacMatrix; | ||||
| import org.dromara.facility.domain.FacPhotovoltaicPanel; | ||||
| import org.dromara.facility.domain.dto.geojson.*; | ||||
| import org.dromara.facility.domain.dto.photovoltaicpanel.*; | ||||
| import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelCreateByGeoJsonReq; | ||||
| import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelCreateReq; | ||||
| import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelQueryReq; | ||||
| import org.dromara.facility.domain.dto.photovoltaicpanel.FacPhotovoltaicPanelUpdateReq; | ||||
| import org.dromara.facility.domain.enums.FacFinishStatusEnum; | ||||
| import org.dromara.facility.domain.enums.FacFinishTypeEnum; | ||||
| import org.dromara.facility.domain.vo.photovoltaicpanel.FacPhotovoltaicPanelVo; | ||||
| @ -329,10 +332,10 @@ public class FacPhotovoltaicPanelServiceImpl extends ServiceImpl<FacPhotovoltaic | ||||
|                                 } | ||||
|                                 Long matrixId = matrix.getId();*/ | ||||
|                                 // 去掉首字母 (T/G) | ||||
|                                 String withoutPrefix = name.substring(2); | ||||
|                                 String withoutPrefix = name.substring(1); | ||||
|  | ||||
|                                 // 如果包含".",只取第一个"."前的数字 | ||||
|                                 int dotIndex = withoutPrefix.indexOf("#"); | ||||
|                                 int dotIndex = withoutPrefix.indexOf("."); | ||||
|                                 if (dotIndex != -1) { | ||||
|                                     withoutPrefix = withoutPrefix.substring(0, dotIndex); | ||||
|                                 } | ||||
|  | ||||
| @ -87,8 +87,7 @@ public class AttendanceJob { | ||||
|                     .lt(BusAttendanceRule::getClockInResultTime, end)); | ||||
|             } | ||||
|  | ||||
|             //获取当前日期 | ||||
|             LocalDate date = LocalDate.now(); | ||||
|  | ||||
|  | ||||
|             //管理员关联多个项目,需要记录是否已生成缺卡记录 | ||||
| //            HashSet<Long> manageUserIds = new HashSet<>(); | ||||
| @ -97,6 +96,8 @@ public class AttendanceJob { | ||||
|             for (BusAttendanceRule rule : list) { | ||||
|                 LocalTime clockInTime = rule.getClockInTime(); | ||||
|                 LocalTime clockInResultTime = rule.getClockInResultTime(); | ||||
|                 //获取当前日期 | ||||
|                 LocalDate date = LocalDate.now(); | ||||
|  | ||||
|                 //计算考勤日期 | ||||
|                 if (start.isAfter(end)) {  // 跨天情况 | ||||
| @ -210,8 +211,7 @@ public class AttendanceJob { | ||||
|                     .lt(BusAttendanceRule::getClockOutResultTime, end)); | ||||
|             } | ||||
|  | ||||
|             //获取当前日期 | ||||
|             LocalDate date = LocalDate.now(); | ||||
|  | ||||
|  | ||||
|             //管理员关联多个项目,需要记录是否已生成缺卡记录 | ||||
| //            HashSet<Long> manageUserIds = new HashSet<>(); | ||||
| @ -220,6 +220,8 @@ public class AttendanceJob { | ||||
|             List<BusAttendance> missList = new ArrayList<>(); | ||||
|  | ||||
|             for (BusAttendanceRule rule : list) { | ||||
|                 //获取当前日期 | ||||
|                 LocalDate date = LocalDate.now(); | ||||
|  | ||||
|                 LocalTime clockOutTime = rule.getClockOutTime(); | ||||
|                 LocalTime clockOutResultTime = rule.getClockOutResultTime(); | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| package org.dromara.job.cycle; | ||||
|  | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import jakarta.annotation.Resource; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.manager.ys7manager.Ys7Manager; | ||||
| @ -10,6 +11,8 @@ import org.dromara.other.domain.enums.OthDeviceStatusEnum; | ||||
| import org.dromara.other.service.IOthDevicePresetService; | ||||
| import org.dromara.other.service.IOthYs7DeviceImgService; | ||||
| import org.dromara.other.service.IOthYs7DeviceService; | ||||
| import org.dromara.safety.domain.HseViolationLevel; | ||||
| import org.dromara.safety.service.IHseViolationLevelService; | ||||
| import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||||
| import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.stereotype.Component; | ||||
| @ -40,6 +43,9 @@ public class IncSyncYs7DeviceCapturePicData { | ||||
|     @Resource | ||||
|     private IOthYs7DeviceImgService ys7DeviceImgService; | ||||
|  | ||||
|     @Resource | ||||
|     private IHseViolationLevelService violationLevelService; | ||||
|  | ||||
|     @Resource | ||||
|     private Ys7Manager ys7Manager; | ||||
|  | ||||
| @ -49,11 +55,21 @@ public class IncSyncYs7DeviceCapturePicData { | ||||
|     @Scheduled(cron = "0 */10 7-19 * * ?") | ||||
|     public void run() { | ||||
|         log.info("执行萤石设备抓拍图片"); | ||||
|         // 获取所有项目的等级信息 | ||||
|         List<HseViolationLevel> allLevel = violationLevelService.lambdaQuery() | ||||
|             .select(HseViolationLevel::getId, HseViolationLevel::getProjectId) | ||||
|             .list(); | ||||
|         Set<Long> projectIds = allLevel.stream().map(HseViolationLevel::getProjectId).collect(Collectors.toSet()); | ||||
|         // 查询所有在线的摄像头设备,仅获取必要字段 | ||||
|         List<OthYs7Device> deviceList = ys7DeviceService.lambdaQuery() | ||||
|             .select(OthYs7Device::getId, OthYs7Device::getDeviceSerial, OthYs7Device::getDeviceName) | ||||
|             .in(OthYs7Device::getProjectId, projectIds) // 仅获取设置了安全等级项目的摄像头 | ||||
|             .eq(OthYs7Device::getStatus, OthDeviceStatusEnum.ONLINE.getValue()) | ||||
|             .list(); | ||||
|         if (CollUtil.isEmpty(deviceList)) { | ||||
|             log.info("没有可拍摄的摄像头设备"); | ||||
|             return; | ||||
|         } | ||||
|         // 提取设备序列号用于后续查询预置位 | ||||
|         List<String> deviceSerialList = deviceList.stream() | ||||
|             .map(OthYs7Device::getDeviceSerial).toList(); | ||||
|  | ||||
| @ -3,6 +3,7 @@ package org.dromara.manager.recognizermanager.enums; | ||||
| import lombok.Getter; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Objects; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| /** | ||||
| @ -48,6 +49,15 @@ public enum RecognizerTypeEnum { | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     public static RecognizerTypeEnum fromCode(String code) { | ||||
|         for (RecognizerTypeEnum type : RecognizerTypeEnum.values()) { | ||||
|             if (type.getCode().equals(code)) { | ||||
|                 return type; | ||||
|             } | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 将多个 RecognizerTypeEnum 拼接为接口识别参数字符串(","分隔) | ||||
|      */ | ||||
| @ -60,4 +70,18 @@ public enum RecognizerTypeEnum { | ||||
|             .collect(Collectors.joining(",")); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 将多个 code 转换为 RecognizerTypeEnum | ||||
|      * | ||||
|      * @param codes code列表 | ||||
|      * @return RecognizerTypeEnum列表 | ||||
|      */ | ||||
|     public static List<RecognizerTypeEnum> listFromCodes(List<String> codes) { | ||||
|         return codes.stream() | ||||
|             .map(RecognizerTypeEnum::fromCode) | ||||
|             .filter(Objects::nonNull) | ||||
|             .distinct() | ||||
|             .toList(); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -0,0 +1,106 @@ | ||||
| package org.dromara.materials.controller; | ||||
|  | ||||
| import cn.dev33.satoken.annotation.SaCheckPermission; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.core.validate.AddGroup; | ||||
| import org.dromara.common.core.validate.EditGroup; | ||||
| import org.dromara.common.excel.utils.ExcelUtil; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.materials.domain.bo.MatWarehouseBo; | ||||
| import org.dromara.materials.domain.vo.MatWarehouseVo; | ||||
| import org.dromara.materials.service.IMatWarehouseService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| @Validated | ||||
| @RequiredArgsConstructor | ||||
| @RestController | ||||
| @RequestMapping("/materials/warehouse") | ||||
| public class MatWarehouseController extends BaseController { | ||||
|  | ||||
|     private final IMatWarehouseService matWarehouseService; | ||||
|  | ||||
|     /** | ||||
|      * 查询物资仓库列表 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:list") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<MatWarehouseVo> list(MatWarehouseBo bo, PageQuery pageQuery) { | ||||
|         return matWarehouseService.queryPageList(bo, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 导出物资仓库列表 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:export") | ||||
|     @Log(title = "物资仓库", businessType = BusinessType.EXPORT) | ||||
|     @PostMapping("/export") | ||||
|     public void export(MatWarehouseBo bo, HttpServletResponse response) { | ||||
|         List<MatWarehouseVo> list = matWarehouseService.queryList(bo); | ||||
|         ExcelUtil.exportExcel(list, "物资仓库", MatWarehouseVo.class, response); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取物资仓库详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:query") | ||||
|     @GetMapping("/{id}") | ||||
|     public R<MatWarehouseVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                      @PathVariable Long id) { | ||||
|         return R.ok(matWarehouseService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增物资仓库 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:add") | ||||
|     @Log(title = "物资仓库", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated(AddGroup.class) @RequestBody MatWarehouseBo bo) { | ||||
|         return toAjax(matWarehouseService.insertByBo(bo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改物资仓库 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:edit") | ||||
|     @Log(title = "物资仓库", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated(EditGroup.class) @RequestBody MatWarehouseBo bo) { | ||||
|         return toAjax(matWarehouseService.updateByBo(bo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除物资仓库 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @SaCheckPermission("materials:warehouse:remove") | ||||
|     @Log(title = "物资仓库", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(matWarehouseService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -68,6 +68,16 @@ public class MatMaterialIssue extends BaseEntity { | ||||
|      */ | ||||
|     private String issueUnit; | ||||
|  | ||||
|     /** | ||||
|      * 领料单位id | ||||
|      */ | ||||
|     private Long issueUnitId; | ||||
|  | ||||
|     /** | ||||
|      * 领用人 | ||||
|      */ | ||||
|     private String shipper; | ||||
|  | ||||
|     /** | ||||
|      * 保管单位 | ||||
|      */ | ||||
|  | ||||
| @ -38,6 +38,11 @@ public class MatMaterials extends BaseEntity { | ||||
|      */ | ||||
|     private Long companyId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|  | ||||
| @ -0,0 +1,91 @@ | ||||
| package org.dromara.materials.domain; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库对象 mat_warehouse | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @TableName("mat_warehouse") | ||||
| public class MatWarehouse extends BaseEntity { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键id | ||||
|      */ | ||||
|     @TableId(value = "id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库编号 | ||||
|      */ | ||||
|     private String warehouseCode; | ||||
|  | ||||
|     /** | ||||
|      * 仓库名称 | ||||
|      */ | ||||
|     private String warehouseName; | ||||
|  | ||||
|     /** | ||||
|      * 仓库类型 | ||||
|      */ | ||||
|     private String warehouseType; | ||||
|  | ||||
|     /** | ||||
|      * 仓库地址 | ||||
|      */ | ||||
|     private String address; | ||||
|  | ||||
|     /** | ||||
|      * 经度 | ||||
|      */ | ||||
|     private String lng; | ||||
|  | ||||
|     /** | ||||
|      * 纬度 | ||||
|      */ | ||||
|     private String lat; | ||||
|  | ||||
|     /** | ||||
|      * 仓库面积 | ||||
|      */ | ||||
|     private Long area; | ||||
|  | ||||
|     /** | ||||
|      * 存放容量 | ||||
|      */ | ||||
|     private Long capacity; | ||||
|  | ||||
|     /** | ||||
|      * 负责人 | ||||
|      */ | ||||
|     private String manager; | ||||
|  | ||||
|     /** | ||||
|      * 负责人电话 | ||||
|      */ | ||||
|     private String managerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,94 @@ | ||||
| package org.dromara.materials.domain.bo; | ||||
|  | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.dromara.common.core.validate.AddGroup; | ||||
| import org.dromara.common.core.validate.EditGroup; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库业务对象 mat_warehouse | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @AutoMapper(target = MatWarehouse.class, reverseConvertGenerate = false) | ||||
| public class MatWarehouseBo extends BaseEntity { | ||||
|  | ||||
|     /** | ||||
|      * 主键id | ||||
|      */ | ||||
|     @NotNull(message = "主键id不能为空", groups = {EditGroup.class}) | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|     @NotNull(message = "项目id不能为空", groups = {AddGroup.class, EditGroup.class}) | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库编号 | ||||
|      */ | ||||
|     @NotBlank(message = "仓库编号不能为空", groups = {AddGroup.class, EditGroup.class}) | ||||
|     private String warehouseCode; | ||||
|  | ||||
|     /** | ||||
|      * 仓库名称 | ||||
|      */ | ||||
|     @NotBlank(message = "仓库名称不能为空", groups = {AddGroup.class, EditGroup.class}) | ||||
|     private String warehouseName; | ||||
|  | ||||
|     /** | ||||
|      * 仓库类型 | ||||
|      */ | ||||
|     @NotBlank(message = "仓库类型不能为空", groups = {AddGroup.class, EditGroup.class}) | ||||
|     private String warehouseType; | ||||
|  | ||||
|     /** | ||||
|      * 仓库地址 | ||||
|      */ | ||||
|     private String address; | ||||
|  | ||||
|     /** | ||||
|      * 经度 | ||||
|      */ | ||||
|     private String lng; | ||||
|  | ||||
|     /** | ||||
|      * 纬度 | ||||
|      */ | ||||
|     private String lat; | ||||
|  | ||||
|     /** | ||||
|      * 仓库面积 | ||||
|      */ | ||||
|     private Long area; | ||||
|  | ||||
|     /** | ||||
|      * 存放容量 | ||||
|      */ | ||||
|     private Long capacity; | ||||
|  | ||||
|     /** | ||||
|      * 负责人 | ||||
|      */ | ||||
|     private String manager; | ||||
|  | ||||
|     /** | ||||
|      * 负责人电话 | ||||
|      */ | ||||
|     private String managerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @ -63,6 +63,12 @@ public class MatMaterialIssueCreateReq implements Serializable { | ||||
|     @NotBlank(message = "领料单位不能为空") | ||||
|     private String issueUnit; | ||||
|  | ||||
|     /** | ||||
|      * 领用人 | ||||
|      */ | ||||
|     @NotBlank(message = "领用人不能为空") | ||||
|     private String shipper; | ||||
|  | ||||
|     /** | ||||
|      * 保管单位 | ||||
|      */ | ||||
|  | ||||
| @ -57,6 +57,11 @@ public class MatMaterialIssueUpdateReq implements Serializable { | ||||
|      */ | ||||
|     private String issueUnit; | ||||
|  | ||||
|     /** | ||||
|      * 领用人 | ||||
|      */ | ||||
|     private String shipper; | ||||
|  | ||||
|     /** | ||||
|      * 保管单位 | ||||
|      */ | ||||
|  | ||||
| @ -61,4 +61,9 @@ public class MatMaterialReceiveItemDto { | ||||
|      */ | ||||
|     private Long planId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -26,6 +26,11 @@ public class MatMaterialsCreateReq implements Serializable { | ||||
|      */ | ||||
|     private Long companyId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|  | ||||
| @ -25,6 +25,11 @@ public class MatMaterialsQueryReq implements Serializable { | ||||
|      */ | ||||
|     private Long companyId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|  | ||||
| @ -31,6 +31,11 @@ public class MatMaterialsUpdateReq implements Serializable { | ||||
|      */ | ||||
|     private Long companyId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|  | ||||
| @ -0,0 +1,108 @@ | ||||
| package org.dromara.materials.domain.vo; | ||||
|  | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 物资仓库视图对象 mat_warehouse | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| @AutoMapper(target = MatWarehouse.class) | ||||
| public class MatWarehouseVo implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键id | ||||
|      */ | ||||
|     @ExcelProperty(value = "主键id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目id | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目id") | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库编号 | ||||
|      */ | ||||
|     @ExcelProperty(value = "仓库编号") | ||||
|     private String warehouseCode; | ||||
|  | ||||
|     /** | ||||
|      * 仓库名称 | ||||
|      */ | ||||
|     @ExcelProperty(value = "仓库名称") | ||||
|     private String warehouseName; | ||||
|  | ||||
|     /** | ||||
|      * 仓库类型 | ||||
|      */ | ||||
|     @ExcelProperty(value = "仓库类型", converter = ExcelDictConvert.class) | ||||
|     @ExcelDictFormat(dictType = "mat_warehouse_type") | ||||
|     private String warehouseType; | ||||
|  | ||||
|     /** | ||||
|      * 仓库地址 | ||||
|      */ | ||||
|     @ExcelProperty(value = "仓库地址") | ||||
|     private String address; | ||||
|  | ||||
|     /** | ||||
|      * 经度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "经度") | ||||
|     private String lng; | ||||
|  | ||||
|     /** | ||||
|      * 纬度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "纬度") | ||||
|     private String lat; | ||||
|  | ||||
|     /** | ||||
|      * 仓库面积 | ||||
|      */ | ||||
|     @ExcelProperty(value = "仓库面积") | ||||
|     private Long area; | ||||
|  | ||||
|     /** | ||||
|      * 存放容量 | ||||
|      */ | ||||
|     @ExcelProperty(value = "存放容量") | ||||
|     private Long capacity; | ||||
|  | ||||
|     /** | ||||
|      * 负责人 | ||||
|      */ | ||||
|     @ExcelProperty(value = "负责人") | ||||
|     private String manager; | ||||
|  | ||||
|     /** | ||||
|      * 负责人电话 | ||||
|      */ | ||||
|     @ExcelProperty(value = "负责人电话") | ||||
|     private String managerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     @ExcelProperty(value = "备注") | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @ -69,6 +69,11 @@ public class MatMaterialIssueVo implements Serializable { | ||||
|      */ | ||||
|     private String issueUnit; | ||||
|  | ||||
|     /** | ||||
|      * 领用人 | ||||
|      */ | ||||
|     private String shipper; | ||||
|  | ||||
|     /** | ||||
|      * 保管单位 | ||||
|      */ | ||||
|  | ||||
| @ -1,13 +1,11 @@ | ||||
| package org.dromara.materials.domain.vo.materials; | ||||
|  | ||||
| import lombok.Data; | ||||
| import org.dromara.materials.domain.vo.materialsinventory.MatMaterialsInventoryOutVo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
| @ -48,9 +46,4 @@ public class MatMaterialsNumberVo implements Serializable { | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     private Date createTime; | ||||
|  | ||||
|     /** | ||||
|      * 出库列表 | ||||
|      */ | ||||
|     private List<MatMaterialsInventoryOutVo> outList; | ||||
| } | ||||
|  | ||||
| @ -28,6 +28,16 @@ public class MatMaterialsUseDetailVo implements Serializable { | ||||
|      */ | ||||
|     private String materialsName; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库名称 | ||||
|      */ | ||||
|     private String warehouseName; | ||||
|  | ||||
|     /** | ||||
|      * 计划数量 | ||||
|      */ | ||||
|  | ||||
| @ -47,6 +47,11 @@ public class MatMaterialsVo implements Serializable { | ||||
|     @ExcelProperty(value = "公司id") | ||||
|     private Long companyId; | ||||
|  | ||||
|     /** | ||||
|      * 仓库id | ||||
|      */ | ||||
|     private Long warehouseId; | ||||
|  | ||||
|     /** | ||||
|      * 公司信息 | ||||
|      */ | ||||
|  | ||||
| @ -0,0 +1,15 @@ | ||||
| package org.dromara.materials.mapper; | ||||
|  | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
| import org.dromara.materials.domain.vo.MatWarehouseVo; | ||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库Mapper接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| public interface MatWarehouseMapper extends BaseMapperPlus<MatWarehouse, MatWarehouseVo> { | ||||
|  | ||||
| } | ||||
| @ -8,6 +8,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.materials.domain.MatMaterials; | ||||
| import org.dromara.materials.domain.MatMaterialsInventory; | ||||
| import org.dromara.materials.domain.MatMaterialsUseRecord; | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
| import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto; | ||||
| import org.dromara.materials.domain.dto.materials.MatMaterialsCreateReq; | ||||
| import org.dromara.materials.domain.dto.materials.MatMaterialsGisReq; | ||||
| @ -117,11 +118,8 @@ public interface IMatMaterialsService extends IService<MatMaterials> { | ||||
|      * @param supplierUnit 供应商单位 | ||||
|      * @param nickname     操作用户昵称 | ||||
|      */ | ||||
|     void create(Long projectId, | ||||
|                 List<MatMaterialReceiveItemDto> itemList, | ||||
|                 String formCode, | ||||
|                 String supplierUnit, | ||||
|                 String nickname | ||||
|     void create(Long projectId, List<MatMaterialReceiveItemDto> itemList, | ||||
|                 String formCode, String supplierUnit, String nickname | ||||
|     ); | ||||
|  | ||||
|     /** | ||||
| @ -173,12 +171,14 @@ public interface IMatMaterialsService extends IService<MatMaterials> { | ||||
|      * @param putList       材料入库列表 | ||||
|      * @param outList       材料出库列表 | ||||
|      * @param useList       材料使用列表 | ||||
|      * @param warehouseList 仓库列表 | ||||
|      * @return 材料使用详情列表 | ||||
|      */ | ||||
|     List<MatMaterialsUseDetailVo> getUseDetailList(List<MatMaterials> materials, | ||||
|                                                    List<MatMaterialsInventory> putList, | ||||
|                                                    List<MatMaterialsInventory> outList, | ||||
|                                                    List<MatMaterialsUseRecord> useList); | ||||
|                                                    List<MatMaterialsUseRecord> useList, | ||||
|                                                    List<MatWarehouse> warehouseList); | ||||
|  | ||||
|     /** | ||||
|      * 获取材料库存数据列表 | ||||
|  | ||||
| @ -0,0 +1,70 @@ | ||||
| package org.dromara.materials.service; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
| import org.dromara.materials.domain.bo.MatWarehouseBo; | ||||
| import org.dromara.materials.domain.vo.MatWarehouseVo; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库Service接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| public interface IMatWarehouseService extends IService<MatWarehouse> { | ||||
|  | ||||
|     /** | ||||
|      * 查询物资仓库 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 物资仓库 | ||||
|      */ | ||||
|     MatWarehouseVo queryById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 分页查询物资仓库列表 | ||||
|      * | ||||
|      * @param bo        查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 物资仓库分页列表 | ||||
|      */ | ||||
|     TableDataInfo<MatWarehouseVo> queryPageList(MatWarehouseBo bo, PageQuery pageQuery); | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的物资仓库列表 | ||||
|      * | ||||
|      * @param bo 查询条件 | ||||
|      * @return 物资仓库列表 | ||||
|      */ | ||||
|     List<MatWarehouseVo> queryList(MatWarehouseBo bo); | ||||
|  | ||||
|     /** | ||||
|      * 新增物资仓库 | ||||
|      * | ||||
|      * @param bo 物资仓库 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     Boolean insertByBo(MatWarehouseBo bo); | ||||
|  | ||||
|     /** | ||||
|      * 修改物资仓库 | ||||
|      * | ||||
|      * @param bo 物资仓库 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean updateByBo(MatWarehouseBo bo); | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除物资仓库信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | ||||
| } | ||||
| @ -23,6 +23,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.oss.core.OssClient; | ||||
| import org.dromara.common.oss.exception.OssException; | ||||
| import org.dromara.common.oss.factory.OssFactory; | ||||
| import org.dromara.common.satoken.utils.LoginHelper; | ||||
| import org.dromara.common.utils.DocumentUtil; | ||||
| import org.dromara.materials.constants.MatMaterialsConstant; | ||||
| import org.dromara.materials.domain.MatMaterialIssue; | ||||
| @ -35,6 +36,7 @@ import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueUpdateReq; | ||||
| import org.dromara.materials.domain.dto.materialissue.MatMaterialIssueWordDto; | ||||
| import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemDto; | ||||
| import org.dromara.materials.domain.dto.materialissueitem.MatMaterialIssueItemWordDto; | ||||
| import org.dromara.materials.domain.enums.MatMaterialsInventoryOutPutEnum; | ||||
| import org.dromara.materials.domain.vo.materialissue.MatMaterialIssueVo; | ||||
| import org.dromara.materials.domain.vo.materialsinventory.MatMaterialsInventoryListVo; | ||||
| import org.dromara.materials.mapper.MatMaterialIssueMapper; | ||||
| @ -238,14 +240,12 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean insertByBo(MatMaterialIssueCreateReq req) { | ||||
|         String nickname = Objects.requireNonNull(LoginHelper.getLoginUser()).getNickname(); | ||||
|         MatMaterialIssue materialIssue = new MatMaterialIssue(); | ||||
|         BeanUtils.copyProperties(req, materialIssue); | ||||
|         validEntityBeforeSave(materialIssue, true); | ||||
|         getFileSize(materialIssue, | ||||
|             req.getLicenseCountFileId(), | ||||
|             req.getReportCountFileId(), | ||||
|             req.getTechDocCountFileId(), | ||||
|             req.getCertCountFileId()); | ||||
|         validEntityBeforeSave(materialIssue); | ||||
|         getFileSize(materialIssue, req.getLicenseCountFileId(), | ||||
|             req.getReportCountFileId(), req.getTechDocCountFileId(), req.getCertCountFileId()); | ||||
|         boolean save = this.save(materialIssue); | ||||
|         if (!save) { | ||||
|             throw new ServiceException("物料领料单新增失败", HttpStatus.ERROR); | ||||
| @ -263,15 +263,17 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap | ||||
|             if (!result) { | ||||
|                 throw new ServiceException("物料领料单明细项新增失败", HttpStatus.ERROR); | ||||
|             } | ||||
| /*            // 创建设备材料出库记录 | ||||
|             // 创建设备材料出库记录 | ||||
|             List<MatMaterialsInventory> inventoryList = itemList.stream().map(item -> { | ||||
|                 MatMaterialsInventory inventory = new MatMaterialsInventory(); | ||||
|                 inventory.setNumber(item.getIssuedQuantity().longValue()); | ||||
|                 inventory.setOutPutTime(new Date()); | ||||
|                 inventory.setResidue(item.getRemainingQuantity().longValue()); | ||||
|                 inventory.setOperator(nickname); | ||||
|                 inventory.setOperatorId(LoginHelper.getUserId()); | ||||
|                 inventory.setRecipient(materialIssue.getIssueUnit()); | ||||
|                 inventory.setShipper(nickname); | ||||
|                 inventory.setRecipientId(materialIssue.getIssueUnitId()); | ||||
|                 inventory.setShipper(materialIssue.getShipper()); | ||||
|                 inventory.setMaterialsId(item.getMaterialsId()); | ||||
|                 inventory.setProjectId(materialIssue.getProjectId()); | ||||
|                 inventory.setOutPut(MatMaterialsInventoryOutPutEnum.OUT.getValue()); | ||||
| @ -281,7 +283,7 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap | ||||
|             boolean saved = materialsInventoryService.saveBatch(inventoryList); | ||||
|             if (!saved) { | ||||
|                 throw new ServiceException("物料出库记录新增失败", HttpStatus.ERROR); | ||||
|             }*/ | ||||
|             } | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
| @ -302,7 +304,7 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap | ||||
|         } | ||||
|         MatMaterialIssue materialIssue = new MatMaterialIssue(); | ||||
|         BeanUtils.copyProperties(req, materialIssue); | ||||
|         validEntityBeforeSave(materialIssue, false); | ||||
|         validEntityBeforeSave(materialIssue); | ||||
|         getFileSize(materialIssue, | ||||
|             req.getLicenseCountFileId(), | ||||
|             req.getReportCountFileId(), | ||||
| @ -341,18 +343,9 @@ public class MatMaterialIssueServiceImpl extends ServiceImpl<MatMaterialIssueMap | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(MatMaterialIssue entity, Boolean create) { | ||||
|     private void validEntityBeforeSave(MatMaterialIssue entity) { | ||||
|         // 做一些数据校验,如唯一约束 | ||||
|         Long projectId = entity.getProjectId(); | ||||
|         String materialSource = entity.getMaterialSource(); | ||||
|         if (create) { | ||||
|             if (projectId == null) { | ||||
|                 throw new ServiceException("项目 id 不能为空", HttpStatus.BAD_REQUEST); | ||||
|             } | ||||
|             if (StringUtils.isEmpty(materialSource)) { | ||||
|                 throw new ServiceException("物料来源不能为空", HttpStatus.BAD_REQUEST); | ||||
|             } | ||||
|         } | ||||
|         // 查询项目是否存在 | ||||
|         if (projectId != null && projectService.getById(projectId) == null) { | ||||
|             throw new ServiceException("对应项目不存在", HttpStatus.NOT_FOUND); | ||||
|  | ||||
| @ -26,16 +26,20 @@ import org.dromara.common.utils.DocumentUtil; | ||||
| import org.dromara.materials.constants.MatMaterialsConstant; | ||||
| import org.dromara.materials.domain.MatMaterialReceive; | ||||
| import org.dromara.materials.domain.MatMaterialReceiveItem; | ||||
| import org.dromara.materials.domain.MatMaterials; | ||||
| import org.dromara.materials.domain.MatMaterialsInventory; | ||||
| import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveCreateReq; | ||||
| import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveQueryReq; | ||||
| import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveUpdateReq; | ||||
| import org.dromara.materials.domain.dto.materialreceive.MatMaterialReceiveWordDto; | ||||
| import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto; | ||||
| import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemWordDto; | ||||
| import org.dromara.materials.domain.enums.MatMaterialsInventoryOutPutEnum; | ||||
| import org.dromara.materials.domain.vo.materialreceive.MatMaterialReceiveVo; | ||||
| import org.dromara.materials.mapper.MatMaterialReceiveMapper; | ||||
| import org.dromara.materials.service.IMatMaterialReceiveItemService; | ||||
| import org.dromara.materials.service.IMatMaterialReceiveService; | ||||
| import org.dromara.materials.service.IMatMaterialsInventoryService; | ||||
| import org.dromara.materials.service.IMatMaterialsService; | ||||
| import org.dromara.project.service.IBusProjectService; | ||||
| import org.dromara.system.domain.vo.SysOssVo; | ||||
| @ -53,6 +57,7 @@ import java.nio.file.Files; | ||||
| import java.nio.file.Path; | ||||
| import java.nio.file.Paths; | ||||
| import java.util.*; | ||||
| import java.util.stream.Collectors; | ||||
| import java.util.zip.ZipOutputStream; | ||||
|  | ||||
| /** | ||||
| @ -81,6 +86,9 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv | ||||
|     @Resource | ||||
|     private IMatMaterialsService materialsService; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatMaterialsInventoryService materialsInventoryService; | ||||
|  | ||||
|     /** | ||||
|      * 查询物料接收单 | ||||
|      * | ||||
| @ -233,7 +241,7 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean insertByBo(MatMaterialReceiveCreateReq req) { | ||||
|         String nickname = LoginHelper.getLoginUser().getNickname(); | ||||
|         String nickname = Objects.requireNonNull(LoginHelper.getLoginUser()).getNickname(); | ||||
|         MatMaterialReceive materialReceive = new MatMaterialReceive(); | ||||
|         BeanUtils.copyProperties(req, materialReceive); | ||||
|         validEntityBeforeSave(materialReceive, true); | ||||
| @ -274,11 +282,8 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv | ||||
|             } | ||||
|             //生成库存 | ||||
|             materialsService.create( | ||||
|                 materialReceive.getProjectId(), | ||||
|                 itemList, | ||||
|                 materialReceive.getFormCode(), | ||||
|                 materialReceive.getSupplierUnit(), | ||||
|                 nickname | ||||
|                 materialReceive.getProjectId(), itemList, materialReceive.getFormCode(), | ||||
|                 materialReceive.getSupplierUnit(), nickname | ||||
|             ); | ||||
|         } | ||||
|         return true; | ||||
| @ -366,12 +371,37 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean deleteByIds(Collection<Long> ids) { | ||||
|         List<MatMaterialReceive> receiveList = this.listByIds(ids); | ||||
|         List<MatMaterialReceiveItem> itemList = materialReceiveItemService.lambdaQuery() | ||||
|             .in(MatMaterialReceiveItem::getReceiveId, ids) | ||||
|             .list(); | ||||
|         if (CollUtil.isNotEmpty(itemList)) { | ||||
|             materialReceiveItemService.removeBatchByIds(itemList); | ||||
|         } | ||||
|         // 关联删除材料数据 | ||||
|         Set<String> formCode = receiveList.stream().map(MatMaterialReceive::getFormCode).collect(Collectors.toSet()); | ||||
|         List<MatMaterials> materials = materialsService.lambdaQuery() | ||||
|             .in(MatMaterials::getFormCode, formCode) | ||||
|             .list(); | ||||
|         if (CollUtil.isNotEmpty(materials)) { | ||||
|             for (MatMaterials material : materials) { | ||||
|                 List<MatMaterialsInventory> inventoryList = materialsInventoryService.lambdaQuery() | ||||
|                     .eq(MatMaterialsInventory::getMaterialsId, material.getId()) | ||||
|                     .eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue()) | ||||
|                     .list(); | ||||
|                 if (CollUtil.isNotEmpty(inventoryList)) { | ||||
|                     throw new ServiceException("存在关联的库存数据,无法删除", HttpStatus.BAD_REQUEST); | ||||
|                 } | ||||
|                 Set<Long> materialIds = materials.stream().map(MatMaterials::getId).collect(Collectors.toSet()); | ||||
|                 List<MatMaterialsInventory> allInventoryList = materialsInventoryService.lambdaQuery() | ||||
|                     .in(MatMaterialsInventory::getMaterialsId, materialIds) | ||||
|                     .list(); | ||||
|                 if (CollUtil.isNotEmpty(allInventoryList)) { | ||||
|                     materialsInventoryService.removeBatchByIds(allInventoryList); | ||||
|                 } | ||||
|             } | ||||
|             materialsService.removeBatchByIds(materials); | ||||
|         } | ||||
|         return this.removeBatchByIds(ids); | ||||
|     } | ||||
|  | ||||
| @ -484,7 +514,7 @@ public class MatMaterialReceiveServiceImpl extends ServiceImpl<MatMaterialReceiv | ||||
|      * @param reportCountFileId  报表文件id | ||||
|      * @param techDocCountFileId 技术文档文件id | ||||
|      * @param certCountFileId    证书文件id | ||||
|      * @param attachmentId | ||||
|      * @param attachmentId       附件id | ||||
|      */ | ||||
|     private void getFileSize(MatMaterialReceive materialReceive, String licenseCountFileId, | ||||
|                              String reportCountFileId, String techDocCountFileId, String certCountFileId, String attachmentId) { | ||||
|  | ||||
| @ -1,7 +1,6 @@ | ||||
| package org.dromara.materials.service.impl; | ||||
|  | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.hutool.core.collection.CollectionUtil; | ||||
| import cn.hutool.json.JSONObject; | ||||
| import cn.hutool.json.JSONUtil; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| @ -18,10 +17,7 @@ import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.json.utils.JsonUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.materials.domain.MatMaterialReceive; | ||||
| import org.dromara.materials.domain.MatMaterials; | ||||
| import org.dromara.materials.domain.MatMaterialsInventory; | ||||
| import org.dromara.materials.domain.MatMaterialsUseRecord; | ||||
| import org.dromara.materials.domain.*; | ||||
| import org.dromara.materials.domain.dto.materialreceiveitem.MatMaterialReceiveItemDto; | ||||
| import org.dromara.materials.domain.dto.materials.MatMaterialsCreateReq; | ||||
| import org.dromara.materials.domain.dto.materials.MatMaterialsGisReq; | ||||
| @ -29,10 +25,8 @@ import org.dromara.materials.domain.dto.materials.MatMaterialsQueryReq; | ||||
| import org.dromara.materials.domain.dto.materials.MatMaterialsUpdateReq; | ||||
| import org.dromara.materials.domain.dto.materialsinventory.MatMaterialsInventoryCreateReq; | ||||
| import org.dromara.materials.domain.enums.MatMaterialsInventoryOutPutEnum; | ||||
| import org.dromara.materials.domain.enums.MatMaterialsInventoryReceiveStatusEnum; | ||||
| import org.dromara.materials.domain.vo.materials.*; | ||||
| import org.dromara.materials.domain.vo.materialsinventory.MatMaterialsInventoryOutUseVo; | ||||
| import org.dromara.materials.domain.vo.materialsinventory.MatMaterialsInventoryOutVo; | ||||
| import org.dromara.materials.domain.vo.materialsinventory.MatMaterialsInventoryVo; | ||||
| import org.dromara.materials.domain.vo.materialsuserecord.MatMaterialsUseRecordByOutVo; | ||||
| import org.dromara.materials.mapper.MatMaterialsMapper; | ||||
| @ -81,6 +75,9 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|     @Resource | ||||
|     private IMatCompanyService companyService; | ||||
|  | ||||
|     @Resource | ||||
|     private IMatWarehouseService warehouseService; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 查询材料名称 | ||||
| @ -317,6 +314,7 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|         // 从对象中取值 | ||||
|         String materialsName = req.getMaterialsName(); | ||||
|         Long companyId = req.getCompanyId(); | ||||
|         Long warehouseId = req.getWarehouseId(); | ||||
|         Long projectId = req.getProjectId(); | ||||
|         String typeSpecificationName = req.getTypeSpecificationName(); | ||||
|         String weightId = req.getWeightId(); | ||||
| @ -331,7 +329,7 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|         lqw.eq(ObjectUtils.isNotEmpty(status), MatMaterials::getStatus, status); | ||||
|         lqw.eq(ObjectUtils.isNotEmpty(projectId), MatMaterials::getProjectId, projectId); | ||||
|         lqw.eq(ObjectUtils.isNotEmpty(companyId), MatMaterials::getCompanyId, companyId); | ||||
|  | ||||
|         lqw.eq(ObjectUtils.isNotEmpty(warehouseId), MatMaterials::getWarehouseId, warehouseId); | ||||
|         lqw.orderByDesc(MatMaterials::getCreateTime); | ||||
|         return lqw; | ||||
|     } | ||||
| @ -368,9 +366,10 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|      */ | ||||
|     @Async | ||||
|     @Override | ||||
|     public void create(Long projectId, List<MatMaterialReceiveItemDto> itemList, String formCode, String supplierUnit, String nickname) { | ||||
|     public void create(Long projectId, List<MatMaterialReceiveItemDto> itemList, | ||||
|                        String formCode, String supplierUnit, String nickname) { | ||||
|         for (MatMaterialReceiveItemDto item : itemList) { | ||||
|             if(item.getAcceptedQuantity().compareTo(BigDecimal.ZERO) <= 0){ | ||||
|             if (item.getAcceptedQuantity().compareTo(BigDecimal.ZERO) <= 0) { | ||||
|                 continue; | ||||
|             } | ||||
|             MatMaterials matMaterials = new MatMaterials(); | ||||
| @ -380,6 +379,7 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|             matMaterials.setWeightId(item.getUnit()); | ||||
|             matMaterials.setQuantityCount(item.getQuantity().toString()); | ||||
|             matMaterials.setFormCode(formCode); | ||||
|             matMaterials.setWarehouseId(item.getWarehouseId()); | ||||
|             save(matMaterials); | ||||
|             Long materialsId = matMaterials.getId(); | ||||
|             MatMaterialsInventoryCreateReq req = new MatMaterialsInventoryCreateReq(); | ||||
| @ -448,18 +448,6 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|             .selectLatestByMaterialIds(materialIds) | ||||
|             .stream() | ||||
|             .collect(Collectors.toMap(MatMaterialsInventory::getMaterialsId, Function.identity(), (a, b) -> a)); | ||||
|         // 查询出库记录 | ||||
|         List<MatMaterialsInventory> outList = materialsInventoryService.lambdaQuery() | ||||
|             .in(MatMaterialsInventory::getMaterialsId, materialIds) | ||||
|             .eq(MatMaterialsInventory::getOutPut, MatMaterialsInventoryOutPutEnum.OUT.getValue()) | ||||
|             .eq(MatMaterialsInventory::getIsReceive, MatMaterialsInventoryReceiveStatusEnum.NOT.getValue()) | ||||
|             .list(); | ||||
|         Map<Long, List<MatMaterialsInventory>> outMap = new HashMap<>(); | ||||
|         if (CollUtil.isNotEmpty(outList)) { | ||||
|             outMap = outList.stream() | ||||
|                 .collect(Collectors.groupingBy(MatMaterialsInventory::getMaterialsId)); | ||||
|         } | ||||
|         Map<Long, List<MatMaterialsInventory>> finalOutMap = outMap; | ||||
|         // 按 formCode 分组 | ||||
|         Map<String, List<MatMaterials>> formCodeMap = materials.stream() | ||||
|             .collect(Collectors.groupingBy(MatMaterials::getFormCode)); | ||||
| @ -474,11 +462,18 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|         for (Map.Entry<String, List<MatMaterials>> entry : formCodeMap.entrySet()) { | ||||
|             String formCode = entry.getKey(); | ||||
|             // 过滤库存为 0 的材料 | ||||
|             List<MatMaterials> validMaterials = entry.getValue().stream() | ||||
|                 .filter(m -> { | ||||
|             List<MatMaterialsNumberVo> validMaterials = entry.getValue().stream().map(m -> { | ||||
|                     MatMaterialsNumberVo numberVo = new MatMaterialsNumberVo(); | ||||
|                     MatMaterialsInventory inv = inventoryMap.get(m.getId()); | ||||
|                     return inv != null && inv.getResidue() > 0; | ||||
|                     if (inv == null) { | ||||
|                         return null; | ||||
|                     } | ||||
|                     BeanUtils.copyProperties(m, numberVo); | ||||
|                     numberVo.setInventoryNumber(BigDecimal.valueOf(inv.getResidue())); | ||||
|                     return numberVo; | ||||
|                 }) | ||||
|                 .filter(Objects::nonNull) | ||||
|                 .filter(m -> m.getInventoryNumber().compareTo(BigDecimal.ZERO) > 0) | ||||
|                 .toList(); | ||||
|             if (CollUtil.isEmpty(validMaterials)) { | ||||
|                 continue; | ||||
| @ -490,29 +485,7 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|             if (receive != null) { | ||||
|                 BeanUtils.copyProperties(receive, vo); | ||||
|             } | ||||
|  | ||||
|             List<MatMaterialsNumberVo> numberVos = new ArrayList<>(); | ||||
|  | ||||
|             for (MatMaterials m : validMaterials) { | ||||
|                 MatMaterialsNumberVo numberVo = new MatMaterialsNumberVo(); | ||||
|                 BeanUtils.copyProperties(m, numberVo); | ||||
|                 MatMaterialsInventory inv = inventoryMap.get(m.getId()); | ||||
|                 if (inv != null) { | ||||
|                     numberVo.setInventoryNumber(BigDecimal.valueOf(inv.getNumber())); | ||||
|                 } | ||||
|                 if (CollUtil.isNotEmpty(finalOutMap) && finalOutMap.containsKey(m.getId())) { | ||||
|                     List<MatMaterialsInventory> outs = finalOutMap.get(m.getId()); | ||||
|                     numberVo.setOutList(outs.stream().map(out -> { | ||||
|                         MatMaterialsInventoryOutVo outVo = new MatMaterialsInventoryOutVo(); | ||||
|                         BeanUtils.copyProperties(out, outVo); | ||||
|                         return outVo; | ||||
|                     }).toList()); | ||||
|                 } | ||||
|                 if(CollectionUtil.isNotEmpty(numberVo.getOutList())){ | ||||
|                     numberVos.add(numberVo); | ||||
|                 } | ||||
|             } | ||||
|             vo.setMaterials(numberVos); | ||||
|             vo.setMaterials(validMaterials); | ||||
|             resultList.add(vo); | ||||
|         } | ||||
|         return resultList; | ||||
| @ -641,7 +614,15 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|                 .in(MatMaterialsUseRecord::getInventoryId, outIds) | ||||
|                 .list(); | ||||
|         } | ||||
|         List<MatMaterialsUseDetailVo> useDetailList = this.getUseDetailList(materialsList, putList, outList, useList); | ||||
|         // 查询仓库列表 | ||||
|         Set<Long> warehouseIds = materialsList.stream().map(MatMaterials::getWarehouseId).collect(Collectors.toSet()); | ||||
|         List<MatWarehouse> warehouseList = new ArrayList<>(); | ||||
|         if (CollUtil.isNotEmpty(warehouseIds)) { | ||||
|             warehouseList = warehouseService.lambdaQuery() | ||||
|                 .in(MatWarehouse::getId, warehouseIds) | ||||
|                 .list(); | ||||
|         } | ||||
|         List<MatMaterialsUseDetailVo> useDetailList = this.getUseDetailList(materialsList, putList, outList, useList, warehouseList); | ||||
|         materialsVoPage.setRecords(useDetailList); | ||||
|         return TableDataInfo.build(materialsVoPage); | ||||
|     } | ||||
| @ -653,13 +634,15 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|      * @param putList       材料入库列表 | ||||
|      * @param outList       材料出库列表 | ||||
|      * @param useList       材料使用列表 | ||||
|      * @param warehouseList 仓库列表 | ||||
|      * @return 材料使用详情列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<MatMaterialsUseDetailVo> getUseDetailList(List<MatMaterials> materials, | ||||
|                                                           List<MatMaterialsInventory> putList, | ||||
|                                                           List<MatMaterialsInventory> outList, | ||||
|                                                           List<MatMaterialsUseRecord> useList) { | ||||
|                                                           List<MatMaterialsUseRecord> useList, | ||||
|                                                           List<MatWarehouse> warehouseList) { | ||||
|         Map<Long, MatMaterialsInventory> putMap = putList.stream() | ||||
|             .collect(Collectors.toMap(MatMaterialsInventory::getMaterialsId, inventory -> inventory, | ||||
|                 (existing, replacement) -> replacement)); | ||||
| @ -668,11 +651,13 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|             BeanUtils.copyProperties(material, vo); | ||||
|             Long id = material.getId(); | ||||
|             MatMaterialsInventory put = putMap.get(id); | ||||
|             if (put != null) { | ||||
|                 vo.setSupplier(put.getRecipient()); | ||||
|                 vo.setInventoryId(put.getId()); | ||||
|                 vo.setNumber(put.getNumber()); | ||||
|                 vo.setOperator(put.getOperator()); | ||||
|                 vo.setEnterTime(put.getCreateTime()); | ||||
|             } | ||||
|             if (CollUtil.isNotEmpty(outList)) { | ||||
|                 List<MatMaterialsInventory> outs = outList.stream() | ||||
|                     .filter(inventory -> inventory.getMaterialsId().equals(id)) | ||||
| @ -698,6 +683,15 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat | ||||
|                 } | ||||
|  | ||||
|             } | ||||
|             // 获取仓库名称 | ||||
|             Long warehouseId = material.getWarehouseId(); | ||||
|             if (CollUtil.isNotEmpty(warehouseList) && warehouseId != null) { | ||||
|                 MatWarehouse warehouse = warehouseList.stream() | ||||
|                     .filter(w -> w.getId().equals(warehouseId)) | ||||
|                     .findFirst() | ||||
|                     .orElse(null); | ||||
|                 vo.setWarehouseName(warehouse != null ? warehouse.getWarehouseName() : null); | ||||
|             } | ||||
|             return vo; | ||||
|         }).toList(); | ||||
|     } | ||||
|  | ||||
| @ -0,0 +1,140 @@ | ||||
| package org.dromara.materials.service.impl; | ||||
|  | ||||
| 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 lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.materials.domain.MatWarehouse; | ||||
| import org.dromara.materials.domain.bo.MatWarehouseBo; | ||||
| import org.dromara.materials.domain.vo.MatWarehouseVo; | ||||
| import org.dromara.materials.mapper.MatWarehouseMapper; | ||||
| import org.dromara.materials.service.IMatWarehouseService; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * 物资仓库Service业务层处理 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-29 | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| public class MatWarehouseServiceImpl extends ServiceImpl<MatWarehouseMapper, MatWarehouse> | ||||
|     implements IMatWarehouseService { | ||||
|  | ||||
|     /** | ||||
|      * 查询物资仓库 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 物资仓库 | ||||
|      */ | ||||
|     @Override | ||||
|     public MatWarehouseVo queryById(Long id) { | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页查询物资仓库列表 | ||||
|      * | ||||
|      * @param bo        查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 物资仓库分页列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public TableDataInfo<MatWarehouseVo> queryPageList(MatWarehouseBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<MatWarehouse> lqw = buildQueryWrapper(bo); | ||||
|         Page<MatWarehouseVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的物资仓库列表 | ||||
|      * | ||||
|      * @param bo 查询条件 | ||||
|      * @return 物资仓库列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<MatWarehouseVo> queryList(MatWarehouseBo bo) { | ||||
|         LambdaQueryWrapper<MatWarehouse> lqw = buildQueryWrapper(bo); | ||||
|         return baseMapper.selectVoList(lqw); | ||||
|     } | ||||
|  | ||||
|     private LambdaQueryWrapper<MatWarehouse> buildQueryWrapper(MatWarehouseBo bo) { | ||||
|         Map<String, Object> params = bo.getParams(); | ||||
|         LambdaQueryWrapper<MatWarehouse> lqw = Wrappers.lambdaQuery(); | ||||
|         lqw.orderByDesc(MatWarehouse::getId); | ||||
|         lqw.eq(bo.getProjectId() != null, MatWarehouse::getProjectId, bo.getProjectId()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getWarehouseCode()), MatWarehouse::getWarehouseCode, bo.getWarehouseCode()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getWarehouseName()), MatWarehouse::getWarehouseName, bo.getWarehouseName()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getWarehouseType()), MatWarehouse::getWarehouseType, bo.getWarehouseType()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getAddress()), MatWarehouse::getAddress, bo.getAddress()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getLng()), MatWarehouse::getLng, bo.getLng()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getLat()), MatWarehouse::getLat, bo.getLat()); | ||||
|         lqw.eq(bo.getArea() != null, MatWarehouse::getArea, bo.getArea()); | ||||
|         lqw.eq(bo.getCapacity() != null, MatWarehouse::getCapacity, bo.getCapacity()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getManager()), MatWarehouse::getManager, bo.getManager()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getManagerPhone()), MatWarehouse::getManagerPhone, bo.getManagerPhone()); | ||||
|         return lqw; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增物资仓库 | ||||
|      * | ||||
|      * @param bo 物资仓库 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean insertByBo(MatWarehouseBo bo) { | ||||
|         MatWarehouse add = MapstructUtils.convert(bo, MatWarehouse.class); | ||||
|         validEntityBeforeSave(add); | ||||
|         boolean flag = baseMapper.insert(add) > 0; | ||||
|         if (flag) { | ||||
|             bo.setId(add.getId()); | ||||
|         } | ||||
|         return flag; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改物资仓库 | ||||
|      * | ||||
|      * @param bo 物资仓库 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean updateByBo(MatWarehouseBo bo) { | ||||
|         MatWarehouse update = MapstructUtils.convert(bo, MatWarehouse.class); | ||||
|         validEntityBeforeSave(update); | ||||
|         return baseMapper.updateById(update) > 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(MatWarehouse entity) { | ||||
|         //TODO 做一些数据校验,如唯一约束 | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除物资仓库信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         if (isValid) { | ||||
|             //TODO 做一些业务上的校验,判断是否需要校验 | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
| } | ||||
| @ -5,6 +5,8 @@ import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.web.socket.server.standard.ServerEndpointExporter; | ||||
|  | ||||
| import java.util.stream.Stream; | ||||
|  | ||||
|  | ||||
| //@Configuration | ||||
| public class WebSocketConfig { | ||||
|  | ||||
| @ -31,9 +31,11 @@ import org.dromara.other.domain.vo.ys7deviceimg.OthYs7DeviceImgVo; | ||||
| import org.dromara.other.mapper.OthYs7DeviceImgMapper; | ||||
| import org.dromara.other.service.IOthYs7DeviceImgService; | ||||
| import org.dromara.other.service.IOthYs7DeviceService; | ||||
| import org.dromara.safety.domain.HseViolationLevel; | ||||
| import org.dromara.safety.domain.dto.recognizerecord.HseRecognizeRecordCreateDto; | ||||
| import org.dromara.safety.domain.enums.HseRecordCategoryEnum; | ||||
| import org.dromara.safety.service.IHseRecognizeRecordService; | ||||
| import org.dromara.safety.service.IHseViolationLevelService; | ||||
| import org.dromara.system.domain.vo.SysOssUploadVo; | ||||
| import org.dromara.system.service.ISysOssService; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| @ -45,6 +47,7 @@ import java.time.LocalDate; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.ZoneId; | ||||
| import java.util.*; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| /** | ||||
|  * 萤石摄像头图片Service业务层处理 | ||||
| @ -66,6 +69,9 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe | ||||
|     @Resource | ||||
|     private IHseRecognizeRecordService recognizeRecordService; | ||||
|  | ||||
|     @Resource | ||||
|     private IHseViolationLevelService violationLevelService; | ||||
|  | ||||
|     @Resource | ||||
|     private IOthYs7DeviceService ys7DeviceService; | ||||
|  | ||||
| @ -206,6 +212,33 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe | ||||
|     public void saveCapturePic(List<OthYs7DeviceImgCreateByCapture> imgList) { | ||||
|         List<OthYs7DeviceImg> saveList = new ArrayList<>(); | ||||
|         List<HseRecognizeRecordCreateDto> recordList = new ArrayList<>(); | ||||
|         // 获取项目id | ||||
|         Set<Long> projectIds = imgList.stream().map(OthYs7DeviceImgCreateByCapture::getProjectId).collect(Collectors.toSet()); | ||||
|         // 获取安全等级设置 | ||||
|         List<HseViolationLevel> levelList = violationLevelService.lambdaQuery() | ||||
|             .in(HseViolationLevel::getProjectId, projectIds) | ||||
|             .list(); | ||||
|         if (CollUtil.isEmpty(levelList)) { | ||||
|             log.error("未设置安全等级"); | ||||
|             return; | ||||
|         } | ||||
|         Map<Long, List<RecognizerTypeEnum>> level = new HashMap<>(); | ||||
|         Map<Long, List<HseViolationLevel>> levelMap = levelList.stream() | ||||
|             .collect(Collectors.groupingBy(HseViolationLevel::getProjectId)); | ||||
|         for (Map.Entry<Long, List<HseViolationLevel>> entry : levelMap.entrySet()) { | ||||
|             List<RecognizerTypeEnum> recognizerTypeEnums = entry.getValue().stream().map(l -> { | ||||
|                     List<String> levels = StringUtils.splitList(l.getViolationType()); | ||||
|                     return RecognizerTypeEnum.listFromCodes(levels); | ||||
|                 }).filter(CollUtil::isNotEmpty) | ||||
|                 .flatMap(Collection::stream) | ||||
|                 .distinct() | ||||
|                 .toList(); | ||||
|             level.put(entry.getKey(), recognizerTypeEnums); | ||||
|         } | ||||
|         if (CollUtil.isEmpty(level)) { | ||||
|             log.error("未设置安全等级"); | ||||
|             return; | ||||
|         } | ||||
|         for (OthYs7DeviceImgCreateByCapture img : imgList) { | ||||
|             OthYs7DeviceImg othYs7DeviceImg = new OthYs7DeviceImg(); | ||||
|             String url = img.getUrl(); | ||||
| @ -220,17 +253,11 @@ public class OthYs7DeviceImgServiceImpl extends ServiceImpl<OthYs7DeviceImgMappe | ||||
|                 othYs7DeviceImg.setDeviceName(img.getDeviceName()); | ||||
|                 othYs7DeviceImg.setUrl(ossUrl); | ||||
|                 // 将抓取的图片进行识别 | ||||
| //                List<RecognizerTypeEnum> recTypes = List.of(RecognizerTypeEnum.NO_EQUIPMENT, | ||||
| //                    RecognizerTypeEnum.NO_HELMET, | ||||
| //                    RecognizerTypeEnum.NO_EQUIPMENT, | ||||
| //                    RecognizerTypeEnum.NO_VEST, | ||||
| //                    RecognizerTypeEnum.SMOKE, | ||||
| //                    RecognizerTypeEnum.FIRE); | ||||
|                 List<RecognizerTypeEnum> recTypes = List.of( | ||||
|                     RecognizerTypeEnum.COLUMN, | ||||
|                     RecognizerTypeEnum.PANEL, | ||||
|                     RecognizerTypeEnum.BRACKET, | ||||
|                     RecognizerTypeEnum.HOLE); | ||||
|                 List<RecognizerTypeEnum> recTypes = level.get(img.getProjectId()); | ||||
|                 if (CollUtil.isEmpty(recTypes)) { | ||||
|                     log.error("未设置安全等级"); | ||||
|                     continue; | ||||
|                 } | ||||
|                 RecognizeVo recognizeVo = null; | ||||
|                 try { | ||||
|                     recognizeVo = recognizerManager.recognize(ossUrl, recTypes); | ||||
|  | ||||
| @ -41,6 +41,12 @@ public class OutConstructionValueRangeVo implements Serializable { | ||||
|     @ExcelProperty(value = "项目ID") | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 第N周 | ||||
|      */ | ||||
|     @ExcelProperty(value = "第N周") | ||||
|     private int week; | ||||
|  | ||||
|     /** | ||||
|      * 开始日期 | ||||
|      */ | ||||
|  | ||||
| @ -31,15 +31,15 @@ import org.dromara.progress.service.IPgsProgressPlanDetailService; | ||||
| import org.springframework.context.annotation.Lazy; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import java.time.format.DateTimeFormatter; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.math.RoundingMode; | ||||
| import java.time.DayOfWeek; | ||||
| import java.time.LocalDate; | ||||
| import java.time.temporal.TemporalAdjusters; | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.time.temporal.WeekFields; | ||||
| import java.util.*; | ||||
|  | ||||
| /** | ||||
|  * 施工产值范围Service业务层处理 | ||||
| @ -61,6 +61,22 @@ public class OutConstructionValueRangeServiceImpl extends ServiceImpl<OutConstru | ||||
|     @Resource | ||||
|     private IPgsProgressPlanDetailService progressPlanDetailService; | ||||
|  | ||||
|     /** | ||||
|      * 获取指定日期所在的周数(根据中国周规则) | ||||
|      * | ||||
|      * @param dateStr 日期字符串(格式:yyyy-MM-dd) | ||||
|      * @return 指定日期所在的周数(1-52) | ||||
|      */ | ||||
|     public Integer getCurrentWeekOfYear(String dateStr) { | ||||
|         // 解析为 LocalDate(可根据需要调整日期格式) | ||||
|         LocalDate specifiedDate = LocalDate.parse(dateStr, DateTimeFormatter.ISO_LOCAL_DATE); | ||||
|         // 2. 定义周规则(可选,默认使用系统区域,也可指定) | ||||
|         // 示例2:中国规则(周一为第一天,第一周包含1月1日即可) | ||||
|         WeekFields chinaWeekFields = WeekFields.of(Locale.CHINA); | ||||
|         // 3. 获取指定时间在当年的周数(根据需要选择周规则) | ||||
|         return specifiedDate.get(chinaWeekFields.weekOfYear()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询施工产值范围 | ||||
|      * | ||||
| @ -87,6 +103,10 @@ public class OutConstructionValueRangeServiceImpl extends ServiceImpl<OutConstru | ||||
|     public TableDataInfo<OutConstructionValueRangeVo> queryPageList(OutConstructionValueRangeBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<OutConstructionValueRange> lqw = buildQueryWrapper(bo); | ||||
|         Page<OutConstructionValueRangeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         //增加第N周 | ||||
|         result.getRecords().forEach(item -> { | ||||
|             item.setWeek(getCurrentWeekOfYear(item.getStartDate().toString())); | ||||
|         }); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.constant.HttpStatus; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.core.exception.ServiceException; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.excel.core.DefaultExcelListener; | ||||
| import org.dromara.common.excel.utils.ExcelUtil; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| @ -39,6 +40,7 @@ import java.math.RoundingMode; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| /** | ||||
| @ -257,10 +259,20 @@ public class PgsProgressCategoryController extends BaseController { | ||||
|                 List<PgsProgressCategoryVo> list = sheetListener.getExcelResult().getList(); | ||||
|                 List<PgsProgressCategoryVo> newList = list.stream().filter(vo -> vo.getId() == null).toList(); | ||||
|                 List<PgsProgressCategoryVo> oldList = list.stream().filter(vo -> vo.getId() != null).toList(); | ||||
|                 Set<Long> ids = oldList.stream().map(PgsProgressCategoryVo::getId).collect(Collectors.toSet()); | ||||
|                 List<PgsProgressCategory> categoryList = pgsProgressCategoryService.listByIds(ids); | ||||
|                 // 筛选出关联设计图的数据 | ||||
|                 List<PgsProgressCategoryVo> oldListVo = oldList.stream().filter(vo -> { | ||||
|                     PgsProgressCategory category = categoryList.stream().filter(c -> c.getId().equals(vo.getId())).findFirst().orElse(null); | ||||
|                     if (category == null) { | ||||
|                         return true; | ||||
|                     } | ||||
|                     String workType = category.getWorkType(); | ||||
|                     return StringUtils.isBlank(workType); | ||||
|                 }).toList(); | ||||
|                 // 将当前sheet的数据添加到总数据中 | ||||
|                 allData.addAll(oldList); | ||||
|                 if (CollUtil.isNotEmpty(newList)) { | ||||
|                     if (CollUtil.isNotEmpty(oldList)) { | ||||
|                 allData.addAll(oldListVo); | ||||
|                 if (CollUtil.isNotEmpty(newList) && CollUtil.isNotEmpty(oldList)) { | ||||
|                     PgsProgressCategoryVo first = oldList.getFirst(); | ||||
|                     PgsProgressCategory category = pgsProgressCategoryService.getById(first.getId()); | ||||
|                     newList.forEach(vo -> { | ||||
| @ -273,7 +285,6 @@ public class PgsProgressCategoryController extends BaseController { | ||||
|                     allData.addAll(newList); | ||||
|                 } | ||||
|             } | ||||
|             } | ||||
|  | ||||
|             // 关闭读取器 | ||||
|             excelReader.finish(); | ||||
|  | ||||
| @ -1,10 +1,13 @@ | ||||
| package org.dromara.project.controller; | ||||
|  | ||||
| import cn.dev33.satoken.annotation.SaIgnore; | ||||
| import cn.hutool.core.date.DateUtil; | ||||
| import cn.hutool.core.io.FileUtil; | ||||
| import cn.hutool.core.util.StrUtil; | ||||
| import cn.hutool.json.JSONUtil; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.apache.commons.codec.binary.Base64; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.project.domain.BusAttendanceMachine; | ||||
| import org.dromara.project.domain.dto.attendance.*; | ||||
| @ -13,10 +16,15 @@ import org.dromara.project.service.IBusAttendanceMachineService; | ||||
| import org.dromara.project.service.IBusAttendanceService; | ||||
| import org.springframework.mock.web.MockMultipartFile; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
| import org.springframework.web.multipart.MultipartFile; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.nio.charset.StandardCharsets; | ||||
| import java.time.LocalDateTime; | ||||
| import java.time.format.DateTimeFormatter; | ||||
|  | ||||
| @ -70,6 +78,7 @@ public class BusAttendanceDeviceController extends BaseController { | ||||
|         req.setUserId(userId); | ||||
|         req.setPunchTime(localDateTime); | ||||
|         req.setSource("1"); | ||||
|         req.setSn(dto.getSn()); | ||||
|         //打印req | ||||
|         log.info("请求参数:{}", req); | ||||
|         //base64转MultipartFile | ||||
| @ -84,6 +93,43 @@ public class BusAttendanceDeviceController extends BaseController { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @PostMapping("/api/v1/recordvisit") | ||||
|     @SaIgnore | ||||
|     public DeviceResult recordvisit(@RequestBody DeviceUserInfo dto) { | ||||
|         try { | ||||
|             log.info("设备上报数据:{}", dto); | ||||
|             // 1. 将对象转为 JSON 字符串(带格式) | ||||
|             String json = JSONUtil.toJsonPrettyStr(dto); | ||||
|             log.info("JSON数据:{}", json); | ||||
|             // 2. 构建保存路径(按日期区分文件) | ||||
|             String dateStr = DateUtil.format(DateUtil.date(), "yyyyMMdd"); | ||||
|             String fileName = StrUtil.format("device_record_{}.txt", dateStr); | ||||
|  | ||||
|             // 3. 路径:项目根目录 /logs/device-data/ | ||||
|             File dir = FileUtil.mkdir("logs/device-data"); | ||||
|             File file = FileUtil.file(dir, fileName); | ||||
|  | ||||
|             // 4. 生成时间戳+分隔符 | ||||
|             String timePrefix = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss"); | ||||
|             String data = StrUtil.format( | ||||
|                 "[{}]\n{}\n{}\n", | ||||
|                 timePrefix, | ||||
|                 json, | ||||
|                 StrUtil.repeat("-", 80) | ||||
|             ); | ||||
|  | ||||
|             // 5. 追加到文件中 | ||||
|             FileUtil.appendString(data, file, StandardCharsets.UTF_8); | ||||
|  | ||||
|             log.info("✅ 设备上报数据已保存: {}", file.getAbsolutePath()); | ||||
|             return new DeviceResult(0, "保存成功"); | ||||
|  | ||||
|         } catch (Exception e) { | ||||
|             log.error("❌ 保存设备数据失败", e); | ||||
|             return new DeviceResult(-2, "保存失败:" + e.getMessage()); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public static MultipartFile convert(String base64String, String fileName) throws IOException { | ||||
|         // 先进行URL解码(如果是URL编码过的数据) | ||||
|  | ||||
| @ -118,4 +118,9 @@ public class BusAttendance extends BaseEntity { | ||||
|      * 来源 | ||||
|      */ | ||||
|     private String source; | ||||
|  | ||||
|     /** | ||||
|      * 设备序列号 | ||||
|      */ | ||||
|     private String sn; | ||||
| } | ||||
|  | ||||
| @ -53,4 +53,6 @@ public class BusAttendancePunchCardByFaceReq implements Serializable { | ||||
|      */ | ||||
|     private String source; | ||||
|  | ||||
|     private String sn; | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -0,0 +1,77 @@ | ||||
| package org.dromara.project.domain.dto.attendance; | ||||
|  | ||||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.util.Map; | ||||
|  | ||||
| @Data | ||||
| public class DeviceUserInfo { | ||||
|  | ||||
|     /** | ||||
|      * 设备序列号 | ||||
|      */ | ||||
|     @JsonProperty("dev_sn") | ||||
|     private String devSn; | ||||
|  | ||||
|     /** | ||||
|      * 用户编号 | ||||
|      */ | ||||
|     @JsonProperty("user_number") | ||||
|     private String userNumber; | ||||
|  | ||||
|     /** | ||||
|      * 用户姓名 | ||||
|      */ | ||||
|     @JsonProperty("user_name") | ||||
|     private String userName; | ||||
|  | ||||
|     @JsonProperty("user_photo") | ||||
|     private String userPhoto; | ||||
|  | ||||
|     @JsonProperty("photo") | ||||
|     private String photo; | ||||
|  | ||||
|     @JsonProperty("recog_time") | ||||
|     private Long recogTime; | ||||
|  | ||||
|     @JsonProperty("user_birthday") | ||||
|     private Long userBirthday; | ||||
|  | ||||
|     @JsonProperty("user_gender") | ||||
|     private String userGender; | ||||
|  | ||||
|     @JsonProperty("user_ethnic") | ||||
|     private String userEthnic; | ||||
|  | ||||
|     @JsonProperty("user_address") | ||||
|     private String userAddress; | ||||
|  | ||||
|     @JsonProperty("user_issue") | ||||
|     private String userIssue; | ||||
|  | ||||
|     @JsonProperty("user_valid_start") | ||||
|     private Long userValidStart; | ||||
|  | ||||
|     @JsonProperty("user_valid_end") | ||||
|     private Long userValidEnd; | ||||
|  | ||||
|     @JsonProperty("confidence") | ||||
|     private String confidence; | ||||
|  | ||||
|     @JsonProperty("body_temperature") | ||||
|     private BigDecimal bodyTemperature; | ||||
|  | ||||
|     @JsonProperty("reflectivity") | ||||
|     private Integer reflectivity; | ||||
|  | ||||
|     @JsonProperty("room_temperature") | ||||
|     private BigDecimal roomTemperature; | ||||
|  | ||||
|     @JsonProperty("health_code_color") | ||||
|     private String healthCodeColor; | ||||
|  | ||||
|     @JsonProperty("health_code_info") | ||||
|     private Map<String, Object> healthCodeInfo; | ||||
| } | ||||
| @ -333,10 +333,11 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|             } | ||||
|  | ||||
|             //打卡范围 | ||||
|             if (!"1".equals(req.getSource())){ | ||||
|                 if (!checkInRange(req)) { | ||||
|                     throw new ServiceException("打卡位置不在范围内", HttpStatus.ERROR); | ||||
|                 } | ||||
|  | ||||
|             } | ||||
|             //用户信息校验 | ||||
|             SubConstructionUser constructionUser = constructionUserService.getBySysUserId(userId); | ||||
|             if ("1".equals(constructionUser.getStatus())) { | ||||
| @ -360,7 +361,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|             try { | ||||
|                 result = constructionUserService.faceComparison(file, userId); | ||||
|             } catch (Exception e) { | ||||
|                 throw new ServiceException("人脸识别失败,请重新识别", HttpStatus.ERROR); | ||||
|                 throw new ServiceException(e.getMessage(), HttpStatus.ERROR); | ||||
|             } | ||||
|  | ||||
|             if (!result) { | ||||
| @ -419,6 +420,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|                     attendance.setReplaceId(replaceId); | ||||
|                     if(req.getSource() != null){ | ||||
|                         attendance.setSource(req.getSource()); | ||||
|                         attendance.setSn(req.getSn()); | ||||
|                     } | ||||
|                     // 记录打卡坐标 | ||||
|                     attendance.setLat(req.getLat()); | ||||
| @ -464,6 +466,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|                     } | ||||
|  | ||||
|                     busAttendance.setSource(req.getSource()); | ||||
|                     busAttendance.setSn(req.getSn()); | ||||
|                     //如果是缺卡需要上传人脸 | ||||
|                     if(oldStatus.equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())){ | ||||
|                         SysOssVo upload = ossService.upload(file); | ||||
| @ -479,6 +482,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|                     BusAttendance busAttendance = outAttendances.getFirst(); | ||||
|                     if("1".equals(req.getSource())){ | ||||
|                         busAttendance.setSource(req.getSource()); | ||||
|                         busAttendance.setSn(req.getSn()); | ||||
|                         if(busAttendance.getClockStatus().equals(BusAttendanceClockStatusEnum.UNCLOCK.getValue())){ | ||||
|                             SysOssVo upload = ossService.upload(file); | ||||
|                             busAttendance.setFacePic(upload.getOssId().toString()); | ||||
| @ -531,6 +535,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B | ||||
|                     attendance.setReplaceId(replaceId); | ||||
|                     if(req.getSource() != null){ | ||||
|                         attendance.setSource(req.getSource()); | ||||
|                         attendance.setSn(req.getSn()); | ||||
|                     } | ||||
|                     // 记录打卡坐标 | ||||
|                     attendance.setLat(req.getLat()); | ||||
|  | ||||
| @ -0,0 +1,137 @@ | ||||
| package org.dromara.vehicle.controller; | ||||
|  | ||||
| import cn.dev33.satoken.annotation.SaCheckPermission; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.excel.utils.ExcelUtil; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.vehicle.domain.dto.vehicleapply.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
| import org.dromara.vehicle.service.IVehVehicleApplyService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Validated | ||||
| @RequiredArgsConstructor | ||||
| @RestController | ||||
| @RequestMapping("/vehicle/vehicleApply") | ||||
| public class VehVehicleApplyController extends BaseController { | ||||
|  | ||||
|     private final IVehVehicleApplyService vehVehicleApplyService; | ||||
|  | ||||
|     /** | ||||
|      * 查询乘车申请列表 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:list") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<VehVehicleApplyVo> list(VehVehicleApplyQueryReq req, PageQuery pageQuery) { | ||||
|         return vehVehicleApplyService.queryPageList(req, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 导出乘车申请列表 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:export") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.EXPORT) | ||||
|     @PostMapping("/export") | ||||
|     public void export(VehVehicleApplyQueryReq req, HttpServletResponse response) { | ||||
|         List<VehVehicleApplyVo> list = vehVehicleApplyService.queryList(req); | ||||
|         ExcelUtil.exportExcel(list, "乘车申请", VehVehicleApplyVo.class, response); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取乘车申请详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:query") | ||||
|     @GetMapping("/{id}") | ||||
|     public R<VehVehicleApplyVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                         @PathVariable Long id) { | ||||
|         return R.ok(vehVehicleApplyService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增乘车申请 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:add") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated @RequestBody VehVehicleApplyCreateReq req) { | ||||
|         return toAjax(vehVehicleApplyService.insertByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车申请 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:edit") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated @RequestBody VehVehicleApplyUpdateReq req) { | ||||
|         return toAjax(vehVehicleApplyService.updateByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 车主审核 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:edit") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/driverReview") | ||||
|     public R<Void> driverReview(@Validated @RequestBody VehVehicleApplyReviewReq req) { | ||||
|         return toAjax(vehVehicleApplyService.driverReview(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 乘客确认上车状态 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:edit") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/changeStatus") | ||||
|     public R<Void> changeStatus(@Validated @RequestBody VehVehicleApplyChangeStatusReq req) { | ||||
|         return toAjax(vehVehicleApplyService.changeStatus(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 乘客取消申请 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:edit") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/cancel") | ||||
|     public R<Void> cancel(@Validated @RequestBody VehVehicleApplyCancelReq req) { | ||||
|         return toAjax(vehVehicleApplyService.cancelApply(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除乘车申请 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleApply:remove") | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(vehVehicleApplyService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,136 @@ | ||||
| package org.dromara.vehicle.controller; | ||||
|  | ||||
| import cn.dev33.satoken.annotation.SaCheckPermission; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.excel.utils.ExcelUtil; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.vehicle.domain.dto.vehicletrip.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripMyVo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripVo; | ||||
| import org.dromara.vehicle.service.IVehVehicleTripService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Validated | ||||
| @RequiredArgsConstructor | ||||
| @RestController | ||||
| @RequestMapping("/vehicle/vehicleTrip") | ||||
| public class VehVehicleTripController extends BaseController { | ||||
|  | ||||
|     private final IVehVehicleTripService vehVehicleTripService; | ||||
|  | ||||
|     /** | ||||
|      * 查询车辆出行记录列表 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:list") | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<VehVehicleTripVo> list(VehVehicleTripQueryReq req, PageQuery pageQuery) { | ||||
|         return vehVehicleTripService.queryPageList(req, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:list") | ||||
|     @GetMapping("/myList") | ||||
|     public R<List<VehVehicleTripMyVo>> queryMyList(VehVehicleTripMyQueryReq req) { | ||||
|         return R.ok(vehVehicleTripService.queryMyList(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 导出车辆出行记录列表 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:export") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.EXPORT) | ||||
|     @PostMapping("/export") | ||||
|     public void export(VehVehicleTripQueryReq req, HttpServletResponse response) { | ||||
|         List<VehVehicleTripVo> list = vehVehicleTripService.queryList(req); | ||||
|         ExcelUtil.exportExcel(list, "车辆出行记录", VehVehicleTripVo.class, response); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取车辆出行记录详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:query") | ||||
|     @GetMapping("/{id}") | ||||
|     public R<VehVehicleTripVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                        @PathVariable Long id) { | ||||
|         return R.ok(vehVehicleTripService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增车辆出行记录 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:add") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated @RequestBody VehVehicleTripCreateReq req) { | ||||
|         return toAjax(vehVehicleTripService.insertByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:edit") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated @RequestBody VehVehicleTripUpdateReq req) { | ||||
|         return toAjax(vehVehicleTripService.updateByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录状态 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:edit") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/changeStatus") | ||||
|     public R<Void> changeStatus(@Validated @RequestBody VehVehicleTripChangeStatusReq req) { | ||||
|         return toAjax(vehVehicleTripService.changeStatus(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 取消车辆出行记录 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:edit") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/cancel") | ||||
|     public R<Void> cancel(@Validated @RequestBody VehVehicleTripCancelReq req) { | ||||
|         return toAjax(vehVehicleTripService.cancel(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除车辆出行记录 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @SaCheckPermission("vehicle:vehicleTrip:remove") | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(vehVehicleTripService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,115 @@ | ||||
| package org.dromara.vehicle.controller.app; | ||||
|  | ||||
| import jakarta.annotation.Resource; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.vehicle.domain.dto.vehicleapply.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
| import org.dromara.vehicle.service.IVehVehicleApplyService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请 app 接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 10:16 | ||||
|  */ | ||||
| @Validated | ||||
| @RestController | ||||
| @RequestMapping("/app/vehicle/vehicleApply") | ||||
| public class VehVehicleApplyAppController extends BaseController { | ||||
|  | ||||
|     @Resource | ||||
|     private IVehVehicleApplyService vehicleApplyService; | ||||
|  | ||||
|     /** | ||||
|      * 查询乘车申请列表 | ||||
|      */ | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<VehVehicleApplyVo> list(VehVehicleApplyQueryReq req, PageQuery pageQuery) { | ||||
|         return vehicleApplyService.queryPageList(req, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取乘车申请详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @GetMapping("/{id}") | ||||
|     public R<VehVehicleApplyVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                         @PathVariable Long id) { | ||||
|         return R.ok(vehicleApplyService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增乘车申请 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated @RequestBody VehVehicleApplyCreateReq req) { | ||||
|         return toAjax(vehicleApplyService.insertByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车申请 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated @RequestBody VehVehicleApplyUpdateReq req) { | ||||
|         return toAjax(vehicleApplyService.updateByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 车主审核 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/driverReview") | ||||
|     public R<Void> driverReview(@Validated @RequestBody VehVehicleApplyReviewReq req) { | ||||
|         return toAjax(vehicleApplyService.driverReview(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 乘客确认上车状态 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/changeStatus") | ||||
|     public R<Void> changeStatus(@Validated @RequestBody VehVehicleApplyChangeStatusReq req) { | ||||
|         return toAjax(vehicleApplyService.changeStatus(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 乘客取消申请 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/cancel") | ||||
|     public R<Void> cancel(@Validated @RequestBody VehVehicleApplyCancelReq req) { | ||||
|         return toAjax(vehicleApplyService.cancelApply(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除乘车申请 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @Log(title = "乘车申请", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(vehicleApplyService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,85 @@ | ||||
| package org.dromara.vehicle.controller.app; | ||||
|  | ||||
| import jakarta.annotation.Resource; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.core.validate.AddGroup; | ||||
| import org.dromara.common.core.validate.EditGroup; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.vehicle.domain.bo.VehVehicleInfoBo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleInfoVo; | ||||
| import org.dromara.vehicle.service.IVehVehicleInfoService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-30 11:51 | ||||
|  */ | ||||
| @Validated | ||||
| @RestController | ||||
| @RequestMapping("/app/vehicle/vehicleInfo") | ||||
| public class VehVehicleInfoAppController extends BaseController { | ||||
|  | ||||
|     @Resource | ||||
|     private IVehVehicleInfoService vehicleInfoService; | ||||
|  | ||||
|     /** | ||||
|      * 查询车辆信息列表 | ||||
|      */ | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<VehVehicleInfoVo> list(VehVehicleInfoBo bo, PageQuery pageQuery) { | ||||
|         return vehicleInfoService.queryPageList(bo, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取车辆信息详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @GetMapping("/{id}") | ||||
|     public R<VehVehicleInfoVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                        @PathVariable Long id) { | ||||
|         return R.ok(vehicleInfoService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增车辆信息 | ||||
|      */ | ||||
|     @Log(title = "车辆信息", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated(AddGroup.class) @RequestBody VehVehicleInfoBo bo) { | ||||
|         return toAjax(vehicleInfoService.insertByBo(bo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆信息 | ||||
|      */ | ||||
|     @Log(title = "车辆信息", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated(EditGroup.class) @RequestBody VehVehicleInfoBo bo) { | ||||
|         return toAjax(vehicleInfoService.updateByBo(bo)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除车辆信息 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @Log(title = "车辆信息", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(vehicleInfoService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,114 @@ | ||||
| package org.dromara.vehicle.controller.app; | ||||
|  | ||||
| import jakarta.annotation.Resource; | ||||
| import jakarta.validation.constraints.NotEmpty; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import org.dromara.common.core.domain.R; | ||||
| import org.dromara.common.idempotent.annotation.RepeatSubmit; | ||||
| import org.dromara.common.log.annotation.Log; | ||||
| import org.dromara.common.log.enums.BusinessType; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.web.core.BaseController; | ||||
| import org.dromara.vehicle.domain.dto.vehicletrip.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripMyVo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripVo; | ||||
| import org.dromara.vehicle.service.IVehVehicleTripService; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录 app 接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 10:19 | ||||
|  */ | ||||
| @Validated | ||||
| @RestController | ||||
| @RequestMapping("/app/vehicle/vehicleTrip") | ||||
| public class VehVehicleTripAppController extends BaseController { | ||||
|  | ||||
|     @Resource | ||||
|     private IVehVehicleTripService vehicleTripService; | ||||
|  | ||||
|     /** | ||||
|      * 查询车辆出行记录列表 | ||||
|      */ | ||||
|     @GetMapping("/list") | ||||
|     public TableDataInfo<VehVehicleTripVo> list(VehVehicleTripQueryReq req, PageQuery pageQuery) { | ||||
|         return vehicleTripService.queryPageList(req, pageQuery); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     @GetMapping("/myList") | ||||
|     public R<List<VehVehicleTripMyVo>> queryMyList(VehVehicleTripMyQueryReq req) { | ||||
|         return R.ok(vehicleTripService.queryMyAppList(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 获取车辆出行记录详细信息 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      */ | ||||
|     @GetMapping("/{id}") | ||||
|     public R<VehVehicleTripVo> getInfo(@NotNull(message = "主键不能为空") | ||||
|                                        @PathVariable Long id) { | ||||
|         return R.ok(vehicleTripService.queryById(id)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增车辆出行记录 | ||||
|      */ | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.INSERT) | ||||
|     @RepeatSubmit() | ||||
|     @PostMapping() | ||||
|     public R<Void> add(@Validated @RequestBody VehVehicleTripCreateReq req) { | ||||
|         return toAjax(vehicleTripService.insertByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录 | ||||
|      */ | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping() | ||||
|     public R<Void> edit(@Validated @RequestBody VehVehicleTripUpdateReq req) { | ||||
|         return toAjax(vehicleTripService.updateByBo(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录状态 | ||||
|      */ | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/changeStatus") | ||||
|     public R<Void> changeStatus(@Validated @RequestBody VehVehicleTripChangeStatusReq req) { | ||||
|         return toAjax(vehicleTripService.changeStatus(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 取消车辆出行记录 | ||||
|      */ | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.UPDATE) | ||||
|     @RepeatSubmit() | ||||
|     @PutMapping("/cancel") | ||||
|     public R<Void> cancel(@Validated @RequestBody VehVehicleTripCancelReq req) { | ||||
|         return toAjax(vehicleTripService.cancel(req)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除车辆出行记录 | ||||
|      * | ||||
|      * @param ids 主键串 | ||||
|      */ | ||||
|     @Log(title = "车辆出行记录", businessType = BusinessType.DELETE) | ||||
|     @DeleteMapping("/{ids}") | ||||
|     public R<Void> remove(@NotEmpty(message = "主键不能为空") | ||||
|                           @PathVariable Long[] ids) { | ||||
|         return toAjax(vehicleTripService.deleteWithValidByIds(List.of(ids), true)); | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,91 @@ | ||||
| package org.dromara.vehicle.domain; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
|  | ||||
| import java.io.Serial; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请对象 veh_vehicle_apply | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @TableName("veh_vehicle_apply") | ||||
| public class VehVehicleApply extends BaseEntity { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @TableId(value = "id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 关联行程ID | ||||
|      */ | ||||
|     private Long tripId; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 乘车状态 | ||||
|      */ | ||||
|     private String status; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @ -1,12 +1,13 @@ | ||||
| package org.dromara.vehicle.domain; | ||||
|  | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
| import com.baomidou.mybatisplus.annotation.*; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import java.math.BigDecimal; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDate; | ||||
|  | ||||
| /** | ||||
| @ -144,5 +145,4 @@ public class VehVehicleInfo extends BaseEntity { | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -0,0 +1,122 @@ | ||||
| package org.dromara.vehicle.domain; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.dromara.common.mybatis.core.domain.BaseEntity; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录对象 veh_vehicle_trip | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @TableName("veh_vehicle_trip") | ||||
| public class VehVehicleTrip extends BaseEntity { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @TableId(value = "id") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 车辆ID | ||||
|      */ | ||||
|     private Long vehicleId; | ||||
|  | ||||
|     /** | ||||
|      * 车牌号 | ||||
|      */ | ||||
|     private String plateNumber; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出行事由 | ||||
|      */ | ||||
|     private String tripReason; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     private Date startTime; | ||||
|  | ||||
|     /** | ||||
|      * 计划到达时间 | ||||
|      */ | ||||
|     private Date endTime; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 剩余座位数 | ||||
|      */ | ||||
|     private Integer leftSeat; | ||||
|  | ||||
|     /** | ||||
|      * 审核状态 | ||||
|      */ | ||||
|     private String reviewStatus; | ||||
|  | ||||
|     /** | ||||
|      * 状态 | ||||
|      */ | ||||
|     private String tripStatus; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 09:22 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyCancelReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -3178638460132028254L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 09:24 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyChangeStatusReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -7509344474542508076L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 乘车状态 | ||||
|      */ | ||||
|     @NotBlank(message = "乘车状态不能为空") | ||||
|     private String status; | ||||
| } | ||||
| @ -0,0 +1,80 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 14:15 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyCreateReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1199219811382958686L; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     @NotNull(message = "项目ID不能为空") | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 关联行程ID | ||||
|      */ | ||||
|     @NotNull(message = "关联行程ID不能为空") | ||||
|     private Long tripId; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     @NotNull(message = "申请人数不能为空") | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地不能为空") | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地经度不能为空") | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地纬度不能为空") | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
| } | ||||
| @ -0,0 +1,52 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 14:48 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyQueryReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -7148064523789231728L; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 关联行程ID | ||||
|      */ | ||||
|     private Long tripId; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 乘车状态 | ||||
|      */ | ||||
|     private String status; | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 15:00 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyReviewReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -5881272503469997069L; | ||||
|  | ||||
|     /** | ||||
|      * 主键 | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 乘车状态 | ||||
|      */ | ||||
|     @NotBlank(message = "乘车状态不能为空") | ||||
|     private String status; | ||||
| } | ||||
| @ -0,0 +1,69 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicleapply; | ||||
|  | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 15:30 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleApplyUpdateReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 7272254511495824388L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
| } | ||||
| @ -0,0 +1,24 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 09:22 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripCancelReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 7690656986769836247L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 18:47 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripChangeStatusReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -1139979225623034249L; | ||||
|  | ||||
|     /** | ||||
|      * 主键 | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 状态 | ||||
|      */ | ||||
|     @NotBlank(message = "状态不能为空") | ||||
|     private String tripStatus; | ||||
| } | ||||
| @ -0,0 +1,109 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 10:05 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripCreateReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 7691668678158594767L; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 车辆ID | ||||
|      */ | ||||
|     private Long vehicleId; | ||||
|  | ||||
|     /** | ||||
|      * 车牌号 | ||||
|      */ | ||||
|     private String plateNumber; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出行事由 | ||||
|      */ | ||||
|     private String tripReason; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     @NotBlank(message = "出发地不能为空") | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地不能为空") | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     @NotBlank(message = "出发地经度不能为空") | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     @NotBlank(message = "出发地纬度不能为空") | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地经度不能为空") | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     @NotBlank(message = "目的地纬度不能为空") | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     @NotNull(message = "计划出发时间不能为空") | ||||
|     private Date startTime; | ||||
|  | ||||
|     /** | ||||
|      * 计划到达时间 | ||||
|      */ | ||||
|     private Date endTime; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     @NotNull(message = "申请人数不能为空") | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 剩余座位数 | ||||
|      */ | ||||
|     @NotNull(message = "剩余座位数不能为空") | ||||
|     private Integer leftSeat; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
| } | ||||
| @ -0,0 +1,26 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import jakarta.validation.constraints.NotBlank; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 16:53 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripMyQueryReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 4251601419123102085L; | ||||
|  | ||||
|     /** | ||||
|      * 查询类型 | ||||
|      * web(1待出行 2预约中 3已完成) | ||||
|      * app(0待出行 1进行中 2预约中 3已完成) | ||||
|      */ | ||||
|     @NotBlank(message = "查询类型不能为空") | ||||
|     private String type; | ||||
| } | ||||
| @ -0,0 +1,59 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 19:40 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripQueryReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = -7795154504461471208L; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     private LocalDateTime startTime; | ||||
|  | ||||
|     /** | ||||
|      * 出行人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 审核状态 | ||||
|      */ | ||||
|     private String reviewStatus; | ||||
|  | ||||
|     /** | ||||
|      * 状态 | ||||
|      */ | ||||
|     private String tripStatus; | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,105 @@ | ||||
| package org.dromara.vehicle.domain.dto.vehicletrip; | ||||
|  | ||||
| import jakarta.validation.constraints.NotNull; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 11:33 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripUpdateReq implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 3855392201273235078L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @NotNull(message = "主键不能为空") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 车辆ID | ||||
|      */ | ||||
|     private Long vehicleId; | ||||
|  | ||||
|     /** | ||||
|      * 车牌号 | ||||
|      */ | ||||
|     private String plateNumber; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出行事由 | ||||
|      */ | ||||
|     private String tripReason; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     private Date startTime; | ||||
|  | ||||
|     /** | ||||
|      * 计划到达时间 | ||||
|      */ | ||||
|     private Date endTime; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 剩余座位数 | ||||
|      */ | ||||
|     private Integer leftSeat; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
| } | ||||
| @ -0,0 +1,27 @@ | ||||
| package org.dromara.vehicle.domain.enums; | ||||
|  | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 09:39 | ||||
|  */ | ||||
| @Getter | ||||
| public enum VehApplyStatusEnum { | ||||
|  | ||||
|     APPLYING("申请中", "1"), | ||||
|     CONFIRMED("已确认", "2"), | ||||
|     REJECTED("已拒绝", "3"), | ||||
|     ALREADY("已上车", "4"), | ||||
|     ARRIVED("已到达", "5"), | ||||
|     CANCELED("已取消", "6"); | ||||
|  | ||||
|     private final String text; | ||||
|  | ||||
|     private final String value; | ||||
|  | ||||
|     VehApplyStatusEnum(String text, String value) { | ||||
|         this.text = text; | ||||
|         this.value = value; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,25 @@ | ||||
| package org.dromara.vehicle.domain.enums; | ||||
|  | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 09:32 | ||||
|  */ | ||||
| @Getter | ||||
| public enum VehTripStatusEnum { | ||||
|  | ||||
|     READY_DEPART("待出发","1"), | ||||
|     UNDERWAY("进行中","2"), | ||||
|     COMPLETED("已完成","3"), | ||||
|     CANCELED("已取消","4" ); | ||||
|  | ||||
|     private final String text; | ||||
|  | ||||
|     private final String value; | ||||
|  | ||||
|     VehTripStatusEnum(String text, String value) { | ||||
|         this.text = text; | ||||
|         this.value = value; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,25 @@ | ||||
| package org.dromara.vehicle.domain.enums; | ||||
|  | ||||
| import lombok.Getter; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-27 11:42 | ||||
|  */ | ||||
| @Getter | ||||
| public enum VehVehicleInfoStatusEnum { | ||||
|  | ||||
|     AVAILABLE("可用", "1"), | ||||
|     IN_USE("使用中", "2"), | ||||
|     UNDER_MAINTENANCE("维护中", "3"), | ||||
|     DISABLE("停用", "4"); | ||||
|  | ||||
|     private final String text; | ||||
|  | ||||
|     private final String value; | ||||
|  | ||||
|     VehVehicleInfoStatusEnum(String text, String value) { | ||||
|         this.text = text; | ||||
|         this.value = value; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,127 @@ | ||||
| package org.dromara.vehicle.domain.vo; | ||||
|  | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import org.dromara.common.translation.annotation.Translation; | ||||
| import org.dromara.common.translation.constant.TransConstant; | ||||
| import org.dromara.vehicle.domain.VehVehicleApply; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 乘车申请视图对象 veh_vehicle_apply | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| @AutoMapper(target = VehVehicleApply.class) | ||||
| public class VehVehicleApplyVo implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "主键ID") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目ID") | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 关联行程ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "关联行程ID") | ||||
|     private Long tripId; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     @ExcelProperty(value = "申请人数") | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     @ExcelProperty(value = "联系电话") | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地") | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地") | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地经度") | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地纬度") | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地经度") | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地纬度") | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 乘车状态 | ||||
|      */ | ||||
|     @ExcelProperty(value = "乘车状态", converter = ExcelDictConvert.class) | ||||
|     @ExcelDictFormat(dictType = "veh_vehicle_apply_status") | ||||
|     private String status; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     @ExcelProperty(value = "备注") | ||||
|     private String remark; | ||||
|  | ||||
|     /** | ||||
|      * 创建者 | ||||
|      */ | ||||
|     private Long createBy; | ||||
|  | ||||
|     /** | ||||
|      * 创建者名称 | ||||
|      */ | ||||
|     @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") | ||||
|     private String createByName; | ||||
|  | ||||
|     /** | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     private Date createTime; | ||||
|  | ||||
| } | ||||
| @ -1,19 +1,17 @@ | ||||
| package org.dromara.vehicle.domain.vo; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import org.dromara.vehicle.domain.VehVehicleInfo; | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import org.dromara.vehicle.domain.VehVehicleInfo; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDate; | ||||
| import java.util.Date; | ||||
|  | ||||
|  | ||||
|  | ||||
| /** | ||||
|  | ||||
| @ -0,0 +1,142 @@ | ||||
| package org.dromara.vehicle.domain.vo; | ||||
|  | ||||
| import lombok.Data; | ||||
| import org.dromara.common.translation.annotation.Translation; | ||||
| import org.dromara.common.translation.constant.TransConstant; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-28 16:45 | ||||
|  */ | ||||
| @Data | ||||
| public class VehVehicleTripMyVo implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 8905520529338036288L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 车辆ID | ||||
|      */ | ||||
|     private Long vehicleId; | ||||
|  | ||||
|     /** | ||||
|      * 车牌号 | ||||
|      */ | ||||
|     private String plateNumber; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出行事由 | ||||
|      */ | ||||
|     private String tripReason; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     private Date startTime; | ||||
|  | ||||
|     /** | ||||
|      * 计划到达时间 | ||||
|      */ | ||||
|     private Date endTime; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 剩余座位数 | ||||
|      */ | ||||
|     private Integer leftSeat; | ||||
|  | ||||
|     /** | ||||
|      * 审核状态 | ||||
|      */ | ||||
|     private String reviewStatus; | ||||
|  | ||||
|     /** | ||||
|      * 状态 | ||||
|      */ | ||||
|     private String tripStatus; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     private String remark; | ||||
|  | ||||
|     /** | ||||
|      * 创建者 | ||||
|      */ | ||||
|     private Long createBy; | ||||
|  | ||||
|     /** | ||||
|      * 创建者名称 | ||||
|      */ | ||||
|     @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") | ||||
|     private String createByName; | ||||
|  | ||||
|     /** | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     private Date createTime; | ||||
|  | ||||
|     /** | ||||
|      * 是否为车主(0不是 1是) | ||||
|      */ | ||||
|     private Integer isVehicleOwner; | ||||
|  | ||||
|     /** | ||||
|      * 申请列表 | ||||
|      */ | ||||
|     private List<VehVehicleApplyVo> applyList; | ||||
| } | ||||
| @ -0,0 +1,188 @@ | ||||
| package org.dromara.vehicle.domain.vo; | ||||
|  | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import org.dromara.common.translation.annotation.Translation; | ||||
| import org.dromara.common.translation.constant.TransConstant; | ||||
| import org.dromara.vehicle.domain.VehVehicleTrip; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.util.Date; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录视图对象 veh_vehicle_trip | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| @AutoMapper(target = VehVehicleTrip.class) | ||||
| public class VehVehicleTripVo implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|      * 主键ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "主键ID") | ||||
|     private Long id; | ||||
|  | ||||
|     /** | ||||
|      * 项目ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目ID") | ||||
|     private Long projectId; | ||||
|  | ||||
|     /** | ||||
|      * 车辆ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "车辆ID") | ||||
|     private Long vehicleId; | ||||
|  | ||||
|     /** | ||||
|      * 车牌号 | ||||
|      */ | ||||
|     @ExcelProperty(value = "车牌号") | ||||
|     private String plateNumber; | ||||
|  | ||||
|     /** | ||||
|      * 联系电话 | ||||
|      */ | ||||
|     @ExcelProperty(value = "联系电话") | ||||
|     private String passengerPhone; | ||||
|  | ||||
|     /** | ||||
|      * 出行事由 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出行事由") | ||||
|     private String tripReason; | ||||
|  | ||||
|     /** | ||||
|      * 出发地 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地") | ||||
|     private String startPlace; | ||||
|  | ||||
|     /** | ||||
|      * 目的地 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地") | ||||
|     private String endPlace; | ||||
|  | ||||
|     /** | ||||
|      * 出发地经度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地经度") | ||||
|     private String startLng; | ||||
|  | ||||
|     /** | ||||
|      * 出发地纬度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "出发地纬度") | ||||
|     private String startLat; | ||||
|  | ||||
|     /** | ||||
|      * 目的地经度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地经度") | ||||
|     private String endLng; | ||||
|  | ||||
|     /** | ||||
|      * 目的地纬度 | ||||
|      */ | ||||
|     @ExcelProperty(value = "目的地纬度") | ||||
|     private String endLat; | ||||
|  | ||||
|     /** | ||||
|      * 计划出发时间 | ||||
|      */ | ||||
|     @ExcelProperty(value = "计划出发时间") | ||||
|     private Date startTime; | ||||
|  | ||||
|     /** | ||||
|      * 计划到达时间 | ||||
|      */ | ||||
|     @ExcelProperty(value = "计划到达时间") | ||||
|     private Date endTime; | ||||
|  | ||||
|     /** | ||||
|      * 申请人数 | ||||
|      */ | ||||
|     @ExcelProperty(value = "申请人数") | ||||
|     private Integer peopleNum; | ||||
|  | ||||
|     /** | ||||
|      * 剩余座位数 | ||||
|      */ | ||||
|     @ExcelProperty(value = "剩余座位数") | ||||
|     private Integer leftSeat; | ||||
|  | ||||
|     /** | ||||
|      * 审核状态 | ||||
|      */ | ||||
|     @ExcelProperty(value = "审核状态", converter = ExcelDictConvert.class) | ||||
|     @ExcelDictFormat(dictType = "wf_business_status") | ||||
|     private String reviewStatus; | ||||
|  | ||||
|     /** | ||||
|      * 状态 | ||||
|      */ | ||||
|     @ExcelProperty(value = "状态", converter = ExcelDictConvert.class) | ||||
|     @ExcelDictFormat(dictType = "veh_vehicle_trip_status") | ||||
|     private String tripStatus; | ||||
|  | ||||
|     /** | ||||
|      * 备注 | ||||
|      */ | ||||
|     @ExcelProperty(value = "备注") | ||||
|     private String remark; | ||||
|  | ||||
|     /** | ||||
|      * 距离(米) | ||||
|      */ | ||||
|     private String distanceM; | ||||
|  | ||||
|     /** | ||||
|      * 距离评分 | ||||
|      */ | ||||
|     private String distanceScore; | ||||
|  | ||||
|     /** | ||||
|      * 时间 | ||||
|      */ | ||||
|     private String time; | ||||
|  | ||||
|     /** | ||||
|      * 时间评分 | ||||
|      */ | ||||
|     private String timeScore; | ||||
|  | ||||
|     /** | ||||
|      * 人数评分 | ||||
|      */ | ||||
|     private String peopleScore; | ||||
|  | ||||
|     /** | ||||
|      * 总评分 | ||||
|      */ | ||||
|     private String totalScore; | ||||
|  | ||||
|     /** | ||||
|      * 创建者 | ||||
|      */ | ||||
|     private Long createBy; | ||||
|  | ||||
|     /** | ||||
|      * 创建者名称 | ||||
|      */ | ||||
|     @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") | ||||
|     private String createByName; | ||||
| } | ||||
| @ -0,0 +1,15 @@ | ||||
| package org.dromara.vehicle.mapper; | ||||
|  | ||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||
| import org.dromara.vehicle.domain.VehVehicleApply; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请Mapper接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| public interface VehVehicleApplyMapper extends BaseMapperPlus<VehVehicleApply, VehVehicleApplyVo> { | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,21 @@ | ||||
| package org.dromara.vehicle.mapper; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
| import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; | ||||
| import org.dromara.vehicle.domain.VehVehicleTrip; | ||||
| import org.dromara.vehicle.domain.dto.vehicletrip.VehVehicleTripQueryReq; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripVo; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录Mapper接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| public interface VehVehicleTripMapper extends BaseMapperPlus<VehVehicleTrip, VehVehicleTripVo> { | ||||
|  | ||||
|     Page<VehVehicleTripVo> selectVehicleTripPage(@Param("page") Page<VehVehicleTrip> page, | ||||
|                                                  @Param("req") VehVehicleTripQueryReq req); | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,94 @@ | ||||
| package org.dromara.vehicle.service; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.vehicle.domain.VehVehicleApply; | ||||
| import org.dromara.vehicle.domain.dto.vehicleapply.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请Service接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| public interface IVehVehicleApplyService extends IService<VehVehicleApply> { | ||||
|  | ||||
|     /** | ||||
|      * 查询乘车申请 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 乘车申请 | ||||
|      */ | ||||
|     VehVehicleApplyVo queryById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 分页查询乘车申请列表 | ||||
|      * | ||||
|      * @param req       查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 乘车申请分页列表 | ||||
|      */ | ||||
|     TableDataInfo<VehVehicleApplyVo> queryPageList(VehVehicleApplyQueryReq req, PageQuery pageQuery); | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的乘车申请列表 | ||||
|      * | ||||
|      * @param req 查询条件 | ||||
|      * @return 乘车申请列表 | ||||
|      */ | ||||
|     List<VehVehicleApplyVo> queryList(VehVehicleApplyQueryReq req); | ||||
|  | ||||
|     /** | ||||
|      * 新增乘车申请 | ||||
|      * | ||||
|      * @param req 乘车申请 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     Boolean insertByBo(VehVehicleApplyCreateReq req); | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车申请 | ||||
|      * | ||||
|      * @param req 乘车申请 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean updateByBo(VehVehicleApplyUpdateReq req); | ||||
|  | ||||
|     /** | ||||
|      * 车主审核 | ||||
|      * | ||||
|      * @param req 审核信息 | ||||
|      * @return 是否审核成功 | ||||
|      */ | ||||
|     Boolean driverReview(VehVehicleApplyReviewReq req); | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车状态 | ||||
|      * | ||||
|      * @param req 修改乘车状态信息 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean changeStatus(VehVehicleApplyChangeStatusReq req); | ||||
|  | ||||
|     /** | ||||
|      * 取消申请 | ||||
|      * | ||||
|      * @param req 取消申请信息 | ||||
|      * @return 是否取消成功 | ||||
|      */ | ||||
|     Boolean cancelApply(VehVehicleApplyCancelReq req); | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除乘车申请信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | ||||
| } | ||||
| @ -0,0 +1,103 @@ | ||||
| package org.dromara.vehicle.service; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.vehicle.domain.VehVehicleTrip; | ||||
| import org.dromara.vehicle.domain.dto.vehicletrip.*; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripMyVo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripVo; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录Service接口 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| public interface IVehVehicleTripService extends IService<VehVehicleTrip> { | ||||
|  | ||||
|     /** | ||||
|      * 查询车辆出行记录 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 车辆出行记录 | ||||
|      */ | ||||
|     VehVehicleTripVo queryById(Long id); | ||||
|  | ||||
|     /** | ||||
|      * 分页查询车辆出行记录列表 | ||||
|      * | ||||
|      * @param req       查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 车辆出行记录分页列表 | ||||
|      */ | ||||
|     TableDataInfo<VehVehicleTripVo> queryPageList(VehVehicleTripQueryReq req, PageQuery pageQuery); | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 列表查询条件 | ||||
|      * @return 当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     List<VehVehicleTripMyVo> queryMyList(VehVehicleTripMyQueryReq req); | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 列表查询条件 | ||||
|      * @return 当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     List<VehVehicleTripMyVo> queryMyAppList(VehVehicleTripMyQueryReq req); | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 查询条件 | ||||
|      * @return 车辆出行记录列表 | ||||
|      */ | ||||
|     List<VehVehicleTripVo> queryList(VehVehicleTripQueryReq req); | ||||
|  | ||||
|     /** | ||||
|      * 新增车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     Boolean insertByBo(VehVehicleTripCreateReq req); | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean updateByBo(VehVehicleTripUpdateReq req); | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录状态 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     Boolean changeStatus(VehVehicleTripChangeStatusReq req); | ||||
|  | ||||
|     /** | ||||
|      * 取消车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否取消成功 | ||||
|      */ | ||||
|     Boolean cancel(VehVehicleTripCancelReq req); | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除车辆出行记录信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); | ||||
| } | ||||
| @ -0,0 +1,395 @@ | ||||
| package org.dromara.vehicle.service.impl; | ||||
|  | ||||
| import cn.hutool.core.util.PhoneUtil; | ||||
| 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 lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.constant.HttpStatus; | ||||
| import org.dromara.common.core.enums.BusinessStatusEnum; | ||||
| import org.dromara.common.core.exception.ServiceException; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.satoken.utils.LoginHelper; | ||||
| import org.dromara.system.domain.vo.SysUserVo; | ||||
| import org.dromara.system.service.ISysUserService; | ||||
| import org.dromara.vehicle.domain.VehVehicleApply; | ||||
| import org.dromara.vehicle.domain.VehVehicleTrip; | ||||
| import org.dromara.vehicle.domain.dto.vehicleapply.*; | ||||
| import org.dromara.vehicle.domain.enums.VehApplyStatusEnum; | ||||
| import org.dromara.vehicle.domain.enums.VehTripStatusEnum; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
| import org.dromara.vehicle.mapper.VehVehicleApplyMapper; | ||||
| import org.dromara.vehicle.service.IVehVehicleApplyService; | ||||
| import org.dromara.vehicle.service.IVehVehicleTripService; | ||||
| import org.dromara.websocket.ChatServerHandler; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.Collection; | ||||
| import java.util.List; | ||||
| import java.util.Objects; | ||||
| import java.util.concurrent.CompletableFuture; | ||||
|  | ||||
| /** | ||||
|  * 乘车申请Service业务层处理 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Slf4j | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| public class VehVehicleApplyServiceImpl extends ServiceImpl<VehVehicleApplyMapper, VehVehicleApply> | ||||
|     implements IVehVehicleApplyService { | ||||
|  | ||||
|     private final IVehVehicleTripService vehicleTripService; | ||||
|  | ||||
|     private final ChatServerHandler chatServerHandler; | ||||
|  | ||||
|     private final ISysUserService userService; | ||||
|  | ||||
|     /** | ||||
|      * 查询乘车申请 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 乘车申请 | ||||
|      */ | ||||
|     @Override | ||||
|     public VehVehicleApplyVo queryById(Long id) { | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页查询乘车申请列表 | ||||
|      * | ||||
|      * @param req       查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 乘车申请分页列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public TableDataInfo<VehVehicleApplyVo> queryPageList(VehVehicleApplyQueryReq req, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<VehVehicleApply> lqw = buildQueryWrapper(req); | ||||
|         Page<VehVehicleApplyVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的乘车申请列表 | ||||
|      * | ||||
|      * @param req 查询条件 | ||||
|      * @return 乘车申请列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<VehVehicleApplyVo> queryList(VehVehicleApplyQueryReq req) { | ||||
|         LambdaQueryWrapper<VehVehicleApply> lqw = buildQueryWrapper(req); | ||||
|         return baseMapper.selectVoList(lqw); | ||||
|     } | ||||
|  | ||||
|     private LambdaQueryWrapper<VehVehicleApply> buildQueryWrapper(VehVehicleApplyQueryReq req) { | ||||
|         LambdaQueryWrapper<VehVehicleApply> lqw = Wrappers.lambdaQuery(); | ||||
|         lqw.orderByDesc(VehVehicleApply::getId); | ||||
|         lqw.eq(req.getProjectId() != null, VehVehicleApply::getProjectId, req.getProjectId()); | ||||
|         lqw.eq(req.getTripId() != null, VehVehicleApply::getTripId, req.getTripId()); | ||||
|         lqw.eq(req.getPeopleNum() != null, VehVehicleApply::getPeopleNum, req.getPeopleNum()); | ||||
|         lqw.eq(StringUtils.isNotBlank(req.getPassengerPhone()), VehVehicleApply::getPassengerPhone, req.getPassengerPhone()); | ||||
|         lqw.eq(StringUtils.isNotBlank(req.getStartPlace()), VehVehicleApply::getStartPlace, req.getStartPlace()); | ||||
|         lqw.eq(StringUtils.isNotBlank(req.getEndPlace()), VehVehicleApply::getEndPlace, req.getEndPlace()); | ||||
|         lqw.eq(StringUtils.isNotBlank(req.getStatus()), VehVehicleApply::getStatus, req.getStatus()); | ||||
|         return lqw; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增乘车申请 | ||||
|      * | ||||
|      * @param req 乘车申请 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean insertByBo(VehVehicleApplyCreateReq req) { | ||||
|         VehVehicleApply apply = new VehVehicleApply(); | ||||
|         BeanUtils.copyProperties(req, apply); | ||||
|         validEntityBeforeSave(apply); | ||||
|         VehVehicleTrip vehicleTrip = vehicleTripService.getById(req.getTripId()); | ||||
|         if (vehicleTrip == null) { | ||||
|             throw new ServiceException("行程不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         if (vehicleTrip.getTripStatus().equals(VehTripStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("行程已取消,请重新选择行程", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (vehicleTrip.getTripStatus().equals(VehTripStatusEnum.COMPLETED.getValue())) { | ||||
|             throw new ServiceException("行程已结束,请重新选择行程", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (!vehicleTrip.getReviewStatus().equals(BusinessStatusEnum.FINISH.getStatus())) { | ||||
|             throw new ServiceException("行程未通过审核,请重新选择行程", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         boolean save = this.save(apply); | ||||
|         if (!save) { | ||||
|             throw new ServiceException("新增失败"); | ||||
|         } | ||||
|         // 发送消息 | ||||
|         CompletableFuture.runAsync(() -> { | ||||
|             Long createBy = vehicleTrip.getCreateBy(); | ||||
|             String title = "有乘客申请乘车,请及时查看!"; | ||||
|             try { | ||||
|                 chatServerHandler.sendSystemMessageToUser(createBy, title, "4"); | ||||
|             } catch (Exception e) { | ||||
|                 log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", createBy, title, e); | ||||
|             } | ||||
|         }); | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车申请 | ||||
|      * | ||||
|      * @param req 乘车申请 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean updateByBo(VehVehicleApplyUpdateReq req) { | ||||
|         // 获取旧数据 | ||||
|         VehVehicleApply oldApply = this.getById(req.getId()); | ||||
|         if (oldApply == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         VehVehicleApply apply = new VehVehicleApply(); | ||||
|         BeanUtils.copyProperties(req, apply); | ||||
|         validEntityBeforeSave(apply); | ||||
|         return this.updateById(apply); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 车主审核 | ||||
|      * | ||||
|      * @param req 审核信息 | ||||
|      * @return 是否审核成功 | ||||
|      */ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean driverReview(VehVehicleApplyReviewReq req) { | ||||
|         Long id = req.getId(); | ||||
|         String status = req.getStatus(); | ||||
|         // 获取数据 | ||||
|         VehVehicleApply apply = this.getById(id); | ||||
|         if (apply == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         String applyStatus = apply.getStatus(); | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("该申请已取消,无需审核", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.ALREADY.getValue()) | ||||
|             || Objects.equals(applyStatus, VehApplyStatusEnum.ARRIVED.getValue())) { | ||||
|             throw new ServiceException("该申请已上车,无需审核", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         // 获取行程信息 | ||||
|         VehVehicleTrip vehicleTrip = vehicleTripService.getById(apply.getTripId()); | ||||
|         if (vehicleTrip == null) { | ||||
|             throw new ServiceException("行程不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         // 判断是否有审核权限 | ||||
|         if (!Objects.equals(vehicleTrip.getCreateBy(), LoginHelper.getUserId())) { | ||||
|             throw new ServiceException("没有审核权限", HttpStatus.FORBIDDEN); | ||||
|         } | ||||
|         if (Objects.equals(status, VehApplyStatusEnum.CONFIRMED.getValue())) { | ||||
|             // 修改行程信息 | ||||
|             int left = vehicleTrip.getLeftSeat() - apply.getPeopleNum(); | ||||
|             if (left < 0) { | ||||
|                 throw new ServiceException("座位不足", HttpStatus.BAD_REQUEST); | ||||
|             } | ||||
|             vehicleTrip.setLeftSeat(left); | ||||
|             boolean updateTrip = vehicleTripService.updateById(vehicleTrip); | ||||
|             if (!updateTrip) { | ||||
|                 throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|             } | ||||
|         } | ||||
|         apply.setStatus(status); | ||||
|         boolean updateApply = this.updateById(apply); | ||||
|         if (!updateApply) { | ||||
|             throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|         } | ||||
|         // 通知申请人 | ||||
|         CompletableFuture.runAsync(() -> { | ||||
|             Long createBy = apply.getCreateBy(); | ||||
|             String title = Objects.equals(status, VehApplyStatusEnum.CONFIRMED.getValue()) ? | ||||
|                 "您申请的行程已通过审核,请及时查看!" : "您申请的行程未通过审核,请及时查看!"; | ||||
|             try { | ||||
|                 chatServerHandler.sendSystemMessageToUser(createBy, title, "4"); | ||||
|             } catch (Exception e) { | ||||
|                 log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", createBy, title, e); | ||||
|             } | ||||
|         }); | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改乘车状态 | ||||
|      * | ||||
|      * @param req 修改乘车状态信息 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean changeStatus(VehVehicleApplyChangeStatusReq req) { | ||||
|         Long id = req.getId(); | ||||
|         String status = req.getStatus(); | ||||
|         // 获取数据 | ||||
|         VehVehicleApply apply = this.getById(id); | ||||
|         if (apply == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         // 判断是否为申请人 | ||||
|         if (!Objects.equals(apply.getCreateBy(), LoginHelper.getUserId())) { | ||||
|             throw new ServiceException("您没有权限修改该申请", HttpStatus.FORBIDDEN); | ||||
|         } | ||||
|         String applyStatus = apply.getStatus(); | ||||
|         // 状态校验 | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("该申请已取消,无法修改", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.APPLYING.getValue())) { | ||||
|             throw new ServiceException("该申请正在审核中,无法修改", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.REJECTED.getValue())) { | ||||
|             throw new ServiceException("该申请已被拒绝,无法修改", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.ARRIVED.getValue()) | ||||
|             && !Objects.equals(status, VehApplyStatusEnum.ALREADY.getValue())) { | ||||
|             throw new ServiceException("请先确认上车后再确认到达目的地", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         apply.setStatus(status); | ||||
|         boolean updateApply = this.updateById(apply); | ||||
|         if (!updateApply) { | ||||
|             throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|         } | ||||
|         // 如果状态为已到达,则修改行程信息 | ||||
|         if (Objects.equals(status, VehApplyStatusEnum.ALREADY.getValue())) { | ||||
|             VehVehicleTrip vehicleTrip = vehicleTripService.getById(apply.getTripId()); | ||||
|             if (vehicleTrip == null) { | ||||
|                 throw new ServiceException("行程不存在", HttpStatus.NOT_FOUND); | ||||
|             } | ||||
|             if (!Objects.equals(vehicleTrip.getTripStatus(), VehTripStatusEnum.COMPLETED.getValue())) { | ||||
|                 return true; | ||||
|             } | ||||
|             Integer leftSeat = vehicleTrip.getLeftSeat(); | ||||
|             vehicleTrip.setLeftSeat(leftSeat + apply.getPeopleNum()); | ||||
|             boolean updateTrip = vehicleTripService.updateById(vehicleTrip); | ||||
|             if (!updateTrip) { | ||||
|                 throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|             } | ||||
|             return true; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 取消申请 | ||||
|      * | ||||
|      * @param req 取消申请信息 | ||||
|      * @return 是否取消成功 | ||||
|      */ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean cancelApply(VehVehicleApplyCancelReq req) { | ||||
|         Long id = req.getId(); | ||||
|         VehVehicleApply apply = this.getById(id); | ||||
|         if (apply == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         // 判断是否为申请人 | ||||
|         if (!Objects.equals(apply.getCreateBy(), LoginHelper.getUserId())) { | ||||
|             throw new ServiceException("您没有权限取消该申请", HttpStatus.FORBIDDEN); | ||||
|         } | ||||
|         String applyStatus = apply.getStatus(); | ||||
|         // 状态校验 | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("该申请已取消,无需取消", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.ARRIVED.getValue())) { | ||||
|             throw new ServiceException("该申请已到达目的地,无法取消", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         // 获取行程信息 | ||||
|         VehVehicleTrip vehicleTrip = vehicleTripService.getById(apply.getTripId()); | ||||
|         if (vehicleTrip == null) { | ||||
|             throw new ServiceException("行程不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         // 需要通知司机的状态 | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|             || Objects.equals(applyStatus, VehApplyStatusEnum.ALREADY.getValue()) | ||||
|             || Objects.equals(applyStatus, VehApplyStatusEnum.APPLYING.getValue())) { | ||||
|             CompletableFuture.runAsync(() -> { | ||||
|                 Long createBy = vehicleTrip.getCreateBy(); | ||||
|                 String title = "有乘客取消预约,请及时查看!"; | ||||
|                 try { | ||||
|                     chatServerHandler.sendSystemMessageToUser(createBy, title, "4"); | ||||
|                 } catch (Exception e) { | ||||
|                     log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", createBy, title, e); | ||||
|                 } | ||||
|             }); | ||||
|         } | ||||
|         // 如果已确认,减少乘车人数 | ||||
|         if (Objects.equals(applyStatus, VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|             || Objects.equals(applyStatus, VehApplyStatusEnum.ALREADY.getValue())) { | ||||
|             Integer leftSeat = vehicleTrip.getLeftSeat(); | ||||
|             vehicleTrip.setLeftSeat(leftSeat + apply.getPeopleNum()); | ||||
|             boolean updateTrip = vehicleTripService.updateById(vehicleTrip); | ||||
|             if (!updateTrip) { | ||||
|                 throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|             } | ||||
|         } | ||||
|         apply.setStatus(VehApplyStatusEnum.CANCELED.getValue()); | ||||
|         boolean updateApply = this.updateById(apply); | ||||
|         if (!updateApply) { | ||||
|             throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(VehVehicleApply entity) { | ||||
|         //TODO 做一些数据校验,如唯一约束 | ||||
|         String passengerPhone = entity.getPassengerPhone(); | ||||
|         // 如果手机号为空,则使用用户手机号 | ||||
|         if (StringUtils.isBlank(passengerPhone)) { | ||||
|             Long userId = LoginHelper.getUserId(); | ||||
|             SysUserVo userVo = userService.selectUserById(userId); | ||||
|             passengerPhone = userVo.getPhonenumber(); | ||||
|         } | ||||
|         if (StringUtils.isNotBlank(passengerPhone) && !PhoneUtil.isPhone(passengerPhone)) { | ||||
|             throw new ServiceException("手机号码格式不正确", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除乘车申请信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         if (isValid) { | ||||
|             List<VehVehicleApply> applyList = this.listByIds(ids); | ||||
|             for (VehVehicleApply apply : applyList) { | ||||
|                 // 判断是否能删除 | ||||
|                 if (apply.getStatus().equals(VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|                     || apply.getStatus().equals(VehApplyStatusEnum.ALREADY.getValue())) { | ||||
|                     throw new ServiceException("该申请已确认,无法删除", HttpStatus.BAD_REQUEST); | ||||
|                 } | ||||
|                 // 判断是否为申请人 | ||||
|                 if (!Objects.equals(apply.getCreateBy(), LoginHelper.getUserId())) { | ||||
|                     throw new ServiceException("您没有权限删除该申请", HttpStatus.FORBIDDEN); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
| } | ||||
| @ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| @ -26,6 +27,7 @@ import java.util.Map; | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Slf4j | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper, VehVehicleInfo> | ||||
| @ -38,7 +40,7 @@ public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper, | ||||
|      * @return 车辆信息 | ||||
|      */ | ||||
|     @Override | ||||
|     public VehVehicleInfoVo queryById(Long id){ | ||||
|     public VehVehicleInfoVo queryById(Long id) { | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
| @ -130,7 +132,7 @@ public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper, | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(VehVehicleInfo entity){ | ||||
|     private void validEntityBeforeSave(VehVehicleInfo entity) { | ||||
|         //TODO 做一些数据校验,如唯一约束 | ||||
|     } | ||||
|  | ||||
| @ -143,7 +145,7 @@ public class VehVehicleInfoServiceImpl extends ServiceImpl<VehVehicleInfoMapper, | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         if(isValid){ | ||||
|         if (isValid) { | ||||
|             //TODO 做一些业务上的校验,判断是否需要校验 | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|  | ||||
| @ -0,0 +1,595 @@ | ||||
| package org.dromara.vehicle.service.impl; | ||||
|  | ||||
| import cn.hutool.core.collection.CollUtil; | ||||
| import cn.hutool.core.util.PhoneUtil; | ||||
| 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 jakarta.annotation.Resource; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.constant.HttpStatus; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.enums.BusinessStatusEnum; | ||||
| import org.dromara.common.core.exception.ServiceException; | ||||
| import org.dromara.common.core.utils.DateUtils; | ||||
| import org.dromara.common.core.utils.ObjectUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| import org.dromara.common.satoken.utils.LoginHelper; | ||||
| import org.dromara.system.domain.vo.SysUserVo; | ||||
| import org.dromara.system.service.ISysUserService; | ||||
| import org.dromara.vehicle.domain.VehVehicleApply; | ||||
| import org.dromara.vehicle.domain.VehVehicleInfo; | ||||
| import org.dromara.vehicle.domain.VehVehicleTrip; | ||||
| import org.dromara.vehicle.domain.dto.vehicletrip.*; | ||||
| import org.dromara.vehicle.domain.enums.VehApplyStatusEnum; | ||||
| import org.dromara.vehicle.domain.enums.VehTripStatusEnum; | ||||
| import org.dromara.vehicle.domain.enums.VehVehicleInfoStatusEnum; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleApplyVo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripMyVo; | ||||
| import org.dromara.vehicle.domain.vo.VehVehicleTripVo; | ||||
| import org.dromara.vehicle.mapper.VehVehicleTripMapper; | ||||
| import org.dromara.vehicle.service.IVehVehicleApplyService; | ||||
| import org.dromara.vehicle.service.IVehVehicleInfoService; | ||||
| import org.dromara.vehicle.service.IVehVehicleTripService; | ||||
| import org.dromara.websocket.ChatServerHandler; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.context.annotation.Lazy; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.*; | ||||
| import java.util.concurrent.CompletableFuture; | ||||
| import java.util.stream.Collectors; | ||||
|  | ||||
| /** | ||||
|  * 车辆出行记录Service业务层处理 | ||||
|  * | ||||
|  * @author lilemy | ||||
|  * @date 2025-10-25 | ||||
|  */ | ||||
| @Slf4j | ||||
| @Service | ||||
| public class VehVehicleTripServiceImpl extends ServiceImpl<VehVehicleTripMapper, VehVehicleTrip> | ||||
|     implements IVehVehicleTripService { | ||||
|  | ||||
|     @Lazy | ||||
|     @Resource | ||||
|     private IVehVehicleInfoService vehicleInfoService; | ||||
|  | ||||
|     @Lazy | ||||
|     @Resource | ||||
|     private IVehVehicleApplyService vehicleApplyService; | ||||
|  | ||||
|     @Resource | ||||
|     private ISysUserService userService; | ||||
|  | ||||
|     @Resource | ||||
|     private ChatServerHandler chatServerHandler; | ||||
|  | ||||
|     /** | ||||
|      * 查询车辆出行记录 | ||||
|      * | ||||
|      * @param id 主键 | ||||
|      * @return 车辆出行记录 | ||||
|      */ | ||||
|     @Override | ||||
|     public VehVehicleTripVo queryById(Long id) { | ||||
|         return baseMapper.selectVoById(id); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 分页查询车辆出行记录列表 | ||||
|      * | ||||
|      * @param req       查询条件 | ||||
|      * @param pageQuery 分页参数 | ||||
|      * @return 车辆出行记录分页列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public TableDataInfo<VehVehicleTripVo> queryPageList(VehVehicleTripQueryReq req, PageQuery pageQuery) { | ||||
|         Page<VehVehicleTripVo> result; | ||||
|         if (StringUtils.isNotBlank(req.getEndLat()) && StringUtils.isNotBlank(req.getEndLng()) | ||||
|             && ObjectUtils.isNotNull(req.getStartTime()) && ObjectUtils.isNotNull(req.getPeopleNum()) | ||||
|             && req.getPeopleNum() >= 1) { | ||||
|             result = baseMapper.selectVehicleTripPage(pageQuery.build(), req); | ||||
|             result.getRecords().forEach(trip -> { | ||||
|                 Date startTime = trip.getStartTime(); | ||||
|                 Date date = DateUtils.toDate(req.getStartTime()); | ||||
|                 // 判断日期 | ||||
|                 if (date.after(startTime)) { | ||||
|                     DateUtils.getTimeDifference(startTime, date); | ||||
|                 } else { | ||||
|                     DateUtils.getTimeDifference(date, startTime); | ||||
|                 } | ||||
|             }); | ||||
|         } else { | ||||
|             result = baseMapper.selectVoPage(pageQuery.build(), buildQueryWrapper(req)); | ||||
|         } | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 列表查询条件 | ||||
|      * @return 当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<VehVehicleTripMyVo> queryMyList(VehVehicleTripMyQueryReq req) { | ||||
|         String type = req.getType(); | ||||
|         Long userId = LoginHelper.getUserId(); | ||||
|         if (userId == null) { | ||||
|             throw new ServiceException("请先登录", HttpStatus.UNAUTHORIZED); | ||||
|         } | ||||
|         // --- 一、查询当前用户创建的行程 --- | ||||
|         List<VehVehicleTrip> createdTrips = this.lambdaQuery() | ||||
|             .eq(VehVehicleTrip::getCreateBy, userId) | ||||
|             .eq(!"3".equals(type), VehVehicleTrip::getTripStatus, VehTripStatusEnum.READY_DEPART.getValue()) | ||||
|             .eq("1".equals(type), VehVehicleTrip::getReviewStatus, BusinessStatusEnum.FINISH.getStatus()) | ||||
|             .ne("2".equals(type), VehVehicleTrip::getReviewStatus, BusinessStatusEnum.FINISH.getStatus()) | ||||
|             .eq("3".equals(type), VehVehicleTrip::getTripStatus, VehTripStatusEnum.COMPLETED.getValue()) | ||||
|             .list(); | ||||
|         // --- 二、查询当前用户作为乘客的申请 --- | ||||
|         List<VehVehicleApply> userApplies = vehicleApplyService.lambdaQuery() | ||||
|             .eq(VehVehicleApply::getCreateBy, userId) | ||||
|             .eq("1".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|             .notIn("2".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.ARRIVED.getValue(), VehApplyStatusEnum.ALREADY.getValue()) | ||||
|             .eq("3".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.ARRIVED.getValue()) | ||||
|             .list(); | ||||
|         // 整合数据 | ||||
|         return buildTripMyVoList(createdTrips, userApplies, userId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询当前用户车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 列表查询条件 | ||||
|      * @return 当前用户车辆出行记录列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<VehVehicleTripMyVo> queryMyAppList(VehVehicleTripMyQueryReq req) { | ||||
|         String type = req.getType(); | ||||
|         Long userId = LoginHelper.getUserId(); | ||||
|         if (userId == null) { | ||||
|             throw new ServiceException("请先登录", HttpStatus.UNAUTHORIZED); | ||||
|         } | ||||
|         // --- 一、查询当前用户创建的行程 --- | ||||
|         List<VehVehicleTrip> createdTrips = this.lambdaQuery() | ||||
|             .eq(VehVehicleTrip::getCreateBy, userId) | ||||
|             .eq("0".equals(type) || "2".equals(type), VehVehicleTrip::getTripStatus, VehTripStatusEnum.READY_DEPART.getValue()) | ||||
|             .eq("0".equals(type), VehVehicleTrip::getReviewStatus, BusinessStatusEnum.FINISH.getStatus()) | ||||
|             .eq("1".equals(type), VehVehicleTrip::getTripStatus, VehTripStatusEnum.UNDERWAY.getValue()) | ||||
|             .ne("2".equals(type), VehVehicleTrip::getReviewStatus, BusinessStatusEnum.FINISH.getStatus()) | ||||
|             .eq("3".equals(type), VehVehicleTrip::getTripStatus, VehTripStatusEnum.COMPLETED.getValue()) | ||||
|             .list(); | ||||
|         // --- 二、查询当前用户作为乘客的申请 --- | ||||
|         List<VehVehicleApply> userApplies = vehicleApplyService.lambdaQuery() | ||||
|             .eq(VehVehicleApply::getCreateBy, userId) | ||||
|             .eq("0".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|             .eq("1".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.ALREADY.getValue()) | ||||
|             .notIn("2".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.ARRIVED.getValue(), VehApplyStatusEnum.ALREADY.getValue()) | ||||
|             .eq("3".equals(type), VehVehicleApply::getStatus, VehApplyStatusEnum.ARRIVED.getValue()) | ||||
|             .list(); | ||||
|         // 整合数据 | ||||
|         return buildTripMyVoList(createdTrips, userApplies, userId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的车辆出行记录列表 | ||||
|      * | ||||
|      * @param req 查询条件 | ||||
|      * @return 车辆出行记录列表 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<VehVehicleTripVo> queryList(VehVehicleTripQueryReq req) { | ||||
|         LambdaQueryWrapper<VehVehicleTrip> lqw = buildQueryWrapper(req); | ||||
|         return baseMapper.selectVoList(lqw); | ||||
|     } | ||||
|  | ||||
|     private LambdaQueryWrapper<VehVehicleTrip> buildQueryWrapper(VehVehicleTripQueryReq req) { | ||||
|         LambdaQueryWrapper<VehVehicleTrip> lqw = Wrappers.lambdaQuery(); | ||||
|         lqw.eq(req.getProjectId() != null, VehVehicleTrip::getProjectId, req.getProjectId()); | ||||
|         lqw.like(StringUtils.isNotBlank(req.getEndPlace()), VehVehicleTrip::getEndPlace, req.getEndPlace()); | ||||
|         lqw.ge(req.getPeopleNum() != null, VehVehicleTrip::getPeopleNum, req.getPeopleNum()); | ||||
|         lqw.eq(req.getReviewStatus() != null, VehVehicleTrip::getReviewStatus, req.getReviewStatus()); | ||||
|         lqw.eq(req.getTripStatus() != null, VehVehicleTrip::getTripStatus, req.getTripStatus()); | ||||
|         return lqw; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否新增成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean insertByBo(VehVehicleTripCreateReq req) { | ||||
|         VehVehicleTrip trip = new VehVehicleTrip(); | ||||
|         BeanUtils.copyProperties(req, trip); | ||||
|         validEntityBeforeSave(trip); | ||||
|         // 判断车辆是否被占用 | ||||
|         Long vehicleId = trip.getVehicleId(); | ||||
|         if (vehicleId != null) { | ||||
|             synchronized (vehicleId.toString()) { | ||||
|                 // 获取车辆信息 | ||||
|                 VehVehicleInfo vehicle = vehicleInfoService.getById(vehicleId); | ||||
|                 if (vehicle == null) { | ||||
|                     throw new ServiceException("车辆不存在", HttpStatus.NOT_FOUND); | ||||
|                 } | ||||
|                 if (!vehicle.getVehicleStatus().equals(VehVehicleInfoStatusEnum.AVAILABLE.getValue())) { | ||||
|                     throw new ServiceException("车辆已被占用", HttpStatus.BAD_REQUEST); | ||||
|                 } | ||||
|                 // 修改车辆状态 | ||||
|                 vehicle.setVehicleStatus(VehVehicleInfoStatusEnum.IN_USE.getValue()); | ||||
|                 boolean update = vehicleInfoService.updateById(vehicle); | ||||
|                 if (!update) { | ||||
|                     throw new ServiceException("修改车辆状态失败"); | ||||
|                 } | ||||
|                 trip.setPlateNumber(vehicle.getPlateNumber()); | ||||
|                 return this.save(trip); | ||||
|             } | ||||
|         } else { | ||||
|             return this.save(trip); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean updateByBo(VehVehicleTripUpdateReq req) { | ||||
|         // 获取旧数据 | ||||
|         VehVehicleTrip oldEntity = this.getById(req.getId()); | ||||
|         if (oldEntity == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         if (ObjectUtils.isNotEmpty(req.getVehicleId()) && !Objects.equals(req.getVehicleId(), oldEntity.getVehicleId())) { | ||||
|             // 车辆id不一致,需要判断车辆是否被占用 | ||||
|             VehVehicleInfo vehicle = vehicleInfoService.getById(req.getVehicleId()); | ||||
|             if (vehicle == null) { | ||||
|                 throw new ServiceException("车辆不存在", HttpStatus.NOT_FOUND); | ||||
|             } | ||||
|             if (!vehicle.getVehicleStatus().equals(VehVehicleInfoStatusEnum.AVAILABLE.getValue())) { | ||||
|                 throw new ServiceException("当前车辆无法使用", HttpStatus.CONFLICT); | ||||
|             } | ||||
|         } | ||||
|         VehVehicleTrip trip = new VehVehicleTrip(); | ||||
|         BeanUtils.copyProperties(req, trip); | ||||
|         validEntityBeforeSave(trip); | ||||
|         return this.updateById(trip); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改车辆出行记录状态 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否修改成功 | ||||
|      */ | ||||
|     @Override | ||||
|     public Boolean changeStatus(VehVehicleTripChangeStatusReq req) { | ||||
|         Long id = req.getId(); | ||||
|         String tripStatus = req.getTripStatus(); | ||||
|         // 获取数据 | ||||
|         VehVehicleTrip trip = this.getById(id); | ||||
|         if (trip == null) { | ||||
|             throw new ServiceException("数据不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         // 判断是否为申请人 | ||||
|         if (!Objects.equals(trip.getCreateBy(), LoginHelper.getUserId())) { | ||||
|             throw new ServiceException("您没有权限修改该申请", HttpStatus.FORBIDDEN); | ||||
|         } | ||||
|         String reviewStatus = trip.getReviewStatus(); | ||||
|         // 判断是否通过审核 | ||||
|         if (!Objects.equals(reviewStatus, BusinessStatusEnum.FINISH.getStatus())) { | ||||
|             throw new ServiceException("该申请未通过审核,无法修改", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         String status = trip.getTripStatus(); | ||||
|         // 状态校验 | ||||
|         if (Objects.equals(status, VehTripStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("该申请已取消,无法修改", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         if (Objects.equals(tripStatus, VehTripStatusEnum.COMPLETED.getValue()) | ||||
|             && !Objects.equals(status, VehTripStatusEnum.UNDERWAY.getValue())) { | ||||
|             throw new ServiceException("请先确认上车后再确认到达目的地", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         trip.setTripStatus(tripStatus); | ||||
|         boolean updateApply = this.updateById(trip); | ||||
|         if (!updateApply) { | ||||
|             throw new ServiceException("行程信息更新失败", HttpStatus.ERROR); | ||||
|         } | ||||
|         // 同步修改乘客状态 | ||||
|         if (Objects.equals(status, VehTripStatusEnum.COMPLETED.getValue())) { | ||||
|             List<VehVehicleApply> applies = vehicleApplyService.lambdaQuery() | ||||
|                 .eq(VehVehicleApply::getTripId, id) | ||||
|                 .in(VehVehicleApply::getStatus, VehApplyStatusEnum.ALREADY.getValue(), VehApplyStatusEnum.CONFIRMED.getValue()) | ||||
|                 .list(); | ||||
|             if (CollUtil.isNotEmpty(applies)) { | ||||
|                 applies.forEach(apply -> apply.setStatus(VehApplyStatusEnum.ARRIVED.getValue())); | ||||
|                 boolean b = vehicleApplyService.updateBatchById(applies); | ||||
|                 if (!b) { | ||||
|                     throw new ServiceException("修改乘客状态失败"); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         // 修改对应车辆状态 | ||||
|         Long vehicleId = trip.getVehicleId(); | ||||
|         if (vehicleId != null) { | ||||
|             VehVehicleInfo info = new VehVehicleInfo(); | ||||
|             info.setId(vehicleId); | ||||
|             info.setVehicleStatus(VehVehicleInfoStatusEnum.AVAILABLE.getValue()); | ||||
|             boolean update = vehicleInfoService.updateById(info); | ||||
|             if (!update) { | ||||
|                 throw new ServiceException("修改车辆状态失败"); | ||||
|             } | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 取消车辆出行记录 | ||||
|      * | ||||
|      * @param req 车辆出行记录 | ||||
|      * @return 是否取消成功 | ||||
|      */ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean cancel(VehVehicleTripCancelReq req) { | ||||
|         // 数据校验 | ||||
|         VehVehicleTrip trip = this.getById(req.getId()); | ||||
|         if (trip == null) { | ||||
|             throw new ServiceException("车辆出行记录不存在", HttpStatus.NOT_FOUND); | ||||
|         } | ||||
|         if (trip.getTripStatus().equals(VehTripStatusEnum.CANCELED.getValue())) { | ||||
|             throw new ServiceException("该记录已取消", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|         // 权限校验 | ||||
|         Long userId = LoginHelper.getUserId(); | ||||
|         if (!LoginHelper.isSuperAdmin() && !userId.equals(trip.getCreateBy())) { | ||||
|             throw new ServiceException("没有权限取消该记录", HttpStatus.FORBIDDEN); | ||||
|         } | ||||
|         // 设置取消状态 | ||||
|         trip.setTripStatus(VehTripStatusEnum.CANCELED.getValue()); | ||||
|         // 通知已预约用户 | ||||
|         List<VehVehicleApply> applyList = vehicleApplyService.lambdaQuery() | ||||
|             .eq(VehVehicleApply::getTripId, trip.getId()) | ||||
|             .list(); | ||||
|         if (CollUtil.isNotEmpty(applyList)) { | ||||
|             // 通知 | ||||
|             for (VehVehicleApply apply : applyList) { | ||||
|                 CompletableFuture.runAsync(() -> { | ||||
|                     Long createBy = apply.getCreateBy(); | ||||
|                     String title = "司机已取消您预约的行程,请及时查看!"; | ||||
|                     try { | ||||
|                         chatServerHandler.sendSystemMessageToUser(createBy, title, "4"); | ||||
|                     } catch (Exception e) { | ||||
|                         log.error("异步发送系统消息失败,用户ID: {}, 消息: {}", createBy, title, e); | ||||
|                     } | ||||
|                 }); | ||||
|             } | ||||
|             // 修改申请状态 | ||||
|             applyList.forEach(apply -> apply.setStatus(VehApplyStatusEnum.CANCELED.getValue())); | ||||
|             boolean updateApply = vehicleApplyService.updateBatchById(applyList); | ||||
|             if (!updateApply) { | ||||
|                 throw new ServiceException("修改申请状态失败"); | ||||
|             } | ||||
|         } | ||||
|         // 更新数据 | ||||
|         boolean update = this.updateById(trip); | ||||
|         if (!update) { | ||||
|             throw new ServiceException("修改车辆出行记录失败"); | ||||
|         } | ||||
|         // 释放车辆 | ||||
|         if (trip.getVehicleId() != null) { | ||||
|             VehVehicleInfo vehicle = vehicleInfoService.getById(trip.getVehicleId()); | ||||
|             if (vehicle != null) { | ||||
|                 vehicle.setVehicleStatus(VehVehicleInfoStatusEnum.AVAILABLE.getValue()); | ||||
|                 boolean updateVehicle = vehicleInfoService.updateById(vehicle); | ||||
|                 if (!updateVehicle) { | ||||
|                     throw new ServiceException("修改车辆状态失败"); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 保存前的数据校验 | ||||
|      */ | ||||
|     private void validEntityBeforeSave(VehVehicleTrip entity) { | ||||
|         Long vehicleId = entity.getVehicleId(); | ||||
|         String plateNumber = entity.getPlateNumber(); | ||||
|         String passengerPhone = entity.getPassengerPhone(); | ||||
|         if (vehicleId == null && StringUtils.isBlank(plateNumber)) { | ||||
|             throw new ServiceException("车辆不能为空"); | ||||
|         } | ||||
|         // 如果车辆为私有车,则审核通过 | ||||
|         if (vehicleId == null) { | ||||
|             entity.setReviewStatus(BusinessStatusEnum.FINISH.getStatus()); | ||||
|         } | ||||
|         // 如果手机号为空,则使用用户手机号 | ||||
|         if (StringUtils.isBlank(passengerPhone)) { | ||||
|             Long userId = LoginHelper.getUserId(); | ||||
|             SysUserVo userVo = userService.selectUserById(userId); | ||||
|             passengerPhone = userVo.getPhonenumber(); | ||||
|         } | ||||
|         if (!PhoneUtil.isPhone(passengerPhone)) { | ||||
|             throw new ServiceException("手机号格式错误", HttpStatus.BAD_REQUEST); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 校验并批量删除车辆出行记录信息 | ||||
|      * | ||||
|      * @param ids     待删除的主键集合 | ||||
|      * @param isValid 是否进行有效性校验 | ||||
|      * @return 是否删除成功 | ||||
|      */ | ||||
|     @Override | ||||
|     @Transactional(rollbackFor = Exception.class) | ||||
|     public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { | ||||
|         // 获取数据列表 | ||||
|         List<VehVehicleTrip> list = this.listByIds(ids); | ||||
|         if (isValid) { | ||||
|             // 获取登录用户 | ||||
|             Long userId = LoginHelper.getUserId(); | ||||
|             Set<Long> userIds = list.stream().map(VehVehicleTrip::getCreateBy).collect(Collectors.toSet()); | ||||
|             if (!userIds.contains(userId)) { | ||||
|                 throw new ServiceException("没有权限删除该记录", HttpStatus.FORBIDDEN); | ||||
|             } | ||||
|             // 获取出现状态 | ||||
|             for (VehVehicleTrip trip : list) { | ||||
|                 if (!trip.getTripStatus().equals(VehTripStatusEnum.CANCELED.getValue()) | ||||
|                     || !trip.getTripStatus().equals(VehTripStatusEnum.READY_DEPART.getValue())) { | ||||
|                     throw new ServiceException("该记录已开始,不能删除", HttpStatus.BAD_REQUEST); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         // 同步删除用户申请记录 | ||||
|         List<VehVehicleApply> applyList = vehicleApplyService.lambdaQuery() | ||||
|             .in(VehVehicleApply::getTripId, ids) | ||||
|             .list(); | ||||
|         if (CollUtil.isNotEmpty(applyList)) { | ||||
|             boolean deleteApply = vehicleApplyService.removeByIds(applyList); | ||||
|             if (!deleteApply) { | ||||
|                 throw new ServiceException("删除用户申请记录失败"); | ||||
|             } | ||||
|         } | ||||
|         return this.removeBatchByIds(ids); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 构建用户行程及其对应申请的展示列表 | ||||
|      * | ||||
|      * @param createdTrips 用户创建的行程列表 | ||||
|      * @param userApplies  用户申请列表 | ||||
|      * @param userId       当前用户ID | ||||
|      * @return 组装后的 VehVehicleTripMyVo 列表 | ||||
|      */ | ||||
|     private List<VehVehicleTripMyVo> buildTripMyVoList(List<VehVehicleTrip> createdTrips, | ||||
|                                                        List<VehVehicleApply> userApplies, | ||||
|                                                        Long userId) { | ||||
|         // 收集行程id | ||||
|         Set<Long> tripIds = createdTrips.stream() | ||||
|             .map(VehVehicleTrip::getId) | ||||
|             .collect(Collectors.toSet()); | ||||
|         List<VehVehicleApply> applyList = new ArrayList<>(userApplies); | ||||
|         // 收集申请对应的行程id | ||||
|         tripIds.addAll(userApplies.stream() | ||||
|             .map(VehVehicleApply::getTripId) | ||||
|             .collect(Collectors.toSet())); | ||||
|         // 收集申请id | ||||
|         Set<Long> applyIds = userApplies.stream() | ||||
|             .map(VehVehicleApply::getId) | ||||
|             .collect(Collectors.toSet()); | ||||
|         // --- 三、查询这些行程Id对应的行程(合并创建的与乘坐的) --- | ||||
|         List<VehVehicleTrip> tripList = new ArrayList<>(); | ||||
|         if (CollUtil.isNotEmpty(tripIds)) { | ||||
|             List<VehVehicleTrip> trips = this.lambdaQuery() | ||||
|                 .in(VehVehicleTrip::getId, tripIds) | ||||
|                 .list(); | ||||
|             tripList.addAll(trips); | ||||
|         } | ||||
|         // --- 四、查询这些行程对应的有效申请 --- | ||||
|         if (CollUtil.isNotEmpty(tripIds)) { | ||||
|             List<VehVehicleApply> applies = vehicleApplyService.lambdaQuery() | ||||
|                 .in(VehVehicleApply::getTripId, tripIds) | ||||
|                 .notIn(CollUtil.isNotEmpty(applyIds), VehVehicleApply::getId, applyIds) | ||||
|                 .ne(VehVehicleApply::getStatus, VehApplyStatusEnum.CANCELED.getValue()) | ||||
|                 .list(); | ||||
|             applyList.addAll(applies); | ||||
|         } | ||||
|         if (CollUtil.isEmpty(tripList)) { | ||||
|             return Collections.emptyList(); | ||||
|         } | ||||
|         return tripList.stream().map(trip -> { | ||||
|                 VehVehicleTripMyVo tripMyVo = new VehVehicleTripMyVo(); | ||||
|                 BeanUtils.copyProperties(trip, tripMyVo); | ||||
|  | ||||
|                 // 找出对应申请 | ||||
|                 List<VehVehicleApply> relatedApplies = applyList.stream() | ||||
|                     .filter(apply -> apply.getTripId().equals(trip.getId())) | ||||
|                     .toList(); | ||||
|  | ||||
|                 if (CollUtil.isNotEmpty(relatedApplies)) { | ||||
|                     List<VehVehicleApplyVo> applyVoList = relatedApplies.stream().map(apply -> { | ||||
|                         VehVehicleApplyVo applyVo = new VehVehicleApplyVo(); | ||||
|                         BeanUtils.copyProperties(apply, applyVo); | ||||
|                         return applyVo; | ||||
|                     }).toList(); | ||||
|                     tripMyVo.setApplyList(applyVoList); | ||||
|                 } | ||||
|  | ||||
|                 // 是否为行程发起人 | ||||
|                 tripMyVo.setIsVehicleOwner(trip.getCreateBy().equals(userId) ? 1 : 0); | ||||
|  | ||||
|                 return tripMyVo; | ||||
|             }).sorted(Comparator.comparing(VehVehicleTripMyVo::getStartTime)) | ||||
|             .toList(); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('vehVehicleTrip')") | ||||
|     @Transactional | ||||
|     public void processPlansHandler(ProcessEvent processEvent) { | ||||
|         log.info("车辆出行审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         VehVehicleTrip vehicleTrip = this.getById(Long.valueOf(id)); | ||||
|         if (vehicleTrip == null) { | ||||
|             return; | ||||
|         } | ||||
|         vehicleTrip.setReviewStatus(processEvent.getStatus()); | ||||
|         this.updateById(vehicleTrip); | ||||
|         if (processEvent.getStatus().equals(BusinessStatusEnum.FINISH.getStatus()) | ||||
|             || processEvent.getStatus().equals(BusinessStatusEnum.TERMINATION.getStatus()) | ||||
|             || processEvent.getStatus().equals(BusinessStatusEnum.INVALID.getStatus()) | ||||
|             || processEvent.getStatus().equals(BusinessStatusEnum.CANCEL.getStatus())) { | ||||
|             // 获取车辆申请列表 | ||||
|             VehVehicleInfo vehicleInfo = new VehVehicleInfo(); | ||||
|             vehicleInfo.setId(vehicleTrip.getVehicleId()); | ||||
|             vehicleInfo.setVehicleStatus(VehVehicleInfoStatusEnum.AVAILABLE.getValue()); | ||||
|             vehicleInfoService.updateById(vehicleInfo); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('vehVehicleTrip')") | ||||
|     public void processTaskPlansHandler(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("车辆出行审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('vehVehicleTrip')") | ||||
|     public void processDeletePlansHandler(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("车辆出行审核删除流程任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
| } | ||||
| @ -12,7 +12,6 @@ import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; | ||||
| import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; | ||||
| import io.netty.util.concurrent.GlobalEventExecutor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.dto.UserDTO; | ||||
| import org.dromara.common.core.domain.model.LoginUser; | ||||
| import org.dromara.common.satoken.utils.LoginHelper; | ||||
| import org.dromara.system.domain.vo.SysOssVo; | ||||
| @ -44,20 +43,24 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|     private static ChatGroupServiceImpl chatGroupService; | ||||
|     private static SysUserServiceImpl sysUserService; | ||||
|     private static SysOssServiceImpl sysOssService; | ||||
|  | ||||
|     @Autowired | ||||
|     public void setChatHistoryService(ChatHistoryServiceImpl service) { | ||||
|         chatHistoryService = service; | ||||
|     } | ||||
|  | ||||
|     @Autowired | ||||
|     public void setChatGroupService(ChatGroupServiceImpl service){ | ||||
|     public void setChatGroupService(ChatGroupServiceImpl service) { | ||||
|         chatGroupService = service; | ||||
|     } | ||||
|  | ||||
|     @Autowired | ||||
|     public void setSysUserService(SysUserServiceImpl service){ | ||||
|     public void setSysUserService(SysUserServiceImpl service) { | ||||
|         sysUserService = service; | ||||
|     } | ||||
|  | ||||
|     @Autowired | ||||
|     public void setSysOssService(SysOssServiceImpl service){ | ||||
|     public void setSysOssService(SysOssServiceImpl service) { | ||||
|         sysOssService = service; | ||||
|     } | ||||
|  | ||||
| @ -72,7 +75,8 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|     private static final ConcurrentHashMap<String, Integer> userRoomCountMap = new ConcurrentHashMap<>(); | ||||
|     //维护一个在线用户列表 | ||||
|     private static final List<String> onlineUserList = new ArrayList<>(); | ||||
|     public static List<String> getOnlineUserList(){ | ||||
|  | ||||
|     public static List<String> getOnlineUserList() { | ||||
|         return onlineUserList; | ||||
|     } | ||||
|  | ||||
| @ -99,13 +103,13 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|  | ||||
|             //建立双向映射关系 | ||||
|             LoginUser loginUser = LoginHelper.getLoginUser(token.replace("Bearer%20", "")); | ||||
|             if (loginUser == null){ | ||||
|             if (loginUser == null) { | ||||
|                 throw new RuntimeException("token获取信息失败"); | ||||
|             } | ||||
|             //判断是否存在该账号的通道实例列表 | ||||
|             userChannelMap.computeIfAbsent(loginUser.getUserId().toString(), k -> new ArrayList<>()); | ||||
|             List<ChannelHandlerContext> channelHandlerContexts = userChannelMap.get(loginUser.getUserId().toString()); | ||||
|             if (!channelHandlerContexts.contains( ctx)){ | ||||
|             if (!channelHandlerContexts.contains(ctx)) { | ||||
|                 channelHandlerContexts.add(ctx); | ||||
|             } | ||||
|             //把该账号的通道实例列表跟账号id关联 一个账号有多个通道实例 | ||||
| @ -131,7 +135,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|  | ||||
|             //构建各个聊天房间未读 数量 | ||||
|             LambdaQueryWrapper<ChatGroup> queryWrapper = new LambdaQueryWrapper<>(); | ||||
|             queryWrapper.like(ChatGroup::getMembers, loginUser.getUserId()+",").or().like(ChatGroup::getMembers,loginUser.getUserId()+"]"); | ||||
|             queryWrapper.like(ChatGroup::getMembers, loginUser.getUserId() + ",").or().like(ChatGroup::getMembers, loginUser.getUserId() + "]"); | ||||
|             //拿到该用户所参与的房间列表 | ||||
|             List<ChatGroup> chatGroups = chatGroupService.list(queryWrapper); | ||||
|             boolean isHaveSystemRoom = false; | ||||
| @ -150,12 +154,12 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|                     historyLambdaQueryWrapper.eq(ChatHistory::getIsRead, "1"); | ||||
|                     List<ChatHistory> list = chatHistoryService.list(historyLambdaQueryWrapper); | ||||
|                     if (list != null && !list.isEmpty()) { | ||||
|                         roomCounts.put(loginUser.getUserId()+"+"+chatGroup.getId().toString(), list.size()); | ||||
|                         roomCounts.put(loginUser.getUserId() + "+" + chatGroup.getId().toString(), list.size()); | ||||
|                         //连接后同步未读消息到内存中 | ||||
|                         userRoomCountMap.put(loginUser.getUserId()+"+"+chatGroup.getId().toString(), list.size()); | ||||
|                         userRoomCountMap.put(loginUser.getUserId() + "+" + chatGroup.getId().toString(), list.size()); | ||||
|                     } | ||||
|                     //在遍历的同时寻找是否有系统消息房间 | ||||
|                     if (!isHaveSystemRoom && chatGroup.getMembers().contains("["+ ChatRoomEnum.SYSTEM.getRoomId())){ | ||||
|                     if (!isHaveSystemRoom && chatGroup.getMembers().contains("[" + ChatRoomEnum.SYSTEM.getRoomId())) { | ||||
|                         isHaveSystemRoom = true; | ||||
|                     } | ||||
| //                    if (!isHaveAttendanceRoom && chatGroup.getMembers().contains("["+ChatRoomEnum.ATTENDANCE.getRoomId())){ | ||||
| @ -170,18 +174,18 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|                 } | ||||
|                 JSONObject message = new JSONObject(); | ||||
|                 message.put("type", "3"); | ||||
|                 message.put("messageType","txt"); | ||||
|                 message.put("messageType", "txt"); | ||||
|                 message.put("unReadCount", roomCounts); | ||||
|                 log.info("发送所有未读消息:{}",message); | ||||
|                 if(message.get("unReadCount") != null && !roomCounts.isEmpty()) { | ||||
|                 log.info("发送所有未读消息:{}", message); | ||||
|                 if (message.get("unReadCount") != null && !roomCounts.isEmpty()) { | ||||
|                     sendMessage(ctx, message.toJSONString()); | ||||
|                 } | ||||
|             } | ||||
|             //认证完成后开始构建系统消息房间   判断是否有系统消息房间 没有则增加 | ||||
|             if (!isHaveSystemRoom){ | ||||
|             if (!isHaveSystemRoom) { | ||||
|                 ChatGroup chatGroup = new ChatGroup(); | ||||
|                 chatGroup.setType(String.valueOf(2)); | ||||
|                 chatGroup.setMembers("["+ChatRoomEnum.SYSTEM.getRoomId()+", " + loginUser.getUserId()+"]"); | ||||
|                 chatGroup.setMembers("[" + ChatRoomEnum.SYSTEM.getRoomId() + ", " + loginUser.getUserId() + "]"); | ||||
|                 chatGroupService.save(chatGroup); | ||||
|             } | ||||
|  | ||||
| @ -310,9 +314,9 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|             //来自哪个用户 | ||||
|             jsonObject.put("from", sysUserVo.getUserId().toString()); | ||||
|             jsonObject.put("nickName", sysUserVo.getNickName()); | ||||
|             if(sysUserVo.getAvatar() != null){ | ||||
|             if (sysUserVo.getAvatar() != null) { | ||||
|                 SysOssVo byId = sysOssService.getById(sysUserVo.getAvatar()); | ||||
|                 if(byId != null){ | ||||
|                 if (byId != null) { | ||||
|                     jsonObject.put("avatar", byId.getUrl()); | ||||
|                 } | ||||
|             } | ||||
| @ -329,7 +333,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|                     //只要发送一条数据,就要给接收方推送所有未读消息 | ||||
|                     if (!userRoomCountMap.containsKey(id + "+" + RoomId)) { | ||||
|                         userRoomCountMap.put(id + "+" + RoomId, 1); | ||||
|                     }else { | ||||
|                     } else { | ||||
|                         userRoomCountMap.put(id + "+" + RoomId, userRoomCountMap.get(id + "+" + RoomId) + 1); | ||||
|                     } | ||||
|                     //发送消息完成后添加聊天记录 | ||||
| @ -340,7 +344,7 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|                     chatHistory.setIsRead("1"); | ||||
|                     chatHistory.setMessageType(jsonObject.get("messageType").toString()); | ||||
|  | ||||
|                     if (!jsonObject.get("messageType").equals("txt")){ | ||||
|                     if (!jsonObject.get("messageType").equals("txt")) { | ||||
|  | ||||
|                         //将携带base64转为文件然后进行存储 赋值url | ||||
|                         String base64Data = jsonObject.get("message").toString(); | ||||
| @ -390,37 +394,37 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|                 } | ||||
|  | ||||
|             } | ||||
|         }else if ("1".equals(type)){ | ||||
|         } else if ("1".equals(type)) { | ||||
|             log.info("收到客户端确认消息:{}", jsonObject); | ||||
|             //前端接收方收到消息返回1 说明此时处于聊天框内 可以清空该房间的所有未读消息 将此房间聊天记录全部已读 | ||||
|             //现在是用户发送消息 ctx为接收方用户 | ||||
|             LambdaQueryWrapper<ChatHistory> lambdaQueryWrapper = new LambdaQueryWrapper<>(); | ||||
|             lambdaQueryWrapper | ||||
|                 .ne(ChatHistory::getSenderId,sysUserVo.getUserId().toString()) | ||||
|                 .eq(ChatHistory::getGeterId,jsonObject.get("roomId")) | ||||
|                 .eq(ChatHistory::getIsRead,"1"); | ||||
|                 .ne(ChatHistory::getSenderId, sysUserVo.getUserId().toString()) | ||||
|                 .eq(ChatHistory::getGeterId, jsonObject.get("roomId")) | ||||
|                 .eq(ChatHistory::getIsRead, "1"); | ||||
|             List<ChatHistory> list = chatHistoryService.list(lambdaQueryWrapper); | ||||
|             if (list != null && !list.isEmpty()){ | ||||
|             if (list != null && !list.isEmpty()) { | ||||
|                 for (ChatHistory chatHistory : list) { | ||||
|                     chatHistory.setIsRead("0"); | ||||
|                 } | ||||
|             } | ||||
|             chatHistoryService.updateBatchById( list); | ||||
|             chatHistoryService.updateBatchById(list); | ||||
|  | ||||
|             //将该房间未读消息 清空 | ||||
|             userRoomCountMap.put(sysUserVo.getUserId() + "+" + jsonObject.get("roomId"), 0); | ||||
|             //清空过后返回其余房间未读消息 | ||||
|             HashMap<String,Object> temp = new HashMap<>(); | ||||
|             userRoomCountMap.forEachKey(0,key ->{ | ||||
|                 if (key.contains(sysUserVo.getUserId().toString())){ | ||||
|                     temp.put(key,userRoomCountMap.get(key)); | ||||
|             HashMap<String, Object> temp = new HashMap<>(); | ||||
|             userRoomCountMap.forEachKey(0, key -> { | ||||
|                 if (key.contains(sysUserVo.getUserId().toString())) { | ||||
|                     temp.put(key, userRoomCountMap.get(key)); | ||||
|                 } | ||||
|             }); | ||||
|             //构建消息 | ||||
|             JSONObject message = new JSONObject(); | ||||
|             message.put("type", "1"); | ||||
|             message.put("unReadCount", temp); | ||||
|             message.put("messageType","txt"); | ||||
|             message.put("messageType", "txt"); | ||||
|             //发送 | ||||
|             sendMessage(ctx, message.toString()); | ||||
|         } | ||||
| @ -435,21 +439,21 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|     } | ||||
|  | ||||
|     //给固定的人发消息 | ||||
|     private void sendMessage(ChannelHandlerContext ctx,String  message) { | ||||
|     private void sendMessage(ChannelHandlerContext ctx, String message) { | ||||
|  | ||||
|         ctx.channel().writeAndFlush(new TextWebSocketFrame(message)); | ||||
|     } | ||||
|  | ||||
|     //发送群消息,此时其他客户端也能收到群消息 | ||||
|     private void sendAllMessage(){ | ||||
|     private void sendAllMessage() { | ||||
|         String message = "我是服务器,这里发送的是群消息"; | ||||
|         channelGroup.writeAndFlush( new TextWebSocketFrame(message)); | ||||
|         channelGroup.writeAndFlush(new TextWebSocketFrame(message)); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     //通过userId进行发送消息 | ||||
|     @Transactional | ||||
|     public void sendSystemMessageToUser(Long userId, String message,String value){ | ||||
|     public void sendSystemMessageToUser(Long userId, String message, String value) { | ||||
| //        /现在已用type:0 1 3 (暂定为0) | ||||
| //        { | ||||
| //            "type":"4", | ||||
| @ -465,94 +469,116 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|         ChatGroup groupServiceOne = null; | ||||
|         ChatHistory chatHistory = null; | ||||
|  | ||||
|         switch (value){ | ||||
|         switch (value) { | ||||
|             //1:系统消息 | ||||
|             case "0" ->{ | ||||
|             case "0" -> { | ||||
|                 //生成系统消息的聊天记录 | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers,"["+ChatRoomEnum.SYSTEM.getRoomId()+", "+userId+"]"); | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers, "[" + ChatRoomEnum.SYSTEM.getRoomId() + ", " + userId + "]"); | ||||
|                 groupServiceOne = chatGroupService.getOne(lambdaQueryWrapper); | ||||
|                 //如果给成员发送系统消息 而该成员还没有建立过连接从而没有群聊房间 则创建该成员系统消息房间 | ||||
|                 if (groupServiceOne == null){ | ||||
|                 if (groupServiceOne == null) { | ||||
|                     groupServiceOne = new ChatGroup(); | ||||
|                     groupServiceOne.setType(String.valueOf(2)); | ||||
|                     groupServiceOne.setMembers("["+ChatRoomEnum.SYSTEM.getRoomId()+", "+userId+"]"); | ||||
|                     groupServiceOne.setMembers("[" + ChatRoomEnum.SYSTEM.getRoomId() + ", " + userId + "]"); | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 }else { | ||||
|                 } else { | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } | ||||
|                 chatHistory = new ChatHistory(); | ||||
|                 //发送方设置为99 表示系统消息 | ||||
|                 chatHistory.setSenderId(99L); | ||||
|                 jsonObject.put("nickName","系统消息"); | ||||
|                 jsonObject.put("roomType",2); | ||||
|                 jsonObject.put("nickName", "系统消息"); | ||||
|                 jsonObject.put("roomType", 2); | ||||
|             } | ||||
|  | ||||
|             //2:考勤消息 | ||||
|             case "1" ->{ | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers,"["+ChatRoomEnum.ATTENDANCE.getRoomId()+", "+userId+"]"); | ||||
|             case "1" -> { | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers, "[" + ChatRoomEnum.ATTENDANCE.getRoomId() + ", " + userId + "]"); | ||||
|                 groupServiceOne = chatGroupService.getOne(lambdaQueryWrapper); | ||||
|                 //如果给成员发送考勤消息 而该成员还没有建立过连接从而没有考勤房间 则创建该成员考勤消息房间 | ||||
|                 if (groupServiceOne == null){ | ||||
|                 if (groupServiceOne == null) { | ||||
|                     groupServiceOne = new ChatGroup(); | ||||
|                     groupServiceOne.setType(String.valueOf(3)); | ||||
|                     groupServiceOne.setMembers("["+ChatRoomEnum.ATTENDANCE.getRoomId()+", "+userId+"]"); | ||||
|                     groupServiceOne.setMembers("[" + ChatRoomEnum.ATTENDANCE.getRoomId() + ", " + userId + "]"); | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 }else { | ||||
|                 } else { | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } | ||||
|                 chatHistory = new ChatHistory(); | ||||
|                 //发送方设置为100 表示系统消息中的考勤消息 | ||||
|                 chatHistory.setSenderId(100L); | ||||
|                 jsonObject.put("nickName","考勤消息"); | ||||
|                 jsonObject.put("roomType",3); | ||||
|                 jsonObject.put("nickName", "考勤消息"); | ||||
|                 jsonObject.put("roomType", 3); | ||||
|             } | ||||
|  | ||||
|             //安全消息 | ||||
|             case "2" ->{ | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers,"["+ChatRoomEnum.SAFE.getRoomId()+", "+userId+"]"); | ||||
|             case "2" -> { | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers, "[" + ChatRoomEnum.SAFE.getRoomId() + ", " + userId + "]"); | ||||
|                 groupServiceOne = chatGroupService.getOne(lambdaQueryWrapper); | ||||
|                 //如果给成员发送安全消息 而该成员还没有建立过连接从而没有安全消息 则创建该成员安全消息房间 | ||||
|                 if (groupServiceOne == null){ | ||||
|                 if (groupServiceOne == null) { | ||||
|                     groupServiceOne = new ChatGroup(); | ||||
|                     groupServiceOne.setType(String.valueOf(4)); | ||||
|                     groupServiceOne.setMembers("["+ChatRoomEnum.SAFE.getRoomId()+", "+userId+"]"); | ||||
|                     groupServiceOne.setMembers("[" + ChatRoomEnum.SAFE.getRoomId() + ", " + userId + "]"); | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 }else { | ||||
|                 } else { | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } | ||||
|                 chatHistory = new ChatHistory(); | ||||
|                 //发送方设置为101 表示系统消息中的安全消息 | ||||
|                 chatHistory.setSenderId(101L); | ||||
|                 jsonObject.put("nickName","安全消息"); | ||||
|                 jsonObject.put("roomType",4); | ||||
|                 jsonObject.put("nickName", "安全消息"); | ||||
|                 jsonObject.put("roomType", 4); | ||||
|             } | ||||
|  | ||||
|             //质量消息 | ||||
|             case "3" ->{ | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers,"["+ChatRoomEnum.QUALITY.getRoomId()+", "+userId+"]"); | ||||
|             case "3" -> { | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers, "[" + ChatRoomEnum.QUALITY.getRoomId() + ", " + userId + "]"); | ||||
|                 groupServiceOne = chatGroupService.getOne(lambdaQueryWrapper); | ||||
|                 //如果给成员发送质量消息 而该成员还没有建立过连接从而没有质量消息 则创建该成员质量消息房间 | ||||
|                 if (groupServiceOne == null){ | ||||
|                 if (groupServiceOne == null) { | ||||
|                     groupServiceOne = new ChatGroup(); | ||||
|                     groupServiceOne.setType(String.valueOf(5)); | ||||
|                     groupServiceOne.setMembers("["+ChatRoomEnum.QUALITY.getRoomId()+", "+userId+"]"); | ||||
|                     groupServiceOne.setMembers("[" + ChatRoomEnum.QUALITY.getRoomId() + ", " + userId + "]"); | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 }else { | ||||
|                 } else { | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } | ||||
|                 chatHistory = new ChatHistory(); | ||||
|                 //发送方设置为102 表示系统消息中的质量消息 | ||||
|                 chatHistory.setSenderId(102L); | ||||
|                 jsonObject.put("nickName","质量消息"); | ||||
|                 jsonObject.put("roomType",5); | ||||
|                 jsonObject.put("nickName", "质量消息"); | ||||
|                 jsonObject.put("roomType", 5); | ||||
|             } | ||||
|  | ||||
|             // 车辆消息 | ||||
|             case "4" -> { | ||||
|                 lambdaQueryWrapper.eq(ChatGroup::getMembers, "[" + ChatRoomEnum.VEHICLE.getRoomId() + ", " + userId + "]"); | ||||
|                 groupServiceOne = chatGroupService.getOne(lambdaQueryWrapper); | ||||
|                 //如果给成员发送车辆消息 而该成员还没有建立过连接从而没有车辆消息 则创建该成员车辆消息房间 | ||||
|                 if (groupServiceOne == null) { | ||||
|                     groupServiceOne = new ChatGroup(); | ||||
|                     groupServiceOne.setType(String.valueOf(6)); | ||||
|                     groupServiceOne.setMembers("[" + ChatRoomEnum.VEHICLE.getRoomId() + ", " + userId + "]"); | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } else { | ||||
|                     groupServiceOne.setLastMessage(message); | ||||
|                     groupServiceOne.setLastMessageTime(new Date()); | ||||
|                 } | ||||
|                 chatHistory = new ChatHistory(); | ||||
|                 //发送方设置为103 表示系统消息中的车辆消息 | ||||
|                 chatHistory.setSenderId(103L); | ||||
|                 jsonObject.put("nickName", "车辆消息"); | ||||
|                 jsonObject.put("roomType", 6); | ||||
|             } | ||||
|  | ||||
|             default -> { | ||||
| @ -572,12 +598,12 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|         chatHistoryService.save(chatHistory); | ||||
|  | ||||
|         //发送消息后 将该房间未读消息数加1 | ||||
|         if (userRoomCountMap.containsKey(userId+"+"+groupServiceOne.getId())){ | ||||
|         if (userRoomCountMap.containsKey(userId + "+" + groupServiceOne.getId())) { | ||||
|             //该房间未读消息数加1 | ||||
|             userRoomCountMap.put(userId+"+"+groupServiceOne.getId(), userRoomCountMap.get(userId+"+"+groupServiceOne.getId())+1); | ||||
|         }else{ | ||||
|             userRoomCountMap.put(userId + "+" + groupServiceOne.getId(), userRoomCountMap.get(userId + "+" + groupServiceOne.getId()) + 1); | ||||
|         } else { | ||||
|             //将该房间未读消息数设置为1 | ||||
|             userRoomCountMap.put(userId+"+"+groupServiceOne.getId(), 1); | ||||
|             userRoomCountMap.put(userId + "+" + groupServiceOne.getId(), 1); | ||||
|         } | ||||
|  | ||||
|         //通过userId拿到该用户所有通道实例 | ||||
| @ -595,10 +621,10 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|  | ||||
|     //设置未读消息数 | ||||
|     private void setUnReadCount(Long userId, JSONObject jsonObject) { | ||||
|         HashMap<String,Object> temp = new HashMap<>(); | ||||
|         HashMap<String, Object> temp = new HashMap<>(); | ||||
|         userRoomCountMap.forEachKey(0, (value) -> { | ||||
|             if (value.contains(userId.toString())){ | ||||
|                 temp.put(value,userRoomCountMap.get(value)); | ||||
|             if (value.contains(userId.toString())) { | ||||
|                 temp.put(value, userRoomCountMap.get(value)); | ||||
|             } | ||||
|         }); | ||||
|         jsonObject.put("unReadCount", temp); | ||||
| @ -606,23 +632,23 @@ public class ChatServerHandler extends SimpleChannelInboundHandler<TextWebSocket | ||||
|  | ||||
|  | ||||
|     //用于房间创建后发送确认消息 | ||||
|     public void sendRoomInfo(Long userId,ChatGroup chatGroup){ | ||||
|     public void sendRoomInfo(Long userId, ChatGroup chatGroup) { | ||||
|         //通过ID找到所有通道 发送消息 | ||||
|         List<ChannelHandlerContext> channelHandlerContexts = userChannelMap.get(userId.toString()); | ||||
|         if (channelHandlerContexts == null||channelHandlerContexts.isEmpty()){ | ||||
|         if (channelHandlerContexts == null || channelHandlerContexts.isEmpty()) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         JSONObject jsonObject = new JSONObject(); | ||||
|         jsonObject.put("type", "5"); | ||||
|         jsonObject.put("messageType","txt"); | ||||
|         jsonObject.put("messageType", "txt"); | ||||
|         jsonObject.put("roomInfo", chatGroup); | ||||
|  | ||||
|         for (ChannelHandlerContext channelHandlerContext : channelHandlerContexts) { | ||||
|             sendMessage(channelHandlerContext, String.valueOf(jsonObject)); | ||||
|         } | ||||
|  | ||||
|         log.info("发送房间创建确认消息:{}",jsonObject); | ||||
|         log.info("发送房间创建确认消息:{}", jsonObject); | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -14,7 +14,9 @@ public enum ChatRoomEnum { | ||||
|  | ||||
|     SAFE("101", "安全消息"), | ||||
|  | ||||
|     QUALITY("102", "质量消息"); | ||||
|     QUALITY("102", "质量消息"), | ||||
|  | ||||
|     VEHICLE("103", "车辆消息"); | ||||
|  | ||||
|     /** | ||||
|      * ID | ||||
|  | ||||
| @ -2,6 +2,10 @@ package org.dromara.xzd.biddingManagement.biaoqianlixiang.service.impl; | ||||
|  | ||||
| import cn.hutool.core.bean.BeanUtil; | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.PageQuery; | ||||
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
| @ -10,6 +14,7 @@ import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.utils.BatchNumberGenerator; | ||||
| import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.XzdBqlxProjectInfo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.XzdProjectRiskAssessment; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.bo.XzdBqlxProjectInfoBo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.dto.BiddingManagementDto; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.dto.QuerBiddingManagementDto; | ||||
| @ -19,6 +24,7 @@ import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBqlxProjec | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdBqlxProjectInfoService; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.bo.XzdBidPreProjectBo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBidPreProjectVo; | ||||
| @ -40,6 +46,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBidPreProjectServiceImpl extends ServiceImpl<XzdBidPreProjectMapper, XzdBidPreProject> implements IXzdBidPreProjectService { | ||||
|  | ||||
|     private final XzdBidPreProjectMapper baseMapper; | ||||
| @ -246,6 +253,50 @@ public class XzdBidPreProjectServiceImpl extends ServiceImpl<XzdBidPreProjectMap | ||||
|  | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('xzdbqlx')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("标前立项审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBidPreProject vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdbqlx')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("标前立项审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdbqlx')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("标前立项删除流程事件,标前立项审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.biaoqianlixiang.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -20,7 +24,9 @@ import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdProjectRis | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.mapper.XzdProjectRiskAssessmentMapper; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdBidPreProjectService; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdProjectRiskAssessmentService; | ||||
| import org.dromara.xzd.comprehensive.domain.XzdCsContractInformation; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
|  | ||||
| @ -37,6 +43,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdProjectRiskAssessmentServiceImpl extends ServiceImpl<XzdProjectRiskAssessmentMapper, XzdProjectRiskAssessment> implements IXzdProjectRiskAssessmentService { | ||||
|  | ||||
|     private final XzdProjectRiskAssessmentMapper baseMapper; | ||||
| @ -137,16 +144,10 @@ public class XzdProjectRiskAssessmentServiceImpl extends ServiceImpl<XzdProjectR | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getDocumentNumber()), XzdProjectRiskAssessment::getDocumentNumber, bo.getDocumentNumber()); | ||||
|         lqw.like(StringUtils.isNotBlank(bo.getProjectName()), XzdProjectRiskAssessment::getProjectName, bo.getProjectName()); | ||||
|         lqw.eq(StringUtils.isNotBlank(bo.getProjectBusinessOwner()), XzdProjectRiskAssessment::getProjectBusinessOwner, bo.getProjectBusinessOwner()); | ||||
|         lqw.eq(bo.getCreateBy() != null,XzdProjectRiskAssessment::getCreateBy, bo.getCreateBy()); | ||||
|         lqw.ge(bo.getStartTime() != null, XzdProjectRiskAssessment::getCreateTime, bo.getStartTime()); | ||||
|         lqw.le(bo.getEndTime() != null, XzdProjectRiskAssessment::getCreateTime, bo.getEndTime()); | ||||
|  | ||||
|         if (bo.getCreateBy() != null) { | ||||
|             lqw.eq(XzdProjectRiskAssessment::getCreateBy, bo.getCreateBy()); | ||||
|         } | ||||
|         if (bo.getCreateBy() != null) { | ||||
|             lqw.ge( XzdProjectRiskAssessment::getCreateTime, bo.getStartTime()); | ||||
|         } | ||||
|         if (bo.getEndTime() != null) { | ||||
|             lqw.le( XzdProjectRiskAssessment::getCreateTime, bo.getEndTime()); | ||||
|         } | ||||
|  | ||||
|         return lqw; | ||||
|     } | ||||
| @ -216,4 +217,51 @@ public class XzdProjectRiskAssessmentServiceImpl extends ServiceImpl<XzdProjectR | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdxmfxpg')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("项目风险评估签审意见审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdProjectRiskAssessment vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdxmfxpg')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("项目风险评估签审意见审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdxmfxpg')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("项目风险评估签审意见删除流程事件,项目风险评估签审意见审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.biddingDocument.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -11,10 +15,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.utils.BatchNumberGenerator; | ||||
| import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.XzdProjectRiskAssessment; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.QuerListXzdBidPreVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBidPreProjectVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdBidPreProjectService; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocument.domain.bo.XzdBiddingFileEstimateBo; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocument.domain.vo.XzdBiddingFileEstimateVo; | ||||
| @ -38,6 +44,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBiddingFileEstimateServiceImpl extends ServiceImpl<XzdBiddingFileEstimateMapper, XzdBiddingFileEstimate> implements IXzdBiddingFileEstimateService { | ||||
|  | ||||
|     private final XzdBiddingFileEstimateMapper baseMapper; | ||||
| @ -195,4 +202,52 @@ public class XzdBiddingFileEstimateServiceImpl extends ServiceImpl<XzdBiddingFil | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdztbwj')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("招标文件审估审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBiddingFileEstimate vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdztbwj')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("招标文件审估审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdztbwj')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("招标文件审估删除流程事件,招标文件审估审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -68,12 +68,24 @@ public class XzdBiddingDocumentVo implements Serializable { | ||||
|     @ExcelProperty(value = "项目名称") | ||||
|     private String projectName; | ||||
|  | ||||
|     /** | ||||
|      * 项目名称 | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目名称") | ||||
|     private String projectNames; | ||||
|  | ||||
|     /** | ||||
|      * 项目类型ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目类型ID") | ||||
|     private Long projectType; | ||||
|  | ||||
|     /** | ||||
|      * 项目类型ID | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目类型ID") | ||||
|     private String projectTypeName; | ||||
|  | ||||
|     /** | ||||
|      * 投标单位 | ||||
|      */ | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.biddingDocumentList.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -11,6 +15,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.utils.BatchNumberGenerator; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.XzdBidPreProject; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.QuerListXzdBidPreVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBidPreProjectVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.mapper.XzdBidPreProjectMapper; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdBidPreProjectService; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.domain.XzdBiddingDocument; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.domain.XzdTbwjBusinessBid; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.domain.XzdTbwjTechnicalBid; | ||||
| @ -25,9 +33,13 @@ import org.dromara.xzd.biddingManagement.biddingDocumentList.service.IXzdBidding | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.service.IXzdTbwjBusinessBidService; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.service.IXzdTbwjTechnicalBidService; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocumentList.service.IXzdTbwjZsyqService; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoneyWithdraw.domain.XzdBidDepositRecovery; | ||||
| import org.dromara.xzd.domain.vo.XzdProjectTypeVo; | ||||
| import org.dromara.xzd.service.IXzdProjectTypeService; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.locationtech.jts.edgegraph.HalfEdge; | ||||
| import org.springframework.beans.BeanUtils; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
|  | ||||
| @ -45,6 +57,7 @@ import java.util.Collection; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBiddingDocumentServiceImpl extends ServiceImpl<XzdBiddingDocumentMapper, XzdBiddingDocument> implements IXzdBiddingDocumentService { | ||||
|  | ||||
|     private final XzdBiddingDocumentMapper baseMapper; | ||||
| @ -59,6 +72,10 @@ public class XzdBiddingDocumentServiceImpl extends ServiceImpl<XzdBiddingDocumen | ||||
|  | ||||
|     private final IXzdTbwjZsyqService iXzdTbwjZsyqService; | ||||
|  | ||||
|     private final IXzdProjectTypeService xzdProjectTypeService; | ||||
|  | ||||
|     private final XzdBidPreProjectMapper xzdBidPreProjectMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询投标文件 | ||||
|      * | ||||
| @ -75,6 +92,7 @@ public class XzdBiddingDocumentServiceImpl extends ServiceImpl<XzdBiddingDocumen | ||||
|         List<XzdTbwjZsyq> xzdTbwjZsyqs = iXzdTbwjZsyqService.getBaseMapper().selectList(new LambdaQueryWrapper<XzdTbwjZsyq>().eq(XzdTbwjZsyq::getMasterId, id)); | ||||
|  | ||||
|  | ||||
|         getName(xzdBiddingDocumentVo); | ||||
|         bylist.setXzdBiddingDocument(xzdBiddingDocumentVo); | ||||
|         bylist.setXzdTbwjTechnicalBidVo(xzdTbwjTechnicalBid); | ||||
|         bylist.setXzdTbwjBusinessBidVo(xzdTbwjBusinessBid); | ||||
| @ -94,9 +112,32 @@ public class XzdBiddingDocumentServiceImpl extends ServiceImpl<XzdBiddingDocumen | ||||
|     public TableDataInfo<XzdBiddingDocumentVo> queryPageList(XzdBiddingDocumentBo bo, PageQuery pageQuery) { | ||||
|         LambdaQueryWrapper<XzdBiddingDocument> lqw = buildQueryWrapper(bo); | ||||
|         Page<XzdBiddingDocumentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); | ||||
|         result.getRecords().forEach(this::getName); | ||||
|  | ||||
|         return TableDataInfo.build(result); | ||||
|     } | ||||
|  | ||||
|     private void getName(XzdBiddingDocumentVo xzdBiddingDocumentVo) { | ||||
|  | ||||
|         if (xzdBiddingDocumentVo != null){ | ||||
|             Long projectType = xzdBiddingDocumentVo.getProjectType(); | ||||
|             if (projectType != null){ | ||||
|                 XzdProjectTypeVo xzdProjectTypeVo = xzdProjectTypeService.queryById(projectType); | ||||
|                 if (xzdProjectTypeVo != null){ | ||||
|                     xzdBiddingDocumentVo.setProjectTypeName(xzdProjectTypeVo.getTypeName()); | ||||
|                 } | ||||
|             } | ||||
|             String projectName = xzdBiddingDocumentVo.getProjectName(); | ||||
|             if (StringUtils.isNotBlank(projectName)){ | ||||
|                 XzdBidPreProjectVo xzdBidPreProjectVo = xzdBidPreProjectMapper.selectVoById(Long.parseLong(projectName)); | ||||
|                 if (xzdBidPreProjectVo != null){ | ||||
|                     xzdBiddingDocumentVo.setProjectNames(xzdBidPreProjectVo.getProjectName()); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询符合条件的投标文件列表 | ||||
|      * | ||||
| @ -246,4 +287,56 @@ public class XzdBiddingDocumentServiceImpl extends ServiceImpl<XzdBiddingDocumen | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdtbwj')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("投标文件审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBiddingDocument vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdtbwj')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("投标文件审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdtbwj')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("投标文件删除流程事件,投标文件审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.earnestMoney.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -21,9 +25,11 @@ import org.dromara.xzd.biddingManagement.earnestMoney.domain.vo.XzdBidDepositPay | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.domain.vo.XzdBidDepositPaymentVo; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.mapper.XzdBidDepositPaymentMapper; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.service.IXzdBidDepositPaymentService; | ||||
| import org.dromara.xzd.biddingManagement.paymentapplication.domain.XzdBiddingAgencyFeePayment; | ||||
| import org.dromara.xzd.service.impl.XzdSupplierInfoServiceImpl; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
|  | ||||
| import java.time.LocalDate; | ||||
| @ -41,6 +47,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBidDepositPaymentServiceImpl extends ServiceImpl<XzdBidDepositPaymentMapper, XzdBidDepositPayment> implements IXzdBidDepositPaymentService { | ||||
|  | ||||
|     private final XzdBidDepositPaymentMapper baseMapper; | ||||
| @ -208,4 +215,52 @@ public class XzdBidDepositPaymentServiceImpl extends ServiceImpl<XzdBidDepositPa | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdtbbzjjn')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("投标保证金缴纳审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBidDepositPayment vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdtbbzjjn')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("投标保证金缴纳审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdtbbzjjn')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("投标保证金缴纳删除流程事件,投标保证金缴纳审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -182,7 +182,7 @@ public class XzdBidDepositRecoveryBo extends BaseEntity { | ||||
|     /** | ||||
|      * 收款账户 | ||||
|      */ | ||||
|     private Integer gatheringNumber; | ||||
|     private String gatheringNumber; | ||||
|  | ||||
|     private Long deptId; | ||||
|  | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.earnestMoneyWithdraw.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -11,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import org.dromara.common.utils.BatchNumberGenerator; | ||||
| import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.domain.XzdBidDepositPayment; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.domain.vo.XzdBidDepositPaymentByBqlx; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoney.service.IXzdBidDepositPaymentService; | ||||
| import org.dromara.xzd.biddingManagement.earnestMoneyWithdraw.domain.XzdBidDepositRecovery; | ||||
| @ -22,6 +27,7 @@ import org.dromara.xzd.biddingManagement.earnestMoneyWithdraw.service.IXzdBidDep | ||||
| import org.dromara.xzd.domain.vo.XzdSupplierInfoVo; | ||||
| import org.dromara.xzd.service.IXzdSupplierInfoService; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import java.time.LocalDate; | ||||
| import java.util.Arrays; | ||||
| @ -39,6 +45,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBidDepositRecoveryServiceImpl extends ServiceImpl<XzdBidDepositRecoveryMapper, XzdBidDepositRecovery> implements IXzdBidDepositRecoveryService { | ||||
|  | ||||
|     private final XzdBidDepositRecoveryMapper baseMapper; | ||||
| @ -220,4 +227,51 @@ public class XzdBidDepositRecoveryServiceImpl extends ServiceImpl<XzdBidDepositR | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdtbbzjsh')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("投标保证金收回审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBidDepositRecovery vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdtbbzjsh')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("投标保证金收回审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdtbbzjsh')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("投标保证金收回删除流程事件,投标保证金收回审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -1,6 +1,10 @@ | ||||
| package org.dromara.xzd.biddingManagement.paymentapplication.service.impl; | ||||
|  | ||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| import org.dromara.common.core.domain.event.ProcessDeleteEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessEvent; | ||||
| import org.dromara.common.core.domain.event.ProcessTaskEvent; | ||||
| import org.dromara.common.core.utils.MapstructUtils; | ||||
| import org.dromara.common.core.utils.StringUtils; | ||||
| import org.dromara.common.mybatis.core.page.TableDataInfo; | ||||
| @ -14,7 +18,9 @@ import org.dromara.system.service.impl.SysOssServiceImpl; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.QuerListXzdBidPreVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.domain.vo.XzdBidPreProjectVo; | ||||
| import org.dromara.xzd.biddingManagement.biaoqianlixiang.service.IXzdBidPreProjectService; | ||||
| import org.dromara.xzd.biddingManagement.biddingDocument.domain.XzdBiddingFileEstimate; | ||||
| import org.dromara.xzd.utilS.AreaUtil; | ||||
| import org.springframework.context.event.EventListener; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.dromara.xzd.biddingManagement.paymentapplication.domain.bo.XzdBiddingAgencyFeePaymentBo; | ||||
| import org.dromara.xzd.biddingManagement.paymentapplication.domain.vo.XzdBiddingAgencyFeePaymentVo; | ||||
| @ -38,6 +44,7 @@ import java.util.stream.Collectors; | ||||
|  */ | ||||
| @RequiredArgsConstructor | ||||
| @Service | ||||
| @Slf4j | ||||
| public class XzdBiddingAgencyFeePaymentServiceImpl extends ServiceImpl<XzdBiddingAgencyFeePaymentMapper, XzdBiddingAgencyFeePayment> implements IXzdBiddingAgencyFeePaymentService { | ||||
|  | ||||
|     private final XzdBiddingAgencyFeePaymentMapper baseMapper; | ||||
| @ -188,4 +195,51 @@ public class XzdBiddingAgencyFeePaymentServiceImpl extends ServiceImpl<XzdBiddin | ||||
|         } | ||||
|         return baseMapper.deleteByIds(ids) > 0; | ||||
|     } | ||||
|     /** | ||||
|      * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) | ||||
|      * 正常使用只需#processEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processEvent.flowCode.endsWith('xzdzbdlfwfsq')") | ||||
|     public void processPlansHandlErequipmentList(ProcessEvent processEvent) { | ||||
|         log.info("招标代理服务费支付申请审核任务执行了{}", processEvent.toString()); | ||||
|         String id = processEvent.getBusinessId(); | ||||
|         XzdBiddingAgencyFeePayment vo = baseMapper.selectById(Long.valueOf(id)); | ||||
|         if (vo == null) { | ||||
|             return; | ||||
|         } | ||||
|         vo.setAuditStatus(processEvent.getStatus()); | ||||
|         this.updateById(vo); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 执行任务创建监听 | ||||
|      * 示例:也可通过  @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断 | ||||
|      * 在方法中判断流程节点key | ||||
|      * if ("xxx".equals(processTaskEvent.getNodeCode())) { | ||||
|      * //执行业务逻辑 | ||||
|      * } | ||||
|      * | ||||
|      * @param processTaskEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processTaskEvent.flowCode.endsWith('xzdzbdlfwfsq')") | ||||
|     public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) { | ||||
|         log.info("招标代理服务费支付申请审核任务创建了{}", processTaskEvent.toString()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 监听删除流程事件 | ||||
|      * 正常使用只需#processDeleteEvent.flowCode=='leave1' | ||||
|      * 示例为了方便则使用startsWith匹配了全部示例key | ||||
|      * | ||||
|      * @param processDeleteEvent 参数 | ||||
|      */ | ||||
|     @EventListener(condition = "#processDeleteEvent.flowCode.endsWith('xzdzbdlfwfsq')") | ||||
|     public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) { | ||||
|         log.info("招标代理服务费支付申请删除流程事件,招标代理服务费支付申请审核任务执行了{}", processDeleteEvent.toString()); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.*; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDate; | ||||
| import java.util.Date; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| @ -44,7 +45,7 @@ public class XzdPostBidAnalysis extends BaseEntity { | ||||
|     /** | ||||
|      * 工程造价(万元) | ||||
|      */ | ||||
|     private Long projectCost; | ||||
|     private BigDecimal projectCost; | ||||
|  | ||||
|     /** | ||||
|      * 项目类型 | ||||
| @ -79,12 +80,12 @@ public class XzdPostBidAnalysis extends BaseEntity { | ||||
|     /** | ||||
|      * 招标控制价(万元) | ||||
|      */ | ||||
|     private Long controlPrice; | ||||
|     private BigDecimal controlPrice; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(万元) | ||||
|      */ | ||||
|     private Long finalQuote; | ||||
|     private BigDecimal finalQuote; | ||||
|  | ||||
|     /** | ||||
|      * 投标结果 | ||||
| @ -104,7 +105,7 @@ public class XzdPostBidAnalysis extends BaseEntity { | ||||
|     /** | ||||
|      * 最终报价(元) | ||||
|      */ | ||||
|     private Long finalQuoteYuan; | ||||
|     private BigDecimal finalQuoteYuan; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(大写) | ||||
|  | ||||
| @ -8,6 +8,7 @@ import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import jakarta.validation.constraints.*; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDate; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
| @ -45,7 +46,7 @@ public class XzdPostBidAnalysisBo extends BaseEntity { | ||||
|     /** | ||||
|      * 工程造价(万元) | ||||
|      */ | ||||
|     private Long projectCost; | ||||
|     private BigDecimal projectCost; | ||||
|  | ||||
|     /** | ||||
|      * 项目类型 | ||||
| @ -80,12 +81,12 @@ public class XzdPostBidAnalysisBo extends BaseEntity { | ||||
|     /** | ||||
|      * 招标控制价(万元) | ||||
|      */ | ||||
|     private Long controlPrice; | ||||
|     private BigDecimal controlPrice; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(万元) | ||||
|      */ | ||||
|     private Long finalQuote; | ||||
|     private BigDecimal finalQuote; | ||||
|  | ||||
|     /** | ||||
|      * 投标结果 | ||||
| @ -106,7 +107,7 @@ public class XzdPostBidAnalysisBo extends BaseEntity { | ||||
|     /** | ||||
|      * 最终报价(元) | ||||
|      */ | ||||
|     private Long finalQuoteYuan; | ||||
|     private BigDecimal finalQuoteYuan; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(大写) | ||||
|  | ||||
| @ -1,7 +1,11 @@ | ||||
| package org.dromara.xzd.biddingManagement.postAnalysis.domain.vo; | ||||
|  | ||||
| import java.math.BigDecimal; | ||||
| import java.time.LocalDate; | ||||
| import java.util.Date; | ||||
|  | ||||
| import com.baomidou.mybatisplus.annotation.FieldFill; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.fasterxml.jackson.annotation.JsonFormat; | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| @ -9,6 +13,8 @@ import org.dromara.common.excel.annotation.ExcelDictFormat; | ||||
| import org.dromara.common.excel.convert.ExcelDictConvert; | ||||
| import io.github.linpeilie.annotations.AutoMapper; | ||||
| import lombok.Data; | ||||
| import org.dromara.common.translation.annotation.Translation; | ||||
| import org.dromara.common.translation.constant.TransConstant; | ||||
| import org.dromara.xzd.biddingManagement.postAnalysis.domain.XzdBhfxDwpm; | ||||
| import org.dromara.xzd.biddingManagement.postAnalysis.domain.XzdPostBidAnalysis; | ||||
|  | ||||
| @ -50,11 +56,18 @@ public class XzdPostBidAnalysisVo implements Serializable { | ||||
|     @ExcelProperty(value = "项目名称") | ||||
|     private String projectName; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 项目名称 | ||||
|      */ | ||||
|     @ExcelProperty(value = "项目名称") | ||||
|     private String projectNames; | ||||
|  | ||||
|     /** | ||||
|      * 工程造价(万元) | ||||
|      */ | ||||
|     @ExcelProperty(value = "工程造价(万元)") | ||||
|     private Long projectCost; | ||||
|     private BigDecimal projectCost; | ||||
|  | ||||
|     /** | ||||
|      * 项目类型 | ||||
| @ -96,13 +109,13 @@ public class XzdPostBidAnalysisVo implements Serializable { | ||||
|      * 招标控制价(万元) | ||||
|      */ | ||||
|     @ExcelProperty(value = "招标控制价(万元)") | ||||
|     private Long controlPrice; | ||||
|     private BigDecimal controlPrice; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(万元) | ||||
|      */ | ||||
|     @ExcelProperty(value = "最终报价(万元)") | ||||
|     private Long finalQuote; | ||||
|     private BigDecimal finalQuote; | ||||
|  | ||||
|     /** | ||||
|      * 投标结果 | ||||
| @ -127,7 +140,7 @@ public class XzdPostBidAnalysisVo implements Serializable { | ||||
|      * 最终报价(元) | ||||
|      */ | ||||
|     @ExcelProperty(value = "最终报价(元)") | ||||
|     private Long finalQuoteYuan; | ||||
|     private BigDecimal finalQuoteYuan; | ||||
|  | ||||
|     /** | ||||
|      * 最终报价(大写) | ||||
| @ -153,6 +166,24 @@ public class XzdPostBidAnalysisVo implements Serializable { | ||||
|     @ExcelProperty(value = "审核状态") | ||||
|     private String auditStatus; | ||||
|  | ||||
|     /** | ||||
|      * 创建者 | ||||
|      */ | ||||
|     @TableField(fill = FieldFill.INSERT) | ||||
|     private Long createBy; | ||||
|  | ||||
|  | ||||
|     @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "createBy") | ||||
|     private String createByName; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 创建时间 | ||||
|      */ | ||||
|     @TableField(fill = FieldFill.INSERT) | ||||
|     private Date createTime; | ||||
|  | ||||
|  | ||||
|     private List<XzdBhfxDwpmVo> pm; | ||||
|  | ||||
|  | ||||
|  | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	