Browse Source

回调e签包样式调整

njs 3 years ago
parent
commit
49dc97b344

+ 17 - 10
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -213,7 +213,7 @@ public class EsignController extends ApiBaseController {
         logger.info("签署完成跳转地址:{}",redirectUrl);
 
         String businessScene = "司机授权";
-        String fileName = deliveryNumber+"_签收订单.pdf";
+        String fileName = deliveryNumber+"_授权.pdf";
         /*根据userId查询个人注册后accountId*/
         String signerAccountId = "";
             SysUser sysUser = userService.selectUserById(Long.parseLong(userId));
@@ -242,28 +242,29 @@ public class EsignController extends ApiBaseController {
                 orderFile.setBeentrustName(beentrustName);
                 orderFile.setCarNumber(carNumber);
                 orderFile.setbId(bId);
+                orderFile.setTypes(1);
                 orderFile.setEntrustName(entrustName);
                 orderFile.setRun_time(runTime);
                 ESignUpPDFModal fileModal = eSignService.uploadDriver(orderFile);
                 /*1、根据传入订单id,查询订单相关信息生成PDF,调用e签宝上传方法返回文件fileId*/
                 Object fileId = fileModal.getFileId();
-                logger.info("签署订单返回文件id:{}",fileId);
+                logger.info("签署授权返回文件id:{}",fileId);
                 /*2、调用E签宝接口一步发起流程,得到返回的流程id*/
                 String flowId = signService.oneStepFlow(businessScene, fileId.toString(),fileModal.getX(),fileModal.getY(), fileName, signerAccountId, authorizedAccountId,redirectUrl);
-                logger.info("签署订单一步发起完成流程id:{}",flowId);
+                logger.info("签署授权一步发起完成流程id:{}",flowId);
                 orderFile.setFlowId(flowId);
                 orderFileService.insertOrderFile(orderFile);
-                logger.info("保存签署订单附件");
+                logger.info("保存授权签署附件");
                 File f = new File(fileModal.getFilePath());
                 f.delete();
             //}
            // }
-            logger.info("签署订单完成");
-            return AjaxResult.success("签收成功");
+            logger.info("授权成功");
+            return AjaxResult.success("授权成功");
         } catch (Exception e) {
             e.printStackTrace();
-            logger.error("签署订单失败:{}",e.getMessage());
-            return AjaxResult.error("签收失败");
+            logger.error("授权失败:{}",e.getMessage());
+            return AjaxResult.error("授权失败");
         }
     }
 
@@ -277,9 +278,15 @@ public class EsignController extends ApiBaseController {
     @PostMapping("updateOrderFile")
     public Object updateOrderFile() {
         ParameterObject obj = getParameterObject();
-        obj.checkParameterNotNull("flowId,signResult");
+        String businessScence =obj.getString("businessScence");
+        String signResult="";
+        if(!("司机授权").equals(businessScence)){
+            obj.checkParameterNotNull("flowId,signResult");
+             signResult = obj.getString("signResult");
+        }else{
+                signResult= obj.getString("flowStatus");
+        }
         String flowId = obj.getString("flowId");
-        String signResult = obj.getString("signResult");
         OrderFile orderFlag = orderFileService.selectOrderFileByFlowId(flowId);
 
         if ("2".equals(signResult)) {

+ 11 - 0
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/domain/OrderFile.java

@@ -94,6 +94,17 @@ public class OrderFile extends BaseEntity
     @Excel(name = "提货时间")
     private String run_time;
 
+    /** 类型1司机授权 */
+    @Excel(name = "类型1司机授权")
+    private Integer types;
+
+    public Integer getTypes() {
+        return types;
+    }
+
+    public void setTypes(Integer types) {
+        this.types = types;
+    }
 
     public String getRun_time() {
         return run_time;

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

@@ -201,10 +201,16 @@ public class EsignSignServiceImpl implements IEsignSignService {
 //        System.out.println("executeAysncTask1 method: 执行异步保存{} -------"+ i);
         String fileUrl = processDocumentDownload(flowId);
         /*下载保存签署后的文件,返回文件存储地址*/
-        downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_签收订单.pdf", fileUrl);
         OrderFile orderFile = new OrderFile();
         orderFile.setFlowId(flowId);
-        orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId() + "_签收订单.pdf");
+        if(orderFlag.getTypes()==1){
+            downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_授权.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getDeliveryNumber() + "_授权.pdf");
+        }else{
+        downloadFile(Global.getPdfPath(), orderFlag.getOrderId() + "_签收订单.pdf", fileUrl);
+            orderFile.setFileUrl(Constants.RESOURCE_PREFIX+"/pdf/"+DateUtils.datePath()+"/"+orderFlag.getOrderId() + "_签收订单.pdf");
+
+        }
 //        orderFile.setFileUrl(refile);
         orderFileService.updateOrderFileByFlowId(orderFile);
     }

+ 20 - 9
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/utils/pdf/PDFSelfUtil.java

@@ -234,7 +234,7 @@ public class PDFSelfUtil {
     public  static int generateEPDF(Document document, OrderSelfNote receivingNote, boolean flag) throws Exception {
         // 段落
         Paragraph paragraph;
-        paragraph = new Paragraph("客  户  自  提  委  托  书", titlefont);
+        paragraph = new Paragraph(/*"客  户  自  提  委  托  书", titlefont*/);
         paragraph.setAlignment(1); //设置文字居中 0靠左   1,居中     2,靠右
         paragraph.setIndentationLeft(12); //设置左缩进
         paragraph.setIndentationRight(12); //设置右缩进
@@ -295,16 +295,27 @@ public class PDFSelfUtil {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);
         // 表格
-        PdfPTable table = createTable(new float[] { 160, 60, 60,60});
+        PdfPTable table = createTable(new float[] { 80, 80, 80, 80, 80, 80 ,80,80});
+        table.addCell(createCell("客  户  自  提  委  托  书", headfont, Element.ALIGN_CENTER, 8, false));
+
+
+    /*    PdfPTable table = createTable(new float[] { 160, 60, 60,60});
         table.addCell(createCell("委托人(名称): " +receivingNote.getEntrustName()+"\n\n"+
                 "受托(提货)人:姓名: " +receivingNote.getBeentrustName()+"       身份证号码: " +receivingNote.getbId()+"        车牌: " +receivingNote.getCarNumber()+"\n\n"+
                 "     委托人委托受托人于   "+calendar.get(Calendar.YEAR)+" 年 "+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+" 日 "+"  来贵司提取交货单号为  "+receivingNote.getDeliveryNumber()+"    上所载明的货物。"+"\n\n"+
                 "          特此委托!。"+"\n\n\n\n"+
-                " 委托人: "+receivingNote.getEntrustName()+"\n\n"+
-                "受托(提货)人:"+receivingNote.getBeentrustName()+"\n\n", keyfont, Element.ALIGN_LEFT, 2, false));
-
-       // table.addCell(createCell(" 委托人:"+receivingNote.getEntrustName(), keyfont, Element.ALIGN_LEFT, 8, false));
-       // table.addCell(createCell(" 受托(提货)人:"+receivingNote.getBeentrustName(), keyfont, Element.ALIGN_LEFT, 9, false));
+                " 委托人: "+receivingNote.getEntrustName()+"\n\n", keyfont, Element.ALIGN_LEFT, 2, false));
+
+
+*/      table.addCell(createCell(" 委托人(名称):姓名: "+receivingNote.getEntrustName(), keyfont, Element.ALIGN_LEFT, 7, false));
+        table.addCell(createCell(" 受托(提货)人:姓名: "+receivingNote.getBeentrustName(), keyfont, Element.ALIGN_LEFT, 7, false));
+        table.addCell(createCell(" 身份证号码: "+receivingNote.getbId(), keyfont, Element.ALIGN_LEFT, 7, false));
+        table.addCell(createCell(" 车牌: "+receivingNote.getCarNumber(), keyfont, Element.ALIGN_LEFT, 7, false));
+        table.addCell(createCell(" 委托人委托受托人于 "+calendar.get(Calendar.YEAR)+" 年 "+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+" 日 ", keyfont, Element.ALIGN_LEFT, 8, false));
+        table.addCell(createCell(" 来贵司提取交货单号为  "+receivingNote.getDeliveryNumber()+"    上所载明的货物。", textfont, Element.ALIGN_CENTER, 11, false));
+        table.addCell(createCell(" 特此委托! ", keyfont, Element.ALIGN_LEFT, 7, false));
+        table.addCell(createCell(" 委托人:"+receivingNote.getEntrustName(), keyfont, Element.ALIGN_LEFT, 8, false));
+        table.addCell(createCell(" 受托(提货)人:"+receivingNote.getBeentrustName(), keyfont, Element.ALIGN_LEFT, 9, false));
         table.addCell(createCell(calendar.get(Calendar.YEAR)+"年"+(calendar.get(Calendar.MONTH)+1)+"月"+calendar.get(Calendar.DATE)+"日", keyfont, Element.ALIGN_RIGHT, 10, false));
         table.addCell(createCell("委托人盖章:", keyfont, Element.ALIGN_RIGHT, 11, false));
         document.add(paragraph1);
@@ -313,7 +324,7 @@ public class PDFSelfUtil {
                 "2、本委托书必须注明立邦公司交货单号。\n" +
                 "3、本委托书必须盖有与销售合同中预留相一致的印章。\n" +
                 "4、仓库不接受传真的公章印鉴(外埠客户因特殊原因自提时,携带的传真件必须得到当地办事处相关人员确认后方为有效)。\n" +
-                "5、本委托书自委托人确定的提货日期后的十日内有效。", keyfont, Element.ALIGN_LEFT, 12, false));
+                "5、本委托书自委托人确定的提货日期后的十日内有效。", textfont, Element.ALIGN_LEFT, 12, false));
 
 
         document.add(table);
@@ -706,7 +717,7 @@ public class PDFSelfUtil {
          * 创建空白的表格
          * @return
          */
-        public PdfPTable createBlankTable() {
+        public static PdfPTable createBlankTable() {
             PdfPTable table = new PdfPTable(1);
             table.getDefaultCell().setBorder(0);
             table.addCell(createCell("", keyfont));

+ 4 - 2
suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/OrderFileMapper.xml

@@ -28,10 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="beentrustName"    column="beentrust_Name"    />
         <result property="bId"    column="b_Id"    />
         <result property="carNumber"    column="car_Number"    />
+        <result property="types"    column="types"    />
     </resultMap>
 
     <sql id="selectOrderFileVo">
-        select order_id,delivery_number,shipment_number,ware_house_code,ware_house_name,code,message, flow_id,chains_code,customers_code,signer_id,signer_name, file_url, create_by, create_time, update_by, update_time, is_delete ,entrust_Name,beentrust_Name,b_Id,car_Number from ssb_order_file
+        select order_id,delivery_number,shipment_number,ware_house_code,ware_house_name,code,message, flow_id,chains_code,customers_code,signer_id,signer_name, file_url, create_by, create_time, update_by, update_time, is_delete ,entrust_Name,beentrust_Name,b_Id,car_Number,types from ssb_order_file
     </sql>
 
     <select id="selectOrderFileList" parameterType="OrderFile" resultMap="OrderFileResult">
@@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="beentrustName != null">beentrust_Name,</if>
             <if test="bId != null">b_Id,</if>
             <if test="carNumber != null">car_Number,</if>
+            <if test="types !=null">types,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">#{orderId},</if>
@@ -132,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="beentrustName != null">#{beentrustName},</if>
             <if test="bId != null">#{bId},</if>
             <if test="carNumber != null">#{carNumber},</if>
-
+            <if test="types !=null">#{types},</if>
          </trim>
     </insert>