Browse Source

商户管理完成审核功能

kouchengxing 5 years ago
parent
commit
a688291d98

+ 13 - 0
dgtly-admin/src/main/java/com/dgtly/web/controller/companyext/CompanyExamineController.java

@@ -1,5 +1,6 @@
 package com.dgtly.web.controller.companyext;
 
+import com.dgtly.framework.util.ShiroUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -124,6 +125,17 @@ public class CompanyExamineController extends BaseController
         return prefix + "/edit";
     }
 
+    /**
+     * 商户审核页面跳转
+     */
+    @GetMapping("/approvePage/{id}")
+    public String approvePage(@PathVariable("id") Long id, ModelMap mmap)
+    {
+        CompanyExamine companyExamine = companyExamineService.selectCompanyExamineById(id);
+        mmap.put("companyExamine", companyExamine);
+        return prefix + "/approve";
+    }
+
     /**
      * 修改保存商户审核
      */
@@ -133,6 +145,7 @@ public class CompanyExamineController extends BaseController
     @ResponseBody
     public AjaxResult editSave(CompanyExamine companyExamine)
     {
+        companyExamine.setUpdateBy(ShiroUtils.getUserId().toString());
         return toAjax(companyExamineService.updateCompanyExamine(companyExamine));
     }
 

+ 1 - 1
dgtly-admin/src/main/resources/templates/companyext/examine/add.html

@@ -10,7 +10,7 @@
             <div class="form-group">    
                 <label class="col-sm-3 control-label">商户(公司)Id:</label>
                 <div class="col-sm-8">
-                    <input name="companyId" class="form-control" type="text" required>
+                    <span class="help-block m-b-none">审核状态</span>
                 </div>
             </div>
             <div class="form-group">    

+ 138 - 0
dgtly-admin/src/main/resources/templates/companyext/examine/approve.html

@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改商户审核')" />
+    <th:block th:include="include :: datetimepicker-css" />
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-examine-edit" th:object="${companyExamine}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业名称:</label>
+                <div class="col-sm-8">
+                    <input name="companyName" th:field="*{companyName}" class="form-control" type="text" disabled="disabled">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业类型:</label>
+                <div class="col-sm-8">
+                    <select name="companyType" class="form-control m-b" th:with="type=${@dict.getType('company_type')}" readonly="readonly">
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{companyType}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">详细地址:</label>
+                <div class="col-sm-8">
+                    <textarea name="detailAddress" class="form-control" readonly="readonly">[[*{detailAddress}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">经度:</label>
+                <div class="col-sm-8">
+                    <input name="longitude" th:field="*{longitude}" class="form-control" type="text" readonly="readonly">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">纬度:</label>
+                <div class="col-sm-8">
+                    <input name="latitude" th:field="*{latitude}" class="form-control" type="text" readonly="readonly">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业法人:</label>
+                <div class="col-sm-8">
+                    <input name="legalPerson" th:field="*{legalPerson}" class="form-control" type="text" readonly="readonly">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">联系电话:</label>
+                <div class="col-sm-8">
+                    <input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" readonly="readonly">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">成立日期:</label>
+                <div class="col-sm-8">
+                    <div class="input-group date">
+                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+                        <input name="establishDate" th:field="*{establishDate}" class="form-control" readonly="readonly" type="text">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">统一社会信用代码:</label>
+                <div class="col-sm-8">
+                    <input name="unifiedSocialCreditCode" th:field="*{unifiedSocialCreditCode}" class="form-control" type="text" readonly="readonly">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">营业执照:</label>
+                <div class="col-sm-8">
+                    <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;">
+                        <img th:src="@{businessLicenseUrl}">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业默认图片:</label>
+                <div class="col-sm-8">
+                    <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;">
+                        <img th:src="@{defaultImgUrl}">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业宣传图片:</label>
+                <div class="col-sm-8">
+                    <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;">
+                        <img th:src="@{propagandaImgUrl}">
+                    </div>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">企业介绍:</label>
+                <div class="col-sm-8">
+                    <textarea name="companyIntroduce" class="form-control" readonly="readonly">[[*{companyIntroduce}]]</textarea>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">审批状态:</label>
+                <div class="col-sm-8">
+                    <label class="radio-box"> <input type="radio" name="status" value="1" th:checked="true"/> 通过 </label>
+                    <label class="radio-box"> <input type="radio" name="status" value="2" /> 驳回 </label>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">驳回理由:</label>
+                <div class="col-sm-8">
+                    <textarea name="rejectReason" class="form-control" maxlength="250"></textarea>
+                </div>
+            </div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: datetimepicker-js" />
+    <script type="text/javascript">
+        var prefix = ctx + "companyext/examine";
+        $("#form-examine-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            var status = $('input[name="status"]:checked').val();
+            var rejectReason = $("textarea[name='rejectReason']").val();
+            debugger;
+            if(status == 2 ){
+                if(rejectReason==null || rejectReason.trim()==0){
+                    $.modal.alertWarning("请填写驳回理由!");
+                    return;
+                }
+            }
+            $.operate.save(prefix + "/edit", "id="+$("input[name='id']").val()+"&status="+status+"&rejectReason="+rejectReason);
+
+        }
+    </script>
+</body>
+</html>

+ 26 - 9
dgtly-admin/src/main/resources/templates/companyext/examine/noExamine.html

@@ -48,11 +48,11 @@
                 </a>
                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:examine:edit">
                     <i class="fa fa-edit"></i> 修改
-                </a>-->
+                </a>
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:examine:remove">
                     <i class="fa fa-remove"></i> 删除
-                </a>
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:examine:export">
+                </a>-->
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="companyext:examine:export">
                     <i class="fa fa-download"></i> 导出
                  </a>
             </div>
@@ -63,8 +63,9 @@
     </div>
     <th:block th:include="include :: footer" />
     <script th:inline="javascript">
-        var editFlag = [[${@permission.hasPermi('system:examine:edit')}]];
-        var removeFlag = [[${@permission.hasPermi('system:examine:remove')}]];
+        var approveFlag = [[${@permission.hasPermi('companyext:noexamine:approve')}]];
+        var companyTypes = [[${@dict.getType('company_type')}]];
+        var examineStatus = [[${@dict.getType('examine_status')}]];
         var prefix = ctx + "companyext/examine";
 
         $(function() {
@@ -74,7 +75,6 @@
                 updateUrl: prefix + "/edit/{id}",
                 removeUrl: prefix + "/remove",
                 exportUrl: prefix + "/export",
-                examineUrl: prefix + "/approvePage",
                 modalName: "商户审核",
                 columns: [{
                     checkbox: true
@@ -95,7 +95,11 @@
                 },
                 {
                     field : 'companyType',
-                    title : '企业类型'
+                    title : '企业类型',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        return $.table.selectDictLabel(companyTypes, value);
+                    }
                 },
                 {
                     field : 'legalPerson',
@@ -107,7 +111,11 @@
                 },
                 {
                     field : 'status', 
-                    title : '审核状态'
+                    title : '审核状态',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        return $.table.selectDictLabel(examineStatus, value);
+                    }
                 },
                 {
                     field : 'applyDate', 
@@ -122,12 +130,21 @@
                     align: 'center',
                     formatter: function(value, row, index) {
                         var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs ' + examineUrl + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>审核</a> ');
+                        actions.push('<a class="btn btn-success btn-xs ' + approveFlag + '" href="javascript:void(0)" onclick="approve(\'' + row.id + '\')"><i class="fa fa-edit"></i>审核</a> ');
                         return actions.join('');
                     }
                 }]
             };
             $.table.init(options);
+
+            approve=function(id){
+                if(id==null && id==""){
+                    return;
+                }
+                $.modal.open("审核商户" , prefix + "/approvePage/"+id);
+            }
+
+
         });
     </script>
 </body>

+ 1 - 3
dgtly-admin/src/main/resources/templates/companyext/examine/yesExamine.html

@@ -121,9 +121,7 @@
                     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.id + '\')"><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.id + '\')"><i class="fa fa-remove"></i>删除</a>');
-                        return actions.join('');
+                       return actions.join('');
                     }
                 }]
             };

+ 0 - 6
dgtly-admin/src/main/resources/templates/system/company/add.html

@@ -25,12 +25,6 @@
                 </div>
             </div>
 
-            <div class="form-group">
-                <label class="col-sm-3 control-label">优图权限编号:</label>
-                <div class="col-sm-8">
-                    <input name="authorizeId" id="authorizeId" class="form-control" type="text" required>
-                </div>
-            </div>
         </form>
     </div>
     <th:block th:include="include :: footer" />

+ 130 - 18
dgtly-system/src/main/java/com/dgtly/companyext/domain/CompanyExamine.java

@@ -20,7 +20,6 @@ public class CompanyExamine extends BaseEntity
     private Long id;
 
     /** 商户(公司)Id */
-    @Excel(name = "商户(公司)Id")
     private Long companyId;
 
     /** 审核状态 */
@@ -28,12 +27,12 @@ public class CompanyExamine extends BaseEntity
     private Integer status;
 
     /** 申请日期 */
-    @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date applyDate;
+    @Excel(name = "申请日期")
+    private String applyDate;
 
     /** 审核日期 */
-    @Excel(name = "审核日期", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date examineDate;
+    @Excel(name = "审核日期")
+    private String examineDate;
 
     /** 驳回理由 */
     @Excel(name = "驳回理由")
@@ -66,25 +65,24 @@ public class CompanyExamine extends BaseEntity
     {
         return status;
     }
-    public void setApplyDate(Date applyDate) 
-    {
-        this.applyDate = applyDate;
-    }
 
-    public Date getApplyDate() 
-    {
+    public String getApplyDate() {
         return applyDate;
     }
-    public void setExamineDate(Date examineDate) 
-    {
-        this.examineDate = examineDate;
+
+    public void setApplyDate(String applyDate) {
+        this.applyDate = applyDate;
     }
 
-    public Date getExamineDate() 
-    {
+    public String getExamineDate() {
         return examineDate;
     }
-    public void setRejectReason(String rejectReason) 
+
+    public void setExamineDate(String examineDate) {
+        this.examineDate = examineDate;
+    }
+
+    public void setRejectReason(String rejectReason)
     {
         this.rejectReason = rejectReason;
     }
@@ -94,13 +92,23 @@ public class CompanyExamine extends BaseEntity
         return rejectReason;
     }
 
-    /** 企业名称 */
     @Excel(name = "企业名称")
     private String companyName;
 
     /** 企业类型 */
     @Excel(name = "企业类型")
     private Integer companyType;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String detailAddress;
+
+    /** 经度 */
+    private String longitude;
+
+    /** 纬度 */
+    private String latitude;
+
     /** 企业法人 */
     @Excel(name = "企业法人")
     private String legalPerson;
@@ -109,6 +117,30 @@ public class CompanyExamine extends BaseEntity
     @Excel(name = "联系电话")
     private String contactNumber;
 
+    /** 成立日期 */
+    @Excel(name = "成立日期")
+    private String establishDate;
+
+    /** 统一社会信用代码 */
+    @Excel(name = "统一社会信用代码")
+    private String unifiedSocialCreditCode;
+
+    /** 营业执照 */
+    private String businessLicenseUrl;
+
+    /** 企业默认图片 */
+    private String defaultImgUrl;
+
+    /** 企业宣传图片 */
+    private String propagandaImgUrl;
+
+    /** 企业介绍 */
+    @Excel(name = "企业介绍")
+    private String companyIntroduce;
+
+    /** 版本号 */
+    private Integer versionNum;
+
     public String getCompanyName() {
         return companyName;
     }
@@ -141,6 +173,86 @@ public class CompanyExamine extends BaseEntity
         this.contactNumber = contactNumber;
     }
 
+    public String getDetailAddress() {
+        return detailAddress;
+    }
+
+    public void setDetailAddress(String detailAddress) {
+        this.detailAddress = detailAddress;
+    }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public String getEstablishDate() {
+        return establishDate;
+    }
+
+    public void setEstablishDate(String establishDate) {
+        this.establishDate = establishDate;
+    }
+
+    public String getUnifiedSocialCreditCode() {
+        return unifiedSocialCreditCode;
+    }
+
+    public void setUnifiedSocialCreditCode(String unifiedSocialCreditCode) {
+        this.unifiedSocialCreditCode = unifiedSocialCreditCode;
+    }
+
+    public String getBusinessLicenseUrl() {
+        return businessLicenseUrl;
+    }
+
+    public void setBusinessLicenseUrl(String businessLicenseUrl) {
+        this.businessLicenseUrl = businessLicenseUrl;
+    }
+
+    public String getDefaultImgUrl() {
+        return defaultImgUrl;
+    }
+
+    public void setDefaultImgUrl(String defaultImgUrl) {
+        this.defaultImgUrl = defaultImgUrl;
+    }
+
+    public String getPropagandaImgUrl() {
+        return propagandaImgUrl;
+    }
+
+    public void setPropagandaImgUrl(String propagandaImgUrl) {
+        this.propagandaImgUrl = propagandaImgUrl;
+    }
+
+    public String getCompanyIntroduce() {
+        return companyIntroduce;
+    }
+
+    public void setCompanyIntroduce(String companyIntroduce) {
+        this.companyIntroduce = companyIntroduce;
+    }
+
+    public Integer getVersionNum() {
+        return versionNum;
+    }
+
+    public void setVersionNum(Integer versionNum) {
+        this.versionNum = versionNum;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 0
dgtly-system/src/main/java/com/dgtly/companyext/service/ICompanyExamineService.java

@@ -58,4 +58,5 @@ public interface ICompanyExamineService
      * @return 结果
      */
     public int deleteCompanyExamineById(Long id);
+
 }

+ 58 - 13
dgtly-system/src/main/resources/mapper/companyext/CompanyExamineMapper.xml

@@ -7,6 +7,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="CompanyExamine" id="CompanyExamineResult">
         <result property="id"    column="id"    />
         <result property="companyId"    column="company_id"    />
+        <result property="companyName"    column="company_name"    />
+        <result property="companyType"    column="company_type"    />
+        <result property="detailAddress"    column="detail_address"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
+        <result property="legalPerson"    column="legal_person"    />
+        <result property="contactNumber"    column="contact_number"    />
+        <result property="establishDate"    column="establish_date"    />
+        <result property="unifiedSocialCreditCode"    column="unified_social_credit_code"    />
+        <result property="businessLicenseUrl"    column="business_license_url"    />
+        <result property="defaultImgUrl"    column="default_img_url"    />
+        <result property="propagandaImgUrl"    column="propaganda_img_url"    />
+        <result property="companyIntroduce"    column="company_introduce"    />
+        <result property="versionNum"    column="version_num"    />
         <result property="status"    column="status"    />
         <result property="applyDate"    column="apply_date"    />
         <result property="examineDate"    column="examine_date"    />
@@ -31,8 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cei.legal_person,
         cei.contact_number,
         ce.STATUS,
-        ce.apply_date,
-        ce.examine_date,
+        date_format(ce.apply_date,'%Y-%m-%d') as 'apply_date',
+        date_format(ce.examine_date,'%Y-%m-%d') as 'examine_date',
         ce.reject_reason
         FROM
         company_examine ce,company_ext_info cei
@@ -42,13 +56,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="companyType != null "> and cei.company_type = #{companyType}</if>
         <if test="legalPerson != null and legalPerson != ''"> and cei.legal_person like concat('%', #{legalPerson}, '%')</if>
         <if test="status != null "> and ce.status = #{status}</if>
-        <if test="applyDate != null "> and date_format(ce.apply_date,'%y-%m-%d') = date_format(#{applyDate},'%y-%m-%d')</if>
-        <if test="examineDate != null "> and date_format(ce.examine_date,'%y-%m-%d') = date_format(#{examineDate},'%y-%m-%d')</if>
+        <if test="applyDate != null and applyDate != ''"> and date_format(ce.apply_date,'%Y-%m-%d') = #{applyDate}</if>
+        <if test="examineDate != null and examineDate != ''"> and date_format(ce.examine_date,'%Y-%m-%d') = #{examineDate}</if>
     </select>
 
     <select id="selectCompanyExamineById" parameterType="Long" resultMap="CompanyExamineResult">
-        <include refid="selectCompanyExamineVo"/>
-        where id = #{id}
+         SELECT
+            ce.id,
+            ce.company_id,
+            cei.company_name,
+            cei.company_type,
+            cei.legal_person,
+            cei.detail_address,
+            cei.longitude,
+            cei.latitude,
+            cei.legal_person,
+            cei.contact_number,
+            date_format(cei.establish_date,'%Y-%m-%d') as 'establish_date',
+            cei.unified_social_credit_code,
+            cei.business_license_url,
+            cei.default_img_url,
+            cei.propaganda_img_url,
+            cei.company_introduce,
+            cei.version_num,
+            cei.contact_number,
+            ce.STATUS,
+            ce.apply_date,
+            ce.examine_date,
+            ce.reject_reason
+        FROM
+            company_examine ce
+        LEFT JOIN	company_ext_info cei on ce.company_id = cei.company_id
+        WHERE
+        ce.del_flag = '0'
+        AND cei.del_flag = '0'
+        AND cei.version_num = (
+            SELECT
+                MAX(a.version_num)
+            FROM
+                company_ext_info a
+            WHERE
+                a.company_id = ce.company_id
+        )
+        AND ce.id = #{id}
     </select>
         
     <insert id="insertCompanyExamine" parameterType="CompanyExamine" useGeneratedKeys="true" keyProperty="id">
@@ -82,16 +132,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="updateCompanyExamine" parameterType="CompanyExamine">
         update company_examine
         <trim prefix="SET" suffixOverrides=",">
-            <if test="companyId != null ">company_id = #{companyId},</if>
             <if test="status != null ">status = #{status},</if>
-            <if test="applyDate != null ">apply_date = #{applyDate},</if>
-            <if test="examineDate != null ">examine_date = #{examineDate},</if>
+            examine_date = NOW(),
             <if test="rejectReason != null  and rejectReason != ''">reject_reason = #{rejectReason},</if>
-            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
-            <if test="createTime != null ">create_time = #{createTime},</if>
             <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
-            <if test="updateTime != null ">update_time = #{updateTime},</if>
-            <if test="remark != null  and remark != ''">remark = #{remark},</if>
+            update_time = NOW(),
         </trim>
         where id = #{id}
     </update>