Newspaper 1 年之前
父節點
當前提交
153acb316a

+ 1 - 4
huimv-receive/src/main/java/com/huimv/receive/controller/BaseWashoutPointController.java

@@ -51,9 +51,6 @@ public class BaseWashoutPointController {
 
     @RequestMapping("/listDest")
     public Result listDest(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
-        String farmId = paramsMap.get("farmId");
-        return new Result(ResultCode.SUCCESS,washoutPointService.list(new QueryWrapper<BaseWashoutPoint>().lambda()
-                .like(BaseWashoutPoint::getFarmIds,farmId)
-                .orderByAsc(BaseWashoutPoint::getPointLevel)));
+       return washoutPointService.listDest(paramsMap);
     }
 }

+ 7 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/BaseWashoutPoint.java

@@ -1,5 +1,6 @@
 package com.huimv.receive.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -37,6 +38,12 @@ public class BaseWashoutPoint implements Serializable {
     private Integer locationId;
 
     /**
+     * 地点名称
+     */
+    @TableField(exist = false)
+    private String locationName;
+
+    /**
      * 所属牧场
      */
     private String farmIds;

+ 9 - 0
huimv-receive/src/main/java/com/huimv/receive/entity/vo/DestVo.java

@@ -0,0 +1,9 @@
+package com.huimv.receive.entity.vo;
+
+import lombok.Data;
+
+@Data
+public class DestVo {
+    private Integer id;
+    private String locationName;
+}

+ 3 - 0
huimv-receive/src/main/java/com/huimv/receive/mapper/BaseWashoutPointMapper.java

@@ -3,6 +3,8 @@ package com.huimv.receive.mapper;
 import com.huimv.receive.entity.BaseWashoutPoint;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface BaseWashoutPointMapper extends BaseMapper<BaseWashoutPoint> {
 
+    List<BaseWashoutPoint> listDest(String farmId, String visitingType);
 }

+ 2 - 0
huimv-receive/src/main/java/com/huimv/receive/service/IBaseWashoutPointService.java

@@ -23,4 +23,6 @@ public interface IBaseWashoutPointService extends IService<BaseWashoutPoint> {
     Result add(HttpServletRequest httpServletRequest, List<GetWashoutPointDto> washoutPointDtos);
 
     Result delete(HttpServletRequest httpServletRequest,Map<String,String> paramsMap);
+
+    Result listDest(Map<String, String> paramsMap);
 }

+ 21 - 0
huimv-receive/src/main/java/com/huimv/receive/service/impl/BaseWashoutPointServiceImpl.java

@@ -9,6 +9,7 @@ import com.huimv.receive.entity.BaseWashoutPoint;
 import com.huimv.receive.entity.dto.GetFlowListDto;
 import com.huimv.receive.entity.dto.GetWashoutPointDto;
 import com.huimv.receive.entity.dto.WashListDto;
+import com.huimv.receive.entity.vo.DestVo;
 import com.huimv.receive.mapper.BaseWashoutPointMapper;
 import com.huimv.receive.service.IBaseWashoutPointService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -108,4 +109,24 @@ public class BaseWashoutPointServiceImpl extends ServiceImpl<BaseWashoutPointMap
         return new Result(10000, "删除成功!", true);
     }
 
+    @Override
+    public Result listDest(Map<String, String> paramsMap) {
+        String farmId = paramsMap.get("farmId");
+        String visitingType = paramsMap.get("visitingType");
+        List<BaseWashoutPoint> baseWashoutPointList = washoutPointMapper.listDest(farmId,visitingType);
+        List<DestVo> destVoList = new ArrayList<>();
+        for (BaseWashoutPoint baseWashoutPoint : baseWashoutPointList) {
+            DestVo destVo = new DestVo();
+            destVo.setId(baseWashoutPoint.getId());
+            destVo.setLocationName(baseWashoutPoint.getLocationName());
+            destVoList.add(destVo);
+
+            DestVo destVo2 = new DestVo();
+            destVo2.setId(baseWashoutPoint.getId());
+            destVo2.setLocationName(baseWashoutPoint.getTailLocationName());
+            destVoList.add(destVo2);
+        }
+        return new Result(ResultCode.SUCCESS,destVoList);
+    }
+
 }

+ 6 - 0
huimv-receive/src/main/resources/mapper/BaseWashoutPointMapper.xml

@@ -16,5 +16,11 @@
         <result column="pcr_time" property="pcrTime" />
         <result column="visiting_type" property="visitingType" />
     </resultMap>
+    <select id="listDest" resultType="com.huimv.receive.entity.BaseWashoutPoint">
+        SELECT w.location_id,l.location_name ,w.tail_location_name FROM `base_washout_point` w
+        LEFT JOIN `base_location` l ON l.id = w.location_id
+        WHERE w.farm_ids LIKE concat('%',#{farmId},'%') AND w.visiting_type = #{visitingType}
+
+    </select>
 
 </mapper>