| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.FmeReqEntity; |
| | | import com.lf.server.helper.PathHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.data.FmeService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | * @author WWW |
| | | */ |
| | | public class CheckController extends BaseController { |
| | | @Autowired |
| | | protected PathHelper pathHelper; |
| | | |
| | | @Autowired |
| | | protected FmeService fmeService; |
| | | |
| | |
| | | return fail("id不能为空"); |
| | | } |
| | | |
| | | Object obj = fmeService.getTaskStatus(id, req); |
| | | |
| | | return obj; |
| | | return fmeService.getTaskStatus(id, req); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | |
| | | if (StringHelper.isEmpty(entity.names)) { |
| | | return fail("任务名称不能为空"); |
| | | } |
| | | if (StringHelper.isEmpty(entity.zipPath)) { |
| | | return fail("请选择待质检的zip文件"); |
| | | } |
| | | |
| | | entity.zipPath = getFullPath(entity.zipPath); |
| | | if (!isZipFile(entity.zipPath)) { |
| | | return fail("待质检的zip文件不存在"); |
| | | } |
| | | if (entity.names.contains(StaticData.CHECK_MAIN)) { |
| | | entity.wbsPath = getFullPath(entity.wbsPath); |
| | | if (!isXlsFile(entity.wbsPath)) { |
| | | return fail("待质检的WBS文件不存在"); |
| | | } |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | for (String name : entity.names.split(StaticData.COMMA)) { |
| | |
| | | } |
| | | } |
| | | |
| | | private String getFullPath(String filePath) { |
| | | return null == filePath ? null : pathHelper.getConfig().getTempPath() + File.separator + filePath; |
| | | } |
| | | |
| | | private boolean isZipFile(String filePath) { |
| | | if (null == filePath || !filePath.toLowerCase().endsWith(StaticData.ZIP)) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | private boolean isXlsFile(String filePath) { |
| | | if (null == filePath) { |
| | | return false; |
| | | } |
| | | if (!(filePath.toLowerCase().endsWith(StaticData.XLS) || filePath.toLowerCase().endsWith(StaticData.XLSX))) { |
| | | return false; |
| | | } |
| | | |
| | | File zipFile = new File(filePath); |
| | | |
| | | return zipFile.exists() && !zipFile.isDirectory(); |
| | | } |
| | | |
| | | /** |
| | | * 方法调用 |
| | | */ |
| | |
| | | public static final double D1050 = 1050.0; |
| | | |
| | | /** |
| | | * 16进制 |
| | | * 等号 |
| | | */ |
| | | public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
| | | public final static String EQ = "="; |
| | | |
| | | /** |
| | | * 字符点 |
| | |
| | | public final static String COMMA = ","; |
| | | |
| | | /** |
| | | * 等号 |
| | | * zip文件 |
| | | */ |
| | | public final static String EQ = "="; |
| | | public final static String ZIP = ".zip"; |
| | | |
| | | /** |
| | | * xls文件 |
| | | */ |
| | | public final static String XLS = ".xls"; |
| | | |
| | | /** |
| | | * xlsx文件 |
| | | */ |
| | | public final static String XLSX = ".xlsx"; |
| | | |
| | | /** |
| | | * 版本号 |
| | |
| | | public final static String TOKEN_COOKIE_KEY = "token"; |
| | | |
| | | /** |
| | | * Cookie中druid键 |
| | | */ |
| | | public final static String DRUID_COOKIE_KEY = "JSESSIONID"; |
| | | |
| | | /** |
| | | * 文本编码方式 |
| | | */ |
| | | public final static String TEXT_ENCODER = "UTF-8"; |
| | | |
| | | /** |
| | | * 密码正则表达式 |
| | | * 总质检 |
| | | */ |
| | | public final static String PWD_REG = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$"; |
| | | public final static String CHECK_MAIN = "checkMain"; |
| | | |
| | | /** |
| | | * Object对象 |
| | | */ |
| | | public final static String OBJECT = "java.lang.Object"; |
| | | |
| | | /** |
| | | * Cookie中druid键 |
| | | */ |
| | | public final static String DRUID_COOKIE_KEY = "JSESSIONID"; |
| | | |
| | | /** |
| | | * 上传文件类型 |
| | |
| | | public final static String FILE_TYPES = "'xls','shp','gdb','mdb'"; |
| | | |
| | | /** |
| | | * Object对象 |
| | | * 16进制 |
| | | */ |
| | | public final static String OBJECT = "java.lang.Object"; |
| | | public static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; |
| | | |
| | | /** |
| | | * 密码正则表达式 |
| | | */ |
| | | public final static String PWD_REG = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$"; |
| | | |
| | | /** |
| | | * MPT文件扩展名 |