Commit b3ee68f4 authored by gary's avatar gary

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

parents f080966c a1b8013f
package pwc.taxtech.atms.vat.service.impl;
import org.reflections.util.Utils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
......@@ -9,19 +9,12 @@ import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.*;
import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
import static pwc.taxtech.atms.constant.Constant.CURRENT_USER_UPLOAD_FOLDER;
import static pwc.taxtech.atms.constant.Constant.FILE_NAME;
import static pwc.taxtech.atms.constant.Constant.TEMP_FILE_NAME;
import static pwc.taxtech.atms.constant.Constant.*;
@Service
public class FileUploadAdapter {
......@@ -84,7 +77,7 @@ public class FileUploadAdapter {
if (paramBean.totalSize > Long.valueOf(maxFileSize))
return ResponseEntity.badRequest().body("InvalidFileSize");
String baseFolder = prepareFolder();
if (Utils.isEmpty(baseFolder)) return ResponseEntity.badRequest().body("PrepareFolderError");
if (StringUtils.isBlank(baseFolder)) return ResponseEntity.badRequest().body("PrepareFolderError");
String tempPath = String.format("%s" + File.separator + "%s", baseFolder, paramBean.tempFileName);
String completePath = String.format("%s" + File.separator + "%s", baseFolder, paramBean.tempFileName);
......@@ -139,11 +132,11 @@ public class FileUploadAdapter {
FileParamBean param = new FileParamBean();
param.fileName = request.getParameter(FILE_NAME);
param.tempFileName = request.getParameter(TEMP_FILE_NAME);
param.chunkNumber = Utils.isEmpty(request.getParameter(CHUNK_NUMBER)) ? -1 : Long.parseLong(
param.chunkNumber = StringUtils.isBlank(request.getParameter(CHUNK_NUMBER)) ? -1 : Long.parseLong(
request.getParameter(CHUNK_NUMBER));
param.chunkSize = Utils.isEmpty(request.getParameter(CHUNK_SIZE)) ? -1 : Long.parseLong(
param.chunkSize = StringUtils.isBlank(request.getParameter(CHUNK_SIZE)) ? -1 : Long.parseLong(
request.getParameter(CHUNK_SIZE));
param.totalSize = Utils.isEmpty(request.getParameter(TOTAL_SIZE)) ? -1 : Long.parseLong(
param.totalSize = StringUtils.isBlank(request.getParameter(TOTAL_SIZE)) ? -1 : Long.parseLong(
request.getParameter(TOTAL_SIZE));
param.result = (param.chunkNumber != -1L) && (param.chunkSize != -1L) || (param.totalSize != -1L);
if (!param.result) return param;
......
package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import javafx.geometry.Orientation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.ibatis.jdbc.ScriptRunner;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.reflections.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dao.DimensionValueOrgMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dpo.PagingResultDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.vatdto.ImportOutputInvoiceDto;
import pwc.taxtech.atms.dto.vatdto.QueryEvidenceDto;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.invoice.OutputFpxxtbMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.service.impl.Message;
import pwc.taxtech.atms.vat.dao.ImportFileMapper;
import pwc.taxtech.atms.vat.dao.OutputVatInvoiceItemMapper;
import pwc.taxtech.atms.vat.dao.OutputVatInvoiceMapper;
......@@ -42,7 +29,6 @@ import pwc.taxtech.atms.vat.dpo.OutputVATInvoiceInfoDto;
import pwc.taxtech.atms.vat.dpo.QueryOutputDto;
import pwc.taxtech.atms.vat.entity.*;
import java.io.IOException;
import java.io.StringReader;
import java.math.BigDecimal;
import java.text.DecimalFormat;
......@@ -197,13 +183,13 @@ public class OutputInvoiceServiceImpl {
ImportFileExample example = new ImportFileExample();
if (queryDto.IsCurrentPeriod) {
if (Utils.isEmpty(queryDto.QueryString)) {
if (StringUtils.isBlank(queryDto.QueryString)) {
example.createCriteria().andFileImportTypeEqualTo(2).andPeriodIdEqualTo(queryDto.PeriodId.intValue());
} else {
example.createCriteria().andFileImportTypeEqualTo(2).andPeriodIdEqualTo(queryDto.PeriodId.intValue()).andFileNameLike(queryDto.QueryString);
}
} else {
if (Utils.isEmpty(queryDto.QueryString)) {
if (StringUtils.isBlank(queryDto.QueryString)) {
example.createCriteria().andFileImportTypeEqualTo(2);
} else {
example.createCriteria().andFileImportTypeEqualTo(2).andFileNameLike(queryDto.QueryString);
......
......@@ -7,14 +7,11 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Workbook;
import org.reflections.util.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
......@@ -313,7 +310,7 @@ public class ReportServiceImpl {
periodCellTemplateConfig.setCellTemplateId(cellTemplateConfig.getCellTemplateId());
periodCellTemplateConfig.setReportTemplateId(templateId);
periodCellTemplateConfig.setDataSourceType(cellTemplateConfig.getDataSourceType());
periodCellTemplateConfig.setFormula(Utils.isEmpty(cellTemplateConfig.getFormula()) ? null : cellTemplateConfig.getFormula());
periodCellTemplateConfig.setFormula(StringUtils.isBlank(cellTemplateConfig.getFormula()) ? null : cellTemplateConfig.getFormula());
periodCellTemplateConfig.setParsedFormula(null);
periodCellTemplateConfig.setFormulaDescription(cellTemplateConfig.getFormulaDescription());
periodCellTemplateConfig.setAccountCodes(cellTemplateConfig.getAccountCodes());
......@@ -321,9 +318,9 @@ public class ReportServiceImpl {
periodCellTemplateConfig.setTaxRate(cellTemplateConfig.getTaxRate());
periodCellTemplateConfig.setInvoiceAmountType(cellTemplateConfig.getInvoiceAmountType());
periodCellTemplateConfig.setModelIds(cellTemplateConfig.getModelIds());
periodCellTemplateConfig.setCreateBy(Utils.isEmpty(cellTemplateConfig.getCreateBy()) ? "admin" : cellTemplateConfig.getCreateBy());
periodCellTemplateConfig.setCreateBy(StringUtils.isBlank(cellTemplateConfig.getCreateBy()) ? "admin" : cellTemplateConfig.getCreateBy());
periodCellTemplateConfig.setCreateTime(cellTemplateConfig.getCreateTime());
periodCellTemplateConfig.setUpdateBy(Utils.isEmpty(cellTemplateConfig.getUpdateBy()) ? "admin" : cellTemplateConfig.getUpdateBy());
periodCellTemplateConfig.setUpdateBy(StringUtils.isBlank(cellTemplateConfig.getUpdateBy()) ? "admin" : cellTemplateConfig.getUpdateBy());
periodCellTemplateConfig.setUpdateTime(cellTemplateConfig.getUpdateTime());
periodCellTemplateConfig.setInvoiceCategory(cellTemplateConfig.getInvoiceCategory());
periodCellTemplateConfig.setFormulaDataSource(cellTemplateConfig.getFormulaDataSource());
......@@ -421,8 +418,8 @@ public class ReportServiceImpl {
periodCellTemplate.setDataType(cellTemplate.getDataType());
periodCellTemplate.setIsReadOnly(cellTemplate.getIsReadOnly() ? 1 : 0);
periodCellTemplate.setCopyFromId(cellTemplate.getCopyFromId());
periodCellTemplate.setCreateBy(Utils.isEmpty(cellTemplate.getCreateBy()) ? "admin" : cellTemplate.getCreateBy());
periodCellTemplate.setUpdateBy(Utils.isEmpty(cellTemplate.getUpdateBy()) ? "admin" : cellTemplate.getUpdateBy());
periodCellTemplate.setCreateBy(StringUtils.isBlank(cellTemplate.getCreateBy()) ? "admin" : cellTemplate.getCreateBy());
periodCellTemplate.setUpdateBy(StringUtils.isBlank(cellTemplate.getUpdateBy()) ? "admin" : cellTemplate.getUpdateBy());
periodCellTemplate.setProjectId(projectId);
periodCellTemplateList.add(periodCellTemplate);
}
......@@ -460,10 +457,10 @@ public class ReportServiceImpl {
periodTemplate.setUpdateTime(template.getUpdateTime());
periodTemplate.setIsSystemType(template.getIsSystemType());
periodTemplate.setIsActiveAssociation(template.getIsActiveAssociation());
periodTemplate.setParentId(Utils.isEmpty(template.getParentId()) ? null : template.getParentId());
periodTemplate.setParentId(StringUtils.isBlank(template.getParentId()) ? null : template.getParentId());
periodTemplate.setTemplateId(template.getId());
periodTemplate.setCreateBy(Utils.isEmpty(template.getCreateBy()) ? "admin" : template.getCreateBy());
periodTemplate.setUpdateBy(Utils.isEmpty(template.getUpdateBy()) ? "admin" : template.getUpdateBy());
periodTemplate.setCreateBy(StringUtils.isBlank(template.getCreateBy()) ? "admin" : template.getCreateBy());
periodTemplate.setUpdateBy(StringUtils.isBlank(template.getUpdateBy()) ? "admin" : template.getUpdateBy());
periodTemplate.setProjectId(projectId);
periodTemplateList.add(periodTemplate);
......
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