管道基础大数据平台系统开发-【后端】-Server
12
13693261870
2022-11-21 07a68b8d93aa059968a9709f2c81e6625338032c
src/main/java/com/lf/server/service/show/ExportService.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.data.DownloadEntity;
import com.lf.server.entity.show.ExportEntity;
import com.lf.server.entity.sys.UserEntity;
@@ -52,7 +53,7 @@
        }
        ResponseMsg<String> msg = JSON.parseObject(str, ResponseMsg.class);
        if (msg == null || msg.getCode() != 200) {
        if (msg == null || msg.getCode() != StaticData.TWO_HUNDRED) {
            return null;
        }
@@ -72,12 +73,12 @@
     * 获取Map数据
     */
    private Map<String, Object> getMapData(ExportEntity entity) {
        Map<String, Object> map = new HashMap<String, Object>();
        Map<String, Object> map = new HashMap<String, Object>(3);
        Field[] fields = entity.getClass().getDeclaredFields();
        for (Field field : fields) {
            try {
                if (field.getName() == "serialVersionUID") {
                if ("serialVersionUID".equals(field.getName())) {
                    continue;
                }
@@ -100,6 +101,7 @@
        DownloadEntity de = new DownloadEntity();
        de.setName(FileHelper.getFileName(file));
        de.setType(2);
        de.setSizes(FileHelper.sizeToMb(new File(file).length()));
        de.setDepid(ue.getDepid());
        de.setDcount(0);
        // de.setPwd(null)
@@ -111,4 +113,14 @@
        return de;
    }
    /**
     * 获取下载文件路径
     *
     * @param de 下载实体类
     * @return 下载文件路径
     */
    public String getDownloadFilePath(DownloadEntity de) {
        return pathHelper.getConfig().getDownloadPath() + File.separator + de.getUrl();
    }
}