Authored by caoyan

营业执照

... ... @@ -22,4 +22,7 @@ public interface BusinessLicenseMapper {
BusinessLicense selectById(@Param("id") Integer id);
int upadteAuditResult(@Param("id") Integer id, @Param("auditStatus") Integer auditStatus,
@Param("rejectReason") String rejectReason, @Param("auditUid")Integer auditUid);
}
... ...
... ... @@ -49,4 +49,8 @@ public class BusinessLicenseReq extends PageRequestBO{
private Integer validStatus;//入驻状态 1:已入驻 9:已退驻
private String rejectReason;
private Integer auditStatus;
}
... ...
... ... @@ -86,5 +86,10 @@
where id=#{id}
</select>
<update id="upadteAuditResult">
update business_license set audit_status=#{auditStatus}, reject_reason=#{rejectReason},
audit_uid=#{auditUid}, audit_time=unix_timestamp()
where id=#{id}
</update>
</mapper>
\ No newline at end of file
... ...
... ... @@ -3,11 +3,9 @@ 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;
... ... @@ -31,49 +29,28 @@ public class BusinessLicenseController {
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/save")
public ApiResponse save(BusinessLicenseReq req) {
@RequestMapping(value = "/getDetailById")
public ApiResponse getDetailById(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();
}
BusinessLicenseRsp result = businessLicenseService.getDetail(req);
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("保存成功").build();
}
@RequestMapping(value = "/queryAuditStatus")
public ApiResponse queryAuditStatus(BusinessLicenseReq req) {
LOGGER.info("queryAuditStatus in. req is {}", req);
BusinessLicense bl;
@RequestMapping(value = "/updateAuditInfoById")
public ApiResponse updateAuditInfoById(BusinessLicenseReq req) {
LOGGER.info("save in. req is {}", req);
int result;
try {
bl = businessLicenseService.getAuditRecord(req);
result = businessLicenseService.updateAuditResult(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();
if(result>0) {
return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("保存成功").build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).data(result).message("保存失败").build();
}
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();
}
}
... ...
... ... @@ -14,4 +14,6 @@ public interface IBusinessLicenseService {
PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req);
BusinessLicenseRsp getDetail(BusinessLicenseReq req);
int updateAuditResult(BusinessLicenseReq req) throws PlatformException;
}
... ...
... ... @@ -18,6 +18,7 @@ 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.impl.UserHelper;
import com.yoho.ufo.service.model.PageResponseBO;
/**
... ... @@ -104,6 +105,16 @@ public class BusinessLicenseServiceImpl implements IBusinessLicenseService {
return rsp;
}
@Override
public int updateAuditResult(BusinessLicenseReq req) throws PlatformException {
BusinessLicense bl = businessLicenseMapper.selectById(req.getId());
if(null == bl) {
throw new PlatformException("记录不存在", 400);
}
return businessLicenseMapper.upadteAuditResult(req.getId(), req.getAuditStatus(), req.getRejectReason(), new UserHelper().getUserId());
}
private String getValidDateStr(Integer startTime, Integer expireTime) {
StringBuilder sb = new StringBuilder();
sb.append(DateUtil.getDateStrBySecond(startTime, "yyyy.MM.dd")).append(" - ");
... ...
<!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%;
}
.btn-long {
width: 200px;
height: 40px;
line-height: 40px;
font-size: 80px;
color: white;
border-radius: 5px;
display: inline-block;
cursor: pointer;
text-align: center;
}
.btn-long:hover {
opacity: 0.9;
}
</style>
</head>
<body class="easyui-layout" fit="true">
<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>不通过原因</th>
<td id="rejectReasonTd"><textarea id="rejectReason" style="margin: 0px; width: 400px; height: 70px;"></textarea></td>
</tr>
</table>
<div id="btnList" style="text-align:center;">
<a id="rejectBtn" class="btn-long" style="background-color: rgba(217, 0, 27, 1);">不通过</a>
<a id="passBtn" class="btn-long" style="background-color: rgba(2, 125, 180, 1);">通过</a>
</div>
<br>
<br>
</div>
<script>
$(function() {
var param=window.location.search;
var id = getQueryString(param, "id");
getDetailInfo(id);
$("#rejectBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
updateAuditReject(id, 2, $("#rejectReason").val());
}
});
$("#passBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
updateAuditPass(id, 1,);
}
});
});
function updateAuditPass(id, auditStatus){
$.post(contextPath + "/businessLicense/updateAuditInfoById", {
id : id,
auditStatus : auditStatus,
rejectReason : ''
}, function(data) {
if (data.code == 200) {
document.getElementById("rejectReasonTr").style.display= "none";
document.getElementById("btnList").style.display= "none";
window.self.$.messager.show({
title : "提示",
msg : "审核成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
function updateAuditReject(id, auditStatus, rejectReason){
$.post(contextPath + "/businessLicense/updateAuditInfoById", {
id : id,
auditStatus : auditStatus,
rejectReason : rejectReason
}, function(data) {
if (data.code == 200) {
$("#rejectReasonTd").html(rejectReason);
document.getElementById("btnList").style.display= "none";
window.self.$.messager.show({
title : "提示",
msg : "审核成功!"
});
}else {
window.self.$.messager.alert("失败", "失败!", "error");
}
});
}
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("法人身份证号");
}
$("#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
... ...
... ... @@ -154,9 +154,8 @@ function getBusinessList(){
$(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())
}
var id = $(this).attr("dataId");
window.open(contextPath + "/html/businessLicense/audit.html?id=" + id + "&ver=" + new Date().getTime()); }
});
}
... ...
... ... @@ -50,26 +50,28 @@
<td id="validDate"></td>
</tr>
<tr>
<th>企业营业执照正本照片</th>
<th>营业执照正本照片</th>
<td><img id="licenseOriginalImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>企业营业执照副本照片</th>
<th>营业执照副本照片</th>
<td><img id="licenseCopyImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>法人身份证正面照片</th>
<th>身份证正面照片</th>
<td><img id="certFaceImage" height='132px;' width='211px;' /></td>
</tr>
<tr>
<th>法人身份证反面照片</th>
<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>
<th>不通过原因</th>
<td id="rejectReason"></td>
</tr>
</table>
<br>
<br>
</div>
<script>
$(function() {
... ... @@ -78,29 +80,6 @@ $(function() {
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){
... ... @@ -126,8 +105,10 @@ function getDetailInfo(id){
$("#certNameTitle").html("法人姓名");
$("#certNoTitle").html("法人身份证号");
}
if(auditStatus ==2){
document.getElementById("rejectReasonTr").style.display= "inline";
if(result.data.auditStatus != 2){
document.getElementById("rejectReasonTr").style.display= "none";
}else{
$("#rejectReason").html(result.data.rejectReason);
}
$("#businessTypeStr").html(result.data.businessTypeStr);
$("#businessName").html(result.data.businessName);
... ...