This commit is contained in:
lxj
2025-09-11 17:35:56 +08:00
17 changed files with 302 additions and 106 deletions

View File

@@ -7,15 +7,18 @@ import org.dromara.common.core.domain.R;
import org.dromara.common.web.core.BaseController;
import org.dromara.property.domain.MeetBooking;
import org.dromara.property.domain.vo.BigScreen.TodayMeetCountVo;
import org.dromara.property.domain.vo.BigScreen.TodayVisitorCountVo;
import org.dromara.property.domain.vo.BigScreen.TypeWorkOrderHistogramVo;
import org.dromara.property.service.IMeetBookingService;
import org.dromara.property.service.IServiceWorkOrdersService;
import org.dromara.property.service.ITbVisitorManagementService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @author yuyongle
@@ -31,6 +34,7 @@ public class ScreenController extends BaseController {
private final IServiceWorkOrdersService serviceWorkOrdersService;
private final IMeetBookingService meetBookingService;
private final ITbVisitorManagementService tbVisitorManagementService;
/**
* 大屏工单柱状图
@@ -46,4 +50,11 @@ public class ScreenController extends BaseController {
public R<TodayMeetCountVo> todayMeetCount() {
return R.ok(meetBookingService.todayMeetCount());
}
/**
* 大屏访客记录统计
*/
@GetMapping("/todayVisitorCount")
public R<List<TodayVisitorCountVo>> todayVisitorCount() {
return R.ok(tbVisitorManagementService.todayVisitorCount());
}
}

View File

@@ -34,7 +34,11 @@ public class CostHouseCharge extends TenantEntity {
/**
* 房屋
*/
private Long roomId;
private Long residentUnitId;
/**
* 面积
*/
private Float area;
/**
* 业主
*/

View File

@@ -30,10 +30,18 @@ public class CostHouseChargeBo extends BaseEntity {
private Long id;
/**
* 房屋
* 入驻单位
*/
@NotNull(message = "房屋不能为空", groups = { AddGroup.class, EditGroup.class })
private Long roomId;
@NotNull(message = "入驻单位id不能为空", groups = { EditGroup.class })
private Long residentUnitId;
/**
* 入驻文本
*/
private String residentUnitText;
/**
* 面积
*/
private Float area;
/**
* 业主
*/

View File

@@ -70,7 +70,10 @@ public class ServiceWorkOrdersBo extends BaseEntity {
* 发起人姓名
*/
private String initiatorName;
/**
* 工单图片
*/
private String orderImgUrl;
/**
* 处理人姓名

View File

@@ -0,0 +1,20 @@
package org.dromara.property.domain.vo.BigScreen;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Map;
/**
* @author yuyongle
* @version 1.0
* @description: TODO
* @date 2025/9/11 16:13
*/
@Data
@Accessors(chain = true)
public class TodayVisitorCountVo {
private String type;
private Map<String, Integer> todayCounts; // ✅ 适合这种结构
}

View File

@@ -3,9 +3,13 @@ package org.dromara.property.domain.vo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.property.domain.CostHouseCharge;
import org.dromara.property.domain.CostItems;
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
import java.io.Serial;
import java.io.Serializable;
@@ -31,14 +35,18 @@ public class CostHouseChargeDetailVo implements Serializable {
private Long id;
/**
* 房屋
* 入驻单位
*/
@ExcelProperty(value = "房屋")
private Long roomId;
private Long residentUnitId;
/**
* 房屋名称
* 入驻文本
*/
private String roomName;
private String residentUnitText;
/**
* 面积
*/
private Float area;
/**
* 业主
*/
@@ -103,7 +111,7 @@ public class CostHouseChargeDetailVo implements Serializable {
* 房间信息
*/
@ExcelProperty(value = "房间信息")
private TbRoomVo roomVo;
private ResidentUnitVo residentUnitVo;
/**
* 收费项设置

View File

@@ -3,6 +3,9 @@ package org.dromara.property.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.property.domain.CostHouseCharge;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
@@ -37,16 +40,20 @@ public class CostHouseChargeVo implements Serializable {
@ExcelProperty(value = "主键")
private Long id;
/**
* 房屋
*/
@ExcelProperty(value = "房屋")
private Long roomId;
/**
* 房屋名称
* 入驻单位
*/
private String roomName;
private Long residentUnitId;
/**
* 入驻文本
*/
private String residentUnitText;
/**
* 面积
*/
private Float area;
/**
* 业主
*/

View File

@@ -51,10 +51,13 @@ public class CostPayFeeAuditVo implements Serializable {
@ExcelDictFormat(dictType = "pro_expense_type")
private String costType;
/**
* 房间号(如101,202)
* 入驻单位
*/
@ExcelProperty(value = "房间号")
private String roomNumber;
private String residentUnitId;
/**
* 入驻单位
*/
private String residentUnitText;
/**
* 车牌号
*/
@@ -100,8 +103,6 @@ public class CostPayFeeAuditVo implements Serializable {
/**
* 缴费时间
*/
@ExcelProperty(value = "缴费时间")
private Date payTime;

View File

@@ -34,7 +34,7 @@ public class TbFloorVo implements Serializable {
/**
*
*/
@ExcelProperty(value = "")
//@ExcelProperty(value = "")
private Long id;
/**
@@ -44,28 +44,30 @@ public class TbFloorVo implements Serializable {
/**
* 社区文本
*/
@ExcelProperty(value = "园区")
private String communityText;
/**
* 建筑名称
*/
@ExcelProperty(value = "建筑名称")
private Long buildingId;
/**
* 建筑文本
*/
@ExcelProperty(value = "建筑名称")
private String buildingText;
/**
* 单元编码
*/
@ExcelProperty(value = "单元编码")
//@ExcelProperty(value = "单元编码")
private Long unitId;
/**
* 楼层数名称
*/
@ExcelProperty(value = "楼层数名称")
@ExcelProperty(value = "楼层数")
private String floorName;
// /**
@@ -77,7 +79,7 @@ public class TbFloorVo implements Serializable {
/**
* 楼层类型
*/
@ExcelProperty(value = "楼层类型")
// @ExcelProperty(value = "楼层类型")
private Integer floorType;
/**
@@ -85,23 +87,28 @@ public class TbFloorVo implements Serializable {
*/
@ExcelProperty(value = "房间数量")
private Integer roomCount;
/**
* 建筑面积(平方米)
*/
private Float area;
/**
* 套内面积(平方米)
*/
private Float insideInArea;
/**
* 公摊面积(平方米)
*/
private Float sharedArea;
/**
* 层高
*/
@ExcelProperty(value = "层高")
private Integer floorHeight;
/**
* 建筑面积(平方米)
*/
@ExcelProperty(value = "建筑面积(平方米)")
private Float area;
/**
* 套内面积(平方米)
*/
@ExcelProperty(value = "套内面积(平方米)")
private Float insideInArea;
/**
* 公摊面积(平方米)
*/
@ExcelProperty(value = "公摊面积(平方米)")
private Float sharedArea;
}

View File

@@ -29,39 +29,48 @@ public class TbRoomVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*id
*/
@ExcelProperty(value = "")
private Long id;
/**
* 社区id
*/
private Long communityId;
/**
* 园区文本
*/
@ExcelProperty(value = "园区")
private String communityText;
/**
* 建筑id
*/
private Long buildingId;
/**
* 建筑名称
*/
@ExcelProperty(value = "建筑名称")
private Long buildingId;
@ExcelProperty(value = "建筑")
private String buildingText;
/**
* 单元编码
*/
@ExcelProperty(value = "单元编码")
private Long unitId;
/**
* 所属楼层ID
*/
@ExcelProperty(value = "所属楼层ID")
private Long floorId;
/**
* 所属楼层text
*/
@ExcelProperty(value = "所属楼层Text")
@ExcelProperty(value = "楼层")
private String floorText;
/**
* 入驻单位文本
*/
@ExcelProperty(value = "单位")
private String residentUnitText;
/**
* 房间号(如101,202)
*/
@@ -71,7 +80,8 @@ public class TbRoomVo implements Serializable {
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
@ExcelProperty(value = "房间类型('住宅','商铺','办公室','设备间','公共区域')")
@ExcelProperty(value = "房间类型('住宅','商铺','办公室','设备间','公共区域')", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "room_type")
private Integer roomType;
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "roomType", other = "room_type")
@@ -96,7 +106,7 @@ public class TbRoomVo implements Serializable {
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
@ExcelProperty(value = "朝向('东','南','西','北','东南','东北','西南','西北')")
//@ExcelProperty(value = "朝向('东','南','西','北','东南','东北','西南','西北')")
private Integer orientation;
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "orientation", other = "direction_towards")
@@ -105,15 +115,16 @@ public class TbRoomVo implements Serializable {
/**
* 是否可售
*/
@ExcelProperty(value = "是否可售")
// @ExcelProperty(value = "是否可售")
private Integer isForSale;
/**
* 状态('空置','已售','已租','自用'
*/
// @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
@ExcelProperty(value = "状态")
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
//@ExcelDictFormat(readConverterExp = "'=空置','已售','已租','自用'")
@ExcelDictFormat(dictType = "wy_fjzt")
private Integer status;
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "status", other = "wy_fjzt")
@@ -126,17 +137,5 @@ public class TbRoomVo implements Serializable {
* 图片
*/
private String imgUrl;
/**
* 园区文本
*/
private String communityText;
/**
* 建筑文本
*/
private String buildingText;
/**
* 入驻单位文本
*/
private String residentUnitText;
}

View File

@@ -1,6 +1,8 @@
package org.dromara.property.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.dromara.property.domain.vo.BigScreen.TodayMeetCountVo;
import org.dromara.property.domain.vo.BigScreen.TodayVisitorCountVo;
import org.dromara.property.domain.vo.TbVisitorManagementVo;
import org.dromara.property.domain.bo.TbVisitorManagementBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -122,5 +124,8 @@ public interface ITbVisitorManagementService {
* @return String
*/
Map<String, Object> getQrCodeByIdForXcx(Long id);
/**
* 大屏访客记录统计
*/
List<TodayVisitorCountVo> todayVisitorCount();
}

View File

@@ -21,6 +21,7 @@ import org.dromara.property.domain.entity.resident.ResidentPerson;
import org.dromara.property.domain.enums.ChargeStatusEnum;
import org.dromara.property.domain.vo.*;
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
import org.dromara.property.mapper.*;
import org.dromara.system.api.RemoteUserService;
import org.springframework.stereotype.Service;
@@ -51,6 +52,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
private final CostPayFeeAuditMapper costPayFeeAuditMapper;
private final CostReturnPayFeeMapper costReturnPayFeeMapper;
private final ResidentPersonMapper residentPersonMapper;
private final ResidentUnitMapper residentUnitMapper;
@DubboReference
private RemoteUserService remoteUserService;
@@ -66,12 +68,11 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
CostHouseChargeDetailVo costHouseChargeDetailVo = BeanUtil.copyProperties(costHouseChargeVo, CostHouseChargeDetailVo.class);
CostItemsVo costItemsVo = costItemsMapper.selectVoById(costHouseChargeDetailVo.getCostItemsId());
costHouseChargeDetailVo.setCostItemsVo(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo : null);
TbRoomVo tbRoomVo = tbRoomMapper.selectVoById(costHouseChargeDetailVo.getRoomId());
costHouseChargeDetailVo.setRoomVo(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo : null);
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(costHouseChargeDetailVo.getResidentUnitId());
costHouseChargeDetailVo.setResidentUnitVo(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo : null);
ResidentPersonVo residentPersonVo = residentPersonMapper.selectVoById(costHouseChargeVo.getPersonId());
//RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId());
String roomName = tbRoomMapper.queryRoomName(costHouseChargeDetailVo.getRoomId());
costHouseChargeDetailVo.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null);
//RemoteUserVo userInfo = remoteUserService.getUserInfoById(costHouseChargeVo.getPersonId()););
costHouseChargeDetailVo.setResidentUnitText(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
costHouseChargeDetailVo.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null);
return costHouseChargeDetailVo;
}
@@ -93,8 +94,8 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
ResidentPerson residentPerson = residentPeoplelist.stream()
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getPersonId())).findFirst().orElse(null);
s.setPersonName(ObjectUtil.isNotEmpty(residentPerson) ? residentPerson.getUserName() : null);
String roomName = tbRoomMapper.queryRoomName(s.getRoomId());
s.setRoomName(StringUtils.isNotBlank(roomName) ? roomName : null);
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(s.getResidentUnitId());
s.setResidentUnitText(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
}
});
return TableDataInfo.build(result);
@@ -117,7 +118,7 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
LambdaQueryWrapper<CostHouseCharge> lqw = Wrappers.lambdaQuery();
lqw.orderByDesc(CostHouseCharge::getCreateTime)
.orderByDesc(CostHouseCharge::getUpdateTime);
lqw.eq(bo.getRoomId() != null, CostHouseCharge::getRoomId, bo.getRoomId());
lqw.eq(bo.getResidentUnitId() != null, CostHouseCharge::getResidentUnitId, bo.getResidentUnitId());
lqw.eq(bo.getCostItemsId() != null, CostHouseCharge::getCostItemsId, bo.getCostItemsId());
lqw.eq(StringUtils.isNotBlank(bo.getChargeCycle()), CostHouseCharge::getChargeCycle, bo.getChargeCycle());
lqw.eq(bo.getAmountReceivable() != null, CostHouseCharge::getAmountReceivable, bo.getAmountReceivable());
@@ -138,9 +139,11 @@ public class CostHouseChargeServiceImpl implements ICostHouseChargeService {
@Transactional(rollbackFor = Exception.class)
public Boolean insertByBo(CostHouseChargeBo bo) {
CostHouseCharge add = MapstructUtils.convert(bo, CostHouseCharge.class);
//查询房间面积
TbRoomVo tbRoomVo = tbRoomMapper.selectVoById(bo.getRoomId());
BigDecimal area = new BigDecimal(tbRoomVo.getArea());
//查询入驻单位信息
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(add.getResidentUnitId());
add.setResidentUnitId(residentUnitVo.getId());
add.setArea(residentUnitVo.getArea());
BigDecimal area = new BigDecimal(add.getArea());
CostItemsVo costItemsVo = costItemsMapper.selectVoById(add.getCostItemsId());
BigDecimal unitPrice = costItemsVo.getUnitPrice();
//向上取整

View File

@@ -21,6 +21,7 @@ import org.dromara.property.domain.bo.CostPayFeeAuditBo;
import org.dromara.property.domain.enums.ChargeStatusEnum;
import org.dromara.property.domain.enums.ChargeTypeEnum;
import org.dromara.property.domain.vo.*;
import org.dromara.property.domain.vo.residentVo.ResidentUnitVo;
import org.dromara.property.mapper.*;
import org.dromara.property.service.ICostPayFeeAuditService;
import org.springframework.stereotype.Service;
@@ -48,6 +49,7 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
private final TbRoomMapper roomMapper;
private final CostHouseChargeMapper coinHouseChargeMapper;
private final CostCarChargeMapper costCarChargeMapper;
private final ResidentUnitMapper residentUnitMapper;
/**
* 查询费用-缴费审核
@@ -64,8 +66,8 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(costPayFeeAuditVo.getChargeId());
if (ObjectUtil.isNotEmpty(costHouseCharge)) {
String queryRoomName = roomMapper.queryRoomName(costHouseCharge.getRoomId());
costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(queryRoomName) ? queryRoomName : null);
ResidentUnitVo residentUnitVo = residentUnitMapper.selectVoById(costHouseCharge.getResidentUnitId());
costPayFeeAuditVo.setResidentUnitText(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
}
}
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
@@ -93,7 +95,7 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
}
List<CostItemsVo> costItemsVoList = costItemsMapper.selectVoList();
List<TbRoomVo> roomVoList = roomMapper.selectVoList();
// List<ResidentUnitVo> residentUnitVoList = residentUnitMapper.selectVoList();
List<CostPayFeeAuditVo> costPayFeeAuditVoList = new ArrayList<>();
result.getRecords().stream().forEach(s -> {
if (CollUtil.isNotEmpty(costItemsVoList)) {
@@ -103,11 +105,11 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
s.setCostType(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getCostType() : null);
s.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
}
if (CollUtil.isNotEmpty(roomVoList)) {
TbRoomVo tbRoomVo = roomVoList.stream()
.filter(vo -> vo.getId() != null && vo.getId().equals(s.getRoomNumber())).findFirst().orElse(null);
s.setRoomNumber(ObjectUtil.isNotEmpty(tbRoomVo) ? tbRoomVo.getRoomNumber() : null);
}
// if (CollUtil.isNotEmpty(residentUnitVoList)) {
// ResidentUnitVo residentUnitVo = residentUnitVoList.stream()
// .filter(vo -> vo.getId() != null && vo.getId().equals(s.getResidentUnitId())).findFirst().orElse(null);
// s.setResidentUnitText(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
// }
costPayFeeAuditVoList.add(s);
});
Page<CostPayFeeAuditVo> costPayFeeAuditVoPage = new Page<CostPayFeeAuditVo>()

View File

@@ -64,6 +64,7 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
private final AttendanceUserGroupMapper attendanceUserGroupMapper;
@DubboReference
private RemoteUserService remoteUserService;
/**
* 查询巡检明细
*
@@ -108,14 +109,14 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
Map<Long, String> pointNameMap = inspectionPointMapper.selectVoByIds(pointIds).stream()
.collect(Collectors.toMap(InspectionPointVo::getId, InspectionPointVo::getPointName));
result.getRecords().stream().forEach(vo -> {
disposeData(vo,taskNameMap,routeNameMap,planNameMap,pointNameMap);
disposeData(vo, taskNameMap, routeNameMap, planNameMap, pointNameMap);
});
}
return TableDataInfo.build(result);
}
private void disposeData(InspectionTaskDetailVo vo,Map<Long, String> taskNameMap,Map<Long, String> routeNameMap, Map<Long, String> planNameMap,Map<Long, String> pointNameMap ) {
private void disposeData(InspectionTaskDetailVo vo, Map<Long, String> taskNameMap, Map<Long, String> routeNameMap, Map<Long, String> planNameMap, Map<Long, String> pointNameMap) {
vo.setTaskText(taskNameMap.get(vo.getTaskId()));
vo.setRouteText(routeNameMap.get(vo.getRouteId()));
vo.setPlanText(planNameMap.get(vo.getPlanId()));
@@ -351,6 +352,13 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean reportedOrder(InspectionTaskDetailToOrderBo bo) {
//修改巡检明细接口绑定工单id
boolean exists = baseMapper.exists(
new LambdaQueryWrapper<InspectionTaskDetail>()
.eq(InspectionTaskDetail::getPointId, bo.getPointId())
.isNotNull(InspectionTaskDetail::getOrderId) // 判断 fieldName 字段不为 null
);
Assert.isTrue(!exists, "该巡检点已提报工单,请勿重复提报");
//查询工单类型
ServiceWorkOrdersType serviceWorkOrdersType = typesMapper.selectById(bo.getOrderTypeId());
ServiceWorkOrders serviceWorkOrders = new ServiceWorkOrders();
@@ -369,7 +377,9 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
serviceWorkOrders.setPlanCompleTime(newDate);
boolean flag = serviceWorkOrdersMapper.insert(serviceWorkOrders) > 0;
if (flag) {
bo.setId(serviceWorkOrders.getId());
InspectionTaskDetail inspectionTaskDetail = baseMapper.selectById(bo.getId());
inspectionTaskDetail.setOrderId(serviceWorkOrders.getId());
baseMapper.updateById(inspectionTaskDetail);
ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord();
serviceWorkOrdersRecord.setOrderId(serviceWorkOrders.getId());
serviceWorkOrdersRecord.setStatus(serviceWorkOrders.getStatus());
@@ -379,10 +389,6 @@ public class InspectionTaskDetailServiceImpl implements IInspectionTaskDetailSer
if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) {
handleServiceWorkOrder(serviceWorkOrders, serviceWorkOrdersType, bo);
}
//修改巡检明细接口绑定工单id
InspectionTaskDetail update = BeanUtil.copyProperties(bo, InspectionTaskDetail.class);
update.setOrderId(serviceWorkOrders.getId());
baseMapper.updateById(update);
}
}
return flag;

View File

@@ -80,8 +80,6 @@ public class TbFloorServiceImpl implements ITbFloorService {
List<Long> communityIds = result.getRecords().stream().map(TbFloorVo::getCommunityId).toList();
//查询园区为map
Map<Long, String> pointNameMap = tbCommunityMapper.selectVoByIds(communityIds).stream().collect(Collectors.toMap(TbCommunityVo::getId, TbCommunityVo::getCommunityName));
//收集建筑id
List<Long> buildingIds = result.getRecords().stream().map(TbFloorVo::getBuildingId).toList();
//查询建筑为map
@@ -107,7 +105,21 @@ public class TbFloorServiceImpl implements ITbFloorService {
@Override
public List<TbFloorVo> queryList(TbFloorBo bo) {
LambdaQueryWrapper<TbFloor> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
List<TbFloorVo> result = baseMapper.selectVoList(lqw);
if (CollUtil.isNotEmpty(result)) {
//收集园区id
List<Long> communityIds = result.stream().map(TbFloorVo::getCommunityId).toList();
//查询园区为map
Map<Long, String> pointNameMap = tbCommunityMapper.selectVoByIds(communityIds).stream().collect(Collectors.toMap(TbCommunityVo::getId, TbCommunityVo::getCommunityName));
//收集建筑id
List<Long> buildingIds = result.stream().map(TbFloorVo::getBuildingId).toList();
//查询建筑为map
Map<Long, String> buildingNameMap = tbBuildingMapper.selectVoByIds(buildingIds).stream().collect(Collectors.toMap(TbBuildingVo::getId, TbBuildingVo::getBuildingName));
result.stream().forEach(s -> {
handleData(s, pointNameMap, buildingNameMap);
});
}
return result;
}
private LambdaQueryWrapper<TbFloor> buildQueryWrapper(TbFloorBo bo) {

View File

@@ -12,17 +12,17 @@ import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.property.domain.TbBuilding;
import org.dromara.property.domain.TbCommunity;
import org.dromara.property.domain.TbRoom;
import org.dromara.property.domain.bo.TbFloorBo;
import org.dromara.property.domain.bo.TbRoomBo;
import org.dromara.property.domain.entity.resident.ResidentUnit;
import org.dromara.property.domain.vo.TbBuildingVo;
import org.dromara.property.domain.vo.TbCommunityVo;
import org.dromara.property.domain.vo.TbFloorVo;
import org.dromara.property.domain.vo.TbRoomVo;
import org.dromara.property.mapper.ResidentUnitMapper;
import org.dromara.property.mapper.TbBuildingMapper;
import org.dromara.property.mapper.TbCommunityMapper;
import org.dromara.property.mapper.TbRoomMapper;
import org.dromara.property.mapper.*;
import org.dromara.property.service.ITbFloorService;
import org.dromara.property.service.ITbRoomService;
import org.springframework.stereotype.Service;
@@ -45,6 +45,7 @@ public class TbRoomServiceImpl implements ITbRoomService {
private final TbRoomMapper baseMapper;
private final ITbFloorService tbFloorService;
private final TbFloorMapper tbFloorMapper;
private final TbBuildingMapper tbBuildingMapper;
private final TbCommunityMapper tbCommunityMapper;
private final ResidentUnitMapper residentUnitMapper;
@@ -61,7 +62,7 @@ public class TbRoomServiceImpl implements ITbRoomService {
//查询园区id
TbCommunityVo tbCommunityVo = tbCommunityMapper.selectVoById(tbRoomVo.getCommunityId());
tbRoomVo.setCommunityText(ObjectUtil.isNotEmpty(tbCommunityVo) ? tbCommunityVo.getCommunityName() : null);
//查询楼栋id
//查询建筑id
TbBuildingVo tbBuildingVo = tbBuildingMapper.selectVoById(tbRoomVo.getBuildingId());
tbRoomVo.setBuildingText(ObjectUtil.isNotEmpty(tbBuildingVo) ? tbBuildingVo.getBuildingName() : null);
//查询楼栋信息
@@ -102,7 +103,42 @@ public class TbRoomServiceImpl implements ITbRoomService {
@Override
public List<TbRoomVo> queryList(TbRoomBo bo) {
LambdaQueryWrapper<TbRoom> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
List<TbRoomVo> tbRoomVos = baseMapper.selectVoList(lqw);
if (CollUtil.isNotEmpty(tbRoomVos)) {
//收集园区 id
List<Long> communityIds = tbRoomVos.stream().map(TbRoomVo::getCommunityId).toList();
Map<Long, String> communityMap = tbCommunityMapper.selectVoByIds(communityIds).stream().collect(Collectors.toMap(TbCommunityVo::getId, TbCommunityVo::getCommunityName));
//收集建筑 id
List<Long> buildingIds = tbRoomVos.stream().map(TbRoomVo::getBuildingId).toList();
Map<Long, String> buildingMap = tbBuildingMapper.selectVoByIds(buildingIds).stream().collect(Collectors.toMap(TbBuildingVo::getId, TbBuildingVo::getBuildingName));
//查询楼栋信息
List<Long> floorIds = tbRoomVos.stream().map(TbRoomVo::getFloorId).toList();
Map<Long, String> floorMap = tbFloorMapper.selectVoByIds(floorIds).stream().collect(Collectors.toMap(TbFloorVo::getId, TbFloorVo::getFloorName));
tbRoomVos.stream().forEach(tbRoomVo -> {
processingData(tbRoomVo, communityMap, buildingMap, floorMap);
});
}
return tbRoomVos;
}
/**
* 处理数据
*/
private void processingData(TbRoomVo tbRoomVo,Map<Long, String> communityMap, Map<Long, String> buildingMap, Map<Long, String> floorMap) {
tbRoomVo.setCommunityText(communityMap.get(tbRoomVo.getCommunityId()));
tbRoomVo.setBuildingText(buildingMap.get(tbRoomVo.getBuildingId()));
tbRoomVo.setFloorText(floorMap.get(tbRoomVo.getFloorId()));
List<ResidentUnit> residentUnits = residentUnitMapper.selectList(
new LambdaQueryWrapper<ResidentUnit>()
.like(ResidentUnit::getLocation, tbRoomVo.getId())
.orderByDesc(ResidentUnit::getCreateTime)
);
if (CollUtil.isNotEmpty(residentUnits)) {
//多个yi,拼接
tbRoomVo.setResidentUnitText(residentUnits.stream().map(ResidentUnit::getName).collect(Collectors.joining(",")));
}
}
private LambdaQueryWrapper<TbRoom> buildQueryWrapper(TbRoomBo bo) {

View File

@@ -2,6 +2,7 @@ package org.dromara.property.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.dubbo.config.annotation.DubboReference;
@@ -18,8 +19,8 @@ import lombok.extern.slf4j.Slf4j;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.property.api.model.LoginResidentPerson;
import org.dromara.property.domain.TbUserGroup;
import org.dromara.property.domain.bo.QrCodeInfo;
import org.dromara.property.domain.vo.BigScreen.TodayVisitorCountVo;
import org.dromara.property.domain.vo.residentVo.ResidentPersonVo;
import org.dromara.property.service.residentService.IResidentPersonService;
import org.dromara.resource.api.RemoteFileService;
@@ -27,7 +28,6 @@ import org.dromara.sis.api.RemoteVisitorService;
import org.dromara.sis.api.domain.RemoteVisitor;
import org.dromara.system.api.RemoteUserService;
import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.dromara.property.domain.bo.TbVisitorManagementBo;
import org.dromara.property.domain.vo.TbVisitorManagementVo;
@@ -36,9 +36,13 @@ import org.dromara.property.mapper.TbVisitorManagementMapper;
import org.dromara.property.service.ITbVisitorManagementService;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.time.LocalDate;
import java.time.YearMonth;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 访客管理Service业务层处理
@@ -114,6 +118,7 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi
lqw.orderByDesc(TbVisitorManagement::getCreateTime)
.orderByDesc(TbVisitorManagement::getUpdateTime);
lqw.like(StringUtils.isNotBlank(bo.getVisitorName()), TbVisitorManagement::getVisitorName, bo.getVisitorName());
lqw.like(ObjectUtil.isNotNull(bo.getType()), TbVisitorManagement::getType, bo.getType());
lqw.eq(StringUtils.isNotBlank(bo.getVisitorUnit()), TbVisitorManagement::getVisitorUnit, bo.getVisitorUnit());
lqw.eq(StringUtils.isNotBlank(bo.getVisitorPhone()), TbVisitorManagement::getVisitorPhone, bo.getVisitorPhone());
lqw.eq(StringUtils.isNotBlank(bo.getVisitingReason()), TbVisitorManagement::getVisitingReason, bo.getVisitingReason());
@@ -368,4 +373,63 @@ public class TbVisitorManagementServiceImpl implements ITbVisitorManagementServi
Assert.notNull(vo, "数据不存在");
return remoteVisitorService.getQrCode(vo.getEEightId());
}
/**
* 大屏访客记录统计
*/
@Override
public List<TodayVisitorCountVo> todayVisitorCount() {
LocalDate now = LocalDate.now();
YearMonth currentMonth = YearMonth.of(now.getYear(), now.getMonth());
LocalDate startOfMonth = currentMonth.atDay(1);
LocalDate endOfMonth = currentMonth.atEndOfMonth();
// 查询当月访客数据
List<TbVisitorManagement> tbVisitorManagements = baseMapper.selectList();
// ====== 初始化两个 LinkedHashMap保持日期顺序 ======
Map<String, Integer> visitMap = new LinkedHashMap<>();
Map<String, Integer> inviteMap = new LinkedHashMap<>();
// 生成当月所有日期,并初始化为 0
Stream.iterate(startOfMonth, date -> date.plusDays(1))
.limit(ChronoUnit.DAYS.between(startOfMonth, endOfMonth) + 1)
.map(LocalDate::toString)
.forEach(dateStr -> {
visitMap.put(dateStr, 0);
inviteMap.put(dateStr, 0);
});
// ====== 遍历数据,按 type 统计 ======
for (TbVisitorManagement v : tbVisitorManagements) {
if (v.getCreateTime() == null || v.getType() == null) continue;
LocalDate date = v.getCreateTime().toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
// 只统计当月数据
if (date.isBefore(startOfMonth) || date.isAfter(endOfMonth)) continue;
String dateStr = date.toString();
if ("0".equals(v.getType())) {
visitMap.put(dateStr, visitMap.get(dateStr) + 1);
} else if ("1".equals(v.getType())) {
inviteMap.put(dateStr, inviteMap.get(dateStr) + 1);
}
}
// ====== 封装 VO 返回 ======
List<TodayVisitorCountVo> result = new ArrayList<>();
result.add(new TodayVisitorCountVo()
.setType("访客")
.setTodayCounts(visitMap) // LinkedHashMap 保证顺序
);
result.add(new TodayVisitorCountVo()
.setType("邀约")
.setTodayCounts(inviteMap) // LinkedHashMap 保证顺序
);
return result;
}
}