Ver Fonte

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun

ccj há 2 anos atrás
pai
commit
997b492446
14 ficheiros alterados com 174 adições e 58 exclusões
  1. 21 10
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FreightInfoController.java
  2. 38 13
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FreightInfo.java
  3. 1 20
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/WarehouseNumView.java
  4. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java
  5. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/FreightInfoMapper.java
  6. 14 6
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFreightInfoService.java
  7. 4 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarrierInfoServiceImpl.java
  8. 1 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java
  9. 13 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightInfoServiceImpl.java
  10. 5 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java
  11. 4 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  12. 59 3
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml
  13. 2 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyFreightSettlementInfoMapper.xml
  14. 2 2
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

+ 21 - 10
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/FreightInfoController.java

@@ -2,6 +2,7 @@ package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
 
 
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
 import com.yh.saas.plugin.yiliangyiyun.service.IFreightInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFreightInfoService;
 import com.yh.saas.plugin.yiliangyiyun.util.Log;
 import com.yh.saas.plugin.yiliangyiyun.util.Log;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +26,26 @@ public class FreightInfoController {
     @Autowired
     @Autowired
     private IFreightInfoService freightInfoService;
     private IFreightInfoService freightInfoService;
 
 
+    /**
+     * 后台管理统计报表利润图表
+     * @param freightInfo
+     * @return
+     */
+    @GetMapping("/selectProfit")
+    public FreightInfo selectProfit(FreightInfo freightInfo){
+        return freightInfoService.selectProfit(freightInfo);
+    }
+
+    /**
+     * 后台管理统计报表待结算费用
+     * @param freightInfo
+     * @return
+     */
+    @GetMapping("/selectSettledExpenses")
+    List<FreightInfo> selectSettledExpenses(FreightInfo freightInfo){
+        return freightInfoService.selectSettledExpenses(freightInfo);
+    }
+
     /**
     /**
      * 预付
      * 预付
      * @param freightInfo
      * @param freightInfo
@@ -47,15 +68,5 @@ public class FreightInfoController {
         return freightInfoService.balance(freightInfo);
         return freightInfoService.balance(freightInfo);
     }
     }
 
 
-    /**
-     * 后台管理统计报表利润图表
-     * @param freightInfo
-     * @return
-     */
-    @Log(title = "统计报表利润图表")
-    @GetMapping("/selectProfit")
-    public FreightInfo selectProfit(FreightInfo freightInfo){
-        return freightInfoService.selectProfit(freightInfo);
-    }
 }
 }
 
 

+ 38 - 13
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/FreightInfo.java

@@ -146,67 +146,92 @@ public class FreightInfo extends BaseModel<FreightInfo> {
      * 1月
      * 1月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Jan;
+    private Double Jan;
     /**
     /**
      * 2月
      * 2月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Feb;
+    private Double Feb;
     /**
     /**
      * 3月
      * 3月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Mar;
+    private Double Mar;
     /**
     /**
      * 4月
      * 4月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Apr;
+    private Double Apr;
     /**
     /**
      * 5月
      * 5月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String May;
+    private Double May;
     /**
     /**
      * 6月
      * 6月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String June;
+    private Double June;
     /**
     /**
      * 7月
      * 7月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String July;
+    private Double July;
     /**
     /**
      * 8月
      * 8月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Aug;
+    private Double Aug;
     /**
     /**
      * 9月
      * 9月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Sept;
+    private Double Sept;
     /**
     /**
      * 10月
      * 10月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Oct;
+    private Double Oct;
     /**
     /**
      * 11月
      * 11月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Nov;
+    private Double Nov;
     /**
     /**
      * 12月
      * 12月
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String Dece;
+    private Double Dece;
     /**
     /**
      * 合计
      * 合计
      */
      */
     @TableField(exist = false)
     @TableField(exist = false)
-    private String total;
+    private Double total;
+    /**
+     * 日期
+     */
+    @TableField(exist = false)
+    private String date;
+    /**
+     * 代付运费
+     */
+    @TableField(exist = false)
+    private Double freight;
+    /**
+     * 提现
+     */
+    @TableField(exist = false)
+    private Double withdrawal;
+    /**
+     * 代收款
+     */
+    @TableField(exist = false)
+    private Double collection;
+    /**
+     * 待开发票
+     */
+    @TableField(exist = false)
+    private Double invoice;
 
 
 
 
 
 

+ 1 - 20
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/WarehouseNumView.java

@@ -1,27 +1,8 @@
 package com.yh.saas.plugin.yiliangyiyun.entity.view;
 package com.yh.saas.plugin.yiliangyiyun.entity.view;
 
 
+
 import lombok.Data;
 import lombok.Data;
 
 
 @Data
 @Data
 public class WarehouseNumView {
 public class WarehouseNumView {
-    /**
-     * 品种
-     */
-    private String goodsName;
-    /**
-     * 品种
-     */
-    private String goodsNameKey;
-    /**
-     * 入库量
-     */
-    private String inNetWeight;
-    /**
-     * 出库量
-     */
-    private String outNetWeight;
-    /**
-     * 应余量
-     */
-    private String storage;
 }
 }

+ 1 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java

@@ -45,6 +45,7 @@ public enum YExceptionEnum {
 	CORRECT_DRIVING_LICENSE("ERROR23", "行驶证车辆类型输入错误"),
 	CORRECT_DRIVING_LICENSE("ERROR23", "行驶证车辆类型输入错误"),
 	CAR_NOT_EXIST("ERROR23", "车辆不存在,请重新选择"),
 	CAR_NOT_EXIST("ERROR23", "车辆不存在,请重新选择"),
 	PAY_ADVANCE_PAYMENT("ERROR24", "请先支付预付款"),
 	PAY_ADVANCE_PAYMENT("ERROR24", "请先支付预付款"),
+	TOTAL_BIG_PREPAID("ERROR25", "合计应付运费必须大于预付款"),
 	;
 	;
 	@Getter
 	@Getter
 	private String value;
 	private String value;

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

@@ -3,6 +3,7 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.FleetInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FleetInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -32,4 +33,12 @@ public interface FreightInfoMapper extends BaseMapper<FreightInfo> {
      * @return
      * @return
      */
      */
     List<FreightInfo> getFormListByCondition(Map<String, Object> pageView);
     List<FreightInfo> getFormListByCondition(Map<String, Object> pageView);
+
+    /**
+     * 查询统计报表待结算费用
+     *
+     * @param pageView
+     * @return
+     */
+    List<FreightInfo> getCostListByCondition(Map<String, Object> pageView);
 }
 }

+ 14 - 6
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IFreightInfoService.java

@@ -2,6 +2,7 @@ package com.yh.saas.plugin.yiliangyiyun.service;
 
 
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo;
 import com.baomidou.mybatisplus.service.IService;
 import com.baomidou.mybatisplus.service.IService;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseNumView;
 
 
 import java.text.ParseException;
 import java.text.ParseException;
 import java.util.List;
 import java.util.List;
@@ -17,24 +18,31 @@ import java.util.List;
 public interface IFreightInfoService extends IService<FreightInfo> {
 public interface IFreightInfoService extends IService<FreightInfo> {
 
 
     /**
     /**
-     * 预付
+     * 后台管理统计报表利润图表
      * @param freightInfo
      * @param freightInfo
      * @return
      * @return
      */
      */
-    String advance (FreightInfo freightInfo) throws ParseException;
+    FreightInfo selectProfit(FreightInfo freightInfo);
 
 
     /**
     /**
-     * 尾款
+     * 后台管理统计报表待结算费用
      * @param freightInfo
      * @param freightInfo
      * @return
      * @return
      */
      */
-    String balance (FreightInfo freightInfo) throws ParseException;
+    List<FreightInfo> selectSettledExpenses(FreightInfo freightInfo);
 
 
+    /**
+     * 预付
+     * @param freightInfo
+     * @return
+     */
+    String advance (FreightInfo freightInfo) throws ParseException;
 
 
     /**
     /**
-     * 后台管理统计报表利润图表
+     * 尾款
      * @param freightInfo
      * @param freightInfo
      * @return
      * @return
      */
      */
-    FreightInfo selectProfit(FreightInfo freightInfo);
+    String balance (FreightInfo freightInfo) throws ParseException;
+
 }
 }

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarrierInfoServiceImpl.java

@@ -227,6 +227,10 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
                     //查询订单是否垫付
                     //查询订单是否垫付
                     //非垫付订单
                     //非垫付订单
                     if("0".equals(orderInfo.getFreightAdvance())){
                     if("0".equals(orderInfo.getFreightAdvance())){
+                        if (freightInfo1.getPrepaidFreight() > hyCarrierInfo.getTotalFreight()){
+                            //预付运费大于实际运费
+                            throw new YException(YExceptionEnum.TOTAL_BIG_PREPAID);
+                        }
                         //查询费用信息
                         //查询费用信息
                         FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
                         FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
                         .eq("order_id",orderInfo.getId()).eq("delete_flag","0"));
                         .eq("order_id",orderInfo.getId()).eq("delete_flag","0"));

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java

@@ -140,7 +140,7 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         user.setPhone(commonUser.getPhone());
         user.setPhone(commonUser.getPhone());
         user.setIdentification(commonUser.getIdentification());
         user.setIdentification(commonUser.getIdentification());
         user.setAvatarUrl(commonUser.getAvatarUrl());
         user.setAvatarUrl(commonUser.getAvatarUrl());
-        //  查询pc 是否有账号
+        //查询pc 是否有账号
         CommonStaff commonStaff = commonStaffService.selectOne(new EntityWrapper<CommonStaff>()
         CommonStaff commonStaff = commonStaffService.selectOne(new EntityWrapper<CommonStaff>()
                 .eq("staff_mobile_phone", commonUser.getPhone()).eq("enabled", "1"));
                 .eq("staff_mobile_phone", commonUser.getPhone()).eq("enabled", "1"));
         if (commonStaff != null) {
         if (commonStaff != null) {

+ 13 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FreightInfoServiceImpl.java

@@ -10,9 +10,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.FreightInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
@@ -61,6 +59,19 @@ public class FreightInfoServiceImpl extends ServiceImpl<FreightInfoMapper, Freig
     }
     }
 
 
 
 
+    /**
+     * 后台管理统计报表待结算费用
+     * @param freightInfo
+     * @return
+     */
+    @Override
+    public List<FreightInfo> selectSettledExpenses(FreightInfo freightInfo){
+        Map<String, Object> pageView = new HashMap<>();
+        List<FreightInfo> dataList = baseMapper.getCostListByCondition(pageView);
+        return dataList;
+    }
+
+
 
 
     /**
     /**
      * 预付
      * 预付

+ 5 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyFreightSettlementInfoServiceImpl.java

@@ -384,7 +384,11 @@ public class HyFreightSettlementInfoServiceImpl extends ServiceImpl<HyFreightSet
                 //查询银行key值
                 //查询银行key值
                 HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                 HyCommonSysParameter hyCommonSysParameter = commonSysParameterService.selectOne(new EntityWrapper<HyCommonSysParameter>()
                         .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
                         .eq("const_id", "BANK1").eq("const_value", orderInfo1.getBankDeposit()));
-                hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                if (hyCommonSysParameter == null){
+                    hyFreightSettlementInfo1.setBankKey("9999");
+                }else {
+                    hyFreightSettlementInfo1.setBankKey(hyCommonSysParameter.getConstKey());
+                }
                 //上报
                 //上报
                 hyFreightSettlementInfo1.setToken(token);
                 hyFreightSettlementInfo1.setToken(token);
                 EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);
                 EntityAnalyse.uploadFlowSheet(hyFreightSettlementInfo1);

+ 4 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java

@@ -537,6 +537,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 //查询订单是否垫付
                 //查询订单是否垫付
                 //非垫付订单
                 //非垫付订单
                 if("0".equals(orderInfo1.getFreightAdvance())){
                 if("0".equals(orderInfo1.getFreightAdvance())){
+                    if (freightInfo1.getPrepaidFreight() > hyCarrierInfo.getTotalFreight()){
+                        //预付运费大于实际运费
+                        throw new YException(YExceptionEnum.TOTAL_BIG_PREPAID);
+                    }
                     //查询费用信息
                     //查询费用信息
                     FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
                     FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
                             .eq("order_id",orderInfo1.getId()).eq("delete_flag","0"));
                             .eq("order_id",orderInfo1.getId()).eq("delete_flag","0"));

+ 59 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FreightInfoMapper.xml

@@ -32,7 +32,7 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
         <if test="searchType != null and searchType != ''">
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
             <if test="searchType == 1">
-                SELECT IFNULL(SUM(b.profit)/10000, 0 ) profit, aa.date create_date
+                SELECT IFNULL(SUM(b.profit)/10000, 0 ) as profit, right(aa.date,2) as date
                 FROM (SELECT @cdate := date_add( @cdate, INTERVAL - 1 DAY ) date
                 FROM (SELECT @cdate := date_add( @cdate, INTERVAL - 1 DAY ) date
                 FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 DAY ) FROM hy_freight_info LIMIT 30 ) a ) aa
                 FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 DAY ) FROM hy_freight_info LIMIT 30 ) a ) aa
                 LEFT JOIN (select id,profit, profit_date from hy_freight_info
                 LEFT JOIN (select id,profit, profit_date from hy_freight_info
@@ -42,11 +42,67 @@
                 ORDER BY aa.date DESC;
                 ORDER BY aa.date DESC;
             </if>
             </if>
             <if test="searchType == 2">
             <if test="searchType == 2">
-
+                SELECT IFNULL( b.profit, 0 ) as profit , right(aa.date,2) as date
+                FROM (SELECT DATE_FORMAT( @cdate := date_add( @cdate, INTERVAL - 1 MONTH ), '%Y-%m' ) date
+                FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 MONTH ) FROM hy_freight_info ) a LIMIT 12
+                ) aa LEFT JOIN (SELECT SUM(profit)/10000 profit,mon profit_date
+                FROM (SELECT profit,profit_date, DATE_FORMAT(profit_date,'%Y-%m') mon
+                FROM hy_freight_info WHERE profit_date >= DATE_SUB(CURDATE(),INTERVAL 1 YEAR)) a
+                GROUP BY mon DESC
+                ) b on aa.date = b.profit_date;
             </if>
             </if>
             <if test="searchType == 3">
             <if test="searchType == 3">
-
+                SELECT IFNULL( b.profit, 0 ) as profit,aa.date as date
+                FROM (SELECT DATE_FORMAT( @cdate := date_add( @cdate, INTERVAL - 1 YEAR ), '%Y' ) date
+                FROM ( SELECT @cdate := date_add( CURDATE(), INTERVAL 1 YEAR ) FROM hy_freight_info LIMIT 10) a ) aa
+                LEFT JOIN (SELECT SUM(profit)/10000 profit,year profit_date
+                FROM (SELECT profit, DATE_FORMAT(profit_date,'%Y') year
+                FROM hy_freight_info WHERE profit_date >= DATE_SUB(CURDATE(),INTERVAL 10 YEAR)) a
+                GROUP BY year) b on aa.date = b.profit_date;
             </if>
             </if>
         </if>
         </if>
     </select>
     </select>
+
+
+    <!-- 后台管理统计报表待结算费用 -->
+    <select id="getCostListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.FreightInfo">
+        SELECT
+				(SELECT
+				case when o.freight_advance = 1 then SUM(f.receivable_freight)/10000
+				else SUM(f.actual_freight + f.owner_service_charge)/10000 end
+				FROM hy_order_info o
+                LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
+                WHERE o.delete_flag = '0'
+                AND o.cargo_owner_status_key = '31'
+				AND o.invoicing = '0'
+				) as invoice,/*待开发票*/
+				(SELECT
+				case when SUM(r.not_repaid)/10000 IS NULL then 0
+				else SUM(r.not_repaid)/10000 end
+				FROM hy_order_info o
+                LEFT JOIN hy_repayment_info r on r.order_id = o.id and r.delete_flag = 0 and (r.status_key = '1' or r.status_key = '3')
+                WHERE o.delete_flag = '0'
+                AND o.cargo_owner_status_key = '27'
+				) as collection,/*代收款*/
+				(SELECT
+				case when SUM(amount_money)/10000 IS NULL then 0
+				else SUM(amount_money)/10000 end
+				FROM hy_cargo_owner_capital_info
+                WHERE delete_flag = '0'
+				AND status_key = '1'
+				AND types = '提现'
+				) as withdrawal,/*提现*/
+				(SELECT
+				case when SUM(amount_money)/10000 IS NULL then 0
+				else SUM(amount_money)/10000 end
+				FROM hy_freight_settlement_info
+                WHERE delete_flag = '0'
+				AND status_key = '1'
+				) as freight/*代付运费*/
+				FROM
+                hy_order_info ho
+				GROUP BY
+                ho.delete_flag = '0';
+    </select>
 </mapper>
 </mapper>

+ 2 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyFreightSettlementInfoMapper.xml

@@ -131,8 +131,10 @@
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo">
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyFreightSettlementInfo">
         SELECT
         SELECT
         f.id,
         f.id,
+        f.common_id as commonId,
         f.order_id as orderId,
         f.order_id as orderId,
         f.order_no as orderNo,
         f.order_no as orderNo,
+        f.document_no as documentNo,
         f.freight_advance as freightAdvance,
         f.freight_advance as freightAdvance,
         f.driver_name as driverName,
         f.driver_name as driverName,
         c.phone as driverPhone,
         c.phone as driverPhone,

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

@@ -385,11 +385,11 @@
         LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
         LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
         LEFT JOIN hy_repayment_info r on r.order_id = o.id and r.delete_flag = 0
         LEFT JOIN hy_repayment_info r on r.order_id = o.id and r.delete_flag = 0
         WHERE o.delete_flag = '0'
         WHERE o.delete_flag = '0'
-        <if test="startDate != null">
+        <if test="startDate != null and startDate != ''">
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &gt;=
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &gt;=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
             DATE_FORMAT(#{startDate},"%Y%m%d"))
         </if>
         </if>
-        <if test="endDate != null">
+        <if test="endDate != null and endDate != ''">
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &lt;=
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &lt;=
             DATE_FORMAT(#{endDate},"%Y%m%d"))
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         </if>
         </if>