init new
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
package com.point.strategy.datas.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.point.strategy.archiveScope.bean.ArchiveScope;
|
||||
import com.point.strategy.common.AjaxJson;
|
||||
import com.point.strategy.datas.service.ImportService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v/import")
|
||||
@Api(tags = "数据导入", value = "ImportController")
|
||||
public class ImportController {
|
||||
|
||||
@Autowired
|
||||
ImportService importService;
|
||||
|
||||
|
||||
@RequestMapping(value="/upload" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "上传Excel")
|
||||
public AjaxJson getExcelHeader(HttpServletRequest request, @RequestParam String userName, MultipartFile multipartFile) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
Map<String, Object> header = importService.getHeader(userName, multipartFile);
|
||||
json = new AjaxJson();
|
||||
json.setBody(header);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("上传Excel失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/importDate" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "导入数据")
|
||||
public AjaxJson importDate(@RequestBody Map<String, Object> parameters) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
Map<String, Object> map = importService.insert(parameters);
|
||||
json = new AjaxJson();
|
||||
json.setBody(map);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("上传Excel失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/importFileDate" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "导入文件数据")
|
||||
public AjaxJson importFileDate(@RequestBody Map<String, Object> parameters) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
Map<String, Object> map = importService.insertFile(parameters);
|
||||
json = new AjaxJson();
|
||||
json.setBody(map);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("上传Excel失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value="/importDateThree" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "导入数据三层")
|
||||
public AjaxJson importDateThree(@RequestBody Map<String, Object> parameters) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
Map<String, Object> map = importService.insertThree(parameters);
|
||||
json = new AjaxJson();
|
||||
json.setBody(map);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("上传Excel失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUp" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "简化方法挂接")
|
||||
public AjaxJson hookUp(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUp(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpByRecId" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "来文发文根据recId挂接")
|
||||
public AjaxJson hookUpByRecId(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpByRecId(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
@RequestMapping(value="/hookUpUrl" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "快速批量挂接")
|
||||
public AjaxJson hookUpUrl(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpUrl(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpNet" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "简化方法网络挂接")
|
||||
public AjaxJson hookUpNet(MultipartFile file,Integer type,Integer entityId,Integer mode,String AbSurface, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpNet(file,type,entityId,mode,AbSurface, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpNew" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "图片按照档号规则命名简化方法挂接")
|
||||
public AjaxJson hookUpNew(Map<String, Object> params, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpNew(params, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpTwo" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "传统方法挂接")
|
||||
public AjaxJson hookUpTwo(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpTwo(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpTwoNet" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "传统方法网络挂接")
|
||||
public AjaxJson hookUpTwoNet(MultipartFile file,Integer type,Integer entityId,Integer mode,String AbSurface, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpTwoNet(file,type,entityId,mode, AbSurface,request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value="/hookUpTwoNew" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "图片按照档号规则命名传统方法挂接")
|
||||
public AjaxJson hookUpTwoNew(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpTwoNew(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpXiaoGan" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "孝感挂接")
|
||||
public synchronized AjaxJson hookUpXiaoGan(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpXiaoGan(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpJzt" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "九州通文件挂接")
|
||||
public synchronized AjaxJson hookUpJzt(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpJzt(parameters, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/hookUpJztNet" , method= RequestMethod.POST)
|
||||
@ApiOperation(value = "九州通文件网络挂接")
|
||||
public synchronized AjaxJson hookUpJztNet(MultipartFile file,Integer entityId,HttpServletRequest request) {
|
||||
AjaxJson json = null;
|
||||
try {
|
||||
json = importService.hookUpJztNet(file,entityId, request);
|
||||
}catch(Exception e) {
|
||||
json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
// @RequestMapping(value="/hookUpXiaoGanTwo" , method= RequestMethod.POST)
|
||||
// @ApiOperation(value = "孝感挂接2")
|
||||
// public AjaxJson hookUpXiaoGanTwo(@RequestBody Map<String, Object> parameters, HttpServletRequest request) {
|
||||
// AjaxJson json = null;
|
||||
// try {
|
||||
// json = importService.hookUpXiaoGanTwo(parameters, request);
|
||||
// }catch(Exception e) {
|
||||
// json = AjaxJson.returnExceptionInfo("挂接失败"+e);
|
||||
// }
|
||||
// return json;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user