xc
2020-12-07 fa06bd64705ccc0e95eaf8818e583ba931118503
日志完整
2 files deleted
3 files modified
1 files added
159 ■■■■ changed files
src/main/java/com/hbbh/adapter/covert/PointConvert.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/dto/SMSDto.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/enums/StockoutBillEnum.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/manager/impl/DataSourceImpl.java 23 ●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/utils/EmptyUtils.java 55 ●●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/utils/SearchConditionUtil.java 1 ●●●● patch | view | raw | blame | history
src/main/java/com/hbbh/adapter/covert/PointConvert.java
@@ -1,7 +1,6 @@
package com.hbbh.adapter.covert;
import com.google.common.collect.Lists;
import com.hbbh.adapter.dto.SMSDto;
import com.hbbh.adapter.pojo.Point;
import com.hbbh.adapter.pojo.golden.*;
import com.hbbh.adapter.utils.DateUtil;
@@ -13,17 +12,6 @@
import java.util.List;
public class PointConvert {
    public static SMSDto targetToSMSDto(MinPoint minPoint){
        SMSDto sMSDto = new SMSDto();
        sMSDto.setId(minPoint.getId());
        sMSDto.setTagName(minPoint.getTagName());
        sMSDto.setDesc(minPoint.getDesc());
        sMSDto.setValueType(minPoint.getValueType());
        sMSDto.setTagType(minPoint.getTagType());
        //sMSDto.setTimestamp();
        return sMSDto;
    }
    public static List<Point> fullpointsToPointEntity(List<FullPoint> fullPoints) {
src/main/java/com/hbbh/adapter/dto/SMSDto.java
File was deleted
src/main/java/com/hbbh/adapter/enums/StockoutBillEnum.java
File was deleted
src/main/java/com/hbbh/adapter/manager/impl/DataSourceImpl.java
@@ -8,6 +8,7 @@
import com.hbbh.adapter.manager.DataSource;
import com.hbbh.adapter.pojo.Point;
import com.hbbh.adapter.pojo.golden.*;
import com.hbbh.adapter.utils.EmptyUtils;
import com.hbbh.adapter.utils.SearchConditionUtil;
import com.rtdb.enums.DataSort;
import com.rtdb.model.Entity;
@@ -135,8 +136,25 @@
    public void insert(String flag, List<Point> point) {
        log.info("golden 中 表 ----> {}  正在构建数据...");
        if (EmptyUtils.isEmpty(flag)) {
            log.info("golden 中 未获取到表信息 -->{}", flag);
            return;
        }
        if (point.size()==0) {
            log.info("golden 中 表 ----> {}  没有数据", flag);
            return;
        }
        log.info("golden 中 表 ----> {}  正在构建数据...",flag);
        TableEnum byType = TableEnum.getByType(flag);
        //TODO:部分表未介入
        if (EmptyUtils.isEmpty(byType)){
            log.info("golden 中 表 ----> {}  暂未介入adapter程序中", flag);
            return;
        }
        switch (byType) {
            case SMS:
@@ -169,9 +187,8 @@
                    ktnz2CPlcDao.saveAndFlush(data);
                });
                break;
            default:
                //TODO:剩下表构建
        }
        log.info("golden 中 表 ----> {}  构建数据成功",flag);
    }
}
src/main/java/com/hbbh/adapter/utils/EmptyUtils.java
New file
@@ -0,0 +1,55 @@
package com.hbbh.adapter.utils;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Map;
/**
 * <pre>
 *     author: Blankj
 *     blog  : http://blankj.com
 *     time  : 2016/9/28
 *     desc  : 判空相关工具类
 * </pre>
 */
public class EmptyUtils {
    private EmptyUtils() {
        throw new UnsupportedOperationException("u can't instantiate me...");
    }
    /**
     * 判断对象是否为空
     *
     * @param obj 对象
     * @return {@code true}: 为空<br>{@code false}: 不为空
     */
    public static boolean isEmpty(Object obj) {
        if (obj == null) {
            return true;
        }
        if (obj instanceof String && obj.toString().length() == 0) {
            return true;
        }
        if (obj.getClass().isArray() && Array.getLength(obj) == 0) {
            return true;
        }
        if (obj instanceof Collection && ((Collection) obj).isEmpty()) {
            return true;
        }
        if (obj instanceof Map && ((Map) obj).isEmpty()) {
            return true;
        }
        return false;
    }
    /**
     * 判断对象是否非空
     *
     * @param obj 对象
     * @return {@code true}: 非空<br>{@code false}: 空
     */
    public static boolean isNotEmpty(Object obj) {
        return !isEmpty(obj);
    }
}
src/main/java/com/hbbh/adapter/utils/SearchConditionUtil.java
@@ -1,6 +1,5 @@
package com.hbbh.adapter.utils;
import com.hbbh.adapter.dto.SMSDto;
import com.rtdb.model.SearchCondition;
import com.rtdb.model.SearchConditionTotal;