Ver código fonte

提交签署文件列表代码

zhangding 4 anos atrás
pai
commit
85a159f603

+ 2 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/CustomersExtMapper.java

@@ -64,4 +64,6 @@ public interface CustomersExtMapper
     public int deleteCustomersExtByIds(String[] chainsCodes);
 
     String selectOrgIdByOrderId(String orderId);
+
+    String selectchainsCodeByOrderId(String orderId);
 }

+ 8 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/ICustomersExtService.java

@@ -70,4 +70,12 @@ public interface ICustomersExtService
      * @date: 2020/10/19 11:31
      */ 
     String selectOrgIdByOrderId(String orderId);
+    /**
+     * @descption: 根据订单编号查询组织代号
+     * @param: [orderId]
+     * @return: java.lang.String
+     * @auther: ZhangDing
+     * @date: 2020-10-20 10:05
+     */
+    String selectchainsCodeByOrderId(String orderId);
 }

+ 5 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/CustomersExtServiceImpl.java

@@ -101,4 +101,9 @@ public class CustomersExtServiceImpl implements ICustomersExtService
     public String selectOrgIdByOrderId(String orderId) {
         return customersExtMapper.selectOrgIdByOrderId(orderId);
     }
+
+    @Override
+    public String selectchainsCodeByOrderId(String orderId) {
+        return null;
+    }
 }

+ 11 - 0
suishenbang-system/src/main/resources/mapper/system/CustomersExtMapper.xml

@@ -52,6 +52,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t.order_number = #{orderId};
     </select>
 
+    <!--根据订单id关联订单基础信息表查询经销商代号-->
+    <select id="selectchainsCodeByOrderId" resultType="java.lang.String">
+        SELECT
+            s.chains_code
+        FROM
+            sales_order_base t
+        LEFT JOIN customers_ext s ON t.belong_to = s.chains_code
+        WHERE
+            t.order_number = #{orderId};
+    </select>
+
     <insert id="insertCustomersExt" parameterType="CustomersExt">
         insert into customers_ext
         <trim prefix="(" suffix=")" suffixOverrides=",">

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

@@ -79,7 +79,8 @@ public class EsignController extends ApiBaseController {
         }
         /*根据订单id关联查询企业注册后id*/
         String authorizedAccountId =customersExtService.selectOrgIdByOrderId(orderId);
-
+        /* 根据订单id关联查询企业代号*/
+        String chainsCode = customersExtService.selectchainsCodeByOrderId(orderId);
         /*首先根据订单id-orderId查询订单是否已被签署*/
         OrderFile orderFlag = orderFileService.selectOrderFileById(orderId);
         if (orderFlag==null) {
@@ -92,6 +93,7 @@ public class EsignController extends ApiBaseController {
             /*4、保存订单id和flowId*/
             OrderFile orderFile = new OrderFile();
             orderFile.setOrderId(orderId);
+            orderFile.setChainsCode(chainsCode);
             orderFile.setCustomersCode(authorizedAccountId);
             orderFile.setSignerId(signerAccountId);
             orderFile.setSignerName(sysUser.getUserName());

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

@@ -19,6 +19,13 @@ public class OrderFile extends BaseEntity
     @Excel(name = "订单id")
     private String orderId;
 
+    /** 经销商代号 */
+    @Excel(name = "经销商代号")
+    private String chainsCode;
+
+    /**经销商名称*/
+    private String chainsName;
+
     /** 经销商id */
     @Excel(name = "经销商id")
     private String customersCode;
@@ -104,6 +111,22 @@ public class OrderFile extends BaseEntity
         this.signerName = signerName;
     }
 
+    public String getChainsCode() {
+        return chainsCode;
+    }
+
+    public void setChainsCode(String chainsCode) {
+        this.chainsCode = chainsCode;
+    }
+
+    public String getChainsName() {
+        return chainsName;
+    }
+
+    public void setChainsName(String chainsName) {
+        this.chainsName = chainsName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 29 - 3
suishenbang-wxportal/suishenbang-wxportal-common/src/main/resources/mapper/wxportal/OrderFileMapper.xml

@@ -7,6 +7,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="OrderFile" id="OrderFileResult">
         <result property="orderId"    column="order_id"    />
         <result property="flowId"    column="flow_id"    />
+        <result property="chainsCode"    column="chains_code"    />
+        <result property="chainsName"    column="chainsName"    />
         <result property="customersCode"    column="customers_code"    />
         <result property="signerId"    column="signer_id"    />
         <result property="signerName"    column="signer_name"    />
@@ -19,17 +21,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectOrderFileVo">
-        select order_id, flow_id,customers_code,signer_id,signer_name, file_url, create_by, create_time, update_by, update_time, is_delete from ssb_order_file
+        select order_id, flow_id,chains_code,customers_code,signer_id,signer_name, file_url, create_by, create_time, update_by, update_time, is_delete from ssb_order_file
     </sql>
 
     <select id="selectOrderFileList" parameterType="OrderFile" resultMap="OrderFileResult">
-        <include refid="selectOrderFileVo"/>
+        SELECT
+        of.order_id,
+        of.flow_id,
+        of.chains_code,
+        of.customers_code,
+        of.signer_id,
+        of.signer_name,
+        of.file_url,
+        of.create_by,
+        of.create_time,
+        of.update_by,
+        of.update_time,
+        of.is_delete,
+        c.chains_name AS chainsName
+        FROM
+        ssb_order_file AS of
+        LEFT JOIN customers AS c ON of.chains_code = c.chains_code
         <where>  
-            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
+            <if test="orderId != null  and orderId != ''"> and c.chains_name = #{orderId}</if>
+            <if test="chainsName != null  and chainsName != ''"> and  c.chains_name like concat('%', #{chainsName}, '%')</if>
+            <if test="signerName != null  and signerName != ''"> and  of.signer_name like concat('%', #{signerName}, '%')</if>
             <if test="flowId != null  and flowId != ''"> and flow_id = #{flowId}</if>
             <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
             <if test="isDelete != null  and isDelete != ''"> and is_delete = #{isDelete}</if>
         </where>
+        GROUP BY
+        of.chains_code
     </select>
     
     <select id="selectOrderFileById" parameterType="String" resultMap="OrderFileResult">
@@ -42,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="orderId != null">order_id,</if>
             <if test="flowId != null">flow_id,</if>
+            <if test="chainsCode != null">chains_code,</if>
             <if test="customersCode != null">customers_code,</if>
             <if test="signerId != null">signer_id,</if>
             <if test="signerName != null">signer_name,</if>
@@ -55,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">#{orderId},</if>
             <if test="flowId != null">#{flowId},</if>
+            <if test="chainsCode != null">#{chainsCode},</if>
             <if test="customersCode != null">#{customersCode},</if>
             <if test="signerId != null">#{signerId},</if>
             <if test="signerName != null">#{signerName},</if>
@@ -71,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update ssb_order_file
         <trim prefix="SET" suffixOverrides=",">
             <if test="flowId != null">flow_id = #{flowId},</if>
+            <if test="chainsCode != null">chains_code = #{chainsCode},</if>
             <if test="customersCode != null">customers_code = #{customersCode},</if>
             <if test="signerId != null">signer_id = #{signerId},</if>
             <if test="signerName != null">signer_name = #{signerName},</if>
@@ -86,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateOrderFileByFlowId">
         update ssb_order_file
         <trim prefix="SET" suffixOverrides=",">
+            <if test="chainsCode != null">chains_code = #{chainsCode},</if>
             <if test="customersCode != null">customers_code = #{customersCode},</if>
             <if test="signerId != null">signer_id = #{signerId},</if>
             <if test="signerName != null">signer_name = #{signerName},</if>

+ 58 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/java/com/dgtly/wxportal/controller/OrderFileController.java

@@ -0,0 +1,58 @@
+package com.dgtly.wxportal.controller;
+
+import com.dgtly.common.core.controller.BaseController;
+import com.dgtly.common.core.page.TableDataInfo;
+import com.dgtly.wxportal.domain.OrderFile;
+import com.dgtly.wxportal.service.IOrderFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+
+/**
+ * @author ZhangDing
+ * @version 1.0
+ * @descption: 签署文件表Controller
+ * @company 神州数码通用软件(洛阳)有限公司
+ * @copyright (c) 2019 LuoYang DGT Co'Ltd Inc. All rights reserved.
+ * @date 2020-10-20 10:54
+ * @since JDK1.8
+ */
+@Controller
+@RequestMapping("/system/orderFile")
+public class OrderFileController extends BaseController {
+    private String prefix = "wxportal/orderfile";
+    @Autowired
+    private IOrderFileService orderFileService;
+
+    @RequiresPermissions("system:file:view")
+    @GetMapping()
+    public String file()
+    {
+        return prefix + "/orderFile";
+    }
+
+    /**
+     * @descption: 查询签署文件列表
+     * @param:
+     * @return:
+     * @auther: ZhangDing
+     * @date: 2020-10-20 10:59
+     */
+    @RequiresPermissions("system:file:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(OrderFile orderFile)
+    {
+        startPage();
+        List<OrderFile> list = orderFileService.selectOrderFileList(orderFile);
+        return getDataTable(list);
+    }
+
+}

+ 108 - 0
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/orderfile/orderfile.html

@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('签署文件列表')" />
+</head>
+<body class="gray-bg">
+<div class="container-div">
+    <div class="row">
+        <div class="col-sm-12 search-collapse">
+            <form id="formId">
+                <div class="select-list">
+                    <ul>
+
+                        <li>
+                            <p>签署人:</p>
+                            <input type="text" name="signerName"/>
+                        </li>
+                        <li>
+                            <p>签署企业:</p>
+                            <input type="text" name="chainsName"/>
+                        </li>
+
+                        <li>
+                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+
+        <div class="btn-group-sm" id="toolbar" role="group">
+            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:file:add">
+                <i class="fa fa-plus"></i> 添加
+            </a>
+            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:file:edit">
+                <i class="fa fa-edit"></i> 修改
+            </a>
+            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:file:remove">
+                <i class="fa fa-remove"></i> 删除
+            </a>
+            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:file:export">
+                <i class="fa fa-download"></i> 导出
+            </a>
+        </div>
+        <div class="col-sm-12 select-table table-striped">
+            <table id="bootstrap-table"></table>
+        </div>
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+    var editFlag = [[${@permission.hasPermi('system:file:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('system:file:remove')}]];
+    var prefix = ctx + "system/orderFile";
+
+    $(function() {
+        var options = {
+            url: prefix + "/list",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            exportUrl: prefix + "/export",
+            modalName: "签署文件列表",
+            columns: [{
+                checkbox: true
+            },
+                {
+                    field : 'orderId',
+                    title : '订单id'
+                },
+                {
+                    field : 'chainsName',
+                    title : '签署企业'
+                },
+                {
+                    field : 'signerName',
+                    title : '签署人名称'
+                },
+                {
+                    field : 'flowId',
+                    title : '签署流程id'
+                },
+                {
+                    field : 'fileUrl',
+                    title : '操作',
+                    formatter : function (value,row,index) {
+                        return '<a class="btn btn-success btn-xs" href='+value+' target="_blank"><i class="fa fa-download"></i>下载</a>';
+                    }
+                }
+                /*,
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.orderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }*/
+                ]
+        };
+        $.table.init(options);
+    });
+</script>
+</body>
+</html>