feat(device): 添加设备使用年限和维护状态功能
- 在FwDeviceDTO、FwDeviceEntity、FwDeviceExcel中新增useDate和serviceLife字段
- 在FwDeviceMapper.xml中添加数据库映射和查询条件
- 在FwDevicePageParam和FwDeviceVO中增加相应的参数和返回字段
- 实现维护状态计算逻辑,根据使用日期和服务年限判断是否需要维护
- 在GdManageDevice相关类中添加maintenanceState字段支持设备维护状态
- 在工单模块中增加typePinyinFirst字段支持工单类型拼音首字母排序
- 优化飞手查询功能,按擅长任务类型进行排序
- 修复部门ID解析问题,支持逗号分隔的多个部门ID情况
| | |
| | | package org.sxkj.fw.device.dto; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @ApiModelProperty(value = " flyTime") |
| | | private Date flyTime; |
| | | |
| | | /** |
| | | * 使用日期 |
| | | */ |
| | | @ApiModelProperty(value = "使用日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date useDate; |
| | | |
| | | /** |
| | | * 使用年限(单位:年) |
| | | */ |
| | | @ApiModelProperty(value = "使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | |
| | | } |
| | |
| | | package org.sxkj.fw.device.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 设备表 实体类 |
| | |
| | | @ApiModelProperty(value = "是否启用:1启用 0禁用") |
| | | private Integer isEnabled; |
| | | |
| | | /** |
| | | * 使用日期 |
| | | */ |
| | | @ApiModelProperty(value = "使用日期") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date useDate; |
| | | |
| | | /** |
| | | * 使用年限(单位:年) |
| | | */ |
| | | @ApiModelProperty(value = "使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | |
| | | } |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | |
| | | @ExcelProperty("删除标志(0存在 1删除)") |
| | | private Byte isDeleted; |
| | | |
| | | /** |
| | | * 使用日期 |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("使用日期") |
| | | private Date useDate; |
| | | |
| | | /** |
| | | * 使用年限(单位:年) |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | |
| | | } |
| | |
| | | <result column="update_user" property="updateUser"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="status" property="status"/> |
| | | <result column="use_date" property="useDate"/> |
| | | <result column="service_life" property="serviceLife"/> |
| | | <!-- <result column="is_deleted" property="isDeleted"/>--> |
| | | </resultMap> |
| | | |
| | |
| | | </if> |
| | | <if test="param2.belongDept != null and param2.belongDept != ''"> |
| | | and belong_dept::text = #{param2.belongDept}::text |
| | | </if> |
| | | <if test="param2.useDate != null"> |
| | | and use_date = #{param2.useDate} |
| | | </if> |
| | | <if test="param2.serviceLife != null"> |
| | | and service_life = #{param2.serviceLife} |
| | | </if> |
| | | <if test="param2.deviceStatusList != null and param2.deviceStatusList != ''"> |
| | | and status::text in |
| | |
| | | d.update_time, |
| | | d.status, |
| | | d.is_deleted, |
| | | d.use_date, |
| | | d.service_life, |
| | | NULLIF(trim(d.latitude::text), '')::double precision AS latitude, |
| | | NULLIF(trim(d.longitude::text), '')::double precision AS longitude, |
| | | min(ad.id) as area_divide_id, |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "设备状态,多个状态用逗号隔开") |
| | | private List<String> deviceStatusList; |
| | | |
| | | /** |
| | | * 使用日期 |
| | | */ |
| | | @ApiModelProperty(value = "使用日期") |
| | | private Date useDate; |
| | | |
| | | /** |
| | | * 使用年限(单位:年) |
| | | */ |
| | | @ApiModelProperty(value = "使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "最终出库区域") |
| | | private String finalOutboundArea; |
| | | |
| | | /** |
| | | * 使用日期 |
| | | */ |
| | | @ApiModelProperty(value = "使用日期") |
| | | private Date useDate; |
| | | |
| | | /** |
| | | * 使用年限(单位:年) |
| | | */ |
| | | @ApiModelProperty(value = "使用年限(单位:年)") |
| | | private Integer serviceLife; |
| | | |
| | | /** |
| | | * 维护状态:0-否,1-是(一个月内要到使用年限) |
| | | */ |
| | | @ApiModelProperty(value = "维护状态:0-否,1-是(一个月内要到使用年限)") |
| | | private Integer maintenanceStatus; |
| | | } |
| | |
| | | import org.sxkj.fw.device.dto.FwDeviceDTO; |
| | | import org.sxkj.fw.device.entity.FwDeviceEntity; |
| | | import org.sxkj.fw.device.vo.FwDeviceVO; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public FwDeviceVO entityVO(FwDeviceEntity fwDevice) { |
| | | return Objects.requireNonNull(BeanUtil.copy(fwDevice, FwDeviceVO.class)); |
| | | FwDeviceVO vo = Objects.requireNonNull(BeanUtil.copy(fwDevice, FwDeviceVO.class)); |
| | | // 计算维护状态 |
| | | vo.setMaintenanceStatus(calculateMaintenanceStatus(fwDevice.getUseDate(), fwDevice.getServiceLife())); |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 计算维护状态 |
| | | * |
| | | * @param useDate 使用日期 |
| | | * @param serviceLife 使用年限(单位:年) |
| | | * @return 维护状态:0-否,1-是(一个月内要到使用年限或已过期) |
| | | */ |
| | | private Integer calculateMaintenanceStatus(Date useDate, Integer serviceLife) { |
| | | // 1. 参数校验:如果使用日期或使用年限为空,返回0 |
| | | if (useDate == null || serviceLife == null || serviceLife <= 0) { |
| | | return 0; |
| | | } |
| | | |
| | | // 2. 计算到期日期:使用日期 + 使用年限 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(useDate); |
| | | calendar.add(Calendar.YEAR, serviceLife); |
| | | Date expiryDate = calendar.getTime(); |
| | | |
| | | // 3. 计算当前日期 |
| | | Date currentDate = new Date(); |
| | | |
| | | // 4. 如果当前日期已经超过到期日期,返回1(已过期) |
| | | if (currentDate.after(expiryDate)) { |
| | | return 1; |
| | | } |
| | | |
| | | // 5. 计算距离到期日期的时间差(毫秒) |
| | | long diffInMillis = expiryDate.getTime() - currentDate.getTime(); |
| | | |
| | | // 6. 一个月的毫秒数(按30天计算) |
| | | long oneMonthInMillis = 30L * 24 * 60 * 60 * 1000; |
| | | |
| | | // 7. 如果距离到期日期在一个月内,返回1;否则返回0 |
| | | return diffInMillis <= oneMonthInMillis ? 1 : 0; |
| | | } |
| | | |
| | | public FwDeviceEntity entityDTO(FwDeviceDTO fwDevice) { |
| | |
| | | @Service |
| | | public class GdFlyerServiceImpl extends BaseServiceImpl<GdFlyerMapper, GdFlyerEntity> implements IGdFlyerService { |
| | | |
| | | /** |
| | | * 分页查询飞手信息列表 |
| | | * @param page 分页对象 |
| | | * @param gdFlyer 查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @Override |
| | | public IPage<GdFlyerVO> selectGdFlyerPage(IPage<GdFlyerVO> page, GdFlyerPageParam gdFlyer) { |
| | | return page.setRecords(baseMapper.selectGdFlyerPage(page, gdFlyer)); |
| | | // 步骤1:执行数据库查询获取飞手列表 |
| | | List<GdFlyerVO> gdFlyerVOS = baseMapper.selectGdFlyerPage(page, gdFlyer); |
| | | |
| | | // 步骤2:判断是否有擅长任务类型的查询条件 |
| | | if (StringUtil.isNotBlank(gdFlyer.getSkilledTaskType())) { |
| | | // 步骤3:获取查询的任务类型 |
| | | String searchTaskType = gdFlyer.getSkilledTaskType(); |
| | | |
| | | // 步骤4:对结果进行排序,匹配的记录排在前面 |
| | | gdFlyerVOS.sort((vo1, vo2) -> { |
| | | // 步骤5:检查记录1是否包含查询的任务类型 |
| | | boolean match1 = containsTaskType(vo1.getSkilledTaskType(), searchTaskType); |
| | | // 步骤6:检查记录2是否包含查询的任务类型 |
| | | boolean match2 = containsTaskType(vo2.getSkilledTaskType(), searchTaskType); |
| | | // 步骤7:匹配的记录排在前面(降序排列) |
| | | return Boolean.compare(match2, match1); |
| | | }); |
| | | } |
| | | |
| | | return page.setRecords(gdFlyerVOS); |
| | | } |
| | | |
| | | /** |
| | | * 检查任务类型列表中是否包含指定的任务类型 |
| | | * @param skilledTaskTypes 擅长的任务类型列表(二维数组) |
| | | * @param searchTaskType 要搜索的任务类型 |
| | | * @return 包含返回true,否则返回false |
| | | */ |
| | | private boolean containsTaskType(List<List<String>> skilledTaskTypes, String searchTaskType) { |
| | | // 步骤1:校验参数有效性 |
| | | if (skilledTaskTypes == null || StringUtil.isBlank(searchTaskType)) { |
| | | return false; |
| | | } |
| | | // 步骤2:遍历二维数组,检查是否包含目标任务类型 |
| | | return skilledTaskTypes.stream() |
| | | .anyMatch(innerList -> innerList != null && innerList.contains(searchTaskType)); |
| | | } |
| | | |
| | | |
| | |
| | | ) |
| | | private Date trafficExpireTime; |
| | | |
| | | /** |
| | | * 设备维护状态{0:无需保养,1:待保养,2:正在保养} |
| | | */ |
| | | @ApiModelProperty(value = "设备维护状态{0:无需保养,1:待保养,2:正在保养}") |
| | | private Integer maintenanceState; |
| | | |
| | | } |
| | |
| | | private String regionCode; |
| | | |
| | | @ApiModelProperty("部门id") |
| | | private Long deptId; |
| | | private String deptId; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | |
| | | |
| | | @ApiModelProperty("负载序号") |
| | | private String loadIndex; |
| | | |
| | | /** |
| | | * 设备维护状态{0:无需保养,1:待保养,2:正在保养} |
| | | */ |
| | | @ApiModelProperty("设备维护状态{0:无需保养,1:待保养,2:正在保养}") |
| | | private Integer maintenanceState; |
| | | } |
| | |
| | | private String regionCode; |
| | | |
| | | @ApiModelProperty("部门id") |
| | | private Long deptId; |
| | | private String deptId; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | |
| | | |
| | | @ApiModelProperty("清晰度") |
| | | private Integer liveClarity; |
| | | |
| | | /** |
| | | * 设备维护状态{0:无需保养,1:待保养,2:正在保养} |
| | | */ |
| | | @ApiModelProperty("设备维护状态{0:无需保养,1:待保养,2:正在保养}") |
| | | private Integer maintenanceState; |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "是否在机巢中0:是1否") |
| | | private Integer isWithDock; |
| | | /** |
| | | * 设备维护状态{O:无需保养,1:待保养2:正在保养} |
| | | * maintenance_state |
| | | */ |
| | | @ApiModelProperty(value = "设备维护状态{O:无需保养,1:待保养2:正在保养") |
| | | private Integer maintenanceState; |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(value = "work_order_type", typeHandler = GenericListTypeHandler.class) |
| | | private List<List<String>> workOrderType; |
| | | /** |
| | | * 工单类型拼音首字母(用于排序,如:B、L、Z) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型拼音首字母(用于排序,如:B、L、Z)") |
| | | @TableField("type_pinyin_first") |
| | | private String typePinyinFirst; |
| | | /** |
| | | * 设备负载需求(红外、喊话器、探照灯) |
| | | */ |
| | | @ApiModelProperty(value = "设备负载需求(红外、喊话器、探照灯)") |
| | |
| | | @ExcelProperty("DEM数据状态:0-未初始化,1-初始化中,2-初始化成功,3-初始化失败") |
| | | private Integer demStatus; |
| | | |
| | | /** |
| | | * 设备维护状态{0:无需保养,1:待保养,2:正在保养} |
| | | */ |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("设备维护状态{0:无需保养,1:待保养,2:正在保养}") |
| | | private Integer maintenanceState; |
| | | |
| | | } |
| | |
| | | <if test="onlyMine != null and onlyMine == 1"> |
| | | and ce.dispose_user = #{userId} |
| | | </if> |
| | | order by ce.create_time desc |
| | | </select> |
| | | |
| | | <select id="selectGdClueEventDetailById" resultMap="gdClueEventVoResultMap"> |
| | |
| | | <result column="mode_code" property="modeCode"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="device_dept_name" property="deviceDeptName"/> |
| | | <result column="maintenance_state" property="maintenanceState"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap"> |
| | | select |
| | | md.*, |
| | | md.id, |
| | | md.device_sn, |
| | | md.device_name, |
| | | md.nickname, |
| | | md.device_payload, |
| | | md.longitude, |
| | | md.latitude, |
| | | md.mode_code, |
| | | md.create_time, |
| | | md.maintenance_state, |
| | | bd.dept_name as device_dept_name |
| | | from |
| | | ja_gd_manage_device md |
| | |
| | | <if test="param2.deviceType != null and param2.deviceType != ''"> |
| | | and md.device_type::text = #{param2.deviceType}::text |
| | | </if> |
| | | <if test="param2.maintenanceState != null"> |
| | | and md.maintenance_state = #{param2.maintenanceState} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | <result column="work_order_name" property="workOrderName"/> |
| | | <result column="work_order_code" property="workOrderCode"/> |
| | | <result column="work_order_type" property="workOrderType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/> |
| | | <result column="type_pinyin_first" property="typePinyinFirst"/> |
| | | <result column="device_load_demand" property="deviceLoadDemand"/> |
| | | <result column="recommend_device_ids" property="recommendDeviceIds"/> |
| | | <result column="work_order_status" property="workOrderStatus"/> |
| | |
| | | work_order_name, |
| | | work_order_code, |
| | | work_order_type, |
| | | type_pinyin_first, |
| | | device_load_demand, |
| | | recommend_device_ids, |
| | | work_order_status, |
| | |
| | | work_order_name, |
| | | work_order_code, |
| | | work_order_type, |
| | | type_pinyin_first, |
| | | device_load_demand, |
| | | recommend_device_ids, |
| | | work_order_status, |
| | |
| | | wo.work_order_name, |
| | | wo.work_order_code, |
| | | wo.work_order_type, |
| | | wo.type_pinyin_first, |
| | | wo.device_load_demand, |
| | | wo.recommend_device_ids, |
| | | wo.work_order_status, |
| | |
| | | <if test="param2.workOrderName != null and param2.workOrderName != ''"> |
| | | and wo.work_order_name like concat('%',#{param2.workOrderName},'%') |
| | | </if> |
| | | <if test="param2.workOrderCode != null and param2.workOrderCode != ''"> |
| | | and wo.work_order_code like concat('%',#{param2.workOrderCode},'%') |
| | | </if> |
| | | <if test="param2.workOrderType != null and param2.workOrderType != ''"> |
| | | /* 将逗号分隔的字符串转换为带引号的格式,如 "road,road1" 转为 "\"road\",\"road1\"" */ |
| | | and wo.work_order_type like concat('%', |
| | |
| | | /* 修改点2:过滤条件也进行类型对齐 */ |
| | | and wo.create_user::VARCHAR = #{param2.createUser}::VARCHAR |
| | | </if> |
| | | <if test="param2.createUserName != null and param2.createUserName != ''"> |
| | | and bu.name like concat('%',#{param2.createUserName},'%') |
| | | </if> |
| | | <if test="param2.serviceParty != null and param2.serviceParty != ''"> |
| | | and wo.service_party like concat('%',#{param2.serviceParty},'%') |
| | | </if> |
| | | <if test="param2.startTime != null and param2.startTime != '' and param2.endTime != null and param2.endTime != ''"> |
| | | and wo.execute_start_time <= #{param2.endTime}::timestamp AND wo.execute_end_time >= #{param2.startTime}::timestamp |
| | | </if> |
| | |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | <!-- 按工单类型拼音首字母排序,然后按 createTime 排序 --> |
| | | ORDER BY |
| | | <choose> |
| | | <when test="param2.typePinyinFirst == 'desc'"> |
| | | wo.type_pinyin_first DESC , |
| | | </when> |
| | | <when test="param2.typePinyinFirst == 'asc'"> |
| | | wo.type_pinyin_first ASC , |
| | | </when> |
| | | <otherwise> |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="param2.createTimeOrder == 'asc'"> |
| | | wo.create_time ASC |
| | | </when> |
| | | <otherwise> |
| | | wo.create_time DESC |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | |
| | | |
| | |
| | | |
| | | <!-- 自定义插入语句,使用ST_GeomFromText处理几何数据 --> |
| | | <insert id="saveWorkOrder" parameterType="org.sxkj.gd.workorder.entity.GdWorkOrderEntity"> |
| | | INSERT INTO ja_gd_work_order ( work_order_name, work_order_code, work_order_type, |
| | | INSERT INTO ja_gd_work_order ( work_order_name, work_order_code, work_order_type, type_pinyin_first, |
| | | device_load_demand, recommend_device_ids, work_order_status, |
| | | execute_start_time, execute_end_time, service_party, |
| | | geom, remark, area_code, |
| | | create_user, create_dept, create_time, |
| | | update_user, update_time, status, is_deleted) |
| | | VALUES ( #{workOrderParam.workOrderName}, #{workOrderParam.workOrderCode}, #{workOrderParam.workOrderType}, |
| | | #{workOrderParam.typePinyinFirst}, |
| | | #{workOrderParam.deviceLoadDemand}, #{workOrderParam.recommendDeviceIds}, #{workOrderParam.workOrderStatus}, |
| | | #{workOrderParam.executeStartTime}, #{workOrderParam.executeEndTime}, #{workOrderParam.serviceParty}, |
| | | ST_GeomFromText(#{workOrderParam.geom}), #{workOrderParam.remark}, #{workOrderParam.areaCode}, |
| | |
| | | <if test="workOrderParam.workOrderType != null and workOrderParam.workOrderType != ''"> |
| | | work_order_type = #{workOrderParam.workOrderType}, |
| | | </if> |
| | | <if test="workOrderParam.typePinyinFirst != null and workOrderParam.typePinyinFirst != ''"> |
| | | type_pinyin_first = #{workOrderParam.typePinyinFirst}, |
| | | </if> |
| | | <if test="workOrderParam.deviceLoadDemand != null and workOrderParam.deviceLoadDemand != ''"> |
| | | device_load_demand = #{workOrderParam.deviceLoadDemand}, |
| | | </if> |
| | |
| | | */ |
| | | @ApiModelProperty(value = "状态 0 在线 1离线") |
| | | private String modeCode; |
| | | // maintenanceState |
| | | @ApiModelProperty(value = "设备状态 0 在线 1离线") |
| | | private String maintenanceState; |
| | | |
| | | } |
| | |
| | | // @NotNull |
| | | private List<List<String>> workOrderType; |
| | | /** |
| | | * 工单类型拼音首字母(用于排序,如:B、L、Z) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型拼音首字母(用于排序,如:B、L、Z)") |
| | | private String typePinyinFirst; |
| | | /** |
| | | * 设备负载需求(红外、喊话器、探照灯) |
| | | */ |
| | | @ApiModelProperty(value = "设备负载需求(1.红外、2.喊话器、3.探照灯)") |
| | |
| | | private String workOrderName; |
| | | |
| | | /** |
| | | * 工单编号 |
| | | */ |
| | | @ApiModelProperty(value = "工单编号") |
| | | private String workOrderCode; |
| | | |
| | | /** |
| | | * 工单类型(巡查类/安检类等) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型(1.巡查类/2.安检类等)") |
| | | @NotNull |
| | | private String workOrderType; |
| | | |
| | | /** |
| | | * 工单类型拼音首字母(用于查询和排序) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型拼音首字母(如:B、L、Z)") |
| | | private String typePinyinFirst; |
| | | |
| | | @ApiModelProperty(value = "工单状态:0草稿、10发布中_接单中、11发布中_拒绝接单、20响应中_待拆分、21响应中_申请取消、22响应中_申请修改、23响应中_已取消、24响应中_拒绝取消、25响应中_拒绝修改 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、50验收通过_待结算、60结算完成_已结算") |
| | | @NotNull |
| | |
| | | |
| | | @ApiModelProperty(value = "创建人") |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * 创建人姓名 |
| | | */ |
| | | @ApiModelProperty(value = "创建人姓名") |
| | | private String createUserName; |
| | | |
| | | /** |
| | | * 服务方 |
| | | */ |
| | | @ApiModelProperty(value = "服务方") |
| | | private String serviceParty; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private String startTime; |
| | |
| | | @ApiModelProperty(value = "是否查询所有:默认true 审核方可以查询所有数据,不做机构过滤") |
| | | private Boolean isQueryAll = true; |
| | | |
| | | /** |
| | | * 工单类型拼音首字母排序方式 |
| | | * 可选值:asc(升序)、desc(降序) |
| | | * 默认值:asc(升序) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型拼音首字母排序方式,可选值:asc(升序)、desc(降序),默认:asc") |
| | | private String typePinyinFirstOrder; |
| | | |
| | | /** |
| | | * 创建时间排序方式 |
| | | * 可选值:asc(升序)、desc(降序) |
| | | * 默认值:desc(降序) |
| | | */ |
| | | @ApiModelProperty(value = "创建时间排序方式,可选值:asc(升序)、desc(降序),默认:desc") |
| | | private String createTimeOrder; |
| | | |
| | | @ApiModelProperty(value = "部门集合",hidden = true) |
| | | private List<Long> deptList; |
| | | } |
| | |
| | | entity.setInsureExpiredTime(parseInsuranceDate(item.getInsuranceInfo())); |
| | | entity.setAreaCode(extractAreaCode(item.getRegionCode())); |
| | | entity.setIsWithDock(item.getIsWithDock()); |
| | | entity.setCreateDept(item.getDeptId()); |
| | | entity.setCreateDept(parseDeptId(item.getDeptId())); |
| | | entity.setMaintenanceState(item.getMaintenanceState()); |
| | | entity.setDevicePayload( |
| | | Optional.ofNullable(item.getLoadList()) |
| | | .orElse(Collections.emptyList()) |
| | |
| | | entity.setInsureExpiredTime(parseInsuranceDate(item.getInsuranceInfo())); |
| | | entity.setAreaCode(extractAreaCode(item.getRegionCode())); |
| | | entity.setHeight(item.getHeight()); |
| | | entity.setCreateDept(item.getDeptId()); |
| | | entity.setCreateDept(parseDeptId(item.getDeptId())); |
| | | entity.setMaintenanceState(item.getMaintenanceState()); |
| | | return entity; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 解析部门ID字符串,处理逗号分隔的情况 |
| | | * 星图接口可能返回逗号分隔的多个部门ID,这里只取第一个 |
| | | * |
| | | * @param deptIdStr 部门ID字符串,可能包含逗号分隔的多个ID |
| | | * @return 第一个部门ID,解析失败返回null |
| | | */ |
| | | private Long parseDeptId(String deptIdStr) { |
| | | // 1. 参数校验 |
| | | if (StringUtil.isBlank(deptIdStr)) { |
| | | return null; |
| | | } |
| | | try { |
| | | // 2. 处理逗号分隔的情况,只取第一个ID |
| | | String firstDeptId = deptIdStr.split(",")[0].trim(); |
| | | // 3. 转换为Long类型 |
| | | return Long.valueOf(firstDeptId); |
| | | } catch (NumberFormatException e) { |
| | | // 4. 记录日志并返回null |
| | | log.warn("解析部门ID失败,deptIdStr: {}", deptIdStr, e); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 解析星图接口返回的列表数据 |
| | | * |
| | | * @param response 接口响应 |
| | |
| | | @ApiModelProperty(value = "设备高度") |
| | | private Double height; |
| | | |
| | | /** |
| | | * 设备维护状态{0:无需保养,1:待保养,2:正在保养} |
| | | */ |
| | | @ApiModelProperty(value = "设备维护状态{0:无需保养,1:待保养,2:正在保养}") |
| | | private Integer maintenanceState; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "工单类型(二维数组,如:[[\"road\",\"road1\"],[\"bridge\",\"bridge2\"]])") |
| | | private List<List<String>> workOrderType; |
| | | /** |
| | | * 工单类型拼音首字母(用于排序,如:B、L、Z) |
| | | */ |
| | | @ApiModelProperty(value = "工单类型拼音首字母(用于排序,如:B、L、Z)") |
| | | private String typePinyinFirst; |
| | | /** |
| | | * 设备负载需求(红外、喊话器、探照灯) |
| | | */ |