api
This commit is contained in:
@@ -169,6 +169,10 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
FOOD_BUSINESS_LICENSE_PARSE_FAIL(109007, "食营证照解析失败", null),
|
FOOD_BUSINESS_LICENSE_PARSE_FAIL(109007, "食营证照解析失败", null),
|
||||||
|
|
||||||
|
|
||||||
|
STORE_NUM_NOT_FOUND(109008, "未找到门店编码", 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),
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.cool.store.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照类型 0.个体工商户 1.有限责任公司 2.独资企业 3.自然人经营
|
||||||
|
*/
|
||||||
|
public enum LicenseTypeEnum {
|
||||||
|
ZERO(0, "个体工商户"),
|
||||||
|
ONE(1,"有限责任公司"),
|
||||||
|
TWO(2,"独资企业"),
|
||||||
|
THREE(3,"自然人经营");
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
LicenseTypeEnum(Integer code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LicenseTypeEnum match(Integer code) {
|
||||||
|
for (LicenseTypeEnum type : LicenseTypeEnum.values()) {
|
||||||
|
if (type.getCode().equals(code)) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.cool.store.mapper;
|
|||||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||||
import com.cool.store.dto.point.LineCountDTO;
|
import com.cool.store.dto.point.LineCountDTO;
|
||||||
|
import com.cool.store.entity.PointInfoDO;
|
||||||
import com.cool.store.entity.ShopInfoDO;
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.cool.store.request.PlanListRequest;
|
import com.cool.store.request.PlanListRequest;
|
||||||
import com.cool.store.request.PreparationRequest;
|
import com.cool.store.request.PreparationRequest;
|
||||||
@@ -86,4 +87,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
|||||||
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
|
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
|
||||||
|
|
||||||
Long getRegionIdByid(@Param("shopId") Long shopId);
|
Long getRegionIdByid(@Param("shopId") Long shopId);
|
||||||
}
|
|
||||||
|
ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);}
|
||||||
@@ -155,6 +155,11 @@
|
|||||||
join region_${enterpriseId} r on r.id = xsi.region_id
|
join region_${enterpriseId} r on r.id = xsi.region_id
|
||||||
where xsi.id = #{shopId}
|
where xsi.id = #{shopId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByStoreNum" resultType="com.cool.store.entity.ShopInfoDO">
|
||||||
|
select <include refid="allColumn"/>
|
||||||
|
from xfsg_shop_info
|
||||||
|
where store_num = #{storeNum}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.cool.store.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class LicenseBizContentRequest {
|
||||||
|
private String storeNum;
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.cool.store.response;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@ApiModel("证照信息回调响应体")
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class LicenseApiResponse {
|
||||||
|
/**
|
||||||
|
* 营业执照经营场所/住所
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照经营场所/住所")
|
||||||
|
private String storeBusinessAdd;
|
||||||
|
/**
|
||||||
|
* 营业执照发证日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照发证日期")
|
||||||
|
private String storeBusinessDate;
|
||||||
|
/**
|
||||||
|
* 营业执照图片
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照图片")
|
||||||
|
private String storeBusinessImg;
|
||||||
|
/**
|
||||||
|
* 营业执照名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照名称")
|
||||||
|
private String storeBusinessName;
|
||||||
|
/**
|
||||||
|
* 营业执照统一社会信用代码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照统一社会信用代码")
|
||||||
|
private String storeBusinessNumber;
|
||||||
|
/**
|
||||||
|
* 营业执照类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照类型")
|
||||||
|
private String storeBusinessType;
|
||||||
|
/**
|
||||||
|
* 营业执照有效期, 非OCR识别,手填。9=长期有效,非长期有效则为具体日期,例:2026-06-01
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照有效期, 非OCR识别,手填。9=长期有效,非长期有效则为具体日期,例:2026-06-01")
|
||||||
|
private String storeBusinessValidPeriod;
|
||||||
|
/**
|
||||||
|
* 门店代码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("门店代码")
|
||||||
|
private String storeCode;
|
||||||
|
/**
|
||||||
|
* 营业执照经营者/法人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("营业执照经营者/法人")
|
||||||
|
private String storeDirector;
|
||||||
|
/**
|
||||||
|
* 食品流通经营许可证编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品流通经营许可证编号")
|
||||||
|
private String storeFoodLicense;
|
||||||
|
/**
|
||||||
|
* 食品流通/经营许可证有效期开始日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品流通/经营许可证有效期开始日期")
|
||||||
|
private String storeFoodLicenseBeginDate;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营场所
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证经营场所")
|
||||||
|
private String storeFoodLicenseBusinessAddress;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营项目
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证经营项目")
|
||||||
|
private String storeFoodLicenseBusinessScope;
|
||||||
|
/**
|
||||||
|
* 食品流通/经营许可证有效期结束日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品流通/经营许可证有效期结束日期")
|
||||||
|
private String storeFoodLicenseEndDate;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证照片
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证照片")
|
||||||
|
private String storeFoodLicenseImg;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证法定代表人(负责人)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证法定代表人(负责人)")
|
||||||
|
private String storeFoodLicenseLegalRepresentative;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证主体业态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证主体业态")
|
||||||
|
private String storeFoodLicenseMainBusiness;
|
||||||
|
/**
|
||||||
|
* 食品经营许可证经营者名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("食品经营许可证经营者名称")
|
||||||
|
private String storeFoodLicenseOperatorName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String storeRemark;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@ package com.cool.store.service;
|
|||||||
|
|
||||||
import com.cool.store.request.AuditResultRequest;
|
import com.cool.store.request.AuditResultRequest;
|
||||||
import com.cool.store.request.SysBuildResultRequest;
|
import com.cool.store.request.SysBuildResultRequest;
|
||||||
|
import com.cool.store.response.LicenseApiResponse;
|
||||||
|
|
||||||
public interface KdzApiService {
|
public interface KdzApiService {
|
||||||
/**
|
/**
|
||||||
@@ -11,4 +12,6 @@ public interface KdzApiService {
|
|||||||
*/
|
*/
|
||||||
boolean auditResult(AuditResultRequest request);
|
boolean auditResult(AuditResultRequest request);
|
||||||
|
|
||||||
|
LicenseApiResponse license(String storeNum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,23 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import com.cool.store.entity.LicenseTransactDO;
|
||||||
|
import com.cool.store.entity.ShopInfoDO;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
|
import com.cool.store.enums.LicenseTypeEnum;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
|
import com.cool.store.mapper.ApplyLicenseMapper;
|
||||||
|
import com.cool.store.mapper.PointInfoMapper;
|
||||||
|
import com.cool.store.mapper.ShopInfoMapper;
|
||||||
import com.cool.store.request.AuditResultRequest;
|
import com.cool.store.request.AuditResultRequest;
|
||||||
|
import com.cool.store.response.LicenseApiResponse;
|
||||||
import com.cool.store.service.KdzApiService;
|
import com.cool.store.service.KdzApiService;
|
||||||
import com.cool.store.utils.StringUtil;
|
import com.cool.store.utils.StringUtil;
|
||||||
|
import com.cool.store.utils.poi.DateUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import springfox.documentation.swagger2.mappers.LicenseMapper;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -18,6 +29,12 @@ public class KdzApiServiceImpl implements KdzApiService {
|
|||||||
@Resource
|
@Resource
|
||||||
private CommonService commonService;
|
private CommonService commonService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ShopInfoMapper shopInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ApplyLicenseMapper applyLicenseMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean auditResult(AuditResultRequest request) {
|
public boolean auditResult(AuditResultRequest request) {
|
||||||
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())) {
|
if (Objects.isNull(request) || StringUtil.isBlank(request.getKdzBusinessId())) {
|
||||||
@@ -27,4 +44,44 @@ public class KdzApiServiceImpl implements KdzApiService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LicenseApiResponse license(String storeNum) {
|
||||||
|
ShopInfoDO shopInfoDO = shopInfoMapper.selectByStoreNum(storeNum);
|
||||||
|
if (Objects.isNull(shopInfoDO)){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.STORE_NUM_NOT_FOUND);
|
||||||
|
}
|
||||||
|
Long shopId = shopInfoDO.getId();
|
||||||
|
LicenseTransactDO licenseTransactDO = new LicenseTransactDO();
|
||||||
|
licenseTransactDO.setShopId(shopId);
|
||||||
|
licenseTransactDO = applyLicenseMapper.selectOneByExample(licenseTransactDO);
|
||||||
|
LicenseApiResponse convertResp = convert(licenseTransactDO,storeNum);
|
||||||
|
return convertResp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LicenseApiResponse convert(LicenseTransactDO licenseTransactDO,
|
||||||
|
String storeNum){
|
||||||
|
LicenseApiResponse response = LicenseApiResponse.builder()
|
||||||
|
.storeBusinessAdd(licenseTransactDO.getLicenseAddress())
|
||||||
|
.storeBusinessDate(DateUtils.dateTime(licenseTransactDO.getIssueTime()))
|
||||||
|
.storeBusinessImg(licenseTransactDO.getCreditUrl())
|
||||||
|
.storeBusinessName(licenseTransactDO.getBusinessLicense())
|
||||||
|
.storeBusinessNumber(licenseTransactDO.getCreditCode())
|
||||||
|
.storeBusinessType(LicenseTypeEnum.match(licenseTransactDO.getLicenseType()).getMessage())
|
||||||
|
.storeBusinessValidPeriod(Objects.isNull(licenseTransactDO.getValidity()) ? "9" : DateUtils.dateTime(licenseTransactDO.getValidity()))
|
||||||
|
.storeCode(storeNum)
|
||||||
|
.storeDirector(licenseTransactDO.getLicenseLegalPerson())
|
||||||
|
.storeFoodLicense(licenseTransactDO.getFoodBusinessLicenseCode())
|
||||||
|
.storeFoodLicenseBeginDate(DateUtils.dateTime(licenseTransactDO.getFoodBusinessStartTime()))
|
||||||
|
.storeFoodLicenseEndDate(DateUtils.dateTime(licenseTransactDO.getFoodBusinessEndTime()))
|
||||||
|
.storeFoodLicenseBusinessAddress(licenseTransactDO.getFoodLicenseAddress())
|
||||||
|
.storeFoodLicenseBusinessScope(licenseTransactDO.getBusinessProject())
|
||||||
|
.storeFoodLicenseImg(licenseTransactDO.getFoodBusinessLicenseUrl())
|
||||||
|
.storeFoodLicenseLegalRepresentative(licenseTransactDO.getFoodLicenseLegalPerson())
|
||||||
|
.storeFoodLicenseMainBusiness(licenseTransactDO.getMainBusiness())
|
||||||
|
.storeFoodLicenseOperatorName(licenseTransactDO.getOperator())
|
||||||
|
.storeRemark("")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ public class SignValidateFilter implements Filter {
|
|||||||
"/**/swagger*/**",
|
"/**/swagger*/**",
|
||||||
"/**/webjars/**",
|
"/**/webjars/**",
|
||||||
"/xfsg/mini/program/v1/partnerManage/openArea/areaApplyQuery",
|
"/xfsg/mini/program/v1/partnerManage/openArea/areaApplyQuery",
|
||||||
"/xfsg/*/api/audit/result",
|
"/xfsg/**/api/audit/result",
|
||||||
|
"/xfsg/**/api/license",
|
||||||
"/xfsg/mini/line/getRegionPayPic"
|
"/xfsg/mini/line/getRegionPayPic"
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package com.cool.store.controller.webb;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cool.store.enums.ErrorCodeEnum;
|
import com.cool.store.enums.ErrorCodeEnum;
|
||||||
import com.cool.store.request.AuditResultRequest;
|
import com.cool.store.request.AuditResultRequest;
|
||||||
|
import com.cool.store.request.LicenseBizContentRequest;
|
||||||
import com.cool.store.request.SysBuildResultRequest;
|
import com.cool.store.request.SysBuildResultRequest;
|
||||||
import com.cool.store.request.XfsgOpenApiRequest;
|
import com.cool.store.request.XfsgOpenApiRequest;
|
||||||
|
import com.cool.store.response.LicenseApiResponse;
|
||||||
import com.cool.store.response.ResponseResult;
|
import com.cool.store.response.ResponseResult;
|
||||||
import com.cool.store.service.KdzApiService;
|
import com.cool.store.service.KdzApiService;
|
||||||
import com.cool.store.utils.EncryptUtil;
|
import com.cool.store.utils.EncryptUtil;
|
||||||
@@ -42,6 +44,22 @@ public class KdzApiController {
|
|||||||
return ResponseResult.success(kdzApiService.auditResult(auditResultRequest));
|
return ResponseResult.success(kdzApiService.auditResult(auditResultRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("证照信息回调")
|
||||||
|
@PostMapping("/license")
|
||||||
|
public ResponseResult<LicenseApiResponse> license(@PathVariable(value = "enterprise-id") String eid,
|
||||||
|
@RequestBody XfsgOpenApiRequest request) {
|
||||||
|
log.info("auditResult requestBody :{}", JSONObject.toJSONString(request));
|
||||||
|
if(!verifyMD5(request,eid)){
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.VERIFY_MD5_FALSE);
|
||||||
|
}
|
||||||
|
if(eid == null || request.getBizContent() == null){
|
||||||
|
return ResponseResult.fail(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
|
||||||
|
}
|
||||||
|
LicenseBizContentRequest storeNum = JSONObject.parseObject(request.getBizContent(), LicenseBizContentRequest.class);
|
||||||
|
return ResponseResult.success(kdzApiService.license(storeNum.getStoreNum()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean verifyMD5(XfsgOpenApiRequest request, String eid){
|
public static boolean verifyMD5(XfsgOpenApiRequest request, String eid){
|
||||||
|
|||||||
Reference in New Issue
Block a user