ccjgmwz 3 years ago
parent
commit
58bb59c9f7

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application-local.yml

@@ -44,7 +44,7 @@ jasypt:
     password: yilaingyiyun
 logging:
   level:
-    root: DEBUG
+    root: INFO
   path: E:/winsea_platform6.0/logs
 oss:
   access:

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -12,7 +12,7 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   profiles:
-    active: local
+    active: prod
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:

BIN
winsea-haixin-platform-backend/src/main/resources/templates/Contract1.pdf


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

@@ -430,7 +430,11 @@ public class OrderInfo extends BaseModel<OrderInfo> {
      */
     @TableField(exist = false)
     private String carNumber;
-
+    /**
+     * 调用类型:1货主 2 司机
+     */
+    @TableField(exist = false)
+    private String typeFlag;
     @Override
     protected Serializable pkVal() {
         return this.id;

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

@@ -512,13 +512,40 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String setPdf(OrderInfo orderInfo) throws DocumentException, IOException, URISyntaxException {
-        OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
-        orderInfo1.setDriverContract("1");
-        orderInfo1.setDriverAutograph(orderInfo.getDriverAutograph());
-        String pdfUrl = pdfUtil.tranContract(orderInfo);
-        orderInfo1.setDriverContractUrl(pdfUrl);
-        this.updateById(orderInfo1);
-        return pdfUrl;
+        if(orderInfo.getTypeFlag().equals("1")){
+            OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
+            orderInfo1.setCargoOwnerContract("1");
+            orderInfo1.setCargoOwnerAutograph(orderInfo.getCargoOwnerAutograph());
+//            String pdfUrl = pdfUtil.tranContract(orderInfo1);
+//            orderInfo1.setOwnerContractUrl(pdfUrl);
+            this.updateById(orderInfo1);
+            return orderInfo1.getDriverContractUrl();
+        }
+        else{
+            OrderInfo orderInfo1 = this.selectById(orderInfo.getId());
+            orderInfo1.setDriverContract("1");
+            orderInfo1.setDriverAutograph(orderInfo.getDriverAutograph());
+            CarrierInfo carrierInfo =  carrierInfoService.selectOne(new EntityWrapper<CarrierInfo>()
+                    .eq("order_id", orderInfo.getId()));
+            carrierInfo.setCarNo(orderInfo.getCarNumber());
+            carrierInfoService.updateById(carrierInfo);
+            FreightInfo freightInfo = freightInfoService.selectOne(new EntityWrapper<FreightInfo>()
+                    .eq(FreightInfo.QueryFiles.ORDER_ID, orderInfo.getId()));
+            if(orderInfo1.getFreightAdvance().equals("0")){
+                freightInfo.setFreight(orderInfo.getFreight());
+            }
+            else{
+                
+            }
+            freightInfoService.updateById(freightInfo);
+            String pdfUrl = pdfUtil.tranContract(orderInfo);
+            orderInfo1.setContractNo(orderInfo1.getOrderNo().replace("CY","HT"));
+            orderInfo1.setDriverContractUrl(pdfUrl);
+            this.updateById(orderInfo1);
+            return pdfUrl;
+        }
+
     }
 }