Authored by caoyan

营业执照

@@ -4,6 +4,7 @@ import java.text.ParseException; @@ -4,6 +4,7 @@ import java.text.ParseException;
4 import java.text.SimpleDateFormat; 4 import java.text.SimpleDateFormat;
5 import java.util.Date; 5 import java.util.Date;
6 6
  7 +import org.apache.commons.lang3.StringUtils;
7 import org.slf4j.Logger; 8 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 9 import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,6 +40,12 @@ public class BusinessLicenseController { @@ -39,6 +40,12 @@ public class BusinessLicenseController {
39 @RequestParam(value = "license_copy_image", required = true) String licenseCopyImage, 40 @RequestParam(value = "license_copy_image", required = true) String licenseCopyImage,
40 @RequestParam(value = "cert_face_image", required = true) String certFaceImage, 41 @RequestParam(value = "cert_face_image", required = true) String certFaceImage,
41 @RequestParam(value = "cert_reverse_image", required = true) String certReverseImage) { 42 @RequestParam(value = "cert_reverse_image", required = true) String certReverseImage) {
  43 + if(StringUtils.isEmpty(businessName) || StringUtils.isEmpty(socialCreditCode) || StringUtils.isEmpty(certName) || StringUtils.isEmpty(certNo)
  44 + || StringUtils.isEmpty(startTime) || StringUtils.isEmpty(expireTime) || StringUtils.isEmpty(licenseOriginalImage)
  45 + || StringUtils.isEmpty(licenseCopyImage) || StringUtils.isEmpty(certFaceImage) || StringUtils.isEmpty(certReverseImage)
  46 + || null == uid || null == businessType) {
  47 + return new ApiResponse.ApiResponseBuilder().code(500).message("有参数为空").build();
  48 + }
42 BusinessLicense bl = new BusinessLicense(); 49 BusinessLicense bl = new BusinessLicense();
43 bl.setUid(uid); 50 bl.setUid(uid);
44 bl.setBusinessType(businessType); 51 bl.setBusinessType(businessType);
@@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl; @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
  5 +import org.apache.commons.collections.CollectionUtils;
5 import org.slf4j.Logger; 6 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory; 7 import org.slf4j.LoggerFactory;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +26,15 @@ public class BusinessLicenseServiceImpl implements IBusinessLicenseService { @@ -25,6 +26,15 @@ public class BusinessLicenseServiceImpl implements IBusinessLicenseService {
25 26
26 @Override 27 @Override
27 public int save(BusinessLicense bl) { 28 public int save(BusinessLicense bl) {
  29 + //查询是否存在
  30 + List<BusinessLicense> dbList = businessLicenseMapper.selectByUid(bl.getUid());
  31 + if(CollectionUtils.isNotEmpty(dbList)) {
  32 + for(BusinessLicense item : dbList) {
  33 + if(item.getAuditStatus().intValue() != 2) {//不是审核不通过的记录,待审核或审核通过
  34 + return 0;
  35 + }
  36 + }
  37 + }
28 return businessLicenseMapper.insert(bl); 38 return businessLicenseMapper.insert(bl);
29 } 39 }
30 40