Browse Source

优化数据

MS-QJVSRANLTYEO\Administrator 4 years ago
parent
commit
9bd651f97e

+ 1 - 1
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java

@@ -109,7 +109,7 @@ public class PayOrderController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(PayOrder payOrder)
     {
-        List<PayOrder> list = payOrderService.selectPayOrderList(payOrder);
+        List<PayOrder> list = payOrderService.selectPayOrderExport(payOrder);
         ExcelUtil<PayOrder> util = new ExcelUtil<PayOrder>(PayOrder.class);
         return util.exportExcel(list, "order");
     }

+ 38 - 2
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceAdjustController.java

@@ -8,6 +8,10 @@ import java.util.List;
 import com.yijia.common.core.domain.entity.SysUser;
 import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.SecurityUtils;
+import com.yijia.station.domain.StationOilGun;
+import com.yijia.station.domain.StationOilPrice;
+import com.yijia.station.service.IStationOilGunService;
+import com.yijia.station.service.IStationOilPriceService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -39,7 +43,10 @@ public class StationOilPriceAdjustController extends BaseController
 {
     @Autowired
     private IStationOilPriceAdjustService stationOilPriceAdjustService;
-
+    @Autowired
+    private IStationOilPriceService stationOilPriceService;
+    @Autowired
+    private IStationOilGunService stationOilGunService;
     /**
      * 查询油品调价信息列表
      */
@@ -93,7 +100,36 @@ public class StationOilPriceAdjustController extends BaseController
         LoginUser currentUser = SecurityUtils.getLoginUser();
         stationOilPriceAdjust.setOperator(currentUser.getUsername());
         stationOilPriceAdjust.setStatus("1");
-        return toAjax(stationOilPriceAdjustService.insertStationOilPriceAdjust(stationOilPriceAdjust));
+       int i= stationOilPriceAdjustService.insertStationOilPriceAdjust(stationOilPriceAdjust);
+       //查询出刚添加的油品调价信息
+        if(stationOilPriceAdjust.getTakeEffectStatus()!=null && stationOilPriceAdjust.getTakeEffectStatus().equals("1")){
+            List<StationOilPriceAdjust> list = stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
+            for(StationOilPriceAdjust adjust: list ){
+                //修改油品价格根据油品价格id
+                StationOilPrice oilPrice=new StationOilPrice();
+                oilPrice.setOilPriceId(adjust.getOilPriceId());
+                oilPrice.setOilPrice(adjust.getOilAdjustPrice());
+                oilPrice.setDate(now);
+                stationOilPriceService.updateStationOilPrice(oilPrice);
+                //修改油枪信息中的价格
+                StationOilGun gun =new StationOilGun();
+                gun.setStationId(adjust.getStationId());
+                gun.setOilName(adjust.getOilName());
+                List<StationOilGun> listGun = stationOilGunService.selectStationOilGunList(gun);
+                for(StationOilGun oilGun: listGun ){
+                    StationOilGun stationOilGun =new StationOilGun();
+                    stationOilGun.setOilPrice(adjust.getOilAdjustPrice());
+                    stationOilGun.setOilGunId(oilGun.getOilGunId());
+                    stationOilGun.setDate(now);
+                    stationOilGunService.updateStationOilGun(stationOilGun);
+                }
+                StationOilPriceAdjust priceAdjust=new StationOilPriceAdjust();
+                priceAdjust.setStatus("2");
+                priceAdjust.setAdjustPriceId(adjust.getAdjustPriceId());
+                stationOilPriceAdjustService.updateStationOilPriceAdjust(priceAdjust);
+            }
+        }
+        return toAjax(i);
     }
 
     /**

+ 35 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/PayOrder.java

@@ -181,6 +181,41 @@ public class PayOrder extends BaseEntity
     @Excel(name = "柴油金额")
     private BigDecimal cyAmt;
 
+    /**
+     * 模糊查询条件
+     * @return
+     */
+    //客户
+    private String likeConsumer;
+    //车牌号
+    private String likeCarNo;
+    //客户电话
+    private String likeCustomerPhone;
+
+    public String getLikeCustomerPhone() {
+        return likeCustomerPhone;
+    }
+
+    public void setLikeCustomerPhone(String likeCustomerPhone) {
+        this.likeCustomerPhone = likeCustomerPhone;
+    }
+
+    public String getLikeConsumer() {
+        return likeConsumer;
+    }
+
+    public void setLikeConsumer(String likeConsumer) {
+        this.likeConsumer = likeConsumer;
+    }
+
+    public String getLikeCarNo() {
+        return likeCarNo;
+    }
+
+    public void setLikeCarNo(String likeCarNo) {
+        this.likeCarNo = likeCarNo;
+    }
+
     public BigDecimal getQyAmt() {
         return qyAmt;
     }

+ 6 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/mapper/PayOrderMapper.java

@@ -99,4 +99,10 @@ public interface PayOrderMapper
      * @return
      */
     public List<PayOrder> listXdata(PayOrder payOrder);
+    /**
+     * 查询导出信息
+     * @param payOrder
+     * @return
+     */
+    public List<PayOrder> selectPayOrderExport(PayOrder payOrder);
 }

+ 7 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/IPayOrderService.java

@@ -94,4 +94,11 @@ public interface IPayOrderService
      * @return
      */
     public List<PayOrder> listXdata(PayOrder payOrder);
+
+    /**
+     * 查询导出信息
+     * @param payOrder
+     * @return
+     */
+    public List<PayOrder> selectPayOrderExport(PayOrder payOrder);
 }

+ 10 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java

@@ -150,4 +150,14 @@ public class PayOrderServiceImpl implements IPayOrderService
         return payOrderMapper.listXdata(payOrder);
     }
 
+    /**
+     * 查询导出信息
+     * @param payOrder
+     * @return
+     */
+    @Override
+    public List<PayOrder> selectPayOrderExport(PayOrder payOrder) {
+        return payOrderMapper.selectPayOrderExport(payOrder);
+    }
+
 }

+ 1 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/task/SaticScheduleTask.java

@@ -37,6 +37,7 @@ public class SaticScheduleTask {
         //查询油品调价列表 查询出未调价的信息
         StationOilPriceAdjust stationOilPriceAdjust =new StationOilPriceAdjust();
         stationOilPriceAdjust.setStatus("1");
+        stationOilPriceAdjust.setTakeEffectStatus("2");
         stationOilPriceAdjust.setEndTime(newdate);
         List<StationOilPriceAdjust>  oilPriceAdjustList=stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
         //循环查看 调价的生效时间是否和当前时间相符

+ 48 - 1
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/PayOrderMapper.xml

@@ -91,10 +91,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="carNo != null  and carNo != ''"> and car_no = #{carNo}</if>
             <if test="customerPhone != null  and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
             <if test="customerGrade != null  and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
+            <if test="likeConsumer != null  and likeConsumer != ''"> and customer  like concat('%',#{likeConsumer}, '%')</if>
+            <if test="likeCarNo != null  and likeCarNo != ''"> and car_no  like concat('%',#{likeCarNo}, '%') </if>
+            <if test="likeCustomerPhone != null  and likeCustomerPhone != ''"> and customer_phone  like concat('%',#{likeCustomerPhone}, '%') </if>
+        </where>
+        order by order_id desc
+    </select>
+    <!--查询导出数据-->
+    <select id="selectPayOrderExport" parameterType="PayOrder" resultMap="PayOrderResult">
+        select order_no,oil_name,oil_pirce,order_liters, amt,consumer,oil_personnel,oil_gun,pay_type,pay_way
+        <where>
+            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
+            <if test="stationId != null "> and station_id = #{stationId}</if>
+            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="consumerId != null "> and consumer_id = #{consumerId}</if>
+            <if test="consumer != null  and consumer != ''"> and consumer = #{consumer}</if>
+            <if test="oilGun != null  and oilGun != ''"> and oil_gun = #{oilGun}</if>
+            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
+            <if test="oilPirce != null "> and oil_pirce = #{oilPirce}</if>
+            <if test="oilType != null  and oilType != ''"> and oil_type = #{oilType}</if>
+            <if test="orderLiters != null "> and order_liters = #{orderLiters}</if>
+            <if test="amt != null "> and amt = #{amt}</if>
+            <if test="receivableAmt != null "> and receivable_amt = #{receivableAmt}</if>
+            <if test="receivedAmt != null "> and received_amt = #{receivedAmt}</if>
+            <if test="discountAmt != null "> and discount_amt = #{discountAmt}</if>
+            <if test="discountCouponAmt != null "> and discount_coupon_amt = #{discountCouponAmt}</if>
+            <if test="discountCoupon != null  and discountCoupon != ''"> and discount_coupon = #{discountCoupon}</if>
+            <if test="wxAmt != null "> and wx_amt = #{wxAmt}</if>
+            <if test="zfbAmt != null "> and zfb_amt = #{zfbAmt}</if>
+            <if test="posAmt != null "> and pos_amt = #{posAmt}</if>
+            <if test="xjAmt != null "> and xj_amt = #{xjAmt}</if>
+            <if test="didiAppAmt != null "> and didi_app_amt = #{didiAppAmt}</if>
+            <if test="tyAppAmt != null "> and ty_app_amt = #{tyAppAmt}</if>
+            <if test="otherAmt != null "> and other_amt = #{otherAmt}</if>
+            <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
+            <if test="score != null "> and score = #{score}</if>
+            <if test="memberNo != null  and memberNo != ''"> and member_no = #{memberNo}</if>
+            <if test="memberAmt != null "> and member_amt = #{memberAmt}</if>
+            <if test="printCount != null "> and print_count = #{printCount}</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="oilPersonnel != null  and oilPersonnel != ''"> and oil_personnel = #{oilPersonnel}</if>
+            <if test="payDate != null "> and pay_date = #{payDate}</if>
+            <if test="createdDate != null "> and created_date = #{createdDate}</if>
+            <if test="orderType != null  and orderType != ''"> and order_type = #{orderType}</if>
+            <if test="carNo != null  and carNo != ''"> and car_no = #{carNo}</if>
+            <if test="customerPhone != null  and customerPhone != ''"> and customer_phone = #{customerPhone}</if>
+            <if test="customerGrade != null  and customerGrade != ''"> and customer_grade = #{customerGrade}</if>
         </where>
         order by order_id desc
     </select>
-    
     <select id="selectPayOrderById" parameterType="Long" resultMap="PayOrderResult">
         <include refid="selectPayOrderVo"/>
         where order_id = #{orderId}

+ 2 - 2
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationClassesSummaryMapper.xml

@@ -42,10 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dzkAmt != null "> and dzk_amt = #{dzkAmt}</if>
             <if test="classesMan != null  and classesMan != ''"> and classes_man = #{classesMan}</if>
             <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
-                AND date_format(endDate,'%Y-%m-%d %H:%i:%s') &gt;= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
+                AND date_format(end_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(endDate,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
+                AND date_format(end_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
             </if>
         </where>
         order by id desc