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
  1 +package com.yoho.order.dal;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.ibatis.annotations.Param;
  6 +
  7 +import com.yoho.order.model.BusinessLicense;
  8 +import com.yoho.order.model.BusinessLicenseReq;
  9 +
  10 +/**
  11 + * Created by caoyan on 2019/1/7.
  12 + */
  13 +public interface BusinessLicenseMapper {
  14 +
  15 + int insert(BusinessLicense businessLicense);
  16 +
  17 + List<BusinessLicense> selectByUid(@Param("uid") Integer uid);
  18 +
  19 + int selectTotalByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq);
  20 +
  21 + List<BusinessLicense> selectByCondition(@Param("businessLicenseReq")BusinessLicenseReq businessLicenseReq);
  22 +
  23 + BusinessLicense selectById(@Param("id") Integer id);
  24 +
  25 +}
  1 +package com.yoho.order.model;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * @author caoyan
  7 + * @date 2019/1/7
  8 + */
  9 +public class BusinessLicense implements Serializable {
  10 +
  11 +
  12 + private static final long serialVersionUID = 2607922995706119816L;
  13 +
  14 + private Integer id;
  15 +
  16 + private Integer uid;
  17 +
  18 + private Integer businessType;
  19 +
  20 + private String businessName;
  21 +
  22 + private String socialCreditCode;
  23 +
  24 + private String certName;
  25 +
  26 + private String certNo;
  27 +
  28 + private Integer startTime;
  29 +
  30 + private Integer expireTime;
  31 +
  32 + private String licenseOriginalImage;
  33 +
  34 + private String licenseCopyImage;
  35 +
  36 + private String certFaceImage;
  37 +
  38 + private String certReverseImage;
  39 +
  40 + private Integer commitTime;
  41 +
  42 + private Integer auditStatus;
  43 +
  44 + private Integer auditTime;
  45 +
  46 + private Integer auditUid;
  47 +
  48 + private String rejectReason;
  49 +
  50 + public Integer getId() {
  51 + return id;
  52 + }
  53 +
  54 + public void setId(Integer id) {
  55 + this.id = id;
  56 + }
  57 +
  58 + public Integer getUid() {
  59 + return uid;
  60 + }
  61 +
  62 + public void setUid(Integer uid) {
  63 + this.uid = uid;
  64 + }
  65 +
  66 + public Integer getBusinessType() {
  67 + return businessType;
  68 + }
  69 +
  70 + public void setBusinessType(Integer businessType) {
  71 + this.businessType = businessType;
  72 + }
  73 +
  74 + public String getBusinessName() {
  75 + return businessName;
  76 + }
  77 +
  78 + public void setBusinessName(String businessName) {
  79 + this.businessName = businessName;
  80 + }
  81 +
  82 + public String getSocialCreditCode() {
  83 + return socialCreditCode;
  84 + }
  85 +
  86 + public void setSocialCreditCode(String socialCreditCode) {
  87 + this.socialCreditCode = socialCreditCode;
  88 + }
  89 +
  90 + public String getCertName() {
  91 + return certName;
  92 + }
  93 +
  94 + public void setCertName(String certName) {
  95 + this.certName = certName;
  96 + }
  97 +
  98 + public String getCertNo() {
  99 + return certNo;
  100 + }
  101 +
  102 + public void setCertNo(String certNo) {
  103 + this.certNo = certNo;
  104 + }
  105 +
  106 + public Integer getStartTime() {
  107 + return startTime;
  108 + }
  109 +
  110 + public void setStartTime(Integer startTime) {
  111 + this.startTime = startTime;
  112 + }
  113 +
  114 + public Integer getExpireTime() {
  115 + return expireTime;
  116 + }
  117 +
  118 + public void setExpireTime(Integer expireTime) {
  119 + this.expireTime = expireTime;
  120 + }
  121 +
  122 + public String getLicenseOriginalImage() {
  123 + return licenseOriginalImage;
  124 + }
  125 +
  126 + public void setLicenseOriginalImage(String licenseOriginalImage) {
  127 + this.licenseOriginalImage = licenseOriginalImage;
  128 + }
  129 +
  130 + public String getLicenseCopyImage() {
  131 + return licenseCopyImage;
  132 + }
  133 +
  134 + public void setLicenseCopyImage(String licenseCopyImage) {
  135 + this.licenseCopyImage = licenseCopyImage;
  136 + }
  137 +
  138 + public String getCertFaceImage() {
  139 + return certFaceImage;
  140 + }
  141 +
  142 + public void setCertFaceImage(String certFaceImage) {
  143 + this.certFaceImage = certFaceImage;
  144 + }
  145 +
  146 + public String getCertReverseImage() {
  147 + return certReverseImage;
  148 + }
  149 +
  150 + public void setCertReverseImage(String certReverseImage) {
  151 + this.certReverseImage = certReverseImage;
  152 + }
  153 +
  154 + public Integer getCommitTime() {
  155 + return commitTime;
  156 + }
  157 +
  158 + public void setCommitTime(Integer commitTime) {
  159 + this.commitTime = commitTime;
  160 + }
  161 +
  162 + public Integer getAuditStatus() {
  163 + return auditStatus;
  164 + }
  165 +
  166 + public void setAuditStatus(Integer auditStatus) {
  167 + this.auditStatus = auditStatus;
  168 + }
  169 +
  170 + public Integer getAuditTime() {
  171 + return auditTime;
  172 + }
  173 +
  174 + public void setAuditTime(Integer auditTime) {
  175 + this.auditTime = auditTime;
  176 + }
  177 +
  178 + public Integer getAuditUid() {
  179 + return auditUid;
  180 + }
  181 +
  182 + public void setAuditUid(Integer auditUid) {
  183 + this.auditUid = auditUid;
  184 + }
  185 +
  186 + public String getRejectReason() {
  187 + return rejectReason;
  188 + }
  189 +
  190 + public void setRejectReason(String rejectReason) {
  191 + this.rejectReason = rejectReason;
  192 + }
  193 +
  194 + @Override
  195 + public String toString() {
  196 + return "BusinessLicense{" +
  197 + "id=" + id +
  198 + ", uid='" + uid + '\'' +
  199 + ", businessType='" + businessType + '\'' +
  200 + ", businessName='" + businessName + '\'' +
  201 + ", socialCreditCode='" + socialCreditCode + '\'' +
  202 + ", certName='" + certName + '\'' +
  203 + ", certNo='" + certNo + '\'' +
  204 + ", startTime='" + startTime + '\'' +
  205 + ", expireTime='" + expireTime + '\'' +
  206 + ", licenseOriginalImage='" + licenseOriginalImage + '\'' +
  207 + ", licenseCopyImage='" + licenseCopyImage + '\'' +
  208 + ", certFaceImage='" + certFaceImage + '\'' +
  209 + ", certReverseImage='" + certReverseImage + '\'' +
  210 + ", commitTime='" + commitTime + '\'' +
  211 + ", auditStatus='" + auditStatus + '\'' +
  212 + ", auditTime='" + auditTime + '\'' +
  213 + ", auditUid='" + auditUid + '\'' +
  214 + ", rejectReason='" + rejectReason + '\'' +
  215 + '}';
  216 + }
  217 +}
  1 +package com.yoho.order.model;
  2 +
  3 +import com.yoho.ufo.service.model.PageRequestBO;
  4 +
  5 +import lombok.AllArgsConstructor;
  6 +import lombok.Data;
  7 +import lombok.NoArgsConstructor;
  8 +import lombok.experimental.Builder;
  9 +
  10 +/**
  11 + * Created by caoyan.
  12 + */
  13 +@Data
  14 +@Builder
  15 +@AllArgsConstructor
  16 +@NoArgsConstructor
  17 +public class BusinessLicenseReq extends PageRequestBO{
  18 +
  19 + /**
  20 + *
  21 + */
  22 + private static final long serialVersionUID = 1620427808531296022L;
  23 +
  24 + private Integer id;
  25 +
  26 + private Integer uid;
  27 +
  28 + private Integer businessType;
  29 +
  30 + private String businessName;
  31 +
  32 + private String socialCreditCode;
  33 +
  34 + private String certName;
  35 +
  36 + private String certNo;
  37 +
  38 + private Integer startTime;
  39 +
  40 + private Integer expireTime;
  41 +
  42 + private String licenseOriginalImage;
  43 +
  44 + private String licenseCopyImage;
  45 +
  46 + private String certFaceImage;
  47 +
  48 + private String certReverseImage;
  49 +
  50 + private Integer validStatus;//入驻状态 1:已入驻 9:已退驻
  51 +
  52 +}
  1 +package com.yoho.order.model;
  2 +
  3 +import com.yoho.ufo.service.model.PageRequestBO;
  4 +
  5 +import lombok.AllArgsConstructor;
  6 +import lombok.Data;
  7 +import lombok.NoArgsConstructor;
  8 +import lombok.experimental.Builder;
  9 +
  10 +/**
  11 + * Created by caoyan.
  12 + */
  13 +@Data
  14 +@Builder
  15 +@AllArgsConstructor
  16 +@NoArgsConstructor
  17 +public class BusinessLicenseRsp extends PageRequestBO{
  18 +
  19 + /**
  20 + *
  21 + */
  22 + private static final long serialVersionUID = 1620427808531296022L;
  23 +
  24 + private Integer id;
  25 +
  26 + private Integer uid;
  27 +
  28 + private Integer businessType;
  29 +
  30 + private String businessTypeStr;
  31 +
  32 + private String certName;
  33 +
  34 + private String certNo;
  35 +
  36 + private String commitTime;
  37 +
  38 + private Integer auditStatus;
  39 +
  40 + private String auditStatusStr;
  41 +
  42 + private String auditTime;
  43 +
  44 + private String rejectReason;
  45 +
  46 + private String validDate;
  47 +
  48 + private String licenseOriginalImage;
  49 +
  50 + private String licenseCopyImage;
  51 +
  52 + private String businessName;
  53 +
  54 + private String socialCreditCode;
  55 +
  56 + private String certFaceImage;
  57 +
  58 + private String certReverseImage;
  59 +
  60 +}
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.yoho.order.dal.BusinessLicenseMapper">
  4 + <resultMap id="BaseResultMap" type="com.yoho.order.model.BusinessLicense">
  5 + <result column="id" property="id" jdbcType="INTEGER" />
  6 + <result column="uid" property="uid" jdbcType="INTEGER" />
  7 + <result column="business_type" property="businessType" jdbcType="INTEGER" />
  8 + <result column="business_name" property="businessName" jdbcType="VARCHAR" />
  9 + <result column="social_credit_code" property="socialCreditCode" jdbcType="VARCHAR" />
  10 + <result column="cert_name" property="certName" jdbcType="VARCHAR" />
  11 + <result column="cert_no" property="certNo" jdbcType="VARCHAR" />
  12 + <result column="start_time" property="startTime" jdbcType="INTEGER" />
  13 + <result column="expire_time" property="expireTime" jdbcType="INTEGER" />
  14 + <result column="license_original_image" property="licenseOriginalImage" jdbcType="VARCHAR" />
  15 + <result column="license_copy_image" property="licenseCopyImage" jdbcType="VARCHAR" />
  16 + <result column="cert_face_image" property="certFaceImage" jdbcType="VARCHAR" />
  17 + <result column="cert_reverse_image" property="certReverseImage" jdbcType="VARCHAR" />
  18 + <result column="commit_time" property="commitTime" jdbcType="INTEGER" />
  19 + <result column="audit_status" property="auditStatus" jdbcType="INTEGER" />
  20 + <result column="audit_time" property="auditTime" jdbcType="INTEGER" />
  21 + <result column="audit_uid" property="auditUid" jdbcType="INTEGER" />
  22 + <result column="reject_reason" property="rejectReason" jdbcType="VARCHAR" />
  23 + </resultMap>
  24 +
  25 + <sql id="Base_Column_List">
  26 + id, uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time, license_original_image,
  27 + license_copy_image, cert_face_image, cert_reverse_image, commit_time, audit_status, audit_time, audit_uid, reject_reason
  28 + </sql>
  29 +
  30 + <insert id="insert" parameterType="com.yoho.order.model.BusinessLicense">
  31 + insert into business_license (uid, business_type, business_name, social_credit_code, cert_name, cert_no, start_time, expire_time,
  32 + license_original_image, license_copy_image, cert_face_image, cert_reverse_image, commit_time) values (#{uid}, #{businessType}, #{businessName},
  33 + #{socialCreditCode}, #{certName}, #{certNo}, #{startTime}, #{expireTime}, #{licenseOriginalImage}, #{licenseCopyImage},
  34 + #{certFaceImage}, #{certReverseImage}, #{commitTime})
  35 + </insert>
  36 +
  37 + <select id="selectByUid" resultMap="BaseResultMap">
  38 + select <include refid="Base_Column_List"></include>
  39 + from business_license
  40 + where uid=#{uid}
  41 + order by commit_time desc
  42 + </select>
  43 +
  44 + <sql id="Query_Sql" >
  45 + <if test="businessLicenseReq.uid != null">
  46 + and a.uid=#{businessLicenseReq.uid}
  47 + </if>
  48 + <if test="businessLicenseReq.businessName!= null">
  49 + <bind name="pattern" value="'%' + businessLicenseReq.businessName + '%'" />
  50 + and a.business_name like #{pattern}
  51 + </if>
  52 + <if test="businessLicenseReq.validStatus != null">
  53 + and b.valid_status=#{businessLicenseReq.validStatus}
  54 + </if>
  55 + </sql>
  56 +
  57 + <select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BusinessLicenseReq">
  58 + select count(1)
  59 + from business_license a
  60 + <if test="businessLicenseReq.validStatus != null">
  61 + LEFT JOIN stored_seller b
  62 + ON( b.uid=a.uid)
  63 + </if>
  64 + where 1=1
  65 + <include refid="Query_Sql"></include>
  66 + </select>
  67 +
  68 + <select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.order.model.BusinessLicenseReq">
  69 + select a.*
  70 + from business_license a
  71 + <if test="businessLicenseReq.validStatus != null">
  72 + LEFT JOIN stored_seller b
  73 + ON( b.uid=a.uid)
  74 + </if>
  75 + where 1=1
  76 + <include refid="Query_Sql"></include>
  77 + order by a.commit_time desc
  78 + <if test="businessLicenseReq.start!=null and businessLicenseReq.size != null">
  79 + limit #{businessLicenseReq.start},#{businessLicenseReq.size}
  80 + </if>
  81 + </select>
  82 +
  83 + <select id="selectById" resultMap="BaseResultMap">
  84 + select <include refid="Base_Column_List"></include>
  85 + from business_license
  86 + where id=#{id}
  87 + </select>
  88 +
  89 +
  90 +</mapper>
  1 +package com.yoho.ufo.order.controller;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestBody;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import com.yoho.order.model.BusinessLicense;
  11 +import com.yoho.order.model.BusinessLicenseReq;
  12 +import com.yoho.order.model.BusinessLicenseRsp;
  13 +import com.yoho.ufo.exception.PlatformException;
  14 +import com.yoho.ufo.order.service.IBusinessLicenseService;
  15 +import com.yoho.ufo.service.model.ApiResponse;
  16 +import com.yoho.ufo.service.model.PageResponseBO;
  17 +
  18 +@RestController
  19 +@RequestMapping(value = "/businessLicense")
  20 +public class BusinessLicenseController {
  21 +
  22 + private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseController.class);
  23 +
  24 + @Autowired
  25 + private IBusinessLicenseService businessLicenseService;
  26 +
  27 + @RequestMapping(value = "/queryList")
  28 + public ApiResponse queryList(BusinessLicenseReq req) {
  29 + LOGGER.info("queryList in. req is {}", req);
  30 + PageResponseBO<BusinessLicenseRsp> result = businessLicenseService.queryList(req);
  31 + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
  32 + }
  33 +
  34 + @RequestMapping(value = "/save")
  35 + public ApiResponse save(@RequestBody BusinessLicenseReq req) {
  36 + LOGGER.info("save in. req is {}", req);
  37 + int result = businessLicenseService.save(req);
  38 + if(result>0) {
  39 + return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").build();
  40 + }else {
  41 + return new ApiResponse.ApiResponseBuilder().code(500).message("保存失败").build();
  42 + }
  43 + }
  44 +
  45 + @RequestMapping(value = "/queryAuditStatus")
  46 + public ApiResponse queryAuditStatus(@RequestBody BusinessLicenseReq req) {
  47 + LOGGER.info("queryAuditStatus in. req is {}", req);
  48 + BusinessLicense bl;
  49 + try {
  50 + bl = businessLicenseService.getAuditRecord(req);
  51 + } catch (PlatformException e) {
  52 + return new ApiResponse.ApiResponseBuilder().code(500).message(e.getMessage()).build();
  53 + }
  54 +
  55 + if(null == bl) {
  56 + return new ApiResponse.ApiResponseBuilder().code(400).message("记录不存在").build();
  57 + }
  58 +
  59 + String auditStatusStr = "审核中";
  60 + String info = "您的资料已提交审核,认证成功后我们将会第一时间通知您。";
  61 + if(bl.getAuditStatus().intValue() == 1) {
  62 + auditStatusStr = "审核通过";
  63 + info = "您的资料已审核通过,现您可以进行商家入驻。";
  64 + }else if(bl.getAuditStatus().intValue() == 2) {
  65 + auditStatusStr = "审核不通过";
  66 + info = bl.getRejectReason();
  67 + }
  68 +
  69 + return new ApiResponse.ApiResponseBuilder().code(200).message(info).data(auditStatusStr).build();
  70 + }
  71 +
  72 + @RequestMapping(value = "/getDetailById")
  73 + public ApiResponse getDetailById(BusinessLicenseReq req) {
  74 + LOGGER.info("save in. req is {}", req);
  75 + BusinessLicenseRsp result = businessLicenseService.getDetail(req);
  76 + return new ApiResponse.ApiResponseBuilder().code(200).data(result).message("保存成功").build();
  77 + }
  78 +
  79 +}
  1 +package com.yoho.ufo.order.service;
  2 +
  3 +import com.yoho.order.model.BusinessLicense;
  4 +import com.yoho.order.model.BusinessLicenseReq;
  5 +import com.yoho.order.model.BusinessLicenseRsp;
  6 +import com.yoho.ufo.exception.PlatformException;
  7 +import com.yoho.ufo.service.model.PageResponseBO;
  8 +
  9 +public interface IBusinessLicenseService {
  10 + int save(BusinessLicenseReq req);
  11 +
  12 + BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException;
  13 +
  14 + PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req);
  15 +
  16 + BusinessLicenseRsp getDetail(BusinessLicenseReq req);
  17 +}
  1 +package com.yoho.ufo.order.service.impl;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.apache.commons.collections.CollectionUtils;
  6 +import org.apache.commons.lang.StringUtils;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.BeanUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Service;
  12 +
  13 +import com.google.common.collect.Lists;
  14 +import com.yoho.core.common.utils.DateUtil;
  15 +import com.yoho.order.dal.BusinessLicenseMapper;
  16 +import com.yoho.order.model.BusinessLicense;
  17 +import com.yoho.order.model.BusinessLicenseReq;
  18 +import com.yoho.order.model.BusinessLicenseRsp;
  19 +import com.yoho.ufo.exception.PlatformException;
  20 +import com.yoho.ufo.order.service.IBusinessLicenseService;
  21 +import com.yoho.ufo.service.model.PageResponseBO;
  22 +
  23 +/**
  24 + * @author caoyan
  25 + * @date 2019/1/7
  26 + */
  27 +@Service
  28 +public class BusinessLicenseServiceImpl implements IBusinessLicenseService {
  29 +
  30 + private static final Logger LOGGER = LoggerFactory.getLogger(BusinessLicenseServiceImpl.class);
  31 +
  32 + @Autowired
  33 + private BusinessLicenseMapper businessLicenseMapper;
  34 +
  35 + @Override
  36 + public int save(BusinessLicenseReq req) {
  37 + BusinessLicense item = new BusinessLicense();
  38 + BeanUtils.copyProperties(req, item);
  39 + item.setCommitTime(DateUtil.getCurrentTimeSecond());
  40 + return businessLicenseMapper.insert(item);
  41 + }
  42 +
  43 + @Override
  44 + public BusinessLicense getAuditRecord(BusinessLicenseReq req) throws PlatformException {
  45 + if(null == req.getUid()) {
  46 + throw new PlatformException("用户ID为空", 400);
  47 + }
  48 + List<BusinessLicense> list = businessLicenseMapper.selectByUid(req.getUid());
  49 +
  50 + return list.get(0);
  51 + }
  52 +
  53 + @Override
  54 + public PageResponseBO<BusinessLicenseRsp> queryList(BusinessLicenseReq req){
  55 + int total = businessLicenseMapper.selectTotalByCondition(req);
  56 + if(total == 0) {
  57 + return null;
  58 + }
  59 +
  60 + List<BusinessLicense> list = businessLicenseMapper.selectByCondition(req);
  61 + if(CollectionUtils.isEmpty(list)) {
  62 + return null;
  63 + }
  64 +
  65 + List<BusinessLicenseRsp> rspList = Lists.newArrayList();
  66 + for(BusinessLicense item : list) {
  67 + BusinessLicenseRsp rsp = new BusinessLicenseRsp();
  68 + rsp.setId(item.getId());
  69 + rsp.setUid(item.getUid());
  70 + rsp.setBusinessType(item.getBusinessType());
  71 + rsp.setBusinessTypeStr(getBusinessTypeStr(item.getBusinessType()));
  72 + rsp.setCertName(item.getCertName());
  73 + rsp.setCertNo(item.getCertNo());
  74 + rsp.setCommitTime(DateUtil.getDateStrBySecond(item.getCommitTime(), "yyyy/MM/dd HH:mm:ss"));
  75 + rsp.setAuditStatus(item.getAuditStatus());
  76 + rsp.setAuditStatusStr(getAuditStatusStr(item.getAuditStatus()));
  77 + rsp.setAuditTime(null == item.getAuditTime() ? "/" : DateUtil.getDateStrBySecond(item.getAuditTime(), "yyyy/MM/dd HH:mm:ss"));
  78 + rsp.setRejectReason(StringUtils.isEmpty(item.getRejectReason()) ? "/" : item.getRejectReason());
  79 +
  80 + rspList.add(rsp);
  81 + }
  82 +
  83 + PageResponseBO<BusinessLicenseRsp> result=new PageResponseBO<>();
  84 + result.setList(rspList);
  85 + result.setPage(req.getPage());
  86 + result.setSize(req.getSize());
  87 + result.setTotal(total);
  88 +
  89 + return result;
  90 + }
  91 +
  92 + @Override
  93 + public BusinessLicenseRsp getDetail(BusinessLicenseReq req) {
  94 + BusinessLicense bl = businessLicenseMapper.selectById(req.getId());
  95 + if(null == bl) {
  96 + return null;
  97 + }
  98 +
  99 + BusinessLicenseRsp rsp = new BusinessLicenseRsp();
  100 + BeanUtils.copyProperties(bl, rsp, BusinessLicenseRsp.class);
  101 + rsp.setBusinessTypeStr(getBusinessTypeStr(bl.getBusinessType()));
  102 + rsp.setValidDate(getValidDateStr(bl.getStartTime(), bl.getExpireTime()));
  103 +
  104 + return rsp;
  105 + }
  106 +
  107 + private String getValidDateStr(Integer startTime, Integer expireTime) {
  108 + StringBuilder sb = new StringBuilder();
  109 + sb.append(DateUtil.getDateStrBySecond(startTime, "yyyy.MM.dd")).append(" - ");
  110 + if(expireTime.intValue() == 0) {
  111 + sb.append("无限期");
  112 + }else {
  113 + sb.append(DateUtil.getDateStrBySecond(expireTime, "yyyy.MM.dd"));
  114 + }
  115 +
  116 + return sb.toString();
  117 + }
  118 +
  119 + private String getBusinessTypeStr(int type) {
  120 + if(type == 1) {
  121 + return "个体工商户";
  122 + }else if(type == 2) {
  123 + return "企业法人";
  124 + }
  125 +
  126 + return StringUtils.EMPTY;
  127 + }
  128 +
  129 + private String getAuditStatusStr(int status) {
  130 + if(status == 0) {
  131 + return "待审核";
  132 + }else if(status == 1) {
  133 + return "审核通过";
  134 + }else if(status == 2) {
  135 + return "审核不通过";
  136 + }
  137 + return "";
  138 + }
  139 +}
@@ -39,6 +39,7 @@ datasources: @@ -39,6 +39,7 @@ datasources:
39 - com.yoho.order.dal.CameraRecordMapper 39 - com.yoho.order.dal.CameraRecordMapper
40 - com.yoho.order.dal.UserCameraRecordMapper 40 - com.yoho.order.dal.UserCameraRecordMapper
41 - com.yoho.order.dal.OrderStatusMonitorMapper 41 - com.yoho.order.dal.OrderStatusMonitorMapper
  42 + - com.yoho.order.dal.BusinessLicenseMapper
42 43
43 ufo_resource: 44 ufo_resource:
44 servers: 45 servers:
@@ -39,6 +39,7 @@ datasources: @@ -39,6 +39,7 @@ datasources:
39 - com.yoho.order.dal.CameraRecordMapper 39 - com.yoho.order.dal.CameraRecordMapper
40 - com.yoho.order.dal.UserCameraRecordMapper 40 - com.yoho.order.dal.UserCameraRecordMapper
41 - com.yoho.order.dal.OrderStatusMonitorMapper 41 - com.yoho.order.dal.OrderStatusMonitorMapper
  42 + - com.yoho.order.dal.BusinessLicenseMapper
42 43
43 ufo_resource: 44 ufo_resource:
44 servers: 45 servers:
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8"/>
  5 + <title>Yoho!Buy运营平台</title>
  6 + <script src="/ufoPlatform/js/include.js"></script>
  7 +</head>
  8 +<body class="easyui-layout">
  9 +<div region="north" style="height:230px;">
  10 + <script>
  11 + document.write(addHead('营业执照认证', '商户入驻资质审核'));
  12 + </script>
  13 + <div style="margin-left: 10px;margin-top: 30px">
  14 + <div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
  15 + <div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
  16 + <input id="uid" name="uid" />
  17 + <input id="businessName" name="businessName" />
  18 + <input id="validStatus" name="validStatus" />
  19 + <a id="searchBtn" class="btn-info">筛选</a>
  20 + <a id="allBtn" class="btn-success">全部</a>
  21 + </div>
  22 + </div>
  23 + </div>
  24 +</div>
  25 +
  26 +<div id="businessList" region="center">
  27 + <table id="businessListTable"></table>
  28 +</div>
  29 +<script>
  30 +$(function() {
  31 + $("#uid").textbox({
  32 + prompt: "用户UID",
  33 + width: 200
  34 + });
  35 +
  36 + $("#businessName").textbox({
  37 + prompt: "商家名称",
  38 + width: 200
  39 + });
  40 +
  41 + $("#validStatus").combobox({
  42 + prompt: "入驻状态",
  43 + width: 150,
  44 + editable : false,
  45 + data: [
  46 + {"text" : "已入驻", "value" : 1},
  47 + {"text" : "已退驻", "value" : 9}
  48 + ]
  49 + });
  50 +
  51 + $("#searchBtn").linkbutton({
  52 + iconCls : "icon-search",
  53 + onClick : function() {
  54 + $("#businessListTable").datagrid("load", {
  55 + uid : $("#uid").val(),
  56 + businessName : $("#businessName").val(),
  57 + validStatus : $("#validStatus").myCombobox("getValue")
  58 + });
  59 + }
  60 + });
  61 +
  62 + //全部按钮
  63 + $("#allBtn").linkbutton({
  64 + iconCls: "icon-import",
  65 + onClick: function () {
  66 + $("#uid").textbox('setValue','');
  67 + $("#businessName").textbox('setValue','');
  68 + $("#validStatus").combobox('setValue','');
  69 + }
  70 + });
  71 +
  72 + getBusinessList();
  73 +});
  74 +
  75 +function getBusinessList(){
  76 + $("#businessListTable").myDatagrid({
  77 + fit: true,
  78 + fitColumns: true,
  79 + striped: true,
  80 + url: contextPath + "/businessLicense/queryList",
  81 + method: 'POST',
  82 + loadFilter: function (data) {
  83 + var temp = defaultLoadFilter(data);
  84 + temp=null==temp?[]:temp;
  85 + temp.rows = temp.list;
  86 + return temp;
  87 + },
  88 +
  89 + columns: [[{
  90 + title: "UID",
  91 + field: "uid",
  92 + width: 20,
  93 + align: "center"
  94 + }, {
  95 + title: "商户类型",
  96 + field: "businessTypeStr",
  97 + width: 20,
  98 + align: "center"
  99 + }, {
  100 + title: "姓名",
  101 + field: "certName",
  102 + width: 20,
  103 + align: "center"
  104 + }, {
  105 + title: "身份证号",
  106 + field: "certNo",
  107 + width: 30,
  108 + align: "center"
  109 + }, {
  110 + title: "提交时间",
  111 + field: "commitTime",
  112 + width: 30,
  113 + align: "center"
  114 + }, {
  115 + title: "审核状态",
  116 + field: "auditStatusStr",
  117 + width: 20,
  118 + align: "center"
  119 + }, {
  120 + title: "审核时间",
  121 + field: "auditTime",
  122 + width: 30,
  123 + align: "center"
  124 + }, {
  125 + title: "原因",
  126 + field: "rejectReason",
  127 + width: 30,
  128 + align: "center"
  129 + }, {
  130 + title: "操作",
  131 + field: "asdf",
  132 + width: 30,
  133 + align: "center",
  134 + formatter: function (value, rowData, rowIndex) {
  135 + var str = "<a role='detail' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #428bca !important;'>查看</a>";
  136 + if(rowData.auditStatus==0){
  137 + str = "<a role='audit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>审核</a>" + str;
  138 + }
  139 + return str;
  140 + }
  141 + }]],
  142 + cache: false,
  143 + pagination: true,
  144 + pageSize: 10,
  145 + idField: "id",
  146 + singleSelect: true,
  147 + onLoadSuccess: function (data) {
  148 + $(this).datagrid("getPanel").find("a[role='detail']").linkbutton({
  149 + onClick: function () {
  150 + var id = $(this).attr("dataId");
  151 + window.open(contextPath + "/html/businessLicense/view.html?id=" + id + "&ver=" + new Date().getTime())
  152 + }
  153 + });
  154 +
  155 + $(this).datagrid("getPanel").find("a[role='audit']").linkbutton({
  156 + onClick: function () {
  157 + var orderCode = $(this).attr("dataId");
  158 + window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime())
  159 + }
  160 + });
  161 +
  162 + }
  163 + });
  164 +}
  165 +
  166 +</script>
  167 +</body>
  168 +</html>
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8"/>
  5 + <title>Yoho!Buy运营平台</title>
  6 + <script src="/ufoPlatform/js/include.js"></script>
  7 + <style>
  8 + .sub-info th{
  9 + font-size: 16px;
  10 + text-align: right;
  11 + width: 30%;
  12 + }
  13 + .sub-info td{
  14 + font-size: 16px;
  15 + width: 70%;
  16 + }
  17 + </style>
  18 +</head>
  19 +<body class="easyui-layout">
  20 +<div region="north" style="height:90px;">
  21 + <script>
  22 + document.write(addHead('营业执照认证', '商户入驻资质审核'));
  23 + </script>
  24 +</div>
  25 +
  26 +<div id="businessDiv" region="center">
  27 + <table id="businessTable" class="sub-info" frame="void" width="80%" cellpadding="16" align="center">
  28 + <tr>
  29 + <th>商户类型</th>
  30 + <td id="businessTypeStr"></td>
  31 + </tr>
  32 + <tr>
  33 + <th id="businessNameTitle">个体工商户名称</th>
  34 + <td id="businessName"></td>
  35 + </tr>
  36 + <tr>
  37 + <th>统一社会信用代码</th>
  38 + <td id="socialCreditCode"></td>
  39 + </tr>
  40 + <tr>
  41 + <th id="certNameTitle">经营者姓名</th>
  42 + <td id="certName"></td>
  43 + </tr>
  44 + <tr>
  45 + <th id="certNoTitle">经营者身份证号</th>
  46 + <td id="certNo"></td>
  47 + </tr>
  48 + <tr>
  49 + <th>营业执照有效期</th>
  50 + <td id="validDate"></td>
  51 + </tr>
  52 + <tr>
  53 + <th>企业营业执照正本照片</th>
  54 + <td><img id="licenseOriginalImage" height='132px;' width='211px;' /></td>
  55 + </tr>
  56 + <tr>
  57 + <th>企业营业执照副本照片</th>
  58 + <td><img id="licenseCopyImage" height='132px;' width='211px;' /></td>
  59 + </tr>
  60 + <tr>
  61 + <th>法人身份证正面照片</th>
  62 + <td><img id="certFaceImage" height='132px;' width='211px;' /></td>
  63 + </tr>
  64 + <tr>
  65 + <th>法人身份证反面照片</th>
  66 + <td><img id="certReverseImage" height='132px;' width='211px;' /></td>
  67 + </tr>
  68 + <tr id="rejectReasonTr">
  69 + <th rowspan="2">不通过原因</th>
  70 + <td id="rejectReason" rowspan="2"></td>
  71 + </tr>
  72 + </table>
  73 +</div>
  74 +<script>
  75 +$(function() {
  76 + var param=window.location.search;
  77 + var id = getQueryString(param, "id");
  78 +
  79 + getDetailInfo(id);
  80 +
  81 +
  82 +
  83 + $("#searchBtn").linkbutton({
  84 + iconCls : "icon-search",
  85 + onClick : function() {
  86 + $("#businessListTable").datagrid("load", {
  87 + uid : $("#uid").val(),
  88 + businessName : $("#businessName").val(),
  89 + validStatus : $("#validStatus").myCombobox("getValue")
  90 + });
  91 + }
  92 + });
  93 +
  94 + //全部按钮
  95 + $("#allBtn").linkbutton({
  96 + iconCls: "icon-import",
  97 + onClick: function () {
  98 + $("#uid").textbox('setValue','');
  99 + $("#businessName").textbox('setValue','');
  100 + $("#validStatus").combobox('setValue','');
  101 + }
  102 + });
  103 +
  104 +});
  105 +
  106 +function getDetailInfo(id){
  107 + var form = new FormData();
  108 + form.append("id", id);
  109 +
  110 + //发送请求
  111 + $.ajax({
  112 + type: "POST",
  113 + url: contextPath + '/businessLicense/getDetailById',
  114 + data: form,
  115 + async: false,
  116 + cache: false,
  117 + contentType: false,
  118 + processData: false,
  119 + dataType: 'json',
  120 + success: function (result) {
  121 + if(result.code == 200) {
  122 + var businessType = result.data.businessType;
  123 + var auditStatus = result.data.auditStatus;
  124 + if(businessType == 2){
  125 + $("#businessNameTitle").html("企业名称");
  126 + $("#certNameTitle").html("法人姓名");
  127 + $("#certNoTitle").html("法人身份证号");
  128 + }
  129 + if(auditStatus ==2){
  130 + document.getElementById("rejectReasonTr").style.display= "inline";
  131 + }
  132 + $("#businessTypeStr").html(result.data.businessTypeStr);
  133 + $("#businessName").html(result.data.businessName);
  134 + $("#socialCreditCode").html(result.data.socialCreditCode);
  135 + $("#certName").html(result.data.certName);
  136 + $("#certNo").html(result.data.certNo);
  137 + $("#validDate").html(result.data.validDate);
  138 + $("#licenseOriginalImage").attr("src", result.data.licenseOriginalImage);
  139 + $("#licenseCopyImage").attr("src", result.data.licenseCopyImage);
  140 + $("#certFaceImage").attr("src", result.data.certFaceImage);
  141 + $("#certReverseImage").attr("src", result.data.certReverseImage);
  142 +
  143 + }
  144 + else {
  145 + $.messager.alert("失败", result.message, "error");
  146 + }
  147 + }
  148 + });
  149 +}
  150 +
  151 +function getQueryString(paraPart,name) {
  152 + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  153 + var r = paraPart.substr(1).match(reg);
  154 + if (r != null) return unescape(r[2]);
  155 + return null;
  156 +}
  157 +
  158 +</script>
  159 +</body>
  160 +</html>