haungfuli 3 jaren geleden
bovenliggende
commit
1801342c07

+ 3 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/AgentCargoOwnerInfoController.java

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
+import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.AgentCargoOwnerInfo;
 import com.yh.saas.plugin.yiliangyiyun.service.IAgentCargoOwnerInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,8 +29,8 @@ public class AgentCargoOwnerInfoController {
      * @return
      */
     @GetMapping("/selectAgentCargoOwner")
-    public List<AgentCargoOwnerInfo> selectAgentCargoOwner(@RequestBody String commonId){
-        return agentCargoOwnerInfoService.selectAgentCargoOwner(commonId);
+    public Page<AgentCargoOwnerInfo> selectAgentCargoOwner(AgentCargoOwnerInfo agentCargoOwnerInfo){
+        return agentCargoOwnerInfoService.selectAgentCargoOwner(agentCargoOwnerInfo);
     }
 
     /**

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CargoOwnerInfo.java

@@ -73,6 +73,10 @@ public class CargoOwnerInfo extends BaseModel<CargoOwnerInfo> {
      * 认证状态
      */
     private String authenticationStatus;
+    /**
+     * 刷新次数
+     */
+    private String refreshTimes;
 
     @TableField(exist = false)
     private List<CargoOwnerCompInfo> cargoOwnerCompInfoList;

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/PublishTaskInfo.java

@@ -188,6 +188,10 @@ public class PublishTaskInfo extends BaseModel<PublishTaskInfo> {
      * 显示隐藏(1显示2隐藏)
      */
     private String showHide;
+    /**
+     * 刷新次数
+     */
+    private String refreshTimes;
 
     /**
      * 司机用户id

+ 19 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/AgentCargoOwnerInfoMapper.java

@@ -2,6 +2,10 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 
 import com.yh.saas.plugin.yiliangyiyun.entity.AgentCargoOwnerInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.yh.saas.plugin.yiliangyiyun.entity.PublishTaskInfo;
+
+import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -13,4 +17,19 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
  */
 public interface AgentCargoOwnerInfoMapper extends BaseMapper<AgentCargoOwnerInfo> {
 
+    /**
+     * 根据条件查询代理货主总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询代理货主列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<AgentCargoOwnerInfo> getListByCondition(Map<String, Object> pageView);
 }

+ 3 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IAgentCargoOwnerInfoService.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.service;
 
+import com.baomidou.mybatisplus.plugins.Page;
 import com.yh.saas.plugin.yiliangyiyun.entity.AgentCargoOwnerInfo;
 import com.baomidou.mybatisplus.service.IService;
 
@@ -18,10 +19,10 @@ public interface IAgentCargoOwnerInfoService extends IService<AgentCargoOwnerInf
     /**
      * 代理货主列表
      *
-     * @param commonId
+     * @param agentCargoOwnerInfo
      * @return
      */
-    List<AgentCargoOwnerInfo> selectAgentCargoOwner(String commonId);
+    Page<AgentCargoOwnerInfo> selectAgentCargoOwner(AgentCargoOwnerInfo agentCargoOwnerInfo);
 
     /**
      * 更改代理货主状态

+ 23 - 6
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/AgentCargoOwnerInfoServiceImpl.java

@@ -1,18 +1,23 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
 import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.AgentCargoOwnerInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.CargoOwnerCompInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.CompanyInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.PublishTaskInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.AgentCargoOwnerInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IAgentCargoOwnerInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -27,15 +32,27 @@ public class AgentCargoOwnerInfoServiceImpl extends ServiceImpl<AgentCargoOwnerI
 
     /**
      *代理货主列表
-     * @param commonId
+     * @param agentCargoOwnerInfo
      * @return
      */
     @Override
-    public List<AgentCargoOwnerInfo> selectAgentCargoOwner(String commonId) {
-        List<AgentCargoOwnerInfo> agentCargoOwnerInfoList = this.selectList(new EntityWrapper<AgentCargoOwnerInfo>()
-                .eq(AgentCargoOwnerInfo.QueryFiles.COMMON_ID, commonId)
-                .eq(AgentCargoOwnerInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
-        return agentCargoOwnerInfoList;
+    public Page<AgentCargoOwnerInfo> selectAgentCargoOwner(AgentCargoOwnerInfo agentCargoOwnerInfo) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (agentCargoOwnerInfo.getCurrentPage() - 1)
+                * agentCargoOwnerInfo.getPageSize());
+        //用户id
+        pageView.put("commonId", agentCargoOwnerInfo.getCommonId());
+        pageView.put("pageSize", agentCargoOwnerInfo.getPageSize());
+        pageView.put("currentPage", agentCargoOwnerInfo.getCurrentPage());
+        // 查询任务总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<AgentCargoOwnerInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<AgentCargoOwnerInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(agentCargoOwnerInfo.getCurrentPage());
+        page.setSize(agentCargoOwnerInfo.getPageSize());
+        return page;
     }
 
     /**

+ 29 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/AgentCargoOwnerInfoMapper.xml

@@ -1,5 +1,33 @@
 <?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.yh.saas.plugin.yiliangyiyun.mapper.AgentCargoOwnerInfoMapper">
-
+    <!-- 获得代理货主总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM agent_cargo_owner_info
+        WHERE delete_flag = '0'
+        AND common_id = #{commonId}
+    </select>
+    <!-- 获得代理货主列表 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.AgentCargoOwnerInfo">
+        SELECT
+        id,
+        agent_common_id as agentCommonId,
+        name,
+        phone,
+        company,
+        certificate_address_url as certificateAddressUrl,
+        status,
+        create_date as createDate,
+        update_date as updateDate
+        FROM agent_cargo_owner_info
+        WHERE delete_flag = '0'
+        AND common_id = #{commonId}
+        ORDER BY create_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
 </mapper>

+ 20 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/PublishTaskInfoMapper.xml

@@ -20,21 +20,38 @@
         SELECT
         id,
         task_no as taskNo,
+        cargo_owner as cargoOwner,
         goods_name as goodsName,
         send_private as sendPrivate,
         send_city as sendCity,
         send_area as sendArea,
+        send_detailed_address as sendDetailedAddress,
+        send_longitude as sendLongitude,
+        send_latitude as sendLatitude,
+        unsend_longitude as unsendLongitude,
+        unsend_latitude as unsendLatitude,
         unload_private as unloadPrivate,
         unload_city as unloadCity,
         unload_area as unloadArea,
+        unload_detailed_address as unloadDetailedAddress,
+        distance,
+        billing_method as billingMethod,
+        freight_price as freightPrice,
+        freight_advance as freightAdvance,
+        sender,
+        sender_phone as senderPhone,
+        receiver,
+        receiver_phone as receiverPhone,
+        weight,
+        loading_date_start as loadingDateStart,
+        loading_date_end as loadingDateEnd,
         car_length_small as carLengthSmall,
         car_length as carLength,
         load_weight_small as loadWeightSmall,
         load_weight as loadWeight,
+        task_description as taskDescription,
+        task_validity as taskValidity,
         car_model as carModel,
-        billing_method as billingMethod,
-        distance,
-        freight_price as freightPrice,
         status,
         create_date as createDate,
         update_date as updateDate