Browse Source

经销商/自动签收

njs 1 year ago
parent
commit
37527ef746

+ 10 - 0
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/mapper/CustomersMapper.java

@@ -2,6 +2,7 @@ package com.dgtly.sync.mapper;
 
 import com.dgtly.sync.domain.Customers;
 import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -68,4 +69,13 @@ public interface CustomersMapper
     @MapKey("chainsCode")
     public Map<String,Customers> selectCustomerMapByChainsCode();
 
+    /**
+     * @description:根据经销商code查询名称
+     * @param:
+     * @return:
+     * @author: njs
+     * @date: 2023/8/29 9:32
+     */
+    public String selectCustomerNameByCustomerCode(@Param("customerCode")String customerCode);
+
 }

+ 10 - 0
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/ICustomersService.java

@@ -1,6 +1,7 @@
 package com.dgtly.sync.service;
 
 import com.dgtly.sync.domain.Customers;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -59,4 +60,13 @@ public interface ICustomersService
      * @return 结果
      */
     public int deleteCustomersById(Long id);
+
+    /**
+     * @description:根据经销商code查询名称
+     * @param:
+     * @return:
+     * @author: njs
+     * @date: 2023/8/29 9:32
+     */
+    public String selectCustomerNameByCustomerCode(String customerCode);
 }

+ 13 - 0
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/impl/CustomersServiceImpl.java

@@ -94,4 +94,17 @@ public class CustomersServiceImpl implements ICustomersService
     {
         return customersMapper.deleteCustomersById(id);
     }
+
+    /**
+     * @param customerCode
+     * @description:根据经销商code查询名称
+     * @param:
+     * @return:
+     * @author: njs
+     * @date: 2023/8/29 9:32
+     */
+    @Override
+    public String selectCustomerNameByCustomerCode(String customerCode) {
+        return customersMapper.selectCustomerNameByCustomerCode(customerCode);
+    }
 }

+ 6 - 1
suishenbang-sync/suishenbang-sync-common/src/main/resources/mapper/sync/CustomersMapper.xml

@@ -136,5 +136,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectCustomerMapByChainsCode" resultMap="CustomersResult">
        select chains_code ,chains_name  from customers where chains_code is not null
     </select>
-    
+
+    <select id="selectCustomerNameByCustomerCode" resultType="java.lang.String">
+        select chains_name from customers where 1=1
+        <if test="customerCode !=null and customerCode !='' ">and chains_code =#{customerCode}</if>
+        limit 1
+    </select>
 </mapper>

+ 5 - 1
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -7,6 +7,7 @@ import com.dgtly.common.core.controller.ApiBaseController;
 import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.common.utils.StringUtils;
+import com.dgtly.sync.service.ICustomersService;
 import com.dgtly.system.domain.AssRelcustomerinfo;
 import com.dgtly.system.domain.CustomersExt;
 import com.dgtly.system.domain.SysUser;
@@ -71,6 +72,8 @@ public class EsignController extends ApiBaseController {
     private ServerConfig serverConfig;
     @Autowired
     private IAssRelcustomerinfoService assRelcustomerinfoService;
+    @Autowired
+    private ICustomersService customersService;
     /**
      * @description: 经销商订单签收方法
      * 没有注册就注册,注册完就认证,然后再点击签署按钮,获取经销商用户id,对应主体id
@@ -131,7 +134,8 @@ public class EsignController extends ApiBaseController {
 //        String chainsCode = customersExtService.selectChainsCodeByOrderId(orderId);
             /*首先根据订单id-orderId查询订单是否已被签署*/
 //        OrderFile orderFlag = orderFileService.selectOrderFileById(orderId);
-            ESignUpPDFModal fileModal = eSignService.upload(orderId,tmsShipNumber,customerCode,sysUser.getSysUserExt().getOrgName(),sysUser.getUserName());
+            String customerName = customersService.selectCustomerNameByCustomerCode(customerCode);
+            ESignUpPDFModal fileModal = eSignService.upload(orderId,tmsShipNumber,customerCode,customerName,sysUser.getUserName());
             /*1、根据传入订单id,查询订单相关信息生成PDF,调用e签宝上传方法返回文件fileId*/
             Object fileId =fileModal.getFileId();
             logger.info("签署订单返回文件id:{}",fileId);

+ 6 - 6
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/EsignSignServiceImpl.java

@@ -260,14 +260,14 @@ public class EsignSignServiceImpl implements IEsignSignService {
         orderFile.setFlowId(flowId);
         if(orderFlag.getTypes()==1){
             downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + ".pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + ".pdf");
-            tmsCertificate(orderFlag.getDeliveryNumber(),Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + ".pdf");
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_司机授权.pdf");
+            tmsCertificate(orderFlag.getDeliveryNumber(),Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_司机授权.pdf");
         }else if( orderFlag.getTypes()==2){
-            downloadFile(Global.getPdfPath(), orderFlag.getFlowId()+uId + "_授权委托.pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getFlowId()+uId + "_授权委托.pdf");
+            downloadFile(Global.getPdfPath(), orderFlag.getFlowId()+uId + "_签收订单.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getFlowId()+uId + "_签收订单.pdf");
         }else{
-            downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + "_签收订单.pdf", fileUrl);
-            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_签收订单.pdf");
+            downloadFile(Global.getPdfPath(), orderFlag.getOrderId()+uId + "_授权委托.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId()+uId + "_授权委托.pdf");
 
         }
 //        orderFile.setFileUrl(refile);