Commit 17fce864 authored by YazhouChen's avatar YazhouChen

增加字段

parent 2f18c5b1
...@@ -23,15 +23,15 @@ ...@@ -23,15 +23,15 @@
<entry name="$MAVEN_REPOSITORY$/joda-time/joda-time/2.9/joda-time-2.9.jar" /> <entry name="$MAVEN_REPOSITORY$/joda-time/joda-time/2.9/joda-time-2.9.jar" />
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar" /> <entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar" />
</processorPath> </processorPath>
<module name="generator" /> <module name="admin" />
<module name="framework" />
<module name="scheduled" /> <module name="scheduled" />
<module name="config" />
<module name="system" /> <module name="system" />
<module name="distribution" />
<module name="example" /> <module name="example" />
<module name="framework" />
<module name="bootstrap" /> <module name="bootstrap" />
<module name="config" /> <module name="distribution" />
<module name="admin" /> <module name="generator" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
</component> </component>
......
This diff is collapsed.
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:53:53 CST 2021 #Thu Dec 09 10:42:31 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=admin artifactId=admin
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:31 CST 2021 #Thu Dec 09 10:42:52 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=bootstrap artifactId=bootstrap
spring-boot-plus:
# 是否启用ansi控制台输出有颜色的字体,dev环境建议开启,服务器环境设置为false
enable-ansi: true
# 当前环境服务IP地址
server-ip: 114.67.82.178
# 文件上传下载配置
upload-path: /opt/upload/
taskstatus: 1
spring:
datasource:
url: jdbc:mysql://114.67.82.178:3306/hxh?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: changfa123$
# Redis配置
redis:
database: 0
# redis bus123$ 8976 127.0.0.1 dapchina 6390
host: 127.0.0.1
password: bus123$
port: 8976
# 打印SQL语句和结果集,本地开发环境可开启,线上注释掉
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
data:
path:
template: D:\\svn-repository\\spms\\template\\
produce: D:\\svn-repository\\spms\\produce\\
...@@ -40,7 +40,7 @@ spring: ...@@ -40,7 +40,7 @@ spring:
--- ---
spring: spring:
profiles: profiles:
active: prod active: uat
# logback.xml中有详细的日志配置 # logback.xml中有详细的日志配置
logging: logging:
......
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:53:58 CST 2021 #Thu Dec 09 10:42:34 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=config artifactId=config
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:32 CST 2021 #Thu Dec 09 10:42:53 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=distribution artifactId=distribution
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:09 CST 2021 #Thu Dec 09 10:42:40 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=framework artifactId=framework
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:39 CST 2021 #Thu Dec 09 10:42:55 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=generator artifactId=generator
...@@ -22,6 +22,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType; ...@@ -22,6 +22,7 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.geekidea.springbootplus.framework.core.validator.groups.Add; import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update; import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.text.StringEscapeUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -188,5 +189,33 @@ public class NoticeController extends BaseController { ...@@ -188,5 +189,33 @@ public class NoticeController extends BaseController {
return ApiResult.ok(paging); return ApiResult.ok(paging);
} }
@GetMapping("/getPayInfo")
@OperationLogIgnore
@ApiOperation(value = "获取某天银联无感文件", notes = "获取某天银联无感文件")
public ApiResult<Object> getOnlpayFile(@Param("day") String day) throws Exception {
HashMap<String,Object> info = noticetypeService.getOnlpayFile(day);
if(info.get("code").toString().equals("200")){
return ApiResult.ok(info.get("data"));
}else{
return ApiResult.result(ApiCode.FAIL,info.get("info").toString(),null);
}
}
@GetMapping("/getPayInfoDetail")
@OperationLogIgnore
@ApiOperation(value = "获取某天银联无感文件", notes = "获取某天银联无感文件")
public ApiResult<Object> getPayInfoDetail(@Param("day") String day) throws Exception {
HashMap<String,Object> info = noticetypeService.getPayInfoDetail(day);
if(info.get("code").toString().equals("200")){
return ApiResult.ok(info.get("data"));
}else{
return ApiResult.result(ApiCode.FAIL,info.get("info").toString(),null);
}
}
} }
...@@ -54,4 +54,8 @@ public interface NoticetypeService extends BaseService<Noticetype> { ...@@ -54,4 +54,8 @@ public interface NoticetypeService extends BaseService<Noticetype> {
Paging<Noticetype> getNoticetypePageList(NoticetypePageParam noticetypePageParam) throws Exception; Paging<Noticetype> getNoticetypePageList(NoticetypePageParam noticetypePageParam) throws Exception;
HashMap<String, Object> noticeTypeList(); HashMap<String, Object> noticeTypeList();
HashMap<String, Object> getOnlpayFile(String day);
HashMap<String, Object> getPayInfoDetail(String day);
} }
...@@ -13,13 +13,20 @@ import io.geekidea.springbootplus.framework.core.pagination.PageInfo; ...@@ -13,13 +13,20 @@ import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.io.IOUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.io.*;
import java.nio.charset.Charset;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
/** /**
* 服务实现类 * 服务实现类
...@@ -101,4 +108,94 @@ public class NoticetypeServiceImpl extends BaseServiceImpl<NoticetypeMapper, Not ...@@ -101,4 +108,94 @@ public class NoticetypeServiceImpl extends BaseServiceImpl<NoticetypeMapper, Not
return hashMap; return hashMap;
} }
@Override
public HashMap<String, Object> getOnlpayFile(String day) {
HashMap<String, Object> hashMap = new HashMap<>();
String filepath = "/root/onlpay/"+day;
System.out.println("filepath = " + filepath);
File directory = new File(filepath);
if(directory.exists()){
File[] fileArr = directory.listFiles();
StringBuffer content = new StringBuffer();
for (int i = 0; i < fileArr.length; i++) {
File fileOne = fileArr[i];
System.out.println("fileOne.getName() = " + fileOne.getName());
System.out.println("fileOne.getName().indexOf(day+\".txt.gz\") = " + fileOne.getName().indexOf(day+".txt.gz"));
if(fileOne.getName().indexOf(day+".txt.gz")>=0 && fileOne.getName().indexOf("pre_balance")>=0 ){
try {
File zipfile = new File("/root/onlpay/"+day+"/"+fileOne.getName());
InputStream in = new GZIPInputStream(new FileInputStream(zipfile));
List<String> list = IOUtils.readLines(in, "GBK");
for (int j = 1; j < list.size()-1; j++) {
String string = list.get(j);
content.append(string+",");
System.out.println(string);
}
//一定记得关闭流
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
hashMap.put("code","200");
hashMap.put("info","查询成功");
hashMap.put("data",content);
}else{
hashMap.put("code","500");
hashMap.put("info","目录不存在");
}
return hashMap;
}
@Override
public HashMap<String, Object> getPayInfoDetail(String day) {
HashMap<String, Object> hashMap = new HashMap<>();
String filepath = "/root/onlpay/"+day;
System.out.println("filepath = " + filepath);
File directory = new File(filepath);
if(directory.exists()){
File[] fileArr = directory.listFiles();
StringBuffer content = new StringBuffer();
for (int i = 0; i < fileArr.length; i++) {
File fileOne = fileArr[i];
System.out.println("fileOne.getName() = " + fileOne.getName());
if(fileOne.getName().indexOf(day+".csv.gz")>=0 && fileOne.getName().indexOf("tran_")>=0 ){
try {
File zipfile = new File("/root/onlpay/"+day+"/"+fileOne.getName());
InputStream in = new GZIPInputStream(new FileInputStream(zipfile));
List<String> list = IOUtils.readLines(in, "GBK");
for (int j = 1; j < list.size()-1; j++) {
String string = list.get(j);
if(string.indexOf("总交易笔数")>=0){
break;
}
content.append(string+",");
System.out.println(string);
}
//一定记得关闭流
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
hashMap.put("code","200");
hashMap.put("info","查询成功");
hashMap.put("data",content);
}else{
hashMap.put("code","500");
hashMap.put("info","目录不存在");
}
return hashMap;
}
} }
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:22 CST 2021 #Thu Dec 09 10:42:48 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=example artifactId=example
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:44 CST 2021 #Thu Dec 09 10:42:56 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=scheduled artifactId=scheduled
#Generated by Maven #Generated by Maven
#Fri Sep 17 19:54:24 CST 2021 #Thu Dec 09 10:42:49 CST 2021
version=2.0 version=2.0
groupId=io.geekidea.springbootplus groupId=io.geekidea.springbootplus
artifactId=system artifactId=system
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment