caoyizhong
1 year ago
15 changed files with 1673 additions and 12 deletions
@ -0,0 +1,56 @@
|
||||
package org.springblade.common.utils; |
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
import javax.servlet.ServletRequest; |
||||
import java.io.BufferedReader; |
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
import java.io.InputStreamReader; |
||||
import java.nio.charset.Charset; |
||||
|
||||
/** |
||||
* 通用http工具封装 |
||||
* |
||||
* @author lmy |
||||
*/ |
||||
public class HttpHelper |
||||
{ |
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HttpHelper.class); |
||||
|
||||
public static String getBodyString(ServletRequest request) |
||||
{ |
||||
StringBuilder sb = new StringBuilder(); |
||||
BufferedReader reader = null; |
||||
try (InputStream inputStream = request.getInputStream()) |
||||
{ |
||||
reader = new BufferedReader(new InputStreamReader(inputStream, Charset.forName("UTF-8"))); |
||||
String line = ""; |
||||
while ((line = reader.readLine()) != null) |
||||
{ |
||||
sb.append(line); |
||||
} |
||||
} |
||||
catch (IOException e) |
||||
{ |
||||
LOGGER.warn("getBodyString出现问题!"); |
||||
} |
||||
finally |
||||
{ |
||||
if (reader != null) |
||||
{ |
||||
try |
||||
{ |
||||
reader.close(); |
||||
} |
||||
catch (IOException e) |
||||
{ |
||||
LOGGER.error(ExceptionUtils.getMessage(e)); |
||||
} |
||||
} |
||||
} |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,69 @@
|
||||
package com.logpm.basicdata.excel; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 货区零担导出 Excel实体类 |
||||
* |
||||
* @author lmy |
||||
* @since 2023-09-11 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class BasicdatavisualizationZreoSheetOne implements Serializable { |
||||
|
||||
/** |
||||
* 运单号 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("运单号") |
||||
private String waybillNumber; |
||||
/** |
||||
* 货物名称 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("货物名称") |
||||
private String goodsName; |
||||
/** |
||||
* 托盘码 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("托盘码") |
||||
private String trayCode; |
||||
|
||||
/** |
||||
* 库位号 |
||||
*/ |
||||
@ColumnWidth(30) |
||||
@ExcelProperty("库位号") |
||||
private String positionInfo; |
||||
|
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("数量") |
||||
private String num; |
||||
|
||||
/** |
||||
* 上架时间 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("上架时间") |
||||
private String upTime; |
||||
|
||||
/** |
||||
* 上架人 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("上架人") |
||||
private String upUser; |
||||
} |
@ -0,0 +1,71 @@
|
||||
package com.logpm.basicdata.excel; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 货区零担导出 Excel实体类 |
||||
* |
||||
* @author lmy |
||||
* @since 2023-09-11 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class BasicdatavisualizationZreoSheetTwo implements Serializable { |
||||
|
||||
/** |
||||
* 库位号 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("库位号") |
||||
private String positionInfo; |
||||
|
||||
/** |
||||
* 一级品类 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("一级品类") |
||||
private String firsts; |
||||
|
||||
/** |
||||
* 二级品类 |
||||
*/ |
||||
@ColumnWidth(40) |
||||
@ExcelProperty("二级品类") |
||||
private String second; |
||||
|
||||
/** |
||||
* 三级品类 |
||||
*/ |
||||
@ColumnWidth(30) |
||||
@ExcelProperty("三级品类") |
||||
private String thirdProduct; |
||||
|
||||
/** |
||||
* 订单自编号 |
||||
*/ |
||||
@ColumnWidth(30) |
||||
@ExcelProperty("订单自编号") |
||||
private String orderCode; |
||||
|
||||
/** |
||||
* 物料名称 |
||||
*/ |
||||
@ColumnWidth(30) |
||||
@ExcelProperty("物料名称") |
||||
private String materialName; |
||||
|
||||
/** |
||||
* 数量 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("数量") |
||||
private String num; |
||||
} |
@ -0,0 +1,35 @@
|
||||
package com.logpm.warehouse.config; |
||||
|
||||
import org.redisson.Redisson; |
||||
import org.redisson.config.Config; |
||||
import org.springblade.core.redis.cache.BladeRedis; |
||||
import org.springblade.core.tool.utils.SpringUtil; |
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; |
||||
|
||||
@Configuration |
||||
public class RedissonConfig { |
||||
|
||||
@Bean |
||||
public Redisson redisson() { |
||||
// 单机模式
|
||||
Config config = new Config(); |
||||
|
||||
BladeRedis bean = SpringUtil.getBean(BladeRedis.class); |
||||
|
||||
RedisConnectionFactory connectionFactory = bean.getRedisTemplate().getConnectionFactory(); |
||||
|
||||
LettuceConnectionFactory factory = (LettuceConnectionFactory) connectionFactory; |
||||
|
||||
String hostName = factory.getHostName(); |
||||
int port = factory.getPort(); |
||||
String password = factory.getPassword(); |
||||
|
||||
config.useSingleServer().setAddress("redis://"+hostName+":"+port).setDatabase(2); |
||||
config.useSingleServer().setPassword(password); |
||||
return (Redisson) Redisson.create(config); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue