Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -166,6 +166,8 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
LICENSE_NOT_EXIST(109006, "证照不存在",null),
|
LICENSE_NOT_EXIST(109006, "证照不存在",null),
|
||||||
|
|
||||||
|
FOOD_BUSINESS_LICENSE_PARSE_FAIL(109007, "食营证照解析失败", null),
|
||||||
|
|
||||||
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
||||||
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
||||||
SHOP_ID_IS_NULL(103003,"验参shopId失败,为空",null),
|
SHOP_ID_IS_NULL(103003,"验参shopId失败,为空",null),
|
||||||
|
|||||||
@@ -128,13 +128,16 @@
|
|||||||
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
|
||||||
select
|
select
|
||||||
a.id as id,
|
a.id as id,
|
||||||
|
a.line_id as lineId,
|
||||||
a.shop_name as shopName,
|
a.shop_name as shopName,
|
||||||
a.store_num as storeNum,
|
a.store_num as storeNum,
|
||||||
a.shop_manager_user_id as shopManagerUserId,
|
a.shop_manager_user_id as shopManagerUserId,
|
||||||
|
a.supervisor_user_id as supervisorUserId,
|
||||||
a.region_id as regionId,
|
a.region_id as regionId,
|
||||||
a.plan_open_time as planOpenTime,
|
a.plan_open_time as planOpenTime,
|
||||||
b.username as username,
|
b.username as username,
|
||||||
b.mobile as mobile
|
b.mobile as mobile,
|
||||||
|
b.investment_manager as investmentManager
|
||||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||||
where a.deleted = 0
|
where a.deleted = 0
|
||||||
<if test="request.keyword != null and request.keyword != ''">
|
<if test="request.keyword != null and request.keyword != ''">
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public class PreparationDTO {
|
|||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
private String shopName;
|
private String shopName;
|
||||||
|
|
||||||
private String storeNum;
|
private String storeNum;
|
||||||
@@ -28,5 +30,9 @@ public class PreparationDTO {
|
|||||||
|
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
|
private String investmentManager;
|
||||||
|
|
||||||
|
private String supervisorUserId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public class SubmitLicenseRequest {
|
|||||||
@ApiModelProperty("营业执照经营场所")
|
@ApiModelProperty("营业执照经营场所")
|
||||||
private String licenseAddress;
|
private String licenseAddress;
|
||||||
|
|
||||||
|
@ApiModelProperty("有效期类型 0:长期有效(不用传validity) 1:效期内")
|
||||||
|
private Integer validityType;
|
||||||
|
|
||||||
@ApiModelProperty("有效期")
|
@ApiModelProperty("有效期")
|
||||||
private Date validity;
|
private Date validity;
|
||||||
|
|
||||||
@@ -96,32 +99,22 @@ public class SubmitLicenseRequest {
|
|||||||
licenseTransactDO.setBusinessProject(this.businessProject);
|
licenseTransactDO.setBusinessProject(this.businessProject);
|
||||||
licenseTransactDO.setRemark(this.remark);
|
licenseTransactDO.setRemark(this.remark);
|
||||||
licenseTransactDO.setRemarkUrl(this.remarkUrl);
|
licenseTransactDO.setRemarkUrl(this.remarkUrl);
|
||||||
// Not mapped LicenseTransactDO fields:
|
|
||||||
// shopId
|
|
||||||
licenseTransactDO.setShopId(this.shopId);
|
licenseTransactDO.setShopId(this.shopId);
|
||||||
// businessLicense
|
|
||||||
licenseTransactDO.setBusinessLicense(this.licenseName);
|
licenseTransactDO.setBusinessLicense(this.licenseName);
|
||||||
// creditCode
|
|
||||||
licenseTransactDO.setCreditCode(this.socialCreditCode);
|
licenseTransactDO.setCreditCode(this.socialCreditCode);
|
||||||
// creditUrl
|
|
||||||
licenseTransactDO.setCreditUrl(this.licenseUrl);
|
licenseTransactDO.setCreditUrl(this.licenseUrl);
|
||||||
// validity
|
if (this.validityType == 0){
|
||||||
|
licenseTransactDO.setValidity(null);
|
||||||
|
}else if (this.validityType == 1){
|
||||||
licenseTransactDO.setValidity(this.validity);
|
licenseTransactDO.setValidity(this.validity);
|
||||||
// idCardPositiveCreditUrl
|
}
|
||||||
licenseTransactDO.setIdCardPositiveCreditUrl(this.idCardAndLicense1);
|
licenseTransactDO.setIdCardPositiveCreditUrl(this.idCardAndLicense1);
|
||||||
// idCardNegativeCreditUrl
|
|
||||||
licenseTransactDO.setIdCardNegativeCreditUrl(this.idCardAndLicense2);
|
licenseTransactDO.setIdCardNegativeCreditUrl(this.idCardAndLicense2);
|
||||||
// foodBusinessLicenseCode
|
|
||||||
licenseTransactDO.setFoodBusinessLicenseCode(this.foodLicenseCode);
|
licenseTransactDO.setFoodBusinessLicenseCode(this.foodLicenseCode);
|
||||||
// foodLicenseAddress
|
|
||||||
licenseTransactDO.setFoodLicenseAddress(this.businessPremises);
|
licenseTransactDO.setFoodLicenseAddress(this.businessPremises);
|
||||||
// foodBusinessStartTime
|
|
||||||
licenseTransactDO.setFoodBusinessStartTime(this.foodLicenseStartTime);
|
licenseTransactDO.setFoodBusinessStartTime(this.foodLicenseStartTime);
|
||||||
// foodBusinessEndTime
|
|
||||||
licenseTransactDO.setFoodBusinessEndTime(this.foodLicenseEndTime);
|
licenseTransactDO.setFoodBusinessEndTime(this.foodLicenseEndTime);
|
||||||
// foodBusinessLicenseUrl
|
licenseTransactDO.setFoodBusinessLicenseUrl(this.foodLicenseUrl);
|
||||||
licenseTransactDO.setFoodBusinessLicenseUrl(this.getFoodLicenseUrl());
|
|
||||||
// submitStatus
|
|
||||||
licenseTransactDO.setSubmitStatus(this.submitStatus);
|
licenseTransactDO.setSubmitStatus(this.submitStatus);
|
||||||
return licenseTransactDO;
|
return licenseTransactDO;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class SubmitLicenseResponse {
|
|||||||
@ApiModelProperty("营业执照经营场所")
|
@ApiModelProperty("营业执照经营场所")
|
||||||
private String licenseAddress;
|
private String licenseAddress;
|
||||||
|
|
||||||
@ApiModelProperty("有效期")
|
@ApiModelProperty("有效期(如果为空则是长期有效)")
|
||||||
private Date validity;
|
private Date validity;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,41 @@ public class BusinessLicenseInfoVO {
|
|||||||
@ApiModelProperty("公司地址")
|
@ApiModelProperty("公司地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty("法人")
|
||||||
|
private String legalPerson;
|
||||||
|
|
||||||
|
@ApiModelProperty("有效期")
|
||||||
|
private String validPeriod;
|
||||||
|
|
||||||
|
@ApiModelProperty("建立日期")
|
||||||
|
private String establishDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("营业执照名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
public BusinessLicenseInfoVO(String registerNumber, String address) {
|
public BusinessLicenseInfoVO(String registerNumber, String address) {
|
||||||
this.registerNumber = registerNumber;
|
this.registerNumber = registerNumber;
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BusinessLicenseInfoVO(String registerNumber, String address, String legalPerson, String validPeriod, String establishDate) {
|
||||||
|
this.registerNumber = registerNumber;
|
||||||
|
this.address = address;
|
||||||
|
this.legalPerson = legalPerson;
|
||||||
|
this.validPeriod = validPeriod;
|
||||||
|
this.establishDate = establishDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusinessLicenseInfoVO(String registerNumber, String address, String legalPerson, String validPeriod, String establishDate, String name, String type) {
|
||||||
|
this.registerNumber = registerNumber;
|
||||||
|
this.address = address;
|
||||||
|
this.legalPerson = legalPerson;
|
||||||
|
this.validPeriod = validPeriod;
|
||||||
|
this.establishDate = establishDate;
|
||||||
|
this.name = name;
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.cool.store.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FoodLicenseVO {
|
||||||
|
@ApiModelProperty("经营者名称")
|
||||||
|
private String operatorName;
|
||||||
|
@ApiModelProperty("法人")
|
||||||
|
private String legalRepresentative;
|
||||||
|
@ApiModelProperty("经营场所")
|
||||||
|
private String businessAddress;
|
||||||
|
@ApiModelProperty("主体业态")
|
||||||
|
private String mainBusiness;
|
||||||
|
@ApiModelProperty("经营项目")
|
||||||
|
private String businessScope;
|
||||||
|
@ApiModelProperty("许可证编号")
|
||||||
|
private String licenceNumber;
|
||||||
|
}
|
||||||
@@ -50,6 +50,15 @@ public class PreparationScheduleVO {
|
|||||||
@ApiModelProperty("所属站区")
|
@ApiModelProperty("所属站区")
|
||||||
private String regionNodeName;
|
private String regionNodeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("招商经理名称")
|
||||||
|
private String investmentManagerName;
|
||||||
|
|
||||||
|
private Long lineId;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty("督导")
|
||||||
|
private String supervisionName;
|
||||||
|
|
||||||
public void setDays() {
|
public void setDays() {
|
||||||
if (this.planOpenTime==null|| this.ContractCompletionTime==null){
|
if (this.planOpenTime==null|| this.ContractCompletionTime==null){
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -72,6 +72,11 @@
|
|||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>ocr20191230</artifactId>
|
<artifactId>ocr20191230</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>ocr_api20210707</artifactId>
|
||||||
|
<version>2.0.7</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.aspectj</groupId>
|
<groupId>org.aspectj</groupId>
|
||||||
<artifactId>aspectjrt</artifactId>
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.cool.store.enums.SmsCodeTypeEnum;
|
|||||||
import com.cool.store.exception.ApiException;
|
import com.cool.store.exception.ApiException;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||||
|
import com.cool.store.vo.FoodLicenseVO;
|
||||||
import com.cool.store.vo.IdentityCardInfoVO;
|
import com.cool.store.vo.IdentityCardInfoVO;
|
||||||
|
|
||||||
public interface AliyunService {
|
public interface AliyunService {
|
||||||
@@ -18,7 +19,7 @@ public interface AliyunService {
|
|||||||
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
|
IdentityCardInfoVO getIdentityCardInfo(String faceImageUrl, IDCardSideEnum sideEnum) throws ApiException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ORC识别证照
|
* ORC识别营业执照
|
||||||
* @param imageUrl
|
* @param imageUrl
|
||||||
* @return
|
* @return
|
||||||
* @throws ApiException
|
* @throws ApiException
|
||||||
@@ -33,5 +34,10 @@ public interface AliyunService {
|
|||||||
*/
|
*/
|
||||||
ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType);
|
ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ORC食营证照解析
|
||||||
|
* @param imageUrl
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FoodLicenseVO getFoodLicense(String imageUrl) throws ApiException ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.aliyun.ocr20191230.models.*;
|
import com.aliyun.ocr20191230.models.*;
|
||||||
|
import com.aliyun.ocr_api20210707.Client;
|
||||||
|
import com.aliyun.ocr_api20210707.models.RecognizeAdvancedRequest;
|
||||||
|
import com.aliyun.ocr_api20210707.models.RecognizeFoodManageLicenseRequest;
|
||||||
|
import com.aliyun.ocr_api20210707.models.RecognizeFoodManageLicenseResponse;
|
||||||
import com.aliyuncs.CommonRequest;
|
import com.aliyuncs.CommonRequest;
|
||||||
import com.aliyuncs.http.MethodType;
|
import com.aliyuncs.http.MethodType;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
@@ -13,6 +18,7 @@ import com.cool.store.response.ResponseResult;
|
|||||||
import com.cool.store.service.AliyunService;
|
import com.cool.store.service.AliyunService;
|
||||||
import com.cool.store.utils.poi.StringUtils;
|
import com.cool.store.utils.poi.StringUtils;
|
||||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||||
|
import com.cool.store.vo.FoodLicenseVO;
|
||||||
import com.cool.store.vo.IdentityCardInfoVO;
|
import com.cool.store.vo.IdentityCardInfoVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -115,17 +121,18 @@ public class AliyunServiceImpl implements AliyunService {
|
|||||||
RecognizeBusinessLicenseAdvanceRequest recognizeBusinessLicenseRequest = new RecognizeBusinessLicenseAdvanceRequest()
|
RecognizeBusinessLicenseAdvanceRequest recognizeBusinessLicenseRequest = new RecognizeBusinessLicenseAdvanceRequest()
|
||||||
.setImageURLObject(inputStream);
|
.setImageURLObject(inputStream);
|
||||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||||
// RecognizeBusinessLicenseResponse recognizeBusinessLicenseResponse = client.recognizeBusinessLicenseWithOptions(RecognizeBusinessLicenseAdvanceRequest, runtime);
|
|
||||||
RecognizeBusinessLicenseResponse recognizeBusinessLicenseResponse = client.recognizeBusinessLicenseAdvance(recognizeBusinessLicenseRequest, runtime);
|
RecognizeBusinessLicenseResponse recognizeBusinessLicenseResponse = client.recognizeBusinessLicenseAdvance(recognizeBusinessLicenseRequest, runtime);
|
||||||
log.info("营业执照解析结果:{}", JSONObject.toJSONString(recognizeBusinessLicenseResponse));
|
log.info("营业执照解析结果:{}", JSONObject.toJSONString(recognizeBusinessLicenseResponse));
|
||||||
RecognizeBusinessLicenseResponseBody.RecognizeBusinessLicenseResponseBodyData result = Optional.ofNullable(recognizeBusinessLicenseResponse).map(o -> o.getBody()).map(o -> o.data).orElse(null);
|
RecognizeBusinessLicenseResponseBody.RecognizeBusinessLicenseResponseBodyData result = Optional.ofNullable(recognizeBusinessLicenseResponse).map(o -> o.getBody()).map(o -> o.data).orElse(null);
|
||||||
if (Objects.nonNull(result)){
|
if (Objects.nonNull(result)){
|
||||||
String address = result.address;
|
String address = result.address;//住所(经营场所)
|
||||||
String registerNumber = result.registerNumber;
|
String registerNumber = result.registerNumber;
|
||||||
String legalPerson = result.legalPerson;//法人
|
String legalPerson = result.legalPerson;//法人
|
||||||
String validPeriod = result.validPeriod;//有效期
|
String validPeriod = result.validPeriod;//有效期
|
||||||
String establishDate = result.establishDate;
|
String establishDate = result.establishDate;
|
||||||
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address);
|
String name = result.name;//营业执照名称
|
||||||
|
String type = result.type;//类型
|
||||||
|
BusinessLicenseInfoVO response = new BusinessLicenseInfoVO(registerNumber,address,legalPerson,validPeriod,establishDate,name,type);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -144,6 +151,56 @@ public class AliyunServiceImpl implements AliyunService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FoodLicenseVO getFoodLicense(String imageUrl) throws ApiException {
|
||||||
|
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||||
|
.setAccessKeyId(accessKeyId)
|
||||||
|
.setAccessKeySecret(accessKeySecret);
|
||||||
|
config.endpoint = "ocr-api.cn-hangzhou.aliyuncs.com";
|
||||||
|
try {
|
||||||
|
com.aliyun.ocr_api20210707.Client client = new com.aliyun.ocr_api20210707.Client(config);
|
||||||
|
//非上海区域OSS必须使用流转换后使用
|
||||||
|
URL url = new URL(imageUrl);
|
||||||
|
InputStream inputStream = url.openConnection().getInputStream();
|
||||||
|
com.aliyun.ocr_api20210707.models.RecognizeFoodManageLicenseRequest recognizeFoodManageLicenseRequest = new com.aliyun.ocr_api20210707.models.RecognizeFoodManageLicenseRequest();
|
||||||
|
// recognizeFoodManageLicenseRequest.setBody(inputStream);
|
||||||
|
recognizeFoodManageLicenseRequest.setUrl(imageUrl);
|
||||||
|
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||||
|
RecognizeFoodManageLicenseResponse recognizeFoodManageLicenseResponse = client.recognizeFoodManageLicenseWithOptions(recognizeFoodManageLicenseRequest,runtime);
|
||||||
|
log.info("食营解析结果:{}", JSONObject.toJSONString(recognizeFoodManageLicenseResponse));
|
||||||
|
String result = Optional.ofNullable(recognizeFoodManageLicenseResponse).map(o -> o.getBody()).map(o -> o.data).orElse(null);
|
||||||
|
if (StringUtils.isNotBlank(result)){
|
||||||
|
JSONObject data = JSONObject.parseObject(JSON.parseObject(result).get("data").toString());
|
||||||
|
String operatorName = data.getString("operatorName");//经营者名称
|
||||||
|
String legalRepresentative = data.getString("legalRepresentative");//法人
|
||||||
|
String businessAddress = data.getString("businessAddress");//经营场所
|
||||||
|
String mainBusiness = data.getString("mainBusiness");//主体业态
|
||||||
|
String businessScope = data.getString("businessScope");//经营项目
|
||||||
|
String licenceNumber = data.getString("licenceNumber");//许可证编号
|
||||||
|
FoodLicenseVO foodLicenseVO = new FoodLicenseVO();
|
||||||
|
foodLicenseVO.setBusinessAddress(businessAddress);
|
||||||
|
foodLicenseVO.setBusinessScope(businessScope);
|
||||||
|
foodLicenseVO.setLegalRepresentative(legalRepresentative);
|
||||||
|
foodLicenseVO.setMainBusiness(mainBusiness);
|
||||||
|
foodLicenseVO.setLicenceNumber(licenceNumber);
|
||||||
|
foodLicenseVO.setOperatorName(operatorName);
|
||||||
|
return foodLicenseVO;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (com.aliyun.tea.TeaException e) {
|
||||||
|
log.error("食营解析报错TeaException:{}", e);
|
||||||
|
throw new ApiException(e.getMessage());
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
log.error("食营解析报错MalformedURLException:{}", e);
|
||||||
|
throw new ApiException(e.getMessage());
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("食营解析报错IOException:{}", e);
|
||||||
|
throw new ApiException(e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("食营解析报错Exception:{}", e);
|
||||||
|
throw new ApiException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType) {
|
public ResponseResult sendMessage(String mobile, SmsCodeTypeEnum codeType) {
|
||||||
|
|||||||
@@ -79,8 +79,10 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
Map<Long, ShopStageInfoDO> shopStageInfoDOMap = shopContractActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
Map<Long, ShopStageInfoDO> shopStageInfoDOMap = shopContractActualCompletionTime.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopId, x -> x));
|
||||||
List<Long> regionIds = preparationDTOS.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
List<Long> regionIds = preparationDTOS.stream().map(PreparationDTO::getRegionId).collect(Collectors.toList());
|
||||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||||
List<String> userIds = preparationDTOS.stream().map(PreparationDTO::getShopManagerUserId).collect(Collectors.toList());
|
Set<String> userIds = preparationDTOS.stream().filter(x->StringUtils.isNotEmpty(x.getShopManagerUserId())).map(PreparationDTO::getShopManagerUserId).collect(Collectors.toSet());
|
||||||
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(userIds);
|
userIds.addAll(preparationDTOS.stream().filter(x->StringUtils.isNotEmpty(x.getInvestmentManager())).map(PreparationDTO::getInvestmentManager).collect(Collectors.toSet()));
|
||||||
|
userIds.addAll(preparationDTOS.stream().filter(x->StringUtils.isNotEmpty(x.getSupervisorUserId())).map(PreparationDTO::getSupervisorUserId).collect(Collectors.toSet()));
|
||||||
|
Map<String, EnterpriseUserDO> userInfoMap = enterpriseUserDAO.getUserInfoMap(new ArrayList<>(userIds));
|
||||||
|
|
||||||
List<PreparationScheduleVO> preparationScheduleVOS = new ArrayList<>();
|
List<PreparationScheduleVO> preparationScheduleVOS = new ArrayList<>();
|
||||||
preparationDTOS.forEach(x->{
|
preparationDTOS.forEach(x->{
|
||||||
@@ -88,10 +90,13 @@ public class PreparationServiceImpl implements PreparationService {
|
|||||||
preparationScheduleVO.setMobile(x.getMobile());
|
preparationScheduleVO.setMobile(x.getMobile());
|
||||||
preparationScheduleVO.setUsername(x.getUsername());
|
preparationScheduleVO.setUsername(x.getUsername());
|
||||||
preparationScheduleVO.setShopId(x.getId());
|
preparationScheduleVO.setShopId(x.getId());
|
||||||
|
preparationScheduleVO.setLineId(x.getLineId());
|
||||||
preparationScheduleVO.setShopName(x.getShopName());
|
preparationScheduleVO.setShopName(x.getShopName());
|
||||||
preparationScheduleVO.setPlanOpenTime(x.getPlanOpenTime());
|
preparationScheduleVO.setPlanOpenTime(x.getPlanOpenTime());
|
||||||
preparationScheduleVO.setStoreNum(x.getStoreNum());
|
preparationScheduleVO.setStoreNum(x.getStoreNum());
|
||||||
preparationScheduleVO.setShopManagerUserName(userInfoMap.getOrDefault(x.getShopManagerUserId(), new EnterpriseUserDO()).getName());
|
preparationScheduleVO.setShopManagerUserName(userInfoMap.getOrDefault(x.getShopManagerUserId(), new EnterpriseUserDO()).getName());
|
||||||
|
preparationScheduleVO.setSupervisionName(userInfoMap.getOrDefault(x.getSupervisorUserId(), new EnterpriseUserDO()).getName());
|
||||||
|
preparationScheduleVO.setInvestmentManagerName(userInfoMap.getOrDefault(x.getInvestmentManager(), new EnterpriseUserDO()).getName());
|
||||||
preparationScheduleVO.setRegionNodeName(regionNameMap.getOrDefault(x.getRegionId(), ""));
|
preparationScheduleVO.setRegionNodeName(regionNameMap.getOrDefault(x.getRegionId(), ""));
|
||||||
ScheduleDTO dto = scheduleDTOMap.getOrDefault(x.getId(), new ScheduleDTO());
|
ScheduleDTO dto = scheduleDTOMap.getOrDefault(x.getId(), new ScheduleDTO());
|
||||||
preparationScheduleVO.setCompletionColumn(dto.getCompletionColumn());
|
preparationScheduleVO.setCompletionColumn(dto.getCompletionColumn());
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.cool.store.exception.ServiceException;
|
|||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.AliyunService;
|
import com.cool.store.service.AliyunService;
|
||||||
import com.cool.store.vo.BusinessLicenseInfoVO;
|
import com.cool.store.vo.BusinessLicenseInfoVO;
|
||||||
|
import com.cool.store.vo.FoodLicenseVO;
|
||||||
import com.cool.store.vo.IdentityCardInfoVO;
|
import com.cool.store.vo.IdentityCardInfoVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -52,4 +53,15 @@ public class OcrController {
|
|||||||
throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_PARSE_FAIL);
|
throw new ServiceException(ErrorCodeEnum.BUSINESS_LICENSE_PARSE_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/getFoodBusinessLicense")
|
||||||
|
@ApiOperation("根据食营证照解析获取数据")
|
||||||
|
public ResponseResult<FoodLicenseVO> getFoodLicense(@RequestParam(value = "imageUrl")String imageUrl){
|
||||||
|
try {
|
||||||
|
FoodLicenseVO businessLicenseInfo = aliyunService.getFoodLicense(imageUrl);
|
||||||
|
return ResponseResult.success(businessLicenseInfo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException(ErrorCodeEnum.FOOD_BUSINESS_LICENSE_PARSE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user