Commit 57389afe authored by 董建华's avatar 董建华

shangbao

parent 30b5a8d6
......@@ -128,6 +128,11 @@
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -8,6 +8,7 @@ public class ZhjreportApplication {
public static void main(String[] args) {
SpringApplication.run(ZhjreportApplication.class, args);
System.out.println("上报系统启动完成");
}
}
......@@ -22,8 +22,8 @@ import javax.sql.DataSource;
* @version: 1.0
*/
@Configuration
@MapperScan(basePackages = "com.mapper.*")
public class DataSourceConfig {
@MapperScan(basePackages = "com.mapper.report")
public class ReportDataSourceConfig {
@Value("${db.driver}")
private String driverClass;
......@@ -42,8 +42,8 @@ public class DataSourceConfig {
@Value("${config-location}")
private String mapperConfig;
@Bean(name = "dataSource")
public DataSource xyqbUserDatasource() {
@Bean(name = "reportDataSource")
public DataSource reportDatasource() {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(jdbcUrl);
config.setUsername(username);
......@@ -53,13 +53,13 @@ public class DataSourceConfig {
return new HikariDataSource(config);
}
@Bean(name = "transactionManager")
public DataSourceTransactionManager xyqbUserDatasourceTransactionManager(@Qualifier("dataSource") DataSource xyqbUserDatasource ) {
return new DataSourceTransactionManager(xyqbUserDatasource);
@Bean
public DataSourceTransactionManager reporDatasourceTransactionManager(@Qualifier("reportDataSource") DataSource datasource ) {
return new DataSourceTransactionManager(datasource);
}
@Bean(name = "sqlSessionFactory")
public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception {
public SqlSessionFactory sqlSessionFactory(@Qualifier("reportDataSource") DataSource dataSource) throws Exception {
final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
......
package com.emums;
import jdk.nashorn.internal.runtime.regexp.joni.constants.StringType;
public enum PathType {
REPORT("upload","上报路径"),
FEEDBACK("feed","反馈路径"),
;
private String path;
private String type;
PathType (String path, String type){
this.path=path;
this.type=type;
}
public String getPath() {
return path;
}
}
package com.entity;
import lombok.Getter;
import lombok.Setter;
/**
* @author :dongjianhua
* @date :Created in 2019/10/30 14:57
......@@ -7,7 +10,9 @@ package com.entity;
* @modified By:
* @version: 1.0
*/
public class ReportEntry {
@Getter
@Setter
public class FileEntry {
String fileName ;
String filePath ;
}
package com.entity.report;
import java.util.Date;
public class ReportRecord {
private Integer id;
private String filename;
private String filepath;
private String reportmsg;
private Integer issearch;
private String feedback;
private Integer status;
private Date createtime;
private Date updatetime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename == null ? null : filename.trim();
}
public String getFilepath() {
return filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath == null ? null : filepath.trim();
}
public String getReportmsg() {
return reportmsg;
}
public void setReportmsg(String reportmsg) {
this.reportmsg = reportmsg == null ? null : reportmsg.trim();
}
public Integer getIssearch() {
return issearch;
}
public void setIssearch(Integer issearch) {
this.issearch = issearch;
}
public String getFeedback() {
return feedback;
}
public void setFeedback(String feedback) {
this.feedback = feedback == null ? null : feedback.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
}
\ No newline at end of file
package com.mapper.report;
import com.entity.report.ReportRecord;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface ReportRecordMapper {
List<ReportRecord> getReportedRecord();
int deleteByPrimaryKey(Integer id);
int insert(ReportRecord record);
int insertSelective(ReportRecord record);
ReportRecord selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(ReportRecord record);
int updateByPrimaryKeySelectiveByFileName(ReportRecord record);
int updateByPrimaryKey(ReportRecord record);
}
\ No newline at end of file
......@@ -2,12 +2,19 @@ package com.service;
import com.emums.BusinessType;
import com.emums.InfoType;
import com.entity.FileEntry;
import java.util.List;
import java.util.Map;
public interface ReportService {
String creatZipFile(List<Map<String,Object>> dataList, InfoType infoType, BusinessType businessType);
FileEntry creatZipFile(List<Map<String,Object>> dataList, InfoType infoType, BusinessType businessType);
Map<String ,Object> reportData(FileEntry fileEntry);
Map<String ,Object> quaryReportedStatus();
Map<String ,Object> quaryReportedStatus(FileEntry fileEntry);
void reportLoanData();
Map<String ,Object> reportData(String fileName);
}
......@@ -231,4 +231,5 @@ public class Utils {
return random.nextInt(max);
}
}
......@@ -5,39 +5,39 @@ db.driver=com.mysql.jdbc.Driver
config-location=classpath:mybatis-config.xml
db.minPoolSize=1
db.maxPoolSize=5
mapper.location=classpath*:mybatis/*.xml
data.source.jdbcUrl=jdbc:mysql://172.17.5.8:31024/xyqb_user?useUnicode=true&characterEncoding=UTF8
mapper.location=classpath:mybatis/report/*.xml
data.source.jdbcUrl=jdbc:mysql://172.30.220.9:3306/project?useUnicode=true&characterEncoding=UTF8
data.source.username=qa
data.source.password=qatest
#报送相关配置
#组织机构代码 测试阶段使用06346639-3
#报送相关配置
#组织机构代码 测试阶段使用06346639-3
organizationCode=06346639-3
#统一社会信用代码 913606000634663936
uniformSocialCreditCode=913606000634663936
#接口的key
#统一社会信用代码 913606000634663936
uniformSocialCreditCode=91360600MA05M6KK96
#接口的key
interFaceKey=cfcc
#code 组织结构代码或者统一社会信用代码的9-17 测试直接用demo给的
#code 组织结构代码或者统一社会信用代码的9-17 MA05M6KK9
code=MA05M6KK9
#查询接口url
#查询接口url
infoUrl=https://testcredit.nifa.org.cn/NifaServer/context/info/json/upload
#报送接口uri
#报送接口uri
dataUri=https://testcredit.nifa.org.cn/NifaServer/context/data/json/asynlist
#报送状态查看接口
#报送状态查看接口
taskUri=https://testcredit.nifa.org.cn/NifaServer/context/task/json/upload
#报送文件加密用公钥1 测试阶段无需修改,生产接入时另行发放
#报送文件加密用公钥1 测试阶段无需修改,生产接入时另行发放
xPubkey=dc5f89775f11266dbb166638710463db31a91f7b3061aeddb69444d5ec748929
#报送文件加密用公钥2 测试阶段无需修改,生产接入时另行发放
#报送文件加密用公钥2 测试阶段无需修改,生产接入时另行发放
yPubKey=740e50cb6e6e04003029a66920d1ba4bc39519035ea423bf0079ef58128202fb
#反馈文件解密用私钥 测试阶段无需修改,生产接入时另行发放
#反馈文件解密用私钥 测试阶段无需修改,生产接入时另行发放
prvKey=9401d5a563967f8bd39fbd81d5dedea4e552bf97f5dd8cab95749421a477e7d0
#业务信息文件名
#业务信息文件名
businfoFileName=121EXPORTTRADEINFO
#删除信息文件名
#删除信息文件名
delinfoFileName=000DELETEINFO
#报送文件存储路径临时位置前缀
#报送文件存储路径临时位置前缀
filePathPre=D:/report/
#是否脱敏
#是否脱敏
isDesensitization=true
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mapper.report.ReportRecordMapper">
<resultMap id="BaseResultMap" type="com.entity.report.ReportRecord">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="filename" jdbcType="VARCHAR" property="filename" />
<result column="filepath" jdbcType="VARCHAR" property="filepath" />
<result column="reportmsg" jdbcType="VARCHAR" property="reportmsg" />
<result column="issearch" jdbcType="INTEGER" property="issearch" />
<result column="feedback" jdbcType="VARCHAR" property="feedback" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
</resultMap>
<sql id="Base_Column_List">
id, filename, filepath, reportmsg, issearch, feedback, status, createtime, updatetime
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from reportrecord
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from reportrecord
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.entity.report.ReportRecord">
insert into reportrecord (id, filename, filepath,
reportmsg, issearch, feedback,
status, createtime, updatetime
)
values (#{id,jdbcType=INTEGER}, #{filename,jdbcType=VARCHAR}, #{filepath,jdbcType=VARCHAR},
#{reportmsg,jdbcType=VARCHAR}, #{issearch,jdbcType=INTEGER}, #{feedback,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.entity.report.ReportRecord">
insert into reportrecord
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="filename != null">
filename,
</if>
<if test="filepath != null">
filepath,
</if>
<if test="reportmsg != null">
reportmsg,
</if>
<if test="issearch != null">
issearch,
</if>
<if test="feedback != null">
feedback,
</if>
<if test="status != null">
status,
</if>
<if test="createtime != null">
createtime,
</if>
<if test="updatetime != null">
updatetime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="filename != null">
#{filename,jdbcType=VARCHAR},
</if>
<if test="filepath != null">
#{filepath,jdbcType=VARCHAR},
</if>
<if test="reportmsg != null">
#{reportmsg,jdbcType=VARCHAR},
</if>
<if test="issearch != null">
#{issearch,jdbcType=INTEGER},
</if>
<if test="feedback != null">
#{feedback,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
#{updatetime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.entity.report.ReportRecord">
update reportrecord
<set>
<if test="filename != null">
filename = #{filename,jdbcType=VARCHAR},
</if>
<if test="filepath != null">
filepath = #{filepath,jdbcType=VARCHAR},
</if>
<if test="reportmsg != null">
reportmsg = #{reportmsg,jdbcType=VARCHAR},
</if>
<if test="issearch != null">
issearch = #{issearch,jdbcType=INTEGER},
</if>
<if test="feedback != null">
feedback = #{feedback,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createtime != null">
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeySelectiveByFileName" parameterType="com.entity.report.ReportRecord">
update reportrecord
<set>
<if test="filename != null">
filename = #{filename,jdbcType=VARCHAR},
</if>
<if test="filepath != null">
filepath = #{filepath,jdbcType=VARCHAR},
</if>
<if test="reportmsg != null">
reportmsg = #{reportmsg,jdbcType=VARCHAR},
</if>
<if test="issearch != null">
issearch = #{issearch,jdbcType=INTEGER},
</if>
<if test="feedback != null">
feedback = #{feedback,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createtime != null">
createtime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
updatetime = #{updatetime,jdbcType=TIMESTAMP},
</if>
</set>
where filename = #{filename,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.entity.report.ReportRecord">
update reportrecord
set filename = #{filename,jdbcType=VARCHAR},
filepath = #{filepath,jdbcType=VARCHAR},
reportmsg = #{reportmsg,jdbcType=VARCHAR},
issearch = #{issearch,jdbcType=INTEGER},
feedback = #{feedback,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
createtime = #{createtime,jdbcType=TIMESTAMP},
updatetime = #{updatetime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getReportedRecord" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
from reportrecord
where status = 1
and
createtime &lt; date_add(NOW(),interval -10 minute)
</select>
</mapper>
\ No newline at end of file
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