| | |
| | | import com.lf.server.entity.ctrl.RegisterEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.PublishEntity; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.RestHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.data.PublishMapper; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 数据发布 |
| | |
| | | @Value("${sys.iisHost}") |
| | | private String iisHost; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | PublishMapper publishMapper; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | FmeService fmeService; |
| | | |
| | | @Resource |
| | | PathHelper pathHelper; |
| | | |
| | | private final static Log log = LogFactory.getLog(PublishService.class); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除发布文件 |
| | | */ |
| | | public void deleteFiles(List<PublishEntity> list) { |
| | | String uploadPath = pathHelper.getConfig().getUploadPath(); |
| | | for (PublishEntity pub : list) { |
| | | if (null != pub.getUrl() && pub.getUrl().contains("/SG/")) { |
| | | continue; |
| | | } |
| | | |
| | | String path = uploadPath + File.separator + pub.getPath().replace("\\tileset.json", ""); |
| | | File file = new File(path); |
| | | if (!file.exists() || !file.isDirectory()) { |
| | | continue; |
| | | } |
| | | |
| | | String cmd = String.format("cmd /c rd \"%s\" /s /q", path); |
| | | WebHelper.exec(cmd); |
| | | } |
| | | } |
| | | } |