| | |
| | | import com.example.server.progressTrack.dao.ImportRecordDao; |
| | | import com.example.server.progressTrack.model.ExportRecord; |
| | | import com.example.server.progressTrack.model.ImportRecord; |
| | | import com.example.server.utils.CacheUtils; |
| | | import com.example.server.utils.UserAndSiteUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | String configPath = configPath2; |
| | | String directoryPath = localPath + "life-protection"; |
| | | |
| | | String mySite = (String) CacheUtils.get("site", "site"); |
| | | String mySite = (String) UserAndSiteUtils.get("site", "site"); |
| | | |
| | | // 弹出文件选择框,让用户选择保存ZIP文件的路径 |
| | | String outputZipPath = showSaveFileDialog(mySite + "同步数据包.zip"); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | String outputZipPath = showSaveFileDialog(dateFormat.format(new Date()) + mySite + "同步数据包.zip"); |
| | | |
| | | if (outputZipPath == null) { |
| | | massage[0] = "用户取消保存,程序退出。"+ new Date(); |
| | | massage[0] = "用户取消保存,程序退出。" + new Date(); |
| | | tips.setText(tips.getText() + massage[0]); |
| | | } else { |
| | | final WaitUtil waitUtil = new WaitUtil(imgPath, "数据正在导入,请稍候"); |
| | |
| | | Path sourceDir = Paths.get(UnzipPath + "life-protection"); |
| | | Path targetDir = Paths.get(localPath + "life-protection"); |
| | | |
| | | if (!Files.exists(sourceDir)) { |
| | | Files.createDirectories(sourceDir); |
| | | } |
| | | // 如果目标文件夹不存在,创建它 |
| | | if (!Files.exists(targetDir)) { |
| | | Files.createDirectories(targetDir); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | String mySite = (String) CacheUtils.get("site", "site"); |
| | | String mySite = (String) UserAndSiteUtils.get("site", "site"); |
| | | String otherSite = properties.get("site").toString(); |
| | | if ("工作组".equals(mySite)) { |
| | | syncTable("dj_jdgz_network_level1"); |
| | | syncTable("dj_jdgz_network_level1_list"); |
| | | syncTable("dj_jdgz_network_level2"); |
| | | syncTable("dj_jdgz_network_level2_list"); |
| | | syncTable("dj_jdgz_handover"); |
| | | syncTable("dj_jdgz_network_level3"); |
| | | syncTable("dj_jdgz_network_level3_list"); |
| | |
| | | syncTable("dj_jdgz_ship"); |
| | | } else if (mySite.equals("TD")) { |
| | | if (otherSite.equals("TD")) { |
| | | syncTable("dj_jdgz_network_level1"); |
| | | syncTable("dj_jdgz_network_level1_list"); |
| | | syncTable("dj_jdgz_network_level2"); |
| | | syncTable("dj_jdgz_network_level2_list"); |
| | | syncTable("dj_jdgz_network_level3"); |
| | | syncTable("dj_jdgz_network_level3_list"); |
| | | syncTable("dj_jdgz_track_record"); |
| | |
| | | syncTable("dj_jdgz_network_level3_list"); |
| | | syncTable("dj_jdgz_track_record"); |
| | | syncTable("dj_sys_oss"); |
| | | syncTable("dj_jdgz_ship"); |
| | | syncTable("dj_jdgz_dismant_track"); |
| | | } |
| | | ImportRecord data =new ImportRecord(); |
| | | ImportRecord data = new ImportRecord(); |
| | | data.setImportSite(otherSite); |
| | | importRecordDao.insert(data); |
| | | List<ImportRecord> list = importRecordDao.getList(); |