zhang song 6 лет назад
Родитель
Сommit
6fc5a8dc47

+ 9 - 1
pine-admin/src/main/java/com/pine/admin/modules/business/dao/CarOrderDao.java

@@ -3,6 +3,9 @@ package com.pine.admin.modules.business.dao;
 import com.pine.admin.modules.base.binder.BaseDao;
 import com.pine.admin.modules.business.entity.CarOrder;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 选配车订单表
  *
@@ -11,5 +14,10 @@ import com.pine.admin.modules.business.entity.CarOrder;
  * @date 2019-07-22 21:11:49
  */
 public interface CarOrderDao extends BaseDao<CarOrder> {
-
+    /**
+     * 查询未支付 和 已经线下支付了
+     * @param parameter
+     * @return
+     */
+   List<CarOrder> queryOfflineByPage(Map<String, Object> parameter);
 }

+ 8 - 1
pine-admin/src/main/java/com/pine/admin/modules/business/entity/CarOrder.java

@@ -277,6 +277,13 @@ public class CarOrder implements Serializable {
     @ApiModelProperty(value = "是否退款 0 否 1 是 默认 0",name = "isRefund")
     private Integer isRefund = 0 ;
 
-    @ApiModelProperty
+    @ApiModelProperty(hidden = true)
     private OfflinePayments offlinePayments;
+
+    /**
+     * 搜索条件  查询首付/尾款  支付信息
+     *   0 未支付 1 已线下支付  2 已经在线支付
+     */
+    @ApiModelProperty(value = "搜索条件  查询首付/尾款0 未支付 1 已线下支付  2 已经在线支付",name = "offlinePayType")
+    private String offlinePayType;
 }

+ 10 - 2
pine-admin/src/main/java/com/pine/admin/modules/business/service/impl/CarOrderServiceImpl.java

@@ -62,15 +62,23 @@ public class CarOrderServiceImpl implements CarOrderService {
 
         log.info("getCarOrderByPage");
         try {
+
             //TODO 目前提供的测试账号查询不到数据 暂时查询所有的 注释去掉即可根据登录用户查询
+            //TODO 首付/尾款支付状态查询
+
             if (!ShiroUtils.getShiroUserInfo().getUserName().contains("超级管理员")) {
                 record.setCarSupplier(ShiroUtils.getShiroUserInfo().getUserName());
             }
             Map<String, Object> parameter = new HashMap<String, Object>();
             parameter.put("record", record);
             parameter.put("page", page);
-
-            return carOrderDao.queryByPage(parameter);
+//            if (!StringUtils.isEmpty(record.getOfflinePayType())){
+//                //如果不是查询在线支付的直接 走查询线下和未支付的接口
+//                if (!record.getOfflinePayType().equals("2")){
+//                    return carOrderDao.queryOfflineByPage(parameter);
+//                }
+//            }
+            return carOrderDao.queryOfflineByPage(parameter);
         } catch (Exception e) {
             log.error("getCarOrderByPage", e);
         }

+ 1 - 1
pine-admin/src/main/java/com/pine/admin/modules/youpaiyun/util/YunUploadUtils.java

@@ -1,6 +1,6 @@
 package com.pine.admin.modules.youpaiyun.util;
 
-import com.upyun.UpYun;
+import com.UpYun;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

+ 157 - 7
pine-admin/src/main/resources/mapper/business/CarOrderDao.xml

@@ -46,16 +46,15 @@
     <resultMap id="offlinePayments" type="com.pine.admin.modules.business.entity.CarOrder" extends="entityMap">
 
         <association property="offlinePayments"
-                    javaType="com.pine.admin.modules.business.entity.OfflinePayments"
-                    select="com.pine.admin.modules.business.dao.OfflinePaymentsDao.queryOne"
-                    column="{ carOrderId = id }"/>
+                     javaType="com.pine.admin.modules.business.entity.OfflinePayments"
+                     select="com.pine.admin.modules.business.dao.OfflinePaymentsDao.queryOne"
+                     column="{ carOrderId = id }"/>
 
         <association property="isRefund"
                      javaType="java.lang.Integer"
                      select="com.pine.admin.modules.business.dao.CarBackOrderDao.isRefund"
                      column="{ orderId = id }"/>
     </resultMap>
-
     <sql id="Base_Column_List">
                  id,
                      code,
@@ -93,6 +92,45 @@
                      url,
                      cancel_reason,
                     is_send         </sql>
+    <sql id="lco_Column_sql">
+            lco.id		id,
+            lco.code		code,
+            lco.customer_id		customer_id,
+            lco.pay_type		pay_type,
+            lco.status		status,
+            lco.loan_status		loan_status,
+            lco.is_use		is_use,
+            lco.car_id		car_id,
+            lco.car_json		car_json,
+            lco.picked_car_information		picked_car_information,
+            lco.loan_instalment_count		loan_instalment_count,
+            lco.loan_rate		loan_rate,
+            lco.down_payment_rate		down_payment_rate,
+            lco.real_down_payment_rate		real_down_payment_rate,
+            lco.total_price		total_price,
+            lco.deposit_price		deposit_price,
+            lco.final_payment_price		final_payment_price,
+            lco.down_payment_price		down_payment_price,
+            lco.real_down_payment_price		real_down_payment_price,
+            lco.loan_price		loan_price,
+            lco.monthly_installment_payment_price		monthly_installment_payment_price,
+            lco.name		name,
+            lco.mobile		mobile,
+            lco.id_card		id_card,
+            lco.pick_city		pick_city,
+            lco.car_supplier		car_supplier,
+            lco.car_supplier_no		car_supplier_no,
+            lco.create_time		create_time,
+            lco.order_cancel_time		order_cancel_time,
+            lco.pay_deposit_time		pay_deposit_time,
+            lco.online_audit_time		online_audit_time,
+            lco.offline_audit_time		offline_audit_time,
+            lco.order_finish_time		order_finish_time,
+            lco.url		url,
+            lco.cancel_reason		cancel_reason,
+
+
+    </sql>
     <!-- 根据Id查询-->
     <select id="selectByPrimaryKey" resultMap="entityMap" parameterType="java.lang.Integer">
         select
@@ -235,14 +273,13 @@
         where id = #{id,jdbcType=INTEGER}
     </update>
 
-    <!-- 分页查询-->
+    <!-- 线上支付分页查询-->
     <select id="queryByPage" parameterType="java.util.Map"
             resultMap="offlinePayments">
         select
         <include refid="Base_Column_List"/>
         from ls_car_order
         <where>
-
             <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                 and id = #{record.id}
             </if>
@@ -351,12 +388,125 @@
             <if test="record.isSend != null and !&quot;&quot;.equals(record.isSend)">
                 and is_send = #{record.isSend}
             </if>
-            and    loan_status != 2
+            <if test="record.offlinePayType == 2">
+                and status = 3
+            </if>
+            and loan_status != 2
             and status != 1
         </where>
         order by id desc
     </select>
 
+    <!-- 查询未支付和线下支付的  -->
+    <select id="queryOfflineByPage" parameterType="java.util.Map"
+            resultMap="offlinePayments">
+        select
+        lco.*
+        from ls_car_order lco
+        LEFT JOIN ls_offline_payments lof ON lco.id = lof.car_order_id
+        <where>
+            <if test="record.code != null and !&quot;&quot;.equals(record.code)">
+                and lco.code = #{record.code}
+            </if>
+            <if test="record.customerId != null and !&quot;&quot;.equals(record.customerId)">
+                and lco.customer_id = #{record.customerId}
+            </if>
+            <if test="record.payType != null and !&quot;&quot;.equals(record.payType)">
+                and lco.pay_type = #{record.payType}
+            </if>
+            <if test="record.status != null and !&quot;&quot;.equals(record.status)">
+                and lco.status = #{record.status}
+            </if>
+            <if test="record.loanStatus != null and !&quot;&quot;.equals(record.loanStatus)">
+                and lco.loan_status = #{record.loanStatus}
+            </if>
+            <if test="record.isUse != null and !&quot;&quot;.equals(record.isUse)">
+                and lco.is_use = #{record.isUse}
+            </if>
+            <if test="record.carId != null and !&quot;&quot;.equals(record.carId)">
+                and lco.car_id = #{record.carId}
+            </if>
+            <if test="record.carJson != null and !&quot;&quot;.equals(record.carJson)">
+                and lco.car_json = #{record.carJson}
+            </if>
+            <if test="record.pickedCarInformation != null and !&quot;&quot;.equals(record.pickedCarInformation)">
+                and lco.picked_car_information = #{record.pickedCarInformation}
+            </if>
+            <if test="record.loanInstalmentCount != null and !&quot;&quot;.equals(record.loanInstalmentCount)">
+                and lco.loan_instalment_count = #{record.loanInstalmentCount}
+            </if>
+            <if test="record.loanRate != null and !&quot;&quot;.equals(record.loanRate)">
+                and lco.loan_rate = #{record.loanRate}
+            </if>
+            <if test="record.downPaymentRate != null and !&quot;&quot;.equals(record.downPaymentRate)">
+                and lco.down_payment_rate = #{record.downPaymentRate}
+            </if>
+            <if test="record.realDownPaymentRate != null and !&quot;&quot;.equals(record.realDownPaymentRate)">
+                and lco.real_down_payment_rate = #{record.realDownPaymentRate}
+            </if>
+            <if test="record.totalPrice != null and !&quot;&quot;.equals(record.totalPrice)">
+                and lco.total_price = #{record.totalPrice}
+            </if>
+            <if test="record.depositPrice != null and !&quot;&quot;.equals(record.depositPrice)">
+                and lco.deposit_price = #{record.depositPrice}
+            </if>
+            <if test="record.finalPaymentPrice != null and !&quot;&quot;.equals(record.finalPaymentPrice)">
+                and lco.final_payment_price = #{record.finalPaymentPrice}
+            </if>
+            <if test="record.downPaymentPrice != null and !&quot;&quot;.equals(record.downPaymentPrice)">
+                and lco.down_payment_price = #{record.downPaymentPrice}
+            </if>
+            <if test="record.realDownPaymentPrice != null and !&quot;&quot;.equals(record.realDownPaymentPrice)">
+                and lco.real_down_payment_price = #{record.realDownPaymentPrice}
+            </if>
+            <if test="record.loanPrice != null and !&quot;&quot;.equals(record.loanPrice)">
+                and lco.loan_price = #{record.loanPrice}
+            </if>
+            <if test="record.monthlyInstallmentPaymentPrice != null and !&quot;&quot;.equals(record.monthlyInstallmentPaymentPrice)">
+                and lco.monthly_installment_payment_price = #{record.monthlyInstallmentPaymentPrice}
+            </if>
+            <if test="record.name != null and !&quot;&quot;.equals(record.name)">
+                and lco.name = #{record.name}
+            </if>
+            <if test="record.mobile != null and !&quot;&quot;.equals(record.mobile)">
+                and lco.mobile = #{record.mobile}
+            </if>
+            <if test="record.idCard != null and !&quot;&quot;.equals(record.idCard)">
+                and lco.id_card = #{record.idCard}
+            </if>
+            <if test="record.pickCity != null and !&quot;&quot;.equals(record.pickCity)">
+                and lco.pick_city = #{record.pickCity}
+            </if>
+            <if test="record.carSupplier != null and !&quot;&quot;.equals(record.carSupplier)">
+                and lco.car_supplier = #{record.carSupplier}
+            </if>
+            <if test="record.carSupplierNo != null and !&quot;&quot;.equals(record.carSupplierNo)">
+                and lco.car_supplier_no = #{record.carSupplierNo}
+            </if>
+            <if test="record.cancelReason != null and !&quot;&quot;.equals(record.cancelReason)">
+                and lco.cancel_reason = #{record.cancelReason}
+            </if>
+            <if test="record.isSend != null and !&quot;&quot;.equals(record.isSend)">
+                and lco.is_send = #{record.isSend}
+            </if>
+            <if test="record.offlinePayType == 2 ">
+                and lof.car_order_id is null
+                and lco.status = 3
+            </if>
+            <if test="record.offlinePayType == 1">
+                and lof.car_order_id is not null
+            </if>
+            <if test="record.offlinePayType == 3">
+                and lof.car_order_id is null
+                AND lco.status !=3
+            </if>
+
+            and lco.loan_status != 2
+            and lco.status != 1
+        </where>
+        order by lco.id desc
+    </select>
+
     <!-- 全部查询 -->
     <select id="queryAll" parameterType="java.util.Map"
             resultMap="entityMap">

+ 2 - 2
pine-common/src/main/java/com/pine/common/dto/Page.java

@@ -24,7 +24,7 @@ public class Page {
     /**
      * 当前第几页
      */
-    @ApiModelProperty(value = "当前第几页", name = "currentPage")
+    @ApiModelProperty(value = "当前第几页", name = "currentPage",example = "1")
     private int currentPage;
 
     /**
@@ -36,7 +36,7 @@ public class Page {
     /**
      * 每页显示条数
      */
-    @ApiModelProperty(value = "每页显示条数", name = "pageNumber")
+    @ApiModelProperty(value = "每页显示条数", name = "pageNumber",example = "20")
     private int pageNumber = DEFAULT_PAGE_SIZE;
 
     /**