Commit 4b212884 authored by chase's avatar chase

新增上传文件接口

parent 2d7c01a5
package pwc.taxtech.atms.constant;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.UUID;
public final class Constant {
......@@ -123,6 +121,7 @@ public final class Constant {
public static final String DEFAULT = "yyyy-MM-dd";
public static final String YEAR_MONTH = "yyyy-MM";
public static final String YYYYMM = "yyyyMM";
public static final String YYYYMMDD = "yyyyMMdd";
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
}
......
package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
@RestController
@RequestMapping("/api/v1/DidiFileUpload")
public class DidiFileUploadController {
private static final Logger logger = LoggerFactory.getLogger(DidiFileUploadController.class);
@Autowired
private DidiFileUploadService didiFileUploadService;
@ResponseBody
// @ApiOperation(value = "导入模板")
@RequestMapping(value = "importTemplateGroupExcelFile", method = RequestMethod.POST)
public OperationResultDto uploadFile(@RequestParam MultipartFile file) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("uploadFile error.", e);
}
return OperationResultDto.error(ErrorMessage.SystemError);
}
// @PostMapping("queryPage")
// public CamelPagingResultDto<DidiFileUploadDetailResult> queryPage(@RequestBody DidiFileIUploadParam param) {
// return new CamelPagingResultDto<>(revenueDetailService.queryPage(param));
// }
}
package pwc.taxtech.atms.dto.didiFileUpload;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import java.io.Serializable;
import java.util.List;
public class DidiFileIUploadParam implements Serializable {
private static final long serialVersionUID = -1277395668299427030L;
private CamelPagingDto pageInfo;
private List<String> uuids;
private List<String> bizSources;
private List<String> uploadDates;
private List<String> uploadMonths;
private List<Integer> uploadWeeks;
private List<Integer> uploadYears;
public List<String> getBizSources() {
return bizSources;
}
public void setBizSources(List<String> bizSources) {
this.bizSources = bizSources;
}
public List<String> getUploadDates() {
return uploadDates;
}
public void setUploadDates(List<String> uploadDates) {
this.uploadDates = uploadDates;
}
public List<String> getUploadMonths() {
return uploadMonths;
}
public void setUploadMonths(List<String> uploadMonths) {
this.uploadMonths = uploadMonths;
}
public List<Integer> getUploadWeeks() {
return uploadWeeks;
}
public void setUploadWeeks(List<Integer> uploadWeeks) {
this.uploadWeeks = uploadWeeks;
}
public List<Integer> getUploadYears() {
return uploadYears;
}
public void setUploadYears(List<Integer> uploadYears) {
this.uploadYears = uploadYears;
}
public CamelPagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public List<String> getUuids() {
return uuids;
}
public void setUuids(List<String> uuids) {
this.uuids = uuids;
}
}
package pwc.taxtech.atms.dto.didiFileUpload;
import pwc.taxtech.atms.vat.entity.FileUpload;
public class DidiFileUploadDetailResult extends FileUpload {
private static final long serialVersionUID = -3050146980194769766L;
}
......@@ -41,4 +41,8 @@ longi_api_gl_balance=${longi_api_gl_balance}
#log
log.level=${log.level}
log.debug=${log.debug}
\ No newline at end of file
log.debug=${log.debug}
env_type=${env_type}
file_upload_post_url=${file_upload_post_url}
file_upload_query_url=${file_upload_query_url}
\ No newline at end of file
......@@ -38,3 +38,7 @@ longi_api_gl_balance=http://39.105.197.175:13001/ETMSSB/Erp/GLBalance/ProxyServi
#log
log.level=DEBUG
log.debug=true
env_type=dev
file_upload_post_url=http://47.94.233.173:11005/resource/erp_tax_system
file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.FileUploadLog;
import pwc.taxtech.atms.vat.entity.FileUploadLogExample;
@Mapper
public interface FileUploadLogMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
long countByExample(FileUploadLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int deleteByExample(FileUploadLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int deleteByPrimaryKey(String uid);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int insert(FileUploadLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int insertSelective(FileUploadLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
List<FileUploadLog> selectByExampleWithRowbounds(FileUploadLogExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
List<FileUploadLog> selectByExample(FileUploadLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
FileUploadLog selectByPrimaryKey(String uid);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") FileUploadLog record, @Param("example") FileUploadLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int updateByExample(@Param("record") FileUploadLog record, @Param("example") FileUploadLogExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(FileUploadLog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
int updateByPrimaryKey(FileUploadLog record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.FileUploadExample;
@Mapper
public interface FileUploadMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
long countByExample(FileUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int deleteByExample(FileUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int deleteByPrimaryKey(String uid);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int insert(FileUpload record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int insertSelective(FileUpload record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
List<FileUpload> selectByExampleWithRowbounds(FileUploadExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
List<FileUpload> selectByExample(FileUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
FileUpload selectByPrimaryKey(String uid);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") FileUpload record, @Param("example") FileUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int updateByExample(@Param("record") FileUpload record, @Param("example") FileUploadExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(FileUpload record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload
*
* @mbg.generated
*/
int updateByPrimaryKey(FileUpload record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import pwc.taxtech.atms.entity.BaseEntity;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table file_upload_log
*
* @mbg.generated do_not_delete_during_merge
*/
public class FileUploadLog extends BaseEntity implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_upload_log.uid
*
* @mbg.generated
*/
private String uid;
/**
* Database Column Remarks:
* 请求uuid
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_upload_log.request_id
*
* @mbg.generated
*/
private String requestId;
/**
* Database Column Remarks:
* 请求路径
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_upload_log.request_url
*
* @mbg.generated
*/
private String requestUrl;
/**
* Database Column Remarks:
* 请求返回json
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_upload_log.respons_json
*
* @mbg.generated
*/
private String responsJson;
/**
* Database Column Remarks:
* 文件上传表主键id
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column file_upload_log.file_upload_id
*
* @mbg.generated
*/
private String fileUploadId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table file_upload_log
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_upload_log.uid
*
* @return the value of file_upload_log.uid
*
* @mbg.generated
*/
public String getUid() {
return uid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_upload_log.uid
*
* @param uid the value for file_upload_log.uid
*
* @mbg.generated
*/
public void setUid(String uid) {
this.uid = uid == null ? null : uid.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_upload_log.request_id
*
* @return the value of file_upload_log.request_id
*
* @mbg.generated
*/
public String getRequestId() {
return requestId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_upload_log.request_id
*
* @param requestId the value for file_upload_log.request_id
*
* @mbg.generated
*/
public void setRequestId(String requestId) {
this.requestId = requestId == null ? null : requestId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_upload_log.request_url
*
* @return the value of file_upload_log.request_url
*
* @mbg.generated
*/
public String getRequestUrl() {
return requestUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_upload_log.request_url
*
* @param requestUrl the value for file_upload_log.request_url
*
* @mbg.generated
*/
public void setRequestUrl(String requestUrl) {
this.requestUrl = requestUrl == null ? null : requestUrl.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_upload_log.respons_json
*
* @return the value of file_upload_log.respons_json
*
* @mbg.generated
*/
public String getResponsJson() {
return responsJson;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_upload_log.respons_json
*
* @param responsJson the value for file_upload_log.respons_json
*
* @mbg.generated
*/
public void setResponsJson(String responsJson) {
this.responsJson = responsJson == null ? null : responsJson.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column file_upload_log.file_upload_id
*
* @return the value of file_upload_log.file_upload_id
*
* @mbg.generated
*/
public String getFileUploadId() {
return fileUploadId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column file_upload_log.file_upload_id
*
* @param fileUploadId the value for file_upload_log.file_upload_id
*
* @mbg.generated
*/
public void setFileUploadId(String fileUploadId) {
this.fileUploadId = fileUploadId == null ? null : fileUploadId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table file_upload_log
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", uid=").append(uid);
sb.append(", requestId=").append(requestId);
sb.append(", requestUrl=").append(requestUrl);
sb.append(", responsJson=").append(responsJson);
sb.append(", fileUploadId=").append(fileUploadId);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
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