初始化
This commit is contained in:
parent
cfd619fa4f
commit
42c26d8f87
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
<version>3.6.7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>aidmt-manage-ms</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-modules-property 物业施工作业管理系统
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-swagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.admin;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||
|
||||
/**
|
||||
* 业务功能模块
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.admin.*.mapper")
|
||||
public class AidmtManageApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(AidmtManageApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 业务功能模块启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
import com.admin.property.service.IPcCameraBizService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.admin.property.domain.PcCameraAlloc;
|
||||
import com.admin.property.domain.dto.PcCameraAllocConfirmDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "球机分配(高风险项目)")
|
||||
@RestController
|
||||
@RequestMapping("/camera/alloc")
|
||||
public class PcCameraAllocationController extends BaseController {
|
||||
|
||||
private final IPcCameraBizService bizService;
|
||||
|
||||
public PcCameraAllocationController(IPcCameraBizService bizService) {
|
||||
this.bizService = bizService;
|
||||
}
|
||||
|
||||
@Operation(summary = "可分配球机列表(弹窗勾选)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:available')")
|
||||
@GetMapping("/availableList")
|
||||
public TableDataInfo availableList(PcCameraLedger query) {
|
||||
startPage();
|
||||
List<PcCameraLedger> list = bizService.selectAvailableCameras(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "项目分配详情(查看分配详情)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:alloc:query')")
|
||||
@GetMapping("/listByProject/{projectId}")
|
||||
public AjaxResult listByProject(@PathVariable Long projectId) {
|
||||
List<PcCameraAlloc> list = bizService.selectAllocListByProjectId(projectId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "确认分配(项目 -> 多台球机)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:alloc:confirm')")
|
||||
@Log(title = "高风险项目分配球机", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/confirm")
|
||||
public AjaxResult confirm(@Validated @RequestBody PcCameraAllocConfirmDTO dto) {
|
||||
return toAjax(bizService.confirmAllocate(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.service.IPcCameraBizService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.admin.property.domain.PcCameraReturn;
|
||||
import com.admin.property.domain.dto.PcCameraInboundAuditDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "球机入库审核")
|
||||
@RestController
|
||||
@RequestMapping("/camera/inbound")
|
||||
public class PcCameraInboundController extends BaseController {
|
||||
|
||||
private final IPcCameraBizService bizService;
|
||||
|
||||
public PcCameraInboundController(IPcCameraBizService bizService) {
|
||||
this.bizService = bizService;
|
||||
}
|
||||
|
||||
@Operation(summary = "入库审核列表(待审核)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:inbound:list')")
|
||||
@GetMapping("/auditList")
|
||||
public TableDataInfo auditList(PcCameraReturn query) {
|
||||
startPage();
|
||||
List<PcCameraReturn> list = bizService.selectAuditPendingList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "确认入库(审核通过)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:inbound:approve')")
|
||||
@Log(title = "球机入库审核-通过", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/approve")
|
||||
public AjaxResult approve(@Validated @RequestBody PcCameraInboundAuditDTO dto) {
|
||||
return toAjax(bizService.approveInbound(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "驳回入库(审核驳回)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:inbound:reject')")
|
||||
@Log(title = "球机入库审核-驳回", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/reject")
|
||||
public AjaxResult reject(@Validated @RequestBody PcCameraInboundAuditDTO dto) {
|
||||
return toAjax(bizService.rejectInbound(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.service.IPcCameraLedgerService;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.security.utils.SecurityUtils.getUsername;
|
||||
|
||||
@Tag(name = "移动球机管控-球机台账")
|
||||
@RestController
|
||||
@RequestMapping("/camera/ledger")
|
||||
public class PcCameraLedgerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPcCameraLedgerService pcCameraLedgerService;
|
||||
|
||||
@Operation(summary = "球机台账-分页列表", description = "支持按状态、仓库、单位、时间范围筛选")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(
|
||||
@Parameter(description = "查询条件对象")
|
||||
PcCameraLedger pcCameraLedger) {
|
||||
startPage();
|
||||
List<PcCameraLedger> list = pcCameraLedgerService.selectPcCameraLedgerList(pcCameraLedger);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-导出Excel", description = "按筛选条件导出Excel")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:export')")
|
||||
@Log(title = "球机台账", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PcCameraLedger pcCameraLedger) {
|
||||
List<PcCameraLedger> list = pcCameraLedgerService.selectPcCameraLedgerList(pcCameraLedger);
|
||||
ExcelUtil<PcCameraLedger> util = new ExcelUtil<>(PcCameraLedger.class);
|
||||
util.exportExcel(response, list, "球机台账");
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-详情", description = "根据cameraId查询单条台账详情")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:query')")
|
||||
@GetMapping("/{cameraId}")
|
||||
public AjaxResult getInfo(
|
||||
@Parameter(description = "台账主键ID", required = true, example = "1")
|
||||
@PathVariable Long cameraId) {
|
||||
return success(pcCameraLedgerService.selectPcCameraLedgerByCameraId(cameraId));
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-新增", description = "新增一条球机台账记录")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:add')")
|
||||
@Log(title = "球机台账", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody PcCameraLedger pcCameraLedger) {
|
||||
pcCameraLedger.setCreateBy(getUsername());
|
||||
pcCameraLedger.setUpdateBy(getUsername());
|
||||
return toAjax(pcCameraLedgerService.insertPcCameraLedger(pcCameraLedger));
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-修改", description = "修改球机台账记录")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:edit')")
|
||||
@Log(title = "球机台账", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody PcCameraLedger pcCameraLedger) {
|
||||
pcCameraLedger.setUpdateBy(getUsername());
|
||||
return toAjax(pcCameraLedgerService.updatePcCameraLedger(pcCameraLedger));
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-删除(逻辑删除)", description = "批量逻辑删除,del_flag=2")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:remove')")
|
||||
@Log(title = "球机台账", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{cameraIds}")
|
||||
public AjaxResult remove(
|
||||
@Parameter(description = "台账ID数组(逗号分隔)", required = true, example = "1,2,3")
|
||||
@PathVariable Long[] cameraIds) {
|
||||
return toAjax(pcCameraLedgerService.deletePcCameraLedgerByCameraIds(cameraIds));
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-状态变更", description = "状态:0闲置 1已分配 2待回收 3已入库")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:edit')")
|
||||
@Log(title = "球机台账-状态", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestParam("cameraId") Long cameraId,
|
||||
@RequestParam("status") String status) {
|
||||
return toAjax(pcCameraLedgerService.changeStatus(cameraId, status));
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-批量导入", description = "导入Excel,updateSupport=true 时遇到已存在编号则更新")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:import')")
|
||||
@Log(title = "球机台账", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
|
||||
ExcelUtil<PcCameraLedger> util = new ExcelUtil<>(PcCameraLedger.class);
|
||||
List<PcCameraLedger> list = util.importExcel(file.getInputStream());
|
||||
String msg = pcCameraLedgerService.importData(list, updateSupport, getUsername());
|
||||
return success(msg);
|
||||
}
|
||||
|
||||
@Operation(summary = "球机台账-导入模板", description = "下载Excel导入模板")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:import')")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil<PcCameraLedger> util = new ExcelUtil<>(PcCameraLedger.class);
|
||||
util.importTemplateExcel(response, "球机台账导入模板");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.service.IPcCameraBizService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.admin.property.domain.PcCameraReturn;
|
||||
import com.admin.property.domain.dto.PcCameraReturnSubmitDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "球机回收")
|
||||
@RestController
|
||||
@RequestMapping("/camera/return")
|
||||
public class PcCameraReturnController extends BaseController {
|
||||
|
||||
private final IPcCameraBizService bizService;
|
||||
|
||||
public PcCameraReturnController(IPcCameraBizService bizService) {
|
||||
this.bizService = bizService;
|
||||
}
|
||||
|
||||
@Operation(summary = "回收记录列表(已回收待入库/已入库/已驳回等)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:return:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PcCameraReturn query) {
|
||||
startPage();
|
||||
List<PcCameraReturn> list = bizService.selectReturnList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "回收确认提交(项目 -> 多台球机)")
|
||||
@PreAuthorize("@ss.hasPermi('property:camera:return:submit')")
|
||||
@Log(title = "球机回收确认", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/submit")
|
||||
public AjaxResult submit(@Validated @RequestBody PcCameraReturnSubmitDTO dto) {
|
||||
return toAjax(bizService.submitReturn(dto));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.service.IPcRiskProjectService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import static com.ruoyi.common.security.utils.SecurityUtils.getUsername;
|
||||
|
||||
@Tag(name = "高风险项目管理")
|
||||
@RestController
|
||||
@RequestMapping("/project/risk")
|
||||
public class PcRiskProjectController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPcRiskProjectService pcRiskProjectService;
|
||||
|
||||
/** 列表(高风险项目) */
|
||||
@Operation(summary = "高风险项目分页查询", description = "分页查询高风险项目")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(
|
||||
@Parameter(description = "查询条件对象")
|
||||
PcRiskProject project) {
|
||||
startPage();
|
||||
return getDataTable(pcRiskProjectService.selectPcRiskProjectList(project));
|
||||
}
|
||||
|
||||
/** 查询高风险项目详情 */
|
||||
@Operation(summary = "高风险项目详情", description = "根据ID查询项目详情")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:query')")
|
||||
@GetMapping("/{projectId}")
|
||||
public AjaxResult getInfo(@PathVariable Long projectId) {
|
||||
return success(pcRiskProjectService.selectPcRiskProjectById(projectId));
|
||||
}
|
||||
|
||||
/** 修改高风险项目 */
|
||||
@Operation(summary = "修改高风险项目", description = "根据ID修改项目")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:edit')")
|
||||
@Log(title = "高风险项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{projectId}")
|
||||
public AjaxResult edit(
|
||||
@Parameter(description = "项目ID")
|
||||
@PathVariable Long projectId,
|
||||
@Parameter(description = "修改后的项目数据")
|
||||
@RequestBody PcRiskProject project) {
|
||||
project.setUpdateBy(getUsername());
|
||||
return toAjax(pcRiskProjectService.updatePcRiskProject(projectId, project));
|
||||
}
|
||||
|
||||
/** 删除高风险项目 */
|
||||
@Operation(summary = "删除高风险项目", description = "根据ID删除项目")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:remove')")
|
||||
@Log(title = "高风险项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{projectIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] projectIds) {
|
||||
return toAjax(pcRiskProjectService.deletePcRiskProjectByIds(projectIds));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.admin.property.service.IPcUnitArchiveService;
|
||||
import com.admin.property.domain.PcUnitArchive;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
|
||||
import static com.ruoyi.common.security.utils.SecurityUtils.getUsername;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
|
||||
@Tag(name = "单位与账号管理-单位建档")
|
||||
@RestController
|
||||
@RequestMapping("/unit/archive")
|
||||
public class PcUnitArchiveController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPcUnitArchiveService pcUnitArchiveService;
|
||||
|
||||
|
||||
@Operation(summary = "单位建档-列表查询")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PcUnitArchive pcUnitArchive) {
|
||||
startPage();
|
||||
List<PcUnitArchive> list = pcUnitArchiveService.selectPcUnitArchiveList(pcUnitArchive);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-导出Excel")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:export')")
|
||||
@Log(title = "单位建档", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, PcUnitArchive pcUnitArchive) {
|
||||
List<PcUnitArchive> list = pcUnitArchiveService.selectPcUnitArchiveList(pcUnitArchive);
|
||||
ExcelUtil<PcUnitArchive> util = new ExcelUtil<>(PcUnitArchive.class);
|
||||
util.exportExcel(response, list, "单位建档数据");
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-详情")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:query')")
|
||||
@GetMapping("/{unitId}")
|
||||
public AjaxResult getInfo(
|
||||
@Parameter(description = "单位ID", required = true, example = "1")
|
||||
@PathVariable("unitId") Long unitId) {
|
||||
return success(pcUnitArchiveService.selectPcUnitArchiveByUnitId(unitId));
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-新增")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:add')")
|
||||
@Log(title = "单位建档", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody PcUnitArchive pcUnitArchive) {
|
||||
pcUnitArchive.setCreateBy(getUsername());
|
||||
pcUnitArchive.setUpdateBy(getUsername());
|
||||
return toAjax(pcUnitArchiveService.insertPcUnitArchive(pcUnitArchive));
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-修改")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:edit')")
|
||||
@Log(title = "单位建档", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody PcUnitArchive pcUnitArchive) {
|
||||
pcUnitArchive.setUpdateBy(getUsername());
|
||||
return toAjax(pcUnitArchiveService.updatePcUnitArchive(pcUnitArchive));
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-删除(逻辑删除)")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:remove')")
|
||||
@Log(title = "单位建档", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{unitIds}")
|
||||
public AjaxResult remove(
|
||||
@Parameter(description = "单位ID数组(逗号分隔)", required = true, example = "1,2,3")
|
||||
@PathVariable Long[] unitIds) {
|
||||
return toAjax(pcUnitArchiveService.deletePcUnitArchiveByUnitIds(unitIds));
|
||||
}
|
||||
|
||||
@Operation(summary = "单位建档-启用/禁用")
|
||||
@PreAuthorize("@ss.hasPermi('property:unit:edit')")
|
||||
@Log(title = "单位建档-状态", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(
|
||||
@Parameter(description = "单位ID", required = true, example = "1")
|
||||
@RequestParam("unitId") Long unitId,
|
||||
@Parameter(description = "状态(0启用/1禁用)", required = true, example = "0")
|
||||
@RequestParam("status") String status) {
|
||||
return toAjax(pcUnitArchiveService.changeStatus(unitId, status));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.admin.property.controller;
|
||||
|
||||
import com.admin.property.service.IPcRiskProjectService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "项目复核-完工复核管理")
|
||||
@RestController
|
||||
@RequestMapping("/project/completionReview")
|
||||
public class ProjectCompletionReviewController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IPcRiskProjectService pcRiskProjectService;
|
||||
|
||||
/** 项目完工复核列表 */
|
||||
@Operation(summary = "项目完工复核-分页列表", description = "支持按项目名称、施工单位等条件筛选")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:completionReviewList')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PcRiskProject pcRiskProject) {
|
||||
startPage();
|
||||
List<PcRiskProject> list = pcRiskProjectService.selectProjectCompletionReviewList(pcRiskProject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/** 现场复核提交 */
|
||||
@Operation(summary = "项目完工复核-现场复核提交", description = "提交现场复核并更新状态")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:onSiteReview')")
|
||||
@PutMapping("/onSiteReview")
|
||||
public AjaxResult onSiteReview(
|
||||
@RequestParam Long projectId,
|
||||
@RequestParam String onSiteReviewStatus,
|
||||
@RequestParam String onSiteReviewImages,
|
||||
@RequestParam Integer workContentCompleteRate,
|
||||
@RequestParam String siteCleaningCondition,
|
||||
@RequestParam String reviewComments) {
|
||||
|
||||
// 先检查监理复核状态,确保复核通过
|
||||
PcRiskProject project = pcRiskProjectService.selectPcRiskProjectById(projectId);
|
||||
if (project == null || !"复核通过".equals(project.getSupervisionReviewStatus())) {
|
||||
return AjaxResult.error("监理复核未通过,无法进行现场复核");
|
||||
}
|
||||
|
||||
return toAjax(pcRiskProjectService.onSiteReview(projectId, onSiteReviewStatus, onSiteReviewImages, workContentCompleteRate, siteCleaningCondition, reviewComments));
|
||||
}
|
||||
|
||||
/** 最终审核提交 */
|
||||
@Operation(summary = "项目完工复核-最终审核提交", description = "最终审核项目,确认无异议后提交")
|
||||
@PreAuthorize("@ss.hasPermi('property:project:finalAudit')")
|
||||
@PutMapping("/finalAudit")
|
||||
public AjaxResult finalAudit(
|
||||
@RequestParam Long projectId) {
|
||||
|
||||
// 先检查现场复核是否已完成
|
||||
PcRiskProject project = pcRiskProjectService.selectPcRiskProjectById(projectId);
|
||||
if (project == null || !"已复核".equals(project.getOnSiteReviewStatus())) {
|
||||
return AjaxResult.error("现场复核未完成,无法进行最终审核");
|
||||
}
|
||||
|
||||
return toAjax(pcRiskProjectService.finalAudit(projectId));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "项目球机分配记录")
|
||||
public class PcCameraAlloc extends BaseEntity {
|
||||
|
||||
private Long allocId;
|
||||
private Long projectId;
|
||||
private Long cameraId;
|
||||
|
||||
private Date allocTime;
|
||||
private String allocBy;
|
||||
private String allocNote;
|
||||
|
||||
@Schema(description = "1已分配 2已回收提交 3已入库完成")
|
||||
private String allocStatus;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
// 方便列表展示(JOIN字段)
|
||||
private String cameraNo;
|
||||
private String model;
|
||||
private String projectName;
|
||||
private String constructionUnit;
|
||||
private String workLocation;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "球机入库记录")
|
||||
public class PcCameraInbound extends BaseEntity {
|
||||
|
||||
private Long inboundId;
|
||||
private Long returnId;
|
||||
private Long cameraId;
|
||||
|
||||
private String warehouse;
|
||||
private String keeper;
|
||||
private Date inboundTime;
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "球机台账")
|
||||
public class PcCameraLedger extends BaseEntity {
|
||||
|
||||
@Schema(description = "球机ID")
|
||||
private Long cameraId;
|
||||
|
||||
@Excel(name = "球机编号")
|
||||
@Schema(description = "球机编号")
|
||||
private String cameraNo;
|
||||
|
||||
@Excel(name = "型号")
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
@Excel(name = "状态", readConverterExp = "0=在库,1=已分配,2=已回收待入库,3=已入库")
|
||||
@Schema(description = "状态:0在库 1已分配 2已回收待入库 3已入库")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "所属单位")
|
||||
@Schema(description = "所属单位")
|
||||
private String ownerUnit;
|
||||
|
||||
@Excel(name = "所在仓库")
|
||||
@Schema(description = "所在仓库")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "逻辑删除标记:0存在 2删除")
|
||||
private String delFlag;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "球机回收记录(待入库审核)")
|
||||
public class PcCameraReturn extends BaseEntity {
|
||||
|
||||
private Long returnId;
|
||||
private Long allocId;
|
||||
private Long projectId;
|
||||
private Long cameraId;
|
||||
|
||||
@Schema(description = "0合格 1不合格 2不齐全")
|
||||
private String checkResult;
|
||||
|
||||
private String returnBy;
|
||||
private Date returnTime;
|
||||
|
||||
@Schema(description = "回收照片url,逗号分隔")
|
||||
private String photoUrls;
|
||||
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "0待审核 1已通过 2已驳回")
|
||||
private String auditStatus;
|
||||
|
||||
private String auditBy;
|
||||
private Date auditTime;
|
||||
private String auditRemark;
|
||||
|
||||
private String delFlag;
|
||||
|
||||
// JOIN展示字段
|
||||
private String cameraNo;
|
||||
private String model;
|
||||
private String projectName;
|
||||
private String constructionUnit;
|
||||
private String workLocation;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "高风险项目")
|
||||
public class PcRiskProject extends BaseEntity {
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "项目编号")
|
||||
private String projectCode;
|
||||
|
||||
@Schema(description = "施工单位")
|
||||
private String constructionUnit;
|
||||
|
||||
@Schema(description = "工作地点")
|
||||
private String workLocation;
|
||||
|
||||
@Schema(description = "工作开始时间")
|
||||
private String workStart;
|
||||
|
||||
@Schema(description = "工作结束时间")
|
||||
private String workEnd;
|
||||
|
||||
@Schema(description = "风险类型")
|
||||
private String riskType;
|
||||
|
||||
@Schema(description = "需要摄像头数量")
|
||||
private Integer needCameraCnt;
|
||||
|
||||
@Schema(description = "分配状态:0待分配,1已分配")
|
||||
private String allocStatus;
|
||||
|
||||
@Schema(description = "删除标记:0存在 2删除")
|
||||
private String delFlag;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "监理复核状态")
|
||||
private String supervisionReviewStatus;
|
||||
|
||||
@Schema(description = "现场复核状态")
|
||||
private String onSiteReviewStatus;
|
||||
|
||||
@Schema(description = "最终审核状态")
|
||||
private String finalAuditStatus;
|
||||
|
||||
@Schema(description = "项目状态")
|
||||
private String projectStatus;
|
||||
|
||||
@Schema(description = "现场复核图片(URL数组)")
|
||||
private String onSiteReviewImages;
|
||||
|
||||
@Schema(description = "作业内容完成度")
|
||||
private Integer workContentCompleteRate;
|
||||
|
||||
@Schema(description = "现场清理情况")
|
||||
private String siteCleaningCondition;
|
||||
|
||||
@Schema(description = "复核意见")
|
||||
private String reviewComments;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.admin.property.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PcUnitArchive extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long unitId;
|
||||
|
||||
/** 单位类型(1施工/2监理/3业主) */
|
||||
@Excel(name = "单位类型", readConverterExp = "1=施工单位,2=监理单位,3=业主单位")
|
||||
private String unitType;
|
||||
|
||||
/** 单位名称 */
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
/** 所属区域编码 */
|
||||
private String areaCode;
|
||||
|
||||
/** 所属区域名称 */
|
||||
@Excel(name = "所属区域")
|
||||
private String areaName;
|
||||
|
||||
/** 统一社会信用代码 */
|
||||
@Excel(name = "统一社会信用代码")
|
||||
private String creditCode;
|
||||
|
||||
/** 联系人 */
|
||||
@Excel(name = "联系人")
|
||||
private String contactName;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "联系电话")
|
||||
private String contactPhone;
|
||||
|
||||
/** 单位地址 */
|
||||
@Excel(name = "单位地址")
|
||||
private String address;
|
||||
|
||||
/** 资质文件(上传后URL/路径) */
|
||||
@Excel(name = "资质文件")
|
||||
private String qualFileUrl;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 建档状态(0草稿/1已建档) */
|
||||
@Excel(name = "建档状态", readConverterExp = "0=草稿,1=已建档")
|
||||
private String archiveStatus;
|
||||
|
||||
/** 状态(0启用/1禁用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0存在/2删除) */
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.admin.property.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "确认分配球机请求")
|
||||
public class PcCameraAllocConfirmDTO {
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "选中的球机ID列表")
|
||||
private List<Long> cameraIds;
|
||||
|
||||
@Schema(description = "分配时间(不传则取当前时间)")
|
||||
private Date allocTime;
|
||||
|
||||
@Schema(description = "分配备注")
|
||||
private String allocNote;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.admin.property.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "入库审核请求(通过/驳回)")
|
||||
public class PcCameraInboundAuditDTO {
|
||||
|
||||
@Schema(description = "回收记录ID列表")
|
||||
private List<Long> returnIds;
|
||||
|
||||
@Schema(description = "仓库名称(通过时必填)")
|
||||
private String warehouse;
|
||||
|
||||
@Schema(description = "库管/审核人(不传则取当前登录人)")
|
||||
private String keeper;
|
||||
|
||||
@Schema(description = "入库时间(不传则取当前时间)")
|
||||
private Date inboundTime;
|
||||
|
||||
@Schema(description = "驳回原因/审核备注")
|
||||
private String auditRemark;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.admin.property.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "回收确认提交请求")
|
||||
public class PcCameraReturnSubmitDTO {
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "回收球机ID列表")
|
||||
private List<Long> cameraIds;
|
||||
|
||||
@Schema(description = "0合格 1不合格 2不齐全")
|
||||
private String checkResult;
|
||||
|
||||
@Schema(description = "回收时间(不传则取当前时间)")
|
||||
private Date returnTime;
|
||||
|
||||
@Schema(description = "回收照片URL列表(前端上传后回传)")
|
||||
private List<String> photoUrls;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.admin.property.enums;
|
||||
|
||||
public interface PcAllocStatus {
|
||||
String ALLOCATED = "1";
|
||||
String RETURN_SUBMITTED = "2";
|
||||
String INBOUND_DONE = "3";
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.admin.property.enums;
|
||||
|
||||
public interface PcAuditStatus {
|
||||
/** 0待入库审核 */
|
||||
String PENDING = "0";
|
||||
/** 1已通过 */
|
||||
String APPROVED = "1";
|
||||
/** 2已驳回 */
|
||||
String REJECTED = "2";
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.admin.property.enums;
|
||||
|
||||
public interface PcCameraStatus {
|
||||
|
||||
/** 台账 status:0在库 */
|
||||
String IN_STOCK = "0";
|
||||
/** 台账 status:1已分配 */
|
||||
String ALLOCATED = "1";
|
||||
/** 台账 status:2已回收待入库 */
|
||||
String RETURNED_PENDING_INBOUND = "2";
|
||||
/** 台账 status:3已入库(等同在库,可按你业务区分) */
|
||||
String INBOUNDED = "3";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcCameraAlloc;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcCameraAllocMapper {
|
||||
|
||||
List<PcCameraAlloc> selectAllocListByProjectId(@Param("projectId") Long projectId);
|
||||
|
||||
/** 高风险项目分配页:项目列表(带过滤) */
|
||||
List<PcCameraAlloc> selectRiskProjectAllocList(PcCameraAlloc query);
|
||||
|
||||
int insertBatch(@Param("list") List<PcCameraAlloc> list);
|
||||
|
||||
int updateAllocStatusByProject(@Param("projectId") Long projectId, @Param("allocStatus") String allocStatus);
|
||||
|
||||
PcCameraAlloc selectActiveAlloc(@Param("projectId") Long projectId, @Param("cameraId") Long cameraId);
|
||||
|
||||
List<PcCameraAlloc> selectAllocatedByProject(@Param("projectId") Long projectId);
|
||||
|
||||
int updateAllocStatusByIds(@Param("allocIds") List<Long> allocIds, @Param("allocStatus") String allocStatus);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcCameraInbound;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcCameraInboundMapper {
|
||||
int insertBatch(@Param("list") List<PcCameraInbound> list);
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcCameraLedgerMapper {
|
||||
|
||||
PcCameraLedger selectPcCameraLedgerByCameraId(@Param("cameraId") Long cameraId);
|
||||
|
||||
List<PcCameraLedger> selectPcCameraLedgerList(PcCameraLedger query);
|
||||
|
||||
/** 精确按编号查(导入更新用,避免 like) */
|
||||
PcCameraLedger selectByCameraNo(@Param("cameraNo") String cameraNo);
|
||||
|
||||
/** 可分配球机列表(status=0或3) */
|
||||
List<PcCameraLedger> selectAvailableCameraList(PcCameraLedger query);
|
||||
|
||||
int insertPcCameraLedger(PcCameraLedger entity);
|
||||
|
||||
int updatePcCameraLedger(PcCameraLedger entity);
|
||||
|
||||
int deletePcCameraLedgerByCameraIds(@Param("cameraIds") Long[] cameraIds);
|
||||
|
||||
int updateStatusIfMatch(@Param("cameraId") Long cameraId,
|
||||
@Param("fromStatus") String fromStatus,
|
||||
@Param("toStatus") String toStatus);
|
||||
|
||||
int updateStatus(@Param("cameraId") Long cameraId, @Param("toStatus") String toStatus);
|
||||
|
||||
List<PcCameraLedger> selectByIds(@Param("cameraIds") List<Long> cameraIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcCameraReturn;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcCameraReturnMapper {
|
||||
|
||||
/** 回收入库页:待回收/已回收待入库/已入库等列表(你可按 audit_status + 台账status组合筛选) */
|
||||
List<PcCameraReturn> selectReturnList(PcCameraReturn query);
|
||||
|
||||
/** 入库审核列表:audit_status=0 */
|
||||
List<PcCameraReturn> selectAuditPendingList(PcCameraReturn query);
|
||||
|
||||
int insertBatch(@Param("list") List<PcCameraReturn> list);
|
||||
|
||||
PcCameraReturn selectById(@Param("returnId") Long returnId);
|
||||
|
||||
List<PcCameraReturn> selectByIds(@Param("returnIds") List<Long> returnIds);
|
||||
|
||||
int updateAuditStatus(@Param("returnIds") List<Long> returnIds,
|
||||
@Param("auditStatus") String auditStatus,
|
||||
@Param("auditBy") String auditBy,
|
||||
@Param("auditTime") java.util.Date auditTime,
|
||||
@Param("auditRemark") String auditRemark);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcRiskProjectMapper {
|
||||
|
||||
PcRiskProject selectPcRiskProjectById(@Param("projectId") Long projectId);
|
||||
|
||||
List<PcRiskProject> selectPcRiskProjectList(PcRiskProject query);
|
||||
|
||||
int insertPcRiskProject(PcRiskProject entity);
|
||||
|
||||
int updatePcRiskProject(PcRiskProject entity);
|
||||
|
||||
int deletePcRiskProjectByIds(@Param("projectIds") Long[] projectIds);
|
||||
|
||||
int updateAllocStatus(@Param("projectId") Long projectId,
|
||||
@Param("allocStatus") String allocStatus);
|
||||
|
||||
/** 完工复核管理列表 */
|
||||
List<PcRiskProject> selectProjectCompletionReviewList(PcRiskProject query);
|
||||
|
||||
/** 更新复核/审核/归档相关状态(包含监理复核状态) */
|
||||
int updateProjectStatus(PcRiskProject entity);
|
||||
|
||||
/** 仅更新监理复核状态(如果监理系统回写用得到,可选) */
|
||||
int updateSupervisionReviewStatus(@Param("projectId") Long projectId,
|
||||
@Param("supervisionReviewStatus") String supervisionReviewStatus);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.admin.property.mapper;
|
||||
|
||||
import com.admin.property.domain.PcUnitArchive;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface PcUnitArchiveMapper {
|
||||
|
||||
PcUnitArchive selectPcUnitArchiveByUnitId(Long unitId);
|
||||
|
||||
List<PcUnitArchive> selectPcUnitArchiveList(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int insertPcUnitArchive(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int updatePcUnitArchive(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int deletePcUnitArchiveByUnitId(Long unitId);
|
||||
|
||||
int deletePcUnitArchiveByUnitIds(Long[] unitIds);
|
||||
|
||||
int updatePcUnitArchiveStatus(Long unitId, String status);
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.admin.property.service;
|
||||
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
import com.admin.property.domain.PcCameraAlloc;
|
||||
import com.admin.property.domain.PcCameraReturn;
|
||||
import com.admin.property.domain.dto.PcCameraAllocConfirmDTO;
|
||||
import com.admin.property.domain.dto.PcCameraInboundAuditDTO;
|
||||
import com.admin.property.domain.dto.PcCameraReturnSubmitDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPcCameraBizService {
|
||||
|
||||
/** 可分配球机列表 */
|
||||
List<PcCameraLedger> selectAvailableCameras(PcCameraLedger query);
|
||||
|
||||
/** 项目分配详情 */
|
||||
List<PcCameraAlloc> selectAllocListByProjectId(Long projectId);
|
||||
|
||||
/** 确认分配(项目 -> 多台球机) */
|
||||
int confirmAllocate(PcCameraAllocConfirmDTO dto);
|
||||
|
||||
/** 回收列表/回收记录列表 */
|
||||
List<PcCameraReturn> selectReturnList(PcCameraReturn query);
|
||||
|
||||
/** 入库审核列表(待审核) */
|
||||
List<PcCameraReturn> selectAuditPendingList(PcCameraReturn query);
|
||||
|
||||
/** 回收确认提交(项目 -> 多台球机) */
|
||||
int submitReturn(PcCameraReturnSubmitDTO dto);
|
||||
|
||||
/** 入库审核通过(确认入库) */
|
||||
int approveInbound(PcCameraInboundAuditDTO dto);
|
||||
|
||||
/** 入库审核驳回 */
|
||||
int rejectInbound(PcCameraInboundAuditDTO dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.admin.property.service;
|
||||
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPcCameraLedgerService {
|
||||
|
||||
PcCameraLedger selectPcCameraLedgerByCameraId(Long cameraId);
|
||||
|
||||
List<PcCameraLedger> selectPcCameraLedgerList(PcCameraLedger pcCameraLedger);
|
||||
|
||||
int insertPcCameraLedger(PcCameraLedger pcCameraLedger);
|
||||
|
||||
int updatePcCameraLedger(PcCameraLedger pcCameraLedger);
|
||||
|
||||
int deletePcCameraLedgerByCameraIds(Long[] cameraIds);
|
||||
|
||||
int changeStatus(Long cameraId, String status);
|
||||
|
||||
String importData(List<PcCameraLedger> list, boolean updateSupport, String operName);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.admin.property.service;
|
||||
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPcRiskProjectService {
|
||||
|
||||
PcRiskProject selectPcRiskProjectById(Long projectId);
|
||||
|
||||
List<PcRiskProject> selectPcRiskProjectList(PcRiskProject project);
|
||||
|
||||
int updatePcRiskProject(Long projectId, PcRiskProject project);
|
||||
|
||||
int deletePcRiskProjectByIds(Long[] projectIds);
|
||||
|
||||
|
||||
public List<PcRiskProject> selectProjectCompletionReviewList(PcRiskProject pcRiskProject);
|
||||
|
||||
public int onSiteReview( Long projectId,
|
||||
String onSiteReviewStatus,
|
||||
String onSiteReviewImages,
|
||||
Integer workContentCompleteRate,
|
||||
String siteCleaningCondition,
|
||||
String reviewComments);
|
||||
|
||||
public int finalAudit(Long projectId);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.admin.property.service;
|
||||
|
||||
|
||||
import com.admin.property.domain.PcUnitArchive;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPcUnitArchiveService {
|
||||
|
||||
PcUnitArchive selectPcUnitArchiveByUnitId(Long unitId);
|
||||
|
||||
List<PcUnitArchive> selectPcUnitArchiveList(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int insertPcUnitArchive(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int updatePcUnitArchive(PcUnitArchive pcUnitArchive);
|
||||
|
||||
int deletePcUnitArchiveByUnitIds(Long[] unitIds);
|
||||
|
||||
int changeStatus(Long unitId, String status);
|
||||
}
|
||||
|
|
@ -0,0 +1,264 @@
|
|||
package com.admin.property.service.impl;
|
||||
|
||||
import com.admin.property.domain.*;
|
||||
import com.admin.property.enums.PcCameraStatus;
|
||||
import com.admin.property.mapper.*;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.admin.property.domain.dto.PcCameraAllocConfirmDTO;
|
||||
import com.admin.property.domain.dto.PcCameraInboundAuditDTO;
|
||||
import com.admin.property.domain.dto.PcCameraReturnSubmitDTO;
|
||||
import com.admin.property.enums.PcAllocStatus;
|
||||
import com.admin.property.enums.PcAuditStatus;
|
||||
import com.admin.property.service.IPcCameraBizService;
|
||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class PcCameraBizServiceImpl implements IPcCameraBizService {
|
||||
|
||||
private final PcRiskProjectMapper projectMapper;
|
||||
private final PcCameraLedgerMapper ledgerMapper;
|
||||
private final PcCameraAllocMapper allocMapper;
|
||||
private final PcCameraReturnMapper returnMapper;
|
||||
private final PcCameraInboundMapper inboundMapper;
|
||||
|
||||
public PcCameraBizServiceImpl(PcRiskProjectMapper projectMapper,
|
||||
PcCameraLedgerMapper ledgerMapper,
|
||||
PcCameraAllocMapper allocMapper,
|
||||
PcCameraReturnMapper returnMapper,
|
||||
PcCameraInboundMapper inboundMapper) {
|
||||
this.projectMapper = projectMapper;
|
||||
this.ledgerMapper = ledgerMapper;
|
||||
this.allocMapper = allocMapper;
|
||||
this.returnMapper = returnMapper;
|
||||
this.inboundMapper = inboundMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcCameraLedger> selectAvailableCameras(PcCameraLedger query) {
|
||||
return ledgerMapper.selectAvailableCameraList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcCameraAlloc> selectAllocListByProjectId(Long projectId) {
|
||||
return allocMapper.selectAllocListByProjectId(projectId);
|
||||
}
|
||||
|
||||
/** ① 确认分配 */
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int confirmAllocate(PcCameraAllocConfirmDTO dto) {
|
||||
if (dto.getProjectId() == null) throw new ServiceException("projectId不能为空");
|
||||
if (dto.getCameraIds() == null || dto.getCameraIds().isEmpty()) throw new ServiceException("cameraIds不能为空");
|
||||
|
||||
PcRiskProject project = projectMapper.selectPcRiskProjectById(dto.getProjectId());
|
||||
if (project == null) throw new ServiceException("项目不存在或已删除");
|
||||
|
||||
Date allocTime = dto.getAllocTime() != null ? dto.getAllocTime() : new Date();
|
||||
String username = SecurityUtils.getUsername();
|
||||
|
||||
// 校验球机是否可分配 + 状态更新(在库->已分配)
|
||||
List<Long> cameraIds = dto.getCameraIds().stream().distinct().collect(Collectors.toList());
|
||||
|
||||
// 先查一次,避免前端传错ID
|
||||
List<PcCameraLedger> ledgers = ledgerMapper.selectByIds(cameraIds);
|
||||
if (ledgers.size() != cameraIds.size()) throw new ServiceException("存在无效的球机ID");
|
||||
|
||||
// 逐个乐观更新,避免并发重复分配
|
||||
for (Long cameraId : cameraIds) {
|
||||
int ok0 = ledgerMapper.updateStatusIfMatch(cameraId, PcCameraStatus.IN_STOCK, PcCameraStatus.ALLOCATED);
|
||||
int ok3 = 0;
|
||||
if (ok0 == 0) {
|
||||
ok3 = ledgerMapper.updateStatusIfMatch(cameraId, PcCameraStatus.INBOUNDED, PcCameraStatus.ALLOCATED);
|
||||
}
|
||||
if (ok0 == 0 && ok3 == 0) {
|
||||
PcCameraLedger one = ledgerMapper.selectPcCameraLedgerByCameraId(cameraId);
|
||||
throw new ServiceException("球机不可分配,编号=" + (one != null ? one.getCameraNo() : cameraId) + ",当前状态=" + (one != null ? one.getStatus() : "未知"));
|
||||
}
|
||||
}
|
||||
|
||||
// 写入分配记录(每台一条)
|
||||
List<PcCameraAlloc> inserts = new ArrayList<>();
|
||||
for (Long cameraId : cameraIds) {
|
||||
// 防重复(同项目同球机唯一键也能兜底)
|
||||
PcCameraAlloc exists = allocMapper.selectActiveAlloc(dto.getProjectId(), cameraId);
|
||||
if (exists != null) throw new ServiceException("重复分配:项目已存在该球机记录,cameraId=" + cameraId);
|
||||
|
||||
PcCameraAlloc a = new PcCameraAlloc();
|
||||
a.setProjectId(dto.getProjectId());
|
||||
a.setCameraId(cameraId);
|
||||
a.setAllocTime(allocTime);
|
||||
a.setAllocBy(username);
|
||||
a.setAllocNote(dto.getAllocNote());
|
||||
a.setAllocStatus(PcAllocStatus.ALLOCATED);
|
||||
a.setCreateBy(username);
|
||||
a.setUpdateBy(username);
|
||||
inserts.add(a);
|
||||
}
|
||||
int rows = allocMapper.insertBatch(inserts);
|
||||
|
||||
// 如果已满足需分配数量,则项目状态置为已分配(你也可以改成“分配中/部分分配”)
|
||||
int allocatedCount = allocMapper.selectAllocatedByProject(dto.getProjectId()).size();
|
||||
int need = project.getNeedCameraCnt() == null ? 0 : project.getNeedCameraCnt();
|
||||
if (need > 0 && allocatedCount >= need) {
|
||||
projectMapper.updateAllocStatus(dto.getProjectId(), "1");
|
||||
} else {
|
||||
projectMapper.updateAllocStatus(dto.getProjectId(), "0");
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcCameraReturn> selectReturnList(PcCameraReturn query) {
|
||||
return returnMapper.selectReturnList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcCameraReturn> selectAuditPendingList(PcCameraReturn query) {
|
||||
return returnMapper.selectAuditPendingList(query);
|
||||
}
|
||||
|
||||
/** ② 回收确认提交(项目->多台球机) */
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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不能为空");
|
||||
|
||||
String username = SecurityUtils.getUsername();
|
||||
Date returnTime = dto.getReturnTime() != null ? dto.getReturnTime() : new Date();
|
||||
String photoUrls = (dto.getPhotoUrls() == null || dto.getPhotoUrls().isEmpty())
|
||||
? null
|
||||
: String.join(",", dto.getPhotoUrls());
|
||||
|
||||
List<Long> cameraIds = dto.getCameraIds().stream().distinct().collect(Collectors.toList());
|
||||
|
||||
// 找到对应的 alloc 记录(必须是已分配状态)
|
||||
List<PcCameraAlloc> allocated = allocMapper.selectAllocatedByProject(dto.getProjectId());
|
||||
Map<Long, PcCameraAlloc> allocByCamera = allocated.stream()
|
||||
.collect(Collectors.toMap(PcCameraAlloc::getCameraId, x -> x, (a,b)->a));
|
||||
|
||||
for (Long cameraId : cameraIds) {
|
||||
if (!allocByCamera.containsKey(cameraId)) {
|
||||
throw new ServiceException("该球机不属于该项目的“已分配”状态,cameraId=" + cameraId);
|
||||
}
|
||||
}
|
||||
|
||||
// 更新台账状态:已分配 -> 已回收待入库
|
||||
for (Long cameraId : cameraIds) {
|
||||
int ok = ledgerMapper.updateStatusIfMatch(cameraId, PcCameraStatus.ALLOCATED, PcCameraStatus.RETURNED_PENDING_INBOUND);
|
||||
if (ok == 0) {
|
||||
PcCameraLedger one = ledgerMapper.selectPcCameraLedgerByCameraId(cameraId);
|
||||
throw new ServiceException("回收失败,球机状态不匹配,编号=" + (one != null ? one.getCameraNo() : cameraId));
|
||||
}
|
||||
}
|
||||
|
||||
// 更新 alloc 状态:1 -> 2
|
||||
List<Long> allocIds = cameraIds.stream().map(id -> allocByCamera.get(id).getAllocId()).collect(Collectors.toList());
|
||||
allocMapper.updateAllocStatusByIds(allocIds, PcAllocStatus.RETURN_SUBMITTED);
|
||||
|
||||
// 插入回收记录(每台一条)
|
||||
List<PcCameraReturn> inserts = new ArrayList<>();
|
||||
for (Long cameraId : cameraIds) {
|
||||
PcCameraAlloc a = allocByCamera.get(cameraId);
|
||||
PcCameraReturn r = new PcCameraReturn();
|
||||
r.setAllocId(a.getAllocId());
|
||||
r.setProjectId(dto.getProjectId());
|
||||
r.setCameraId(cameraId);
|
||||
r.setCheckResult(dto.getCheckResult());
|
||||
r.setReturnBy(username);
|
||||
r.setReturnTime(returnTime);
|
||||
r.setPhotoUrls(photoUrls);
|
||||
r.setRemark(dto.getRemark());
|
||||
r.setAuditStatus(PcAuditStatus.PENDING);
|
||||
r.setCreateBy(username);
|
||||
r.setUpdateBy(username);
|
||||
inserts.add(r);
|
||||
}
|
||||
return returnMapper.insertBatch(inserts);
|
||||
}
|
||||
|
||||
/** ③ 入库审核通过(确认入库) */
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int approveInbound(PcCameraInboundAuditDTO dto) {
|
||||
if (dto.getReturnIds() == null || dto.getReturnIds().isEmpty()) throw new ServiceException("returnIds不能为空");
|
||||
if (dto.getWarehouse() == null || dto.getWarehouse().isEmpty()) throw new ServiceException("warehouse不能为空(通过时必填)");
|
||||
|
||||
String username = SecurityUtils.getUsername();
|
||||
String keeper = (dto.getKeeper() == null || dto.getKeeper().isEmpty()) ? username : dto.getKeeper();
|
||||
Date inboundTime = dto.getInboundTime() != null ? dto.getInboundTime() : new Date();
|
||||
|
||||
List<PcCameraReturn> returns = returnMapper.selectByIds(dto.getReturnIds());
|
||||
if (returns.size() != dto.getReturnIds().size()) throw new ServiceException("存在无效returnId");
|
||||
for (PcCameraReturn r : returns) {
|
||||
if (!PcAuditStatus.PENDING.equals(r.getAuditStatus())) {
|
||||
throw new ServiceException("仅允许审核“待入库审核”的记录,returnId=" + r.getReturnId());
|
||||
}
|
||||
}
|
||||
|
||||
// 1) 回收记录置为通过
|
||||
int rows = returnMapper.updateAuditStatus(dto.getReturnIds(), PcAuditStatus.APPROVED, username, new Date(), dto.getAuditRemark());
|
||||
|
||||
// 2) 台账状态:2已回收待入库 -> 3已入库(或0在库)
|
||||
for (PcCameraReturn r : returns) {
|
||||
int ok = ledgerMapper.updateStatusIfMatch(r.getCameraId(), PcCameraStatus.RETURNED_PENDING_INBOUND, PcCameraStatus.INBOUNDED);
|
||||
if (ok == 0) {
|
||||
PcCameraLedger one = ledgerMapper.selectPcCameraLedgerByCameraId(r.getCameraId());
|
||||
throw new ServiceException("入库失败,球机状态不匹配,编号=" + (one != null ? one.getCameraNo() : r.getCameraId()));
|
||||
}
|
||||
}
|
||||
|
||||
// 3) 分配记录状态:2 -> 3
|
||||
List<Long> allocIds = returns.stream().map(PcCameraReturn::getAllocId).collect(Collectors.toList());
|
||||
allocMapper.updateAllocStatusByIds(allocIds, PcAllocStatus.INBOUND_DONE);
|
||||
|
||||
// 4) 写入入库记录
|
||||
List<PcCameraInbound> inboundList = new ArrayList<>();
|
||||
for (PcCameraReturn r : returns) {
|
||||
PcCameraInbound in = new PcCameraInbound();
|
||||
in.setReturnId(r.getReturnId());
|
||||
in.setCameraId(r.getCameraId());
|
||||
in.setWarehouse(dto.getWarehouse());
|
||||
in.setKeeper(keeper);
|
||||
in.setInboundTime(inboundTime);
|
||||
in.setRemark(dto.getAuditRemark());
|
||||
in.setCreateBy(username);
|
||||
inboundList.add(in);
|
||||
|
||||
// 可选:同步台账的仓库字段
|
||||
PcCameraLedger ledger = new PcCameraLedger();
|
||||
ledger.setCameraId(r.getCameraId());
|
||||
ledger.setWarehouse(dto.getWarehouse());
|
||||
ledger.setUpdateBy(username);
|
||||
ledgerMapper.updatePcCameraLedger(ledger);
|
||||
}
|
||||
inboundMapper.insertBatch(inboundList);
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
/** ④ 入库审核驳回 */
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int rejectInbound(PcCameraInboundAuditDTO dto) {
|
||||
if (dto.getReturnIds() == null || dto.getReturnIds().isEmpty()) throw new ServiceException("returnIds不能为空");
|
||||
String username = SecurityUtils.getUsername();
|
||||
|
||||
List<PcCameraReturn> returns = returnMapper.selectByIds(dto.getReturnIds());
|
||||
if (returns.size() != dto.getReturnIds().size()) throw new ServiceException("存在无效returnId");
|
||||
for (PcCameraReturn r : returns) {
|
||||
if (!PcAuditStatus.PENDING.equals(r.getAuditStatus())) {
|
||||
throw new ServiceException("仅允许驳回“待入库审核”的记录,returnId=" + r.getReturnId());
|
||||
}
|
||||
}
|
||||
|
||||
// 驳回只改变回收记录状态;台账仍保持“已回收待入库”,方便修改后重新提交/重新审核
|
||||
return returnMapper.updateAuditStatus(dto.getReturnIds(), PcAuditStatus.REJECTED, username, new Date(), dto.getAuditRemark());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.admin.property.service.impl;
|
||||
|
||||
import com.admin.property.service.IPcCameraLedgerService;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.admin.property.domain.PcCameraLedger;
|
||||
import com.admin.property.mapper.PcCameraLedgerMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PcCameraLedgerServiceImpl implements IPcCameraLedgerService {
|
||||
|
||||
private final PcCameraLedgerMapper pcCameraLedgerMapper;
|
||||
|
||||
public PcCameraLedgerServiceImpl(PcCameraLedgerMapper pcCameraLedgerMapper) {
|
||||
this.pcCameraLedgerMapper = pcCameraLedgerMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PcCameraLedger selectPcCameraLedgerByCameraId(Long cameraId) {
|
||||
return pcCameraLedgerMapper.selectPcCameraLedgerByCameraId(cameraId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcCameraLedger> selectPcCameraLedgerList(PcCameraLedger pcCameraLedger) {
|
||||
return pcCameraLedgerMapper.selectPcCameraLedgerList(pcCameraLedger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPcCameraLedger(PcCameraLedger pcCameraLedger) {
|
||||
if (StringUtils.isEmpty(pcCameraLedger.getDelFlag())) {
|
||||
pcCameraLedger.setDelFlag("0");
|
||||
}
|
||||
if (StringUtils.isEmpty(pcCameraLedger.getStatus())) {
|
||||
pcCameraLedger.setStatus("0");
|
||||
}
|
||||
return pcCameraLedgerMapper.insertPcCameraLedger(pcCameraLedger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePcCameraLedger(PcCameraLedger pcCameraLedger) {
|
||||
return pcCameraLedgerMapper.updatePcCameraLedger(pcCameraLedger);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePcCameraLedgerByCameraIds(Long[] cameraIds) {
|
||||
return pcCameraLedgerMapper.deletePcCameraLedgerByCameraIds(cameraIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int changeStatus(Long cameraId, String status) {
|
||||
return pcCameraLedgerMapper.updateStatus(cameraId, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String importData(List<PcCameraLedger> list, boolean updateSupport, String operName) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
throw new ServiceException("导入数据不能为空");
|
||||
}
|
||||
|
||||
int success = 0;
|
||||
int fail = 0;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for (PcCameraLedger item : list) {
|
||||
try {
|
||||
if (StringUtils.isEmpty(item.getCameraNo())) {
|
||||
fail++;
|
||||
sb.append("<br/>球机编号为空,跳过");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 默认值
|
||||
if (StringUtils.isEmpty(item.getDelFlag())) {
|
||||
item.setDelFlag("0");
|
||||
}
|
||||
if (StringUtils.isEmpty(item.getStatus())) {
|
||||
item.setStatus("0");
|
||||
}
|
||||
|
||||
item.setCreateBy(operName);
|
||||
item.setUpdateBy(operName);
|
||||
|
||||
PcCameraLedger exists = pcCameraLedgerMapper.selectByCameraNo(item.getCameraNo());
|
||||
|
||||
if (exists == null) {
|
||||
pcCameraLedgerMapper.insertPcCameraLedger(item);
|
||||
success++;
|
||||
} else if (updateSupport) {
|
||||
item.setCameraId(exists.getCameraId());
|
||||
pcCameraLedgerMapper.updatePcCameraLedger(item);
|
||||
success++;
|
||||
} else {
|
||||
fail++;
|
||||
sb.append("<br/>球机编号 ").append(item.getCameraNo()).append(" 已存在");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
fail++;
|
||||
sb.append("<br/>球机编号 ").append(item.getCameraNo()).append(" 导入失败:").append(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
sb.insert(0, "导入完成:成功 " + success + " 条,失败 " + fail + " 条。");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.admin.property.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.admin.property.domain.PcRiskProject;
|
||||
import com.admin.property.mapper.PcRiskProjectMapper;
|
||||
import com.admin.property.service.IPcRiskProjectService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PcRiskProjectServiceImpl implements IPcRiskProjectService {
|
||||
|
||||
private final PcRiskProjectMapper pcRiskProjectMapper;
|
||||
|
||||
public PcRiskProjectServiceImpl(PcRiskProjectMapper pcRiskProjectMapper) {
|
||||
this.pcRiskProjectMapper = pcRiskProjectMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PcRiskProject selectPcRiskProjectById(Long projectId) {
|
||||
return pcRiskProjectMapper.selectPcRiskProjectById(projectId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcRiskProject> selectPcRiskProjectList(PcRiskProject project) {
|
||||
return pcRiskProjectMapper.selectPcRiskProjectList(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int updatePcRiskProject(Long projectId, PcRiskProject project) {
|
||||
project.setProjectId(projectId);
|
||||
return pcRiskProjectMapper.updatePcRiskProject(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deletePcRiskProjectByIds(Long[] projectIds) {
|
||||
return pcRiskProjectMapper.deletePcRiskProjectByIds(projectIds);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PcRiskProject> selectProjectCompletionReviewList(PcRiskProject pcRiskProject) {
|
||||
return pcRiskProjectMapper.selectProjectCompletionReviewList(pcRiskProject);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int onSiteReview(Long projectId,
|
||||
String onSiteReviewStatus,
|
||||
String onSiteReviewImages,
|
||||
Integer workContentCompleteRate,
|
||||
String siteCleaningCondition,
|
||||
String reviewComments) {
|
||||
// 查询项目
|
||||
PcRiskProject project = pcRiskProjectMapper.selectPcRiskProjectById(projectId);
|
||||
if (project == null) {
|
||||
throw new ServiceException("项目不存在");
|
||||
}
|
||||
|
||||
// 检查监理复核状态,确保复核通过才能进行现场复核
|
||||
if (!"复核通过".equals(project.getSupervisionReviewStatus())) {
|
||||
throw new ServiceException("监理复核未通过,无法进行现场复核");
|
||||
}
|
||||
|
||||
// 更新现场复核状态
|
||||
project.setOnSiteReviewStatus(onSiteReviewStatus);
|
||||
|
||||
// 设置其他复核字段
|
||||
project.setOnSiteReviewImages(onSiteReviewImages); // 现场复核图片(URL数组)
|
||||
project.setWorkContentCompleteRate(workContentCompleteRate); // 作业内容完成度
|
||||
project.setSiteCleaningCondition(siteCleaningCondition); // 现场清理情况
|
||||
project.setReviewComments(reviewComments); // 复核意见
|
||||
|
||||
// 设置为待最终审核状态
|
||||
if ("已复核".equals(onSiteReviewStatus)) {
|
||||
project.setFinalAuditStatus("待审核"); // 设置为待最终审核
|
||||
}
|
||||
|
||||
// 更新项目状态
|
||||
return pcRiskProjectMapper.updateProjectStatus(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int finalAudit(Long projectId) {
|
||||
PcRiskProject project = pcRiskProjectMapper.selectPcRiskProjectById(projectId);
|
||||
if (project == null || !"已复核".equals(project.getOnSiteReviewStatus())) {
|
||||
throw new ServiceException("现场复核未完成,无法进行最终审核");
|
||||
}
|
||||
|
||||
// 更新项目为已完成审核
|
||||
project.setFinalAuditStatus("已审核");
|
||||
|
||||
// 标记项目为已完成并归档
|
||||
project.setProjectStatus("已完成审核");
|
||||
|
||||
return pcRiskProjectMapper.updateProjectStatus(project);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.admin.property.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.admin.property.service.IPcUnitArchiveService;
|
||||
import com.admin.property.domain.PcUnitArchive;
|
||||
import com.admin.property.mapper.PcUnitArchiveMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
@Service
|
||||
public class PcUnitArchiveServiceImpl implements IPcUnitArchiveService {
|
||||
|
||||
private final PcUnitArchiveMapper pcUnitArchiveMapper;
|
||||
|
||||
public PcUnitArchiveServiceImpl(PcUnitArchiveMapper pcUnitArchiveMapper) {
|
||||
this.pcUnitArchiveMapper = pcUnitArchiveMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PcUnitArchive selectPcUnitArchiveByUnitId(Long unitId) {
|
||||
return pcUnitArchiveMapper.selectPcUnitArchiveByUnitId(unitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PcUnitArchive> selectPcUnitArchiveList(PcUnitArchive pcUnitArchive) {
|
||||
return pcUnitArchiveMapper.selectPcUnitArchiveList(pcUnitArchive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPcUnitArchive(PcUnitArchive pcUnitArchive) {
|
||||
// 默认:已建档 + 启用(你也可以由前端传 archiveStatus 实现“暂存草稿/保存建档”)
|
||||
if (!StringUtils.hasText(pcUnitArchive.getArchiveStatus())) {
|
||||
pcUnitArchive.setArchiveStatus("1");
|
||||
}
|
||||
if (!StringUtils.hasText(pcUnitArchive.getStatus())) {
|
||||
pcUnitArchive.setStatus("0");
|
||||
}
|
||||
return pcUnitArchiveMapper.insertPcUnitArchive(pcUnitArchive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePcUnitArchive(PcUnitArchive pcUnitArchive) {
|
||||
return pcUnitArchiveMapper.updatePcUnitArchive(pcUnitArchive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePcUnitArchiveByUnitIds(Long[] unitIds) {
|
||||
return pcUnitArchiveMapper.deletePcUnitArchiveByUnitIds(unitIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int changeStatus(Long unitId, String status) {
|
||||
return pcUnitArchiveMapper.updatePcUnitArchiveStatus(unitId, status);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9208
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-property
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/ruoyi-work" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
</configuration>
|
||||
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.admin.property.mapper.PcCameraAllocMapper">
|
||||
|
||||
<!-- 分配详情:按项目查 -->
|
||||
<select id="selectAllocListByProjectId" resultType="com.admin.property.domain.PcCameraAlloc">
|
||||
select a.alloc_id as allocId,
|
||||
a.project_id as projectId,
|
||||
a.camera_id as cameraId,
|
||||
a.alloc_time as allocTime,
|
||||
a.alloc_by as allocBy,
|
||||
a.alloc_note as allocNote,
|
||||
a.alloc_status as allocStatus,
|
||||
l.camera_no as cameraNo,
|
||||
l.model as model
|
||||
from pc_camera_alloc a
|
||||
left join pc_camera_ledger l on l.camera_id = a.camera_id and l.del_flag='0'
|
||||
where a.del_flag='0'
|
||||
and a.project_id = #{projectId}
|
||||
order by a.alloc_id desc
|
||||
</select>
|
||||
|
||||
<!-- 分配页:高风险项目列表(项目维度展示 + 需要字段) -->
|
||||
<select id="selectRiskProjectAllocList" resultType="com.admin.property.domain.PcCameraAlloc">
|
||||
select
|
||||
p.project_id as projectId,
|
||||
p.project_name as projectName,
|
||||
p.construction_unit as constructionUnit,
|
||||
p.work_location as workLocation,
|
||||
p.risk_type as allocNote, <!-- 复用字段占位(你也可新建VO) -->
|
||||
p.need_camera_cnt as cameraId, <!-- 复用字段占位(你也可新建VO) -->
|
||||
p.alloc_status as allocStatus
|
||||
from pc_risk_project p
|
||||
where p.del_flag='0'
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and p.project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="constructionUnit != null and constructionUnit != ''">
|
||||
and p.construction_unit like concat('%', #{constructionUnit}, '%')
|
||||
</if>
|
||||
<if test="workLocation != null and workLocation != ''">
|
||||
and p.work_location like concat('%', #{workLocation}, '%')
|
||||
</if>
|
||||
<if test="allocStatus != null and allocStatus != ''">
|
||||
and p.alloc_status = #{allocStatus}
|
||||
</if>
|
||||
order by p.project_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch">
|
||||
insert into pc_camera_alloc(project_id, camera_id, alloc_time, alloc_by, alloc_note, alloc_status, del_flag, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.projectId}, #{it.cameraId}, #{it.allocTime}, #{it.allocBy}, #{it.allocNote}, #{it.allocStatus}, '0', #{it.createBy}, now(), #{it.updateBy}, now())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateAllocStatusByProject">
|
||||
update pc_camera_alloc
|
||||
set alloc_status=#{allocStatus}, update_time=now()
|
||||
where del_flag='0' and project_id=#{projectId}
|
||||
</update>
|
||||
|
||||
<select id="selectActiveAlloc" resultType="com.admin.property.domain.PcCameraAlloc">
|
||||
select alloc_id as allocId, project_id as projectId, camera_id as cameraId, alloc_status as allocStatus
|
||||
from pc_camera_alloc
|
||||
where del_flag='0' and project_id=#{projectId} and camera_id=#{cameraId}
|
||||
order by alloc_id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedByProject" resultType="com.admin.property.domain.PcCameraAlloc">
|
||||
select alloc_id as allocId, project_id as projectId, camera_id as cameraId
|
||||
from pc_camera_alloc
|
||||
where del_flag='0' and project_id=#{projectId} and alloc_status='1'
|
||||
</select>
|
||||
|
||||
<update id="updateAllocStatusByIds">
|
||||
update pc_camera_alloc
|
||||
set alloc_status=#{allocStatus}, update_time=now()
|
||||
where del_flag='0' and alloc_id in
|
||||
<foreach collection="allocIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.admin.property.mapper.PcCameraInboundMapper">
|
||||
|
||||
<insert id="insertBatch">
|
||||
insert into pc_camera_inbound(return_id, camera_id, warehouse, keeper, inbound_time, remark, create_by, create_time)
|
||||
values
|
||||
<foreach collection="list" item="it" separator=",">
|
||||
(#{it.returnId}, #{it.cameraId}, #{it.warehouse}, #{it.keeper}, #{it.inboundTime}, #{it.remark}, #{it.createBy}, now())
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.admin.property.mapper.PcCameraLedgerMapper">
|
||||
|
||||
<resultMap id="PcCameraLedgerMap" type="com.admin.property.domain.PcCameraLedger">
|
||||
<id property="cameraId" column="camera_id"/>
|
||||
<result property="cameraNo" column="camera_no"/>
|
||||
<result property="model" column="model"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="ownerUnit" column="owner_unit"/>
|
||||
<result property="warehouse" column="warehouse"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPcCameraLedgerByCameraId" resultMap="PcCameraLedgerMap">
|
||||
select * from pc_camera_ledger
|
||||
where camera_id = #{cameraId}
|
||||
and del_flag='0'
|
||||
</select>
|
||||
|
||||
<select id="selectPcCameraLedgerList" resultMap="PcCameraLedgerMap">
|
||||
select * from pc_camera_ledger
|
||||
where del_flag='0'
|
||||
|
||||
<if test="cameraNo != null and cameraNo != ''">
|
||||
and camera_no like concat('%', #{cameraNo}, '%')
|
||||
</if>
|
||||
<if test="model != null and model != ''">
|
||||
and model like concat('%', #{model}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="ownerUnit != null and ownerUnit != ''">
|
||||
and owner_unit like concat('%', #{ownerUnit}, '%')
|
||||
</if>
|
||||
<if test="warehouse != null and warehouse != ''">
|
||||
and warehouse = #{warehouse}
|
||||
</if>
|
||||
|
||||
<!-- 时间范围:RuoYi 通用 params.beginTime / params.endTime -->
|
||||
<if test="params != null and params.beginTime != null and params.beginTime != ''">
|
||||
and create_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null and params.endTime != ''">
|
||||
and create_time <= #{params.endTime}
|
||||
</if>
|
||||
|
||||
order by camera_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectByCameraNo" resultMap="PcCameraLedgerMap">
|
||||
select * from pc_camera_ledger
|
||||
where del_flag='0'
|
||||
and camera_no = #{cameraNo}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectAvailableCameraList" resultMap="PcCameraLedgerMap">
|
||||
select * from pc_camera_ledger
|
||||
where del_flag='0'
|
||||
and status in ('0','3')
|
||||
<if test="cameraNo != null and cameraNo != ''">
|
||||
and camera_no like concat('%', #{cameraNo}, '%')
|
||||
</if>
|
||||
<if test="model != null and model != ''">
|
||||
and model like concat('%', #{model}, '%')
|
||||
</if>
|
||||
order by camera_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertPcCameraLedger" useGeneratedKeys="true" keyProperty="cameraId">
|
||||
insert into pc_camera_ledger
|
||||
(camera_no, model, status, owner_unit, warehouse, remark, del_flag, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
(#{cameraNo}, #{model}, #{status}, #{ownerUnit}, #{warehouse}, #{remark}, '0', #{createBy}, now(), #{updateBy}, now())
|
||||
</insert>
|
||||
|
||||
<update id="updatePcCameraLedger">
|
||||
update pc_camera_ledger
|
||||
set camera_no=#{cameraNo},
|
||||
model=#{model},
|
||||
status=#{status},
|
||||
owner_unit=#{ownerUnit},
|
||||
warehouse=#{warehouse},
|
||||
remark=#{remark},
|
||||
update_by=#{updateBy},
|
||||
update_time=now()
|
||||
where camera_id=#{cameraId}
|
||||
and del_flag='0'
|
||||
</update>
|
||||
|
||||
<update id="deletePcCameraLedgerByCameraIds">
|
||||
update pc_camera_ledger
|
||||
set del_flag='2',
|
||||
update_time=now()
|
||||
where camera_id in
|
||||
<foreach collection="cameraIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
and del_flag='0'
|
||||
</update>
|
||||
|
||||
<update id="updateStatusIfMatch">
|
||||
update pc_camera_ledger
|
||||
set status = #{toStatus},
|
||||
update_time = now()
|
||||
where camera_id = #{cameraId}
|
||||
and del_flag='0'
|
||||
and status = #{fromStatus}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
update pc_camera_ledger
|
||||
set status = #{toStatus},
|
||||
update_time=now()
|
||||
where camera_id = #{cameraId}
|
||||
and del_flag='0'
|
||||
</update>
|
||||
|
||||
<select id="selectByIds" resultMap="PcCameraLedgerMap">
|
||||
select * from pc_camera_ledger
|
||||
where del_flag='0'
|
||||
and camera_id in
|
||||
<foreach collection="cameraIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.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,
|
||||
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'
|
||||
<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>
|
||||
order by r.return_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectAuditPendingList" 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,
|
||||
l.camera_no as cameraNo,
|
||||
l.model 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' and r.audit_status='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>
|
||||
order by r.return_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch">
|
||||
insert into pc_camera_return(
|
||||
alloc_id, project_id, camera_id, check_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.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>
|
||||
|
||||
<select id="selectByIds" resultType="com.admin.property.domain.PcCameraReturn">
|
||||
select * from pc_camera_return
|
||||
where del_flag='0'
|
||||
and return_id in
|
||||
<foreach collection="returnIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="updateAuditStatus">
|
||||
update pc_camera_return
|
||||
set audit_status = #{auditStatus},
|
||||
audit_by = #{auditBy},
|
||||
audit_time = #{auditTime},
|
||||
audit_remark = #{auditRemark},
|
||||
update_by = #{auditBy},
|
||||
update_time = now()
|
||||
where del_flag='0'
|
||||
and return_id in
|
||||
<foreach collection="returnIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.admin.property.mapper.PcRiskProjectMapper">
|
||||
|
||||
<!-- ✅ 补全复核/审核字段映射(不然业务判断会拿到null) -->
|
||||
<resultMap id="PcRiskProjectMap" type="com.admin.property.domain.PcRiskProject">
|
||||
<id property="projectId" column="project_id"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="projectCode" column="project_code"/>
|
||||
<result property="constructionUnit" column="construction_unit"/>
|
||||
<result property="workLocation" column="work_location"/>
|
||||
<result property="workStart" column="work_start"/>
|
||||
<result property="workEnd" column="work_end"/>
|
||||
<result property="riskType" column="risk_type"/>
|
||||
<result property="needCameraCnt" column="need_camera_cnt"/>
|
||||
<result property="allocStatus" column="alloc_status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
|
||||
<!-- 复核/审核/归档字段 -->
|
||||
<result property="supervisionReviewStatus" column="supervision_review_status"/>
|
||||
<result property="onSiteReviewStatus" column="on_site_review_status"/>
|
||||
<result property="finalAuditStatus" column="final_audit_status"/>
|
||||
<result property="projectStatus" column="project_status"/>
|
||||
<result property="onSiteReviewImages" column="on_site_review_images"/>
|
||||
<result property="workContentCompleteRate" column="work_content_complete_rate"/>
|
||||
<result property="siteCleaningCondition" column="site_cleaning_condition"/>
|
||||
<result property="reviewComments" column="review_comments"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- ===================== 基础CRUD ===================== -->
|
||||
|
||||
<select id="selectPcRiskProjectById" resultMap="PcRiskProjectMap">
|
||||
select * from pc_risk_project
|
||||
where project_id = #{projectId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectPcRiskProjectList" resultMap="PcRiskProjectMap">
|
||||
select * from pc_risk_project
|
||||
where del_flag = '0'
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="projectCode != null and projectCode != ''">
|
||||
and project_code like concat('%', #{projectCode}, '%')
|
||||
</if>
|
||||
<if test="constructionUnit != null and constructionUnit != ''">
|
||||
and construction_unit like concat('%', #{constructionUnit}, '%')
|
||||
</if>
|
||||
<if test="workLocation != null and workLocation != ''">
|
||||
and work_location like concat('%', #{workLocation}, '%')
|
||||
</if>
|
||||
<if test="allocStatus != null and allocStatus != ''">
|
||||
and alloc_status = #{allocStatus}
|
||||
</if>
|
||||
order by project_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertPcRiskProject" useGeneratedKeys="true" keyProperty="projectId">
|
||||
insert into pc_risk_project(
|
||||
project_name, project_code, construction_unit, work_location,
|
||||
work_start, work_end, risk_type, need_camera_cnt, alloc_status,
|
||||
remark, del_flag, create_by, create_time, update_by, update_time
|
||||
) values (
|
||||
#{projectName}, #{projectCode}, #{constructionUnit}, #{workLocation},
|
||||
#{workStart}, #{workEnd}, #{riskType}, #{needCameraCnt}, #{allocStatus},
|
||||
#{remark}, '0', #{createBy}, now(), #{updateBy}, now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePcRiskProject">
|
||||
update pc_risk_project
|
||||
set project_name=#{projectName},
|
||||
project_code=#{projectCode},
|
||||
construction_unit=#{constructionUnit},
|
||||
work_location=#{workLocation},
|
||||
work_start=#{workStart},
|
||||
work_end=#{workEnd},
|
||||
risk_type=#{riskType},
|
||||
need_camera_cnt=#{needCameraCnt},
|
||||
alloc_status=#{allocStatus},
|
||||
remark=#{remark},
|
||||
update_by=#{updateBy},
|
||||
update_time=now()
|
||||
where project_id=#{projectId} and del_flag='0'
|
||||
</update>
|
||||
|
||||
<update id="deletePcRiskProjectByIds">
|
||||
update pc_risk_project
|
||||
set del_flag='2',
|
||||
update_time=now()
|
||||
where project_id in
|
||||
<foreach collection="projectIds" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateAllocStatus">
|
||||
update pc_risk_project
|
||||
set alloc_status = #{allocStatus},
|
||||
update_time = now()
|
||||
where project_id = #{projectId} and del_flag='0'
|
||||
</update>
|
||||
|
||||
<!-- ===================== 完工复核管理 ===================== -->
|
||||
|
||||
<select id="selectProjectCompletionReviewList" resultMap="PcRiskProjectMap">
|
||||
select * from pc_risk_project
|
||||
where del_flag='0'
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and project_name like concat('%', #{projectName}, '%')
|
||||
</if>
|
||||
<if test="constructionUnit != null and constructionUnit != ''">
|
||||
and construction_unit like concat('%', #{constructionUnit}, '%')
|
||||
</if>
|
||||
<if test="workLocation != null and workLocation != ''">
|
||||
and work_location like concat('%', #{workLocation}, '%')
|
||||
</if>
|
||||
|
||||
<!-- 复核/审核/归档筛选 -->
|
||||
<if test="supervisionReviewStatus != null and supervisionReviewStatus != ''">
|
||||
and supervision_review_status = #{supervisionReviewStatus}
|
||||
</if>
|
||||
<if test="onSiteReviewStatus != null and onSiteReviewStatus != ''">
|
||||
and on_site_review_status = #{onSiteReviewStatus}
|
||||
</if>
|
||||
<if test="finalAuditStatus != null and finalAuditStatus != ''">
|
||||
and final_audit_status = #{finalAuditStatus}
|
||||
</if>
|
||||
<if test="projectStatus != null and projectStatus != ''">
|
||||
and project_status = #{projectStatus}
|
||||
</if>
|
||||
|
||||
order by project_id desc
|
||||
</select>
|
||||
|
||||
<!-- ✅ 状态更新:一定要把监理字段也带上,否则你“必须监理通过才能下一步”的判断没法落库 -->
|
||||
<update id="updateProjectStatus">
|
||||
update pc_risk_project
|
||||
set
|
||||
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||
<if test="supervisionReviewStatus != null">supervision_review_status = #{supervisionReviewStatus},</if>
|
||||
<if test="onSiteReviewStatus != null">on_site_review_status = #{onSiteReviewStatus},</if>
|
||||
<if test="finalAuditStatus != null">final_audit_status = #{finalAuditStatus},</if>
|
||||
<if test="projectStatus != null">project_status = #{projectStatus},</if>
|
||||
<if test="onSiteReviewImages != null">on_site_review_images = #{onSiteReviewImages},</if>
|
||||
<if test="workContentCompleteRate != null">work_content_complete_rate = #{workContentCompleteRate},</if>
|
||||
<if test="siteCleaningCondition != null">site_cleaning_condition = #{siteCleaningCondition},</if>
|
||||
<if test="reviewComments != null">review_comments = #{reviewComments},</if>
|
||||
|
||||
update_by = #{updateBy},
|
||||
update_time = now()
|
||||
where project_id = #{projectId} and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<!-- 可选:仅更新监理复核状态(监理系统回写/人工回写时更方便) -->
|
||||
<update id="updateSupervisionReviewStatus">
|
||||
update pc_risk_project
|
||||
set supervision_review_status = #{supervisionReviewStatus},
|
||||
update_time = now()
|
||||
where project_id = #{projectId} and del_flag = '0'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.admin.property.mapper.PcUnitArchiveMapper">
|
||||
|
||||
<resultMap id="PcUnitArchiveResult" type="com.admin.property.domain.PcUnitArchive">
|
||||
<id property="unitId" column="unit_id"/>
|
||||
<result property="unitType" column="unit_type"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="creditCode" column="credit_code"/>
|
||||
<result property="contactName" column="contact_name"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="qualFileUrl" column="qual_file_url"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="archiveStatus" column="archive_status"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
unit_id, unit_type, unit_name, area_code, area_name, credit_code,
|
||||
contact_name, contact_phone, address, qual_file_url, remark,
|
||||
archive_status, status, del_flag, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectPcUnitArchiveByUnitId" parameterType="long" resultMap="PcUnitArchiveResult">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from pc_unit_archive
|
||||
where unit_id = #{unitId}
|
||||
and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectPcUnitArchiveList" parameterType="com.admin.property.domain.PcUnitArchive" resultMap="PcUnitArchiveResult">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from pc_unit_archive
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="unitType != null and unitType != ''">
|
||||
and unit_type = #{unitType}
|
||||
</if>
|
||||
<if test="unitName != null and unitName != ''">
|
||||
and unit_name like concat('%', #{unitName}, '%')
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">
|
||||
and area_code = #{areaCode}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="archiveStatus != null and archiveStatus != ''">
|
||||
and archive_status = #{archiveStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertPcUnitArchive" parameterType="com.admin.property.domain.PcUnitArchive" useGeneratedKeys="true" keyProperty="unitId">
|
||||
insert into pc_unit_archive
|
||||
(unit_type, unit_name, area_code, area_name, credit_code,
|
||||
contact_name, contact_phone, address, qual_file_url, remark,
|
||||
archive_status, status, del_flag, create_by, create_time, update_by, update_time)
|
||||
values
|
||||
(#{unitType}, #{unitName}, #{areaCode}, #{areaName}, #{creditCode},
|
||||
#{contactName}, #{contactPhone}, #{address}, #{qualFileUrl}, #{remark},
|
||||
#{archiveStatus}, #{status}, '0', #{createBy}, now(), #{updateBy}, now())
|
||||
</insert>
|
||||
|
||||
<update id="updatePcUnitArchive" parameterType="com.admin.property.domain.PcUnitArchive">
|
||||
update pc_unit_archive
|
||||
<set>
|
||||
<if test="unitType != null and unitType != ''">unit_type = #{unitType},</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||||
<if test="areaCode != null">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null">area_name = #{areaName},</if>
|
||||
<if test="creditCode != null">credit_code = #{creditCode},</if>
|
||||
<if test="contactName != null">contact_name = #{contactName},</if>
|
||||
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
|
||||
<if test="address != null">address = #{address},</if>
|
||||
<if test="qualFileUrl != null">qual_file_url = #{qualFileUrl},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="archiveStatus != null and archiveStatus != ''">archive_status = #{archiveStatus},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
update_by = #{updateBy},
|
||||
update_time = now()
|
||||
</set>
|
||||
where unit_id = #{unitId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updatePcUnitArchiveStatus">
|
||||
update pc_unit_archive
|
||||
set status = #{param2}, update_time = now()
|
||||
where unit_id = #{param1}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="deletePcUnitArchiveByUnitId" parameterType="long">
|
||||
update pc_unit_archive
|
||||
set del_flag = '2', update_time = now()
|
||||
where unit_id = #{unitId}
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="deletePcUnitArchiveByUnitIds" parameterType="long">
|
||||
update pc_unit_archive
|
||||
set del_flag = '2', update_time = now()
|
||||
where unit_id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and del_flag = '0'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
<module>ruoyi-gen</module>
|
||||
<module>ruoyi-job</module>
|
||||
<module>ruoyi-file</module>
|
||||
<module>aidmt-manage-ms</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>ruoyi-modules</artifactId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue