消防资源整体功能
parent
c9bfc9821b
commit
4ddbc0a99b
|
|
@ -2,5 +2,5 @@ spring:
|
|||
config:
|
||||
import:
|
||||
- classpath:nacos.yml
|
||||
- classpath:sdk-prod.yml
|
||||
- classpath:sdk.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
|
|||
|
|
@ -80,3 +80,5 @@ spring:
|
|||
# namespace: ${spring.cloud.nacos.config.namespace}
|
||||
# username: nacos
|
||||
# password: u9Hc7tLFBY
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
sdk:
|
||||
server:
|
||||
app-key: fd5a910ba902465c81f23fff851ed20d
|
||||
app-key: 4420c5c763574ea5bf71f82913fb7d00
|
||||
client:
|
||||
gateway:
|
||||
url: ${common.gateway.network.http.external}
|
||||
|
|
@ -14,7 +14,7 @@ sdk:
|
|||
name: ${application.cn-name}-后端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://${application.name}
|
||||
uri: lb://${application.name}
|
||||
path: /${application.gateway}/**
|
||||
- client:
|
||||
system-code: ${application.name}-container
|
||||
|
|
@ -25,21 +25,9 @@ sdk:
|
|||
name: ${application.cn-name}-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://jjb-saas-base
|
||||
uri: lb://jjb-saas-base
|
||||
path: /${application.gateway}/container/**
|
||||
order: -2
|
||||
- client:
|
||||
system-code: ${application.name}-h5
|
||||
name: ${application.cn-name}-h5-前端
|
||||
group-code: public_api
|
||||
service:
|
||||
system-code: ${application.name}-h5
|
||||
name: ${application.cn-name}-h5-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://${application.name}
|
||||
path: /${application.gateway}-h5/**
|
||||
order: -3
|
||||
openapi:
|
||||
appId: 1871106785124999168
|
||||
appKey: 7314ecfc11ff4d5fad1ac19284ed2ac3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
server:
|
||||
# 测试
|
||||
app-key: 4a0af47cd2c2498bb209fa56ad1f4414
|
||||
sdk:
|
||||
server:
|
||||
app-key: 4420c5c763574ea5bf71f82913fb7d00
|
||||
client:
|
||||
gateway:
|
||||
url: ${common.gateway.network.http.external}
|
||||
|
|
@ -14,7 +14,7 @@ server:
|
|||
name: ${application.cn-name}-后端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://${application.name}
|
||||
uri: lb://${application.name}
|
||||
path: /${application.gateway}/**
|
||||
- client:
|
||||
system-code: ${application.name}-container
|
||||
|
|
@ -25,21 +25,9 @@ server:
|
|||
name: ${application.cn-name}-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://jjb-saas-base
|
||||
uri: lb://jjb-saas-base
|
||||
path: /${application.gateway}/container/**
|
||||
order: -2
|
||||
- client:
|
||||
system-code: ${application.name}-h5
|
||||
name: ${application.cn-name}-h5-前端
|
||||
group-code: public_api
|
||||
service:
|
||||
system-code: ${application.name}-h5
|
||||
name: ${application.cn-name}-h5-前端
|
||||
group-code: public_api
|
||||
strip-prefix: 0
|
||||
uri: http://${application.name}
|
||||
path: /${application.gateway}-h5/**
|
||||
order: -3
|
||||
openapi:
|
||||
appId: 1871106785124999168
|
||||
appKey: 7314ecfc11ff4d5fad1ac19284ed2ac3
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.zcGbsServicer.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.api.FireResourceServiceI;
|
||||
import com.zcloud.zcGbsServicer.dto.FireResourceStaPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.FireResourceStaCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "消防资源-监管端使用")
|
||||
@RequestMapping("/${application.gateway}/resource")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class FireResourceController {
|
||||
|
||||
private final FireResourceServiceI fireResourceService;
|
||||
|
||||
@ApiOperation("消防资源统计")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<FireResourceStaCO> listSta(@RequestBody FireResourceStaPageQry qry) {
|
||||
return fireResourceService.listSta(qry);
|
||||
}
|
||||
}
|
||||
|
|
@ -53,7 +53,7 @@ public class WaterSourceController {
|
|||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<WaterSourceCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new WaterSourceCO());
|
||||
return SingleResponse.of(waterSourceService.getInfoById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ControlRoomGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ControlRoomE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourceDeviceE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.dto.ControlRoomAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -11,7 +15,7 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -25,13 +29,17 @@ public class ControlRoomAddExe {
|
|||
private final ControlRoomGateway controlRoomGateway;
|
||||
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
private final ResourcePersonCoConvertor resourcePersonCoConvertor;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(ControlRoomAddCmd cmd) {
|
||||
ControlRoomE controlRoomE = new ControlRoomE();
|
||||
BeanUtils.copyProperties(cmd, controlRoomE);
|
||||
controlRoomE.addInit();
|
||||
List<ResourcePersonE> persons = resourcePersonCoConvertor.converAddToEOs(cmd.getPersons());
|
||||
List<ResourceDeviceE> devices = resourceDeviceCoConvertor.converAddToE(cmd.getDevices());
|
||||
controlRoomE.addInit(persons, devices);
|
||||
boolean res = false;
|
||||
boolean addPerRes = false;
|
||||
boolean addDeviceRes = false;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ControlRoomGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ControlRoomDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ControlRoomRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -18,11 +24,17 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class ControlRoomRemoveExe {
|
||||
private final ControlRoomGateway controlRoomGateway;
|
||||
private final ControlRoomRepository controlRoomRepository;
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
ControlRoomDO controlRoomDO = controlRoomRepository.getById(id);
|
||||
boolean res = controlRoomGateway.deletedControlRoomById(id);
|
||||
if(!res){
|
||||
boolean resDelPer = resourcePersonGateway.deletedResourcePersonByBizId(controlRoomDO.getRoomId(), PersonTypeEnum.CONTROL_ROOM.getCode());
|
||||
boolean resDelDev = resourceDeviceGateway.deletedResourceDeviceByBizId(controlRoomDO.getRoomId(), DeviceTypeEnum.CONTROL_ROOM.getCode());
|
||||
if(!res || !resDelPer || !resDelDev){
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class ControlRoomUpdateExe {
|
|||
BeanUtils.copyProperties(controlRoomUpdateCmd, controlRoomE);
|
||||
boolean res = controlRoomGateway.update(controlRoomE);
|
||||
boolean relUpdate = executePersonAndDevice(controlRoomUpdateCmd);
|
||||
if (!res) {
|
||||
if (!res || !relUpdate) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import ch.qos.logback.core.pattern.color.RedCompositeConverter;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.PumpRoomGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.PumpRoomE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourceDeviceE;
|
||||
import com.zcloud.zcGbsServicer.dto.PumpRoomAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -10,7 +13,7 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -23,12 +26,14 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
public class PumpRoomAddExe {
|
||||
private final PumpRoomGateway pumpRoomGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(PumpRoomAddCmd cmd) {
|
||||
PumpRoomE pumpRoomE = new PumpRoomE();
|
||||
BeanUtils.copyProperties(cmd, pumpRoomE);
|
||||
pumpRoomE.addInit();
|
||||
List<ResourceDeviceE> devices = resourceDeviceCoConvertor.converAddToE(cmd.getDevices());
|
||||
pumpRoomE.addInit(devices);
|
||||
boolean res = false;
|
||||
boolean resDevice = false;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class RescueTeamAddExe {
|
|||
boolean addPerRes = false;
|
||||
try {
|
||||
res = rescueTeamGateway.add(rescueTeamE);
|
||||
addPerRes = resourcePersonGateway.addBatch(rescueTeamE.getTeamMembers());
|
||||
addPerRes = resourcePersonGateway.addBatch(rescueTeamE.getRescueMembers());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.RescueTeamGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.RescueTeamRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.val;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -18,11 +23,15 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class RescueTeamRemoveExe {
|
||||
private final RescueTeamGateway rescueTeamGateway;
|
||||
private final RescueTeamRepository rescueTeamRepository;
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
RescueTeamDO rescueTeamDO = rescueTeamRepository.getById(id);
|
||||
Boolean resDelPer = resourcePersonGateway.deletedResourcePersonByBizId(rescueTeamDO.getTeamId(), PersonTypeEnum.RESCUE_TEAM.getCode());
|
||||
boolean res = rescueTeamGateway.deletedRescueTeamById(id);
|
||||
if(!res){
|
||||
if(!res || !resDelPer){
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.FireResourceStaCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
* @Author makejava
|
||||
* @Date 2026-01-21 17:21:48
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface FireResourceCoConvertor {
|
||||
/**
|
||||
* @param fireResourceStaDOS
|
||||
* @return
|
||||
*/
|
||||
List<FireResourceStaCO> converDOsToCOs(List<FireResourceStaDO> fireResourceStaDOS);
|
||||
}
|
||||
|
||||
|
|
@ -20,5 +20,7 @@ public interface WaterSourceCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<WaterSourceCO> converDOsToCOs(List<WaterSourceDO> waterSourceDOs);
|
||||
|
||||
WaterSourceCO converDOToCO(WaterSourceDO waterSourceDO);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.zcloud.zcGbsServicer.command.query;
|
||||
|
||||
import com.zcloud.zcGbsServicer.command.convertor.FireResourceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.dto.FireResourceStaPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.FireResourceStaCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.FireResourceRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class FireResourceQueryExe {
|
||||
|
||||
private FireResourceRepository fireResourceRepository;
|
||||
private FireResourceCoConvertor fireResourceCoConvertor;
|
||||
|
||||
public PageResponse<FireResourceStaCO> execute(FireResourceStaPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<FireResourceStaDO> pageResponse = fireResourceRepository.listPage(params);
|
||||
List<FireResourceStaCO> cos = fireResourceCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(cos, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -34,9 +34,18 @@ public class WaterSourceQueryExe {
|
|||
*/
|
||||
public PageResponse<WaterSourceCO> execute(WaterSourcePageQry waterSourcePageQry) {
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(waterSourcePageQry);
|
||||
params.put("tenant_id", waterSourcePageQry.getEqCorpId());
|
||||
PageResponse<WaterSourceDO> pageResponse = waterSourceRepository.listPage(params);
|
||||
List<WaterSourceCO> examCenterCOS = waterSourceCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
List<WaterSourceCO> examCenterCOS = waterSourceCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
public WaterSourceCO getInfoById(Long id) {
|
||||
WaterSourceDO waterSourceDO = waterSourceRepository.getById(id);
|
||||
return waterSourceCoConvertor.converDOToCO(waterSourceDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.zcloud.zcGbsServicer.service;
|
||||
|
||||
import com.zcloud.zcGbsServicer.api.FireResourceServiceI;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.command.query.FireResourceQueryExe;
|
||||
import com.zcloud.zcGbsServicer.dto.FireResourceStaPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.FireResourceStaCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class FireResourceServiceImpl implements FireResourceServiceI {
|
||||
|
||||
private final FireResourceQueryExe fireResourceQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<FireResourceStaCO> listSta(FireResourceStaPageQry qry) {
|
||||
return fireResourceQueryExe.execute(qry);
|
||||
}
|
||||
}
|
||||
|
|
@ -55,5 +55,10 @@ public class WaterSourceServiceImpl implements WaterSourceServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
waterSourceRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WaterSourceCO getInfoById(Long id) {
|
||||
return waterSourceQueryExe.getInfoById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.zcloud.zcGbsServicer.api;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.dto.FireResourceStaPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.FireResourceStaCO;
|
||||
|
||||
public interface FireResourceServiceI {
|
||||
|
||||
PageResponse<FireResourceStaCO> listSta(FireResourceStaPageQry qry);
|
||||
}
|
||||
|
|
@ -23,5 +23,10 @@ public interface WaterSourceServiceI {
|
|||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
WaterSourceCO getInfoById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class ControlRoomAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键ID", name = "roomId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String roomId;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室名称", name = "roomName", required = true)
|
||||
|
|
@ -30,6 +30,9 @@ public class ControlRoomAddCmd extends Command {
|
|||
@ApiModelProperty(value = "消防控制室状态(字典码)", name = "roomStatus", required = true)
|
||||
@NotEmpty(message = "消防控制室状态(字典码)不能为空")
|
||||
private String roomStatus;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室状态名称")
|
||||
private String roomStatusName;
|
||||
|
||||
@ApiModelProperty(value = "负责人", name = "principalName", required = true)
|
||||
@NotEmpty(message = "负责人不能为空")
|
||||
|
|
|
|||
|
|
@ -32,5 +32,8 @@ public class ControlRoomPageQry extends PageQuery {
|
|||
|
||||
@ApiModelProperty(value = "消防控制室状态")
|
||||
private String eqRoomStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long eqCorpId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ public class ControlRoomUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "消防控制室状态(字典码)", name = "roomStatus", required = true)
|
||||
@NotEmpty(message = "消防控制室状态(字典码)不能为空")
|
||||
private String roomStatus;
|
||||
@ApiModelProperty(value = "消防控制室状态名称")
|
||||
private String roomStatusName;
|
||||
@ApiModelProperty(value = "负责人", name = "principalName", required = true)
|
||||
@NotEmpty(message = "负责人不能为空")
|
||||
private String principalName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.zcloud.zcGbsServicer.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FireResourceStaPageQry extends PageQuery {
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpName;
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class PumpRoomAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键ID", name = "pumpRoomId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String pumpRoomId;
|
||||
|
||||
@ApiModelProperty(value = "消防泵房名称", name = "pumpRoomName", required = true)
|
||||
|
|
|
|||
|
|
@ -31,5 +31,8 @@ public class PumpRoomPageQry extends PageQuery {
|
|||
|
||||
@ApiModelProperty(value = "泵房状态")
|
||||
private String eqPumpRoomStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long eqCorpId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class RescueTeamAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键ID", name = "teamId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String teamId;
|
||||
|
||||
@ApiModelProperty(value = "救援队名称", name = "teamName", required = true)
|
||||
|
|
@ -30,8 +30,11 @@ public class RescueTeamAddCmd extends Command {
|
|||
private String teamName;
|
||||
|
||||
@ApiModelProperty(value = "类型(字典码)", name = "teamType", required = true)
|
||||
@NotEmpty(message = "类型(字典码)不能为空")
|
||||
// @NotEmpty(message = "类型(字典码)不能为空")
|
||||
private String teamType;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String teamTypeName;
|
||||
|
||||
@ApiModelProperty(value = "负责人单位或部门", name = "chargeOrgDept", required = true)
|
||||
@NotEmpty(message = "负责人单位或部门不能为空")
|
||||
|
|
@ -44,14 +47,21 @@ public class RescueTeamAddCmd extends Command {
|
|||
@ApiModelProperty(value = "队长电话", name = "captainPhone", required = true)
|
||||
@NotEmpty(message = "队长电话不能为空")
|
||||
private String captainPhone;
|
||||
|
||||
@ApiModelProperty(value = "指挥人员")
|
||||
@NotEmpty(message = "指挥人员不能为空")
|
||||
private String commandCrew;
|
||||
|
||||
@ApiModelProperty(value = "建立日期", name = "establishDate", required = true)
|
||||
@NotNull(message = "建立日期不能为空")
|
||||
private LocalDate establishDate;
|
||||
|
||||
@ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true)
|
||||
@NotEmpty(message = "所属区域或范围(字典码)不能为空")
|
||||
// @NotEmpty(message = "所属区域或范围(字典码)不能为空")
|
||||
private String regionScope;
|
||||
|
||||
@ApiModelProperty(value = "所属区域名称")
|
||||
private String regionScopeName;
|
||||
|
||||
@ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true)
|
||||
@NotEmpty(message = "职责和任务范围不能为空")
|
||||
|
|
|
|||
|
|
@ -33,11 +33,17 @@ public class RescueTeamPageQry extends PageQuery {
|
|||
private String likeChargeOrgDept;
|
||||
|
||||
@ApiModelProperty(value = "救援队类型")
|
||||
private Integer eqTeamType;
|
||||
private String eqTeamType;
|
||||
|
||||
@ApiModelProperty(value = "队长")
|
||||
private String likeCaptainName;
|
||||
|
||||
@ApiModelProperty(value = "所属区域范围(字典码)")
|
||||
private String eqRegionScope;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long eqCorpId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,16 @@ public class RescueTeamUpdateCmd extends Command {
|
|||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键ID", name = "teamId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String teamId;
|
||||
@ApiModelProperty(value = "救援队名称", name = "teamName", required = true)
|
||||
@NotEmpty(message = "救援队名称不能为空")
|
||||
private String teamName;
|
||||
@ApiModelProperty(value = "类型(字典码)", name = "teamType", required = true)
|
||||
@NotEmpty(message = "类型(字典码)不能为空")
|
||||
// @NotEmpty(message = "类型(字典码)不能为空")
|
||||
private String teamType;
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String teamTypeName;
|
||||
@ApiModelProperty(value = "负责人单位或部门", name = "chargeOrgDept", required = true)
|
||||
@NotEmpty(message = "负责人单位或部门不能为空")
|
||||
private String chargeOrgDept;
|
||||
|
|
@ -41,12 +43,17 @@ public class RescueTeamUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "队长电话", name = "captainPhone", required = true)
|
||||
@NotEmpty(message = "队长电话不能为空")
|
||||
private String captainPhone;
|
||||
@ApiModelProperty(value = "指挥人员")
|
||||
@NotEmpty(message = "指挥人员不能为空")
|
||||
private String commandCrew;;
|
||||
@ApiModelProperty(value = "建立日期", name = "establishDate", required = true)
|
||||
@NotNull(message = "建立日期不能为空")
|
||||
private LocalDate establishDate;
|
||||
@ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true)
|
||||
@NotEmpty(message = "所属区域或范围(字典码)不能为空")
|
||||
// @NotEmpty(message = "所属区域或范围(字典码)不能为空")
|
||||
private String regionScope;
|
||||
@ApiModelProperty(value = "所属区域或范围名称")
|
||||
private String regionScopeName;
|
||||
@ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true)
|
||||
@NotEmpty(message = "职责和任务范围不能为空")
|
||||
private String dutyScope;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
|
@ -24,5 +25,14 @@ public class WaterSourcePageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeWaterSourceId;
|
||||
|
||||
private String likeWaterSourceName;
|
||||
|
||||
private String likeBelongOrgDept;
|
||||
|
||||
private String eqWaterSourceStatus;
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long eqCorpId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -24,8 +25,11 @@ public class ControlRoomCO extends ClientObject {
|
|||
@ApiModelProperty(value = "消防控制室名称")
|
||||
private String roomName;
|
||||
//消防控制室状态(字典码)
|
||||
@ApiModelProperty(value = "消防控制室状态(字典码)")
|
||||
@ApiModelProperty(value = "消防控制室状态(0-停用 1-正常)")
|
||||
private String roomStatus;
|
||||
//消防控制室状态名称
|
||||
@ApiModelProperty(value = "消防控制室状态名称")
|
||||
private String roomStatusName;
|
||||
//负责人
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String principalName;
|
||||
|
|
@ -82,5 +86,13 @@ public class ControlRoomCO extends ClientObject {
|
|||
//人员数量
|
||||
@ApiModelProperty(value = "人员数量")
|
||||
private Integer personCount;
|
||||
|
||||
//设备信息
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<ResourceDeviceCO> devices;
|
||||
|
||||
//人员信息
|
||||
@ApiModelProperty(value = "人员信息")
|
||||
private List<ResourcePersonCO> persons;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.zcloud.zcGbsServicer.dto.clientobject;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 消防资源统计
|
||||
*/
|
||||
@Data
|
||||
public class FireResourceStaCO {
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long corpId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpName;
|
||||
|
||||
@ApiModelProperty(value = "消防救援队数量")
|
||||
private Integer rescueTeamCount;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室数量")
|
||||
private Integer controlRoomCount;
|
||||
|
||||
@ApiModelProperty(value = "消防泵房数量")
|
||||
private Integer pumpRoomCount;
|
||||
|
||||
@ApiModelProperty(value = "消防水源数量")
|
||||
private Integer waterSourceCount;
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -78,5 +79,9 @@ public class PumpRoomCO extends ClientObject {
|
|||
//设备数量
|
||||
@ApiModelProperty(value = "设备数量")
|
||||
private Integer deviceCount;
|
||||
|
||||
//设备信息
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<ResourceDeviceCO> devices;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public class RescueTeamCO extends ClientObject {
|
|||
//类型(字典码)
|
||||
@ApiModelProperty(value = "类型(字典码)")
|
||||
private String teamType;
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String teamTypeName;
|
||||
//负责人单位或部门
|
||||
@ApiModelProperty(value = "负责人单位或部门")
|
||||
private String chargeOrgDept;
|
||||
|
|
@ -43,6 +45,8 @@ public class RescueTeamCO extends ClientObject {
|
|||
//所属区域或范围(字典码)
|
||||
@ApiModelProperty(value = "所属区域或范围(字典码)")
|
||||
private String regionScope;
|
||||
@ApiModelProperty(value = "所属区域或范围名称")
|
||||
private String regionScopeName;
|
||||
//职责和任务范围
|
||||
@ApiModelProperty(value = "职责和任务范围")
|
||||
private String dutyScope;
|
||||
|
|
@ -87,6 +91,9 @@ public class RescueTeamCO extends ClientObject {
|
|||
private Integer memberCount;
|
||||
//救援队员
|
||||
@ApiModelProperty(value = "救援队员")
|
||||
private List<ResourcePersonCO> teamMembers;
|
||||
private List<ResourcePersonCO> rescueMembers;
|
||||
//指挥人员
|
||||
@ApiModelProperty(value = "指挥人员")
|
||||
private String commandCrew;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,6 @@ public interface RescueTeamGateway {
|
|||
*/
|
||||
Boolean deletedRescueTeamById(Long id);
|
||||
Boolean deletedRescueTeamByIds(Long[] id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ public class ControlRoomE extends BaseE {
|
|||
private String roomName;
|
||||
//消防控制室状态(字典码)
|
||||
private String roomStatus;
|
||||
//消防控制室状态名称
|
||||
private String roomStatusName;
|
||||
//负责人
|
||||
private String principalName;
|
||||
//负责人手机号
|
||||
|
|
@ -45,17 +47,19 @@ public class ControlRoomE extends BaseE {
|
|||
private List<ResourcePersonE> persons;
|
||||
|
||||
//初始化
|
||||
public void addInit(){
|
||||
public void addInit(List<ResourcePersonE> persons, List<ResourceDeviceE> devices){
|
||||
if (StrUtil.isBlank(this.roomId)) {
|
||||
this.roomId = Tools.get32UUID();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.devices)) {
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
this.devices = devices;
|
||||
devices.forEach(resourceDeviceE -> {
|
||||
resourceDeviceE.setBizId(this.roomId);
|
||||
resourceDeviceE.setBizType(DeviceTypeEnum.CONTROL_ROOM.getCode());
|
||||
});
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.persons)) {
|
||||
if (CollUtil.isNotEmpty(persons)) {
|
||||
this.persons = persons;
|
||||
persons.forEach(resourcePersonE -> {
|
||||
resourcePersonE.setBizId(this.roomId);
|
||||
resourcePersonE.setBizType(PersonTypeEnum.CONTROL_ROOM.getCode());
|
||||
|
|
|
|||
|
|
@ -39,22 +39,21 @@ public class PumpRoomE extends BaseE {
|
|||
//设备数量
|
||||
private Integer deviceCount;
|
||||
|
||||
public void addInit() {
|
||||
public void addInit(List<ResourceDeviceE> devices) {
|
||||
if (StrUtil.isBlank(this.pumpRoomId)) {
|
||||
this.pumpRoomId = Tools.get32UUID();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.devices)) {
|
||||
for (ResourceDeviceE device : this.devices) {
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
for (ResourceDeviceE device : devices) {
|
||||
device.setBizId(this.pumpRoomId);
|
||||
device.setBizType(DeviceTypeEnum.PUMP_ROOM.getCode());
|
||||
}
|
||||
this.devices = devices;
|
||||
}
|
||||
}
|
||||
|
||||
public void device(List<ResourceDeviceE> devices) {
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
this.deviceCount = devices.size();
|
||||
}
|
||||
this.deviceCount = CollUtil.isNotEmpty(devices) ? devices.size() : 0;
|
||||
}
|
||||
|
||||
public void deviceInfo(List<ResourceDeviceE> devices) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
|
@ -25,6 +26,8 @@ public class RescueTeamE extends BaseE {
|
|||
private String teamName;
|
||||
//类型(字典码)
|
||||
private String teamType;
|
||||
//类型名称
|
||||
private String teamTypeName;
|
||||
//负责人单位或部门
|
||||
private String chargeOrgDept;
|
||||
//队长
|
||||
|
|
@ -35,19 +38,22 @@ public class RescueTeamE extends BaseE {
|
|||
private LocalDate establishDate;
|
||||
//所属区域或范围(字典码)
|
||||
private String regionScope;
|
||||
//所属区域或范围名称
|
||||
private String regionScopeName;
|
||||
//职责和任务范围
|
||||
private String dutyScope;
|
||||
|
||||
//指挥人员
|
||||
private String commandCrew;
|
||||
//消防队员
|
||||
private List<ResourcePersonE> teamMembers;
|
||||
private List<ResourcePersonE> rescueMembers;
|
||||
|
||||
|
||||
public void addInit() {
|
||||
if (StrUtil.isBlank(this.teamId)) {
|
||||
this.teamId = IdUtil.simpleUUID();
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(this.teamMembers)) {
|
||||
for (ResourcePersonE member : this.teamMembers) {
|
||||
if (CollectionUtil.isNotEmpty(this.rescueMembers)) {
|
||||
for (ResourcePersonE member : this.rescueMembers) {
|
||||
member.setBizId(this.teamId);
|
||||
member.setBizType(PersonTypeEnum.RESCUE_TEAM.getCode());
|
||||
}
|
||||
|
|
@ -56,7 +62,7 @@ public class RescueTeamE extends BaseE {
|
|||
|
||||
public void memberInfo (List<ResourcePersonE> teamMembers){
|
||||
if (CollectionUtil.isNotEmpty(teamMembers)) {
|
||||
this.teamMembers = teamMembers;
|
||||
this.rescueMembers = teamMembers;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class PumpRoomGatewayImpl implements PumpRoomGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(PumpRoomE pumpRoomE) {
|
||||
PumpRoomDO d = new PumpRoomDO(Tools.get32UUID());
|
||||
PumpRoomDO d = new PumpRoomDO(pumpRoomE.getPumpRoomId());
|
||||
BeanUtils.copyProperties(pumpRoomE, d,"pumpRoomId");
|
||||
pumpRoomRepository.save(d);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class RescueTeamGatewayImpl implements RescueTeamGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(RescueTeamE rescueTeamE) {
|
||||
RescueTeamDO d = new RescueTeamDO(Tools.get32UUID());
|
||||
RescueTeamDO d = new RescueTeamDO(rescueTeamE.getTeamId());
|
||||
BeanUtils.copyProperties(rescueTeamE, d,"teamId");
|
||||
rescueTeamRepository.save(d);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class ResourceDeviceGatewayImpl implements ResourceDeviceGateway {
|
|||
|
||||
@Override
|
||||
public Boolean addBatch(List<ResourceDeviceE> resourceDeviceEList) {
|
||||
if (resourceDeviceEList.isEmpty()) return true;
|
||||
if (CollUtil.isEmpty(resourceDeviceEList)) return true;
|
||||
List<ResourceDeviceDO> resourceDeviceDOList = resourceDeviceEList.stream().map(resourceDeviceE -> {
|
||||
ResourceDeviceDO d = new ResourceDeviceDO(resourceDeviceE.getDeviceId());
|
||||
BeanUtils.copyProperties(resourceDeviceE, d,"deviceId");
|
||||
|
|
@ -63,7 +63,11 @@ public class ResourceDeviceGatewayImpl implements ResourceDeviceGateway {
|
|||
|
||||
@Override
|
||||
public Boolean deletedResourceDeviceByBizId(String roomId, Integer deviceType) {
|
||||
return resourceDeviceRepository.removeBatchByIds(resourceDeviceRepository.listByBizIdAndBizType(CollUtil.newArrayList(roomId), deviceType));
|
||||
List<ResourceDeviceDO> deviceDOList = resourceDeviceRepository.listByBizIdAndBizType(CollUtil.newArrayList(roomId), deviceType);
|
||||
if (CollUtil.isEmpty(deviceDOList)) {
|
||||
return true;
|
||||
}
|
||||
return resourceDeviceRepository.removeBatchByIds(deviceDOList.stream().map(ResourceDeviceDO::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,12 +34,13 @@ public class ResourcePersonGatewayImpl implements ResourcePersonGateway {
|
|||
|
||||
@Override
|
||||
public Boolean addBatch(List<ResourcePersonE> resourcePersonEList) {
|
||||
if (resourcePersonEList.isEmpty()) return true;
|
||||
if (CollUtil.isEmpty(resourcePersonEList)) return true;
|
||||
// 使用 Stream 流进行转换
|
||||
List<ResourcePersonDO> doList = resourcePersonEList.stream()
|
||||
.map(e -> {
|
||||
ResourcePersonDO d = new ResourcePersonDO(e.getPersonId());
|
||||
ResourcePersonDO d = new ResourcePersonDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(e, d, "personId");
|
||||
d.setId(null);
|
||||
return d;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
|
@ -67,7 +68,7 @@ public class ResourcePersonGatewayImpl implements ResourcePersonGateway {
|
|||
@Override
|
||||
public Boolean deletedResourcePersonByBizId(String bizId, Integer bizType) {
|
||||
List<ResourcePersonDO> resourcePersonDOList = resourcePersonRepository.listByBizIdAndBizType(CollUtil.newArrayList(bizId), bizType);
|
||||
return resourcePersonRepository.removeByIds(resourcePersonDOList.stream().map(ResourcePersonDO::getId).collect(Collectors.toList()));
|
||||
return resourcePersonRepository.removeBatchByIds(resourcePersonDOList.stream().map(ResourcePersonDO::getId).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ public class ControlRoomDO extends BaseDO {
|
|||
//消防控制室状态(字典码)
|
||||
@ApiModelProperty(value = "消防控制室状态(字典码)")
|
||||
private String roomStatus;
|
||||
//消防控制室状态名称
|
||||
@ApiModelProperty(value = "消防控制室状态名称")
|
||||
private String roomStatusName;
|
||||
//负责人
|
||||
@ApiModelProperty(value = "负责人")
|
||||
private String principalName;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FireResourceStaDO {
|
||||
|
||||
@ApiModelProperty(value = "企业ID")
|
||||
private Long corpId;
|
||||
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String corpName;
|
||||
|
||||
@ApiModelProperty(value = "消防救援队数量")
|
||||
private Integer rescueTeamCount;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室数量")
|
||||
private Integer controlRoomCount;
|
||||
|
||||
@ApiModelProperty(value = "消防泵房数量")
|
||||
private Integer pumpRoomCount;
|
||||
|
||||
@ApiModelProperty(value = "消防水源数量")
|
||||
private Integer waterSourceCount;
|
||||
|
||||
}
|
||||
|
|
@ -30,6 +30,9 @@ public class RescueTeamDO extends BaseDO {
|
|||
//类型(字典码)
|
||||
@ApiModelProperty(value = "类型(字典码)")
|
||||
private String teamType;
|
||||
//类型名称
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String teamTypeName;
|
||||
//负责人单位或部门
|
||||
@ApiModelProperty(value = "负责人单位或部门")
|
||||
private String chargeOrgDept;
|
||||
|
|
@ -39,12 +42,16 @@ public class RescueTeamDO extends BaseDO {
|
|||
//队长电话
|
||||
@ApiModelProperty(value = "队长电话")
|
||||
private String captainPhone;
|
||||
@ApiModelProperty(value = "指挥人员")
|
||||
private String commandCrew;
|
||||
//建立日期
|
||||
@ApiModelProperty(value = "建立日期")
|
||||
private LocalDate establishDate;
|
||||
//所属区域或范围(字典码)
|
||||
@ApiModelProperty(value = "所属区域或范围(字典码)")
|
||||
private String regionScope;
|
||||
@ApiModelProperty(value = "所属区域或范围名称")
|
||||
private String regionScopeName;
|
||||
//职责和任务范围
|
||||
@ApiModelProperty(value = "职责和任务范围")
|
||||
private String dutyScope;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ public class ResourceDeviceDO extends BaseDO {
|
|||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "删除表示")
|
||||
private String deleteEnum;
|
||||
|
||||
public ResourceDeviceDO(String deviceId) {
|
||||
this.deviceId = deviceId != null ? deviceId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ public class ResourcePersonDO extends BaseDO {
|
|||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "删除表示")
|
||||
private String deleteEnum;
|
||||
|
||||
public ResourcePersonDO(String personId) {
|
||||
if (StrUtil.isBlank(personId)) this.personId = Tools.get32UUID();
|
||||
else this.personId = personId;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface FireResourceMapper extends BaseMapper<FireResourceStaDO> {
|
||||
|
||||
IPage<FireResourceStaDO> selectStaPage(IPage<FireResourceStaDO> page, @Param("corpName") String corpName);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface FireResourceRepository {
|
||||
|
||||
PageResponse<FireResourceStaDO> listPage(Map<String, Object> params);
|
||||
}
|
||||
|
|
@ -13,6 +13,5 @@ import java.util.Map;
|
|||
public interface PumpRoomRepository extends BaseRepository<PumpRoomDO> {
|
||||
PageResponse<PumpRoomDO> listPage(Map<String,Object> params);
|
||||
|
||||
PumpRoomDO getById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@ public class ControlRoomRepositoryImpl extends BaseRepositoryImpl<ControlRoomMap
|
|||
public PageResponse<ControlRoomDO> listPage(Map<String,Object> params) {
|
||||
IPage<ControlRoomDO> iPage = new Query<ControlRoomDO>().getPage(params);
|
||||
QueryWrapper<ControlRoomDO> queryWrapper = new QueryWrapper<>();
|
||||
Object corpId = params == null ? null : params.remove("eqCorpId");
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
if (corpId != null) {
|
||||
queryWrapper.eq("tenant_id", corpId);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ControlRoomDO> result = controlRoomMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
||||
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.mapper.FireResourceMapper;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.FireResourceRepository;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class FireResourceRepositoryImpl implements FireResourceRepository {
|
||||
|
||||
private final FireResourceMapper fireResourceMapper;
|
||||
|
||||
@Override
|
||||
public PageResponse<FireResourceStaDO> listPage(Map<String, Object> params) {
|
||||
IPage<FireResourceStaDO> iPage = new Query<FireResourceStaDO>().getPage(params);
|
||||
String corpName = params == null ? null : (String) params.get("corpName");
|
||||
IPage<FireResourceStaDO> result = fireResourceMapper.selectStaPage(iPage, corpName);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
}
|
||||
|
|
@ -28,15 +28,15 @@ public class PumpRoomRepositoryImpl extends BaseRepositoryImpl<PumpRoomMapper, P
|
|||
public PageResponse<PumpRoomDO> listPage(Map<String,Object> params) {
|
||||
IPage<PumpRoomDO> iPage = new Query<PumpRoomDO>().getPage(params);
|
||||
QueryWrapper<PumpRoomDO> queryWrapper = new QueryWrapper<>();
|
||||
Object corpId = params == null ? null : params.remove("eqCorpId");
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
if (corpId != null) {
|
||||
queryWrapper.eq("tenant_id", corpId);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<PumpRoomDO> result = pumpRoomMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PumpRoomDO getById(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,11 @@ public class RescueTeamRepositoryImpl extends BaseRepositoryImpl<RescueTeamMappe
|
|||
public PageResponse<RescueTeamDO> listPage(Map<String,Object> params) {
|
||||
IPage<RescueTeamDO> iPage = new Query<RescueTeamDO>().getPage(params);
|
||||
QueryWrapper<RescueTeamDO> queryWrapper = new QueryWrapper<>();
|
||||
Object corpId = params == null ? null : params.remove("eqCorpId");
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
if (corpId != null) {
|
||||
queryWrapper.eq("tenant_id", corpId);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<RescueTeamDO> result = rescueTeamMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
|
|
|
|||
|
|
@ -26,9 +26,13 @@ public class WaterSourceRepositoryImpl extends BaseRepositoryImpl<WaterSourceMap
|
|||
|
||||
@Override
|
||||
public PageResponse<WaterSourceDO> listPage(Map<String,Object> params) {
|
||||
IPage<WaterSourceDO> iPage = new Query<WaterSourceDO>().getPage(params);
|
||||
IPage<WaterSourceDO> iPage = new Query<WaterSourceDO>().getPage(params);
|
||||
QueryWrapper<WaterSourceDO> queryWrapper = new QueryWrapper<>();
|
||||
Object corpId = params == null ? null : params.remove("eqCorpId");
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
if (corpId != null) {
|
||||
queryWrapper.eq("tenant_id", corpId);
|
||||
}
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<WaterSourceDO> result = waterSourceMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<?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.zcloud.zcGbsServicer.persistence.mapper.FireResourceMapper">
|
||||
|
||||
<select id="selectStaPage" resultType="com.zcloud.zcGbsServicer.persistence.dataobject.FireResourceStaDO">
|
||||
SELECT
|
||||
ci.id AS corpId,
|
||||
ci.corp_name AS corpName,
|
||||
(SELECT COUNT(*) FROM rescue_team WHERE tenant_id = ci.id AND delete_enum = 'false') AS rescueTeamCount,
|
||||
(SELECT COUNT(*) FROM control_room WHERE tenant_id = ci.id AND delete_enum = 'false') AS controlRoomCount,
|
||||
(SELECT COUNT(*) FROM pump_room WHERE tenant_id = ci.id AND delete_enum = 'false') AS pumpRoomCount,
|
||||
(SELECT COUNT(*) FROM water_source WHERE tenant_id = ci.id AND delete_enum = 'false') AS waterSourceCount
|
||||
FROM
|
||||
corp_info ci
|
||||
<where>
|
||||
<if test="corpName != null and corpName != ''">
|
||||
AND ci.corp_name LIKE CONCAT('%', #{corpName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
ci.id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue