Merge remote-tracking branch 'origin/test' into test
| | |
| | | String originName = file.getOriginalFilename(); |
| | | AtomicBoolean isVideo = new AtomicBoolean(false); |
| | | videoExtensionAllow.forEach(ext ->{ |
| | | if(ext.equalsIgnoreCase(originName)){ |
| | | String originNameLowerCase = originName.toLowerCase(); |
| | | if(originNameLowerCase.endsWith("." +ext)){ |
| | | isVideo.set(true); |
| | | } |
| | | }); |
| | |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | EasyExcel.read(inputStream, ComCvtServeExcelVO.class, new ComCvtServeExcelListen(communityService,null)).sheet().doRead(); |
| | | EasyExcel.read(inputStream, ComCvtServeExcelVO.class, new ComCvtServeExcelListen(communityService,null)) |
| | | .sheet().doRead(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ApiOperation(value = "编辑商家、启用、禁用") |
| | | @PostMapping("/store/edit/{id}") |
| | | @ApiImplicitParam(name = "id", value = "商家id") |
| | | public R editStore(@Validated(AddGroup.class) @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { |
| | | public R editStore(@Validated @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { |
| | | //判断参数 |
| | | if(storeVO == null || id == null){ |
| | | return R.fail("参数错误"); |
| | |
| | | public static final int CONFLICT = 409; |
| | | |
| | | /** |
| | | * 请求主体的大小超过了服务器 |
| | | */ |
| | | public static final int REQUEST_TOO_LARGE = 413; |
| | | |
| | | /** |
| | | * 不支持的数据,媒体类型 |
| | | */ |
| | | public static final int UNSUPPORTED_TYPE = 415; |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Base64; |
| | |
| | | log.info("请求公安实名认证接口,请求地址:" + URL); |
| | | log.info("请求公安实名认证接口,请求参数:" + param); |
| | | log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, headervalue + encodeToString); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 2, headerkey, headervalue + encodeToString); |
| | | log.info("请求公安实名认证接口,返回参数:" + postByJson); |
| | | int code = JSONObject.parseObject(postByJson).getIntValue("code"); |
| | | if (0==code) { |
| | | result =true; |
| | | if(postByJson!=null && StringUtils.isNotEmpty(postByJson)) { |
| | | JSONObject obj = JSONObject.parseObject(postByJson); |
| | | if(obj!=null) { |
| | | int code = JSONObject.parseObject(postByJson).getIntValue("code"); |
| | | if (0 == code) { |
| | | result = true; |
| | | } |
| | | } |
| | | }else{ |
| | | throw new ServiceException("公安实名认证接口超时,请重试"); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | "AND community_id=#{comMngStructAreaVO.communityId} \n" + |
| | | " </if> " + |
| | | "<if test='comMngStructAreaVO.areaName != null and comMngStructAreaVO.areaName.trim() != ""'>" + |
| | | "AND area_name = concat( '%',#{comMngStructAreaVO.areaName}, '%' )" + |
| | | "AND area_name like concat( '%',#{comMngStructAreaVO.areaName}, '%' )" + |
| | | " </if> " + |
| | | "</script>") |
| | | IPage<ComMngStructAreaVO> pageArea(Page page, @Param("comMngStructAreaVO") ComMngStructAreaVO comMngStructAreaVO); |
| | |
| | | String idCard = loginUserInfoVO.getIdCard(); |
| | | String name = loginUserInfoVO.getName(); |
| | | log.info("用户实名认证发送请求,姓名:" + name + "身份证号码:" + idCard); |
| | | boolean b = RealNameUtil.authentication(idCard, name); |
| | | if (!b) { |
| | | return R.fail("身份认证失败:请填写真实信息"); |
| | | try { |
| | | boolean b = RealNameUtil.authentication(idCard, name); |
| | | if (!b) { |
| | | return R.fail("身份认证失败:请填写真实信息"); |
| | | } |
| | | }catch (ServiceException serviceException){ |
| | | return R.fail(serviceException.getMessage()); |
| | | } |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setName(name); |
New file |
| | |
| | | package com.panzhihua.zuul.handles; |
| | | |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; |
| | | import org.springframework.web.bind.annotation.ControllerAdvice; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.multipart.MaxUploadSizeExceededException; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | @ControllerAdvice |
| | | public class FileUploadExceptionAdvice { |
| | | |
| | | @ExceptionHandler(MaxUploadSizeExceededException.class) |
| | | public void handleMaxSizeException( |
| | | MaxUploadSizeExceededException exc, |
| | | HttpServletRequest request, |
| | | HttpServletResponse response) { |
| | | //请求超过大小限制 |
| | | response.setContentType("application/json;charset=utf-8"); |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.REQUEST_TOO_LARGE, "请求主体的大小超过限制")); |
| | | return; |
| | | |
| | | } |
| | | |
| | | @ExceptionHandler(FileSizeLimitExceededException.class) |
| | | public void handleFileSizeLimitException( |
| | | FileSizeLimitExceededException exc, |
| | | HttpServletRequest request, |
| | | HttpServletResponse response) { |
| | | //请求超过大小限制 |
| | | response.setContentType("application/json;charset=utf-8"); |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.REQUEST_TOO_LARGE, "文件大小超过限制")); |
| | | return; |
| | | } |
| | | |
| | | } |
| | |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | max-file-size: 20MB |
| | | max-request-size: 22MB |
| | | |
| | | eureka: |
| | | client: |