Skip to content

Instantly share code, notes, and snippets.

View lxpfunny's full-sized avatar
💭
working

lxp_funny lxpfunny

💭
working
View GitHub Profile
@lxpfunny
lxpfunny / StringUtils.join
Created July 2, 2018 07:08
StringUtils.join
StringUtils.join(ownerDetailDTO.getPhones(), ",")
@lxpfunny
lxpfunny / java:jdbcTemplate batchUpdate
Created April 28, 2018 09:54
java:jdbcTemplate batchUpdate
jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {
@lxpfunny
lxpfunny / spring:restTemplate
Created April 17, 2018 01:59
spring:restTemplate
package com.fangyou.service.transaction.utils;
import com.fangyou.common.exception.biz.BizException;
import com.fangyou.service.transaction.constant.ReturnCode;
import com.fangyou.service.transaction.model.tms.NetContractInfo;
import com.fangyou.service.transaction.model.tms.PreparationResultData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
@lxpfunny
lxpfunny / PreAuthorizeAspect.class
Created March 21, 2018 02:06
spring:aop通过注解切入
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.fangyou.common.security.aop;
import com.fangyou.common.security.annotation.PreAuthorize;
import com.fangyou.common.security.process.AuthorizeProcessor;
import org.aspectj.lang.JoinPoint;
@lxpfunny
lxpfunny / PreparationEntityMapper.java
Created March 14, 2018 07:43
entity property convert
package com.fangyou.service.transaction.utils.convert;
import com.fangyou.repo.transaction.model.Preparation;
import com.fangyou.service.transaction.model.dto.PreparationDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
@lxpfunny
lxpfunny / entity property convert
Created March 14, 2018 07:42
entity property convert
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>${org.mapstruct.version}</version>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version>
@lxpfunny
lxpfunny / bufferedOutputstream
Created February 5, 2018 05:51
bufferedOutputstream write inputstream
public static void saveData(InputStream is, File file) {
try (BufferedInputStream bis = new BufferedInputStream(is);
BufferedOutputStream bos = new BufferedOutputStream(
new FileOutputStream(file));) {
byte[] buffer = new byte[1024];
int len = -1;
while ((len = bis.read(buffer)) != -1) {
bos.write(buffer, 0, len);
bos.flush();
}
@lxpfunny
lxpfunny / common.js
Created October 12, 2017 03:04
js:global config
//jqGrid的配置信息
$.jgrid.defaults.width = 1000;
$.jgrid.defaults.responsive = true;
$.jgrid.defaults.styleUI = 'Bootstrap';
//工具集合Tools
window.T = {};
// 获取请求参数
// 使用示例
@lxpfunny
lxpfunny / java:excel response header and contentType
Created October 11, 2017 09:38
java:excel response header and contentType
response.setContentType("application/x-msdownload");
response.setHeader("Content-disposition", "attachment; filename=" + URLDecoder.decode(System.currentTimeMillis() + ".xls", "UTF-8"));
outputStream.flush();
outputStream.close();
@lxpfunny
lxpfunny / java:lombok
Created October 11, 2017 09:28
java:lombok
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.8</version>
</dependency>