新疆aed迁移

This commit is contained in:
wanghao
2025-11-28 09:35:59 +08:00
parent 714bba6733
commit 9942105af9
4 changed files with 23 additions and 5 deletions
@@ -3,6 +3,7 @@ package com.renkang.emergency.aed.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.renkang.emergency.aed.entity.AedLocationEquipment;
import com.renkang.emergency.entity.AedEquipmentManger;
import com.renkang.emergency.aed.vo.res.manager.AEDManagerPageRes;
import com.renkang.emergency.aed.vo.res.manager.AEDPublishPageRes;
@@ -60,4 +61,6 @@ public interface AedEquipmentMangerMapper extends BaseMapper<AedEquipmentManger>
*/
@Select(value = "SELECT LEFT(depart_code,6) as orgCode, count(1) as aedCount FROM `aed_equipment_manger` where del_flag = 0 GROUP BY LEFT(depart_code,6)")
List<JSONObject> statisticAedByOrgCode();
List<AedLocationEquipment> getLocation(@Param("idList") List<Long> idList);
}
@@ -121,4 +121,12 @@
</if>
</where>
</select>
<select id="getLocation" resultType="com.renkang.emergency.aed.entity.AedLocationEquipment" parameterType="java.util.List">
SELECT *
FROM aed_location_equipment
WHERE equipment_id IN
<foreach collection="idList" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.renkang.emergency.aed.entity.AedLocationEquipment;
import com.renkang.emergency.aed.manage.AedCacheNewManager;
import com.renkang.emergency.aed.manage.AedManagerNew;
import com.renkang.emergency.aed.mapper.AedEquipmentMangerMapper;
@@ -121,7 +122,13 @@ public class AedEquipmentMangerServiceImpl extends ServiceImpl<AedEquipmentMange
if (CollectionUtil.isEmpty(pageInfo.getRecords())) {
return pageInfo;
}
List<Long> idList = pageInfo.getRecords().stream().map(AEDPublishPageRes::getId).collect(Collectors.toList());
List<AedLocationEquipment> location = aedEquipmentMangerMapper.getLocation(idList);
pageInfo.getRecords().forEach(f -> {
AedLocationEquipment aedLocationEquipment = location.stream().filter(item -> item.getEquipmentId().equals(f.getId())).findFirst().orElse(null);
if (aedLocationEquipment != null) {
f.setInstallAddress(aedLocationEquipment.getAddress());
}
// 处理部门
if (StrUtil.isNotBlank(f.getDepartCode())) {
// 二级
@@ -34,14 +34,14 @@ public class AEDPublishEquipmentReq {
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Schema(title = "布点日期")
@NotNull(message = "布点日期不能为空,请选择布点日期")
// @NotNull(message = "布点日期不能为空,请选择布点日期")
private Date installTime;
/**
* 布点位置
*/
@Excel(name = "布点位置", width = 15)
@Schema(title = "布点位置")
@NotBlank(message = "布点位置不能为空,请输入布点位置")
// @NotBlank(message = "布点位置不能为空,请输入布点位置")
private String installAddress;
/**
@@ -54,21 +54,21 @@ public class AEDPublishEquipmentReq {
*/
@Excel(name = "经度", width = 15)
@Schema(title = "经度")
@NotNull(message = "经度不能为空,请输入经度")
// @NotNull(message = "经度不能为空,请输入经度")
private Double longitude;
/**
* 纬度
*/
@Excel(name = "纬度", width = 15)
@Schema(title = "纬度")
@NotNull(message = "纬度不能为空,请输入纬度")
// @NotNull(message = "纬度不能为空,请输入纬度")
private Double latitude;
/**
* 覆盖人数
*/
@Excel(name = "覆盖人数", width = 15)
@Schema(title = "覆盖人数")
@NotNull(message = "纬度不能为空,请输入纬度")
// @NotNull(message = "纬度不能为空,请输入纬度")
private Integer coverUserNum;
@Excel(name = "负责人1", width = 15)
private String chargeFirst;