Przeglądaj źródła

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

gongdecai 3 lat temu
rodzic
commit
a8a3fc3f78
15 zmienionych plików z 759 dodań i 68 usunięć
  1. BIN
      templates/Contract1.pdf
  2. 26 2
      winsea-haixin-platform-backend/src/main/java/com/yh/saas/platform/controller/AppendixController.java
  3. 10 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/OrderInfoController.java
  4. 4 4
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/HyCarrierInfo.java
  5. 16 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java
  6. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java
  7. 10 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IOrderInfoService.java
  8. 3 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerAddressInfoServiceImpl.java
  9. 24 4
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerCompInfoServiceImpl.java
  10. 1 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java
  11. 24 22
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/EvaluateInfoServiceImpl.java
  12. 617 28
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  13. 5 0
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/CompanyInfoMapper.xml
  14. 1 1
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/FleetInfoMapper.xml
  15. 17 4
      winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/OrderInfoMapper.xml

BIN
templates/Contract1.pdf


+ 26 - 2
winsea-haixin-platform-backend/src/main/java/com/yh/saas/platform/controller/AppendixController.java

@@ -16,8 +16,10 @@ import com.winsea.svc.base.base.util.ClientTypeChecker;
 import com.winsea.svc.base.base.view.CommonAppendixView;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.platform.util.GtAppendixUtil;
+import com.yh.saas.plugin.yiliangyiyun.util.GeneratorUtil;
 import lombok.Getter;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.velocity.shaded.commons.io.FilenameUtils;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -86,8 +88,8 @@ public class AppendixController implements InitializingBean {
     @Getter
     @Value("${oss.endpoint.internal:}")
     private String baseUrl;
-//    @Autowired
-//    private OSSClient ossClient;
+    @Autowired
+    private OSSClient ossClient;
     @Override
     public void afterPropertiesSet() throws Exception {
         host = "http://" + bucketName + "." + endpoint;
@@ -344,4 +346,26 @@ public class AppendixController implements InitializingBean {
 //        ossClient.putObject(putObjectRequest);
         return baseUrl + "eliangeyun/" +companyId+"/" +name;
     }
+    /**
+     * 后台通过服务器间接传文件
+     * @param file
+     * @return
+     * @throws IOException
+     */
+    @PostMapping("/admin")
+    @ResponseBody
+    public Object create(MultipartFile file) throws IOException {
+        ObjectMetadata objectMetadata = new ObjectMetadata();
+        objectMetadata.setContentLength(file.getSize());
+        objectMetadata.setContentType(file.getContentType());
+        String ext = FilenameUtils.getExtension(file.getOriginalFilename());
+        String uuid = GeneratorUtil.genFileName();
+        PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, "admin/" + uuid+"."+ext, file.getInputStream(), objectMetadata);
+        ossClient.putObject(putObjectRequest);
+        Map<String, Object> data = new HashMap<>();
+        data.put("url", baseUrl + "admin/" + uuid +"."+ext);
+        data.put("errno", 200);
+        data.put("errmsg", "成功");
+        return data;
+    }
 }

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

@@ -8,6 +8,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.IOrderInfoService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.text.ParseException;
@@ -177,6 +178,14 @@ public class OrderInfoController {
          orderInfoService.selectRouterPath();
     }
 
-
+    /**
+     * 后台管理订单导出
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/api/export")
+    public void export(@RequestBody OrderInfo orderInfo, HttpServletResponse response) throws Exception {
+        orderInfoService.export(orderInfo,response);
+    }
 }
 

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

@@ -66,8 +66,8 @@ public class HyCarrierInfo extends BaseModel<HyCarrierInfo> {
     /**
      * 装车时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date loadingDate;
     /**
      * 装车照片
@@ -116,8 +116,8 @@ public class HyCarrierInfo extends BaseModel<HyCarrierInfo> {
     /**
      * 卸车时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date unloadingDate;
     /**
      * 状态标识(1暂存3提交)

+ 16 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/OrderInfo.java

@@ -218,6 +218,16 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      * 司机开户支行
      */
     private String bankDepositBranch;
+    /**
+     * 司机已评价(1是)
+     */
+    private String driverEvaluated;
+    /**
+     * 货主已评价(1是)
+     */
+    private String ownerEvaluated;
+
+
     /**
      * 收款人姓名
      */
@@ -230,13 +240,17 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      * 开始时间
      */
     @TableField(exist = false)
-    private String startDate;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date startDate;
 
     /**
      * 结束时间
      */
     @TableField(exist = false)
-    private String endDate;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date endDate;
 
     /**
      * 模糊查询

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

@@ -37,6 +37,7 @@ public enum YExceptionEnum {
 	OWNER_ALREADY_EXISTS("ERROR16", "货主身份已存在,不可添加!"),
 	INSUFFICIENT_ACCOUNT_BALANCES("ERROR17", "您的账户余额不足,请充值!"),
 	CONDUCTED_ORDER("ERROR18", "您有正在进行的订单,不可抢单!"),
+	COMPANY_AUTHENTICATION("ERROR19", "您已经认证该企业,不能重复认证!"),
 	;
 	@Getter
 	private String value;

+ 10 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IOrderInfoService.java

@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.plugins.Page;
 import com.itextpdf.text.DocumentException;
 import com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo;
 import com.baomidou.mybatisplus.service.IService;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.text.ParseException;
@@ -111,4 +114,11 @@ public interface IOrderInfoService extends IService<OrderInfo> {
 
 
     void selectRouterPath() throws IOException;
+
+    /**
+     * 后台管理订单导出
+     * @return
+     * @throws Exception
+     */
+    void export(OrderInfo orderInfo, HttpServletResponse response) throws Exception;
 }

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

@@ -124,6 +124,9 @@ public class CargoOwnerAddressInfoServiceImpl extends ServiceImpl<CargoOwnerAddr
                     }else if("2".equals(hyCargoOwnerAddressInfo.getDefaultFlag())){
                         //取消默认收货
                         hyCargoOwnerAddressInfo1.setDefaultReceipt("0");
+                    }else {
+                        //取消置顶
+                        hyCargoOwnerAddressInfo1.setToppingFlag("0");
                     }
                     this.updateById(hyCargoOwnerAddressInfo1);
                 }

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

@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyAgentCargoOwnerInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyCargoOwnerCompInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyCargoOwnerInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.HyCompanyInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.GoodsSourceView;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CargoOwnerCompInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IAgentCargoOwnerInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.ICargoOwnerCompInfoService;
@@ -55,7 +58,15 @@ public class CargoOwnerCompInfoServiceImpl extends ServiceImpl<CargoOwnerCompInf
         hyCargoOwnerCompInfo.setId(IdGenerator.generateUUID());
         hyCargoOwnerCompInfo.setStatus(StatusEnum.COMPANY_EXAMINEING.getName());
         hyCargoOwnerCompInfo.setStatusKey(StatusEnum.COMPANY_EXAMINEING.getFlag());
-        this.insert(hyCargoOwnerCompInfo);
+        //判断是否已经认证
+        HyCargoOwnerCompInfo hyCargoOwnerCompInfo1 = this.selectOne(new EntityWrapper<HyCargoOwnerCompInfo>()
+                .eq("common_id",hyCargoOwnerCompInfo.getCommonId())
+                .eq("company",hyCargoOwnerCompInfo.getCompany())
+                .eq("delete_flag", NumberConstant.CONSTANT0));
+        if (hyCargoOwnerCompInfo1 != null) {
+            throw new YException(YExceptionEnum.COMPANY_AUTHENTICATION);
+        }
+        boolean one = this.insert(hyCargoOwnerCompInfo);
         //根据公司名称和法人名称获取公司用户id
         HyCompanyInfo hyCompanyInfo = companyInfoService.selectOne(new EntityWrapper<HyCompanyInfo>()
                 .eq("company_name", hyCargoOwnerCompInfo.getCompany())
@@ -75,9 +86,12 @@ public class CargoOwnerCompInfoServiceImpl extends ServiceImpl<CargoOwnerCompInf
         hyAgentCargoOwnerInfo.setCertificateAddressUrl(hyCargoOwnerCompInfo.getCertificateAddressUrl());
         hyAgentCargoOwnerInfo.setStatus(StatusEnum.TO_BE_REVIEWED.getName());
         hyAgentCargoOwnerInfo.setStatusKey(StatusEnum.TO_BE_REVIEWED.getFlag());
-        agentCargoOwnerInfoService.insert(hyAgentCargoOwnerInfo);
-        return "OK";
-
+        boolean two = agentCargoOwnerInfoService.insert(hyAgentCargoOwnerInfo);
+        if (one && two){
+            return "OK";
+        }else {
+            return "NG";
+        }
     }
 
     /**
@@ -105,6 +119,12 @@ public class CargoOwnerCompInfoServiceImpl extends ServiceImpl<CargoOwnerCompInf
         if (hyCargoOwnerCompInfo != null) {
             this.deleteById(hyCargoOwnerCompInfo.getId());
         }
+        //删除代理货主信息
+        HyAgentCargoOwnerInfo hyAgentCargoOwnerInfo = agentCargoOwnerInfoService.selectOne(new EntityWrapper<HyAgentCargoOwnerInfo>()
+        .eq("agent_common_id",hyCargoOwnerCompInfo.getCommonId()).eq("delete_flag","0"));
+        if (hyAgentCargoOwnerInfo != null){
+            agentCargoOwnerInfoService.deleteById(hyAgentCargoOwnerInfo.getId());
+        }
     }
 
     /**

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

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

+ 24 - 22
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/EvaluateInfoServiceImpl.java

@@ -77,6 +77,7 @@ public class EvaluateInfoServiceImpl extends ServiceImpl<EvaluateInfoMapper, Eva
             .eq("common_id",evaluateInfo.getEvaluatoredId()).eq("delete_flag","0"));
             hyDriverInfo.setFavorableRate(haoCount / count * 100);
             driverInfoService.updateById(hyDriverInfo);
+            orderInfo.setOwnerEvaluated("1");
         }
         //被评价人是货主
         else{
@@ -85,7 +86,9 @@ public class EvaluateInfoServiceImpl extends ServiceImpl<EvaluateInfoMapper, Eva
                     .eq("common_id",evaluateInfo.getEvaluatoredId()).eq("delete_flag","0"));
             hyCargoOwnerInfo.setFavorableRate(haoCount / count * 100);
             cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+            orderInfo.setDriverEvaluated("1");
         }
+        orderInfoService.updateById(orderInfo);
         return "OK";
     }
 
@@ -113,33 +116,32 @@ public class EvaluateInfoServiceImpl extends ServiceImpl<EvaluateInfoMapper, Eva
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<EvaluateInfo> dataList = baseMapper.getListByCondition(pageView);
 
-        //查询好评数
-        Map<String, Object> pageView1 = new HashMap<>(7);
-        pageView.put("evaluatoredId", evaluateInfo.getEvaluatoredId());
-        pageView1.put("haoType", "1");
-        pageView.put("searchType", evaluateInfo.getSearchType());
-        pageView1.put("flag", evaluateInfo.getFlag());
-        Integer dataCount1 = baseMapper.getCountByCondition(pageView);
-        //查询差评数
-        Map<String, Object> pageView2 = new HashMap<>(7);
-        pageView.put("evaluatoredId", evaluateInfo.getEvaluatoredId());
-        pageView2.put("haoType", "2");
-        pageView.put("searchType", evaluateInfo.getSearchType());
-        pageView2.put("flag", evaluateInfo.getFlag());
-        Integer dataCount2 = baseMapper.getCountByCondition(pageView);
+//        //查询好评数
+//        Map<String, Object> pageView1 = new HashMap<>(7);
+//        pageView.put("evaluatoredId", evaluateInfo.getEvaluatoredId());
+//        pageView1.put("haoType", "1");
+//        pageView.put("searchType", evaluateInfo.getSearchType());
+//        pageView1.put("flag", evaluateInfo.getFlag());
+//        Integer dataCount1 = baseMapper.getCountByCondition(pageView);
+//        //查询差评数
+//        Map<String, Object> pageView2 = new HashMap<>(7);
+//        pageView.put("evaluatoredId", evaluateInfo.getEvaluatoredId());
+//        pageView2.put("haoType", "2");
+//        pageView.put("searchType", evaluateInfo.getSearchType());
+//        pageView2.put("flag", evaluateInfo.getFlag());
+//        Integer dataCount2 = baseMapper.getCountByCondition(pageView);
 
         if(CollectionUtil.isNotEmpty(dataList)){
             for(int i =0 ;i<dataList.size();i++){
                 EvaluateInfo evaluateInfo1= dataList.get(i);
                 evaluateInfo1.setOrderInfo(orderInfoService.selectById(evaluateInfo1.getOrderId()));
-                evaluateInfo1.setHaoCount(String.valueOf(dataCount1));
-                evaluateInfo1.setChaCount(String.valueOf(dataCount2));
-
-                CommonUser commonUser1 = commonUserService.selectOne(new EntityWrapper<CommonUser>()
-                        .eq("id", dataList.get(i).getEvaluatorId()));
-                if (commonUser1 != null) {
-                    evaluateInfo1.setOwnerPortrait(commonUser1.getAvatarUrl());
-                }
+//                evaluateInfo1.setHaoCount(String.valueOf(dataCount1));
+//                evaluateInfo1.setChaCount(String.valueOf(dataCount2));
+//                CommonUser commonUser1 = commonUserService.selectOne(new EntityWrapper<CommonUser>()
+//                        .eq("id", dataList.get(i).getEvaluatorId()));
+//                if (commonUser1 != null) {
+//                    evaluateInfo1.setOwnerPortrait(commonUser1.getAvatarUrl());
+//                }
             }
 
         }

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

@@ -1,9 +1,13 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.ObjectMetadata;
+import com.aliyun.oss.model.PutObjectRequest;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.google.common.collect.Lists;
 import com.itextpdf.text.DocumentException;
+import com.winsea.svc.base.base.util.DateUtils;
 import com.yh.saas.common.support.util.IdGenerator;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
@@ -13,16 +17,16 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.OrderInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
 import org.activiti.engine.impl.util.CollectionUtil;
 import org.apache.commons.collections.CollectionUtils;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
+import java.io.*;
 import java.net.HttpURLConnection;
 import java.net.URL;
 
+import org.apache.commons.httpclient.util.DateUtil;
 import org.apache.http.HttpStatus;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -33,11 +37,20 @@ import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletResponse;
 import java.net.URISyntaxException;
+import java.net.URLDecoder;
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -52,6 +65,7 @@ import java.util.*;
  * @since 2022-02-16
  */
 @Service
+@Slf4j
 public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements IOrderInfoService {
 
     @Autowired
@@ -80,6 +94,18 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
     private IHyCargoOwnerCapitalInfoService hyCargoOwnerCapitalInfoService;
     @Autowired
     private IHyDriverCapitalInfoService hyDriverCapitalInfoService;
+    @Value("${file-root-path}")
+    private String localPath;
+    @Getter
+    @Value("${oss.endpoint.internal:}")
+    private String baseUrl;
+    @Getter
+    @Value("${oss.bucket.name:}")
+    private String bucket;
+    @Autowired
+    private OSSClient ossClient;
+
+
 
     /**
      * 司机订单列表
@@ -222,7 +248,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         if ("1".equals(evaluateFlag)) {
             //查询司机发运次数
             Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
-                    .eq("common_id", commonId).eq("order_status_key", "23").eq("delete_flag", "0"));
+                    .eq("common_id", commonId).eq("order_status_key", "25").eq("delete_flag", "0"));
             orderInfo.setCountFa(String.valueOf(count));
             //查询好评数
             Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
@@ -254,7 +280,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         } else {
             //查询货主发运次数
             Integer count = this.selectCount(new EntityWrapper<OrderInfo>()
-                    .eq("cargo_common_id", commonId).eq("cargo_owner_status_key", "23").eq("delete_flag", "0"));
+                    .eq("cargo_common_id", commonId).eq("cargo_owner_status_key", "31").eq("delete_flag", "0"));
             orderInfo.setCountFa(String.valueOf(count));
             //查询好评数
             Integer evaluateInfoCount = evaluateInfoService.selectCount(new EntityWrapper<EvaluateInfo>()
@@ -429,28 +455,30 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
             orderInfo1.setCargoOwnerStatus(StatusEnum.OWNER_ORDER_FINISH.getName());
             this.updateById(orderInfo1);
         }
-        //查询费用表
-        FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>().eq("order_id",orderInfo1.getId())
-                .eq("delete_flag","0"));
-        //司机承运次数+1,计算累计支付运费
-        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
-                .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
-        if (hyDriverInfo != null) {
-            Long count = hyDriverInfo.getShipmentsNumber() + 1;
-            hyDriverInfo.setShipmentsNumber(count);
-            Double d = hyDriverInfo.getAccumulatedFreight();
-            hyDriverInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()-freightInfo.getDriverServiceCharge());
-            driverInfoService.updateById(hyDriverInfo);
-        }
-        //货主发运次数+1,计算累计支付运费
-        HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
-                .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
-        if (hyCargoOwnerInfo != null) {
-            Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
-            hyCargoOwnerInfo.setShipmentsNumber(count);
-            Double d = hyCargoOwnerInfo.getAccumulatedFreight();
-            hyCargoOwnerInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()+freightInfo.getOwnerServiceCharge());
-            cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+        if("1".equals(orderInfo1.getFreightAdvance())){
+            //查询费用表
+            FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>().eq("order_id",orderInfo1.getId())
+                    .eq("delete_flag","0"));
+            //司机承运次数+1,计算累计支付运费
+            HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                    .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
+            if (hyDriverInfo != null) {
+                Long count = hyDriverInfo.getShipmentsNumber() + 1;
+                hyDriverInfo.setShipmentsNumber(count);
+                Double d = hyDriverInfo.getAccumulatedFreight();
+                hyDriverInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()-freightInfo.getDriverServiceCharge());
+                driverInfoService.updateById(hyDriverInfo);
+            }
+            //货主发运次数+1,计算累计支付运费
+            HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
+                    .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+            if (hyCargoOwnerInfo != null) {
+                Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
+                hyCargoOwnerInfo.setShipmentsNumber(count);
+                Double d = hyCargoOwnerInfo.getAccumulatedFreight();
+                hyCargoOwnerInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()+freightInfo.getOwnerServiceCharge());
+                cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+            }
         }
         return "ok";
     }
@@ -704,6 +732,26 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         hyDriverCapitalInfo.setOrderId(orderInfo1.getId());
                         hyDriverCapitalInfo.setOrderNo(orderInfo1.getOrderNo());
                         hyDriverCapitalInfoService.insert(hyDriverCapitalInfo);
+                        //司机承运次数+1,计算累计支付运费
+                        HyDriverInfo hyDriverInfo = driverInfoService.selectOne(new EntityWrapper<HyDriverInfo>()
+                                .eq("common_id", orderInfo1.getCommonId()).eq("delete_flag", "0"));
+                        if (hyDriverInfo != null) {
+                            Long count = hyDriverInfo.getShipmentsNumber() + 1;
+                            hyDriverInfo.setShipmentsNumber(count);
+                            Double d = hyDriverInfo.getAccumulatedFreight();
+                            hyDriverInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()-freightInfo.getDriverServiceCharge());
+                            driverInfoService.updateById(hyDriverInfo);
+                        }
+                        //货主发运次数+1,计算累计支付运费
+                        HyCargoOwnerInfo hyCargoOwnerInfo = cargoOwnerInfoService.selectOne(new EntityWrapper<HyCargoOwnerInfo>()
+                                .eq("common_id", orderInfo1.getCargoCommonId()).eq("delete_flag", "0"));
+                        if (hyCargoOwnerInfo != null) {
+                            Long count = hyCargoOwnerInfo.getShipmentsNumber() + 1;
+                            hyCargoOwnerInfo.setShipmentsNumber(count);
+                            Double d = hyCargoOwnerInfo.getAccumulatedFreight();
+                            hyCargoOwnerInfo.setAccumulatedFreight(d+freightInfo.getActualFreight()+freightInfo.getOwnerServiceCharge());
+                            cargoOwnerInfoService.updateById(hyCargoOwnerInfo);
+                        }
                     }
                     //垫付订单
                     else {
@@ -936,4 +984,545 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
         httpUrlConn.disconnect();
         return buffer.toString();
     }
+
+
+    /**
+     * 后台管理订单导出
+     * @param orderInfo
+     * @param response
+     * @throws Exception
+     */
+    @Override
+    public void export(OrderInfo orderInfo, HttpServletResponse response) throws Exception {
+        // 1.Excel的头部信息
+        String headerTitle = "";
+
+        // 2.创建一个webbook 对应一个Excel文件
+        HSSFWorkbook wb = new HSSFWorkbook();
+
+        // 3.在webbook中添加一个sheet,对应Excel文件中的sheet
+        HSSFSheet sheet;
+
+        sheet = wb.createSheet("订单信息");
+        headerTitle = "订单信息";
+
+        // 4.设置打印参数
+        sheet.setMargin(HSSFSheet.TopMargin, (short) 1);// 页边距(上)
+        sheet.setMargin(HSSFSheet.BottomMargin, (short) 1);// 页边距(下)
+        sheet.setMargin(HSSFSheet.LeftMargin, (short) 1);// 页边距(左)
+        sheet.setMargin(HSSFSheet.RightMargin, (short) 1);// 页边距(右)
+
+        // 不显示网格
+        sheet.setDisplayGridlines(false);
+        // 设置水平居中
+        sheet.setHorizontallyCenter(true);
+
+        /**************** 数据行样式 start ****************/
+        HSSFFont fontTitle = wb.createFont();
+        fontTitle.setFontName("宋体");
+        fontTitle.setFontHeightInPoints((short) 14);
+        // 设置字体加粗
+        fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+
+        HSSFFont fontComp = wb.createFont();
+        fontComp.setFontName("宋体");
+        fontComp.setFontHeightInPoints((short) 16);
+        // 设置字体加粗
+        fontComp.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+
+        HSSFFont fontDetail = wb.createFont();
+        fontDetail.setFontName("宋体");
+        fontDetail.setFontHeightInPoints((short) 12);
+
+        HSSFFont fontDetail1 = wb.createFont();
+        fontDetail1.setFontName("宋体");
+        fontDetail1.setFontHeightInPoints((short) 12);
+        fontDetail1.setColor(HSSFColor.RED.index);
+
+        // title
+        HSSFCellStyle styleTitle = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleTitle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleTitle.setWrapText(true);
+        // 设置单元格字体
+        styleTitle.setFont(fontTitle);
+        // 右边框
+        styleTitle.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleTitle.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleTitle.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleTitle.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        // title
+        HSSFCellStyle styleComp = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleComp.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleComp.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleComp.setWrapText(true);
+        // 设置单元格字体
+        styleComp.setFont(fontComp);
+        // 右边框
+        styleComp.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleComp.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleComp.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleComp.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        HSSFCellStyle styleInfo = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleInfo.setAlignment(HSSFCellStyle.ALIGN_LEFT);
+        // 指定单元格垂直居中对齐
+        styleInfo.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleInfo.setWrapText(true);
+        // 设置单元格字体
+        styleInfo.setFont(fontDetail);
+        // 右边框
+        styleInfo.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleInfo.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleInfo.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleInfo.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        HSSFCellStyle styleDetail = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetail.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleDetail.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetail.setWrapText(true);
+        // 设置单元格字体
+        styleDetail.setFont(fontDetail);
+        // 右边框
+        styleDetail.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetail.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetail.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetail.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+
+        HSSFCellStyle styleDetail1 = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetail1.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleDetail1.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetail1.setWrapText(true);
+        // 设置单元格字体
+        styleDetail1.setFont(fontDetail1);
+        // 右边框
+        styleDetail1.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetail1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetail1.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetail1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+
+        HSSFCellStyle contextstyle = wb.createCellStyle();
+        // 指定单元格居中对齐
+        contextstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        contextstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        contextstyle.setWrapText(true);
+        // 设置单元格字体
+        contextstyle.setFont(fontDetail);
+        // 右边框
+        contextstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        contextstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        contextstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        contextstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+
+        HSSFCellStyle styleDetailYellow = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetailYellow.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleDetailYellow.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetailYellow.setWrapText(true);
+        // 设置单元格字体
+        styleDetailYellow.setFont(fontDetail);
+        // 右边框
+        styleDetailYellow.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetailYellow.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetailYellow.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetailYellow.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        styleDetailYellow.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
+        styleDetailYellow.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+
+
+        HSSFCellStyle styleDetailLeft = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetailLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT);
+        // 指定单元格垂直居中对齐
+        styleDetailLeft.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetailLeft.setWrapText(true);
+        // 设置单元格字体
+        styleDetailLeft.setFont(fontDetail);
+        // 右边框
+        styleDetailLeft.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetailLeft.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetailLeft.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetailLeft.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        /**************** 数据行样式 end ****************/
+
+        // 设置列宽
+        sheet.setColumnWidth(0, 1 * 256 + 184);
+        sheet.setColumnWidth(1, 12 * 256 + 184);
+        sheet.setColumnWidth(2, 12 * 256 + 184);
+        sheet.setColumnWidth(3, 12 * 256 + 184);
+        sheet.setColumnWidth(4, 12 * 256 + 184);
+        sheet.setColumnWidth(5, 12 * 256 + 184);
+        sheet.setColumnWidth(6, 12 * 256 + 184);
+        sheet.setColumnWidth(7, 12 * 256 + 184);
+        sheet.setColumnWidth(8, 12 * 256 + 184);
+        sheet.setColumnWidth(9, 12 * 256 + 184);
+        sheet.setColumnWidth(10, 12 * 256 + 184);
+        sheet.setColumnWidth(11, 12 * 256 + 184);
+        sheet.setColumnWidth(12, 12 * 256 + 184);
+        sheet.setColumnWidth(13, 12 * 256 + 184);
+        sheet.setColumnWidth(14, 12 * 256 + 184);
+        sheet.setColumnWidth(15, 12 * 256 + 184);
+        sheet.setColumnWidth(16, 12 * 256 + 184);
+        sheet.setColumnWidth(17, 12 * 256 + 184);
+        sheet.setColumnWidth(18, 12 * 256 + 184);
+        sheet.setColumnWidth(19, 12 * 256 + 184);
+        sheet.setColumnWidth(20, 1 * 256 + 184);
+
+        // 创建单元格对象
+        HSSFCell cell = null;
+
+        // 创建打印设置对象
+        HSSFPrintSetup ps = sheet.getPrintSetup();
+        // 打印方向,true:横向,false:纵向(默认)
+        ps.setLandscape(false);
+        // // 打印质量
+        // ps.setVResolution((short) 700)
+        // 设置缩放比例
+        ps.setScale((short) 80);
+        // 纸张类型
+        ps.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
+
+
+        int rownum = 1;
+        HSSFRow row0 = sheet.createRow((int) rownum);
+        row0.setHeightInPoints(25);
+        cell = row0.createCell(1);
+        cell.setCellStyle(styleTitle);
+        cell.setCellValue("订单信息");
+        sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 1, (short) 19));
+        cell = row0.createCell(2);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(3);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(4);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(5);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(6);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(7);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(8);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(9);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(10);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(11);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(12);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(13);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(14);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(15);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(16);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(17);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(18);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(19);
+        cell.setCellStyle(styleTitle);
+        rownum++;
+
+
+        HSSFRow row1 = sheet.createRow((int) rownum);
+        row1.setHeightInPoints(30);
+        cell = row1.createCell(1);
+        cell.setCellValue("订单编号");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(2);
+        cell.setCellValue("垫付类型");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(3);
+        cell.setCellValue("货主");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(4);
+        cell.setCellValue("司机");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(5);
+        cell.setCellValue("预计运费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(6);
+        cell.setCellValue("实际运费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(7);
+        cell.setCellValue("预付运费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(8);
+        cell.setCellValue("司机费用结算");
+        sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 8, (short) 11));
+        cell.setCellValue("服务费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(9);
+        cell.setCellValue("应付(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(10);
+        cell.setCellValue("已付(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(11);
+        cell.setCellValue("未付(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(12);
+        cell.setCellValue("货主费用结算");
+        sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 12, (short) 15));
+        cell.setCellValue("服务费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(13);
+        cell.setCellValue("超期费(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(14);
+        cell.setCellValue("应收(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(15);
+        cell.setCellValue("已收(元)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(16);
+        cell.setCellValue("发票");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(17);
+        cell.setCellValue("合同");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(18);
+        cell.setCellValue("更新时间");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(19);
+        cell.setCellValue("状态");
+        cell.setCellStyle(styleDetail);
+        rownum++;
+
+
+        Map<String, Object> pageView = new HashMap<>();
+        //开始时间
+        pageView.put("startDate", orderInfo.getStartDate());
+        pageView.put("endDate", orderInfo.getEndDate());
+        // 查询订单列表
+        List<OrderInfo> dataList = baseMapper.getListhByCondition(pageView);
+
+
+        // 详情信息
+        if (!org.springframework.util.CollectionUtils.isEmpty(dataList)) {
+            for (int i = 0; i < dataList.size(); i++) {
+                OrderInfo orderInfo1 = dataList.get(i);
+                HSSFRow rowx = sheet.createRow((int) rownum);
+                rowx.setHeightInPoints(20);
+                cell = rowx.createCell(1);
+                cell.setCellValue(editString(orderInfo1.getOrderNo()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(2);
+                cell.setCellValue(editString(orderInfo1.getFreightAdvance()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(3);
+                cell.setCellValue(editString(orderInfo1.getCargoOwner() + "(" + orderInfo1.getCargoOwnerPhone() +")"));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(4);
+                cell.setCellValue(editString(orderInfo1.getDriverName() + "(" + orderInfo1.getDriverPhone() +")"));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(5);
+                cell.setCellValue(editDouble(orderInfo1.getFreight()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(6);
+                cell.setCellValue(editDouble(orderInfo1.getActualFreight()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(7);
+                cell.setCellValue(editDouble(orderInfo1.getAdvanceCharge()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(8);
+                cell.setCellValue(editDouble(orderInfo1.getDriverServiceCharge()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(9);
+                cell.setCellValue(editDouble(orderInfo1.getPayable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(10);
+                cell.setCellValue(editDouble(orderInfo1.getPayabled()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(11);
+                cell.setCellValue(editDouble(orderInfo1.getNopayable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(12);
+                cell.setCellValue(editDouble(orderInfo1.getOwnerServiceCharge()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(13);
+                cell.setCellValue(editDouble(orderInfo1.getOverdueFee()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(14);
+                cell.setCellValue(editDouble(orderInfo1.getReceivable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(15);
+                cell.setCellValue(editDouble(orderInfo1.getReceivabled()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(16);
+                cell.setCellValue(editString(orderInfo1.getInvoicing()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(17);
+                cell.setCellValue(editString(orderInfo1.getDriverContractUrl()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(18);
+                cell.setCellValue(orderInfo1.getUpdateDate());
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(19);
+                cell.setCellValue(editString(orderInfo1.getOrderStatus()));
+                cell.setCellStyle(styleDetail);
+                rownum++;
+            }
+
+        }
+
+        String path = null;
+        String tempPath = null;
+        String excelPath = null;
+
+        try {
+
+            // 取得绝对路径
+            tempPath = URLDecoder.decode((localPath), "utf-8");
+
+            // EXCEL路径
+            excelPath = "/web/temp/pay/" + DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYYMMDD_NS) + '/'
+                    + UUID.randomUUID().toString().replaceAll("-", "");
+
+            path = tempPath + excelPath + '/' + "订单信息"
+                    + ".xlsx";
+
+        } catch (Exception e) {
+            log.debug(e.getMessage());
+        }
+        // 下载
+        download(path, response, wb);
+
+    }
+
+    /**
+     * 后台通过服务器间接传文件
+     *
+     * @param file
+     * @return
+     * @throws IOException
+     */
+    public String upload(MultipartFile file, String name) throws IOException {
+        ObjectMetadata objectMetadata = new ObjectMetadata();
+        objectMetadata.setContentLength(file.getSize());
+        objectMetadata.setContentType(file.getContentType());
+        PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, "pcfiles/" + name + ".xlsx", file.getInputStream(), objectMetadata);
+        ossClient.putObject(putObjectRequest);
+        return baseUrl + "pcfiles/" + name + ".xlsx";
+    }
+    
+
+    /**
+     * 判断浮点数
+     *
+     * @param example
+     * @return
+     */
+    private Double editDouble(Double example) {
+        Double exampleOne = example != null ? example : 0.00;
+        return exampleOne;
+    }
+
+    /**
+     * 判断字符串
+     *
+     * @param example
+     * @return
+     */
+    private String editString(String example) {
+        String exampleOne = example != null ? example : "";
+        return exampleOne;
+    }
+
+    /**
+     * 下载
+     *
+     * @param path
+     * @param response
+     */
+    private void download(String path, HttpServletResponse response, Workbook wb) {
+
+        try {
+
+            // path是指欲下载的文件的路径。
+            File file = new File(path);
+            // 取得文件名。
+            String fileName = file.getName();
+            // 给文件名编码
+            fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
+
+            response.setContentType("application/vnd.ms-excel");
+            response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
+
+            // 定义byte输出流
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+            // 写导出文件
+            wb.write(out);
+
+            // 取得模板文件中的数据
+            byte[] result = out.toByteArray();
+
+            // 设置输出数据类型
+            response.setContentType("application/vnd.ms-excel");
+            // 设置输出数据长度
+            response.setContentLength(result.length);
+
+            // 设置文件名称
+            response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
+            // 将文件流输出到画面
+            response.getOutputStream().write(result);
+
+            out.flush();
+            out.close();
+
+        } catch (IOException ex) {
+            log.debug(ex.getMessage());
+        }
+
+    }
 }

+ 5 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/CompanyInfoMapper.xml

@@ -79,6 +79,11 @@
         c.property_address_url as propertyAddressUrl,
         c.advance_freight_service as advanceFreightService,
         c.video_address_url as videoAddressUrl,
+        c.mailing_address as mailingAddress,
+        c.card_address_url as cardAddressUrl,
+        c.card_back_address_url as cardBackAddressUrl,
+        c.card_number as cardNumber,
+        c.card_validity_date as cardValidityDate,
         c.status_key as statusKey,
         c.status,
         c.create_date as createDate,

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

@@ -36,7 +36,7 @@
         f.cover_url as coverUrl,
         f.fleet_url as fleetUrl,
         fm.status as fleetMemberStatus,
-        (SELECT group_concat(driver_portrait) from fleet_member_info m where m.fleet_id = f.id
+        (SELECT group_concat(driver_portrait) from hy_fleet_member_info m where m.fleet_id = f.id
         and m.delete_flag = 0 and m.status_key = 5 LIMIT 3) as fleetMemberUrl
         FROM hy_fleet_info f
         LEFT JOIN hy_fleet_member_info fm on fm.fleet_id = f.id and fm.delete_flag = 0 and fm.common_id = #{commonId}

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

@@ -72,12 +72,16 @@
         o.distance,
         o.freight,
         o.billing_method as billingMethod,
+        o.driver_evaluated as driverEvaluated,
         o.order_status as orderStatus,
         o.order_status_key as orderStatusKey,
         o.create_date as createDate,
         o.update_date as updateDate,
-        c.id as carrierId
+        c.id as carrierId,
+        c.car_no as carNumber,
+        cu.avatar_url as cargoOwnerPortrait
         FROM hy_order_info o
+        LEFT JOIN common_user cu on o.cargo_common_id = cu.id and cu.delete_flag = 0
         LEFT JOIN hy_carrier_info c on c.order_id = o.id and c.delete_flag = 0
         LEFT JOIN hy_freight_info f on f.order_id = o.id and f.delete_flag = 0
         WHERE o.delete_flag = '0'
@@ -209,6 +213,7 @@
         o.distance,
         o.freight,
         o.billing_method as billingMethod,
+        o.owner_evaluated as ownerEvaluated,
         o.cargo_owner_status as cargoOwnerStatus,
         o.cargo_owner_status_key as cargoOwnerStatusKey,
         o.create_date as createDate,
@@ -353,6 +358,14 @@
         case when o.invoicing = 1 then '已开' else '未开' end as invoicing,
         o.driver_contract_url as driverContractUrl,
         o.owner_contract_url as ownerContractUrl,
+        o.send_private as sendPrivate,
+        o.send_city as sendCity,
+        o.send_area as sendArea,
+        o.send_detailed_address as sendDetailedAddress,
+        o.unload_private as unloadPrivate,
+        o.unload_city as unloadCity,
+        o.unload_area as unloadArea,
+        o.unload_detailed_address as unloadDetailedAddress,
         o.order_status as orderStatus,
         o.order_status_key as orderStatusKey,
         o.cargo_owner_status as cargoOwnerStatus,
@@ -363,11 +376,11 @@
         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
         WHERE o.delete_flag = '0'
-        <if test="startDate != null and startDate != ''">
+        <if test="startDate != null">
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &gt;=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
         </if>
-        <if test="endDate != null and endDate != ''">
+        <if test="endDate != null">
             AND (DATE_FORMAT(o.update_date,"%Y%m%d") &lt;=
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         </if>
@@ -408,7 +421,7 @@
     select * from hy_order_info where delete_flag = '0'
     AND common_id = #{commonId}
     AND DATE_SUB(CURDATE(), INTERVAL 1 MONTH) &lt;= date(create_date)
-    AND order_status_key &lt; '15'
+    AND order_status_key &lt; 15
     ORDER BY update_date DESC
     </select>