diff --git a/data-center-business-controller/.DS_Store b/data-center-business-controller/.DS_Store new file mode 100644 index 0000000..b5631c1 Binary files /dev/null and b/data-center-business-controller/.DS_Store differ diff --git a/data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/FacilityController.java b/data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/FacilityController.java new file mode 100644 index 0000000..b3b0d57 --- /dev/null +++ b/data-center-business-controller/src/main/java/com/techsor/datacenter/business/controller/FacilityController.java @@ -0,0 +1,93 @@ +package com.techsor.datacenter.business.controller; + +import com.techsor.datacenter.business.common.response.PageInfo; +import com.techsor.datacenter.business.common.response.PageResponse; +import com.techsor.datacenter.business.common.response.ResponseCode; +import com.techsor.datacenter.business.common.response.SimpleDataResponse; +import com.techsor.datacenter.business.configurator.interceptor.AccessRequired; +import com.techsor.datacenter.business.dto.facility.FacilityAddParam; +import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; +import com.techsor.datacenter.business.dto.facility.FacilityEditParam; +import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; +import com.techsor.datacenter.business.service.FacilityService; +import com.techsor.datacenter.business.vo.facility.FacilityPageVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@AccessRequired +@RequestMapping("/facility") +@Tag(name = "FacilityController", description = "Facility Management Module - APIs for managing facility information") +@Slf4j +public class FacilityController { + + @Autowired + private FacilityService facilityService; + + @Operation(summary = "Get facility list by param") + @GetMapping(path = "/getListPage") + public PageResponse> getListPage( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, + FacilityQueryParam param) { + PageResponse> pageResponse = new PageResponse<>(); + try { + pageResponse.setData(facilityService.query(param, UserId, CompanyId, LanguageType)); + pageResponse.setCode(ResponseCode.SUCCESS); + pageResponse.setMsg("success"); + } catch (Exception e) { + log.error("Error querying facility list", e); + pageResponse.setCode(ResponseCode.SERVER_ERROR); + pageResponse.setMsg("service error"); + } + return pageResponse; + } + + @Operation(summary = "Add facility") + @PostMapping(path = "/add") + public SimpleDataResponse add( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, + @RequestBody FacilityAddParam param) { + return facilityService.add(param, UserId, CompanyId, LanguageType); + } + + @Operation(summary = "Edit facility") + @PostMapping(path = "/edit") + public SimpleDataResponse edit( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, + @RequestBody FacilityEditParam param) { + return facilityService.edit(param, UserId, CompanyId, LanguageType); + } + + @Operation(summary = "Batch delete facilities") + @PostMapping(path = "/delete") + public SimpleDataResponse delete( + @Parameter(name = "LoginName", description = "Login name", required = true, schema = @Schema(defaultValue = "admin")) @RequestHeader(required = true) String LoginName, + @Parameter(name = "AccessToken", description = "Authentication token", required = true) @RequestHeader(required = true) String AccessToken, + @Parameter(name = "UserId", description = "User ID", required = true, schema = @Schema(defaultValue = "1")) @RequestHeader(required = true) Long UserId, + @Parameter(name = "CompanyId", description = "User's company ID", required = false, schema = @Schema(defaultValue = "1")) @RequestHeader(required = false) Long CompanyId, + @Parameter(name = "LanguageType", description = "Language type 0: Chinese 1: English 2: Japanese", required = true, schema = @Schema(defaultValue = "2")) @RequestHeader(required = true) Integer LanguageType, + @Parameter(name = "UTCOffset", description = "Offset between GMT and local time in minutes, e.g., -480 for GMT+8") @RequestHeader(required = true) Integer UTCOffset, + @RequestBody FacilityDeleteParam param) { + return facilityService.batchDelete(param, UserId, CompanyId, LanguageType); + } +} diff --git a/data-center-business-controller/src/main/resources/db/migration/V87__basic_facility.sql b/data-center-business-controller/src/main/resources/db/migration/V87__basic_facility.sql new file mode 100644 index 0000000..9e49cdd --- /dev/null +++ b/data-center-business-controller/src/main/resources/db/migration/V87__basic_facility.sql @@ -0,0 +1,35 @@ +CREATE TABLE `basic_facility` ( + `facility_id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID', + `building_id` bigint NOT NULL COMMENT '关联楼宇ID', + `company_id` bigint DEFAULT NULL COMMENT '企业ID', + `security_company_name` varchar(255) DEFAULT NULL COMMENT '常驻警备公司名称', + `machine_security_company` varchar(255) DEFAULT NULL COMMENT '机械警备公司名称', + `machine_security_tel` varchar(40) DEFAULT NULL COMMENT '机械警备联系电话', + `machine_security_customer_code` varchar(40) DEFAULT NULL COMMENT '机械警备客户代码', + `night_shift_type` varchar(50) DEFAULT NULL COMMENT '夜间体制区分', + `night_guard_count` int DEFAULT NULL COMMENT '夜间常驻人数', + `security_switch_time` varchar(10) DEFAULT NULL COMMENT '常驻→机械 切换时间', + `security_phs` varchar(40) DEFAULT NULL COMMENT '警备员PHS号码', + `mall_security_tel` varchar(40) DEFAULT NULL COMMENT '商场侧警备电话', + `facility_side_type` varchar(50) DEFAULT NULL COMMENT '商场/永旺侧区分', + `ad_direct_tel` varchar(40) DEFAULT NULL COMMENT 'AD直通电话', + `alarm_reception_note` varchar(2000) DEFAULT NULL COMMENT '警报接收特记', + `escalation_flow` varchar(2000) DEFAULT NULL COMMENT '联络流程', + `contract_start_date` date DEFAULT NULL COMMENT '合同开始日', + `open_date` date DEFAULT NULL COMMENT '开业日', + `contract_end_date` date DEFAULT NULL COMMENT '解约日/闭店日', + `legacy_address` varchar(20) DEFAULT NULL COMMENT '旧地址', + `legacy_property_flag` tinyint DEFAULT '0' COMMENT '旧物业标志 0:否 1:是', + `name_change_history` varchar(255) DEFAULT NULL COMMENT '名称变更履历', + `communication_info` varchar(255) DEFAULT NULL COMMENT 'SIM/通信线路', + `nap_time` varchar(20) DEFAULT NULL COMMENT '值班小睡时段', + `note_updated_by` varchar(128) DEFAULT NULL COMMENT '记载者/更新日', + `flag` int DEFAULT '0' COMMENT '删除标记 0:正常 1:已删除', + `create_time` bigint DEFAULT NULL COMMENT '创建时间', + `creator_id` bigint DEFAULT NULL COMMENT '创建人ID', + `modify_time` bigint DEFAULT NULL COMMENT '修改时间', + `modifier_id` bigint DEFAULT NULL COMMENT '修改人ID', + PRIMARY KEY (`facility_id`), + KEY `idx_building_id` (`building_id`), + KEY `idx_company_id` (`company_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='设施信息表'; diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/BasicFacilityMapper.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/BasicFacilityMapper.java new file mode 100644 index 0000000..1ddc720 --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/auto/BasicFacilityMapper.java @@ -0,0 +1,31 @@ +package com.techsor.datacenter.business.dao.auto; + +import com.techsor.datacenter.business.model.BasicFacility; +import com.techsor.datacenter.business.model.BasicFacilityExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface BasicFacilityMapper { + + long countByExample(BasicFacilityExample example); + + int deleteByExample(BasicFacilityExample example); + + int deleteByPrimaryKey(Long facilityId); + + int insert(BasicFacility record); + + int insertSelective(BasicFacility record); + + List selectByExample(BasicFacilityExample example); + + BasicFacility selectByPrimaryKey(Long facilityId); + + int updateByExampleSelective(@Param("record") BasicFacility record, @Param("example") BasicFacilityExample example); + + int updateByExample(@Param("record") BasicFacility record, @Param("example") BasicFacilityExample example); + + int updateByPrimaryKeySelective(BasicFacility record); + + int updateByPrimaryKey(BasicFacility record); +} diff --git a/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/BasicFacilityMapperExt.java b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/BasicFacilityMapperExt.java new file mode 100644 index 0000000..ead824f --- /dev/null +++ b/data-center-business-dao/src/main/java/com/techsor/datacenter/business/dao/ex/BasicFacilityMapperExt.java @@ -0,0 +1,15 @@ +package com.techsor.datacenter.business.dao.ex; + +import com.techsor.datacenter.business.dao.auto.BasicFacilityMapper; +import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; +import com.techsor.datacenter.business.vo.facility.FacilityPageVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface BasicFacilityMapperExt extends BasicFacilityMapper { + + List getListPage(@Param("param") FacilityQueryParam param, @Param("companyId") Long companyId); +} diff --git a/data-center-business-dao/src/main/resources/mappers/auto/BasicFacilityMapper.xml b/data-center-business-dao/src/main/resources/mappers/auto/BasicFacilityMapper.xml new file mode 100644 index 0000000..dcd18b8 --- /dev/null +++ b/data-center-business-dao/src/main/resources/mappers/auto/BasicFacilityMapper.xml @@ -0,0 +1,623 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + facility_id, building_id, company_id, security_company_name, machine_security_company, + machine_security_tel, machine_security_customer_code, night_shift_type, night_guard_count, + security_switch_time, security_phs, mall_security_tel, facility_side_type, ad_direct_tel, + alarm_reception_note, escalation_flow, contract_start_date, open_date, contract_end_date, + legacy_address, legacy_property_flag, name_change_history, communication_info, nap_time, + note_updated_by, flag, create_time, creator_id, modify_time, modifier_id + + + + + + + + delete from basic_facility + where facility_id = #{facilityId,jdbcType=BIGINT} + + + + delete from basic_facility + + + + + + + insert into basic_facility (facility_id, building_id, company_id, + security_company_name, machine_security_company, machine_security_tel, + machine_security_customer_code, night_shift_type, night_guard_count, + security_switch_time, security_phs, mall_security_tel, + facility_side_type, ad_direct_tel, alarm_reception_note, + escalation_flow, contract_start_date, open_date, + contract_end_date, legacy_address, legacy_property_flag, + name_change_history, communication_info, nap_time, + note_updated_by, flag, create_time, + creator_id, modify_time, modifier_id) + values (#{facilityId,jdbcType=BIGINT}, #{buildingId,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, + #{securityCompanyName,jdbcType=VARCHAR}, #{machineSecurityCompany,jdbcType=VARCHAR}, #{machineSecurityTel,jdbcType=VARCHAR}, + #{machineSecurityCustomerCode,jdbcType=VARCHAR}, #{nightShiftType,jdbcType=VARCHAR}, #{nightGuardCount,jdbcType=INTEGER}, + #{securitySwitchTime,jdbcType=VARCHAR}, #{securityPhs,jdbcType=VARCHAR}, #{mallSecurityTel,jdbcType=VARCHAR}, + #{facilitySideType,jdbcType=VARCHAR}, #{adDirectTel,jdbcType=VARCHAR}, #{alarmReceptionNote,jdbcType=VARCHAR}, + #{escalationFlow,jdbcType=VARCHAR}, #{contractStartDate,jdbcType=DATE}, #{openDate,jdbcType=DATE}, + #{contractEndDate,jdbcType=DATE}, #{legacyAddress,jdbcType=VARCHAR}, #{legacyPropertyFlag,jdbcType=TINYINT}, + #{nameChangeHistory,jdbcType=VARCHAR}, #{communicationInfo,jdbcType=VARCHAR}, #{napTime,jdbcType=VARCHAR}, + #{noteUpdatedBy,jdbcType=VARCHAR}, #{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, + #{creatorId,jdbcType=BIGINT}, #{modifyTime,jdbcType=BIGINT}, #{modifierId,jdbcType=BIGINT}) + + + + insert into basic_facility + + + facility_id, + + + building_id, + + + company_id, + + + security_company_name, + + + machine_security_company, + + + machine_security_tel, + + + machine_security_customer_code, + + + night_shift_type, + + + night_guard_count, + + + security_switch_time, + + + security_phs, + + + mall_security_tel, + + + facility_side_type, + + + ad_direct_tel, + + + alarm_reception_note, + + + escalation_flow, + + + contract_start_date, + + + open_date, + + + contract_end_date, + + + legacy_address, + + + legacy_property_flag, + + + name_change_history, + + + communication_info, + + + nap_time, + + + note_updated_by, + + + flag, + + + create_time, + + + creator_id, + + + modify_time, + + + modifier_id, + + + + + #{facilityId,jdbcType=BIGINT}, + + + #{buildingId,jdbcType=BIGINT}, + + + #{companyId,jdbcType=BIGINT}, + + + #{securityCompanyName,jdbcType=VARCHAR}, + + + #{machineSecurityCompany,jdbcType=VARCHAR}, + + + #{machineSecurityTel,jdbcType=VARCHAR}, + + + #{machineSecurityCustomerCode,jdbcType=VARCHAR}, + + + #{nightShiftType,jdbcType=VARCHAR}, + + + #{nightGuardCount,jdbcType=INTEGER}, + + + #{securitySwitchTime,jdbcType=VARCHAR}, + + + #{securityPhs,jdbcType=VARCHAR}, + + + #{mallSecurityTel,jdbcType=VARCHAR}, + + + #{facilitySideType,jdbcType=VARCHAR}, + + + #{adDirectTel,jdbcType=VARCHAR}, + + + #{alarmReceptionNote,jdbcType=VARCHAR}, + + + #{escalationFlow,jdbcType=VARCHAR}, + + + #{contractStartDate,jdbcType=DATE}, + + + #{openDate,jdbcType=DATE}, + + + #{contractEndDate,jdbcType=DATE}, + + + #{legacyAddress,jdbcType=VARCHAR}, + + + #{legacyPropertyFlag,jdbcType=TINYINT}, + + + #{nameChangeHistory,jdbcType=VARCHAR}, + + + #{communicationInfo,jdbcType=VARCHAR}, + + + #{napTime,jdbcType=VARCHAR}, + + + #{noteUpdatedBy,jdbcType=VARCHAR}, + + + #{flag,jdbcType=INTEGER}, + + + #{createTime,jdbcType=BIGINT}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{modifyTime,jdbcType=BIGINT}, + + + #{modifierId,jdbcType=BIGINT}, + + + + + + + + update basic_facility + + + facility_id = #{record.facilityId,jdbcType=BIGINT}, + + + building_id = #{record.buildingId,jdbcType=BIGINT}, + + + company_id = #{record.companyId,jdbcType=BIGINT}, + + + security_company_name = #{record.securityCompanyName,jdbcType=VARCHAR}, + + + machine_security_company = #{record.machineSecurityCompany,jdbcType=VARCHAR}, + + + machine_security_tel = #{record.machineSecurityTel,jdbcType=VARCHAR}, + + + machine_security_customer_code = #{record.machineSecurityCustomerCode,jdbcType=VARCHAR}, + + + night_shift_type = #{record.nightShiftType,jdbcType=VARCHAR}, + + + night_guard_count = #{record.nightGuardCount,jdbcType=INTEGER}, + + + security_switch_time = #{record.securitySwitchTime,jdbcType=VARCHAR}, + + + security_phs = #{record.securityPhs,jdbcType=VARCHAR}, + + + mall_security_tel = #{record.mallSecurityTel,jdbcType=VARCHAR}, + + + facility_side_type = #{record.facilitySideType,jdbcType=VARCHAR}, + + + ad_direct_tel = #{record.adDirectTel,jdbcType=VARCHAR}, + + + alarm_reception_note = #{record.alarmReceptionNote,jdbcType=VARCHAR}, + + + escalation_flow = #{record.escalationFlow,jdbcType=VARCHAR}, + + + contract_start_date = #{record.contractStartDate,jdbcType=DATE}, + + + open_date = #{record.openDate,jdbcType=DATE}, + + + contract_end_date = #{record.contractEndDate,jdbcType=DATE}, + + + legacy_address = #{record.legacyAddress,jdbcType=VARCHAR}, + + + legacy_property_flag = #{record.legacyPropertyFlag,jdbcType=TINYINT}, + + + name_change_history = #{record.nameChangeHistory,jdbcType=VARCHAR}, + + + communication_info = #{record.communicationInfo,jdbcType=VARCHAR}, + + + nap_time = #{record.napTime,jdbcType=VARCHAR}, + + + note_updated_by = #{record.noteUpdatedBy,jdbcType=VARCHAR}, + + + flag = #{record.flag,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + creator_id = #{record.creatorId,jdbcType=BIGINT}, + + + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{record.modifierId,jdbcType=BIGINT}, + + + + + + + + + update basic_facility + set facility_id = #{record.facilityId,jdbcType=BIGINT}, + building_id = #{record.buildingId,jdbcType=BIGINT}, + company_id = #{record.companyId,jdbcType=BIGINT}, + security_company_name = #{record.securityCompanyName,jdbcType=VARCHAR}, + machine_security_company = #{record.machineSecurityCompany,jdbcType=VARCHAR}, + machine_security_tel = #{record.machineSecurityTel,jdbcType=VARCHAR}, + machine_security_customer_code = #{record.machineSecurityCustomerCode,jdbcType=VARCHAR}, + night_shift_type = #{record.nightShiftType,jdbcType=VARCHAR}, + night_guard_count = #{record.nightGuardCount,jdbcType=INTEGER}, + security_switch_time = #{record.securitySwitchTime,jdbcType=VARCHAR}, + security_phs = #{record.securityPhs,jdbcType=VARCHAR}, + mall_security_tel = #{record.mallSecurityTel,jdbcType=VARCHAR}, + facility_side_type = #{record.facilitySideType,jdbcType=VARCHAR}, + ad_direct_tel = #{record.adDirectTel,jdbcType=VARCHAR}, + alarm_reception_note = #{record.alarmReceptionNote,jdbcType=VARCHAR}, + escalation_flow = #{record.escalationFlow,jdbcType=VARCHAR}, + contract_start_date = #{record.contractStartDate,jdbcType=DATE}, + open_date = #{record.openDate,jdbcType=DATE}, + contract_end_date = #{record.contractEndDate,jdbcType=DATE}, + legacy_address = #{record.legacyAddress,jdbcType=VARCHAR}, + legacy_property_flag = #{record.legacyPropertyFlag,jdbcType=TINYINT}, + name_change_history = #{record.nameChangeHistory,jdbcType=VARCHAR}, + communication_info = #{record.communicationInfo,jdbcType=VARCHAR}, + nap_time = #{record.napTime,jdbcType=VARCHAR}, + note_updated_by = #{record.noteUpdatedBy,jdbcType=VARCHAR}, + flag = #{record.flag,jdbcType=INTEGER}, + create_time = #{record.createTime,jdbcType=BIGINT}, + creator_id = #{record.creatorId,jdbcType=BIGINT}, + modify_time = #{record.modifyTime,jdbcType=BIGINT}, + modifier_id = #{record.modifierId,jdbcType=BIGINT} + + + + + + + update basic_facility + + + building_id = #{buildingId,jdbcType=BIGINT}, + + + company_id = #{companyId,jdbcType=BIGINT}, + + + security_company_name = #{securityCompanyName,jdbcType=VARCHAR}, + + + machine_security_company = #{machineSecurityCompany,jdbcType=VARCHAR}, + + + machine_security_tel = #{machineSecurityTel,jdbcType=VARCHAR}, + + + machine_security_customer_code = #{machineSecurityCustomerCode,jdbcType=VARCHAR}, + + + night_shift_type = #{nightShiftType,jdbcType=VARCHAR}, + + + night_guard_count = #{nightGuardCount,jdbcType=INTEGER}, + + + security_switch_time = #{securitySwitchTime,jdbcType=VARCHAR}, + + + security_phs = #{securityPhs,jdbcType=VARCHAR}, + + + mall_security_tel = #{mallSecurityTel,jdbcType=VARCHAR}, + + + facility_side_type = #{facilitySideType,jdbcType=VARCHAR}, + + + ad_direct_tel = #{adDirectTel,jdbcType=VARCHAR}, + + + alarm_reception_note = #{alarmReceptionNote,jdbcType=VARCHAR}, + + + escalation_flow = #{escalationFlow,jdbcType=VARCHAR}, + + + contract_start_date = #{contractStartDate,jdbcType=DATE}, + + + open_date = #{openDate,jdbcType=DATE}, + + + contract_end_date = #{contractEndDate,jdbcType=DATE}, + + + legacy_address = #{legacyAddress,jdbcType=VARCHAR}, + + + legacy_property_flag = #{legacyPropertyFlag,jdbcType=TINYINT}, + + + name_change_history = #{nameChangeHistory,jdbcType=VARCHAR}, + + + communication_info = #{communicationInfo,jdbcType=VARCHAR}, + + + nap_time = #{napTime,jdbcType=VARCHAR}, + + + note_updated_by = #{noteUpdatedBy,jdbcType=VARCHAR}, + + + flag = #{flag,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + creator_id = #{creatorId,jdbcType=BIGINT}, + + + modify_time = #{modifyTime,jdbcType=BIGINT}, + + + modifier_id = #{modifierId,jdbcType=BIGINT}, + + + where facility_id = #{facilityId,jdbcType=BIGINT} + + + + update basic_facility + set building_id = #{buildingId,jdbcType=BIGINT}, + company_id = #{companyId,jdbcType=BIGINT}, + security_company_name = #{securityCompanyName,jdbcType=VARCHAR}, + machine_security_company = #{machineSecurityCompany,jdbcType=VARCHAR}, + machine_security_tel = #{machineSecurityTel,jdbcType=VARCHAR}, + machine_security_customer_code = #{machineSecurityCustomerCode,jdbcType=VARCHAR}, + night_shift_type = #{nightShiftType,jdbcType=VARCHAR}, + night_guard_count = #{nightGuardCount,jdbcType=INTEGER}, + security_switch_time = #{securitySwitchTime,jdbcType=VARCHAR}, + security_phs = #{securityPhs,jdbcType=VARCHAR}, + mall_security_tel = #{mallSecurityTel,jdbcType=VARCHAR}, + facility_side_type = #{facilitySideType,jdbcType=VARCHAR}, + ad_direct_tel = #{adDirectTel,jdbcType=VARCHAR}, + alarm_reception_note = #{alarmReceptionNote,jdbcType=VARCHAR}, + escalation_flow = #{escalationFlow,jdbcType=VARCHAR}, + contract_start_date = #{contractStartDate,jdbcType=DATE}, + open_date = #{openDate,jdbcType=DATE}, + contract_end_date = #{contractEndDate,jdbcType=DATE}, + legacy_address = #{legacyAddress,jdbcType=VARCHAR}, + legacy_property_flag = #{legacyPropertyFlag,jdbcType=TINYINT}, + name_change_history = #{nameChangeHistory,jdbcType=VARCHAR}, + communication_info = #{communicationInfo,jdbcType=VARCHAR}, + nap_time = #{napTime,jdbcType=VARCHAR}, + note_updated_by = #{noteUpdatedBy,jdbcType=VARCHAR}, + flag = #{flag,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=BIGINT}, + creator_id = #{creatorId,jdbcType=BIGINT}, + modify_time = #{modifyTime,jdbcType=BIGINT}, + modifier_id = #{modifierId,jdbcType=BIGINT} + where facility_id = #{facilityId,jdbcType=BIGINT} + + + diff --git a/data-center-business-dao/src/main/resources/mappers/ex/BasicFacilityMapperExt.xml b/data-center-business-dao/src/main/resources/mappers/ex/BasicFacilityMapperExt.xml new file mode 100644 index 0000000..189eafb --- /dev/null +++ b/data-center-business-dao/src/main/resources/mappers/ex/BasicFacilityMapperExt.xml @@ -0,0 +1,54 @@ + + + + + + + diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityAddParam.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityAddParam.java new file mode 100644 index 0000000..8b150e9 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityAddParam.java @@ -0,0 +1,77 @@ +package com.techsor.datacenter.business.dto.facility; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FacilityAddParam { + + @Schema(description = "楼宇ID", example = "1", required = true) + private Long buildingId; + + @Schema(description = "常驻警备公司名称", example = "ABC Security") + private String securityCompanyName; + + @Schema(description = "机械警备公司名称", example = "XYZ Machine Security") + private String machineSecurityCompany; + + @Schema(description = "机械警备联系电话", example = "03-1234-5678") + private String machineSecurityTel; + + @Schema(description = "机械警备客户代码", example = "CUST001") + private String machineSecurityCustomerCode; + + @Schema(description = "夜间体制区分", example = "A") + private String nightShiftType; + + @Schema(description = "夜间常驻人数", example = "2") + private Integer nightGuardCount; + + @Schema(description = "常驻→机械 切换时间", example = "22:00") + private String securitySwitchTime; + + @Schema(description = "警备员PHS号码", example = "070-1234-5678") + private String securityPhs; + + @Schema(description = "商场侧警备电话", example = "03-8765-4321") + private String mallSecurityTel; + + @Schema(description = "商场/永旺侧区分", example = "Mall") + private String facilitySideType; + + @Schema(description = "AD直通电话", example = "03-1111-2222") + private String adDirectTel; + + @Schema(description = "警报接收特记", example = "注意事项...") + private String alarmReceptionNote; + + @Schema(description = "联络流程", example = "联络流程说明...") + private String escalationFlow; + + @Schema(description = "合同开始日", example = "2024-01-01") + private String contractStartDate; + + @Schema(description = "开业日", example = "2024-04-01") + private String openDate; + + @Schema(description = "解约日/闭店日", example = "2025-12-31") + private String contractEndDate; + + @Schema(description = "旧地址", example = "旧地址信息") + private String legacyAddress; + + @Schema(description = "旧物业标志 0:否 1:是", example = "0") + private Integer legacyPropertyFlag; + + @Schema(description = "名称变更履历", example = "变更履历...") + private String nameChangeHistory; + + @Schema(description = "SIM/通信线路", example = "通信线路信息") + private String communicationInfo; + + @Schema(description = "值班小睡时段", example = "23:00-06:00") + private String napTime; + + @Schema(description = "记载者/更新日", example = "张三") + private String noteUpdatedBy; +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityDeleteParam.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityDeleteParam.java new file mode 100644 index 0000000..6c81d9e --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityDeleteParam.java @@ -0,0 +1,11 @@ +package com.techsor.datacenter.business.dto.facility; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FacilityDeleteParam { + + @Schema(description = "设施ID, 逗号分隔", example = "1,2,3") + private String facilityIds; +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityEditParam.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityEditParam.java new file mode 100644 index 0000000..22e2132 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityEditParam.java @@ -0,0 +1,80 @@ +package com.techsor.datacenter.business.dto.facility; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FacilityEditParam { + + @Schema(description = "设施ID", example = "1", required = true) + private Long facilityId; + + @Schema(description = "楼宇ID", example = "1") + private Long buildingId; + + @Schema(description = "常驻警备公司名称", example = "ABC Security") + private String securityCompanyName; + + @Schema(description = "机械警备公司名称", example = "XYZ Machine Security") + private String machineSecurityCompany; + + @Schema(description = "机械警备联系电话", example = "03-1234-5678") + private String machineSecurityTel; + + @Schema(description = "机械警备客户代码", example = "CUST001") + private String machineSecurityCustomerCode; + + @Schema(description = "夜间体制区分", example = "A") + private String nightShiftType; + + @Schema(description = "夜间常驻人数", example = "2") + private Integer nightGuardCount; + + @Schema(description = "常驻→机械 切换时间", example = "22:00") + private String securitySwitchTime; + + @Schema(description = "警备员PHS号码", example = "070-1234-5678") + private String securityPhs; + + @Schema(description = "商场侧警备电话", example = "03-8765-4321") + private String mallSecurityTel; + + @Schema(description = "商场/永旺侧区分", example = "Mall") + private String facilitySideType; + + @Schema(description = "AD直通电话", example = "03-1111-2222") + private String adDirectTel; + + @Schema(description = "警报接收特记", example = "注意事项...") + private String alarmReceptionNote; + + @Schema(description = "联络流程", example = "联络流程说明...") + private String escalationFlow; + + @Schema(description = "合同开始日", example = "2024-01-01") + private String contractStartDate; + + @Schema(description = "开业日", example = "2024-04-01") + private String openDate; + + @Schema(description = "解约日/闭店日", example = "2025-12-31") + private String contractEndDate; + + @Schema(description = "旧地址", example = "旧地址信息") + private String legacyAddress; + + @Schema(description = "旧物业标志 0:否 1:是", example = "0") + private Integer legacyPropertyFlag; + + @Schema(description = "名称变更履历", example = "变更履历...") + private String nameChangeHistory; + + @Schema(description = "SIM/通信线路", example = "通信线路信息") + private String communicationInfo; + + @Schema(description = "值班小睡时段", example = "23:00-06:00") + private String napTime; + + @Schema(description = "记载者/更新日", example = "张三") + private String noteUpdatedBy; +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityQueryParam.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityQueryParam.java new file mode 100644 index 0000000..d1d1f92 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/facility/FacilityQueryParam.java @@ -0,0 +1,18 @@ +package com.techsor.datacenter.business.dto.facility; + +import com.techsor.datacenter.business.dto.BaseSearchParams; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FacilityQueryParam extends BaseSearchParams { + + @Schema(description = "楼宇ID", example = "1") + private Long buildingId; + + @Schema(description = "常驻警备公司名称关键字", example = "ABC") + private String securityCompanyName; + + @Schema(description = "机械警备公司名称关键字", example = "XYZ") + private String machineSecurityCompany; +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacility.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacility.java new file mode 100644 index 0000000..9061849 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacility.java @@ -0,0 +1,279 @@ +package com.techsor.datacenter.business.model; + +import java.io.Serializable; +import java.util.Date; + +public class BasicFacility implements Serializable { + private Long facilityId; + private Long buildingId; + private Long companyId; + private String securityCompanyName; + private String machineSecurityCompany; + private String machineSecurityTel; + private String machineSecurityCustomerCode; + private String nightShiftType; + private Integer nightGuardCount; + private String securitySwitchTime; + private String securityPhs; + private String mallSecurityTel; + private String facilitySideType; + private String adDirectTel; + private String alarmReceptionNote; + private String escalationFlow; + private Date contractStartDate; + private Date openDate; + private Date contractEndDate; + private String legacyAddress; + private Integer legacyPropertyFlag; + private String nameChangeHistory; + private String communicationInfo; + private String napTime; + private String noteUpdatedBy; + private Integer flag; + private Long createTime; + private Long creatorId; + private Long modifyTime; + private Long modifierId; + + private static final long serialVersionUID = 1L; + + public Long getFacilityId() { + return facilityId; + } + + public void setFacilityId(Long facilityId) { + this.facilityId = facilityId; + } + + public Long getBuildingId() { + return buildingId; + } + + public void setBuildingId(Long buildingId) { + this.buildingId = buildingId; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getSecurityCompanyName() { + return securityCompanyName; + } + + public void setSecurityCompanyName(String securityCompanyName) { + this.securityCompanyName = securityCompanyName; + } + + public String getMachineSecurityCompany() { + return machineSecurityCompany; + } + + public void setMachineSecurityCompany(String machineSecurityCompany) { + this.machineSecurityCompany = machineSecurityCompany; + } + + public String getMachineSecurityTel() { + return machineSecurityTel; + } + + public void setMachineSecurityTel(String machineSecurityTel) { + this.machineSecurityTel = machineSecurityTel; + } + + public String getMachineSecurityCustomerCode() { + return machineSecurityCustomerCode; + } + + public void setMachineSecurityCustomerCode(String machineSecurityCustomerCode) { + this.machineSecurityCustomerCode = machineSecurityCustomerCode; + } + + public String getNightShiftType() { + return nightShiftType; + } + + public void setNightShiftType(String nightShiftType) { + this.nightShiftType = nightShiftType; + } + + public Integer getNightGuardCount() { + return nightGuardCount; + } + + public void setNightGuardCount(Integer nightGuardCount) { + this.nightGuardCount = nightGuardCount; + } + + public String getSecuritySwitchTime() { + return securitySwitchTime; + } + + public void setSecuritySwitchTime(String securitySwitchTime) { + this.securitySwitchTime = securitySwitchTime; + } + + public String getSecurityPhs() { + return securityPhs; + } + + public void setSecurityPhs(String securityPhs) { + this.securityPhs = securityPhs; + } + + public String getMallSecurityTel() { + return mallSecurityTel; + } + + public void setMallSecurityTel(String mallSecurityTel) { + this.mallSecurityTel = mallSecurityTel; + } + + public String getFacilitySideType() { + return facilitySideType; + } + + public void setFacilitySideType(String facilitySideType) { + this.facilitySideType = facilitySideType; + } + + public String getAdDirectTel() { + return adDirectTel; + } + + public void setAdDirectTel(String adDirectTel) { + this.adDirectTel = adDirectTel; + } + + public String getAlarmReceptionNote() { + return alarmReceptionNote; + } + + public void setAlarmReceptionNote(String alarmReceptionNote) { + this.alarmReceptionNote = alarmReceptionNote; + } + + public String getEscalationFlow() { + return escalationFlow; + } + + public void setEscalationFlow(String escalationFlow) { + this.escalationFlow = escalationFlow; + } + + public Date getContractStartDate() { + return contractStartDate; + } + + public void setContractStartDate(Date contractStartDate) { + this.contractStartDate = contractStartDate; + } + + public Date getOpenDate() { + return openDate; + } + + public void setOpenDate(Date openDate) { + this.openDate = openDate; + } + + public Date getContractEndDate() { + return contractEndDate; + } + + public void setContractEndDate(Date contractEndDate) { + this.contractEndDate = contractEndDate; + } + + public String getLegacyAddress() { + return legacyAddress; + } + + public void setLegacyAddress(String legacyAddress) { + this.legacyAddress = legacyAddress; + } + + public Integer getLegacyPropertyFlag() { + return legacyPropertyFlag; + } + + public void setLegacyPropertyFlag(Integer legacyPropertyFlag) { + this.legacyPropertyFlag = legacyPropertyFlag; + } + + public String getNameChangeHistory() { + return nameChangeHistory; + } + + public void setNameChangeHistory(String nameChangeHistory) { + this.nameChangeHistory = nameChangeHistory; + } + + public String getCommunicationInfo() { + return communicationInfo; + } + + public void setCommunicationInfo(String communicationInfo) { + this.communicationInfo = communicationInfo; + } + + public String getNapTime() { + return napTime; + } + + public void setNapTime(String napTime) { + this.napTime = napTime; + } + + public String getNoteUpdatedBy() { + return noteUpdatedBy; + } + + public void setNoteUpdatedBy(String noteUpdatedBy) { + this.noteUpdatedBy = noteUpdatedBy; + } + + public Integer getFlag() { + return flag; + } + + public void setFlag(Integer flag) { + this.flag = flag; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public Long getCreatorId() { + return creatorId; + } + + public void setCreatorId(Long creatorId) { + this.creatorId = creatorId; + } + + public Long getModifyTime() { + return modifyTime; + } + + public void setModifyTime(Long modifyTime) { + this.modifyTime = modifyTime; + } + + public Long getModifierId() { + return modifierId; + } + + public void setModifierId(Long modifierId) { + this.modifierId = modifierId; + } +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacilityExample.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacilityExample.java new file mode 100644 index 0000000..6bfaf92 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicFacilityExample.java @@ -0,0 +1,180 @@ +package com.techsor.datacenter.business.model; + +import java.util.ArrayList; +import java.util.List; + +public class BasicFacilityExample { + protected String orderByClause; + protected boolean distinct; + protected List oredCriteria; + + public BasicFacilityExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria createCriteria() { + Criteria criteria = new Criteria(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public static class Criteria { + protected List criteria; + + protected Criteria() { + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value) { + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2) { + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andFacilityIdEqualTo(Long value) { + addCriterion("facility_id =", value); + return this; + } + + public Criteria andFacilityIdIn(List values) { + addCriterion("facility_id in", values); + return this; + } + + public Criteria andBuildingIdEqualTo(Long value) { + addCriterion("building_id =", value); + return this; + } + + public Criteria andBuildingIdIn(List values) { + addCriterion("building_id in", values); + return this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value); + return this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values); + return this; + } + + public Criteria andFlagEqualTo(Integer value) { + addCriterion("flag =", value); + return this; + } + + public Criteria andFlagNotEqualTo(Integer value) { + addCriterion("flag <>", value); + return this; + } + } + + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + + protected Criterion(String condition) { + this.condition = condition; + this.noValue = true; + } + + protected Criterion(String condition, Object value) { + this.condition = condition; + this.value = value; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.betweenValue = true; + } + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + } +} diff --git a/data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/facility/FacilityPageVO.java b/data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/facility/FacilityPageVO.java new file mode 100644 index 0000000..6fcbac2 --- /dev/null +++ b/data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/facility/FacilityPageVO.java @@ -0,0 +1,86 @@ +package com.techsor.datacenter.business.vo.facility; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class FacilityPageVO { + + @Schema(description = "设施ID") + private Long facilityId; + + @Schema(description = "楼宇ID") + private Long buildingId; + + @Schema(description = "楼宇名称") + private String buildingName; + + @Schema(description = "企业ID") + private Long companyId; + + @Schema(description = "常驻警备公司名称") + private String securityCompanyName; + + @Schema(description = "机械警备公司名称") + private String machineSecurityCompany; + + @Schema(description = "机械警备联系电话") + private String machineSecurityTel; + + @Schema(description = "机械警备客户代码") + private String machineSecurityCustomerCode; + + @Schema(description = "夜间体制区分") + private String nightShiftType; + + @Schema(description = "夜间常驻人数") + private Integer nightGuardCount; + + @Schema(description = "常驻→机械 切换时间") + private String securitySwitchTime; + + @Schema(description = "警备员PHS号码") + private String securityPhs; + + @Schema(description = "商场侧警备电话") + private String mallSecurityTel; + + @Schema(description = "商场/永旺侧区分") + private String facilitySideType; + + @Schema(description = "AD直通电话") + private String adDirectTel; + + @Schema(description = "警报接收特记") + private String alarmReceptionNote; + + @Schema(description = "联络流程") + private String escalationFlow; + + @Schema(description = "合同开始日") + private String contractStartDate; + + @Schema(description = "开业日") + private String openDate; + + @Schema(description = "解约日/闭店日") + private String contractEndDate; + + @Schema(description = "旧地址") + private String legacyAddress; + + @Schema(description = "旧物业标志 0:否 1:是") + private Integer legacyPropertyFlag; + + @Schema(description = "名称变更履历") + private String nameChangeHistory; + + @Schema(description = "SIM/通信线路") + private String communicationInfo; + + @Schema(description = "值班小睡时段") + private String napTime; + + @Schema(description = "记载者/更新日") + private String noteUpdatedBy; +} diff --git a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/FacilityService.java b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/FacilityService.java new file mode 100644 index 0000000..2ca6fb4 --- /dev/null +++ b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/FacilityService.java @@ -0,0 +1,20 @@ +package com.techsor.datacenter.business.service; + +import com.techsor.datacenter.business.common.response.PageInfo; +import com.techsor.datacenter.business.common.response.SimpleDataResponse; +import com.techsor.datacenter.business.dto.facility.FacilityAddParam; +import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; +import com.techsor.datacenter.business.dto.facility.FacilityEditParam; +import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; +import com.techsor.datacenter.business.vo.facility.FacilityPageVO; + +public interface FacilityService { + + PageInfo query(FacilityQueryParam param, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse add(FacilityAddParam param, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse edit(FacilityEditParam param, Long userId, Long companyId, Integer languageType); + + SimpleDataResponse batchDelete(FacilityDeleteParam param, Long userId, Long companyId, Integer languageType); +} diff --git a/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/FacilityServiceImpl.java b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/FacilityServiceImpl.java new file mode 100644 index 0000000..414f05e --- /dev/null +++ b/data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/FacilityServiceImpl.java @@ -0,0 +1,243 @@ +package com.techsor.datacenter.business.service.impl; + +import com.github.pagehelper.PageHelper; +import com.google.gson.Gson; +import com.techsor.datacenter.business.common.Constants; +import com.techsor.datacenter.business.common.language.msg.MsgLanguageChange; +import com.techsor.datacenter.business.common.response.PageInfo; +import com.techsor.datacenter.business.common.response.ResponseCode; +import com.techsor.datacenter.business.common.response.SimpleDataResponse; +import com.techsor.datacenter.business.dao.ex.BasicFacilityMapperExt; +import com.techsor.datacenter.business.dto.facility.FacilityAddParam; +import com.techsor.datacenter.business.dto.facility.FacilityDeleteParam; +import com.techsor.datacenter.business.dto.facility.FacilityEditParam; +import com.techsor.datacenter.business.dto.facility.FacilityQueryParam; +import com.techsor.datacenter.business.model.BasicFacility; +import com.techsor.datacenter.business.model.BasicFacilityExample; +import com.techsor.datacenter.business.service.FacilityService; +import com.techsor.datacenter.business.service.UserOperationLogsService; +import com.techsor.datacenter.business.vo.facility.FacilityPageVO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.ObjectUtils; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.List; + +@Slf4j +@Service +public class FacilityServiceImpl implements FacilityService { + + private static Logger logger = LoggerFactory.getLogger(FacilityServiceImpl.class); + + @Autowired + private MsgLanguageChange msgLanguageChange; + + @Autowired + private BasicFacilityMapperExt basicFacilityMapperExt; + + @Autowired + private UserOperationLogsService userOperationLogsService; + + private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + @Override + public PageInfo query(FacilityQueryParam param, Long userId, Long companyId, Integer languageType) { + PageHelper.startPage(param.getPageNum() == null ? 1 : param.getPageNum(), param.getPageSize() == null ? 20 : param.getPageSize()); + List resultList = basicFacilityMapperExt.getListPage(param, companyId); + return new PageInfo<>(resultList); + } + + @Override + @Transactional + public SimpleDataResponse add(FacilityAddParam param, Long userId, Long companyId, Integer languageType) { + try { + if (ObjectUtils.isEmpty(param.getBuildingId())) { + return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); + } + + BasicFacility insertObj = new BasicFacility(); + insertObj.setBuildingId(param.getBuildingId()); + insertObj.setCompanyId(companyId); + insertObj.setSecurityCompanyName(param.getSecurityCompanyName()); + insertObj.setMachineSecurityCompany(param.getMachineSecurityCompany()); + insertObj.setMachineSecurityTel(param.getMachineSecurityTel()); + insertObj.setMachineSecurityCustomerCode(param.getMachineSecurityCustomerCode()); + insertObj.setNightShiftType(param.getNightShiftType()); + insertObj.setNightGuardCount(param.getNightGuardCount()); + insertObj.setSecuritySwitchTime(param.getSecuritySwitchTime()); + insertObj.setSecurityPhs(param.getSecurityPhs()); + insertObj.setMallSecurityTel(param.getMallSecurityTel()); + insertObj.setFacilitySideType(param.getFacilitySideType()); + insertObj.setAdDirectTel(param.getAdDirectTel()); + insertObj.setAlarmReceptionNote(param.getAlarmReceptionNote()); + insertObj.setEscalationFlow(param.getEscalationFlow()); + if (StringUtils.isNotBlank(param.getContractStartDate())) { + try { + insertObj.setContractStartDate(DATE_FORMAT.parse(param.getContractStartDate())); + } catch (Exception e) { + log.warn("Invalid contractStartDate: {}", param.getContractStartDate()); + } + } + if (StringUtils.isNotBlank(param.getOpenDate())) { + try { + insertObj.setOpenDate(DATE_FORMAT.parse(param.getOpenDate())); + } catch (Exception e) { + log.warn("Invalid openDate: {}", param.getOpenDate()); + } + } + if (StringUtils.isNotBlank(param.getContractEndDate())) { + try { + insertObj.setContractEndDate(DATE_FORMAT.parse(param.getContractEndDate())); + } catch (Exception e) { + log.warn("Invalid contractEndDate: {}", param.getContractEndDate()); + } + } + insertObj.setLegacyAddress(param.getLegacyAddress()); + insertObj.setLegacyPropertyFlag(param.getLegacyPropertyFlag()); + insertObj.setNameChangeHistory(param.getNameChangeHistory()); + insertObj.setCommunicationInfo(param.getCommunicationInfo()); + insertObj.setNapTime(param.getNapTime()); + insertObj.setNoteUpdatedBy(param.getNoteUpdatedBy()); + insertObj.setFlag(0); + insertObj.setCreateTime(System.currentTimeMillis()); + insertObj.setCreatorId(userId); + + basicFacilityMapperExt.insertSelective(insertObj); + + userOperationLogsService.recordLog(companyId, userId, "添加设施信息:" + insertObj.getFacilityId(), + "Add Facility:" + insertObj.getFacilityId(), + "施設情報を追加:" + insertObj.getFacilityId(), + "Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, + new Gson().toJson(insertObj)); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Error adding facility", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } + + @Override + @Transactional + public SimpleDataResponse edit(FacilityEditParam param, Long userId, Long companyId, Integer languageType) { + try { + if (ObjectUtils.isEmpty(param.getFacilityId())) { + return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); + } + + BasicFacilityExample example = new BasicFacilityExample(); + example.createCriteria().andFacilityIdEqualTo(param.getFacilityId()).andFlagEqualTo(0); + long cnt = basicFacilityMapperExt.countByExample(example); + if (cnt == 0) { + return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "facilityNotExist")); + } + + BasicFacility updateObj = new BasicFacility(); + updateObj.setFacilityId(param.getFacilityId()); + if (param.getBuildingId() != null) { + updateObj.setBuildingId(param.getBuildingId()); + } + updateObj.setSecurityCompanyName(param.getSecurityCompanyName()); + updateObj.setMachineSecurityCompany(param.getMachineSecurityCompany()); + updateObj.setMachineSecurityTel(param.getMachineSecurityTel()); + updateObj.setMachineSecurityCustomerCode(param.getMachineSecurityCustomerCode()); + updateObj.setNightShiftType(param.getNightShiftType()); + updateObj.setNightGuardCount(param.getNightGuardCount()); + updateObj.setSecuritySwitchTime(param.getSecuritySwitchTime()); + updateObj.setSecurityPhs(param.getSecurityPhs()); + updateObj.setMallSecurityTel(param.getMallSecurityTel()); + updateObj.setFacilitySideType(param.getFacilitySideType()); + updateObj.setAdDirectTel(param.getAdDirectTel()); + updateObj.setAlarmReceptionNote(param.getAlarmReceptionNote()); + updateObj.setEscalationFlow(param.getEscalationFlow()); + if (StringUtils.isNotBlank(param.getContractStartDate())) { + try { + updateObj.setContractStartDate(DATE_FORMAT.parse(param.getContractStartDate())); + } catch (Exception e) { + log.warn("Invalid contractStartDate: {}", param.getContractStartDate()); + } + } + if (StringUtils.isNotBlank(param.getOpenDate())) { + try { + updateObj.setOpenDate(DATE_FORMAT.parse(param.getOpenDate())); + } catch (Exception e) { + log.warn("Invalid openDate: {}", param.getOpenDate()); + } + } + if (StringUtils.isNotBlank(param.getContractEndDate())) { + try { + updateObj.setContractEndDate(DATE_FORMAT.parse(param.getContractEndDate())); + } catch (Exception e) { + log.warn("Invalid contractEndDate: {}", param.getContractEndDate()); + } + } + updateObj.setLegacyAddress(param.getLegacyAddress()); + updateObj.setLegacyPropertyFlag(param.getLegacyPropertyFlag()); + updateObj.setNameChangeHistory(param.getNameChangeHistory()); + updateObj.setCommunicationInfo(param.getCommunicationInfo()); + updateObj.setNapTime(param.getNapTime()); + updateObj.setNoteUpdatedBy(param.getNoteUpdatedBy()); + updateObj.setModifyTime(System.currentTimeMillis()); + updateObj.setModifierId(userId); + + basicFacilityMapperExt.updateByPrimaryKeySelective(updateObj); + + userOperationLogsService.recordLog(companyId, userId, "编辑设施信息:" + updateObj.getFacilityId(), + "Edit Facility:" + updateObj.getFacilityId(), + "施設情報を編集:" + updateObj.getFacilityId(), + "Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, + new Gson().toJson(updateObj)); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Error editing facility", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } + + @Override + @Transactional + public SimpleDataResponse batchDelete(FacilityDeleteParam param, Long userId, Long companyId, Integer languageType) { + try { + if (ObjectUtils.isEmpty(param.getFacilityIds())) { + return SimpleDataResponse.fail(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "paramsFormatError")); + } + + List idList = Arrays.stream(param.getFacilityIds().split(",")) + .map(String::trim) + .filter(s -> !s.isEmpty()) + .map(Long::parseLong) + .toList(); + + for (Long id : idList) { + BasicFacility updateObj = new BasicFacility(); + updateObj.setFacilityId(id); + updateObj.setModifyTime(System.currentTimeMillis()); + updateObj.setModifierId(userId); + updateObj.setFlag(1); + basicFacilityMapperExt.updateByPrimaryKeySelective(updateObj); + } + + userOperationLogsService.recordLog(companyId, userId, "删除设施信息:" + param.getFacilityIds(), + "Delete Facility:" + param.getFacilityIds(), + "施設情報を削除:" + param.getFacilityIds(), + "Success", Constants.USER_OPERATION_LOG_TYPE_ASSET_LOG, ""); + + return SimpleDataResponse.success(); + } catch (Exception e) { + logger.error("Error deleting facility", e); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return new SimpleDataResponse(ResponseCode.SERVER_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "serviceError")); + } + } +} diff --git a/document/.DS_Store b/document/.DS_Store index 75398f4..c4304a1 100644 Binary files a/document/.DS_Store and b/document/.DS_Store differ diff --git a/document/openapis/facility-openapi.json b/document/openapis/facility-openapi.json new file mode 100644 index 0000000..ac73ac3 --- /dev/null +++ b/document/openapis/facility-openapi.json @@ -0,0 +1,1029 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Facility Management API", + "description": "设施信息管理接口文档,提供设施信息的增删改查功能。设施表(basic_facility)通过building_id与楼宇表(basic_building)关联。", + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.example.com", + "description": "Production Server" + } + ], + "paths": { + "/facility/getListPage": { + "get": { + "summary": "分页查询设施列表", + "description": "根据查询条件分页获取设施信息列表,支持按楼宇ID、常驻警备公司名称、机械警备公司名称进行筛选。返回结果包含关联的楼宇名称。", + "tags": ["FacilityController"], + "parameters": [ + { + "name": "LoginName", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "admin" + }, + "description": "登录名" + }, + { + "name": "AccessToken", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "鉴权token" + }, + { + "name": "UserId", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户ID" + }, + { + "name": "CompanyId", + "in": "header", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户所属企业ID" + }, + { + "name": "LanguageType", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": 2 + }, + "description": "语言类型 0:中文 1:英文 2:日文" + }, + { + "name": "UTCOffset", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": -480 + }, + "description": "格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480" + }, + { + "name": "buildingId", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + }, + "description": "楼宇ID", + "example": 1 + }, + { + "name": "securityCompanyName", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "常驻警备公司名称(模糊匹配)", + "example": "ABC" + }, + { + "name": "machineSecurityCompany", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "description": "机械警备公司名称(模糊匹配)", + "example": "XYZ" + }, + { + "name": "pageNum", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 1 + }, + "description": "页码" + }, + { + "name": "pageSize", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20 + }, + "description": "每页条数" + } + ], + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageResponse_FacilityPageVO" + } + } + } + }, + "500": { + "description": "服务器内部错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PageResponse" + } + } + } + } + } + } + }, + "/facility/add": { + "post": { + "summary": "新增设施信息", + "description": "新增一条设施信息记录,buildingId为必填字段。日期字段格式为 yyyy-MM-dd。", + "tags": ["FacilityController"], + "parameters": [ + { + "name": "LoginName", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "admin" + }, + "description": "登录名" + }, + { + "name": "AccessToken", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "鉴权token" + }, + { + "name": "UserId", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户ID" + }, + { + "name": "CompanyId", + "in": "header", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户所属企业ID" + }, + { + "name": "LanguageType", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": 2 + }, + "description": "语言类型 0:中文 1:英文 2:日文" + }, + { + "name": "UTCOffset", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": -480 + }, + "description": "格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480" + } + ], + "requestBody": { + "description": "设施新增参数", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FacilityAddParam" + } + } + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "400": { + "description": "参数校验失败", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "500": { + "description": "服务器内部错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + } + } + } + }, + "/facility/edit": { + "post": { + "summary": "编辑设施信息", + "description": "编辑一条已有的设施信息记录,facilityId为必填字段。日期字段格式为 yyyy-MM-dd。", + "tags": ["FacilityController"], + "parameters": [ + { + "name": "LoginName", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "admin" + }, + "description": "登录名" + }, + { + "name": "AccessToken", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "鉴权token" + }, + { + "name": "UserId", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户ID" + }, + { + "name": "CompanyId", + "in": "header", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户所属企业ID" + }, + { + "name": "LanguageType", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": 2 + }, + "description": "语言类型 0:中文 1:英文 2:日文" + }, + { + "name": "UTCOffset", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": -480 + }, + "description": "格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480" + } + ], + "requestBody": { + "description": "设施编辑参数", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FacilityEditParam" + } + } + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "400": { + "description": "参数校验失败或记录不存在", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "500": { + "description": "服务器内部错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + } + } + } + }, + "/facility/delete": { + "post": { + "summary": "批量删除设施信息", + "description": "批量软删除设施信息(设置flag=1),支持逗号分隔的多个facilityId。", + "tags": ["FacilityController"], + "parameters": [ + { + "name": "LoginName", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "admin" + }, + "description": "登录名" + }, + { + "name": "AccessToken", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "鉴权token" + }, + { + "name": "UserId", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户ID" + }, + { + "name": "CompanyId", + "in": "header", + "required": false, + "schema": { + "type": "integer", + "format": "int64", + "default": 1 + }, + "description": "用户所属企业ID" + }, + { + "name": "LanguageType", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": 2 + }, + "description": "语言类型 0:中文 1:英文 2:日文" + }, + { + "name": "UTCOffset", + "in": "header", + "required": true, + "schema": { + "type": "integer", + "default": -480 + }, + "description": "格林威治时间与本地时间的差值,单位是分钟,比如东八区是 -480" + } + ], + "requestBody": { + "description": "设施删除参数", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FacilityDeleteParam" + } + } + } + }, + "responses": { + "200": { + "description": "成功", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "400": { + "description": "参数校验失败", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + }, + "500": { + "description": "服务器内部错误", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SimpleDataResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "FacilityAddParam": { + "type": "object", + "required": ["buildingId"], + "properties": { + "buildingId": { + "type": "integer", + "format": "int64", + "description": "楼宇ID(必填)", + "example": 1 + }, + "securityCompanyName": { + "type": "string", + "maxLength": 255, + "description": "常驻警备公司名称", + "example": "ABC Security" + }, + "machineSecurityCompany": { + "type": "string", + "maxLength": 255, + "description": "机械警备公司名称", + "example": "XYZ Machine Security" + }, + "machineSecurityTel": { + "type": "string", + "maxLength": 40, + "description": "机械警备联系电话", + "example": "03-1234-5678" + }, + "machineSecurityCustomerCode": { + "type": "string", + "maxLength": 40, + "description": "机械警备客户代码", + "example": "CUST001" + }, + "nightShiftType": { + "type": "string", + "maxLength": 50, + "description": "夜间体制区分", + "example": "A" + }, + "nightGuardCount": { + "type": "integer", + "description": "夜间常驻人数", + "example": 2 + }, + "securitySwitchTime": { + "type": "string", + "maxLength": 10, + "description": "常驻→机械 切换时间(格式 HH:mm)", + "example": "22:00" + }, + "securityPhs": { + "type": "string", + "maxLength": 40, + "description": "警备员PHS号码", + "example": "070-1234-5678" + }, + "mallSecurityTel": { + "type": "string", + "maxLength": 40, + "description": "商场侧警备电话", + "example": "03-8765-4321" + }, + "facilitySideType": { + "type": "string", + "maxLength": 50, + "description": "商场/永旺侧区分", + "example": "Mall" + }, + "adDirectTel": { + "type": "string", + "maxLength": 40, + "description": "AD直通电话", + "example": "03-1111-2222" + }, + "alarmReceptionNote": { + "type": "string", + "maxLength": 2000, + "description": "警报接收特记", + "example": "注意事项..." + }, + "escalationFlow": { + "type": "string", + "maxLength": 2000, + "description": "联络流程", + "example": "联络流程说明..." + }, + "contractStartDate": { + "type": "string", + "format": "date", + "description": "合同开始日(格式 yyyy-MM-dd)", + "example": "2024-01-01" + }, + "openDate": { + "type": "string", + "format": "date", + "description": "开业日(格式 yyyy-MM-dd)", + "example": "2024-04-01" + }, + "contractEndDate": { + "type": "string", + "format": "date", + "description": "解约日/闭店日(格式 yyyy-MM-dd)", + "example": "2025-12-31" + }, + "legacyAddress": { + "type": "string", + "maxLength": 20, + "description": "旧地址", + "example": "旧地址信息" + }, + "legacyPropertyFlag": { + "type": "integer", + "description": "旧物业标志 0:否 1:是", + "example": 0 + }, + "nameChangeHistory": { + "type": "string", + "maxLength": 255, + "description": "名称变更履历", + "example": "变更履历..." + }, + "communicationInfo": { + "type": "string", + "maxLength": 255, + "description": "SIM/通信线路", + "example": "通信线路信息" + }, + "napTime": { + "type": "string", + "maxLength": 20, + "description": "值班小睡时段", + "example": "23:00-06:00" + }, + "noteUpdatedBy": { + "type": "string", + "maxLength": 128, + "description": "记载者/更新日", + "example": "张三" + } + } + }, + "FacilityEditParam": { + "type": "object", + "required": ["facilityId"], + "properties": { + "facilityId": { + "type": "integer", + "format": "int64", + "description": "设施ID(必填)", + "example": 1 + }, + "buildingId": { + "type": "integer", + "format": "int64", + "description": "楼宇ID", + "example": 1 + }, + "securityCompanyName": { + "type": "string", + "maxLength": 255, + "description": "常驻警备公司名称", + "example": "ABC Security" + }, + "machineSecurityCompany": { + "type": "string", + "maxLength": 255, + "description": "机械警备公司名称", + "example": "XYZ Machine Security" + }, + "machineSecurityTel": { + "type": "string", + "maxLength": 40, + "description": "机械警备联系电话", + "example": "03-1234-5678" + }, + "machineSecurityCustomerCode": { + "type": "string", + "maxLength": 40, + "description": "机械警备客户代码", + "example": "CUST001" + }, + "nightShiftType": { + "type": "string", + "maxLength": 50, + "description": "夜间体制区分", + "example": "A" + }, + "nightGuardCount": { + "type": "integer", + "description": "夜间常驻人数", + "example": 2 + }, + "securitySwitchTime": { + "type": "string", + "maxLength": 10, + "description": "常驻→机械 切换时间(格式 HH:mm)", + "example": "22:00" + }, + "securityPhs": { + "type": "string", + "maxLength": 40, + "description": "警备员PHS号码", + "example": "070-1234-5678" + }, + "mallSecurityTel": { + "type": "string", + "maxLength": 40, + "description": "商场侧警备电话", + "example": "03-8765-4321" + }, + "facilitySideType": { + "type": "string", + "maxLength": 50, + "description": "商场/永旺侧区分", + "example": "Mall" + }, + "adDirectTel": { + "type": "string", + "maxLength": 40, + "description": "AD直通电话", + "example": "03-1111-2222" + }, + "alarmReceptionNote": { + "type": "string", + "maxLength": 2000, + "description": "警报接收特记", + "example": "注意事项..." + }, + "escalationFlow": { + "type": "string", + "maxLength": 2000, + "description": "联络流程", + "example": "联络流程说明..." + }, + "contractStartDate": { + "type": "string", + "format": "date", + "description": "合同开始日(格式 yyyy-MM-dd)", + "example": "2024-01-01" + }, + "openDate": { + "type": "string", + "format": "date", + "description": "开业日(格式 yyyy-MM-dd)", + "example": "2024-04-01" + }, + "contractEndDate": { + "type": "string", + "format": "date", + "description": "解约日/闭店日(格式 yyyy-MM-dd)", + "example": "2025-12-31" + }, + "legacyAddress": { + "type": "string", + "maxLength": 20, + "description": "旧地址", + "example": "旧地址信息" + }, + "legacyPropertyFlag": { + "type": "integer", + "description": "旧物业标志 0:否 1:是", + "example": 0 + }, + "nameChangeHistory": { + "type": "string", + "maxLength": 255, + "description": "名称变更履历", + "example": "变更履历..." + }, + "communicationInfo": { + "type": "string", + "maxLength": 255, + "description": "SIM/通信线路", + "example": "通信线路信息" + }, + "napTime": { + "type": "string", + "maxLength": 20, + "description": "值班小睡时段", + "example": "23:00-06:00" + }, + "noteUpdatedBy": { + "type": "string", + "maxLength": 128, + "description": "记载者/更新日", + "example": "张三" + } + } + }, + "FacilityDeleteParam": { + "type": "object", + "required": ["facilityIds"], + "properties": { + "facilityIds": { + "type": "string", + "description": "设施ID,逗号分隔", + "example": "1,2,3" + } + } + }, + "FacilityPageVO": { + "type": "object", + "properties": { + "facilityId": { + "type": "integer", + "format": "int64", + "description": "设施ID", + "example": 1 + }, + "buildingId": { + "type": "integer", + "format": "int64", + "description": "楼宇ID", + "example": 1 + }, + "buildingName": { + "type": "string", + "description": "楼宇名称", + "example": "东京建物日本桥ビル" + }, + "companyId": { + "type": "integer", + "format": "int64", + "description": "企业ID", + "example": 1 + }, + "securityCompanyName": { + "type": "string", + "description": "常驻警备公司名称", + "example": "ABC Security" + }, + "machineSecurityCompany": { + "type": "string", + "description": "机械警备公司名称", + "example": "XYZ Machine Security" + }, + "machineSecurityTel": { + "type": "string", + "description": "机械警备联系电话", + "example": "03-1234-5678" + }, + "machineSecurityCustomerCode": { + "type": "string", + "description": "机械警备客户代码", + "example": "CUST001" + }, + "nightShiftType": { + "type": "string", + "description": "夜间体制区分", + "example": "A" + }, + "nightGuardCount": { + "type": "integer", + "description": "夜间常驻人数", + "example": 2 + }, + "securitySwitchTime": { + "type": "string", + "description": "常驻→机械 切换时间", + "example": "22:00" + }, + "securityPhs": { + "type": "string", + "description": "警备员PHS号码", + "example": "070-1234-5678" + }, + "mallSecurityTel": { + "type": "string", + "description": "商场侧警备电话", + "example": "03-8765-4321" + }, + "facilitySideType": { + "type": "string", + "description": "商场/永旺侧区分", + "example": "Mall" + }, + "adDirectTel": { + "type": "string", + "description": "AD直通电话", + "example": "03-1111-2222" + }, + "alarmReceptionNote": { + "type": "string", + "description": "警报接收特记", + "example": "注意事项..." + }, + "escalationFlow": { + "type": "string", + "description": "联络流程", + "example": "联络流程说明..." + }, + "contractStartDate": { + "type": "string", + "description": "合同开始日", + "example": "2024-01-01" + }, + "openDate": { + "type": "string", + "description": "开业日", + "example": "2024-04-01" + }, + "contractEndDate": { + "type": "string", + "description": "解约日/闭店日", + "example": "2025-12-31" + }, + "legacyAddress": { + "type": "string", + "description": "旧地址", + "example": "旧地址信息" + }, + "legacyPropertyFlag": { + "type": "integer", + "description": "旧物业标志 0:否 1:是", + "example": 0 + }, + "nameChangeHistory": { + "type": "string", + "description": "名称变更履历", + "example": "变更履历..." + }, + "communicationInfo": { + "type": "string", + "description": "SIM/通信线路", + "example": "通信线路信息" + }, + "napTime": { + "type": "string", + "description": "值班小睡时段", + "example": "23:00-06:00" + }, + "noteUpdatedBy": { + "type": "string", + "description": "记载者/更新日", + "example": "张三" + } + } + }, + "SimpleDataResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "状态码,0 或 200 表示成功", + "example": 0 + }, + "msg": { + "type": "string", + "description": "响应消息", + "example": "success" + }, + "data": { + "description": "响应数据(错误时为 null)" + } + } + }, + "PageInfo_FacilityPageVO": { + "type": "object", + "properties": { + "total": { + "type": "integer", + "format": "int64", + "description": "总记录数", + "example": 100 + }, + "list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacilityPageVO" + }, + "description": "设施信息列表" + }, + "pageNum": { + "type": "integer", + "description": "当前页码", + "example": 1 + }, + "pageSize": { + "type": "integer", + "description": "每页条数", + "example": 20 + }, + "pages": { + "type": "integer", + "description": "总页数", + "example": 5 + } + } + }, + "PageResponse_FacilityPageVO": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "状态码,0 或 200 表示成功", + "example": 0 + }, + "msg": { + "type": "string", + "description": "响应消息", + "example": "success" + }, + "data": { + "$ref": "#/components/schemas/PageInfo_FacilityPageVO" + } + } + }, + "PageResponse": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "状态码", + "example": 500 + }, + "msg": { + "type": "string", + "description": "响应消息", + "example": "service error" + }, + "data": { + "description": "响应数据(错误时为 null)", + "nullable": true + } + } + } + } + } +}