冷热区数据分为冷区一张表热区一张表存储

web_backend_develope
chenlw 9 years ago
parent 86436a12b8
commit 9dd1b0f019

@ -0,0 +1,357 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
"http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
<mapper namespace="com.platform.dao.IHotDataInfoDao">
<resultMap id="getEntityByText" type="com.platform.entities.DataInfoEntity">
<id property="id" column="id"/>
<result property="regionalismCode" column="regionalism_code"/>
<result property="cityName" column="city_name"/>
<result property="districtName" column="district_name"/>
<result property="systemCode" column="system_code"/>
<result property="systemName" column="system_name"/>
<result property="dataType" column="data_type"/>
<result property="dataVersion" column="data_version"/>
<result property="submittedBatch" column="submitted_batch"/>
<result property="dataPath" column="data_path"/>
<result property="charset" column="data_charset"/>
<result property="collectingTime" column="collection_time"/>
<result property="collectorContacts" column="collector_contacts"/>
<result property="collectorName" column="collector_name"/>
<result property="extractStatus" column="extract_status"/>
<result property="year" column="data_year"/>
<result property="startYear" column="start_year"/>
<result property="endYear" column="end_year"/>
<result property="volumeIp" column="volume_ip"/>
<result property="volumePath" column="volume_path"/>
<result property="mark" column="mark"/>
<result property="volumePath" column="volume_path"/>
<result property="dataBaseType" column="data_base_type"/>
<result property="execResultLast" column="checkout_indicate_last"/>
<result property="payResultLast" column="checkout_pay_last"/>
<result property="standardExtractStatus" column="standard_extract_status"/>
<result property="checkoutFlag" column="checkout_flag"/>
<result property="mark" column="mark"/>
</resultMap>
<sql id="conditionsFilters">
<if test="dataType!=null">
AND data_details.data_type=#{dataType}
</if>
<if test="mark!=null and mark != ''">
AND data_details.mark=#{mark}
</if>
<if test="submittedBatch!=null">
AND
data_details.submitted_batch=#{submittedBatch}
</if>
<if test="cityName!=null">
AND data_details.city_name=#{cityName}
</if>
<if test="districtName!=null">
AND
data_details.district_name=#{districtName}
</if>
<if test="dataVersion !=null">
AND data_details.data_version=#{dataVersion}
</if>
<if test="systemName !=null">
AND data_details.system_name=#{systemName}
</if>
<if test="dataYear !=null">
AND data_details.data_year=#{dataYear}
</if>
<if test="dataBaseType !=null and dataBaseType !=''">
AND data_details.data_base_type=#{dataBaseType}
</if>
<if test="array !=null and array.size() != 0">
<foreach collection="array" item="item" index="index">
AND CONCAT(regionalism_code,system_code,city_name,district_name,system_name,data_year) LIKE CONCAT('%',CONCAT('${item}','%'))
</foreach>
</if>
</sql>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="getLimitedDataInfoEntities" parameterType="com.platform.form.PagerOptions"
resultMap="getEntityByText">
SELECT
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,extract_status,data_year,start_year,end_year,volume_ip,volume_path,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
<where>
<include refid="conditionsFilters" />
<choose>
<when test="offset > 0">
and data_details.id>= #{offset}
</when>
<otherwise>
and data_details.id>=0
</otherwise>
</choose>
</where>
ORDER BY data_details.id
<if test="limit > 0">
LIMIT #{limit}
</if>
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="getLimitedDataInfoByPage" parameterType="com.platform.form.PagerOptions"
resultMap="getEntityByText">
SELECT
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,extract_status,data_year,start_year,end_year,volume_ip,volume_path,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
<where>
<include refid="conditionsFilters" />
</where>
ORDER BY data_details.id
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="findAll" resultMap="getEntityByText">
SELECT
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,extract_status,data_year,start_year,end_year,volume_ip,volume_path,data_base_type,standard_extract_status,checkout_flag,mark
FROM data_details
ORDER BY data_details.id
</select>
<select id="countByDataPath" resultType="java.lang.Integer" parameterType="com.platform.entities.DataInfoEntity">
SELECT count(id)
FROM data_info
where data_path=#{dataPath} and remove='0'
</select>
<!-- 获取数据符合筛选条件的全部记录信息 -->
<select id="findById" resultMap="getEntityByText" parameterType="java.lang.Integer">
SELECT
id,regionalism_code,city_name,district_name,system_code,system_name,data_type,data_version,submitted_batch,data_path,data_charset,collection_time,collector_name,collector_contacts,extract_status,data_year,start_year,end_year,volume_ip,volume_path,data_base_type,standard_extract_status,checkout_indicate_last,checkout_pay_last,checkout_flag,mark
FROM data_details
WHERE id =#{id}
</select>
<!-- 获取数据 条件:采集时间 -->
<select id="findByParam" resultType="com.platform.entities.DataInfoEntity" parameterType="com.platform.entities.DataInfoEntity">
SELECT
regionalism_code regionalismCode,system_code systemCode,checkout_indicate execResult,checkout_pay payResult
FROM data_details
WHERE
collection_time > #{collectingTime}
ORDER BY data_details.id
</select>
<!-- 获取数据符合筛选条件的总记录条数 -->
<select id="getLimitedDataCount" resultType="java.lang.Integer"
parameterType="com.platform.form.PagerOptions">
SELECT COUNT(id) FROM data_details
<where>
<include refid="conditionsFilters" />
</where>
</select>
<!-- 获取数据查询的起始di -->
<select id="getLimitedBeginId" resultType="java.lang.Integer"
parameterType="com.platform.form.PagerOptions">
SELECT MAX(idx) FROM (SELECT id idx FROM data_details
ORDER BY id LIMIT 0,#{totalLimit}) AS TEMP
</select>
<insert id="save" parameterType="com.platform.entities.DataInfoEntity">
INSERT INTO
data_info(
<trim suffixOverrides=",">
<if test="regionalismCode != null and regionalismCode != ''">
regionalism_code,
</if>
<if test="systemCode != null">
system_code,
</if>
<if test="dataType != null and dataType != ''">
data_type,
</if>
<if test="dataVersion != null">
data_version,
</if>
<if test="submittedBatch != null and submittedBatch != ''">
submitted_batch,
</if>
<if test="dataPath != null and dataPath != ''">
data_path,
</if>
<if test="collectingTime != null">
collection_time,
</if>
<if test="collectorName != null and collectorName != ''">
collector_name,
</if>
<if test="collectorContacts != null and collectorContacts != ''">
collector_contacts,
</if>
<if test="charset != null and charset != ''">
data_charset,
</if>
<if test="year != null and year != ''">
data_year,
</if>
<if test="startYear != null and startYear != ''">
start_year,
</if>
<if test="endYear != null and endYear != ''">
end_year,
</if>
<if test="volumeIp != null and volumeIp != ''">
volume_ip,
</if>
<if test="volumePath != null and volumePath != ''">
volume_path,
</if>
<if test="extractStatus > 0">
extract_status,
</if>
<if test="payResult != null and payResult != ''">
checkout_pay,
</if>
<if test="execResult != null and execResult != ''">
checkout_indicate,
</if>
<if test="startMonth != null and startMonth != ''">
start_month,
</if>
<if test="endMonth != null and endMonth != ''">
end_month,
</if>
<if test="dataBaseType != null and dataBaseType != ''">
data_base_type,
</if>
</trim>
)
VALUES(
<trim suffixOverrides=",">
<if test="regionalismCode != null and regionalismCode != ''">
#{regionalismCode},
</if>
<if test="systemCode != null">
#{systemCode},
</if>
<if test="dataType != null and dataType != ''">
#{dataType},
</if>
<if test="dataVersion != null">
#{dataVersion},
</if>
<if test="submittedBatch != null and submittedBatch != ''">
#{submittedBatch},
</if>
<if test="dataPath != null and dataPath != ''">
#{dataPath},
</if>
<if test="collectingTime != null">
#{collectingTime},
</if>
<if test="collectorName != null and collectorName != ''">
#{collectorName},
</if>
<if test="collectorContacts != null and collectorContacts != ''">
#{collectorContacts},
</if>
<if test="charset != null and charset != ''">
#{charset},
</if>
<if test="year != null and year != ''">
#{year},
</if>
<if test="startYear != null and startYear != ''">
#{startYear},
</if>
<if test="endYear != null and endYear != ''">
#{endYear},
</if>
<if test="volumeIp != null and volumeIp != ''">
#{volumeIp},
</if>
<if test="volumePath != null and volumePath != ''">
#{volumePath},
</if>
<if test="extractStatus > 0">
#{extractStatus},
</if>
<if test="payResult != null and payResult != ''">
#{payResult},
</if>
<if test="execResult != null and execResult != ''">
#{execResult},
</if>
<if test="startMonth != null and startMonth != ''">
#{startMonth},
</if>
<if test="endMonth != null and endMonth != ''">
#{endMonth},
</if>
<if test="dataBaseType != null and dataBaseType != ''">
#{dataBaseType},
</if>
</trim>
)
</insert>
<select id="getIdIsExist" parameterType="java.util.List" resultType="java.lang.String">
select data_path
from data_info
where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
and remove ='0'
</select>
<update id="removes" parameterType="java.util.List">
UPDATE
data_info
set remove = '1'
where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
and remove ='0'
</update>
<update id="updateExtract" parameterType="com.platform.entities.DataInfoEntity">
UPDATE
data_info
set extract_status = #{extractStatus}
<where>
id = #{id}
AND remove ='0'
</where>
</update>
<update id="update" parameterType="com.platform.entities.DataInfoEntity">
UPDATE
data_info
<set>
<trim suffixOverrides=",">
<if test="dataPath != null and dataPath != ''">
data_path= #{dataPath},
</if>
<if test="extractStatus != null and extractStatus != ''">
extract_status= #{extractStatus},
</if>
<if test="payResultLast != null and payResultLast != ''">
checkout_pay_last= #{payResultLast},
</if>
<if test="execResultLast != null and execResultLast != ''">
checkout_indicate_last= #{execResultLast},
</if>
<if test="checkoutFlag != null and checkoutFlag != ''">
checkout_flag= #{checkoutFlag},
</if>
</trim>
</set>
<where>
id = #{id}
AND remove ='0'
</where>
</update>
</mapper>

@ -203,6 +203,17 @@ PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
ORDER BY a.area_code,a.sys_code,d.data_version ORDER BY a.area_code,a.sys_code,d.data_version
</select> </select>
<select id="findHotDataByCity" resultType="com.platform.entities.CheckoutEntity" parameterType="com.platform.entities.PreDataInfo">
SELECT
<include refid="find_city_Column_List" />
FROM standard_data_details a left join collection_data_description l on a.area_code=l.regionalism_code AND a.sys_code=l.sys_code
left join hot_data_details d on a.area_code=d.regionalism_code AND a.sys_code=d.system_code
<where>
a.is_collection='是' AND a.city_name=#{cityName}
</where>
ORDER BY a.area_code,a.sys_code,d.data_version
</select>
<!-- 批量插入 --> <!-- 批量插入 -->
<select id="insertBatch" parameterType="java.util.List"> <select id="insertBatch" parameterType="java.util.List">
INSERT INTO default_data_description ( <include refid="Batch_Column_List" /> ) INSERT INTO default_data_description ( <include refid="Batch_Column_List" /> )

@ -0,0 +1,39 @@
package com.platform.dao;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.platform.entities.DataInfoEntity;
import com.platform.form.PagerOptions;
@Repository(value = "hotDataInfoDao")
public interface IHotDataInfoDao {
int getLimitedDataCount(PagerOptions pagerOptions);
int getLimitedBeginId(PagerOptions pagerOptions);
List<DataInfoEntity> getLimitedDataInfoEntities(PagerOptions pagerOptions);
List<DataInfoEntity> getLimitedDataInfoByPage(PagerOptions pagerOptions);
List<String> getIdIsExist(List<Integer> list)throws Exception;
List<DataInfoEntity> findAll()throws Exception;
DataInfoEntity findById(int id)throws Exception;
List<DataInfoEntity> findByParam(DataInfoEntity data)throws Exception;
int countByDataPath(DataInfoEntity data)throws Exception;
int removes(List<Integer> list)throws Exception;
int save(DataInfoEntity data) throws Exception;
int update(DataInfoEntity data) throws Exception;
int updateExtract(DataInfoEntity data) throws Exception;
}

@ -25,6 +25,8 @@ public interface PreDataInfoDao {
List<CheckoutEntity> findByCity(PreDataInfo pre)throws Exception; List<CheckoutEntity> findByCity(PreDataInfo pre)throws Exception;
List<CheckoutEntity> findHotDataByCity(PreDataInfo pre)throws Exception;
void insertBatch(List<PreDataInfo> list) throws Exception; void insertBatch(List<PreDataInfo> list) throws Exception;
int update(PreDataInfo data) throws Exception; int update(PreDataInfo data) throws Exception;

@ -68,6 +68,7 @@ public class OracleConnector {
.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, .createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE); ResultSet.CONCUR_UPDATABLE);
resultSet = statement.executeQuery(sql); resultSet = statement.executeQuery(sql);
FileOperateHelper FileOperateHelper
.fileWrite(filePath+".log", sql+ "\r\n"+ "OK \r\n"); .fileWrite(filePath+".log", sql+ "\r\n"+ "OK \r\n");
} catch (SQLException e) { } catch (SQLException e) {

@ -130,45 +130,70 @@ public class CheckoutServiceImpl implements ICheckoutService {
Map<String,CheckoutEntity> resul = new HashMap<String,CheckoutEntity>(); Map<String,CheckoutEntity> resul = new HashMap<String,CheckoutEntity>();
Map<String,CheckoutEntity> nodata = new HashMap<String,CheckoutEntity>(); Map<String,CheckoutEntity> nodata = new HashMap<String,CheckoutEntity>();
//冷区数据
List<CheckoutEntity> list = preDataInfoDao.findByCity(cksql); List<CheckoutEntity> list = preDataInfoDao.findByCity(cksql);
int length = list.size(); Map<String, List<CheckoutEntity>> coolDataMap = new HashMap<String, List<CheckoutEntity>>();
// 对所有数据分析 for (CheckoutEntity checkoutEntity : list) {
for (int i = 0; i < length; i++) { if(null == checkoutEntity.getCollectingTime()
CheckoutEntity preDataInfo = list.get(i); || c2.getTime().after(DateForm.string2DateByDay(checkoutEntity.getCollectingTime()))){
preDataInfo.setId(i); continue;
preDataInfo.setCollUpdate(isY(preDataInfo.getCollUpdate())); }
if (preDataInfo.getDataVersion() < 1) { List<CheckoutEntity> tmpList = coolDataMap.get(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode());
preDataInfo.setCollection("否"); if (null == tmpList) {
} tmpList = new ArrayList<CheckoutEntity>();
if (null != preDataInfo.getCollectingTime()) { coolDataMap.put(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode(),tmpList);
if (c2.getTime().before(DateForm.string2DateByDay(preDataInfo.getCollectingTime()))) { }
resul.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode()+"_"+preDataInfo.getDataId(), preDataInfo); // 带数据的 系统
tmpList.add(checkoutEntity);
}
//热区数据
List<CheckoutEntity> hotDatalist = preDataInfoDao.findHotDataByCity(cksql);
for (CheckoutEntity checkoutEntity : hotDatalist) {
if (null != checkoutEntity.getCollectingTime()) {
//一段时间内的数据(半年)
if (c2.getTime().before(DateForm.string2DateByDay(checkoutEntity.getCollectingTime()))) {
// 带数据的 系统
resul.put(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode()+"_"+checkoutEntity.getDataVersion(), checkoutEntity);
} }
// 半年之前的数据
else { else {
preDataInfo.setDataId(0); checkoutEntity.setDataId(0);
preDataInfo.setPath(null); checkoutEntity.setPath(null);
preDataInfo.setDataVersion(0); checkoutEntity.setDataVersion(0);
preDataInfo.setExecResult(null); checkoutEntity.setExecResult(null);
preDataInfo.setExecResultLast(null); checkoutEntity.setExecResultLast(null);
preDataInfo.setPayResult(null); checkoutEntity.setPayResult(null);
preDataInfo.setPayResultLast(null); checkoutEntity.setPayResultLast(null);
preDataInfo.setCheckoutFlag(null); checkoutEntity.setCheckoutFlag(null);
preDataInfo.setCollection("否"); checkoutEntity.setCollection("否");
//data_id 已经为 0 (数据不存在时) nodata.put(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode()+"_"+checkoutEntity.getDataVersion(), checkoutEntity);
nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo);
} }
} }
else { else {
nodata.put(preDataInfo.getAreaCode()+"_"+preDataInfo.getSysCode(), preDataInfo); // DataVersion = 0
checkoutEntity.setCollection("否");
nodata.put(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode()+"_"+checkoutEntity.getDataVersion(), checkoutEntity);
} }
} }
List<String> keyList = new ArrayList<String>(); // 将 nodata中的 无热区数据的 系统,在冷区中查询,如果有的话,将冷区数据放入 resul中 而没有数据的 系统 的 key放入 keyList
List<String> noDataKeyList = new ArrayList<String>();
for ( String noDataKey : nodata.keySet()) {
CheckoutEntity checkData = nodata.get(noDataKey);
String coolDataMapKey = checkData.getAreaCode()+"_"+checkData.getSysCode();
if (coolDataMap.containsKey(coolDataMapKey)) {
List<CheckoutEntity> coolDatas = coolDataMap.get(coolDataMapKey);
for (CheckoutEntity checkoutEntity : coolDatas) {
resul.put(checkoutEntity.getAreaCode()+"_"+checkoutEntity.getSysCode()+"_"+ checkoutEntity.getDataVersion(), checkoutEntity);
}
}
else {
//记录 不存在数据 在 nodata的 key值 //记录 不存在数据 在 nodata的 key值
for (String nodatakey : nodata.keySet()) { noDataKeyList.add(noDataKey);
keyList.add(nodatakey); }
} }
List<CheckoutEntity> resultList = new ArrayList<CheckoutEntity>(); List<CheckoutEntity> resultList = new ArrayList<CheckoutEntity>();
//带数据的
for (String key : resul.keySet()) { for (String key : resul.keySet()) {
//如果有 校验失败的结果则 为否 //如果有 校验失败的结果则 为否
CheckoutEntity tmp = resul.get(key); CheckoutEntity tmp = resul.get(key);
@ -181,14 +206,14 @@ public class CheckoutServiceImpl implements ICheckoutService {
} }
} }
resultList.add(resul.get(key)); resultList.add(resul.get(key));
for (String nodatakey : keyList) {
if (key.contains(nodatakey)) {
nodata.remove(nodatakey);
}
} }
//无数据的 系统
for (String nodatakey : noDataKeyList) {
if (nodata.keySet().contains(nodatakey)) {
CheckoutEntity checkoutEntity = nodata.get(nodatakey);
checkoutEntity.setCollection("否");
resultList.add(checkoutEntity);
} }
for (String key : nodata.keySet()) {
resultList.add(nodata.get(key));
} }
return resultList; return resultList;
} }

@ -15,6 +15,7 @@ import org.springframework.ui.ModelMap;
import com.base.Custom4exception; import com.base.Custom4exception;
import com.base.CustomException; import com.base.CustomException;
import com.platform.dao.DataInfoDao; import com.platform.dao.DataInfoDao;
import com.platform.dao.IHotDataInfoDao;
import com.platform.entities.DataInfoEntity; import com.platform.entities.DataInfoEntity;
import com.platform.form.PagerOptions; import com.platform.form.PagerOptions;
import com.platform.http.gfs.RemoveData; import com.platform.http.gfs.RemoveData;
@ -30,6 +31,9 @@ public class DataInfoServiceImp implements DataInfoService {
@Resource(name = "dataInfoDao") @Resource(name = "dataInfoDao")
private DataInfoDao dfdDao; private DataInfoDao dfdDao;
@Resource(name = "hotDataInfoDao")
private IHotDataInfoDao hotDataInfoDao;
private RemoveData removedata = new RemoveData(); private RemoveData removedata = new RemoveData();
public void setDfdDao(DataInfoDao dfdDao) { public void setDfdDao(DataInfoDao dfdDao) {
@ -92,7 +96,12 @@ public class DataInfoServiceImp implements DataInfoService {
} }
List<DataInfoEntity> result = null; List<DataInfoEntity> result = null;
try{ try{
if ("1".equals(pagerOptions.getMark())) {
result = dfdDao.getLimitedDataInfoByPage(pagerOptions); result = dfdDao.getLimitedDataInfoByPage(pagerOptions);
}
else {
result = hotDataInfoDao.getLimitedDataInfoByPage(pagerOptions);
}
}catch(Exception e){ }catch(Exception e){
log.error(e.getMessage()); log.error(e.getMessage());
} }

@ -39,7 +39,7 @@ public class ThreadCheckoutStandardOracle extends Thread {
private DataInfoDao dataInfoDao; private DataInfoDao dataInfoDao;
public ThreadCheckoutStandardOracle(DataInfoDao dataInfoDao) { public ThreadCheckoutStandardOracle(DataInfoDao dataInfoDao) {
this.setDaemon(true);
this.client = new SimpleKubeClient(); this.client = new SimpleKubeClient();
this.dataInfoDao = dataInfoDao; this.dataInfoDao = dataInfoDao;
} }

@ -20,6 +20,7 @@ public class ThreadExtractOracle extends Thread {
* @param OracleExtract * @param OracleExtract
*/ */
public ThreadExtractOracle(oracleForm form, IOracleExtractService OracleExtract) { public ThreadExtractOracle(oracleForm form, IOracleExtractService OracleExtract) {
this.setDaemon(true);
this.OracleExtract = OracleExtract; this.OracleExtract = OracleExtract;
this.form = form; this.form = form;
} }

@ -30,6 +30,7 @@ public class ThreadExtractStandardOracle extends Thread {
* @param OracleExtract * @param OracleExtract
*/ */
public ThreadExtractStandardOracle(oracleForm form, IOracleExtractService OracleExtract) { public ThreadExtractStandardOracle(oracleForm form, IOracleExtractService OracleExtract) {
this.setDaemon(true);
this.OracleExtract = OracleExtract; this.OracleExtract = OracleExtract;
this.form = form; this.form = form;
} }

@ -43,6 +43,7 @@ public class ThreadExtractStandardSqlServer extends Thread{
private DataInfoDao dataInfoDao; private DataInfoDao dataInfoDao;
public ThreadExtractStandardSqlServer(GatherOracleInfo oracleConnect, List<CheckoutEntity> Extractlist, DataInfoDao dataInfoDao) { public ThreadExtractStandardSqlServer(GatherOracleInfo oracleConnect, List<CheckoutEntity> Extractlist, DataInfoDao dataInfoDao) {
this.setDaemon(true);
this.oracleConnect = oracleConnect; this.oracleConnect = oracleConnect;
this.Extractlist = Extractlist; this.Extractlist = Extractlist;
this.dataInfoDao = dataInfoDao; this.dataInfoDao = dataInfoDao;

@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
import com.base.TaskOperateData; import com.base.TaskOperateData;
import com.platform.dao.DataInfoDao; import com.platform.dao.DataInfoDao;
import com.platform.dao.DataInfoMoveTmpDao; import com.platform.dao.DataInfoMoveTmpDao;
import com.platform.dao.IHotDataInfoDao;
import com.platform.entities.DataInfoEntity; import com.platform.entities.DataInfoEntity;
import com.platform.entities.DataInfoEntityMoveTmp; import com.platform.entities.DataInfoEntityMoveTmp;
import com.platform.glusterfs.CheckoutMD5; import com.platform.glusterfs.CheckoutMD5;
@ -36,8 +37,8 @@ public class ThreadMoveData{
public final static Logger log = Logger.getLogger(ThreadMoveData.class); public final static Logger log = Logger.getLogger(ThreadMoveData.class);
@Resource(name = "dataInfoDao") @Resource(name = "hotDataInfoDao")
private DataInfoDao dataInfoDao; private IHotDataInfoDao hotDataInfoDao;
/** /**
* *
@ -336,7 +337,7 @@ public class ThreadMoveData{
data.setPayResult(dataMove.getPayResult()); data.setPayResult(dataMove.getPayResult());
data.setExecResult(dataMove.getExecResult()); data.setExecResult(dataMove.getExecResult());
data.setId(0); data.setId(0);
dataInfoDao.save(data); hotDataInfoDao.save(data);
} }
else { else {
dataMove.setCompleteStatus("2"); dataMove.setCompleteStatus("2");
@ -384,8 +385,8 @@ public class ThreadMoveData{
data.setExecResult(dataMove.getExecResult()); data.setExecResult(dataMove.getExecResult());
data.setId(0); data.setId(0);
try { try {
if (dataInfoDao.countByDataPath(data) == 0) { if (hotDataInfoDao.countByDataPath(data) == 0) {
dataInfoDao.save(data); hotDataInfoDao.save(data);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e); log.error(e);

@ -18,6 +18,7 @@ public class TreadMoveData2Start extends Thread{
private IMoveDataService dataInfoMove= new MoveDataServiceImpl(); private IMoveDataService dataInfoMove= new MoveDataServiceImpl();
public TreadMoveData2Start() { public TreadMoveData2Start() {
this.setDaemon(true);
} }
@Override @Override

@ -36,7 +36,7 @@ public class Constant {
+ "#这个必须要,否则会在文件名中有空格时出错\nINIT_PATH=\".\";\nergodic \\$1\n"; + "#这个必须要,否则会在文件名中有空格时出错\nINIT_PATH=\".\";\nergodic \\$1\n";
/** /**
* volume 线 *
*/ */
public final static int moveFileMaxNum = 1; public final static int moveFileMaxNum = 1;

Loading…
Cancel
Save