管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-04-10 88a5f5ef66fd9be3835f80cb81c8399b831da341
src/main/java/com/lf/server/controller/all/CrdsController.java
@@ -4,10 +4,12 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.all.StaticData;
import com.lf.server.entity.data.DirEntity;
import com.lf.server.entity.data.MetaEntity;
import com.lf.server.helper.HttpHelper;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.data.DirService;
import com.lf.server.service.data.FmeService;
import com.lf.server.service.data.MetaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -35,16 +37,22 @@
    @Autowired
    FmeService fmeService;
    @Autowired
    MetaService metaService;
    @SysLog()
    @ApiOperation(value = "查询项目")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "西")
    })
    @GetMapping(value = "/selectProject")
    public ResponseMsg<List<DirEntity>> selectProject() {
    public ResponseMsg<List<DirEntity>> selectProject(String name) {
        try {
            List<DirEntity> list = dirService.selectProject();
            List<DirEntity> list = dirService.selectProject(name);
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -57,7 +65,7 @@
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -75,24 +83,20 @@
            return fmeService.getTaskStatus(id, req);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
    @SysLog()
    @ApiOperation(value = "请求打包")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dirId", value = "目录ID", dataType = "Integer", paramType = "57"),
            @ApiImplicitParam(name = "dirCode", value = "目录编码", dataType = "String", paramType = "01"),
            @ApiImplicitParam(name = "major", value = "专业", dataType = "String", paramType = "穿跨越"),
            @ApiImplicitParam(name = "isCut", value = "是否裁剪", dataType = "String", paramType = "NO")
    })
    @GetMapping(value = "/uploadReqPackaging")
    public ResponseMsg<Object> uploadReqPackaging(Integer dirId, String major, String isCut, HttpServletRequest req) {
    public ResponseMsg<Object> uploadReqPackaging(String dirCode, String major, String isCut, HttpServletRequest req) {
        try {
            if (null == dirId || dirId < StaticData.TWO) {
                return fail("目录ID不能为空且大于1");
            }
            boolean isMajor = StaticData.CROSSING.equals(major) || StaticData.ROUTE.equals(major);
            if (!isMajor) {
                return fail("专业只能是“穿跨越”或“线路”");
@@ -103,16 +107,19 @@
                return fail("是否裁剪只能是“YES”或“NO”");
            }
            DirEntity dir = dirService.selectDir(dirId);
            if (StringHelper.isEmpty(dirCode)) {
                return fail("目录编码不能为空");
            }
            DirEntity dir = dirService.selectByCode(dirCode);
            if (null == dir) {
                return fail("目录(id = " + dirId + ")不存在");
                return fail("目录编码为" + dirCode + "的目录不存在");
            }
            String id = fmeService.crdsPackaging(dir.getFullName(), major, isCut, req);
            String id = fmeService.crdsPackaging(dirCode, major, isCut, req);
            return success(id);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
            return fail(ex, null);
        }
    }
@@ -134,4 +141,24 @@
            log.error(ex.getMessage(), ex);
        }
    }
    @SysLog()
    @ApiOperation(value = "根据目录编码查询元数据文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dircode", value = "目录编码", dataType = "String", paramType = "query", example = "01")
    })
    @GetMapping(value = "/selectMetasByDirCode")
    public ResponseMsg<Object> selectMetasByDirCode(String dircode) {
        try {
            if (StringHelper.isEmpty(dircode)) {
                return fail("目录编码不能为空");
            }
            List<MetaEntity> list = metaService.selectMetasByDirCode(dircode);
            return success(null == list ? 0 : list.size(), list);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
}