Bläddra i källkod

订单修改添加字段

jk-GitHub-coder 4 år sedan
förälder
incheckning
cab1a2511c

+ 41 - 17
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/PayOrder.java

@@ -32,6 +32,10 @@ public class PayOrder extends BaseEntity
     @Excel(name = "油品名称")
     private String oilName;
 
+    /** 油品价格*/
+    @Excel(name = "油品价格")
+    private String oilPirce;
+
     /** 用户id(消费者) */
     @Excel(name = "用户id(消费者)")
     private Long consumerId;
@@ -48,6 +52,10 @@ public class PayOrder extends BaseEntity
     @Excel(name = "油站id")
     private Long stationId;
 
+    /** 油站名称 */
+    @Excel(name = "油站名称")
+    private String stationName;
+
     /** 状态(0未支付,1,已支付) */
     @Excel(name = "状态(0未支付,1,已支付)")
     private String status;
@@ -82,6 +90,22 @@ public class PayOrder extends BaseEntity
     @Excel(name = "订单类型", readConverterExp = "1=.柴油,2.汽油,积分:3.现金+积分4.现金,5.积分")
     private String orderType;
 
+    public String getOilPirce() {
+        return oilPirce;
+    }
+
+    public void setOilPirce(String oilPirce) {
+        this.oilPirce = oilPirce;
+    }
+
+    public String getStationName() {
+        return stationName;
+    }
+
+    public void setStationName(String stationName) {
+        this.stationName = stationName;
+    }
+
     public void setOrderId(Long orderId)
     {
         this.orderId = orderId;
@@ -230,22 +254,22 @@ public class PayOrder extends BaseEntity
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("orderId", getOrderId())
-            .append("orderNo", getOrderNo())
-            .append("oilGun", getOilGun())
-            .append("oilName", getOilName())
-            .append("consumerId", getConsumerId())
-            .append("consumer", getConsumer())
-            .append("amt", getAmt())
-            .append("stationId", getStationId())
-            .append("status", getStatus())
-            .append("orderLiters", getOrderLiters())
-            .append("payType", getPayType())
-            .append("payWay", getPayWay())
-            .append("payDate", getPayDate())
-            .append("oilPersonnel", getOilPersonnel())
-            .append("createdDate", getCreatedDate())
-            .append("orderType", getOrderType())
-            .toString();
+                .append("orderId", getOrderId())
+                .append("orderNo", getOrderNo())
+                .append("oilGun", getOilGun())
+                .append("oilName", getOilName())
+                .append("consumerId", getConsumerId())
+                .append("consumer", getConsumer())
+                .append("amt", getAmt())
+                .append("stationId", getStationId())
+                .append("status", getStatus())
+                .append("orderLiters", getOrderLiters())
+                .append("payType", getPayType())
+                .append("payWay", getPayWay())
+                .append("payDate", getPayDate())
+                .append("oilPersonnel", getOilPersonnel())
+                .append("createdDate", getCreatedDate())
+                .append("orderType", getOrderType())
+                .toString();
     }
 }

+ 19 - 9
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml

@@ -1,7 +1,7 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.PayOrderMapper">
 
     <resultMap type="PayOrder" id="PayOrderResult">
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orderNo"    column="order_no"    />
         <result property="oilGun"    column="oil_gun"    />
         <result property="oilName"    column="oil_name"    />
+        <result property="oilPirce"    column="oil_pirce"    />
         <result property="consumerId"    column="consumer_id"    />
         <result property="consumer"    column="consumer"    />
         <result property="amt"    column="amt"    />
@@ -21,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="oilPersonnel"    column="oil_personnel"    />
         <result property="createdDate"    column="created_date"    />
         <result property="orderType"    column="order_type"    />
+        <result property="stationName"    column="station_name"    />
     </resultMap>
 
     <sql id="selectPayOrderVo">
-        select order_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type from pay_order
+        select order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name from pay_order
     </sql>
 
     <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
@@ -41,15 +43,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderLiters != null  and orderLiters != ''"> and order_liters = #{orderLiters}</if>
             <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if>
             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if>
-            <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
+
+            <if test="beginTime != null and beginTime != ''">
                 AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
             </if>
-            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+            <if test="endTime != null and endTime != ''">
                 AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
             </if>
-<!--            <if test="payDate != null "> and pay_date = #{payDate}</if>-->
+            <if test="stationName != null  and stationName != ''">
+                AND station_name LIKE CONCAT('%', #{stationName}, '%')
+            </if>
             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
-<!--            <if test="createdDate != null "> and created_date = #{createdDate}</if>-->
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
         </where>
         ORDER BY created_date DESC
@@ -66,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderNo != null">order_no,</if>
             <if test="oilGun != null">oil_gun,</if>
             <if test="oilName != null">oil_name,</if>
+            <if test="oilPirce != null">oil_pirce,</if>
             <if test="consumerId != null">consumer_id,</if>
             <if test="consumer != null">consumer,</if>
             <if test="amt != null">amt,</if>
@@ -78,11 +83,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">oil_personnel,</if>
             <if test="createdDate != null">created_date,</if>
             <if test="orderType != null">order_type,</if>
-         </trim>
+            <if test="stationName != null">station_name,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderNo != null">#{orderNo},</if>
             <if test="oilGun != null">#{oilGun},</if>
             <if test="oilName != null">#{oilName},</if>
+            <if test="oilPirce != null">#{oilPirce},</if>
             <if test="consumerId != null">#{consumerId},</if>
             <if test="consumer != null">#{consumer},</if>
             <if test="amt != null">#{amt},</if>
@@ -95,7 +102,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">#{oilPersonnel},</if>
             <if test="createdDate != null">#{createdDate},</if>
             <if test="orderType != null">#{orderType},</if>
-         </trim>
+            <if test="stationName != null">#{stationName},</if>
+        </trim>
     </insert>
 
     <update id="updatePayOrder" parameterType="PayOrder">
@@ -104,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderNo != null">order_no = #{orderNo},</if>
             <if test="oilGun != null">oil_gun = #{oilGun},</if>
             <if test="oilName != null">oil_name = #{oilName},</if>
+            <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
             <if test="consumerId != null">consumer_id = #{consumerId},</if>
             <if test="consumer != null">consumer = #{consumer},</if>
             <if test="amt != null">amt = #{amt},</if>
@@ -116,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
             <if test="createdDate != null">created_date = #{createdDate},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="stationName != null">station_name = #{stationName},</if>
         </trim>
         where order_id = #{orderId}
     </update>

+ 23 - 7
Yijia-SaaS/yijia-station/target/classes/mapper/station/PayOrderMapper.xml

@@ -1,7 +1,7 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.PayOrderMapper">
 
     <resultMap type="PayOrder" id="PayOrderResult">
@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orderNo"    column="order_no"    />
         <result property="oilGun"    column="oil_gun"    />
         <result property="oilName"    column="oil_name"    />
+        <result property="oilPirce"    column="oil_pirce"    />
         <result property="consumerId"    column="consumer_id"    />
         <result property="consumer"    column="consumer"    />
         <result property="amt"    column="amt"    />
@@ -21,10 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="oilPersonnel"    column="oil_personnel"    />
         <result property="createdDate"    column="created_date"    />
         <result property="orderType"    column="order_type"    />
+        <result property="stationName"    column="station_name"    />
     </resultMap>
 
     <sql id="selectPayOrderVo">
-        select order_id, order_no, oil_gun, oil_name, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type from pay_order
+        select order_id, order_no, oil_gun, oil_name, oil_pirce, consumer_id, consumer, amt, station_id, status, order_liters, pay_type, pay_way, pay_date, oil_personnel, created_date, order_type, station_name from pay_order
     </sql>
 
     <select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
@@ -41,9 +43,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderLiters != null  and orderLiters != ''"> and order_liters = #{orderLiters}</if>
             <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if>
             <if test="payWay != null  and payWay != ''"> and pay_way = #{payWay}</if>
-            <if test="payDate != null "> and pay_date = #{payDate}</if>
+
+            <if test="beginTime != null and beginTime != ''">
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND date_format(created_date,'%y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%y-%m-%d %H:%i:%s')
+            </if>
+            <if test="stationName != null  and stationName != ''">
+                AND station_name LIKE CONCAT('%', #{stationName}, '%')
+            </if>
             <if test="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
-            <if test="createdDate != null "> and created_date = #{createdDate}</if>
             <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
         </where>
         ORDER BY created_date DESC
@@ -60,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderNo != null">order_no,</if>
             <if test="oilGun != null">oil_gun,</if>
             <if test="oilName != null">oil_name,</if>
+            <if test="oilPirce != null">oil_pirce,</if>
             <if test="consumerId != null">consumer_id,</if>
             <if test="consumer != null">consumer,</if>
             <if test="amt != null">amt,</if>
@@ -72,11 +83,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">oil_personnel,</if>
             <if test="createdDate != null">created_date,</if>
             <if test="orderType != null">order_type,</if>
-         </trim>
+            <if test="stationName != null">station_name,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderNo != null">#{orderNo},</if>
             <if test="oilGun != null">#{oilGun},</if>
             <if test="oilName != null">#{oilName},</if>
+            <if test="oilPirce != null">#{oilPirce},</if>
             <if test="consumerId != null">#{consumerId},</if>
             <if test="consumer != null">#{consumer},</if>
             <if test="amt != null">#{amt},</if>
@@ -89,7 +102,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">#{oilPersonnel},</if>
             <if test="createdDate != null">#{createdDate},</if>
             <if test="orderType != null">#{orderType},</if>
-         </trim>
+            <if test="stationName != null">#{stationName},</if>
+        </trim>
     </insert>
 
     <update id="updatePayOrder" parameterType="PayOrder">
@@ -98,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderNo != null">order_no = #{orderNo},</if>
             <if test="oilGun != null">oil_gun = #{oilGun},</if>
             <if test="oilName != null">oil_name = #{oilName},</if>
+            <if test="oilPirce != null">oil_pirce = #{oilPirce},</if>
             <if test="consumerId != null">consumer_id = #{consumerId},</if>
             <if test="consumer != null">consumer = #{consumer},</if>
             <if test="amt != null">amt = #{amt},</if>
@@ -110,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilPersonnel != null">oil_personnel = #{oilPersonnel},</if>
             <if test="createdDate != null">created_date = #{createdDate},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="stationName != null">station_name = #{stationName},</if>
         </trim>
         where order_id = #{orderId}
     </update>

+ 25 - 16
Yijia-SaaS/yijia-ui/src/views/station/order/index.vue

@@ -117,14 +117,22 @@
           <el-option label="请选择字典生成" value="" />
         </el-select>
       </el-form-item>
-
+      <el-form-item label="油站名称" prop="stationName">
+        <el-input
+          v-model="queryParams.stationName"
+          placeholder="请输入油站名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="创建时间" prop="createdDate">
         <el-date-picker style="width: 350px"
-          v-model="dateRangeCreatedDate" size="mini" value-format="yyyy-MM-dd HH:mm:ss"
-          type="datetimerange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期">
+                        v-model="dateRangeCreatedDate" size="mini" value-format="yyyy-MM-dd HH:mm:ss"
+                        type="datetimerange"
+                        range-separator="至"
+                        start-placeholder="开始日期"
+                        end-placeholder="结束日期">
         </el-date-picker>
       </el-form-item>
       <el-form-item>
@@ -179,10 +187,12 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column v-if="false" label="订单id" align="center" prop="orderId" />
       <el-table-column label="订单号"  width="200" align="center" prop="orderNo" />
+      <el-table-column label="消费者" width="120" align="center" prop="consumer" />
       <el-table-column label="加油枪号" align="center" prop="oilGun" />
       <el-table-column label="油品名称" align="center" prop="oilName" />
+      <el-table-column label="油品价格" align="center" prop="oilPirce" />
+      <el-table-column label="油站名称" width="120" align="center" prop="stationName" />
       <el-table-column v-if="false" label="用户id(消费者)" align="center" prop="consumerId" />
-      <el-table-column label="消费者" width="120" align="center" prop="consumer" />
       <el-table-column label="金额" align="center" prop="amt" />
       <el-table-column label="加油升数" align="center" prop="orderLiters" />
       <el-table-column v-if="false" label="油站id" align="center" prop="stationId" />
@@ -190,19 +200,19 @@
       <el-table-column label="支付类型" align="center" prop="payType" :formatter="payTypeFotmat"/>
       <el-table-column label="支付方式" align="center" prop="payWay" :formatter="payWayFotmat"/>
       <el-table-column label="订单类型" align="center" prop="orderType" />
-      <el-table-column label="加油员" align="center" prop="oilPersonnel" />
+      <el-table-column label="加油员" width="120" align="center" prop="oilPersonnel" />
       <el-table-column label="创建时间" align="center" prop="createdDate" width="150">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createdDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="支付时间" align="center" prop="payDate" width="150">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
-        </template>
-      </el-table-column>
+      <!--      <el-table-column label="支付时间" align="center" prop="payDate" width="150">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <span>{{ parseTime(scope.row.payDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
       <el-table-column label="订单类型" align="center" prop="orderType" v-if="false" />
-      <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <!--          <el-button-->
           <!--            size="mini"-->
@@ -372,8 +382,7 @@
           orderLiters: null,
           payType: null,
           payWay: null,
-          // pay:[],
-          // cre:[],
+          stationName: null,
           payDate: null,
           payMaxDate: null,
           payMinDate: null,