消防功能
parent
348c180b58
commit
c9bfc9821b
|
|
@ -4,7 +4,7 @@ nacos:
|
|||
application:
|
||||
name: jjb-saas-zcloud-fire-resource
|
||||
version:
|
||||
gateway: fire
|
||||
gateway: fireResource
|
||||
cn-name: 消防资源应用
|
||||
#server:
|
||||
# port: 8089
|
||||
|
|
@ -39,6 +39,7 @@ spring:
|
|||
discovery:
|
||||
server-addr: ${spring.cloud.nacos.config.server-addr}
|
||||
namespace: ${spring.cloud.nacos.config.namespace}
|
||||
ip: 192.168.10.168
|
||||
|
||||
#nacos:
|
||||
# url: prod-nacos:8848
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class ControlRoomController {
|
|||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<ControlRoomCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new ControlRoomCO());
|
||||
return SingleResponse.of(controlRoomService.getInfoById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class PumpRoomController {
|
|||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<PumpRoomCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new PumpRoomCO());
|
||||
return SingleResponse.of(pumpRoomService.getInfoById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class RescueTeamController {
|
|||
@ApiOperation("详情")
|
||||
@GetMapping("/{id}")
|
||||
public SingleResponse<RescueTeamCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(new RescueTeamCO());
|
||||
return SingleResponse.of(rescueTeamService.get(id));
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
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.dto.ControlRoomAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
|
|
@ -22,17 +24,25 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
public class ControlRoomAddExe {
|
||||
private final ControlRoomGateway controlRoomGateway;
|
||||
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(ControlRoomAddCmd cmd) {
|
||||
ControlRoomE controlRoomE = new ControlRoomE();
|
||||
BeanUtils.copyProperties(cmd, controlRoomE);
|
||||
controlRoomE.addInit();
|
||||
boolean res = false;
|
||||
boolean addPerRes = false;
|
||||
boolean addDeviceRes = false;
|
||||
try {
|
||||
res = controlRoomGateway.add(controlRoomE);
|
||||
addPerRes = resourcePersonGateway.addBatch(controlRoomE.getPersons());
|
||||
addDeviceRes = resourceDeviceGateway.addBatch(controlRoomE.getDevices());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
if (!res || !addPerRes || !addDeviceRes) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,24 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
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.ControlRoomUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -21,15 +30,56 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class ControlRoomUpdateExe {
|
||||
private final ControlRoomGateway controlRoomGateway;
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
|
||||
private final ResourcePersonCoConvertor resourcePersonCoConvertor;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(ControlRoomUpdateCmd controlRoomUpdateCmd) {
|
||||
ControlRoomE controlRoomE = new ControlRoomE();
|
||||
BeanUtils.copyProperties(controlRoomUpdateCmd, controlRoomE);
|
||||
boolean res = controlRoomGateway.update(controlRoomE);
|
||||
boolean relUpdate = executePersonAndDevice(controlRoomUpdateCmd);
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理人员和设备(全删再增)
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean executePersonAndDevice(ControlRoomUpdateCmd cmd) {
|
||||
Integer personBizType = PersonTypeEnum.CONTROL_ROOM.getCode();
|
||||
Integer deviceBizType = DeviceTypeEnum.CONTROL_ROOM.getCode();
|
||||
String bizId = cmd.getRoomId();
|
||||
|
||||
resourcePersonGateway.deletedResourcePersonByBizId(bizId, personBizType);
|
||||
resourceDeviceGateway.deletedResourceDeviceByBizId(bizId, deviceBizType);
|
||||
|
||||
if (CollUtil.isEmpty(cmd.getPersons()) && CollUtil.isEmpty(cmd.getDevices())) {
|
||||
return true;
|
||||
}
|
||||
Boolean resPer = true;
|
||||
Boolean resDev = true;
|
||||
if (CollUtil.isNotEmpty(cmd.getPersons())) {
|
||||
List<ResourcePersonE> persons = resourcePersonCoConvertor.converAddToEOs(cmd.getPersons());
|
||||
persons.forEach(p -> {
|
||||
p.relInfo(bizId, personBizType);
|
||||
});
|
||||
resPer = resourcePersonGateway.addBatch(persons);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(cmd.getDevices())) {
|
||||
List<ResourceDeviceE> devices = resourceDeviceCoConvertor.converAddToE(cmd.getDevices());
|
||||
devices.forEach(d -> {
|
||||
d.relInfo(bizId, deviceBizType);
|
||||
});
|
||||
resDev = resourceDeviceGateway.addBatch(devices);
|
||||
}
|
||||
return resPer && resDev;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
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.dto.PumpRoomAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
|
|
@ -21,18 +22,22 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class PumpRoomAddExe {
|
||||
private final PumpRoomGateway pumpRoomGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(PumpRoomAddCmd cmd) {
|
||||
PumpRoomE pumpRoomE = new PumpRoomE();
|
||||
BeanUtils.copyProperties(cmd, pumpRoomE);
|
||||
pumpRoomE.addInit();
|
||||
boolean res = false;
|
||||
boolean resDevice = false;
|
||||
try {
|
||||
res = pumpRoomGateway.add(pumpRoomE);
|
||||
resDevice = resourceDeviceGateway.addBatch(pumpRoomE.getDevices());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
if (!res || !resDevice) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum;
|
||||
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.PumpRoomUpdateCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -21,15 +26,34 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class PumpRoomUpdateExe {
|
||||
private final PumpRoomGateway pumpRoomGateway;
|
||||
private final ResourceDeviceGateway resourceDeviceGateway;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(PumpRoomUpdateCmd pumpRoomUpdateCmd) {
|
||||
PumpRoomE pumpRoomE = new PumpRoomE();
|
||||
BeanUtils.copyProperties(pumpRoomUpdateCmd, pumpRoomE);
|
||||
boolean res = pumpRoomGateway.update(pumpRoomE);
|
||||
if (!res) {
|
||||
boolean resDev = executePersonAndDevice(pumpRoomUpdateCmd);
|
||||
if (!res || !resDev) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理设备修改
|
||||
*/
|
||||
private boolean executePersonAndDevice(PumpRoomUpdateCmd pumpRoomUpdateCmd) {
|
||||
Integer bizType = DeviceTypeEnum.PUMP_ROOM.getCode();
|
||||
resourceDeviceGateway.deletedResourceDeviceByBizId(pumpRoomUpdateCmd.getPumpRoomId(), bizType);
|
||||
if (CollUtil.isEmpty(pumpRoomUpdateCmd.getDevices())) {
|
||||
return true;
|
||||
}
|
||||
List<ResourceDeviceE> devices = resourceDeviceCoConvertor.converAddToE(pumpRoomUpdateCmd.getDevices());
|
||||
devices.forEach(d -> {
|
||||
d.relInfo(pumpRoomUpdateCmd.getPumpRoomId(), bizType);
|
||||
});
|
||||
return resourceDeviceGateway.addBatch(devices);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.RescueTeamGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
||||
import com.zcloud.zcGbsServicer.dto.RescueTeamAddCmd;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
|
|
@ -21,18 +22,22 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class RescueTeamAddExe {
|
||||
private final RescueTeamGateway rescueTeamGateway;
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(RescueTeamAddCmd cmd) {
|
||||
RescueTeamE rescueTeamE = new RescueTeamE();
|
||||
BeanUtils.copyProperties(cmd, rescueTeamE);
|
||||
rescueTeamE.addInit();
|
||||
boolean res = false;
|
||||
boolean addPerRes = false;
|
||||
try {
|
||||
res = rescueTeamGateway.add(rescueTeamE);
|
||||
addPerRes = resourcePersonGateway.addBatch(rescueTeamE.getTeamMembers());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
if (!res) {
|
||||
if (!res || !addPerRes) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,26 @@
|
|||
package com.zcloud.zcGbsServicer.command;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.RescueTeamGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.dto.RescueTeamUpdateCmd;
|
||||
import com.zcloud.zcGbsServicer.dto.ResourcePersonAddCmd;
|
||||
import com.zcloud.zcGbsServicer.dto.ResourcePersonUpdateCmd;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourcePersonRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -21,15 +32,38 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class RescueTeamUpdateExe {
|
||||
private final RescueTeamGateway rescueTeamGateway;
|
||||
private final ResourcePersonGateway resourcePersonGateway;
|
||||
|
||||
private final ResourcePersonRepository resourcePersonRepository;
|
||||
private final ResourcePersonCoConvertor resourcePersonCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(RescueTeamUpdateCmd rescueTeamUpdateCmd) {
|
||||
RescueTeamE rescueTeamE = new RescueTeamE();
|
||||
BeanUtils.copyProperties(rescueTeamUpdateCmd, rescueTeamE);
|
||||
boolean res = rescueTeamGateway.update(rescueTeamE);
|
||||
if (!res) {
|
||||
boolean resPer = executePerson(rescueTeamUpdateCmd.getRescueMembers(), rescueTeamE.getTeamId());
|
||||
if (!res || !resPer) {
|
||||
throw new BizException("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理人员
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean executePerson(List<ResourcePersonAddCmd> cmds, String teamId) {
|
||||
Integer bizType = PersonTypeEnum.RESCUE_TEAM.getCode();
|
||||
resourcePersonGateway.deletedResourcePersonByBizId(teamId, bizType);
|
||||
if (CollUtil.isEmpty(cmds)) {
|
||||
return true;
|
||||
}
|
||||
List<ResourcePersonE> es = resourcePersonCoConvertor.converAddToEOs(cmds);
|
||||
es.forEach(e -> {
|
||||
e.relInfo(teamId, bizType);
|
||||
});
|
||||
return resourcePersonGateway.addBatch(es);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.model.ControlRoomE;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ControlRoomCO;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourceDeviceCO;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourcePersonCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ControlRoomDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -20,5 +25,17 @@ public interface ControlRoomCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<ControlRoomCO> converDOsToCOs(List<ControlRoomDO> controlRoomDOs);
|
||||
|
||||
List<ControlRoomE> converDOsToE(List<ControlRoomDO> controlRoomDOs);
|
||||
|
||||
List<ControlRoomCO> converEtoCOs(List<ControlRoomE> controlRoomE);
|
||||
|
||||
ControlRoomE converDOtoE(ControlRoomDO controlRoomDO);
|
||||
|
||||
ControlRoomCO converEtoCO(ControlRoomE controlRoomE);
|
||||
|
||||
ResourceDeviceCO converDOtoCO(ResourceDeviceDO resourceDeviceDO);
|
||||
|
||||
ResourcePersonCO converDOtoCO(ResourcePersonDO resourcePersonDO);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.model.PumpRoomE;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.PumpRoomCO;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourceDeviceCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.PumpRoomDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
|
|
@ -20,5 +22,15 @@ public interface PumpRoomCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<PumpRoomCO> converDOsToCOs(List<PumpRoomDO> pumpRoomDOs);
|
||||
|
||||
List<PumpRoomE> converDOsToE(List<PumpRoomDO> pumpRoomDOs);
|
||||
|
||||
List<PumpRoomCO> converEtoCOs(List<PumpRoomE> pumpRoomE);
|
||||
|
||||
PumpRoomE converDOtoE(PumpRoomDO pumpRoomDO);
|
||||
|
||||
PumpRoomCO converEtoCO(PumpRoomE pumpRoomE);
|
||||
|
||||
ResourceDeviceCO converEtoCO1(PumpRoomE pumpRoomE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourcePersonCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
|
|
@ -20,5 +23,18 @@ public interface RescueTeamCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<RescueTeamCO> converDOsToCOs(List<RescueTeamDO> rescueTeamDOs);
|
||||
|
||||
List<RescueTeamE> converDOsToEs(List<RescueTeamDO> rescueTeamDOs);
|
||||
|
||||
List<RescueTeamCO> converEsToCOs(List<RescueTeamE> rescueTeamES);
|
||||
|
||||
RescueTeamCO converDOToCO(RescueTeamDO rescueTeamDO);
|
||||
|
||||
RescueTeamE converDOToEO(RescueTeamDO rescueTeamDO);
|
||||
|
||||
RescueTeamCO converEToCO(RescueTeamE rescueTeamE);
|
||||
|
||||
|
||||
ResourcePersonCO converPersonEToCO(ResourcePersonE resourcePersonE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourceDeviceE;
|
||||
import com.zcloud.zcGbsServicer.dto.ResourceDeviceAddCmd;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourceDeviceCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
|
@ -20,5 +22,9 @@ public interface ResourceDeviceCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<ResourceDeviceCO> converDOsToCOs(List<ResourceDeviceDO> resourceDeviceDOs);
|
||||
|
||||
List<ResourceDeviceE> converDOsToE(List<ResourceDeviceDO> resourceDeviceDOs);
|
||||
|
||||
List<ResourceDeviceE> converAddToE(List<ResourceDeviceAddCmd> resourceDeviceAddCmds);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package com.zcloud.zcGbsServicer.command.convertor;
|
||||
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.dto.ResourcePersonAddCmd;
|
||||
import com.zcloud.zcGbsServicer.dto.ResourcePersonUpdateCmd;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ResourcePersonCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
|
@ -20,5 +23,14 @@ public interface ResourcePersonCoConvertor {
|
|||
* @return
|
||||
*/
|
||||
List<ResourcePersonCO> converDOsToCOs(List<ResourcePersonDO> resourcePersonDOs);
|
||||
|
||||
List<ResourcePersonE> converDOsTOEOs(List<ResourcePersonDO> resourcePersonDOs);
|
||||
|
||||
List<ResourcePersonCO> converEOsToCOs(List<ResourcePersonE> resourcePersonES);
|
||||
|
||||
List<ResourcePersonDO> converUpdateToDOs(List<ResourcePersonUpdateCmd> resourcePersonUpdateCmds);
|
||||
|
||||
List<ResourcePersonE> converAddToEOs(List<ResourcePersonAddCmd> resourcePersonAddCmds);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,29 @@
|
|||
package com.zcloud.zcGbsServicer.command.query;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ControlRoomCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||
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.ControlRoomPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.ControlRoomCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ControlRoomDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ControlRoomRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourceDeviceRepository;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourcePersonRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -26,17 +37,59 @@ public class ControlRoomQueryExe {
|
|||
private final ControlRoomRepository controlRoomRepository;
|
||||
private final ControlRoomCoConvertor controlRoomCoConvertor;
|
||||
|
||||
private final ResourceDeviceRepository resourceDeviceRepository;
|
||||
private final ResourcePersonCoConvertor resourcePersonCoConvertor;
|
||||
private final ResourcePersonRepository resourcePersonRepository;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param controlRoomPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<ControlRoomCO> execute(ControlRoomPageQry controlRoomPageQry) {
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(controlRoomPageQry);
|
||||
PageResponse<ControlRoomDO> pageResponse = controlRoomRepository.listPage(params);
|
||||
List<ControlRoomCO> examCenterCOS = controlRoomCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
public PageResponse<ControlRoomCO> execute(ControlRoomPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<ControlRoomDO> page = controlRoomRepository.listPage(params);
|
||||
|
||||
List<ControlRoomDO> records = page.getData();
|
||||
if (CollUtil.isEmpty(records)) {
|
||||
return PageResponse.of(Collections.emptyList(), 0, page.getPageSize(), page.getPageIndex());
|
||||
}
|
||||
List<ControlRoomE> es = controlRoomCoConvertor.converDOsToE(records);
|
||||
List<String> roomIds = es.stream()
|
||||
.map(ControlRoomE::getRoomId)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, List<ResourceDeviceDO>> deviceMap =
|
||||
resourceDeviceRepository.listByBizId(roomIds)
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(ResourceDeviceDO::getBizId));
|
||||
Map<String, List<ResourcePersonDO>> personMap =
|
||||
resourcePersonRepository.listByBizId(roomIds)
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(ResourcePersonDO::getBizId));
|
||||
es.forEach(e -> {
|
||||
int deviceCount = CollUtil.size(deviceMap.get(e.getRoomId()));
|
||||
int personCount = CollUtil.size(personMap.get(e.getRoomId()));
|
||||
e.relationInfo(deviceCount, personCount);
|
||||
});
|
||||
|
||||
List<ControlRoomCO> cos = controlRoomCoConvertor.converEtoCOs(es);
|
||||
return PageResponse.of(cos, page.getTotalCount(), page.getPageSize(), page.getPageIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
public ControlRoomCO getById(Long id) {
|
||||
ControlRoomDO rescueTeamDO = controlRoomRepository.getById(id);
|
||||
if (rescueTeamDO == null) {
|
||||
return null;
|
||||
}
|
||||
List<ResourceDeviceE> deviceDOs = resourceDeviceCoConvertor.converDOsToE(resourceDeviceRepository.listByBizId(CollUtil.newArrayList(rescueTeamDO.getRoomId())));
|
||||
List<ResourcePersonE> personDOs = resourcePersonCoConvertor.converDOsTOEOs(resourcePersonRepository.listByBizId(CollUtil.newArrayList(rescueTeamDO.getRoomId())));
|
||||
ControlRoomE rescueTeamE = controlRoomCoConvertor.converDOtoE(rescueTeamDO);
|
||||
rescueTeamE.relationData(deviceDOs, personDOs);
|
||||
|
||||
return controlRoomCoConvertor.converEtoCO(rescueTeamE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,25 @@
|
|||
package com.zcloud.zcGbsServicer.command.query;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.PumpRoomCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourceDeviceCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.model.PumpRoomE;
|
||||
import com.zcloud.zcGbsServicer.dto.PumpRoomPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.PumpRoomCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.PumpRoomDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.PumpRoomRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourceDeviceRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -26,17 +33,50 @@ public class PumpRoomQueryExe {
|
|||
private final PumpRoomRepository pumpRoomRepository;
|
||||
private final PumpRoomCoConvertor pumpRoomCoConvertor;
|
||||
|
||||
private final ResourceDeviceRepository resourceDeviceRepository;
|
||||
private final ResourceDeviceCoConvertor resourceDeviceCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param pumpRoomPageQry
|
||||
* @param qry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<PumpRoomCO> execute(PumpRoomPageQry pumpRoomPageQry) {
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(pumpRoomPageQry);
|
||||
PageResponse<PumpRoomDO> pageResponse = pumpRoomRepository.listPage(params);
|
||||
List<PumpRoomCO> examCenterCOS = pumpRoomCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
public PageResponse<PumpRoomCO> execute(PumpRoomPageQry qry) {
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||
PageResponse<PumpRoomDO> page = pumpRoomRepository.listPage(params);
|
||||
List<PumpRoomDO> records = page.getData();
|
||||
if (CollUtil.isEmpty(records)) {
|
||||
return PageResponse.of(Collections.emptyList(), 0, page.getPageSize(), page.getPageIndex());
|
||||
}
|
||||
List<PumpRoomE> es = pumpRoomCoConvertor.converDOsToE(records);
|
||||
List<String> pumpRoomIds = es.stream()
|
||||
.map(PumpRoomE::getPumpRoomId)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, List<ResourceDeviceDO>> deviceMap =
|
||||
resourceDeviceRepository.listByBizId(pumpRoomIds)
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(ResourceDeviceDO::getBizId));
|
||||
es.forEach(e -> {
|
||||
List<ResourceDeviceDO> devices = deviceMap.get(e.getPumpRoomId());
|
||||
e.device(resourceDeviceCoConvertor.converDOsToE(CollUtil.emptyIfNull(devices)));
|
||||
});
|
||||
List<PumpRoomCO> cos = pumpRoomCoConvertor.converEtoCOs(es);
|
||||
return PageResponse.of(cos, page.getTotalCount(), page.getPageSize(), page.getPageIndex());
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
public PumpRoomCO getById(Long id) {
|
||||
PumpRoomDO pumpRoomDO = pumpRoomRepository.getById(id);
|
||||
if (pumpRoomDO == null) {
|
||||
return null;
|
||||
}
|
||||
PumpRoomE pumpRoomE = pumpRoomCoConvertor.converDOtoE(pumpRoomDO);
|
||||
pumpRoomE.deviceInfo(resourceDeviceCoConvertor.converDOsToE(resourceDeviceRepository.listByBizId(CollUtil.newArrayList(pumpRoomDO.getPumpRoomId()))));
|
||||
return pumpRoomCoConvertor.converEtoCO(pumpRoomE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,26 @@
|
|||
package com.zcloud.zcGbsServicer.command.query;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.RescueTeamCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.command.convertor.ResourcePersonCoConvertor;
|
||||
import com.zcloud.zcGbsServicer.domain.model.RescueTeamE;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.dto.RescueTeamPageQry;
|
||||
import com.zcloud.zcGbsServicer.dto.clientobject.RescueTeamCO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.RescueTeamRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourcePersonRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -26,6 +34,9 @@ public class RescueTeamQueryExe {
|
|||
private final RescueTeamRepository rescueTeamRepository;
|
||||
private final RescueTeamCoConvertor rescueTeamCoConvertor;
|
||||
|
||||
private final ResourcePersonRepository resourcePersonRepository;
|
||||
private final ResourcePersonCoConvertor resourcePersonCoConvertor;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
|
|
@ -33,10 +44,50 @@ public class RescueTeamQueryExe {
|
|||
* @return
|
||||
*/
|
||||
public PageResponse<RescueTeamCO> execute(RescueTeamPageQry rescueTeamPageQry) {
|
||||
Map<String,Object> params = PageQueryHelper.toHashMap(rescueTeamPageQry);
|
||||
Map<String, Object> params = PageQueryHelper.toHashMap(rescueTeamPageQry);
|
||||
PageResponse<RescueTeamDO> pageResponse = rescueTeamRepository.listPage(params);
|
||||
List<RescueTeamCO> examCenterCOS = rescueTeamCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||
List<RescueTeamCO> rescueTeamList = rescueTeamCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
if (CollUtil.isEmpty(rescueTeamList)) {
|
||||
return toPageResponse(pageResponse, rescueTeamList);
|
||||
}
|
||||
List<String> teamIds = rescueTeamList.stream()
|
||||
.map(RescueTeamCO::getTeamId)
|
||||
.collect(Collectors.toList());
|
||||
//获取队员人数
|
||||
List<ResourcePersonDO> allMembers = resourcePersonRepository.listByBizId(teamIds);
|
||||
if (CollUtil.isNotEmpty(allMembers)) {
|
||||
Map<String, List<ResourcePersonDO>> memberMap = allMembers.stream().collect(Collectors.groupingBy(ResourcePersonDO::getBizId));
|
||||
for (RescueTeamCO team : rescueTeamList) {
|
||||
List<ResourcePersonDO> members = memberMap.get(team.getTeamId());
|
||||
if (CollUtil.isNotEmpty(members)) {
|
||||
team.setMemberCount(members.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
return toPageResponse(pageResponse, rescueTeamList);
|
||||
}
|
||||
|
||||
private PageResponse<RescueTeamCO> toPageResponse(PageResponse<RescueTeamDO> sourcePage, List<RescueTeamCO> data) {
|
||||
return PageResponse.of(data, sourcePage.getTotalCount(), sourcePage.getPageSize(), sourcePage.getPageIndex());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
public RescueTeamCO getById(Long id) {
|
||||
RescueTeamDO rescueTeamDO = rescueTeamRepository.getById(id);
|
||||
if (rescueTeamDO == null) {
|
||||
return null;
|
||||
}
|
||||
RescueTeamE rescueTeamE = rescueTeamCoConvertor.converDOToEO(rescueTeamDO);
|
||||
//获取队员列表
|
||||
List<ResourcePersonE> memberList = resourcePersonCoConvertor.converDOsTOEOs(resourcePersonRepository.listByBizId(CollUtil.newArrayList(rescueTeamDO.getTeamId())));
|
||||
if (CollUtil.isNotEmpty(memberList)) {
|
||||
rescueTeamE.memberInfo(memberList);
|
||||
}
|
||||
return rescueTeamCoConvertor.converEToCO(rescueTeamE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ public class ControlRoomServiceImpl implements ControlRoomServiceI {
|
|||
return controlRoomQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControlRoomCO getInfoById(Long id) {
|
||||
return controlRoomQueryExe.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(ControlRoomAddCmd cmd) {
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ public class PumpRoomServiceImpl implements PumpRoomServiceI {
|
|||
return pumpRoomQueryExe.execute(qry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PumpRoomCO getInfoById(Long id) {
|
||||
return pumpRoomQueryExe.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse add(PumpRoomAddCmd cmd) {
|
||||
|
||||
|
|
|
|||
|
|
@ -55,5 +55,10 @@ public class RescueTeamServiceImpl implements RescueTeamServiceI {
|
|||
public void removeBatch(Long[] ids) {
|
||||
rescueTeamRemoveExe.execute(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RescueTeamCO get(Long id) {
|
||||
return rescueTeamQueryExe.getById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import com.alibaba.cola.dto.SingleResponse;
|
|||
public interface ControlRoomServiceI {
|
||||
PageResponse<ControlRoomCO> listPage(ControlRoomPageQry qry);
|
||||
|
||||
ControlRoomCO getInfoById(Long id);
|
||||
|
||||
SingleResponse<ControlRoomCO> add(ControlRoomAddCmd cmd);
|
||||
|
||||
void edit(ControlRoomUpdateCmd cmd);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import com.alibaba.cola.dto.SingleResponse;
|
|||
public interface PumpRoomServiceI {
|
||||
PageResponse<PumpRoomCO> listPage(PumpRoomPageQry qry);
|
||||
|
||||
PumpRoomCO getInfoById(Long id);
|
||||
|
||||
SingleResponse<PumpRoomCO> add(PumpRoomAddCmd cmd);
|
||||
|
||||
void edit(PumpRoomUpdateCmd cmd);
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ public interface RescueTeamServiceI {
|
|||
void remove(Long id);
|
||||
|
||||
void removeBatch(Long[] ids);
|
||||
|
||||
RescueTeamCO get(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,10 +47,11 @@ public class ControlRoomAddCmd extends Command {
|
|||
@NotNull(message = "纬度不能为空")
|
||||
private Double lat;
|
||||
|
||||
//救援队员信息
|
||||
@ApiModelProperty(value = "救援队员信息", name = "rescueMembers", required = true)
|
||||
@NotEmpty(message = "救援队员信息不能为空")
|
||||
private List<ResourcePersonAddCmd> rescueMembers;
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<ResourceDeviceAddCmd> devices;
|
||||
|
||||
@ApiModelProperty(value = "人员信息")
|
||||
private List<ResourcePersonAddCmd> persons;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.zcloud.zcGbsServicer.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
|
@ -24,5 +26,11 @@ public class ControlRoomPageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeRoomId;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室名称")
|
||||
private String likeRoomName;
|
||||
|
||||
@ApiModelProperty(value = "消防控制室状态")
|
||||
private String eqRoomStatus;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -42,5 +43,11 @@ public class ControlRoomUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "纬度", name = "lat", required = true)
|
||||
@NotNull(message = "纬度不能为空")
|
||||
private Double lat;
|
||||
|
||||
@ApiModelProperty(value = "人员信息")
|
||||
private List<ResourcePersonAddCmd> persons;
|
||||
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<ResourceDeviceAddCmd> devices;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -45,6 +46,9 @@ public class PumpRoomAddCmd extends Command {
|
|||
@ApiModelProperty(value = "纬度", name = "lat", required = true)
|
||||
@NotNull(message = "纬度不能为空")
|
||||
private Double lat;
|
||||
|
||||
@ApiModelProperty(value = "设备集合")
|
||||
private List<ResourceDeviceAddCmd> devices;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,11 @@ public class PumpRoomPageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likePumpRoomId;
|
||||
|
||||
@ApiModelProperty(value = "泵房名称")
|
||||
private String likePumpRoomName;
|
||||
|
||||
@ApiModelProperty(value = "泵房状态")
|
||||
private String eqPumpRoomStatus;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -42,5 +43,8 @@ public class PumpRoomUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "纬度", name = "lat", required = true)
|
||||
@NotNull(message = "纬度不能为空")
|
||||
private Double lat;
|
||||
|
||||
@ApiModelProperty(value = "设备信息")
|
||||
private List<ResourceDeviceAddCmd> devices;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.dto;
|
||||
|
||||
import com.alibaba.cola.dto.Command;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -8,6 +9,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -54,6 +56,11 @@ public class RescueTeamAddCmd extends Command {
|
|||
@ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true)
|
||||
@NotEmpty(message = "职责和任务范围不能为空")
|
||||
private String dutyScope;
|
||||
|
||||
@ApiModelProperty(value = "消防队员")
|
||||
private List<ResourcePersonE> rescueMembers;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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,19 @@ public class RescueTeamPageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeTeamId;
|
||||
|
||||
@ApiModelProperty(value = "队伍名称", name = "teamName")
|
||||
private String likeTeamName;
|
||||
|
||||
@ApiModelProperty(value = "负责人或者单位", name = "leaderOrUnit")
|
||||
private String likeChargeOrgDept;
|
||||
|
||||
@ApiModelProperty(value = "救援队类型")
|
||||
private Integer eqTeamType;
|
||||
|
||||
@ApiModelProperty(value = "队长")
|
||||
private String likeCaptainName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -49,5 +50,7 @@ public class RescueTeamUpdateCmd extends Command {
|
|||
@ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true)
|
||||
@NotEmpty(message = "职责和任务范围不能为空")
|
||||
private String dutyScope;
|
||||
@ApiModelProperty(value = "消防队员")
|
||||
private List<ResourcePersonAddCmd> rescueMembers;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ import javax.validation.constraints.*;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ResourceDeviceAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务主键ID", name = "deviceId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
private String deviceId;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ import javax.validation.constraints.*;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ResourcePersonAddCmd extends Command {
|
||||
|
||||
@ApiModelProperty(value = "主键", name = "id", required = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "业务主键ID", name = "personId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
private String personId;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import javax.validation.constraints.*;
|
|||
@AllArgsConstructor
|
||||
public class WaterSourceAddCmd extends Command {
|
||||
@ApiModelProperty(value = "业务主键ID", name = "waterSourceId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String waterSourceId;
|
||||
|
||||
@ApiModelProperty(value = "消防水源名称", name = "waterSourceName", required = true)
|
||||
|
|
@ -27,7 +27,7 @@ public class WaterSourceAddCmd extends Command {
|
|||
private String waterSourceName;
|
||||
|
||||
@ApiModelProperty(value = "消防水源状态(字典码)", name = "waterSourceStatus", required = true)
|
||||
@NotEmpty(message = "消防水源状态(字典码)不能为空")
|
||||
@NotEmpty(message = "消防水源状态不能为空")
|
||||
private String waterSourceStatus;
|
||||
|
||||
@ApiModelProperty(value = "所属单位或部门", name = "belongOrgDept", required = true)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class WaterSourceUpdateCmd extends Command {
|
|||
@NotNull(message = "主键不能为空")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "业务主键ID", name = "waterSourceId", required = true)
|
||||
@NotEmpty(message = "业务主键ID不能为空")
|
||||
// @NotEmpty(message = "业务主键ID不能为空")
|
||||
private String waterSourceId;
|
||||
@ApiModelProperty(value = "消防水源名称", name = "waterSourceName", required = true)
|
||||
@NotEmpty(message = "消防水源名称不能为空")
|
||||
|
|
|
|||
|
|
@ -74,5 +74,13 @@ public class ControlRoomCO extends ClientObject {
|
|||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
//设备数量
|
||||
@ApiModelProperty(value = "设备数量")
|
||||
private Integer deviceCount;
|
||||
|
||||
//人员数量
|
||||
@ApiModelProperty(value = "人员数量")
|
||||
private Integer personCount;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,5 +74,9 @@ public class PumpRoomCO extends ClientObject {
|
|||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
//设备数量
|
||||
@ApiModelProperty(value = "设备数量")
|
||||
private Integer deviceCount;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -81,5 +82,11 @@ public class RescueTeamCO extends ClientObject {
|
|||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
//队员人数
|
||||
@ApiModelProperty(value = "队员人数")
|
||||
private Integer memberCount;
|
||||
//救援队员
|
||||
@ApiModelProperty(value = "救援队员")
|
||||
private List<ResourcePersonCO> teamMembers;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.zcloud.zcGbsServicer.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
public enum DeviceTypeEnum {
|
||||
|
||||
//控制室
|
||||
CONTROL_ROOM(1, "控制室"),
|
||||
//泵房
|
||||
PUMP_ROOM(2, "泵房"),;
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
DeviceTypeEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
/**
|
||||
* 根据 Code 查找枚举对象
|
||||
* @param code 设备类型码
|
||||
* @return 对应的枚举,若未找到返回 null
|
||||
*/
|
||||
public static DeviceTypeEnum getByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (DeviceTypeEnum value : values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 Code 获取描述(空指针安全)
|
||||
* 常用于日志打印或导出 Excel 时转换字段
|
||||
*/
|
||||
public static String getDescByCode(Integer code) {
|
||||
DeviceTypeEnum item = getByCode(code);
|
||||
return item == null ? "" : item.getDescription();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.zcGbsServicer.domain.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
@Getter
|
||||
public enum PersonTypeEnum {
|
||||
|
||||
//救援队
|
||||
RESCUE_TEAM(1, "救援队"),
|
||||
//控制室
|
||||
CONTROL_ROOM(2, "控制室"),
|
||||
//泵房
|
||||
PUMP_ROOM(3, "泵房"),
|
||||
//水源
|
||||
WATER_SOURCE(4, "水源"),;
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
PersonTypeEnum(Integer code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 Code 获取枚举对象
|
||||
* 通常用于 Mybatis/JPA 的类型转换,或处理前端传来的参数
|
||||
*
|
||||
* @param code 状态码
|
||||
* @return 对应的枚举,如果找不到则返回 null (或抛出异常)
|
||||
*/
|
||||
public static PersonTypeEnum getByCode(Integer code) {
|
||||
return Arrays.stream(PersonTypeEnum.values())
|
||||
.filter(e -> e.getCode().equals(code))
|
||||
.findFirst()
|
||||
.orElse(null); // 或者 .orElseThrow(() -> new IllegalArgumentException("未知的人员类型"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 Code 获取描述信息(空指针安全)
|
||||
*/
|
||||
public static String getDescByCode(Integer code) {
|
||||
return Optional.ofNullable(getByCode(code))
|
||||
.map(PersonTypeEnum::getDescription)
|
||||
.orElse("未知类型");
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断某个 code 是否合法
|
||||
*/
|
||||
public static boolean isValid(Integer code) {
|
||||
return getByCode(code) != null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,8 @@ package com.zcloud.zcGbsServicer.domain.gateway;
|
|||
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourceDeviceE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
* @Author makejava
|
||||
|
|
@ -14,6 +16,11 @@ public interface ResourceDeviceGateway {
|
|||
*/
|
||||
Boolean add(ResourceDeviceE resourceDeviceE) ;
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
Boolean addBatch(List<ResourceDeviceE> resourceDeviceEList);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
|
@ -24,5 +31,10 @@ public interface ResourceDeviceGateway {
|
|||
*/
|
||||
Boolean deletedResourceDeviceById(Long id);
|
||||
Boolean deletedResourceDeviceByIds(Long[] id);
|
||||
|
||||
/**
|
||||
* 根据绑定资源删除同设备类型
|
||||
*/
|
||||
Boolean deletedResourceDeviceByBizId(String roomId, Integer deviceType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package com.zcloud.zcGbsServicer.domain.gateway;
|
|||
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
* @Author makejava
|
||||
|
|
@ -14,6 +16,12 @@ public interface ResourcePersonGateway {
|
|||
*/
|
||||
Boolean add(ResourcePersonE resourcePersonE) ;
|
||||
|
||||
/**
|
||||
* 批量新增
|
||||
*/
|
||||
Boolean addBatch(List<ResourcePersonE> resourcePersonEList);
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
|
@ -24,5 +32,11 @@ public interface ResourcePersonGateway {
|
|||
*/
|
||||
Boolean deletedResourcePersonById(Long id);
|
||||
Boolean deletedResourcePersonByIds(Long[] id);
|
||||
|
||||
/**
|
||||
* 根据资源ID删除人员
|
||||
*/
|
||||
Boolean deletedResourcePersonByBizId(String bizId, Integer bizType);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package com.zcloud.zcGbsServicer.domain.model;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
* @Author makejava
|
||||
|
|
@ -26,5 +33,48 @@ public class ControlRoomE extends BaseE {
|
|||
private Double lng;
|
||||
//纬度
|
||||
private Double lat;
|
||||
//设备数量
|
||||
private Integer deviceCount;
|
||||
//人员数量
|
||||
private Integer personCount;
|
||||
|
||||
//消防控制室设备
|
||||
private List<ResourceDeviceE> devices;
|
||||
|
||||
//消防控制室人员
|
||||
private List<ResourcePersonE> persons;
|
||||
|
||||
//初始化
|
||||
public void addInit(){
|
||||
if (StrUtil.isBlank(this.roomId)) {
|
||||
this.roomId = Tools.get32UUID();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.devices)) {
|
||||
devices.forEach(resourceDeviceE -> {
|
||||
resourceDeviceE.setBizId(this.roomId);
|
||||
resourceDeviceE.setBizType(DeviceTypeEnum.CONTROL_ROOM.getCode());
|
||||
});
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.persons)) {
|
||||
persons.forEach(resourcePersonE -> {
|
||||
resourcePersonE.setBizId(this.roomId);
|
||||
resourcePersonE.setBizType(PersonTypeEnum.CONTROL_ROOM.getCode());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//设置相关信息
|
||||
public void relationInfo(int deviceCount, int personCount){
|
||||
this.deviceCount = deviceCount;
|
||||
this.personCount = personCount;
|
||||
}
|
||||
|
||||
//设置相关数据
|
||||
public void relationData(List<ResourceDeviceE> devices, List<ResourcePersonE> persons){
|
||||
this.devices = devices;
|
||||
this.persons = persons;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
package com.zcloud.zcGbsServicer.domain.model;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
* @Author makejava
|
||||
|
|
@ -26,5 +32,35 @@ public class PumpRoomE extends BaseE {
|
|||
private Double lng;
|
||||
//纬度
|
||||
private Double lat;
|
||||
|
||||
//设备集合
|
||||
private List<ResourceDeviceE> devices;
|
||||
|
||||
//设备数量
|
||||
private Integer deviceCount;
|
||||
|
||||
public void addInit() {
|
||||
if (StrUtil.isBlank(this.pumpRoomId)) {
|
||||
this.pumpRoomId = Tools.get32UUID();
|
||||
}
|
||||
if (CollUtil.isNotEmpty(this.devices)) {
|
||||
for (ResourceDeviceE device : this.devices) {
|
||||
device.setBizId(this.pumpRoomId);
|
||||
device.setBizType(DeviceTypeEnum.PUMP_ROOM.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void device(List<ResourceDeviceE> devices) {
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
this.deviceCount = devices.size();
|
||||
}
|
||||
}
|
||||
|
||||
public void deviceInfo(List<ResourceDeviceE> devices) {
|
||||
if (CollUtil.isNotEmpty(devices)) {
|
||||
this.devices = devices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
|
|||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
|
@ -38,12 +39,25 @@ public class RescueTeamE extends BaseE {
|
|||
private String dutyScope;
|
||||
|
||||
//消防队员
|
||||
private List<ResourcePersonE> rescueMembers;
|
||||
private List<ResourcePersonE> teamMembers;
|
||||
|
||||
|
||||
public void addInit() {
|
||||
if (StrUtil.isBlank(this.teamId)) {
|
||||
this.teamId = IdUtil.simpleUUID();
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(this.teamMembers)) {
|
||||
for (ResourcePersonE member : this.teamMembers) {
|
||||
member.setBizId(this.teamId);
|
||||
member.setBizType(PersonTypeEnum.RESCUE_TEAM.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void memberInfo (List<ResourcePersonE> teamMembers){
|
||||
if (CollectionUtil.isNotEmpty(teamMembers)) {
|
||||
this.teamMembers = teamMembers;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,5 +36,10 @@ public class ResourceDeviceE extends BaseE {
|
|||
private String paramsSpec;
|
||||
//排序
|
||||
private Integer sort;
|
||||
|
||||
public void relInfo(String bizId, Integer bizType) {
|
||||
this.bizId = bizId;
|
||||
this.bizType = bizType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,10 @@ public class ResourcePersonE extends BaseE {
|
|||
private String dutyDesc;
|
||||
//排序
|
||||
private Integer sort;
|
||||
|
||||
public void relInfo(String teamId, Integer bizType) {
|
||||
this.bizId = teamId;
|
||||
this.bizType = bizType;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class ControlRoomGatewayImpl implements ControlRoomGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(ControlRoomE controlRoomE) {
|
||||
ControlRoomDO d = new ControlRoomDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(controlRoomE, d,"${uuid}");
|
||||
ControlRoomDO d = new ControlRoomDO(controlRoomE.getRoomId());
|
||||
BeanUtils.copyProperties(controlRoomE, d,"roomId");
|
||||
controlRoomRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class PumpRoomGatewayImpl implements PumpRoomGateway {
|
|||
@Override
|
||||
public Boolean add(PumpRoomE pumpRoomE) {
|
||||
PumpRoomDO d = new PumpRoomDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(pumpRoomE, d,"${uuid}");
|
||||
BeanUtils.copyProperties(pumpRoomE, d,"pumpRoomId");
|
||||
pumpRoomRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class RescueTeamGatewayImpl implements RescueTeamGateway {
|
|||
@Override
|
||||
public Boolean add(RescueTeamE rescueTeamE) {
|
||||
RescueTeamDO d = new RescueTeamDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(rescueTeamE, d,"${uuid}");
|
||||
BeanUtils.copyProperties(rescueTeamE, d,"teamId");
|
||||
rescueTeamRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.zcGbsServicer.gatewayimpl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourceDeviceE;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
|
|
@ -10,6 +11,8 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -23,12 +26,23 @@ public class ResourceDeviceGatewayImpl implements ResourceDeviceGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(ResourceDeviceE resourceDeviceE) {
|
||||
ResourceDeviceDO d = new ResourceDeviceDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(resourceDeviceE, d,"${uuid}");
|
||||
ResourceDeviceDO d = new ResourceDeviceDO(resourceDeviceE.getDeviceId());
|
||||
BeanUtils.copyProperties(resourceDeviceE, d,"deviceId");
|
||||
resourceDeviceRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addBatch(List<ResourceDeviceE> resourceDeviceEList) {
|
||||
if (resourceDeviceEList.isEmpty()) return true;
|
||||
List<ResourceDeviceDO> resourceDeviceDOList = resourceDeviceEList.stream().map(resourceDeviceE -> {
|
||||
ResourceDeviceDO d = new ResourceDeviceDO(resourceDeviceE.getDeviceId());
|
||||
BeanUtils.copyProperties(resourceDeviceE, d,"deviceId");
|
||||
return d;
|
||||
}).collect(Collectors.toList());
|
||||
return resourceDeviceRepository.saveBatch(resourceDeviceDOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(ResourceDeviceE resourceDeviceE) {
|
||||
ResourceDeviceDO d = new ResourceDeviceDO();
|
||||
|
|
@ -46,5 +60,10 @@ public class ResourceDeviceGatewayImpl implements ResourceDeviceGateway {
|
|||
public Boolean deletedResourceDeviceByIds(Long[] ids) {
|
||||
return resourceDeviceRepository.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedResourceDeviceByBizId(String roomId, Integer deviceType) {
|
||||
return resourceDeviceRepository.removeBatchByIds(resourceDeviceRepository.listByBizIdAndBizType(CollUtil.newArrayList(roomId), deviceType));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.zcGbsServicer.gatewayimpl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway;
|
||||
import com.zcloud.zcGbsServicer.domain.model.ResourcePersonE;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
|
|
@ -10,6 +11,8 @@ import org.springframework.beans.BeanUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* web-infrastructure
|
||||
|
|
@ -23,12 +26,26 @@ public class ResourcePersonGatewayImpl implements ResourcePersonGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(ResourcePersonE resourcePersonE) {
|
||||
ResourcePersonDO d = new ResourcePersonDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(resourcePersonE, d,"${uuid}");
|
||||
ResourcePersonDO d = new ResourcePersonDO(resourcePersonE.getPersonId());
|
||||
BeanUtils.copyProperties(resourcePersonE, d,"personId");
|
||||
resourcePersonRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addBatch(List<ResourcePersonE> resourcePersonEList) {
|
||||
if (resourcePersonEList.isEmpty()) return true;
|
||||
// 使用 Stream 流进行转换
|
||||
List<ResourcePersonDO> doList = resourcePersonEList.stream()
|
||||
.map(e -> {
|
||||
ResourcePersonDO d = new ResourcePersonDO(e.getPersonId());
|
||||
BeanUtils.copyProperties(e, d, "personId");
|
||||
return d;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return resourcePersonRepository.saveBatch(doList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(ResourcePersonE resourcePersonE) {
|
||||
ResourcePersonDO d = new ResourcePersonDO();
|
||||
|
|
@ -46,5 +63,11 @@ public class ResourcePersonGatewayImpl implements ResourcePersonGateway {
|
|||
public Boolean deletedResourcePersonByIds(Long[] ids) {
|
||||
return resourcePersonRepository.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class WaterSourceGatewayImpl implements WaterSourceGateway {
|
|||
|
||||
@Override
|
||||
public Boolean add(WaterSourceE waterSourceE) {
|
||||
WaterSourceDO d = new WaterSourceDO(Tools.get32UUID());
|
||||
BeanUtils.copyProperties(waterSourceE, d,"${uuid}");
|
||||
WaterSourceDO d = new WaterSourceDO(waterSourceE.getWaterSourceId());
|
||||
BeanUtils.copyProperties(waterSourceE, d,"waterSourceId");
|
||||
waterSourceRepository.save(d);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -41,7 +42,7 @@ public class ControlRoomDO extends BaseDO {
|
|||
private Double lat;
|
||||
|
||||
public ControlRoomDO(String roomId) {
|
||||
this. roomId= IdUtil.simpleUUID();
|
||||
this.roomId= StrUtil.isNotBlank(roomId) ? roomId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -41,7 +42,7 @@ public class PumpRoomDO extends BaseDO {
|
|||
private Double lat;
|
||||
|
||||
public PumpRoomDO(String pumpRoomId) {
|
||||
this.pumpRoomId = IdUtil.simpleUUID();
|
||||
this.pumpRoomId = StrUtil.isNotBlank(pumpRoomId) ? pumpRoomId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -49,7 +50,7 @@ public class RescueTeamDO extends BaseDO {
|
|||
private String dutyScope;
|
||||
|
||||
public RescueTeamDO(String teamId) {
|
||||
this.teamId = IdUtil.simpleUUID();
|
||||
this.teamId = StrUtil.isNotBlank(teamId) ? teamId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class ResourceDeviceDO extends BaseDO {
|
|||
private Integer sort;
|
||||
|
||||
public ResourceDeviceDO(String deviceId) {
|
||||
this.deviceId = IdUtil.simpleUUID();
|
||||
this.deviceId = deviceId != null ? deviceId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -44,7 +46,8 @@ public class ResourcePersonDO extends BaseDO {
|
|||
private Integer sort;
|
||||
|
||||
public ResourcePersonDO(String personId) {
|
||||
this.personId = IdUtil.simpleUUID();
|
||||
if (StrUtil.isBlank(personId)) this.personId = Tools.get32UUID();
|
||||
else this.personId = personId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.dataobject;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -62,7 +63,7 @@ public class WaterSourceDO extends BaseDO {
|
|||
private String equipmentList;
|
||||
|
||||
public WaterSourceDO(String waterSourceId) {
|
||||
this.waterSourceId = IdUtil.simpleUUID();
|
||||
this.waterSourceId = StrUtil.isNotBlank(waterSourceId) ? waterSourceId :IdUtil.simpleUUID();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,7 @@ import java.util.Map;
|
|||
*/
|
||||
public interface ControlRoomRepository extends BaseRepository<ControlRoomDO> {
|
||||
PageResponse<ControlRoomDO> listPage(Map<String,Object> params);
|
||||
|
||||
ControlRoomDO getById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,5 +12,7 @@ import java.util.Map;
|
|||
*/
|
||||
public interface PumpRoomRepository extends BaseRepository<PumpRoomDO> {
|
||||
PageResponse<PumpRoomDO> listPage(Map<String,Object> params);
|
||||
|
||||
PumpRoomDO getById(Long id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.zcloud.zcGbsServicer.persistence.repository;
|
|||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -12,5 +14,6 @@ import java.util.Map;
|
|||
*/
|
||||
public interface RescueTeamRepository extends BaseRepository<RescueTeamDO> {
|
||||
PageResponse<RescueTeamDO> listPage(Map<String,Object> params);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.zcloud.zcGbsServicer.persistence.repository;
|
|||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -12,5 +14,9 @@ import java.util.Map;
|
|||
*/
|
||||
public interface ResourceDeviceRepository extends BaseRepository<ResourceDeviceDO> {
|
||||
PageResponse<ResourceDeviceDO> listPage(Map<String,Object> params);
|
||||
|
||||
List<ResourceDeviceDO> listByBizId(List<String> bizIds);
|
||||
|
||||
List<ResourceDeviceDO> listByBizIdAndBizType(List<String> bizIds, Integer bizType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository;
|
||||
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -12,5 +15,13 @@ import java.util.Map;
|
|||
*/
|
||||
public interface ResourcePersonRepository extends BaseRepository<ResourcePersonDO> {
|
||||
PageResponse<ResourcePersonDO> listPage(Map<String,Object> params);
|
||||
|
||||
|
||||
List<ResourcePersonDO> listByBizId(List<String> bizIds);
|
||||
|
||||
List<ResourcePersonDO> listByBizIdAndBizType(List<String> bizIds, Integer bizType);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,5 +33,10 @@ public class ControlRoomRepositoryImpl extends BaseRepositoryImpl<ControlRoomMap
|
|||
IPage<ControlRoomDO> result = controlRoomMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControlRoomDO getById(Long id) {
|
||||
return controlRoomMapper.selectById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,5 +33,10 @@ public class PumpRoomRepositoryImpl extends BaseRepositoryImpl<PumpRoomMapper, P
|
|||
IPage<PumpRoomDO> result = pumpRoomMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PumpRoomDO getById(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.mapper.RescueTeamMapper;
|
||||
|
|
@ -12,6 +13,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -33,5 +37,6 @@ public class RescueTeamRepositoryImpl extends BaseRepositoryImpl<RescueTeamMappe
|
|||
IPage<RescueTeamDO> result = rescueTeamMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourceDeviceDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.mapper.ResourceDeviceMapper;
|
||||
|
|
@ -12,6 +14,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -33,5 +38,20 @@ public class ResourceDeviceRepositoryImpl extends BaseRepositoryImpl<ResourceDev
|
|||
IPage<ResourceDeviceDO> result = resourceDeviceMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResourceDeviceDO> listByBizId(List<String> bizIds) {
|
||||
if (CollUtil.isEmpty(bizIds)) return null;
|
||||
return this.list(new LambdaQueryWrapper<ResourceDeviceDO>()
|
||||
.in(ResourceDeviceDO::getBizId, bizIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResourceDeviceDO> listByBizIdAndBizType(List<String> bizIds, Integer bizType) {
|
||||
if (CollUtil.isEmpty(bizIds)) return null;
|
||||
return this.list(new LambdaQueryWrapper<ResourceDeviceDO>()
|
||||
.in(ResourceDeviceDO::getBizId, bizIds)
|
||||
.eq(ResourceDeviceDO::getBizType, bizType));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.zcloud.zcGbsServicer.persistence.repository.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.RescueTeamDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.dataobject.ResourcePersonDO;
|
||||
import com.zcloud.zcGbsServicer.persistence.mapper.ResourcePersonMapper;
|
||||
import com.zcloud.zcGbsServicer.persistence.repository.ResourcePersonRepository;
|
||||
|
|
@ -12,6 +15,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -26,12 +32,29 @@ public class ResourcePersonRepositoryImpl extends BaseRepositoryImpl<ResourcePer
|
|||
|
||||
@Override
|
||||
public PageResponse<ResourcePersonDO> listPage(Map<String,Object> params) {
|
||||
IPage<ResourcePersonDO> iPage = new Query<ResourcePersonDO>().getPage(params);
|
||||
IPage<ResourcePersonDO> iPage = new Query<ResourcePersonDO>().getPage(params);
|
||||
QueryWrapper<ResourcePersonDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ResourcePersonDO> result = resourcePersonMapper.selectPage(iPage, queryWrapper);
|
||||
return PageHelper.pageToResponse(result, result.getRecords());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ResourcePersonDO> listByBizId(List<String> bizIds) {
|
||||
if (CollUtil.isEmpty(bizIds)) return null;
|
||||
return this.list(new LambdaQueryWrapper<ResourcePersonDO>()
|
||||
.in(ResourcePersonDO::getBizId, bizIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ResourcePersonDO> listByBizIdAndBizType(List<String> bizIds, Integer bizType) {
|
||||
if (CollUtil.isEmpty(bizIds)) return null;
|
||||
return this.list(new LambdaQueryWrapper<ResourcePersonDO>()
|
||||
.in(ResourcePersonDO::getBizId, bizIds)
|
||||
.eq(ResourcePersonDO::getBizType, bizType)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue