Compare commits
2 Commits
ddd2868db2
...
4ef0ff2324
| Author | SHA1 | Date |
|---|---|---|
|
|
4ef0ff2324 | |
|
|
702ac4dba5 |
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"java.compile.nullAnalysis.mode": "automatic"
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
# 网关路由配置修复说明
|
||||
|
||||
## 问题分析
|
||||
|
||||
您的网关配置中已经包含了 `ruoyi-system` 和 `ruoyi-manage` 的路由,但是 **缺少 Swagger 文档的专门路由**。
|
||||
|
||||
### 当前路由配置
|
||||
- `ruoyi-system` → `/system/**`
|
||||
- `ruoyi-manage` → `/manage/**`
|
||||
|
||||
### Swagger 文档访问路径
|
||||
- `ruoyi-system` Swagger → `/ruoyi-system/v3/api-docs`
|
||||
- `ruoyi-manage` Swagger → `/ruoyi-manage/v3/api-docs`
|
||||
|
||||
**问题**:`/ruoyi-system/v3/api-docs` 和 `/ruoyi-manage/v3/api-docs` 无法匹配现有的路由规则!
|
||||
|
||||
## 解决方案
|
||||
|
||||
在 Nacos 配置中心的 `ruoyi-gateway-dev.yml` 文件中,添加 Swagger 文档的专门路由:
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
lowerCaseServiceId: true
|
||||
enabled: true
|
||||
routes:
|
||||
# 认证中心
|
||||
- id: ruoyi-auth
|
||||
uri: lb://ruoyi-auth
|
||||
predicates:
|
||||
- Path=/auth/**
|
||||
filters:
|
||||
- CacheRequestBody
|
||||
- ValidateCodeFilter
|
||||
- StripPrefix=1
|
||||
# 代码生成
|
||||
- id: ruoyi-gen
|
||||
uri: lb://ruoyi-gen
|
||||
predicates:
|
||||
- Path=/code/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 定时任务
|
||||
- id: ruoyi-job
|
||||
uri: lb://ruoyi-job
|
||||
predicates:
|
||||
- Path=/schedule/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 系统模块
|
||||
- id: ruoyi-system
|
||||
uri: lb://ruoyi-system
|
||||
predicates:
|
||||
- Path=/system/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 系统模块 Swagger 文档(新增)
|
||||
- id: ruoyi-system-swagger
|
||||
uri: lb://ruoyi-system
|
||||
predicates:
|
||||
- Path=/ruoyi-system/v3/api-docs/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 文件服务
|
||||
- id: ruoyi-file
|
||||
uri: lb://ruoyi-file
|
||||
predicates:
|
||||
- Path=/file/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 物业施工作业管理系统
|
||||
- id: ruoyi-manage
|
||||
uri: lb://ruoyi-manage
|
||||
predicates:
|
||||
- Path=/manage/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# 物业施工作业管理系统 Swagger 文档(新增)
|
||||
- id: ruoyi-manage-swagger
|
||||
uri: lb://ruoyi-manage
|
||||
predicates:
|
||||
- Path=/ruoyi-manage/v3/api-docs/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
```
|
||||
|
||||
## 操作步骤
|
||||
|
||||
1. 登录 Nacos 控制台:`http://127.0.0.1:8848/nacos`
|
||||
2. 进入"配置管理" -> "配置列表"
|
||||
3. 找到 `ruoyi-gateway-dev.yml` 配置文件
|
||||
4. 在 `routes` 列表中添加上述两个 Swagger 路由配置
|
||||
5. 点击"发布"保存配置
|
||||
6. **重启网关服务**(`ruoyi-gateway`)
|
||||
|
||||
## 验证
|
||||
|
||||
配置完成后,访问以下 URL 验证:
|
||||
|
||||
1. **Swagger 文档**:
|
||||
- `http://localhost:8080/ruoyi-system/v3/api-docs` - 应该返回系统模块的 API 文档 JSON
|
||||
- `http://localhost:8080/ruoyi-manage/v3/api-docs` - 应该返回管理模块的 API 文档 JSON
|
||||
|
||||
2. **Swagger UI**:
|
||||
- `http://localhost:8080/swagger-ui.html` 或 `http://localhost:8080/doc.html`
|
||||
- 在服务下拉列表中应该能看到 `ruoyi-system` 和 `ruoyi-manage`
|
||||
- 选择服务后应该能看到"用户管理"和"部门管理"的接口
|
||||
|
||||
3. **业务接口**:
|
||||
- `http://localhost:8080/system/user/list` - 用户列表
|
||||
- `http://localhost:8080/system/dept/list` - 部门列表
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 路由配置修改后必须重启网关服务才能生效
|
||||
- `StripPrefix=1` 表示去掉路径的第一段(如 `/ruoyi-system/v3/api-docs` 会变成 `/v3/api-docs` 转发到后端服务)
|
||||
- Swagger 文档路径已经在白名单中(`/*/v3/api-docs`),不需要认证即可访问
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
# 网关路由配置说明
|
||||
|
||||
## 问题分析
|
||||
|
||||
用户管理和部门管理的 Swagger 接口不显示,可能是因为网关路由配置缺失。
|
||||
|
||||
## 网关路由配置位置
|
||||
|
||||
网关路由配置在 **Nacos 配置中心**,配置文件名:`application-dev.yml`(根据环境可能是 `application-prod.yml` 等)
|
||||
|
||||
## 需要检查的配置
|
||||
|
||||
### 1. 登录 Nacos 控制台
|
||||
- 地址:`http://127.0.0.1:8848/nacos`
|
||||
- 用户名/密码:`nacos/nacos`(默认)
|
||||
|
||||
### 2. 查找配置文件
|
||||
- **Data ID**: `application-dev.yml`
|
||||
- **Group**: `DEFAULT_GROUP`
|
||||
- **命名空间**: 根据实际情况选择
|
||||
|
||||
### 3. 检查路由配置
|
||||
|
||||
网关路由配置应该包含以下内容:
|
||||
|
||||
```yaml
|
||||
spring:
|
||||
cloud:
|
||||
gateway:
|
||||
discovery:
|
||||
locator:
|
||||
enabled: true # 启用服务发现自动路由
|
||||
lower-case-service-id: true # 服务ID转小写
|
||||
routes:
|
||||
# ruoyi-system 路由配置
|
||||
- id: ruoyi-system
|
||||
uri: lb://ruoyi-system
|
||||
predicates:
|
||||
- Path=/system/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# ruoyi-manage 路由配置
|
||||
- id: ruoyi-manage
|
||||
uri: lb://ruoyi-manage
|
||||
predicates:
|
||||
- Path=/manage/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
# Swagger 路由配置
|
||||
- id: ruoyi-system-swagger
|
||||
uri: lb://ruoyi-system
|
||||
predicates:
|
||||
- Path=/ruoyi-system/v3/api-docs/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
- id: ruoyi-manage-swagger
|
||||
uri: lb://ruoyi-manage
|
||||
predicates:
|
||||
- Path=/ruoyi-manage/v3/api-docs/**
|
||||
filters:
|
||||
- StripPrefix=1
|
||||
```
|
||||
|
||||
## 如果配置不存在
|
||||
|
||||
如果 Nacos 中没有上述路由配置,需要添加:
|
||||
|
||||
1. 登录 Nacos 控制台
|
||||
2. 进入"配置管理" -> "配置列表"
|
||||
3. 找到或创建 `application-dev.yml`
|
||||
4. 添加上述路由配置
|
||||
5. 发布配置
|
||||
6. 重启网关服务
|
||||
|
||||
## 验证步骤
|
||||
|
||||
1. **检查服务注册**:在 Nacos 控制台的"服务管理" -> "服务列表"中,确认以下服务已注册:
|
||||
- `ruoyi-system`
|
||||
- `ruoyi-manage`
|
||||
|
||||
2. **检查路由**:访问以下 URL 验证路由是否正常:
|
||||
- `http://localhost:8080/system/user/list` - 系统模块用户列表
|
||||
- `http://localhost:8080/manage/unit/archive/list` - 管理模块单位建档列表
|
||||
- `http://localhost:8080/ruoyi-system/v3/api-docs` - 系统模块 Swagger 文档
|
||||
- `http://localhost:8080/ruoyi-manage/v3/api-docs` - 管理模块 Swagger 文档
|
||||
|
||||
3. **检查 Swagger UI**:
|
||||
- 访问:`http://localhost:8080/swagger-ui.html` 或 `http://localhost:8080/doc.html`
|
||||
- 在服务下拉列表中应该能看到 `ruoyi-system` 和 `ruoyi-manage`
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 如果启用了 `discovery.locator.enabled: true`,网关会自动为所有注册的服务创建路由,路径格式为:`/服务名/**`
|
||||
- 但为了更好的控制和明确的路由规则,建议显式配置路由
|
||||
- 路由配置修改后需要重启网关服务才能生效
|
||||
|
|
@ -47,9 +47,9 @@ public class WorkPlanController extends BaseController {
|
|||
*/
|
||||
@Operation(summary = "获取工作计划详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('contractor:workPlan:query')")
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@Parameter(description = "计划ID") @PathVariable("planId") Long planId) {
|
||||
return success(workPlanService.selectWorkPlanById(planId));
|
||||
@GetMapping(value = "/{projectId}")
|
||||
public AjaxResult getInfo(@Parameter(description = "项目ID") @PathVariable("projectId") Long projectId) {
|
||||
return success(workPlanService.selectWorkPlanById(projectId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -60,7 +60,11 @@ public class WorkPlanController extends BaseController {
|
|||
@Log(title = "工作计划", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody WorkPlan workPlan) {
|
||||
return toAjax(workPlanService.insertWorkPlan(workPlan));
|
||||
int rows = workPlanService.insertWorkPlan(workPlan);
|
||||
if (rows > 0) {
|
||||
return success(workPlan.getProjectId());
|
||||
}
|
||||
return error("新增工作计划失败");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -80,9 +84,9 @@ public class WorkPlanController extends BaseController {
|
|||
@Operation(summary = "删除工作计划")
|
||||
@PreAuthorize("@ss.hasPermi('contractor:workPlan:remove')")
|
||||
@Log(title = "工作计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@Parameter(description = "计划ID数组") @PathVariable Long[] planIds) {
|
||||
return toAjax(workPlanService.deleteWorkPlanByIds(planIds));
|
||||
@DeleteMapping("/{projectIds}")
|
||||
public AjaxResult remove(@Parameter(description = "项目ID数组") @PathVariable Long[] projectIds) {
|
||||
return toAjax(workPlanService.deleteWorkPlanByIds(projectIds));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,8 +106,8 @@ public class WorkPlanController extends BaseController {
|
|||
@Operation(summary = "提交工作计划")
|
||||
@PreAuthorize("@ss.hasPermi('contractor:workPlan:edit')")
|
||||
@Log(title = "工作计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/submit/{planId}")
|
||||
public AjaxResult submit(@Parameter(description = "计划ID") @PathVariable("planId") Long planId) {
|
||||
return toAjax(workPlanService.submitWorkPlan(planId));
|
||||
@PutMapping("/submit/{projectId}")
|
||||
public AjaxResult submit(@Parameter(description = "项目ID") @PathVariable("projectId") Long projectId) {
|
||||
return toAjax(workPlanService.submitWorkPlan(projectId));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import java.util.List;
|
|||
@Schema(description = "工作计划(施工项目)")
|
||||
public class WorkPlan extends BaseEntity {
|
||||
|
||||
@Schema(description = "计划ID")
|
||||
private Long planId;
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectCode;
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ public interface WorkPlanMapper {
|
|||
/**
|
||||
* 查询工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 工作计划信息
|
||||
*/
|
||||
WorkPlan selectWorkPlanById(Long planId);
|
||||
WorkPlan selectWorkPlanById(Long projectId);
|
||||
|
||||
/**
|
||||
* 查询工作计划列表
|
||||
|
|
@ -49,36 +49,36 @@ public interface WorkPlanMapper {
|
|||
/**
|
||||
* 删除工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWorkPlanById(Long planId);
|
||||
int deleteWorkPlanById(Long projectId);
|
||||
|
||||
/**
|
||||
* 批量删除工作计划
|
||||
*
|
||||
* @param planIds 需要删除的数据ID
|
||||
* @param projectIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWorkPlanByIds(@Param("planIds") Long[] planIds);
|
||||
int deleteWorkPlanByIds(@Param("projectIds") Long[] projectIds);
|
||||
|
||||
/**
|
||||
* 更新项目状态
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @param projectStatus 项目状态
|
||||
* @return 结果
|
||||
*/
|
||||
int updateProjectStatus(@Param("planId") Long planId, @Param("projectStatus") String projectStatus);
|
||||
int updateProjectStatus(@Param("projectId") Long projectId, @Param("projectStatus") String projectStatus);
|
||||
|
||||
/**
|
||||
* 更新项目进度
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @param progress 进度
|
||||
* @return 结果
|
||||
*/
|
||||
int updateProgress(@Param("planId") Long planId, @Param("progress") Integer progress);
|
||||
int updateProgress(@Param("projectId") Long projectId, @Param("progress") Integer progress);
|
||||
|
||||
/**
|
||||
* 查询项目全流程状态总览列表(包含关联的工作票和出入证信息)
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ public interface IWorkPlanService {
|
|||
/**
|
||||
* 查询工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 工作计划信息
|
||||
*/
|
||||
WorkPlan selectWorkPlanById(Long planId);
|
||||
WorkPlan selectWorkPlanById(Long projectId);
|
||||
|
||||
/**
|
||||
* 查询工作计划列表
|
||||
|
|
@ -46,10 +46,10 @@ public interface IWorkPlanService {
|
|||
/**
|
||||
* 批量删除工作计划
|
||||
*
|
||||
* @param planIds 需要删除的计划ID
|
||||
* @param projectIds 需要删除的项目ID
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteWorkPlanByIds(Long[] planIds);
|
||||
int deleteWorkPlanByIds(Long[] projectIds);
|
||||
|
||||
/**
|
||||
* 保存草稿
|
||||
|
|
@ -62,10 +62,10 @@ public interface IWorkPlanService {
|
|||
/**
|
||||
* 提交工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 结果
|
||||
*/
|
||||
int submitWorkPlan(Long planId);
|
||||
int submitWorkPlan(Long projectId);
|
||||
|
||||
/**
|
||||
* 查询项目全流程状态总览列表(包含关联的工作票和出入证信息)
|
||||
|
|
|
|||
|
|
@ -38,12 +38,12 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
/**
|
||||
* 查询工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 工作计划信息
|
||||
*/
|
||||
@Override
|
||||
public WorkPlan selectWorkPlanById(Long planId) {
|
||||
WorkPlan workPlan = workPlanMapper.selectWorkPlanById(planId);
|
||||
public WorkPlan selectWorkPlanById(Long projectId) {
|
||||
WorkPlan workPlan = workPlanMapper.selectWorkPlanById(projectId);
|
||||
if (workPlan != null) {
|
||||
// 查询作业班成员用户信息
|
||||
loadSysUsers(workPlan);
|
||||
|
|
@ -193,13 +193,13 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
/**
|
||||
* 批量删除工作计划
|
||||
*
|
||||
* @param planIds 需要删除的计划ID
|
||||
* @param projectIds 需要删除的项目ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int deleteWorkPlanByIds(Long[] planIds) {
|
||||
return workPlanMapper.deleteWorkPlanByIds(planIds);
|
||||
public int deleteWorkPlanByIds(Long[] projectIds) {
|
||||
return workPlanMapper.deleteWorkPlanByIds(projectIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -212,7 +212,7 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
@Transactional
|
||||
public int saveDraft(WorkPlan workPlan) {
|
||||
workPlan.setProjectStatus("0"); // 草稿状态
|
||||
if (workPlan.getPlanId() == null) {
|
||||
if (workPlan.getProjectId() == null) {
|
||||
return insertWorkPlan(workPlan);
|
||||
} else {
|
||||
return updateWorkPlan(workPlan);
|
||||
|
|
@ -222,17 +222,17 @@ public class WorkPlanServiceImpl implements IWorkPlanService {
|
|||
/**
|
||||
* 提交工作计划
|
||||
*
|
||||
* @param planId 计划ID
|
||||
* @param projectId 项目ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int submitWorkPlan(Long planId) {
|
||||
WorkPlan workPlan = workPlanMapper.selectWorkPlanById(planId);
|
||||
public int submitWorkPlan(Long projectId) {
|
||||
WorkPlan workPlan = workPlanMapper.selectWorkPlanById(projectId);
|
||||
if (workPlan == null) {
|
||||
throw new ServiceException("工作计划不存在");
|
||||
}
|
||||
return workPlanMapper.updateProjectStatus(planId, "1"); // 已提交
|
||||
return workPlanMapper.updateProjectStatus(projectId, "1"); // 已提交
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class PcCameraReturnController extends BaseController {
|
|||
this.bizService = bizService;
|
||||
}
|
||||
|
||||
@Operation(summary = "回收记录列表(已回收待入库/已入库/已驳回等)")
|
||||
@Operation(summary = "待回收列表(已分配但未提交回收的球机)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:return:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PcCameraReturn query) {
|
||||
|
|
|
|||
|
|
@ -12,12 +12,24 @@ import java.util.Date;
|
|||
@Schema(description = "球机入库记录")
|
||||
public class PcCameraInbound extends BaseEntity {
|
||||
|
||||
@Schema(description = "入库ID")
|
||||
private Long inboundId;
|
||||
|
||||
@Schema(description = "回收记录ID")
|
||||
private Long returnId;
|
||||
|
||||
@Schema(description = "球机ID")
|
||||
private Long cameraId;
|
||||
|
||||
@Schema(description = "仓库")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "库管/审核人")
|
||||
private String keeper;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
private Date inboundTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,35 +12,67 @@ import java.util.Date;
|
|||
@Schema(description = "球机回收记录(待入库审核)")
|
||||
public class PcCameraReturn extends BaseEntity {
|
||||
|
||||
@Schema(description = "回收记录ID")
|
||||
private Long returnId;
|
||||
|
||||
@Schema(description = "分配记录ID")
|
||||
private Long allocId;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "球机ID")
|
||||
private Long cameraId;
|
||||
|
||||
@Schema(description = "0合格 1不合格 2不齐全")
|
||||
private String checkResult;
|
||||
@Schema(description = "外观完整性:0完好 1破损 2丢失")
|
||||
private String appearanceIntegrity;
|
||||
|
||||
@Schema(description = "功能测试结果:0正常 1异常")
|
||||
private String functionalTestResult;
|
||||
|
||||
@Schema(description = "回收人")
|
||||
private String returnBy;
|
||||
|
||||
@Schema(description = "回收时间")
|
||||
private Date returnTime;
|
||||
|
||||
@Schema(description = "回收照片url,逗号分隔")
|
||||
private String photoUrls;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "0待审核 1已通过 2已驳回")
|
||||
@Schema(description = "回收状态:-1待回收 0待审核 1已通过 2已驳回")
|
||||
private String auditStatus;
|
||||
|
||||
@Schema(description = "审核人")
|
||||
private String auditBy;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
private Date auditTime;
|
||||
|
||||
@Schema(description = "审核备注")
|
||||
private String auditRemark;
|
||||
|
||||
@Schema(description = "删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
// JOIN展示字段
|
||||
@Schema(description = "球机编号(关联查询)")
|
||||
private String cameraNo;
|
||||
|
||||
@Schema(description = "球机ID列表(聚合,逗号分隔,用于待回收列表)")
|
||||
private String cameraIds;
|
||||
|
||||
@Schema(description = "球机型号(关联查询)")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "项目名称(关联查询)")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "施工单位(关联查询)")
|
||||
private String constructionUnit;
|
||||
|
||||
@Schema(description = "作业地点(关联查询)")
|
||||
private String workLocation;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@ public class PcCameraAllocConfirmDTO {
|
|||
@Schema(description = "分配时间(不传则取当前时间)")
|
||||
private Date allocTime;
|
||||
|
||||
@Schema(description = "分配人(不传则取当前登录用户)")
|
||||
private String allocBy;
|
||||
|
||||
@Schema(description = "分配备注")
|
||||
private String allocNote;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,11 @@ public class PcCameraReturnSubmitDTO {
|
|||
@Schema(description = "回收球机ID列表")
|
||||
private List<Long> cameraIds;
|
||||
|
||||
@Schema(description = "0合格 1不合格 2不齐全")
|
||||
private String checkResult;
|
||||
@Schema(description = "外观完整性:0完好 1破损 2丢失")
|
||||
private String appearanceIntegrity;
|
||||
|
||||
@Schema(description = "功能测试结果:0正常 1异常")
|
||||
private String functionalTestResult;
|
||||
|
||||
@Schema(description = "回收时间(不传则取当前时间)")
|
||||
private Date returnTime;
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
|||
if (project == null) throw new ServiceException("项目不存在或已删除");
|
||||
|
||||
Date allocTime = dto.getAllocTime() != null ? dto.getAllocTime() : new Date();
|
||||
String allocBy = dto.getAllocBy() != null && !dto.getAllocBy().isEmpty() ? dto.getAllocBy() : SecurityUtils.getUsername();
|
||||
String username = SecurityUtils.getUsername();
|
||||
|
||||
// 校验球机是否可分配 + 状态更新(在库->已分配)
|
||||
|
|
@ -92,7 +93,7 @@ public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
|||
a.setProjectId(dto.getProjectId());
|
||||
a.setCameraId(cameraId);
|
||||
a.setAllocTime(allocTime);
|
||||
a.setAllocBy(username);
|
||||
a.setAllocBy(allocBy);
|
||||
a.setAllocNote(dto.getAllocNote());
|
||||
a.setAllocStatus(PcAllocStatus.ALLOCATED);
|
||||
a.setCreateBy(username);
|
||||
|
|
@ -128,7 +129,8 @@ public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
|||
public int submitReturn(PcCameraReturnSubmitDTO dto) {
|
||||
if (dto.getProjectId() == null) throw new ServiceException("projectId不能为空");
|
||||
if (dto.getCameraIds() == null || dto.getCameraIds().isEmpty()) throw new ServiceException("cameraIds不能为空");
|
||||
if (dto.getCheckResult() == null || dto.getCheckResult().isEmpty()) throw new ServiceException("checkResult不能为空");
|
||||
if (dto.getAppearanceIntegrity() == null || dto.getAppearanceIntegrity().isEmpty()) throw new ServiceException("appearanceIntegrity不能为空");
|
||||
if (dto.getFunctionalTestResult() == null || dto.getFunctionalTestResult().isEmpty()) throw new ServiceException("functionalTestResult不能为空");
|
||||
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date returnTime = dto.getReturnTime() != null ? dto.getReturnTime() : new Date();
|
||||
|
|
@ -170,7 +172,8 @@ public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
|||
r.setAllocId(a.getAllocId());
|
||||
r.setProjectId(dto.getProjectId());
|
||||
r.setCameraId(cameraId);
|
||||
r.setCheckResult(dto.getCheckResult());
|
||||
r.setAppearanceIntegrity(dto.getAppearanceIntegrity());
|
||||
r.setFunctionalTestResult(dto.getFunctionalTestResult());
|
||||
r.setReturnBy(username);
|
||||
r.setReturnTime(returnTime);
|
||||
r.setPhotoUrls(photoUrls);
|
||||
|
|
@ -232,11 +235,15 @@ public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
|||
inboundList.add(in);
|
||||
|
||||
// 可选:同步台账的仓库字段
|
||||
PcCameraLedger ledger = new PcCameraLedger();
|
||||
ledger.setCameraId(r.getCameraId());
|
||||
ledger.setWarehouse(dto.getWarehouse());
|
||||
ledger.setUpdateBy(username);
|
||||
ledgerMapper.updatePcCameraLedger(ledger);
|
||||
PcCameraLedger existingLedger = ledgerMapper.selectPcCameraLedgerByCameraId(r.getCameraId());
|
||||
if (existingLedger != null) {
|
||||
PcCameraLedger ledger = new PcCameraLedger();
|
||||
ledger.setCameraId(r.getCameraId());
|
||||
ledger.setCameraNo(existingLedger.getCameraNo()); // camera_no 字段必填
|
||||
ledger.setWarehouse(dto.getWarehouse());
|
||||
ledger.setUpdateBy(username);
|
||||
ledgerMapper.updatePcCameraLedger(ledger);
|
||||
}
|
||||
}
|
||||
inboundMapper.insertBatch(inboundList);
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
}
|
||||
|
||||
// 从工作计划填充数据
|
||||
project.setPlanId(workPlan.getPlanId());
|
||||
project.setPlanId(workPlan.getProjectId());
|
||||
project.setProjectName(workPlan.getProjectName());
|
||||
project.setProjectCode(workPlan.getProjectCode());
|
||||
project.setConstructionUnit(workPlan.getConstructionUnitName());
|
||||
|
|
@ -204,7 +204,7 @@ public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
|||
// 构建返回对象,包含从工作计划获取的信息
|
||||
PcRiskProject result = new PcRiskProject();
|
||||
result.setWorkTicketId(ticketId);
|
||||
result.setPlanId(workPlan.getPlanId());
|
||||
result.setPlanId(workPlan.getProjectId());
|
||||
result.setProjectName(workPlan.getProjectName());
|
||||
result.setProjectCode(workPlan.getProjectCode());
|
||||
result.setConstructionUnit(workPlan.getConstructionUnitName());
|
||||
|
|
|
|||
|
|
@ -5,38 +5,54 @@
|
|||
<mapper namespace="com.admin.property.mapper.PcCameraReturnMapper">
|
||||
|
||||
<select id="selectReturnList" resultType="com.admin.property.domain.PcCameraReturn">
|
||||
select r.return_id as returnId,
|
||||
r.alloc_id as allocId,
|
||||
r.project_id as projectId,
|
||||
r.camera_id as cameraId,
|
||||
r.check_result as checkResult,
|
||||
r.return_by as returnBy,
|
||||
r.return_time as returnTime,
|
||||
r.photo_urls as photoUrls,
|
||||
r.remark as remark,
|
||||
r.audit_status as auditStatus,
|
||||
r.audit_by as auditBy,
|
||||
r.audit_time as auditTime,
|
||||
r.audit_remark as auditRemark,
|
||||
l.camera_no as cameraNo,
|
||||
l.model as model,
|
||||
-- 待回收列表:从分配表查询(已分配但未提交回收),按项目分组聚合
|
||||
select
|
||||
null as returnId,
|
||||
null as allocId,
|
||||
a.project_id as projectId,
|
||||
null as cameraId,
|
||||
null as appearanceIntegrity,
|
||||
null as functionalTestResult,
|
||||
null as returnBy,
|
||||
MAX(a.alloc_time) as returnTime,
|
||||
null as photoUrls,
|
||||
null as remark,
|
||||
'-1' as auditStatus,
|
||||
null as auditBy,
|
||||
null as auditTime,
|
||||
null as auditRemark,
|
||||
GROUP_CONCAT(l.camera_no ORDER BY l.camera_no SEPARATOR ', ') as cameraNo,
|
||||
GROUP_CONCAT(CAST(a.camera_id AS CHAR) ORDER BY a.camera_id SEPARATOR ', ') as cameraIds,
|
||||
null as model,
|
||||
p.project_name as projectName,
|
||||
p.construction_unit as constructionUnit,
|
||||
p.work_location as workLocation
|
||||
from pc_camera_return r
|
||||
left join pc_camera_ledger l on l.camera_id=r.camera_id and l.del_flag='0'
|
||||
left join pc_risk_project p on p.project_id=r.project_id and p.del_flag='0'
|
||||
where r.del_flag='0'
|
||||
from pc_camera_alloc a
|
||||
left join pc_camera_ledger l on l.camera_id = a.camera_id and l.del_flag='0'
|
||||
left join pc_risk_project p on p.project_id = a.project_id and p.del_flag='0'
|
||||
where a.del_flag='0'
|
||||
and a.alloc_status='1'
|
||||
and l.status='1'
|
||||
-- 排除已提交回收的记录(通过 NOT EXISTS 判断 return 表中是否存在)
|
||||
and not exists (
|
||||
select 1 from pc_camera_return r2
|
||||
where r2.alloc_id = a.alloc_id
|
||||
and r2.del_flag='0'
|
||||
)
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and p.project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="cameraNo != null and cameraNo != ''">
|
||||
and l.camera_no like concat('%', #{cameraNo}, '%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and r.audit_status = #{auditStatus}
|
||||
<if test="constructionUnit != null and constructionUnit != ''">
|
||||
and p.construction_unit like concat('%', #{constructionUnit}, '%')
|
||||
</if>
|
||||
order by r.return_id desc
|
||||
<if test="workLocation != null and workLocation != ''">
|
||||
and p.work_location like concat('%', #{workLocation}, '%')
|
||||
</if>
|
||||
group by a.project_id, p.project_name, p.construction_unit, p.work_location
|
||||
order by MAX(a.alloc_time) desc, a.project_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectAuditPendingList" resultType="com.admin.property.domain.PcCameraReturn">
|
||||
|
|
@ -44,7 +60,8 @@
|
|||
r.alloc_id as allocId,
|
||||
r.project_id as projectId,
|
||||
r.camera_id as cameraId,
|
||||
r.check_result as checkResult,
|
||||
r.appearance_integrity as appearanceIntegrity,
|
||||
r.functional_test_result as functionalTestResult,
|
||||
r.return_by as returnBy,
|
||||
r.return_time as returnTime,
|
||||
r.photo_urls as photoUrls,
|
||||
|
|
@ -70,23 +87,56 @@
|
|||
|
||||
<insert id="insertBatch">
|
||||
insert into pc_camera_return(
|
||||
alloc_id, project_id, camera_id, check_result, return_by, return_time, photo_urls, remark,
|
||||
alloc_id, project_id, camera_id, appearance_integrity, functional_test_result, return_by, return_time, photo_urls, remark,
|
||||
audit_status, del_flag, create_by, create_time, update_by, update_time
|
||||
) values
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.allocId}, #{it.projectId}, #{it.cameraId}, #{it.checkResult}, #{it.returnBy}, #{it.returnTime},
|
||||
(#{it.allocId}, #{it.projectId}, #{it.cameraId}, #{it.appearanceIntegrity}, #{it.functionalTestResult}, #{it.returnBy}, #{it.returnTime},
|
||||
#{it.photoUrls}, #{it.remark}, #{it.auditStatus}, '0', #{it.createBy}, now(), #{it.updateBy}, now())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectById" resultType="com.admin.property.domain.PcCameraReturn">
|
||||
select * from pc_camera_return where return_id=#{returnId} and del_flag='0'
|
||||
select
|
||||
r.return_id as returnId,
|
||||
r.alloc_id as allocId,
|
||||
r.project_id as projectId,
|
||||
r.camera_id as cameraId,
|
||||
r.appearance_integrity as appearanceIntegrity,
|
||||
r.functional_test_result as functionalTestResult,
|
||||
r.return_by as returnBy,
|
||||
r.return_time as returnTime,
|
||||
r.photo_urls as photoUrls,
|
||||
r.remark as remark,
|
||||
r.audit_status as auditStatus,
|
||||
r.audit_by as auditBy,
|
||||
r.audit_time as auditTime,
|
||||
r.audit_remark as auditRemark,
|
||||
r.del_flag as delFlag
|
||||
from pc_camera_return r
|
||||
where r.return_id=#{returnId} and r.del_flag='0'
|
||||
</select>
|
||||
|
||||
<select id="selectByIds" resultType="com.admin.property.domain.PcCameraReturn">
|
||||
select * from pc_camera_return
|
||||
where del_flag='0'
|
||||
and return_id in
|
||||
select
|
||||
r.return_id as returnId,
|
||||
r.alloc_id as allocId,
|
||||
r.project_id as projectId,
|
||||
r.camera_id as cameraId,
|
||||
r.appearance_integrity as appearanceIntegrity,
|
||||
r.functional_test_result as functionalTestResult,
|
||||
r.return_by as returnBy,
|
||||
r.return_time as returnTime,
|
||||
r.photo_urls as photoUrls,
|
||||
r.remark as remark,
|
||||
r.audit_status as auditStatus,
|
||||
r.audit_by as auditBy,
|
||||
r.audit_time as auditTime,
|
||||
r.audit_remark as auditRemark,
|
||||
r.del_flag as delFlag
|
||||
from pc_camera_return r
|
||||
where r.del_flag='0'
|
||||
and r.return_id in
|
||||
<foreach collection="returnIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<result property="contactPerson" column="contact_person"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="workTicketId" column="work_ticket_id"/>
|
||||
<result property="planId" column="plan_id"/>
|
||||
<result property="planId" column="project_id"/>
|
||||
|
||||
<!-- 复核/审核/归档字段 -->
|
||||
<result property="supervisionReviewStatus" column="supervision_review_status"/>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
project_name, project_code, construction_unit, work_location,
|
||||
work_start, work_end, risk_type, need_camera_cnt, alloc_status,
|
||||
installation_location, contact_person, contact_phone,
|
||||
work_ticket_id, plan_id,
|
||||
work_ticket_id, project_id,
|
||||
remark, del_flag, create_by, create_time, update_by, update_time
|
||||
) values (
|
||||
#{projectName}, #{projectCode}, #{constructionUnit}, #{workLocation},
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<mapper namespace="com.admin.contractor.mapper.WorkPlanMapper">
|
||||
|
||||
<resultMap id="WorkPlanResult" type="com.admin.contractor.domain.WorkPlan">
|
||||
<id property="planId" column="plan_id" />
|
||||
<id property="projectId" column="project_id" />
|
||||
<result property="projectCode" column="project_code" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="workLocation" column="work_location" />
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<select id="selectWorkPlanById" parameterType="Long" resultMap="WorkPlanResult">
|
||||
select * from work_plan
|
||||
where plan_id = #{planId} and del_flag = '0'
|
||||
where project_id = #{projectId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectWorkPlanList" parameterType="com.admin.contractor.domain.WorkPlan" resultMap="WorkPlanResult">
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertWorkPlan" parameterType="com.admin.contractor.domain.WorkPlan" useGeneratedKeys="true" keyProperty="planId">
|
||||
<insert id="insertWorkPlan" parameterType="com.admin.contractor.domain.WorkPlan" useGeneratedKeys="true" keyProperty="projectId">
|
||||
insert into work_plan(
|
||||
project_code, project_name, work_location, work_location_detail,
|
||||
longitude, latitude, work_start_time, work_end_time,
|
||||
|
|
@ -114,17 +114,17 @@
|
|||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = now()
|
||||
</set>
|
||||
where plan_id = #{planId}
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<update id="deleteWorkPlanById" parameterType="Long">
|
||||
update work_plan set del_flag = '2', update_time = now() where plan_id = #{planId}
|
||||
update work_plan set del_flag = '2', update_time = now() where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<update id="deleteWorkPlanByIds" parameterType="String">
|
||||
update work_plan set del_flag = '2', update_time = now() where plan_id in
|
||||
<foreach item="planId" collection="planIds" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
update work_plan set del_flag = '2', update_time = now() where project_id in
|
||||
<foreach item="projectId" collection="projectIds" open="(" separator="," close=")">
|
||||
#{projectId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
|
@ -132,20 +132,20 @@
|
|||
update work_plan
|
||||
set project_status = #{projectStatus},
|
||||
update_time = now()
|
||||
where plan_id = #{planId}
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<update id="updateProgress">
|
||||
update work_plan
|
||||
set current_progress = #{progress},
|
||||
update_time = now()
|
||||
where plan_id = #{planId}
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<!-- 项目全流程状态总览查询(包含关联信息) -->
|
||||
<select id="selectProjectFullProcessList" parameterType="com.admin.contractor.domain.WorkPlan" resultMap="WorkPlanResult">
|
||||
select
|
||||
wp.plan_id,
|
||||
wp.project_id,
|
||||
wp.project_code,
|
||||
wp.project_name,
|
||||
wp.work_location,
|
||||
|
|
@ -180,8 +180,8 @@
|
|||
'' as supervision_review_status,
|
||||
'' as property_review_status
|
||||
from work_plan wp
|
||||
left join work_ticket wt on wt.project_id = wp.plan_id and wt.del_flag = '0'
|
||||
left join access_permit ap on ap.project_id = wp.plan_id and ap.del_flag = '0'
|
||||
left join work_ticket wt on wt.project_id = wp.project_id and wt.del_flag = '0'
|
||||
left join access_permit ap on ap.project_id = wp.project_id and ap.del_flag = '0'
|
||||
where wp.del_flag = '0'
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and (wp.project_name like concat('%', #{projectName}, '%') or wp.project_code like concat('%', #{projectName}, '%'))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.system;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
|
|
@ -13,6 +14,7 @@ import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
|||
@EnableCustomConfig
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.ruoyi.system.mapper")
|
||||
public class RuoYiSystemApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ package com.ruoyi.system.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 参数配置 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysConfigMapper
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue