| | |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | 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.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.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 检查控制器 |
| | |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "提交数据质检") |
| | | @GetMapping(value = "/uploadChecks") |
| | | public ResponseMsg<Object> uploadChecks(FmeReqEntity entity, HttpServletRequest req) { |
| | | try { |
| | | if (StringHelper.isEmpty(entity.names)) { |
| | | return fail("任务名称不能为空"); |
| | | } |
| | | |
| | | List<String> list = new ArrayList<>(); |
| | | for (String name : entity.names.split(StaticData.COMMA)) { |
| | | String guid = invoke(name, entity, req); |
| | | list.add(guid); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 方法调用 |
| | | */ |
| | | private String invoke(String name, FmeReqEntity entity, HttpServletRequest req) throws Exception { |
| | | Method method; |
| | | try { |
| | | method = FmeService.class.getDeclaredMethod(name, FmeReqEntity.class, HttpServletRequest.class); |
| | | } catch (Exception ex) { |
| | | throw new Exception(name + ",该检查方法不存在"); |
| | | } |
| | | |
| | | Object obj = method.invoke(fmeService, entity, req); |
| | | |
| | | return null == obj ? null : obj.toString(); |
| | | } |
| | | |
| | | /*@SysLog() |
| | | @ApiOperation(value = "查询OSGB检查") |
| | | @GetMapping(value = "/selectCheckOsgb") |