wxr 2022-11-23 交银理财威科数据先行代码
parent
618d1b2a3d
commit
cf1bb661ed
|
@ -0,0 +1,16 @@
|
||||||
|
package weaver.xuanran.wang.common.annocation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>Action和计划任务参数</h1>
|
||||||
|
* @Author xuanran.wang
|
||||||
|
* @Date 2022/11/23 10:29
|
||||||
|
*/
|
||||||
|
@Target({ElementType.FIELD,ElementType.TYPE})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface ActionJobParam {
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package weaver.xuanran.wang.common.annocation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>action和计划任务参数检测</h1>
|
||||||
|
*
|
||||||
|
* @Author xuanran.wang
|
||||||
|
* @Date 2022/11/23 10:23
|
||||||
|
*/
|
||||||
|
@Target({ElementType.FIELD,ElementType.TYPE})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface ParamNotNull {
|
||||||
|
String value() default "";
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package weaver.xuanran.wang.common.mapper;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.Delete;
|
||||||
|
import aiyh.utils.annotation.recordset.ParamMapper;
|
||||||
|
import aiyh.utils.annotation.recordset.Select;
|
||||||
|
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author xuanran.wang
|
||||||
|
* @Date 2022/11/11 18:12
|
||||||
|
*/
|
||||||
|
@SqlMapper
|
||||||
|
public interface CommonMapper {
|
||||||
|
@Select(" select tablename \n" +
|
||||||
|
" from modeinfo t1 \n" +
|
||||||
|
" left join workflow_bill t2 \n" +
|
||||||
|
" on t1.formid = t2.id \n" +
|
||||||
|
" where t1.id = #{modelId}")
|
||||||
|
String getModelNameByModelId(@ParamMapper("modelId") String modelId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>通过id删除表数据</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/17 10:41
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param id 数据id
|
||||||
|
* @return 删除是否成功
|
||||||
|
**/
|
||||||
|
@Delete("delete from $t{tableName} where id = #{id}")
|
||||||
|
boolean deleteModelDataById(@ParamMapper("tableName") String tableName,
|
||||||
|
@ParamMapper("id") String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>通过id删除表数据</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/17 10:41
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param ids 数据ids
|
||||||
|
* @return 删除是否成功
|
||||||
|
**/
|
||||||
|
@Delete("delete from $t{tableName} where id in (${ids})")
|
||||||
|
boolean deleteModelDataByIds(@ParamMapper("tableName") String tableName,
|
||||||
|
@ParamMapper("ids") List<String> ids);
|
||||||
|
}
|
|
@ -0,0 +1,175 @@
|
||||||
|
package weaver.xuanran.wang.common.util;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.xuanran.wang.common.annocation.ParamNotNull;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>工具类</h1>
|
||||||
|
* @Author xuanran.wang
|
||||||
|
* @Date 2022/11/23 10:25
|
||||||
|
*/
|
||||||
|
public class CommonUtil {
|
||||||
|
|
||||||
|
private final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
|
public static final int SQL_IN_PAGE_SIZE = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>将文件解压至指定文件夹中</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 16:02
|
||||||
|
* @param srcFilePath 源文件
|
||||||
|
* @param acceptFilePath 接收解压文件的文件夹
|
||||||
|
**/
|
||||||
|
public static void unZip(String srcFilePath, String acceptFilePath) throws RuntimeException {
|
||||||
|
// 判断源文件是否存在
|
||||||
|
if (!new File(srcFilePath).exists()) {
|
||||||
|
throw new CustomerException(srcFilePath + " 路径不存在");
|
||||||
|
}
|
||||||
|
// 开始解压
|
||||||
|
ZipFile zipFile = null;
|
||||||
|
try {
|
||||||
|
zipFile = new ZipFile(new File(srcFilePath), Charset.forName("GBK"));
|
||||||
|
Enumeration<?> entries = zipFile.entries();
|
||||||
|
while (entries.hasMoreElements()) {
|
||||||
|
ZipEntry entry = (ZipEntry) entries.nextElement();
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
String dirPath = acceptFilePath + File.separator + entry.getName();
|
||||||
|
File dir = new File(dirPath);
|
||||||
|
dir.mkdirs();
|
||||||
|
} else {
|
||||||
|
String temp = acceptFilePath + File.separator + entry.getName();
|
||||||
|
File targetFile = new File(temp);
|
||||||
|
if(!targetFile.getParentFile().exists()){
|
||||||
|
targetFile.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
targetFile.createNewFile();
|
||||||
|
InputStream is = zipFile.getInputStream(entry);
|
||||||
|
FileOutputStream fos = new FileOutputStream(targetFile);
|
||||||
|
int len;
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
while ((len = is.read(buf)) != -1) {
|
||||||
|
fos.write(buf, 0, len);
|
||||||
|
}
|
||||||
|
// 关流顺序,先打开的后关闭
|
||||||
|
fos.close();
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("解压文件出现异常: " + e.getMessage());
|
||||||
|
} finally {
|
||||||
|
if(zipFile != null){
|
||||||
|
try {
|
||||||
|
zipFile.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>一行一行的读文件</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 17:22
|
||||||
|
* @param filePath 文件路径
|
||||||
|
* @return 文件内容
|
||||||
|
**/
|
||||||
|
public static String readFileByLines(String filePath) {
|
||||||
|
if(!new File(filePath).exists()){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
File file = new File(filePath);
|
||||||
|
BufferedReader reader = null;
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
try {
|
||||||
|
reader = new BufferedReader(new FileReader(file));
|
||||||
|
String tempString = null;
|
||||||
|
// 一次读入一行,直到读入null为文件结束
|
||||||
|
while ((tempString = reader.readLine()) != null) {
|
||||||
|
builder.append(tempString);
|
||||||
|
}
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (reader != null) {
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException ie) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <h1>检查属性是否存在空值</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 15:59
|
||||||
|
* @param t 需要判断的对象
|
||||||
|
**/
|
||||||
|
public static <T> void checkParamNotNull(T t) throws IllegalAccessException {
|
||||||
|
Class<?> clazz = t.getClass();
|
||||||
|
Field[] fields = clazz.getDeclaredFields();
|
||||||
|
for (Field field : fields) {
|
||||||
|
ParamNotNull paramNotNull = field.getDeclaredAnnotation(ParamNotNull.class);
|
||||||
|
if(paramNotNull == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
field.setAccessible(true);
|
||||||
|
Object value = field.get(t);
|
||||||
|
Class<?> valueClass = field.getType();
|
||||||
|
boolean isNull = false;
|
||||||
|
if(valueClass.isAssignableFrom(String.class)){
|
||||||
|
if(StringUtils.isBlank(Util.null2String(value))){
|
||||||
|
isNull = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(valueClass.isAssignableFrom(List.class)){
|
||||||
|
if(CollectionUtils.isEmpty((List) value)){
|
||||||
|
isNull = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(valueClass.isAssignableFrom(Map.class)){
|
||||||
|
if(MapUtils.isEmpty((Map) value)){
|
||||||
|
isNull = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(isNull){
|
||||||
|
throw new CustomerException("classPath : [ " + clazz.getName() + " ], field : [ " + field.getName() + " ] is not be null!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static <T> List<List<T>> splitList(List<T> list, int splitSize) {
|
||||||
|
//判断集合是否为空
|
||||||
|
if (CollectionUtils.isEmpty(list))
|
||||||
|
return Collections.emptyList();
|
||||||
|
//计算分割后的大小
|
||||||
|
int maxSize = (list.size() + splitSize - 1) / splitSize;
|
||||||
|
//开始分割
|
||||||
|
return Stream.iterate(0, n -> n + 1)
|
||||||
|
.limit(maxSize)
|
||||||
|
.parallel()
|
||||||
|
.map(a -> list.parallelStream().skip((long) a * splitSize).limit(splitSize).collect(Collectors.toList()))
|
||||||
|
.filter(b -> !b.isEmpty())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package weaver.xuanran.wang.common.util;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
|
||||||
|
import aiyh.utils.sqlUtil.whereUtil.Where;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.formmode.data.ModeDataIdUpdate;
|
||||||
|
import weaver.formmode.setup.ModeRightInfo;
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
import weaver.xuanran.wang.common.mapper.CommonMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author xuanran.wang
|
||||||
|
* @Date 2022/11/11 18:05
|
||||||
|
*/
|
||||||
|
public class CusInfoToOAUtil {
|
||||||
|
private static final CommonMapper commonMapper = Util.getMapper(CommonMapper.class);
|
||||||
|
private static final ModeDataIdUpdate modeDataIdUpdate = ModeDataIdUpdate.getInstance();
|
||||||
|
private static final ModeRightInfo moderightinfo = new ModeRightInfo();
|
||||||
|
private static final Logger log = Util.getLogger();
|
||||||
|
public static final String TABLE_NAME_PLACEHOLDER = "#\\{table}";
|
||||||
|
/**
|
||||||
|
* <h1>将自定义信息写入建模</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 17:00
|
||||||
|
* @param modelId 模块id
|
||||||
|
* @param params 需要插入的数据map
|
||||||
|
* @param whereSql 重复数据条件sql
|
||||||
|
* @param whereParams 重复数据参数集合
|
||||||
|
* @return 建模数据id
|
||||||
|
**/
|
||||||
|
public static int execute(int modelId,
|
||||||
|
Map<String, Object> params,
|
||||||
|
String whereSql,
|
||||||
|
List<String> whereParams) {
|
||||||
|
if(modelId < 0){
|
||||||
|
throw new RuntimeException("建模模块id不能小于0!");
|
||||||
|
}
|
||||||
|
String tableName = commonMapper.getModelNameByModelId(String.valueOf(modelId));
|
||||||
|
if(StringUtils.isBlank(tableName)){
|
||||||
|
throw new CustomerException("模块id为 " + modelId + ", 在系统中暂没查询到对应表单!");
|
||||||
|
}
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
int mainId = -1;
|
||||||
|
boolean needModeRight = false;
|
||||||
|
if(StringUtils.isNotBlank(whereSql)){
|
||||||
|
whereSql = whereSql.replaceAll(TABLE_NAME_PLACEHOLDER, tableName);
|
||||||
|
if (rs.executeQuery(whereSql, whereParams) && rs.next()) {
|
||||||
|
mainId = Util.getIntValue(rs.getString(1),-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(mainId < 0){
|
||||||
|
mainId = getNewIdByModelInfo(tableName, modelId);
|
||||||
|
needModeRight = true;
|
||||||
|
}
|
||||||
|
Where where = Util.createPrepWhereImpl()
|
||||||
|
.whereAnd("id").whereEqual(mainId);
|
||||||
|
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql(
|
||||||
|
tableName,
|
||||||
|
params,
|
||||||
|
where
|
||||||
|
);
|
||||||
|
if (!rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs())) {
|
||||||
|
String error = Util.logStr("错误信息写入建模后置处理执行更新sql失败!" +
|
||||||
|
" 当前sql [{}], 当前参数 [{}], where条件[{}]", sqlResult.getSqlStr(),
|
||||||
|
JSONObject.toJSONString(sqlResult.getArgs()), mainId);
|
||||||
|
log.error(error);
|
||||||
|
throw new CustomerException(error);
|
||||||
|
}
|
||||||
|
if(needModeRight){
|
||||||
|
moderightinfo.rebuildModeDataShareByEdit(1, modelId, mainId);
|
||||||
|
}
|
||||||
|
return mainId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>删除建模数据</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 21:02
|
||||||
|
* @param modelId 模块id
|
||||||
|
* @param ids 数据集合
|
||||||
|
* @return 删除是否成功
|
||||||
|
**/
|
||||||
|
public static boolean deleteModelDataByIds(String modelId, List<String> ids){
|
||||||
|
String tableName = commonMapper.getModelNameByModelId(modelId);
|
||||||
|
return commonMapper.deleteModelDataByIds(tableName, ids);
|
||||||
|
}
|
||||||
|
private static Integer getNewIdByModelInfo(String modelTableName, int modelId){
|
||||||
|
String currentDateTime = TimeUtil.getCurrentTimeString();
|
||||||
|
//日期
|
||||||
|
String currentDate = currentDateTime.substring(0, 10);
|
||||||
|
//时间
|
||||||
|
String currentTime = currentDateTime.substring(11);
|
||||||
|
return modeDataIdUpdate.getModeDataNewId(modelTableName, modelId, 1, 0, currentDate, currentTime);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,10 +3,6 @@ package weaver.xuanran.wang.traffic_bank.waco_first.entity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import weaver.xuanran.wang.traffic_bank.waco_first.annocation.BodyPath;
|
import weaver.xuanran.wang.traffic_bank.waco_first.annocation.BodyPath;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>威科先行信息实体类</h1>
|
* <h1>威科先行信息实体类</h1>
|
||||||
*
|
*
|
||||||
|
@ -15,6 +11,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class Info {
|
public class Info {
|
||||||
|
private String infoId;
|
||||||
private String adminPenaltyTitle;
|
private String adminPenaltyTitle;
|
||||||
private String trialCourt;
|
private String trialCourt;
|
||||||
private String jurisdictionName;
|
private String jurisdictionName;
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
package weaver.xuanran.wang.traffic_bank.waco_first.job;
|
package weaver.xuanran.wang.traffic_bank.waco_first.job;
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
|
import com.jcraft.jsch.ChannelSftp;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import weaver.interfaces.schedule.BaseCronJob;
|
import weaver.interfaces.schedule.BaseCronJob;
|
||||||
|
import weaver.xuanran.wang.common.annocation.ParamNotNull;
|
||||||
|
import weaver.xuanran.wang.common.util.CommonUtil;
|
||||||
|
import weaver.xuanran.wang.traffic_bank.waco_first.entity.Info;
|
||||||
|
import weaver.xuanran.wang.traffic_bank.waco_first.service.WacoDataPushOAService;
|
||||||
|
import weaver.xuanran.wang.util.FtpUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>交银理财威科先行数据写入建模</h1>
|
* <h1>交银理财威科先行数据写入建模</h1>
|
||||||
|
@ -13,9 +21,58 @@ import weaver.interfaces.schedule.BaseCronJob;
|
||||||
public class WacoDataPushOA extends BaseCronJob {
|
public class WacoDataPushOA extends BaseCronJob {
|
||||||
|
|
||||||
private final Logger logger = Util.getLogger();
|
private final Logger logger = Util.getLogger();
|
||||||
|
/**
|
||||||
|
* <h2>ftpUrl地址</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String ftpUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>ftp端口号</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String ftpPort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>ftp用户名</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String ftpUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>ftp密码</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String ftpPassWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>文件存放根路径</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String localPath;
|
||||||
|
/**
|
||||||
|
* <h2>模块id</h2>
|
||||||
|
**/
|
||||||
|
@ParamNotNull
|
||||||
|
private String modelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>文档目录 如果不配置则为-1</h2>
|
||||||
|
**/
|
||||||
|
private String secCategory;
|
||||||
|
|
||||||
|
private final WacoDataPushOAService dataPushOAService = new WacoDataPushOAService();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
try {
|
||||||
|
CommonUtil.checkParamNotNull(this);
|
||||||
|
ChannelSftp connect = FtpUtil.connect(ftpUrl, Util.getIntValue(ftpPort), ftpUserName, ftpPassWord);
|
||||||
|
List<Info> infos = dataPushOAService.getInfoListFromFtp(connect, localPath);
|
||||||
|
dataPushOAService.writeInfoToOA(Util.getIntValue(modelId, -1),Util.getIntValue(secCategory, -1), infos);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(Util.logStr("计划任务执行失败!, 具体异常信息 : {}", e.getMessage()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,33 @@
|
||||||
package weaver.xuanran.wang.traffic_bank.waco_first.service;
|
package weaver.xuanran.wang.traffic_bank.waco_first.service;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jcraft.jsch.ChannelSftp;
|
||||||
|
import com.jcraft.jsch.SftpException;
|
||||||
|
import com.weaver.procedure.doc.Doc_diracl_insert_type3;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.conn.RecordSetTrans;
|
||||||
|
import weaver.docs.webservices.DocInfo;
|
||||||
|
import weaver.docs.webservices.DocServiceImpl;
|
||||||
|
import weaver.general.GCONST;
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.xuanran.wang.common.util.CommonUtil;
|
||||||
|
import weaver.xuanran.wang.common.util.CusInfoToOAUtil;
|
||||||
import weaver.xuanran.wang.traffic_bank.waco_first.annocation.BodyPath;
|
import weaver.xuanran.wang.traffic_bank.waco_first.annocation.BodyPath;
|
||||||
import weaver.xuanran.wang.traffic_bank.waco_first.entity.Info;
|
import weaver.xuanran.wang.traffic_bank.waco_first.entity.Info;
|
||||||
|
import weaver.xuanran.wang.util.FtpUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Iterator;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +38,107 @@ import java.util.regex.Matcher;
|
||||||
*/
|
*/
|
||||||
public class WacoDataPushOAService {
|
public class WacoDataPushOAService {
|
||||||
|
|
||||||
|
private static final String SUFFIX = ".zip";
|
||||||
|
private static final String DATA_SUFFIX = ".xml";
|
||||||
|
private final Logger logger = Util.getLogger();
|
||||||
|
private static final String WACO_TEMP_PATH = File.separator + "WACO" + File.separator + "temp" + File.separator;
|
||||||
|
private static final String INSERT_DOC_DETAIL_CONTENT_SQL = "insert into docdetailcontent(docid,doccontent) values(?,?)";
|
||||||
|
/**
|
||||||
|
* <h1></h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 16:29
|
||||||
|
* @param connect ftp连接对象
|
||||||
|
* @param localPath ftp根路径
|
||||||
|
* @return xml信息集合
|
||||||
|
**/
|
||||||
|
public List<Info> getInfoListFromFtp(ChannelSftp connect, String localPath){
|
||||||
|
// 获取当天日期文件存在格式 /files/administrativePenalty/2022/05/30/20220530.zip
|
||||||
|
String currentDate = TimeUtil.getCurrentDateString();
|
||||||
|
String[] currentDateSplit = currentDate.split("-");
|
||||||
|
String currentDatePath = StringUtils.join(currentDateSplit, "/");
|
||||||
|
// 进行路径拼接
|
||||||
|
localPath += currentDatePath;
|
||||||
|
String fileName = currentDate.replaceAll("-","") + SUFFIX;
|
||||||
|
String realPath = localPath + "/" + fileName;
|
||||||
|
logger.info(Util.logStr("ftp文件路径:{}, 文件名:{}, 全路径:{}",localPath, fileName, realPath));
|
||||||
|
if (!FtpUtil.isExist(localPath, fileName, connect)) {
|
||||||
|
throw new CustomerException("ftp上不存在 " + localPath + "/" + fileName + " 文件, 请检查!");
|
||||||
|
}
|
||||||
|
// 临时路径
|
||||||
|
String zipOATempPath = GCONST.getSysFilePath() + WACO_TEMP_PATH + fileName;
|
||||||
|
logger.info(Util.logStr("存放OA临时文件路径:{}", zipOATempPath));
|
||||||
|
if (!FtpUtil.download(localPath, fileName, zipOATempPath, connect)) {
|
||||||
|
logger.error(Util.logStr("从ftp下载文件失败!"));
|
||||||
|
}
|
||||||
|
String tempFolder = GCONST.getSysFilePath() + WACO_TEMP_PATH;
|
||||||
|
// 进行解压
|
||||||
|
CommonUtil.unZip(zipOATempPath,tempFolder);
|
||||||
|
ArrayList<Info> infos = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
getAllInfoByPath(infos, tempFolder, DATA_SUFFIX);
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new CustomerException("获取指定文件夹下的所有xml信息出现异常: " + e.getMessage());
|
||||||
|
}
|
||||||
|
if(CollectionUtils.isEmpty(infos)){
|
||||||
|
throw new CustomerException("获取到xml信息集合为空,请检查!");
|
||||||
|
}
|
||||||
|
return infos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeInfoToOA(int modelId, int secCategory, List<Info> infos) {
|
||||||
|
String whereSql = "select 1 from " + CusInfoToOAUtil.TABLE_NAME_PLACEHOLDER + " where infoId = ?";
|
||||||
|
List<String> ids = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
for (Info info : infos) {
|
||||||
|
Map<String, Object> param = getParamsMapByInfo(secCategory, info);
|
||||||
|
int dataId = CusInfoToOAUtil.execute(modelId, param,
|
||||||
|
whereSql,
|
||||||
|
Collections.singletonList(info.getInfoId()));
|
||||||
|
ids.add(String.valueOf(dataId));
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
logger.error(Util.logStr("写入建模出现异常:[{}]", e.getMessage()));
|
||||||
|
List<List<String>> splitList = CommonUtil.splitList(ids, CommonUtil.SQL_IN_PAGE_SIZE);
|
||||||
|
for (List<String> list : splitList) {
|
||||||
|
if (!CusInfoToOAUtil.deleteModelDataByIds(String.valueOf(modelId), list)) {
|
||||||
|
logger.error(Util.logStr("删除数据失败, 数据集合 : [{}] ", JSONObject.toJSONString(list)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1></h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/23 21:09
|
||||||
|
* @param secCategory
|
||||||
|
* @param info
|
||||||
|
* @return
|
||||||
|
**/
|
||||||
|
public Map<String, Object> getParamsMapByInfo(int secCategory, Info info) throws Exception {
|
||||||
|
Class<? extends Info> clazz = info.getClass();
|
||||||
|
Field[] fields = clazz.getDeclaredFields();
|
||||||
|
HashMap<String, Object> res = new HashMap<>();
|
||||||
|
for (Field field : fields) {
|
||||||
|
field.setAccessible(true);
|
||||||
|
Object value = field.get(info);
|
||||||
|
BodyPath annotation = field.getDeclaredAnnotation(BodyPath.class);
|
||||||
|
if(annotation != null){
|
||||||
|
DocInfo docInfo = new DocInfo();
|
||||||
|
docInfo.setSeccategory(secCategory);
|
||||||
|
docInfo.setDocSubject(Util.null2String(info.getAdminPenaltyTitle()));
|
||||||
|
String body = CommonUtil.readFileByLines(info.getBodyPath());
|
||||||
|
docInfo.setDoccontent(body);
|
||||||
|
DocServiceImpl docService = new DocServiceImpl();
|
||||||
|
int docId = docService.createDocByUser(docInfo, new User(1));
|
||||||
|
res.put(field.getName(), docId);
|
||||||
|
}else {
|
||||||
|
res.put(field.getName(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>递归获取指定文件夹下的所有xml信息</h1>
|
* <h1>递归获取指定文件夹下的所有xml信息</h1>
|
||||||
* @author xuanran.wang
|
* @author xuanran.wang
|
||||||
|
@ -39,6 +158,7 @@ public class WacoDataPushOAService {
|
||||||
}else {
|
}else {
|
||||||
if (childFile.getName().endsWith(suffix)) {
|
if (childFile.getName().endsWith(suffix)) {
|
||||||
Info info = xmlStrToObject(path + File.separator + childFile.getName());
|
Info info = xmlStrToObject(path + File.separator + childFile.getName());
|
||||||
|
info.setInfoId(childFile.getName());
|
||||||
res.add(info);
|
res.add(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package weaver.xuanran.wang.util;
|
package weaver.xuanran.wang.util;
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
import com.jcraft.jsch.*;
|
import com.jcraft.jsch.*;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
@ -18,7 +19,8 @@ import java.util.Vector;
|
||||||
* @Date 2022/11/22 17:25
|
* @Date 2022/11/22 17:25
|
||||||
*/
|
*/
|
||||||
public class FtpUtil {
|
public class FtpUtil {
|
||||||
private final Logger logger = Util.getLogger();
|
private static final Logger logger = Util.getLogger();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>连接ftp</h1>
|
* <h1>连接ftp</h1>
|
||||||
* @author xuanran.wang
|
* @author xuanran.wang
|
||||||
|
@ -29,7 +31,8 @@ public class FtpUtil {
|
||||||
* @param password 密码
|
* @param password 密码
|
||||||
* @return 连接对象
|
* @return 连接对象
|
||||||
**/
|
**/
|
||||||
public ChannelSftp connect(String host, int port, String username, String password) {
|
public static ChannelSftp connect(String host, int port, String username, String password) {
|
||||||
|
logger.info(Util.logStr("--------- stp connect begin host : [{}], port : [{}], username : [{}], password : [{}] ---------", host, port, username, password));
|
||||||
ChannelSftp sftp = null;
|
ChannelSftp sftp = null;
|
||||||
Channel channel=null;
|
Channel channel=null;
|
||||||
Session sshSession=null;
|
Session sshSession=null;
|
||||||
|
@ -42,16 +45,9 @@ public class FtpUtil {
|
||||||
sshConfig.put("StrictHostKeyChecking", "no");
|
sshConfig.put("StrictHostKeyChecking", "no");
|
||||||
sshSession.setConfig(sshConfig);
|
sshSession.setConfig(sshConfig);
|
||||||
sshSession.connect();
|
sshSession.connect();
|
||||||
if(logger.isInfoEnabled()){
|
|
||||||
logger.info("***************** Session connected. **********************");
|
|
||||||
logger.info("***************** Opening Channel. **********************");
|
|
||||||
}
|
|
||||||
channel = sshSession.openChannel("sftp");
|
channel = sshSession.openChannel("sftp");
|
||||||
channel.connect();
|
channel.connect();
|
||||||
sftp = (ChannelSftp) channel;
|
sftp = (ChannelSftp) channel;
|
||||||
if(logger.isInfoEnabled()){
|
|
||||||
logger.info("***************** Connected to " + host + ". **********************");
|
|
||||||
}
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (channel!=null) {
|
if (channel!=null) {
|
||||||
try {
|
try {
|
||||||
|
@ -76,7 +72,7 @@ public class FtpUtil {
|
||||||
* 关闭连接
|
* 关闭连接
|
||||||
* @param sftp
|
* @param sftp
|
||||||
*/
|
*/
|
||||||
public void disconnect(String host, ChannelSftp sftp){
|
public static void disconnect(String host, ChannelSftp sftp){
|
||||||
// 关闭连接
|
// 关闭连接
|
||||||
try {
|
try {
|
||||||
if (null != sftp) {
|
if (null != sftp) {
|
||||||
|
@ -106,7 +102,7 @@ public class FtpUtil {
|
||||||
* @param sftp 连接
|
* @param sftp 连接
|
||||||
* @return 是否存在
|
* @return 是否存在
|
||||||
*/
|
*/
|
||||||
public boolean isExist(String directory, String fileName, ChannelSftp sftp) {
|
public static boolean isExist(String directory, String fileName, ChannelSftp sftp) {
|
||||||
try {
|
try {
|
||||||
Vector<ChannelSftp.LsEntry> v = listFiles(directory, sftp);
|
Vector<ChannelSftp.LsEntry> v = listFiles(directory, sftp);
|
||||||
Iterator<ChannelSftp.LsEntry> it = v.iterator();
|
Iterator<ChannelSftp.LsEntry> it = v.iterator();
|
||||||
|
@ -129,7 +125,7 @@ public class FtpUtil {
|
||||||
* @param uploadFile 要上传的文件
|
* @param uploadFile 要上传的文件
|
||||||
* @param sftp 连接
|
* @param sftp 连接
|
||||||
*/
|
*/
|
||||||
public boolean upload(String directory, String uploadFile, ChannelSftp sftp) {
|
public static boolean upload(String directory, String uploadFile, ChannelSftp sftp) {
|
||||||
boolean successFlg = true;
|
boolean successFlg = true;
|
||||||
try {
|
try {
|
||||||
sftp.cd(directory);
|
sftp.cd(directory);
|
||||||
|
@ -151,25 +147,17 @@ public class FtpUtil {
|
||||||
* @param saveFile 存在本地的路径
|
* @param saveFile 存在本地的路径
|
||||||
* @param sftp 连接
|
* @param sftp 连接
|
||||||
*/
|
*/
|
||||||
public boolean download(String directory, String downloadFile, String saveFile, ChannelSftp sftp) {
|
public static boolean download(String directory, String downloadFile, String saveFile, ChannelSftp sftp) {
|
||||||
boolean successFlg = true;
|
boolean successFlg = true;
|
||||||
try {
|
try {
|
||||||
logger.info("下载目录为 " + directory);
|
|
||||||
sftp.cd(directory);
|
sftp.cd(directory);
|
||||||
File file = new File(saveFile);
|
File file = new File(saveFile);
|
||||||
if(!file.getParentFile().exists()){
|
if(!file.getParentFile().exists()){
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
}
|
}
|
||||||
String pwd = sftp.pwd();
|
|
||||||
logger.info("pwd => " + pwd);
|
|
||||||
logger.info("downloadFile => " + downloadFile);
|
|
||||||
sftp.get(downloadFile, new FileOutputStream(file));
|
sftp.get(downloadFile, new FileOutputStream(file));
|
||||||
if(logger.isInfoEnabled()){
|
|
||||||
logger.info("***************** Finished **********************");
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
successFlg = false;
|
throw new CustomerException("下载文件出现异常: " + e.getMessage());
|
||||||
logger.info("下载文件出现异常 => " + e.getMessage());
|
|
||||||
}
|
}
|
||||||
return successFlg;
|
return successFlg;
|
||||||
}
|
}
|
||||||
|
@ -180,7 +168,7 @@ public class FtpUtil {
|
||||||
* @param deleteFile 要删除的文件
|
* @param deleteFile 要删除的文件
|
||||||
* @param sftp 连接
|
* @param sftp 连接
|
||||||
*/
|
*/
|
||||||
public void delete(String directory, String deleteFile, ChannelSftp sftp) {
|
public static void delete(String directory, String deleteFile, ChannelSftp sftp) {
|
||||||
try {
|
try {
|
||||||
sftp.cd(directory);
|
sftp.cd(directory);
|
||||||
sftp.rm(deleteFile);
|
sftp.rm(deleteFile);
|
||||||
|
@ -205,14 +193,14 @@ public class FtpUtil {
|
||||||
* @return
|
* @return
|
||||||
* @throws SftpException
|
* @throws SftpException
|
||||||
*/
|
*/
|
||||||
public Vector<ChannelSftp.LsEntry> listFiles(String directory, ChannelSftp sftp) throws SftpException {
|
public static Vector<ChannelSftp.LsEntry> listFiles(String directory, ChannelSftp sftp) throws SftpException {
|
||||||
return sftp.ls(directory);
|
return sftp.ls(directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断本地路径是否存在,不存在就创建路径
|
* 判断本地路径是否存在,不存在就创建路径
|
||||||
*/
|
*/
|
||||||
public void makeDirs(String localSavePath) {
|
public static void makeDirs(String localSavePath) {
|
||||||
File localFile = new File(localSavePath);
|
File localFile = new File(localSavePath);
|
||||||
if (!localFile.exists()) {
|
if (!localFile.exists()) {
|
||||||
localFile.mkdirs();
|
localFile.mkdirs();
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
serverName=ecology
|
|
||||||
rootPath=F:\wxr\e9-project-ebu7-dev1\src\main\resources\resources
|
|
||||||
systemFilePath=F:\wxr\e9-project-ebu7-dev1\src\main\resources\file
|
|
||||||
logPath=F:\wxr\e9-project-ebu7-dev1\src\main\resources\log
|
|
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
|
||||||
<beans>
|
|
||||||
<bean id="propertyPlaceholderConfigurer"
|
|
||||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
|
||||||
<property name="locations" value="classpath:application.properties" />
|
|
||||||
</bean>
|
|
||||||
<bean id="basetest" class="basetest.BaseTestConfig">
|
|
||||||
<property name="serverName" value="${serverName}"/>
|
|
||||||
<property name="rootPath" value="${rootPath}"/>
|
|
||||||
<property name="systemFilePath" value="${systemFilePath}"/>
|
|
||||||
<property name="logPath" value="${logPath}"/>
|
|
||||||
</bean>
|
|
||||||
</beans>
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366389">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>唐山银保监分局行政处罚信息公开表(唐银保监罚决字〔2022〕16号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会唐山监管分局</trialCourt>
|
||||||
|
<jurisdictionName>唐山市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>唐银保监罚决字〔2022〕16号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/个人;银行监督/银行类金融机构/六大行</punishmentObjectType>
|
||||||
|
<punishedParties>中国农业银行股份有限公司唐山丰润支行</punishedParties>
|
||||||
|
<punishedPeople>江宁(时任中国农业银行股份有限公司唐山丰润支行行长)</punishedPeople>
|
||||||
|
<lawAccording>《中华人民共和国银行业监督管理法》第四十六条、第四十八条</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/罚款;银行监督/警告</punishmentResult>
|
||||||
|
<punishmentAmount>25万元(不含)---30万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366389/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366391">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>唐山银保监分局行政处罚信息公开表(唐银保监罚决字〔2022〕15号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会唐山监管分局</trialCourt>
|
||||||
|
<jurisdictionName>唐山市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>唐银保监罚决字〔2022〕15号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/银行类金融机构/六大行;银行监督/个人</punishmentObjectType>
|
||||||
|
<punishedParties>中国农业银行股份有限公司唐山广场支行</punishedParties>
|
||||||
|
<punishedPeople>许卿(时任中国农业银行股份有限公司唐山广场支行行长)</punishedPeople>
|
||||||
|
<lawAccording>《中华人民共和国银行业监督管理法》第四十六条、第四十八条</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/警告;银行监督/罚款</punishmentResult>
|
||||||
|
<punishmentAmount>25万元(不含)---30万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366391/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366432">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>唐山银保监分局行政处罚信息公开表(唐银保监罚决字〔2022〕14号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会唐山监管分局</trialCourt>
|
||||||
|
<jurisdictionName>唐山市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>唐银保监罚决字〔2022〕14号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/个人;银行监督/银行类金融机构/六大行</punishmentObjectType>
|
||||||
|
<punishedParties>中国农业银行股份有限公司唐山龙泽路支行</punishedParties>
|
||||||
|
<punishedPeople>吕秀阁(时任中国农业银行股份有限公司唐山龙泽路支行行长)</punishedPeople>
|
||||||
|
<lawAccording>《中华人民共和国银行业监督管理法》第四十六条、第四十八条</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/警告;银行监督/罚款</punishmentResult>
|
||||||
|
<punishmentAmount>35万元(不含)---40万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366432/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366443">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>中国银保监会绍兴监管分局行政处罚信息公开表(绍银保监罚决字〔2022〕8号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会绍兴监管分局</trialCourt>
|
||||||
|
<jurisdictionName>绍兴市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>绍银保监罚决字〔2022〕8号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/银行类金融机构/全国股份制银行</punishmentObjectType>
|
||||||
|
<punishedParties>上海浦东发展银行股份有限公司绍兴分行</punishedParties>
|
||||||
|
<punishedPeople>上海浦东发展银行股份有限公司绍兴分行(胡牧)</punishedPeople>
|
||||||
|
<lawAccording>《中华人民共和国银行业监督管理法》第四十六条第五项</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/罚款</punishmentResult>
|
||||||
|
<punishmentAmount>15万元(不含)---20万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366443/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366448">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>泉州银保监分局行政处罚信息公开表(泉银保监罚决字〔2022〕12号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会泉州监管分局</trialCourt>
|
||||||
|
<jurisdictionName>泉州市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>泉银保监罚决字〔2022〕12号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/银行类金融机构/六大行</punishmentObjectType>
|
||||||
|
<punishedParties>中国工商银行股份有限公司泉州分行</punishedParties>
|
||||||
|
<punishedPeople>中国工商银行股份有限公司泉州分行(郑一鹏)</punishedPeople>
|
||||||
|
<lawAccording>《中国银监会办公厅关于加强银行业金融机构内控管理有效防范柜面业务操作风险的通知》(银监办发〔2015〕97号)第十二条《中国银监会办公厅关于进一步强化内控合规管理防范案件风险的通知》(银监办发〔2017〕10号)第四条、第六条《中国银监会办公厅关于进一步加强网上银行风险防控工作的通知》(银监办发〔2011〕62号)第三条《中华人民共和国银行业监督管理法》第二十一条第三款、第四十六条第(五)项</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/罚款</punishmentResult>
|
||||||
|
<punishmentAmount>25万元(不含)---30万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366448/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366449">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>泉州银保监分局行政处罚信息公开表(泉银保监罚决字〔2022〕11号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会泉州监管分局</trialCourt>
|
||||||
|
<jurisdictionName>泉州市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>泉银保监罚决字〔2022〕11号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/个人;银行监督/银行类金融机构/六大行</punishmentObjectType>
|
||||||
|
<punishedParties>中国工商银行股份有限公司泉州丰泽支行</punishedParties>
|
||||||
|
<punishedPeople>中国工商银行股份有限公司泉州丰泽支行(陈彬莲)</punishedPeople>
|
||||||
|
<lawAccording>《中国银监会办公厅关于银行自助设备管理风险提示的通知》(银监办发〔2014〕124号)第六条《中国银监会办公厅关于加强银行业金融机构内控管理有效防范柜面业务操作风险的通知》(银监办发〔2015〕97号)第十二条《中国银监会办公厅关于加强银行业消费者权益保护解决当前群众关切问题的指导意见》(银监办发〔2016〕25号)第二条《中国银监会办公厅关于进一步强化内控合规管理防范案件风险的通知》(银监办发〔2017〕10号)第四条、第六条《中华人民共和国银行业监督管理法》第二十一条第三款、第四十六条第(五)项、第四十八条第(二)项</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/警告;银行监督/罚款</punishmentResult>
|
||||||
|
<punishmentAmount>45万元(不含)---50万元(含)</punishmentAmount>
|
||||||
|
<bodyPath>./2E058366449/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="2E058366450">
|
||||||
|
<info>
|
||||||
|
<adminPenaltyTitle>泉州银保监分局行政处罚信息公开表(泉银保监罚决字〔2022〕10号)</adminPenaltyTitle>
|
||||||
|
<trialCourt>中国银行保险监督管理委员会泉州监管分局</trialCourt>
|
||||||
|
<jurisdictionName>泉州市</jurisdictionName>
|
||||||
|
<adminPenaltyNumber>泉银保监罚决字〔2022〕10号</adminPenaltyNumber>
|
||||||
|
<industryClassification>金融/银行</industryClassification>
|
||||||
|
<adminPenaltyDate>2022.09.14</adminPenaltyDate>
|
||||||
|
<punishmentObjectType>银行监督/个人;银行监督/银行类金融机构/六大行</punishmentObjectType>
|
||||||
|
<punishedParties>中国工商银行股份有限公司泉州津淮街支行</punishedParties>
|
||||||
|
<punishedPeople>中国工商银行股份有限公司泉州津淮街支行(邱燕芳、黄原英、黄春凤、柯文瑜)</punishedPeople>
|
||||||
|
<lawAccording>《中国银监会办公厅关于加强银行业金融机构内控管理有效防范柜面业务操作风险的通知》(银监办发〔2015〕97号)第十二条《中国银监会办公厅关于加强银行业消费者权益保护解决当前群众关切问题的指导意见》(银监办发〔2016〕25号)第二条第(九)项《中国银监会办公厅关于进一步强化内控合规管理防范案件风险的通知》(银监办发〔2017〕10号)第四条、第六条《中华人民共和国银行业监督管理法》第二十一条第三款、第四十六条第(五)项、第四十八条第(二)项</lawAccording>
|
||||||
|
<punishmentCause>银行监督/违反审慎经营规则</punishmentCause>
|
||||||
|
<punishmentResult>银行监督/罚款;银行监督/警告;银行监督/取消终身任职资格</punishmentResult>
|
||||||
|
<punishmentAmount />
|
||||||
|
<bodyPath>./2E058366450/body.txt</bodyPath>
|
||||||
|
</info>
|
||||||
|
</article>
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -1,11 +1,24 @@
|
||||||
package xuanran.wang.traffic_bank.waco_first;
|
package xuanran.wang.traffic_bank.waco_first;
|
||||||
|
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
import basetest.BaseTest;
|
import basetest.BaseTest;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.DailyRollingFileAppender;
|
||||||
|
import org.apache.log4j.PatternLayout;
|
||||||
|
import org.apache.log4j.Priority;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import weaver.general.GCONST;
|
||||||
|
import weaver.general.TimeUtil;
|
||||||
|
import weaver.xuanran.wang.common.util.CommonUtil;
|
||||||
import weaver.xuanran.wang.traffic_bank.waco_first.entity.Info;
|
import weaver.xuanran.wang.traffic_bank.waco_first.entity.Info;
|
||||||
import weaver.xuanran.wang.traffic_bank.waco_first.service.WacoDataPushOAService;
|
import weaver.xuanran.wang.traffic_bank.waco_first.service.WacoDataPushOAService;
|
||||||
|
import weaver.xuanran.wang.util.FtpUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,16 +37,35 @@ public class WacoFirstTest extends BaseTest {
|
||||||
**/
|
**/
|
||||||
@Test
|
@Test
|
||||||
public void testParseXml() throws Exception {
|
public void testParseXml() throws Exception {
|
||||||
|
|
||||||
ArrayList<Info> infos = new ArrayList<>();
|
ArrayList<Info> infos = new ArrayList<>();
|
||||||
wacoDataPushOAService.getAllInfoByPath(infos, "F:\\wxr\\项目\\交银理财\\威科先行\\20220924","xml");
|
wacoDataPushOAService.getAllInfoByPath(infos, "F:\\wxr\\项目\\交银理财\\威科先行\\20220924","xml");
|
||||||
System.out.println(infos);
|
System.out.println("info " + JSONObject.toJSONString(infos));
|
||||||
for (Info info : infos) {
|
|
||||||
System.out.println("解析的对象 \n : ");
|
|
||||||
System.out.println(JSONObject.toJSONString(info));
|
|
||||||
System.out.println("\n");
|
|
||||||
System.out.println("文件地址 : " + info.getBodyPath());
|
|
||||||
}
|
}
|
||||||
// String name = "./2E058366389/body.txt";
|
|
||||||
// System.out.println(name.replaceAll("/","a"));
|
/**
|
||||||
|
* <h1>测试解析xml</h1>
|
||||||
|
* @author xuanran.wang
|
||||||
|
* @dateTime 2022/11/22 21:22
|
||||||
|
**/
|
||||||
|
@Test
|
||||||
|
public void testUnZipFile() throws Exception {
|
||||||
|
String currentDate = TimeUtil.getCurrentDateString();
|
||||||
|
String WACO_TEMP_PATH = "WACO" + File.separator + "temp" + File.separator;
|
||||||
|
String fileName = currentDate.replaceAll("-","") + ".zip";
|
||||||
|
String zipOATempPath = GCONST.getSysFilePath() + WACO_TEMP_PATH + fileName;
|
||||||
|
String tempFolder = GCONST.getSysFilePath() + WACO_TEMP_PATH;
|
||||||
|
// 进行解压
|
||||||
|
CommonUtil.unZip(zipOATempPath,tempFolder);
|
||||||
|
ArrayList<Info> infos = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
wacoDataPushOAService.getAllInfoByPath(infos, tempFolder, ".xml");
|
||||||
|
}catch (Exception e){
|
||||||
|
throw new CustomerException("获取指定文件夹下的所有xml信息出现异常: " + e.getMessage());
|
||||||
|
}
|
||||||
|
if(CollectionUtils.isEmpty(infos)){
|
||||||
|
throw new CustomerException("获取到xml信息集合为空,请检查!");
|
||||||
|
}
|
||||||
|
System.out.println("infos : \n " + JSONObject.toJSONString(infos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue