|
|
@@ -125,8 +125,10 @@ public class TtMerchantPoiController extends BaseController { |
|
|
|
|
|
|
|
TtOpenMaService openMaService = openService.getTtOpenComponentService().getTtMaServiceByAppid(appId); |
|
|
|
String res = openMaService.mediaUpload(materialType, fileFormat, multiReq.getInputStream()); |
|
|
|
return new ResultData(res); |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(res)){ |
|
|
|
return new ResultData(res); |
|
|
|
} |
|
|
|
return new ResultData(ErrorCode.SYS_SERVER_ERROR); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("解析图片",e); |
|
|
|
return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); |
|
|
@@ -206,6 +208,70 @@ public class TtMerchantPoiController extends BaseController { |
|
|
|
return new ResultData(b); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param |
|
|
|
* @return |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
@PostMapping(value = "/add_shop_material_v1") |
|
|
|
@ApiOperation("提交商铺资质材料") |
|
|
|
public ResultData addShopMaterialV1(@RequestBody Map<String, String> param) { |
|
|
|
logger.info("[" + getIpAddr() + "] TtMerchantPoiController::add_shop_material"); |
|
|
|
String appId = param.get("appId"); |
|
|
|
if(StringUtils.isBlank(appId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"appId为空"); |
|
|
|
} |
|
|
|
WxAppinfo appinfo = appinfoService.getByAppId(appId); |
|
|
|
if(appinfo == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"找不到小程序信息"); |
|
|
|
} |
|
|
|
|
|
|
|
String supplierExtId = param.get("supplierExtId"); |
|
|
|
if(StringUtils.isBlank(supplierExtId)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商户ID为空"); |
|
|
|
} |
|
|
|
|
|
|
|
TtMerchantPoi merchantPoi = ttMerchantPoiService.getById(Long.parseLong(supplierExtId)); |
|
|
|
if(merchantPoi == null){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"查询不到商户"); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isBlank(merchantPoi.getBizLicencePath())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"商铺营业执照为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isBlank(merchantPoi.getContractPath())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"授权函为空"); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isBlank(merchantPoi.getExpireTime())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"过期时间为空"); |
|
|
|
} |
|
|
|
String regex = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29) "; |
|
|
|
if(!merchantPoi.getExpireTime().matches(regex)){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"过期时间格式 YYYY-MM-DD"); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(merchantPoi.getQualMaterial())){ |
|
|
|
try{ |
|
|
|
JSON.parse(merchantPoi.getQualMaterial()); |
|
|
|
}catch(Exception e){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"商铺行业资质材料信息格式不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(merchantPoi.getAdditionalQual())){ |
|
|
|
try{ |
|
|
|
JSON.parse(merchantPoi.getAdditionalQual()); |
|
|
|
}catch(Exception e){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"其他补充资质信息格式不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
boolean b = ttMerchantPoiService.addShopMaterial(appinfo,merchantPoi); |
|
|
|
|
|
|
|
return new ResultData(b); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询商铺资质材料状态") |
|
|
|
@GetMapping("/query_shop_meaterial") |
|
|
|