BladeController.java 19.0 KB
Newer Older
S
smallchill 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/**
 * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springblade.core.base.controller;

18
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
S
smallchill 已提交
19 20 21
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springblade.core.annotation.Json;
22
import org.springblade.core.constant.Const;
S
smallchill 已提交
23
import org.springblade.core.constant.ConstShiro;
24 25
import org.springblade.core.exception.NoPermissionException;
import org.springblade.core.exception.NoUserException;
S
smallchill 已提交
26 27 28
import org.springblade.core.meta.IQuery;
import org.springblade.core.toolbox.CMap;
import org.springblade.core.toolbox.Func;
29
import org.springblade.core.toolbox.ajax.AjaxResult;
S
smallchill 已提交
30 31
import org.springblade.core.toolbox.captcha.CaptchaMaker;
import org.springblade.core.toolbox.file.BladeFile;
32
import org.springblade.core.toolbox.file.BladeFileKit;
S
smallchill 已提交
33 34
import org.springblade.core.toolbox.file.FileMaker;
import org.springblade.core.toolbox.grid.GridManager;
35 36 37 38
import org.springblade.core.toolbox.kit.*;
import org.springblade.core.toolbox.log.BladeLogManager;
import org.springblade.core.toolbox.qrcode.QrCodeMaker;
import org.springblade.core.toolbox.support.BeanInjector;
S
smallchill 已提交
39 40 41 42 43 44 45
import org.springblade.core.toolbox.support.Convert;
import org.springblade.core.toolbox.support.WafRequestWrapper;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

46 47 48 49 50 51 52 53
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
S
smallchill 已提交
54 55 56

/**
 * Blade控制器封装类
57
 * @author zhuangqian
S
smallchill 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
 */
public class BladeController {

	protected Logger LOGGER = LogManager.getLogger(this.getClass());
	
	/** ============================     requset    =================================================  */

	@Resource
	private HttpServletRequest request;
	
	/**   
	 * 获取request
	*/
	public HttpServletRequest getRequest() {
		return new WafRequestWrapper(this.request);
	}
	
	/**   
	 * 是否ajax
	*/
	public boolean isAjax() {
		String header = getRequest().getHeader("X-Requested-With");
		boolean isAjax = "XMLHttpRequest".equalsIgnoreCase(header);
		return isAjax;
	}
	
	/**   
	 * 是否post
	*/
	public boolean isPost() {
		String method = getRequest().getMethod();
		return StrKit.equalsIgnoreCase("POST", method);
	}

	/**   
	 * 获取String参数
	*/
	public String getParameter(String name) {
		return getRequest().getParameter(name);
	}

	/**   
	 * 获取String参数
	*/
	public String getParameter(String name, String defaultValue) {
		return Convert.toStr(getRequest().getParameter(name), defaultValue);
	}

	/**   
	 * 获取Integer参数
	*/
	public Integer getParameterToInt(String name) {
		return Convert.toInt(getRequest().getParameter(name));
	}

	/**   
	 * 获取Integer参数
	*/
	public Integer getParameterToInt(String name, Integer defaultValue) {
		return Convert.toInt(getRequest().getParameter(name), defaultValue);
	}

	/**   
	 * 获取Long参数
	*/
	public Long getParameterToLong(String name) {
		return Convert.toLong(getRequest().getParameter(name));
	}

	/**   
	 * 获取Long参数
	*/
	public Long getParameterToLong(String name, Long defaultValue) {
		return Convert.toLong(getRequest().getParameter(name), defaultValue);
	}

	/**   
	 * 获取Float参数
	*/
	public Float getParameterToFloat(String name) {
		return Convert.toFloat(getRequest().getParameter(name));
	}

	/**   
	 * 获取Float参数
	*/
	public Float getParameterToFloat(String name, Float defaultValue) {
		return Convert.toFloat(getRequest().getParameter(name), defaultValue);
	}

	/**   
	 * 获取BigDecimal参数
	*/
	public BigDecimal getParameterToBigDecimal(String name) {
		return Convert.toBigDecimal(getRequest().getParameter(name));
	}

	/**   
	 * 获取BigDecimal参数
	*/
	public BigDecimal getParameterToBigDecimal(String name, BigDecimal defaultValue) {
		return Convert.toBigDecimal(getRequest().getParameter(name), defaultValue);
	}
	
	/**   
	 * 获取Encode参数
	*/
	public String getParameterToEncode(String para) {
		return URLKit.encode(getRequest().getParameter(para), CharsetKit.UTF_8);
	}

	/**   
	 * 获取Decode参数
	*/
	public String getParameterToDecode(String para) {
		return URLKit.decode(getRequest().getParameter(para), CharsetKit.UTF_8);
	}

	/**   
	 * 获取ContextPath
	*/
	public String getContextPath() {
		return getRequest().getContextPath();
	}

	/**   
	 * 页面跳转
185
	 * @param url
S
smallchill 已提交
186 187 188 189 190 191 192 193 194 195 196
	*/
	public String redirect(String url) {
		return StrKit.format("redirect:{}", url);
	}
	
	/**
	 * 对象是否为空
	 * 
	 * @param obj String,List,Map,Object[],int[],long[]
	 * @return
	 */
197 198
	public boolean isEmpty(Object obj) {
		return Func.isEmpty(obj);
S
smallchill 已提交
199 200 201 202 203 204 205 206
	}
	
	/**
	 * 对象是否不为空
	 * 
	 * @param obj String,List,Map,Object[],int[],long[]
	 * @return
	 */
207 208
	public boolean notEmpty(Object obj) {
		return !isEmpty(obj);
S
smallchill 已提交
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
	}
	
	/**
	 * 字符串是否为空白 空白的定义如下: <br>
	 * 1、为null <br>
	 * 2、为不可见字符(如空格)<br>
	 * 3、""<br>
	 * 
	 * @param str 被检测的字符串
	 * @return 是否为空
	 */
	public boolean isBlank(String str) {
		return StrKit.isBlank(str);
	}
	
	/**
	 * 字符串是否为非空白 空白的定义如下: <br>
	 * 1、不为null <br>
	 * 2、不为不可见字符(如空格)<br>
	 * 3、不为""<br>
	 * 
	 * @param str 被检测的字符串
	 * @return 是否为非空
	 */
	public boolean notBlank(String str) {
		return StrKit.notBlank(str);
	}
	
	/**
	 * 格式化文本, {} 表示占位符<br>
	 * 此方法只是简单将占位符 {} 按照顺序替换为参数<br>
	 * 如果想输出 {} 使用 \\转义 { 即可,如果想输出 {} 之前的 \ 使用双转义符 \\\\ 即可<br>
	 * 例:<br>
	 * 		通常使用:format("this is {} for {}", "a", "b") -> this is a for b<br>
	 * 		转义{}: 	format("this is \\{} for {}", "a", "b") -> this is \{} for a<br>
	 * 		转义\:		format("this is \\\\{} for {}", "a", "b") -> this is \a for b<br>
	 * 
	 * @param template 文本模板,被替换的部分用 {} 表示
	 * @param params 参数值
	 * @return 格式化后的文本
	 */
	public String format(String template, Object... params) {
		return StrKit.format(template, params);
	}
	
	/**
	 * 格式化文本,使用 {varName} 占位<br>
	 * map = {a: "aValue", b: "bValue"}
	 * format("{a} and {b}", map)    ---->    aValue and bValue
	 * 
	 * @param template 文本模板,被替换的部分用 {key} 表示
	 * @param map 参数值对
	 * @return 格式化后的文本
	 */
	public String format(String template, Map<?, ?> map) {
		return StrKit.format(template, map);
	}
	
	
	/**
	 * 创建StringBuilder对象
	 */
	public StringBuilder builder() {
		return StrKit.builder();
	}
	
	/**
	 * 创建StringBuilder对象
	 */
	public StringBuilder builder(int capacity) {
		return StrKit.builder(capacity);
	}
	
	/**
	 * 创建StringBuilder对象
	 */
	public StringBuilder build(String... strs) {
		return StrKit.builder(strs);
	}
	
	/**
	 * 克隆对象<br>
	 * 对象必须实现Serializable接口
	 * 
	 * @param obj 被克隆对象
	 * @return 克隆后的对象
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	public <T extends Cloneable> T clone(T obj) {
		return ObjectKit.clone(obj);
	}
	
	/**
	 * 克隆对象<br>
	 * 对象必须实现Serializable接口
	 * 
	 * @param obj 被克隆对象
	 * @return 克隆后的对象
	 * @throws IOException
	 * @throws ClassNotFoundException
	 */
	public <T> T clone(T obj) {
		return ObjectKit.clone(obj);
	}
	
	/** ============================     mapping    =================================================  */
	
	/**
	 * 表单值映射为javabean
	 * 
	 * @param beanClass javabean.class
	 * @return T
	 */
	public <T> T mapping(Class<T> beanClass) {
		return (T) BeanInjector.inject(beanClass, getRequest());
	}

	/**
	 * 表单值映射为javabean
	 * 
	 * @param prefix name前缀
	 * @param beanClass javabean.class
	 * @return T
	 */
	public <T> T mapping(String prefix, Class<T> beanClass) {
		return (T) BeanInjector.inject(beanClass, prefix, getRequest());
	}

	/**
	 * 表单值映射为CMap
	 * 
	 * @return CMap
	 */
	public CMap getCMap() {
		return BeanInjector.injectMaps(getRequest());
	}

	/**
	 * 表单值映射为CMap
	 * 
	 * @param prefix  name前缀
	 * @return CMap
	 */
	public CMap getCMap(String prefix) {
		return BeanInjector.injectMaps(prefix, getRequest());
	}
	
	/**===========================     convert    ===============================================  */
	
	/**   
	 * 强转String
	*/
	public String toStr(Object value) {
		return Convert.toStr(value);
	}

	/**   
	 * 强转String
	*/
	public String toStr(Object value, String defaultValue) {
		return Convert.toStr(value, defaultValue);
	}

	/**   
	 * 强转Integer
	*/
	public Integer toInt(Object value) {
		return Convert.toInt(value);
	}

	/**   
	 * 强转Integer
	*/
	public Integer toInt(Object value, Integer defaultValue) {
		return Convert.toInt(value, defaultValue);
	}

	/**   
	 * 强转Long
	*/
	public Long toLong(Object value) {
		return Convert.toLong(value);
	}

	/**   
	 * 强转Long
	*/
	public Long toLong(Object value, Long defaultValue) {
		return Convert.toLong(value, defaultValue);
	}

	/**   
	 * 强转Float
	*/
	public Float toFloat(Object value) {
		return Convert.toFloat(value);
	}

	/**   
	 * 强转Float
	*/
	public Float toFloat(Object value, Float defaultValue) {
		return Convert.toFloat(value, defaultValue);
	}

	/**   
	 * 强转BigDecimal
	*/
	public BigDecimal toBigDecimal(Object value) {
		return Convert.toBigDecimal(value);
	}

	/**   
	 * 强转BigDecimal
	*/
	public BigDecimal toBigDecimal(Object value, BigDecimal defaultValue) {
		return Convert.toBigDecimal(value, defaultValue);
	}
	
	/**   
	 * 强转String数组
	*/
	public String[] toArray(String str) {
		return Convert.toStrArray(str);
	}
	
	/**   
	 * 强转String数组
	*/
	public String[] toArray(String split, String str) {
		return Convert.toStrArray(split, str);
	}
	
	/**   
	 * 强转Integer数组
	*/
	public Integer[] toIntArray(String str) {
		return Convert.toIntArray(str);
	}
	
	/**   
	 * 强转Integer数组
	*/
	public Integer[] toIntArray(String split, String str) {
		return Convert.toIntArray(split, str);
	}
	
	/**   
	 * encode
	*/
	public String encode(String value) {
		return URLKit.encode(value, CharsetKit.UTF_8);
	}

	/**   
	 * decode
	*/
	public String decode(String value) {
		return URLKit.decode(value, CharsetKit.UTF_8);
	}
	
	/**============================     file    =================================================  */
	
	/**
	 * 获取BladeFile封装类
	 * @param file
	 * @return
	 */
	public BladeFile getFile(MultipartFile file){
		return BladeFileKit.getFile(file);
	}
	
	/**
	 * 获取BladeFile封装类
	 * @param file
	 * @param dir
	 * @return
	 */
	public BladeFile getFile(MultipartFile file, String dir){
		return BladeFileKit.getFile(file, dir);
	}
	
	/**
	 * 获取BladeFile封装类
	 * @param file
	 * @param dir
	 * @param path
	 * @param virtualPath
	 * @return
	 */
	public BladeFile getFile(MultipartFile file, String dir, String path, String virtualPath){
		return BladeFileKit.getFile(file, dir, path, virtualPath);
	}
	
	/**
	 * 获取BladeFile封装类
	 * @param files
	 * @return
	 */
	public List<BladeFile> getFiles(List<MultipartFile> files){
		return BladeFileKit.getFiles(files);
	}
	
	/**
	 * 获取BladeFile封装类
	 * @param files
	 * @param dir
	 * @return
	 */
	public List<BladeFile> getFiles(List<MultipartFile> files, String dir){
		return BladeFileKit.getFiles(files, dir);
	}
	
	/**
	 * 获取BladeFile封装类
	 * @param files
	 * @param path
	 * @param virtualPath
	 * @return
	 */
	public List<BladeFile> getFiles(List<MultipartFile> files, String dir, String path, String virtualPath){
		return BladeFileKit.getFiles(files, dir, path, virtualPath);
	}


	/** ============================     ajax    =================================================  */
	
	/**   
	 * 返回ajaxresult
	 * @param data
	 * @return AjaxResult
	*/
	public AjaxResult json(Object data) {
		return new AjaxResult().success(data);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param data
	 * @param message
	 * @return AjaxResult
	*/
	public AjaxResult json(Object data, String message) {
		return json(data).setMessage(message);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param data
	 * @param message
	 * @param code
	 * @return AjaxResult
	*/
	public AjaxResult json(Object data, String message, int code) {
		return json(data, message).setCode(code);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param message
	 * @return AjaxResult
	*/
	public AjaxResult success(String message) {
		return new AjaxResult().addSuccess(message);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param message
	 * @return AjaxResult
	*/
	public AjaxResult error(String message) {
		return new AjaxResult().addError(message);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param message
	 * @return AjaxResult
	*/
	public AjaxResult warn(String message) {
		return new AjaxResult().addWarn(message);
	}
	
	/**   
	 * 返回ajaxresult
	 * @param message
	 * @return AjaxResult
	*/
	public AjaxResult fail(String message) {
		return new AjaxResult().addFail(message);
	}
	
	
	/** ============================     paginate    =================================================  */
	
	/**   
	 * 分页
	 * @param dbName 数据库别名
	 * @param source 数据源
	 * @param intercept 分页拦截器
	 * @return Object
	*/
	private Object basepage(String dbName, String source, IQuery intercept){
		Integer page = getParameterToInt("page", 1);
		Integer rows = getParameterToInt("rows", 10);
		String where = getParameter("where", StrKit.EMPTY);
		String sidx =  getParameter("sidx", StrKit.EMPTY);
		String sord =  getParameter("sord", StrKit.EMPTY);
		String sort =  getParameter("sort", StrKit.EMPTY);
		String order =  getParameter("order", StrKit.EMPTY);
		if (StrKit.notBlank(sidx)) {
			sort = sidx + " " + sord + (StrKit.notBlank(sort) ? ("," + sort) : StrKit.EMPTY);
		}
		Object grid = GridManager.paginate(dbName, page, rows, source, where, sort, order, intercept, this);
		return grid;
	}
	

	/**   
	 * 分页
	 * @param source 数据源
	 * @return Object
	*/
	public Object paginate(String source){
		return basepage(null, source, null);
	}
	

	/**   
	 * 分页
	 * @param source 数据源
	 * @param intercept 分页拦截器
	 * @return Object
	*/
	public Object paginate(String source, IQuery intercept){
		return basepage(null, source, intercept);
	}
	

	/**   
	 * 分页
	 * @param dbName 数据库别名
	 * @param source 数据源
	 * @return Object
	*/
	public Object paginate(String dbName, String source){
		return basepage(dbName, source, null);
	}
	

	/**   
	 * 分页
	 * @param dbName 数据库别名
	 * @param source 数据源
	 * @param intercept 分页拦截器
	 * @return Object
	*/
	public Object paginate(String dbName, String source, IQuery intercept){
		return basepage(dbName, source, intercept);
	}
	
	/** ============================      maker    ===================================================  */
	
	/**   
	 * 返回验证码
	*/
	public void makeCaptcha(HttpServletResponse response) {
		CaptchaMaker.init(response).start();
	}
	
	/**   
	 * 校验验证码
	*/
	public boolean validateCaptcha(HttpServletResponse response, String value) {
		return CaptchaMaker.validate(getRequest(), response, value);
	}
	
	/**   
	 * 返回二维码
	 * 
	 * @param content 二维码携带内容
	 * @param width 二维码宽度
	 * @param height 二维码高度
	*/
	public void makeQRCode(HttpServletResponse response, String content, int width, int height) {
696
		QrCodeMaker.init(response, content, width, height).start();
S
smallchill 已提交
697 698 699 700 701 702 703 704 705 706 707
	}
	
	/**   
	 * 返回二维码
	 * 
	 * @param content 二维码携带内容
	 * @param width 二维码宽度
	 * @param height 二维码高度
	 * @param errorCorrectionLevel 带有纠错级别参数的构造方法,纠错能力从高到低共有四个级别:'H'、'Q'、'M'、'L'
	*/
	public void makeQRCode(HttpServletResponse response, String content, int width, int height, ErrorCorrectionLevel errorCorrectionLevel) {
708
		QrCodeMaker.init(response, content, width, height, errorCorrectionLevel).start();
S
smallchill 已提交
709 710 711 712 713 714 715 716 717 718 719
	}
	
	/**   
	 * 返回二维码
	 * 
	 * @param content 二维码携带内容
	 * @param width 二维码宽度
	 * @param height 二维码高度
	 * @param errorCorrectionLevel 带有纠错级别参数的构造方法,纠错能力从高到低共有四个级别:'H'、'Q'、'M'、'L'
	*/
	public void makeQRCode(HttpServletResponse response, String content, int width, int height, char errorCorrectionLevel) {
720
		QrCodeMaker.init(response, content, width, height, errorCorrectionLevel).start();
S
smallchill 已提交
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740
	}
	
	/**   
	 * 返回文件
	*/
	public void makeFile(HttpServletResponse response, File file) {
		FileMaker.init(getRequest(), response, file).start();
	}
	
	/** ============================     exception    =================================================  */

	@Json
	@ExceptionHandler(Exception.class)
	public Object exceptionHandler(Exception ex, HttpServletResponse response, HttpServletRequest request) throws IOException {
		AjaxResult result = new AjaxResult();
		String url = Const.ERROR_500;
		String msg = ex.getMessage();
		Object resultModel = null;
		try {
			if (ex.getClass() == HttpRequestMethodNotSupportedException.class) {
741 742 743 744
                /**
                 * 请求方式不允许抛出的异常,后面可自定义页面
                 */
				url = Const.ERROR_500;
S
smallchill 已提交
745
			} else if (ex.getClass() == NoPermissionException.class) {
746 747 748 749
                /**
                 * 无权限抛出的异常
                 */
				url = Const.NOPERMISSION_PATH;
S
smallchill 已提交
750 751
				msg = ConstShiro.NO_PERMISSION;
			} else if (ex.getClass() == NoUserException.class) {
752 753 754 755
                /**
                 * session过期抛出的异常
                 */
				url = Const.LOGIN_REALPATH;
S
smallchill 已提交
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784
				msg = ConstShiro.NO_USER;
			}
			if (isAjax() || isPost()) {
				result.addFail(msg);
				resultModel = result;
			} else {
				ModelAndView view = new ModelAndView(url);
				view.addObject("error", msg);
				view.addObject("class", ex.getClass());
				view.addObject("method", request.getRequestURI());
				resultModel = view;
			}
			try {
				if(StrKit.notBlank(msg)){
					BladeLogManager.doLog("异常日志", msg, false);
				}
			} catch (Exception logex) {
				LogKit.logNothing(logex);
			}
			return resultModel;
		} catch (Exception exception) {
			LOGGER.error(exception.getMessage(), exception);
			return resultModel;
		} finally {
			LOGGER.error(msg, ex);
		}
	}

}