Commit bf945c3a authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

# Conflicts:
#	atms-web/src/main/webapp/app-resources/i18n/zh-CN/vat.json
parents 7735b088 fcf65a28
......@@ -31,6 +31,7 @@
<artifactId>atms-dao</artifactId>
<version>0.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
......
package pwc.taxtech.atms.common;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class CustomDateSerializer extends JsonSerializer<Date> {
@Override
public void serialize(Date value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException, JsonProcessingException {
// TODO Auto-generated method stub
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String formattedDate = formatter.format(value);
jgen.writeString(formattedDate);
}
}
......@@ -135,6 +135,19 @@ public class DateUtils {
return period;
}
/**
* 将yyyymm 字符串转换为区间格式 yyyyMM
*
* @param dateStr
* @return
*/
public static Integer strToPeriod2(String dateStr) {
dateStr = dateStr.replace(" ","");
Integer period = Integer.valueOf(dateStr);
return period;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd
*
......@@ -175,6 +188,19 @@ public class DateUtils {
return strtodate;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM-dd
*
* @param strDate
* @return
*/
public static Date strToDate4(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/**
* 得到现在时间
*
......
package pwc.taxtech.atms.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.config.FileServiceConfig;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.exception.ServiceException;
import java.io.IOException;
/**
* author kevin
* ver 1.0
*/
@Configuration
public class FileUploadUtil implements ApplicationContextAware {
protected static final Logger logger = LoggerFactory.getLogger(FileUploadUtil.class);
// Spring应用上下文环境
private static ApplicationContext applicationContext;
private static FileServiceConfig config;
private static final String USER_TEMPLATE_PATH = "pwc/userTemplate/";
private static final String HTTP_HEADER = "application/json;charset=UTF-8";
public static String upload(MultipartFile file) throws ServiceException{
return upload( file, false);
}
public static String serverPath(){
config = (FileServiceConfig)applicationContext.getBean("fileServiceConfig");
return config.getServerUrl() + config.getUploadUrl();
}
/**
* 上传模板
*
* @param file MultipartFile
* @param fullPath 是否返回全路径 默认false ,如果为true返回的路径直接可以用于下载
* @return Boolean
*/
public static String upload( MultipartFile file, boolean fullPath) throws ServiceException {
if (StringUtils.isBlank(file.getOriginalFilename()) || null == file) {
throw new IllegalArgumentException("上传参数为空");
}
CloseableHttpClient httpClient = null;
String filePath = USER_TEMPLATE_PATH + file.getOriginalFilename();
try {
String serverPath = serverPath();
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(serverPath);
httpPost.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
JSONObject param = new JSONObject();
param.put("path", filePath);
param.put("file", file.getBytes());
HttpEntity httpEntity = new StringEntity(param.toJSONString(), ContentType.APPLICATION_JSON);
httpPost.setEntity(httpEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
ApiResultDto resultDto = JSON.parseObject(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"), ApiResultDto.class);
if (resultDto.getCode() == ApiResultDto.SUCCESS) {
if(fullPath){
return config.getServerUrl() + "/" + filePath;
}
return filePath;
}
} catch (Exception e) {
e.printStackTrace();
logger.error("uploadTemplate error.", e);
} finally {
if (null != httpClient) {
try {
httpClient.close();
} catch (IOException e) {
logger.error("close httpClient error.", e);
}
}
}
throw new ServiceException("uploadTemplate error.");
}
/**
* 实现ApplicationContextAware接口的回调方法。设置上下文环境
*
* @param applicationContext
*/
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
/**
* @return ApplicationContext
*/
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
}
......@@ -8,7 +8,9 @@ public enum EnumImportType {
AdjustmentTable(4),
CashFlow(5),
CoupaPurchasingReport(6),
InvoiceData(7)
InvoiceData(7),
CertifiedInvoicesList(8),
InvoiceRecord(9)
;
private Integer code;
......
......@@ -164,6 +164,39 @@ public class DataImportController extends BaseController {
}
}
@ResponseBody
@RequestMapping(value = "IRExcelFile", method = RequestMethod.POST)
public OperationResultDto importIRExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
List<String> orgList = (List<String>)JSONArray.parse(orgIds);
return dataImportService.importIRExcelFile(file,orgList, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importIRExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "CILExcelFile", method = RequestMethod.POST)
public OperationResultDto importCILExcelFile(@RequestParam MultipartFile file,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
return dataImportService.importCILExcelFile(file, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importCILExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "displayImportLog", method = RequestMethod.GET)
public List<DataImportLogDto> displayImportLog(@RequestParam Integer type) {
......
......@@ -55,11 +55,35 @@ public class DataPreviewController extends BaseController {
return dataPreviewSerivceImpl.getBSDataForDisplay(param);
}
@PostMapping("getIRDataForDisplay")
public PageInfo<InvoiceRecordDto> getIRDataForDisplay(@RequestBody InvoiceRecordParam param) {
logger.debug(String.format("发票记录表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getIRDataForDisplay(param);
}
@PostMapping("getRLITDataForDisplay")
public PageInfo<RedLetterInfoTableDto> getRLITDataForDisplay(@RequestBody RedLetterInfoTableParam param) {
logger.debug(String.format("红字信息表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getRLITDataForDisplay(param);
}
@PostMapping("getCPRDataForDisplay")
public PageInfo<CoupaPurchasingReportDto> getCPRDataForDisplay(@RequestBody CoupaPurchasingReportParam param) {
logger.debug(String.format("Coupa发票报告表查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getCPRDataForDisplay(param);
}
@PostMapping("getCILDataForDisplay")
public PageInfo<CertifiedInvoicesListDto> getCILDataForDisplay(@RequestBody CertifiedInvoicesListParam param) {
logger.debug(String.format("已认证发票清单查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getCILDataForDisplay(param);
}
@RequestMapping(value = "exportCFData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCFQueryData(@RequestBody CashFlowParam param, HttpServletResponse response) {
logger.debug("enter downloadCFQueryData");
String fileName="testFile";
// dataPreviewSerivceImpl.exportCashFlowList(response, param, fileName);
dataPreviewSerivceImpl.exportCashFlowList(response, param, fileName);
}
@RequestMapping(value = "exportTBData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
......@@ -2,12 +2,13 @@ package pwc.taxtech.atms.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import pwc.taxtech.atms.dto.ebsdto.*;
import pwc.taxtech.atms.service.EbsApiService;
import javax.annotation.Resource;
......@@ -18,23 +19,128 @@ import java.util.List;
@RequestMapping("/ebs/api/v1/dd")
public class EbsApiController {
private static final Logger logger= LoggerFactory.getLogger(EbsApiController.class);
private static final Logger logger = LoggerFactory.getLogger(EbsApiController.class);
@Resource
private EbsApiService ebsApiService;
@RequestMapping(value = "/queryRemoteServerThenUpdateJE", method = RequestMethod.POST)
public ApiResultDto queryRemoteServerThenUpdateJE(@RequestBody List<JEqueryDto> items) {
if (items!=null&&!items.isEmpty()) {
@RequestMapping(value = "/updateJE", method = RequestMethod.POST)
public ApiResultDto updateJE(@RequestBody List<JournalEntryQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateJE return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateJE(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("queryRemoteServerThenUpdateJE error.", e);
logger.error("updateJE error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateTB", method = RequestMethod.POST)
public ApiResultDto updateTB(@RequestBody List<TrialBalanceQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateTB return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateTB(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateTB error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateCF", method = RequestMethod.POST)
public ApiResultDto updateCF(@RequestBody List<CashFlowQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateCF return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateCF(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateCF error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateBS", method = RequestMethod.POST)
public ApiResultDto updateBS(@RequestBody List<BalanceSheetQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateBS return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateBS(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateBS error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updatePL", method = RequestMethod.POST)
public ApiResultDto updatePL(@RequestBody List<ProfitLossStatementQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updatePL return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdatePL(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updatePL error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateBSprc", method = RequestMethod.POST)
public ApiResultDto updateBSprc(@RequestBody List<BalanceSheetPrcQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateBSprc return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateBSprc(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateBSprc error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updatePLprc", method = RequestMethod.POST)
public ApiResultDto updatePLprc(@RequestBody List<ProfitLossStatementPrcQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updatePLprc return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdatePLprc(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updatePLprc error.", e);
}
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateOAR", method = RequestMethod.POST)
public ApiResultDto updateOAR(@RequestBody List<OrganizationAccountingRateQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateOAR return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateOAR(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateOAR error.", e);
}
return ApiResultDto.fail();
}
}
......@@ -8,15 +8,21 @@ import org.springframework.http.ResponseEntity;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.dto.FileDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.FileService;
import pwc.taxtech.atms.service.impl.HttpFileService;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;
import javax.mail.Session;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
......@@ -33,6 +39,9 @@ public class FileUploadController {
@Autowired
private FileService fileService;
@Autowired
private HttpFileService httpFileService;
@RequestMapping(value = "NewFile", method = RequestMethod.POST, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity getInputInvoiceTreeViewData(MultipartHttpServletRequest request) {
return fileUploadAdapter.upload(request);
......
package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import pwc.taxtech.atms.vat.entity.PwcReportAttach;
import pwc.taxtech.atms.vat.entity.VatEnterpriseAccount;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@RestController
......@@ -149,4 +157,26 @@ public class ReportController {
}
@RequestMapping(value = "doUpload", method = RequestMethod.POST)
public OperationResultDto doUploadAttach(@RequestParam("fileName") String fileName, MultipartFile file, String remarks, @RequestParam("activeCol")Long activeCol, @RequestParam("activeRow")Long activeRow, @RequestParam("activeTemplateId")String activeTemplateId){
System.out.println(activeCol + "----" + activeRow + "-----" + activeTemplateId);
OperationResultDto operationResultDto = reportService.doUploadAttach(file, remarks);
if(!"error".equals(operationResultDto.getResultMsg())){//上传成功绑定
reportService.bindPwcAttach(activeCol, activeRow, activeTemplateId, (FileDto) operationResultDto.getData());
}
return operationResultDto;
}
@RequestMapping("loadAttachList")
public List<PwcReportAttach> loadAttachList(@RequestBody ReportAttachDto reportAttachDto){
System.out.println("sdsdfsd");
return reportService.loadAttachList(reportAttachDto);
}
@RequestMapping("deleteAttach")
public OperationResultDto deleteAttach(Long id){
return reportService.deleteAttach(id);
}
}
\ No newline at end of file
......@@ -43,5 +43,4 @@ public class RevenueConfController extends BaseController {
revenueConfService.updateConfig(config);
return ApiResultDto.success();
}
}
......@@ -278,6 +278,10 @@ public class TemplateController extends BaseController implements ServletContext
return EnumImportType.CoupaPurchasingReport.name();
}else if(EnumImportType.InvoiceData.getCode().equals(fileType)){
return EnumImportType.InvoiceData.name();
}else if(EnumImportType.CertifiedInvoicesList.getCode().equals(fileType)){
return EnumImportType.CertifiedInvoicesList.name();
}else if(EnumImportType.InvoiceRecord.getCode().equals(fileType)){
return EnumImportType.InvoiceRecord.name();
}else if(EnumImportType.Undefined.getCode().equals(fileType)){
return EnumImportType.Undefined.name();
}
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;
import pwc.taxtech.atms.common.CustomDateSerializer;
import pwc.taxtech.atms.entity.BaseEntity;
import java.util.Date;
//统一返回文件对象
public class FileDto extends BaseEntity {
private String fileName;
private String size;
private String remarks;//备注信息
private String uploadUser;//上传用户
private Date createTime;
protected Date updateTime;
private String fileUrl;
public String getFileUrl() {
return fileUrl;
}
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getUploadUser() {
return uploadUser;
}
public void setUploadUser(String uploadUser) {
this.uploadUser = uploadUser;
}
@JsonSerialize(using = CustomDateSerializer.class)
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@JsonSerialize(using = CustomDateSerializer.class)
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String toString() {
return "FileDto{" +
"fileName='" + fileName + '\'' +
", size='" + size + '\'' +
", remarks='" + remarks + '\'' +
", uploadUser='" + uploadUser + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", fileUrl='" + fileUrl + '\'' +
'}';
}
}
......@@ -16,6 +16,7 @@ public class OperationResultDto<T> extends OperationResultBase {
private T data;
public OperationResultDto() {
}
......
package pwc.taxtech.atms.dto;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfParam;
public class ReportAttachDto extends RevenueConfParam {
private Long activeCol;
private Long activeRow;
private String activeTemplateId;
public Long getActiveCol() {
return activeCol;
}
public void setActiveCol(Long activeCol) {
this.activeCol = activeCol;
}
public Long getActiveRow() {
return activeRow;
}
public void setActiveRow(Long activeRow) {
this.activeRow = activeRow;
}
public String getActiveTemplateId() {
return activeTemplateId;
}
public void setActiveTemplateId(String activeTemplateId) {
this.activeTemplateId = activeTemplateId;
}
@Override
public String toString() {
return "ReportAttachDto{" +
"activeCol=" + activeCol +
", activeRow=" + activeRow +
", activeTemplateId='" + activeTemplateId + '\'' +
'}';
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CertifiedInvoicesListParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class CoupaPurchasingReportParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class InvoiceRecordParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.dpo.PagingDto;
public class RedLetterInfoTableParam {
private PagingDto pageInfo;
private String orgId;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public PagingDto getPageInfo() {
return pageInfo;
}
public void setPageInfo(PagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
......@@ -22,7 +22,7 @@ public class WrapPeriodJobDto {
public static final String STEP_UPDATE_CONFIG = "UpdateConfig";
public static PeriodJob createReportGenJob(String projectId, Integer period, List<Template> templates) {
public static PeriodJob createReportGenJob(String projectId, Integer period, List<Template> templates,List<String> dataValidateArray) {
MyAsserts.assertNotEmpty(templates, Exceptions.NOT_FOUND_TEMPLATE_EXCEPTION);
PeriodJob job = new PeriodJob();
job.setCreateTime(new Date());
......@@ -33,10 +33,12 @@ public class WrapPeriodJobDto {
job.setCurrentStep(STEP_UPDATE_CONFIG);
setStatus(job,STEP_UPDATE_CONFIG,STATUS_BEGIN);
StringBuilder builder = new StringBuilder(STEP_UPDATE_CONFIG);
dataValidateArray.forEach(m ->{
builder.append(",").append(m);
});
templates.forEach(m -> {
builder.append(",").append(m.getCode());
});
job.setStepsCode(builder.toString());
return job;
}
......
package pwc.taxtech.atms.service;
import pwc.taxtech.atms.dto.ebsdto.JEqueryDto;
import pwc.taxtech.atms.dto.ebsdto.*;
import java.util.List;
......@@ -8,7 +8,57 @@ public interface EbsApiService {
/**
* EBS 日记账同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateJE(List<JEqueryDto> items);
void queryRemoteServerThenUpdateJE(List<JournalEntryQueryDto> items);
/**
* ebs 科目余额表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateTB(List<TrialBalanceQueryDto> items);
/**
* ebs 现金流量表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateCF(List<CashFlowQueryDto> items);
/**
* ebs 资产负债表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateBS(List<BalanceSheetQueryDto> items);
/**
* ebs 资产负债表PRC同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateBSprc(List<BalanceSheetPrcQueryDto> items);
/**
* ebs 利润表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdatePL(List<ProfitLossStatementQueryDto> items);
/**
* ebs 利润表PRC同步更新
*
* @param items
*/
void queryRemoteServerThenUpdatePLprc(List<ProfitLossStatementPrcQueryDto> items);
/**
* ebs 汇率表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateOAR(List<OrganizationAccountingRateQueryDto> items);
}
/*
package pwc.taxtech.atms.service.impl;
import org.jxls.common.Context;
import org.jxls.expression.JexlExpressionEvaluator;
import org.jxls.transform.Transformer;
......@@ -82,4 +80,4 @@ public class CommonDocumentHelper {
}
}
*/
......@@ -198,4 +198,8 @@ public class FileService {
}
}
//上传文件
}
......@@ -23,15 +23,22 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.config.FileServiceConfig;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.FileDto;
import pwc.taxtech.atms.exception.ServiceException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* version 2.0
* author kevin
*/
@Service
public class HttpFileService extends BaseService {
@Autowired
......@@ -44,21 +51,23 @@ public class HttpFileService extends BaseService {
*
* @param fileName 文件名
* @param file MultipartFile
* @param fullPath 是否返回全路径 默认false ,如果为true返回的路径直接可以用于下载
* @return Boolean
*/
public String uploadTemplate(String fileName, MultipartFile file) throws ServiceException {
public String uploadTemplate(String fileName, MultipartFile file, boolean fullPath) throws ServiceException {
if (StringUtils.isBlank(fileName) || null == file) {
throw new IllegalArgumentException("上传参数为空");
}
CloseableHttpClient httpClient = null;
String fullPath = USER_TEMPLATE_PATH + fileName;
String filePath = USER_TEMPLATE_PATH + fileName;
try {
String serverPath = config.getServerUrl() + config.getUploadUrl();
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(config.getServerUrl() + config.getUploadUrl());
HttpPost httpPost = new HttpPost(serverPath);
httpPost.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
JSONObject param = new JSONObject();
param.put("path", fullPath);
param.put("path", filePath);
param.put("file", file.getBytes());
HttpEntity httpEntity = new StringEntity(param.toJSONString(), ContentType.APPLICATION_JSON);
......@@ -67,7 +76,10 @@ public class HttpFileService extends BaseService {
HttpResponse httpResponse = httpClient.execute(httpPost);
ApiResultDto resultDto = JSON.parseObject(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"), ApiResultDto.class);
if (resultDto.getCode() == ApiResultDto.SUCCESS) {
return fullPath;
if(fullPath){
return config.getServerUrl() + "/" + filePath;
}
return filePath;
}
} catch (Exception e) {
logger.error("uploadTemplate error.", e);
......@@ -83,6 +95,11 @@ public class HttpFileService extends BaseService {
throw new ServiceException("uploadTemplate error.");
}
public String uploadTemplate(String fileName, MultipartFile file) throws ServiceException{
return uploadTemplate(fileName, file, false);
}
/**
* 下载模板
*
......@@ -117,4 +134,22 @@ public class HttpFileService extends BaseService {
return null;
}
//上传
public FileDto upload(MultipartFile file, String remarks){
FileDto fileDto = new FileDto();
int i = file.getOriginalFilename().lastIndexOf(".");
fileDto.setFileName(file.getOriginalFilename());
if(remarks != null){
fileDto.setRemarks(remarks);
}
fileDto.setFileUrl(uploadTemplate(file.getOriginalFilename(), file, true));
//绑定
fileDto.setSize(String.valueOf(file.getSize()/1024));
fileDto.setUploadUser(authUserHelper.getCurrentAuditor().get());
fileDto.setCreateTime(DateUtils.getNowDate());
return fileDto;
}
}
......@@ -41,7 +41,12 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator>
<table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<!-- <table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>-->
<table tableName="pwc_report_attach" domainObjectName="PwcReportAttach">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
......
......@@ -466,6 +466,14 @@ public class OrganizationDto {
this.pLevel = pLevel;
}
public Integer getPLevel() {
return pLevel;
}
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
public String getRemark() {
return remark;
}
......
......@@ -787,6 +787,30 @@ public class Organization extends BaseEntity implements Serializable {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.p_level
*
* @return the value of organization.p_level
*
* @mbg.generated
*/
public Integer getPLevel() {
return pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.p_level
*
* @param pLevel the value for organization.p_level
*
* @mbg.generated
*/
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.create_time
......@@ -1699,6 +1723,8 @@ public class Organization extends BaseEntity implements Serializable {
this.logoutTime = logoutTime;
}
public Area getArea() {
return area;
}
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
......@@ -108,4 +110,5 @@ public interface AdjustmentTableMapper extends MyVatMapper {
int insertBatch(List<AdjustmentTable> rlits);
List<AdjustmentTable> selectBeforeAdjustData(Map<String,Object> map1);
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ 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.dpo.CoupaPurchasingReportCondition;
import pwc.taxtech.atms.vat.entity.CoupaPurchasingReport;
import pwc.taxtech.atms.vat.entity.CoupaPurchasingReportExample;
......@@ -107,4 +108,6 @@ public interface CoupaPurchasingReportMapper extends MyVatMapper {
int updateByPrimaryKey(CoupaPurchasingReport record);
int insertBatch(List<CoupaPurchasingReport> cprs);
List<CoupaPurchasingReport> selectByCondition(@Param("cprCondition") CoupaPurchasingReportCondition condition);
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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