Browse Source

添加航段名称

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
ca5d1b4290
5 changed files with 174 additions and 0 deletions
  1. +19
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/dao/LegMapper.java
  2. +101
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/Leg.java
  3. +12
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java
  4. +5
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionFileInfoVo.java
  5. +37
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/LegMapper.xml

+ 19
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/dao/LegMapper.java View File

@@ -0,0 +1,19 @@
package com.tuoheng.miniprogram.dao;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.miniprogram.entity.Leg;

import java.util.List;
import java.util.Map;

/**
* @Author ChengWang
* @Date 2022/11/17
*/
public interface LegMapper extends BaseMapper<Leg> {

List<Leg> getListByMap(Map<String, Object> map);

}

+ 101
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/entity/Leg.java View File

@@ -0,0 +1,101 @@
package com.tuoheng.miniprogram.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.core.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
* @Author ChengWang
* @Date 2022/11/16
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_leg")
public class Leg extends BaseEntity {
private static final long serialVersionUID = 1L;

/**
* 租户id
*/
private String tenantId;

/**
* 航道id
*/
private String channelId;

/**
* 航段范围
*/
private String legRange;

/**
* 城市编码
*/
private String cityCode;

/**
* 起点名称
*/
private String startName;

/**
* 终点名称
*/
private String endName;

/**
* 起点经度
*/
private String startLongitude;

/**
* 起点纬度
*/
private String startLatitude;

/**
* 终点经度
*/
private String endLongitude;

/**
* 终点纬度
*/
private String endLatitude;

/**
* 备注
*/
private String remark;

/**
* 长度
*/
private String length;

/**
* 是否绑定部门 true:绑定 false:未绑定
*/
@TableField(exist = false)
private boolean relation;

/**
* 航道代号
*/
@TableField(exist = false)
private String code;

/**
* 航道名称
*/
@TableField(exist = false)
private String name;



}

+ 12
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java View File

@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -62,6 +63,9 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
@Autowired
private QuestionTypeMapper questionTypeMapper;

@Autowired
private LegMapper legMapper;

/**
* 待确认问题 status状态为5
*
@@ -469,6 +473,14 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
if (ObjectUtil.isNotNull(channel)) {
vo.setCode(channel.getCode());
}
//航段名称
Leg leg = legMapper.selectOne(new LambdaQueryWrapper<Leg>()
.eq(Leg::getId, inspection.getLegId())
.eq(Leg::getMark, MarkEnum.VALID.getCode()));
if(ObjectUtil.isNotNull(leg)){
vo.setLegRange(leg.getLegRange());
}

// 任务名称
if (StringUtils.isNotEmpty(inspection.getName())) {
vo.setName(inspection.getName());

+ 5
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/vo/InspectionFileInfoVo.java View File

@@ -38,6 +38,11 @@ public class InspectionFileInfoVo {
*/
private String code;

/**
* 航段名称
*/
private String legRange;

/**
* 任务时间(巡检执行时间)
*/

+ 37
- 0
tuoheng-service/tuoheng-miniprogram/src/main/resources/mapper/LegMapper.xml View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.miniprogram.dao.LegMapper">

<resultMap type="com.tuoheng.miniprogram.entity.Leg" id="SectionResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="channelId" column="channel_id" />
<result property="legRange" column="leg_range" />
<result property="startLongitude" column="start_longitude" />
<result property="startLatitude" column="start_latitude" />
<result property="endLongitude" column="end_longitude" />
<result property="endLatitude" column="end_latitude" />
<result property="remark" column="remark" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="mark" column="mark" />
</resultMap>

<sql id="Base_Column_List">
id, tenant_id, channel_id, leg_range, start_longitude, start_latitude, end_longitude, end_latitude, remark, create_user, create_time, update_user, update_time, mark
</sql>

<!-- 查找数据 -->
<select id="getListByMap" parameterType="hashmap" resultMap="SectionResult">
select <include refid="Base_Column_List"/>
from th_leg
where tenant_id = #{tenantId} and id in
<foreach collection="legIdList" item="legId" separator="," open="(" close=")">
#{legId}
</foreach>
</select>


</mapper>

Loading…
Cancel
Save