Commit f340d06b authored by lisong's avatar lisong

添加通用表单提交远程接口

parent 68fe9817
package com.yeejoin.amos.boot.biz.common.feign; package com.yeejoin.amos.boot.biz.common.feign;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.support.SpringEncoder;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -18,4 +25,13 @@ public class FeignConfiguration { ...@@ -18,4 +25,13 @@ public class FeignConfiguration {
return new FeignAuthRequestInterceptor(); return new FeignAuthRequestInterceptor();
} }
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.feign; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.feign;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.feign.FeignConfiguration;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -10,7 +12,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -10,7 +12,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(value = "AMOS-IDX", path = "idx") @FeignClient(value = "AMOS-IDX", path = "idx", configuration = {FeignConfiguration.class})
public interface IdxFeignService { public interface IdxFeignService {
@RequestMapping("/dimensionTable/getTreeChildIds") @RequestMapping("/dimensionTable/getTreeChildIds")
...@@ -35,4 +37,32 @@ public interface IdxFeignService { ...@@ -35,4 +37,32 @@ public interface IdxFeignService {
*/ */
@RequestMapping(value = "/report/form/getFormRecordById", method = RequestMethod.GET) @RequestMapping(value = "/report/form/getFormRecordById", method = RequestMethod.GET)
ResponseModel<Map<String,Map<String,Object>>>getFormRecordById(@RequestParam Map map); ResponseModel<Map<String,Map<String,Object>>>getFormRecordById(@RequestParam Map map);
/**
*更新任务
*/
@RequestMapping(value = "/report/form/updateAmosTask/{taskId}", method = RequestMethod.POST)
FeignClientResult<JSONObject> updateAmosTask(@PathVariable("taskId")String taskId, @RequestBody JSONObject object);
/**
*查询任务第一个填报单
*/
@RequestMapping(value = "/report/form/getFirstFormByTaskId/{taskId}", method = RequestMethod.GET)
FeignClientResult<JSONObject> getFirstTask(@PathVariable("taskId")String taskId);
/**
*通用表单提交 数据填报
*/
@RequestMapping(value = "/table/submit", method = RequestMethod.POST)
FeignClientResult<String> submit(@RequestParam(value = "pageId") long pageId,
@RequestParam(value = "taskId",required = false) String taskId,
@RequestParam(value = "planInstanceId", required = false) String planInstanceId,
@RequestParam(value = "topic", required = false) String topic,
@RequestParam(value = "tableName", required = false) String tableName,
@RequestBody Map<String, Object> kv) throws Exception;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment