Authored by caoyan

Merge branch 'dev_上传营业执照' into test6.8.5

# Conflicts:
#	web/src/main/resources/databases.yml
#	web/src/main/webapp/META-INF/autoconf/databases.yml
package com.yoho.order.dal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yoho.order.model.BusinessLicense;
import com.yoho.order.model.BusinessLicenseReq;
/**
* Created by caoyan on 2019/1/7.
*/
public interface BusinessLicenseMapper {
int insert(BusinessLicense businessLicense);
List<BusinessLicense> selectByUid(@Param("uid") Integer uid);
int selectTotalByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq);
List<BusinessLicense> selectByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq);
BusinessLicense selectById(@Param("id") Integer id);
}
... ...
package com.yoho.order.model;
import java.io.Serializable;
/**
* @author caoyan
* @date 2019/1/7
*/
public class BusinessLicense implements Serializable {
private static final long serialVersionUID = 2607922995706119816L;
private Integer id;
private Integer uid;
private Integer businessType;
private String businessName;
private String socialCreditCode;
private String certName;
private String certNo;
private Integer startTime;
private Integer expireTime;
private String licenseOriginalImage;
private String licenseCopyImage;
private String certFaceImage;
private String certReverseImage;
private Integer commitTime;
private Integer auditStatus;
private Integer auditTime;
private Integer auditUid;
private String rejectReason;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Integer getBusinessType() {
return businessType;
}
public void setBusinessType(Integer businessType) {
this.businessType = businessType;
}
public String getBusinessName() {
return businessName;
}
public void setBusinessName(String businessName) {
this.businessName = businessName;
}
public String getSocialCreditCode() {
return socialCreditCode;
}
public void setSocialCreditCode(String socialCreditCode) {
this.socialCreditCode = socialCreditCode;
}
public String getCertName() {
return certName;
}
public void setCertName(String certName) {
this.certName = certName;
}
public String getCertNo() {
return certNo;
}
public void setCertNo(String certNo) {
this.certNo = certNo;
}
public Integer getStartTime() {
return startTime;
}
public void setStartTime(Integer startTime) {
this.startTime = startTime;
}
public Integer getExpireTime() {
return expireTime;
}
public void setExpireTime(Integer expireTime) {
this.expireTime = expireTime;
}
public String getLicenseOriginalImage() {
return licenseOriginalImage;
}
public void setLicenseOriginalImage(String licenseOriginalImage) {
this.licenseOriginalImage = licenseOriginalImage;
}
public String getLicenseCopyImage() {
return licenseCopyImage;
}
public void setLicenseCopyImage(String licenseCopyImage) {
this.licenseCopyImage = licenseCopyImage;
}
public String getCertFaceImage() {
return certFaceImage;
}
public void setCertFaceImage(String certFaceImage) {
this.certFaceImage = certFaceImage;
}
public String getCertReverseImage() {
return certReverseImage;
}
public void setCertReverseImage(String certReverseImage) {
this.certReverseImage = certReverseImage;
}
public Integer getCommitTime() {
return commitTime;
}
public void setCommitTime(Integer commitTime) {
this.commitTime = commitTime;
}
public Integer getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(Integer auditStatus) {
this.auditStatus = auditStatus;
}
public Integer getAuditTime() {
return auditTime;
}
public void setAuditTime(Integer auditTime) {
this.auditTime = auditTime;
}
public Integer getAuditUid() {
return auditUid;
}
public void setAuditUid(Integer auditUid) {
this.auditUid = auditUid;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
@Override
public String toString() {
return "BusinessLicense{" +
"id=" + id +
", uid='" + uid + '\'' +
", businessType='" + businessType + '\'' +
", businessName='" + businessName + '\'' +
", socialCreditCode='" + socialCreditCode + '\'' +
", certName='" + certName + '\'' +
", certNo='" + certNo + '\'' +
", startTime='" + startTime + '\'' +
", expireTime='" + expireTime + '\'' +
", licenseOriginalImage='" + licenseOriginalImage + '\'' +
", licenseCopyImage='" + licenseCopyImage + '\'' +
", certFaceImage='" + certFaceImage + '\'' +
", certReverseImage='" + certReverseImage + '\'' +
", commitTime='" + commitTime + '\'' +
", auditStatus='" + auditStatus + '\'' +
", auditTime='" + auditTime + '\'' +
", auditUid='" + auditUid + '\'' +
", rejectReason='" + rejectReason + '\'' +
'}';
}
}
... ...
package com.yoho.order.model;
import com.yoho.ufo.service.model.PageRequestBO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
/**
* Created by caoyan.
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BusinessLicenseReq extends PageRequestBO{
/**
*
*/
private static final long serialVersionUID = 1620427808531296022L;
private Integer id;
private Integer uid;
private Integer businessType;
private String businessName;
private String socialCreditCode;
private String certName;
private String certNo;
private Integer startTime;
private Integer expireTime;
private String licenseOriginalImage;
private String licenseCopyImage;
private String certFaceImage;
private String certReverseImage;
private Integer validStatus;//入驻状态 1:已入驻 9:已退驻
}
... ...
package com.yoho.order.model;
import com.yoho.ufo.service.model.PageRequestBO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
/**
* Created by caoyan.
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BusinessLicenseRsp extends PageRequestBO{
/**
*
*/
private static final long serialVersionUID = 1620427808531296022L;
private Integer id;
private Integer uid;
private Integer businessType;
private String businessTypeStr;
private String certName;
private String certNo;
private String commitTime;
private Integer auditStatus;
private String auditStatusStr;
private String auditTime;
private String rejectReason;
private String validDate;
private String licenseOriginalImage;
private String licenseCopyImage;
private String businessName;
private String socialCreditCode;
private String certFaceImage;
private String certReverseImage;
}
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.order.dal.BusinessLicenseMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.BusinessLicense">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="INTEGER" />
<result column="business_name" property="businessName" jdbcType="VARCHAR" />
<result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR" />
<result column="cert_name" property="certName" jdbcType="VARCHAR" />
<result column="cert_no" property="certNo" jdbcType="VARCHAR" />
<result column="start_time" property="startTime" jdbcType="INTEGER" />
<result column="expire_time" property="expireTime" jdbcType="INTEGER" />
<result column="license_original_image" property="licenseOriginalImage" jdbcType="VARCHAR" />
<result column="license_copy_image" property="licenseCopyImage" jdbcType="VARCHAR" />
<result column="cert_face_image" property="certFaceImage" jdbcType="VARCHAR" />
<result column="cert_reverse_image" property="certReverseImage" jdbcType="VARCHAR" />
<result column="commit_time" property="commitTime" jdbcType="INTEGER" />
<result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="INTEGER" />
<result column="audit_uid" property="auditUid" jdbcType="INTEGER" />
<result column="reject_reason" property="rejectReason" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id, uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time, license_original_image,
license_copy_image, cert_face_image, cert_reverse_image, commit_time, audit_status, audit_time, audit_uid, reject_reason
</sql>
<insert id="insert" parameterType="com.yoho.order.model.BusinessLicense">
insert into business_license (uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time,
license_original_image, license_copy_image, cert_face_image, cert_reverse_image, commit_time) values (#{uid}, #{businessType}, #{businessName},
#{socialCreditCode}, #{certName}, #{certNo}, #{startTime}, #{expireTime}, #{licenseOriginalImage}, #{licenseCopyImage},
#{certFaceImage}, #{certReverseImage}, #{commitTime})
</insert>
<select id="selectByUid" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from business_license
where uid=#{uid}
order by commit_time desc
</select>
<sql id="Query_Sql" >
<if test="businessLicenseReq.uid != null">
and a.uid=#{businessLicenseReq.uid}
</if>
<if test="businessLicenseReq.businessName!= null">
<bind name="pattern" value="'%' + businessLicenseReq.businessName + '%'" />
and a.business_name like #{pattern}
</if>
<if test="businessLicenseReq.validStatus != null">
and b.valid_status=#{businessLicenseReq.validStatus}
</if>
</sql>
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BusinessLicenseReq">
select count(1)
from business_license a
<if test="businessLicenseReq.validStatus != null">
LEFT JOIN stored_seller b
ON( b.uid=a.uid)
</if>
where 1=1
<include refid="Query_Sql"></include>
</select>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BusinessLicenseReq">
select a.*
from business_license a
<if test="businessLicenseReq.validStatus != null">
LEFT JOIN stored_seller b
ON( b.uid=a.uid)
</if>
where 1=1
<include refid="Query_Sql"></include>
order by a.commit_time desc
<if test="businessLicenseReq.start!=null and businessLicenseReq.size != null">
limit #{businessLicenseReq.start},#{businessLicenseReq.size}
</if>
</select>
<select id="selectById" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from business_license
where id=#{id}
</select>
</mapper>
\ No newline at end of file
... ...
package com.yoho.ufo.order.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yoho.order.model.BusinessLicense;
import com.yoho.order.model.BusinessLicenseReq;
import com.yoho.order.model.BusinessLicenseRsp;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.IBusinessLicenseService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
@RestController
@RequestMapping(value = "/businessLicense")
public class BusinessLicenseController {
private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseController.class);
@Autowired
private IBusinessLicenseService businessLicenseService;
@RequestMapping(value = "/queryList")
public ApiResponse queryList(BusinessLicenseReq req) {
LOGGER.info("queryList in. req is {}", req);
PageResponseBO<BusinessLicenseRsp> result = businessLicenseService.queryList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/save")
public ApiResponse save(@RequestBody BusinessLicenseReq req) {
LOGGER.info("save in. req is {}", req);
int result = businessLicenseService.save(req);
if(result>0) {
return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message("保存失败").build();
}
}
@RequestMapping(value = "/queryAuditStatus")
public ApiResponse queryAuditStatus(@RequestBody BusinessLicenseReq req) {
LOGGER.info("queryAuditStatus in. req is {}", req);
BusinessLicense bl;
try {
bl = businessLicenseService.getAuditRecord(req);
} catch (PlatformException e) {
return new ApiResponse.ApiResponseBuilder().code(500).message(e.getMessage()).build();
}
if(null == bl) {
return new ApiResponse.ApiResponseBuilder().code(400).message("记录不存在").build();
}
String auditStatusStr = "审核中";
String info = "您的资料已提交审核,认证成功后我们将会第一时间通知您。";
if(bl.getAuditStatus().intValue() == 1) {
auditStatusStr = "审核通过";
info = "您的资料已审核通过,现您可以进行商家入驻。";
}else if(bl.getAuditStatus().intValue() == 2) {
auditStatusStr = "审核不通过";
info = bl.getRejectReason();
}
return new ApiResponse.ApiResponseBuilder().code(200).message(info).data(auditStatusStr).build();
}
@RequestMapping(value = "/getDetailById")
public ApiResponse getDetailById(BusinessLicenseReq req) {
LOGGER.info("save in. req is {}", req);
BusinessLicenseRsp result = businessLicenseService.getDetail(req);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("保存成功").build();
}
}
... ...
package com.yoho.ufo.order.service;
import com.yoho.order.model.BusinessLicense;
import com.yoho.order.model.BusinessLicenseReq;
import com.yoho.order.model.BusinessLicenseRsp;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.service.model.PageResponseBO;
public interface IBusinessLicenseService {
int save(BusinessLicenseReq req);
BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException;
PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req);
BusinessLicenseRsp getDetail(BusinessLicenseReq req);
}
... ...
package com.yoho.ufo.order.service.impl;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.order.dal.BusinessLicenseMapper;
import com.yoho.order.model.BusinessLicense;
import com.yoho.order.model.BusinessLicenseReq;
import com.yoho.order.model.BusinessLicenseRsp;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.IBusinessLicenseService;
import com.yoho.ufo.service.model.PageResponseBO;
/**
* @author caoyan
* @date 2019/1/7
*/
@Service
public class BusinessLicenseServiceImpl implements IBusinessLicenseService {
private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseServiceImpl.class);
@Autowired
private BusinessLicenseMapper businessLicenseMapper;
@Override
public int save(BusinessLicenseReq req) {
BusinessLicense item = new BusinessLicense();
BeanUtils.copyProperties(req, item);
item.setCommitTime(DateUtil.getCurrentTimeSecond());
return businessLicenseMapper.insert(item);
}
@Override
public BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException {
if(null == req.getUid()) {
throw new PlatformException("用户ID为空", 400);
}
List<BusinessLicense> list = businessLicenseMapper.selectByUid(req.getUid());
return list.get(0);
}
@Override
public PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req){
int total = businessLicenseMapper.selectTotalByCondition(req);
if(total == 0) {
return null;
}
List<BusinessLicense> list = businessLicenseMapper.selectByCondition(req);
if(CollectionUtils.isEmpty(list)) {
return null;
}
List<BusinessLicenseRsp> rspList = Lists.newArrayList();
for(BusinessLicense item : list) {
BusinessLicenseRsp rsp = new BusinessLicenseRsp();
rsp.setId(item.getId());
rsp.setUid(item.getUid());
rsp.setBusinessType(item.getBusinessType());
rsp.setBusinessTypeStr(getBusinessTypeStr(item.getBusinessType()));
rsp.setCertName(item.getCertName());
rsp.setCertNo(item.getCertNo());
rsp.setCommitTime(DateUtil.getDateStrBySecond(item.getCommitTime(), "yyyy/MM/dd HH:mm:ss"));
rsp.setAuditStatus(item.getAuditStatus());
rsp.setAuditStatusStr(getAuditStatusStr(item.getAuditStatus()));
rsp.setAuditTime(null == item.getAuditTime() ? "/" : DateUtil.getDateStrBySecond(item.getAuditTime(), "yyyy/MM/dd HH:mm:ss"));
rsp.setRejectReason(StringUtils.isEmpty(item.getRejectReason()) ? "/" : item.getRejectReason());
rspList.add(rsp);
}
PageResponseBO<BusinessLicenseRsp> result=new PageResponseBO<>();
result.setList(rspList);
result.setPage(req.getPage());
result.setSize(req.getSize());
result.setTotal(total);
return result;
}
@Override
public BusinessLicenseRsp getDetail(BusinessLicenseReq req) {
BusinessLicense bl = businessLicenseMapper.selectById(req.getId());
if(null == bl) {
return null;
}
BusinessLicenseRsp rsp = new BusinessLicenseRsp();
BeanUtils.copyProperties(bl, rsp, BusinessLicenseRsp.class);
rsp.setBusinessTypeStr(getBusinessTypeStr(bl.getBusinessType()));
rsp.setValidDate(getValidDateStr(bl.getStartTime(), bl.getExpireTime()));
return rsp;
}
private String getValidDateStr(Integer startTime, Integer expireTime) {
StringBuilder sb = new StringBuilder();
sb.append(DateUtil.getDateStrBySecond(startTime, "yyyy.MM.dd")).append(" - ");
if(expireTime.intValue() == 0) {
sb.append("无限期");
}else {
sb.append(DateUtil.getDateStrBySecond(expireTime, "yyyy.MM.dd"));
}
return sb.toString();
}
private String getBusinessTypeStr(int type) {
if(type == 1) {
return "个体工商户";
}else if(type == 2) {
return "企业法人";
}
return StringUtils.EMPTY;
}
private String getAuditStatusStr(int status) {
if(status == 0) {
return "待审核";
}else if(status == 1) {
return "审核通过";
}else if(status == 2) {
return "审核不通过";
}
return "";
}
}
... ...
... ... @@ -39,6 +39,7 @@ datasources:
- com.yoho.order.dal.CameraRecordMapper
- com.yoho.order.dal.UserCameraRecordMapper
- com.yoho.order.dal.OrderStatusMonitorMapper
- com.yoho.order.dal.BusinessLicenseMapper
ufo_resource:
servers:
... ...
... ... @@ -39,6 +39,7 @@ datasources:
- com.yoho.order.dal.CameraRecordMapper
- com.yoho.order.dal.UserCameraRecordMapper
- com.yoho.order.dal.OrderStatusMonitorMapper
- com.yoho.order.dal.BusinessLicenseMapper
ufo_resource:
servers:
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">
<div region="north" style="height:230px;">
<script>
document.write(addHead('营业执照认证', '商户入驻资质审核'));
</script>
<div style="margin-left: 10px;margin-top: 30px">
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
<div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
<input id="uid" name="uid" />
<input id="businessName" name="businessName" />
<input id="validStatus" name="validStatus" />
<a id="searchBtn" class="btn-info">筛选</a>
<a id="allBtn" class="btn-success">全部</a>
</div>
</div>
</div>
</div>
<div id="businessList" region="center">
<table id="businessListTable"></table>
</div>
<script>
$(function() {
$("#uid").textbox({
prompt: "用户UID",
width: 200
});
$("#businessName").textbox({
prompt: "商家名称",
width: 200
});
$("#validStatus").combobox({
prompt: "入驻状态",
width: 150,
editable : false,
data: [
{"text" : "已入驻", "value" : 1},
{"text" : "已退驻", "value" : 9}
]
});
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#businessListTable").datagrid("load", {
uid : $("#uid").val(),
businessName : $("#businessName").val(),
validStatus : $("#validStatus").myCombobox("getValue")
});
}
});
//全部按钮
$("#allBtn").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#uid").textbox('setValue','');
$("#businessName").textbox('setValue','');
$("#validStatus").combobox('setValue','');
}
});
getBusinessList();
});
function getBusinessList(){
$("#businessListTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: contextPath + "/businessLicense/queryList",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "UID",
field: "uid",
width: 20,
align: "center"
}, {
title: "商户类型",
field: "businessTypeStr",
width: 20,
align: "center"
}, {
title: "姓名",
field: "certName",
width: 20,
align: "center"
}, {
title: "身份证号",
field: "certNo",
width: 30,
align: "center"
}, {
title: "提交时间",
field: "commitTime",
width: 30,
align: "center"
}, {
title: "审核状态",
field: "auditStatusStr",
width: 20,
align: "center"
}, {
title: "审核时间",
field: "auditTime",
width: 30,
align: "center"
}, {
title: "原因",
field: "rejectReason",
width: 30,
align: "center"
}, {
title: "操作",
field: "asdf",
width: 30,
align: "center",
formatter: function (value, rowData, rowIndex) {
var str = "<a role='detail' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>查看</a>";
if(rowData.auditStatus==0){
str = "<a role='audit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>审核</a>" + str;
}
return str;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
$(this).datagrid("getPanel").find("a[role='detail']").linkbutton({
onClick: function () {
var id = $(this).attr("dataId");
window.open(contextPath + "/html/businessLicense/view.html?id=" + id + "&ver=" + new Date().getTime())
}
});
$(this).datagrid("getPanel").find("a[role='audit']").linkbutton({
onClick: function () {
var orderCode = $(this).attr("dataId");
window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime())
}
});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<style>
.sub-info th{
font-size: 16px;
text-align: right;
width: 30%;
}
.sub-info td{
font-size: 16px;
width: 70%;
}
</style>
</head>
<body class="easyui-layout">
<div region="north" style="height:90px;">
<script>
document.write(addHead('营业执照认证', '商户入驻资质审核'));
</script>
</div>
<div id="businessDiv" region="center">
<table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
<tr>
<th>商户类型</th>
<td id="businessTypeStr"></td>
</tr>
<tr>
<th id="businessNameTitle">个体工商户名称</th>
<td id="businessName"></td>
</tr>
<tr>
<th>统一社会信用代码</th>
<td id="socialCreditCode"></td>
</tr>
<tr>
<th id="certNameTitle">经营者姓名</th>
<td id="certName"></td>
</tr>
<tr>
<th id="certNoTitle">经营者身份证号</th>
<td id="certNo"></td>
</tr>
<tr>
<th>营业执照有效期</th>
<td id="validDate"></td>
</tr>
<tr>
<th>企业营业执照正本照片</th>
<td><img id="licenseOriginalImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>企业营业执照副本照片</th>
<td><img id="licenseCopyImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>法人身份证正面照片</th>
<td><img id="certFaceImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>法人身份证反面照片</th>
<td><img id="certReverseImage" height='132px;' width='211px;' /></td>
</tr>
<tr id="rejectReasonTr">
<th rowspan="2">不通过原因</th>
<td id="rejectReason" rowspan="2"></td>
</tr>
</table>
</div>
<script>
$(function() {
var param=window.location.search;
var id = getQueryString(param, "id");
getDetailInfo(id);
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
$("#businessListTable").datagrid("load", {
uid : $("#uid").val(),
businessName : $("#businessName").val(),
validStatus : $("#validStatus").myCombobox("getValue")
});
}
});
//全部按钮
$("#allBtn").linkbutton({
iconCls: "icon-import",
onClick: function () {
$("#uid").textbox('setValue','');
$("#businessName").textbox('setValue','');
$("#validStatus").combobox('setValue','');
}
});
});
function getDetailInfo(id){
var form = new FormData();
form.append("id", id);
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/businessLicense/getDetailById',
data: form,
async: false,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (result) {
if(result.code == 200) {
var businessType = result.data.businessType;
var auditStatus = result.data.auditStatus;
if(businessType == 2){
$("#businessNameTitle").html("企业名称");
$("#certNameTitle").html("法人姓名");
$("#certNoTitle").html("法人身份证号");
}
if(auditStatus ==2){
document.getElementById("rejectReasonTr").style.display= "inline";
}
$("#businessTypeStr").html(result.data.businessTypeStr);
$("#businessName").html(result.data.businessName);
$("#socialCreditCode").html(result.data.socialCreditCode);
$("#certName").html(result.data.certName);
$("#certNo").html(result.data.certNo);
$("#validDate").html(result.data.validDate);
$("#licenseOriginalImage").attr("src", result.data.licenseOriginalImage);
$("#licenseCopyImage").attr("src", result.data.licenseCopyImage);
$("#certFaceImage").attr("src", result.data.certFaceImage);
$("#certReverseImage").attr("src", result.data.certReverseImage);
}
else {
$.messager.alert("失败", result.message, "error");
}
}
});
}
function getQueryString(paraPart,name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = paraPart.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
</script>
</body>
</html>
\ No newline at end of file
... ...