Commit 4ab5fa76 authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 66363940 ca1a6046
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.math.BigDecimal;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* author kevin
* target : Solve ThousandConvert
* version 1.0
*/
public class ThousandConvert extends JsonSerializer<BigDecimal> {
@Override
public void serialize(BigDecimal value, JsonGenerator jgen, SerializerProvider arg2)
throws IOException {
jgen.writeString(NumberFormat.getIntegerInstance(Locale.getDefault()).format(value));
}
}
......@@ -37,6 +37,8 @@ public class SystemConfig {
private String tableauAustralianTax;
@Value("${tableau_brazilian_tax}")
private String tableauBrazilianTax;
@Value("${tableau_dashboard}")
private String tableauDashboard;
public String getLongiApiBasicUser() {
return this.longiApiBasicUser;
......@@ -157,4 +159,12 @@ public class SystemConfig {
public void setTableauBrazilianTax(String tableauBrazilianTax) {
this.tableauBrazilianTax = tableauBrazilianTax;
}
public String getTableauDashboard() {
return this.tableauDashboard;
}
public void setTableauDashboard(String tableauDashboard) {
this.tableauDashboard = tableauDashboard;
}
}
......@@ -83,4 +83,10 @@ public class TableauController extends BaseController {
return ApiResultDto.success(tableauService.getBrazilianTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("dashboard")
public ApiResultDto getDashboard() {
return ApiResultDto.success(tableauService.getBrazilianTax().orElse(StringUtils.EMPTY));
}
}
......@@ -9,14 +9,18 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.common.PageResultVo;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
......@@ -24,6 +28,7 @@ import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.HttpFileService;
import pwc.taxtech.atms.service.impl.OrganizationServiceImpl;
import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
......@@ -48,6 +53,8 @@ public class TaxDocumentController {
private DidiFileUploadService didiFileUploadService;
@Autowired
private OrganizationServiceImpl organizationService;
@Autowired
HttpFileService httpFileService;
@PostMapping("selectList")
@ResponseBody
public PageResultVo<TaxDocument> selectTaxDocumentList(@RequestBody TaxDocumentDto taxDocumentDto) {
......@@ -394,4 +401,38 @@ public class TaxDocumentController {
dataArray.add(sheetJson);
}
}
@RequestMapping(value = "/convertExcel", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public void convertExcel(HttpServletResponse response,String url){
InputStream is = null;
Workbook tWorkbook = null;
Workbook workbook = new XSSFWorkbook();
OutputStream ouputStream = null;
try{
is = httpFileService.getUserTemplate(url);
tWorkbook = WorkbookFactory.create(is);
for(int i = 1;i<tWorkbook.getNumberOfSheets();i++){
POIUtil.cloneSheet(tWorkbook.getSheetAt(i), workbook.createSheet(tWorkbook.getSheetAt(i).getSheetName()));
}
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("test.xlsx".getBytes("GB2312"), "ISO-8859-1"));
ouputStream = response.getOutputStream();
workbook.write(ouputStream);
}catch (Exception e){
e.printStackTrace();
}finally {
try {
if (ouputStream != null) {
ouputStream.close();
}
if(is!=null){
is.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
package pwc.taxtech.atms.dto.analysis;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.ThousandConvert;
import java.math.BigDecimal;
/**
......@@ -11,16 +14,17 @@ public class AnalysisTaxDto {
private String companyName;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment1;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment2;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment3;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment4;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment5;
@JsonSerialize(using = ThousandConvert.class)
private BigDecimal segment6;
public String getCompanyName() {
......
......@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Date;
......@@ -197,18 +198,19 @@ public class AnalysisServiceImpl extends BaseService {
}
public OperationResultDto importDomesitcExcelFile(MultipartFile file, String periodDate, Integer type) {
StringBuilder notOrgMatch = new StringBuilder();
switch (type) {
case 0:
importAnalysisTaxExcelFile(file, periodDate);
notOrgMatch = importAnalysisTaxExcelFile(file, periodDate);
break;
case 1:
importAnalysisReturnTaxExcelFile(file, periodDate);
notOrgMatch = importAnalysisReturnTaxExcelFile(file, periodDate);
break;
case 2:
importAnalysisGMVSubsidyExcelFile(file, periodDate);
break;
case 3:
importAnalysisEmployeeNumExcelFile(file, periodDate);
notOrgMatch = importAnalysisEmployeeNumExcelFile(file, periodDate);
break;
case 4:
importAnalysisDriverNumExcelFile(file, periodDate);
......@@ -216,7 +218,7 @@ public class AnalysisServiceImpl extends BaseService {
default:
break;
}
return OperationResultDto.success();
return OperationResultDto.success(notOrgMatch);
}
public OperationResultDto importInterNationalExcelFile(MultipartFile file, String periodDate, Integer type,
......@@ -237,7 +239,9 @@ public class AnalysisServiceImpl extends BaseService {
private String[] headerArr = null;
private void importAnalysisTaxExcelFile(MultipartFile file, String periodDate) {
private StringBuilder importAnalysisTaxExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -263,7 +267,8 @@ public class AnalysisServiceImpl extends BaseService {
example.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example);
if (orgs.isEmpty()) {
break;
orgNotList.add(j + 1);
continue;
}
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
AnalysisTax model = getAnalysisTax(selectedPer, sheet, k, j, orgs.get(0));
......@@ -284,6 +289,7 @@ public class AnalysisServiceImpl extends BaseService {
} catch (Exception e) {
throw new ServiceException(e);
}
return notMatchOrg.append(orgNotList + "机构匹配失败");
}
private AnalysisTax getAnalysisTax(Integer period, Sheet sheet, int k, int j, Organization org) {
......@@ -326,7 +332,9 @@ public class AnalysisServiceImpl extends BaseService {
}
private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
private StringBuilder importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -351,7 +359,8 @@ public class AnalysisServiceImpl extends BaseService {
example.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example);
if (orgs.isEmpty()) {
break;
orgNotList.add(j + 1);
continue;
}
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
AnalysisActualTaxReturn model = getAnalysisActualTaxReturn(selectedPer, sheet, k, j, orgs.get(0));
......@@ -373,6 +382,7 @@ public class AnalysisServiceImpl extends BaseService {
} catch (Exception e) {
throw new ServiceException(e);
}
return notMatchOrg.append(orgNotList + "行匹配失败");
}
private AnalysisActualTaxReturn getAnalysisActualTaxReturn(Integer period, Sheet sheet, int k, int j, Organization org) {
......@@ -387,7 +397,9 @@ public class AnalysisServiceImpl extends BaseService {
return model;
}
private void importAnalysisEmployeeNumExcelFile(MultipartFile file, String periodDate) {
private StringBuilder importAnalysisEmployeeNumExcelFile(MultipartFile file, String periodDate) {
StringBuilder notMatchOrg = new StringBuilder();
List orgNotList = Lists.newArrayList();
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -409,7 +421,17 @@ public class AnalysisServiceImpl extends BaseService {
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) {
continue;
}
model.setCompanyName(getCellStringValue(sheet.getRow(j).getCell(0)));
//进行机构验证
String companyName = getCellStringValue(sheet.getRow(j).getCell(0));
OrganizationExample example1 = new OrganizationExample();
example1.createCriteria().andNameEqualTo(companyName);
List<Organization> orgs = organizationMapper.selectByExample(example1);
if (orgs.isEmpty()) {
orgNotList.add(j + 1);
continue;
}
model.setCompanyName(companyName);
try {
model.setSeqNo(getSeqNoByPeriod(getOrgByCompanyName(getCellStringValue(sheet.getRow(j).getCell(0))).getId(), selectedPer));
} catch (Exception e) {
......@@ -447,9 +469,11 @@ public class AnalysisServiceImpl extends BaseService {
e.printStackTrace();
throw new ServiceException(e);
}
return notMatchOrg.append(orgNotList + "行匹配失败");
}
private void importAnalysisGMVSubsidyExcelFile(MultipartFile file, String periodDate) {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -719,7 +743,6 @@ public class AnalysisServiceImpl extends BaseService {
public HttpServletResponse downloadDomesticFile(HttpServletResponse response, AnalysisDomesticlParam param, String fileName) {
String excelTemplatePathInClassPath = EnumAnalysisExpTempPath.getPath(param.getType());
List<Object> datas = displayAnalysisImportData(param);
try {
if (datas.size() < 1) {
throw new Exception("无可导出的数据");
......
......@@ -113,4 +113,10 @@ public class TableauService extends BaseService {
return optional.map(s -> String.format(systemConfig.getTableauBrazilianTax(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
public Optional<String> getDashboard() {
Optional<String> optional = authUserHelper.getCurrentAuditor();
return optional.map(s -> String.format(systemConfig.getTableauDashboard(),
getTicket(s).orElse(StringUtils.EMPTY)));
}
}
......@@ -311,16 +311,9 @@ public class TaxDocumentServiceImpl {
public boolean editFilesType(TaxDocument taxDocument) {
try {
TaxDocumentExample taxDocumentExample = new TaxDocumentExample();
taxDocumentExample.createCriteria().andFileNameEqualTo(taxDocument.getFileName());
List<TaxDocument> list = taxDocumentMapper.selectByExample(taxDocumentExample);
if (list.size() > 0) {
return false;
}
//更新上传时间和文件名称
taxDocument.setUpdateTime(new Date());
taxDocument.setUploadTime(new Date());
int num = taxDocumentMapper.updateByPrimaryKey(taxDocument);
if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
......
......@@ -231,8 +231,7 @@ public class ReportServiceImpl extends BaseService {
return operationResult;
}
private void clearPeriodData(String projectId, Integer period, List<Long> templateIds, boolean isMergeManualData) {
if (templateIds.isEmpty()) templateIds.add(Long.MAX_VALUE);
private void clearPeriodData(String projectId, Integer period, boolean isMergeManualData) {
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodFormulaBlockMapper.deleteByExample(periodFormulaBlockExample);
......@@ -242,15 +241,15 @@ public class ReportServiceImpl extends BaseService {
periodTaxRuleSettingMapper.deleteByExample(periodTaxRuleSettingExample);
PeriodCellTemplateExample periodCellTemplateExample = new PeriodCellTemplateExample();
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportTemplateIdNotIn(templateIds);
periodCellTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodCellTemplateMapper.deleteByExample(periodCellTemplateExample);
PeriodCellTemplateConfigExample periodCellTemplateConfigExample = new PeriodCellTemplateConfigExample();
periodCellTemplateConfigExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andReportTemplateIdNotIn(templateIds);
periodCellTemplateConfigExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodCellTemplateConfigMapper.deleteByExample(periodCellTemplateConfigExample);
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period).andTemplateIdNotIn(templateIds);
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(period);
periodTemplateMapper.deleteByExample(periodTemplateExample);
PeriodTaxPayerReportRuleExample periodTaxPayerReportRuleExample = new PeriodTaxPayerReportRuleExample();
......@@ -304,12 +303,13 @@ public class ReportServiceImpl extends BaseService {
}
private void updateConfig(String projectId, Integer period, Boolean isMergeManualData, List<Template> templates, PeriodJob job) {
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
//财务报表不删除,这个逻辑用不到,先注释掉
// List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
//根据收入类型映射生成开票记录关联数据
assembleInvoiceRecord(projectId, period, isMergeManualData);
//生成trial_balance_final数据
assembleTrialBalanceFinal(projectId, period);
clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
clearPeriodData(projectId, period, isMergeManualData);
copyTemplateAndConfigFromAdmin(projectId, templates, period);
setStatus(job, STATUS_END);
periodJobMapper.updateByPrimaryKey(job);
......@@ -373,8 +373,10 @@ public class ReportServiceImpl extends BaseService {
destRecord.setRevenueCofId(map.get(mapping.getContent()));
InvoiceRecordExample recordExample = new InvoiceRecordExample();
recordExample.createCriteria().andProjectIdEqualTo(projectId)
.andOrganizationIdEqualTo(mapping.getOrgId()).andBillingContentEqualTo(mapping.getContent()).
andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", "")));
.andOrganizationIdEqualTo(mapping.getOrgId()).andBillingContentEqualTo(mapping.getContent())
.andTaxRateEqualTo(mapping.getTaxRate())
.andDepartmentEqualTo(mapping.getOuName())
.andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", "")));
invoiceRecordMapper.updateByExampleSelective(destRecord, recordExample);
}
}
......@@ -875,8 +877,8 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue(
"DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
"DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",3,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",3,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if (2 == config.getAccountType()) {//手工输入
} else {
......@@ -894,9 +896,9 @@ public class ReportServiceImpl extends BaseService {
} else if (3 == config.getTaxBase()) {//手工录入
} else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("JFFS(\"" + config.getBaseDrCode() + "\"," + project.getYear() + "," + period + ",1,,)");
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("JFFS(\"" + config.getBaseDrCode() + "\"," + project.getYear() + "," + period + ",3,,)");
} else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("DFFS(\"" + config.getBaseCrCode() + "\"," + project.getYear() + "," + period + ",1,,)");
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("DFFS(\"" + config.getBaseCrCode() + "\"," + project.getYear() + "," + period + ",3,,)");
} else {
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("");
}
......@@ -932,7 +934,7 @@ public class ReportServiceImpl extends BaseService {
sumStr += cellNum + ",";
}
sumStr += "\")";
sumStr = sumStr.replace(",\")", "\")");
// sumStr = sumStr.replace(",\")", "\")");
sumRow.getCell(entry.getKey()).setCellValue(sumStr);
}
......
......@@ -186,13 +186,13 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
for (TrialBalanceFinal balance : temp) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(balance.getPeriodCr());
dto.setAmount(balance.getPeriodCrBeq());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.Report.getCode());
contain.add(dto);
}
return temp.stream().mapToDouble(a -> a.getPeriodCr().doubleValue()).sum();
return temp.stream().mapToDouble(a -> a.getPeriodCrBeq().doubleValue()).sum();
}
}
......@@ -183,13 +183,13 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
for (TrialBalanceFinal balance : temp) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
dto.setAmount(balance.getPeriodDr());
dto.setAmount(balance.getPeriodDrBeq());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.Report.getCode());
contain.add(dto);
}
return temp.stream().mapToDouble(a -> a.getPeriodDr().doubleValue()).sum();
return temp.stream().mapToDouble(a -> a.getPeriodDrBeq().doubleValue()).sum();
}
}
......@@ -52,51 +52,63 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
private double assembleData(String revenueTypeName, List<OutputInvoiceDataSourceDto> contain, Integer billType, Integer amountType, OperationEvaluationContext ec) {
String queryDate = formulaContext.getYear() + (formulaContext.getPeriod() < 10 ? ("0" + formulaContext.getPeriod()) : (formulaContext.getPeriod() + ""));
// RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
// typeMappingExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId())
// .andRevenueTypeNameEqualTo(revenueTypeName).andStartDateLessThanOrEqualTo(queryDate)
// .andEndDateGreaterThanOrEqualTo(queryDate);
// List<RevenueTypeMapping> typeMappingList = SpringContextUtil.revenueTypeMappingMapper.selectByExample(typeMappingExample);
// if (CollectionUtils.isEmpty(typeMappingList)) {
// return 0.0;
// }
// List<String> revenueTypes = typeMappingList.stream()
// .map(o -> o.getRevenueTypeName()).collect(Collectors.toList());
RevenueConfigExample configExample = new RevenueConfigExample();
configExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId()).andStartDateLessThanOrEqualTo(queryDate)
.andEndDateGreaterThanOrEqualTo(queryDate).andNameEqualTo(revenueTypeName);
.andEndDateGreaterThanOrEqualTo(queryDate).andNameEqualTo(revenueTypeName).andStatusEqualTo(0);
List<RevenueConfig> configDatas = SpringContextUtil.revenueConfigMapper.selectByExample(configExample);
if (CollectionUtils.isEmpty(configDatas)) {
return 0.0;
}
RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
typeMappingExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId())
.andRevenueTypeNameEqualTo(revenueTypeName).andStartDateLessThanOrEqualTo(queryDate)
.andEndDateGreaterThanOrEqualTo(queryDate).andStatusEqualTo(0);
List<RevenueTypeMapping> typeMappingList = SpringContextUtil.revenueTypeMappingMapper.selectByExample(typeMappingExample);
if (CollectionUtils.isEmpty(typeMappingList)) {
return 0.0;
}
List<Long> revenueTypeIds = configDatas.stream()
.map(o -> o.getId()).collect(Collectors.toList());
List<InvoiceRecord> billDetails = new ArrayList<>();
InvoiceRecordExample invoiceRecordExample = new InvoiceRecordExample();
invoiceRecordExample.createCriteria().andRevenueCofIdIn(revenueTypeIds)
.andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate))
.andInvoiceTypeEqualTo(InvoiceRecordEnum.InvoiceType.MAPPING.get(billType));
List<InvoiceRecord> billDetails1 = SpringContextUtil.invoiceRecordMapper.selectByExample(invoiceRecordExample);
if(CollectionUtils.isNotEmpty(billDetails1)){
Iterator<InvoiceRecord> iterator = billDetails1.iterator();
while (iterator.hasNext()){
if(iterator.next().getModifyRevenueCofId()!=null){
iterator.remove();
InvoiceRecordExample invoiceRecordExample = null;
for(RevenueTypeMapping typeMapping:typeMappingList){
invoiceRecordExample = new InvoiceRecordExample();
invoiceRecordExample.createCriteria().andRevenueCofIdIn(revenueTypeIds)
.andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate))
.andTaxRateEqualTo(typeMapping.getTaxRate())
.andDepartmentEqualTo(typeMapping.getOuName())
.andInvoiceTypeEqualTo(InvoiceRecordEnum.InvoiceType.MAPPING.get(billType));
List<InvoiceRecord> billDetails1 = SpringContextUtil.invoiceRecordMapper.selectByExample(invoiceRecordExample);
if(CollectionUtils.isNotEmpty(billDetails1)){
Iterator<InvoiceRecord> iterator = billDetails1.iterator();
while (iterator.hasNext()){
if(iterator.next().getModifyRevenueCofId()!=null){
iterator.remove();
}
}
billDetails.addAll(billDetails1);
}
invoiceRecordExample = new InvoiceRecordExample();
invoiceRecordExample.createCriteria().andModifyRevenueCofIdIn(revenueTypeIds)
.andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate))
.andTaxRateEqualTo(typeMapping.getTaxRate())
.andDepartmentEqualTo(typeMapping.getOuName())
.andInvoiceTypeEqualTo(InvoiceRecordEnum.InvoiceType.MAPPING.get(billType));
List<InvoiceRecord> billDetails2 = SpringContextUtil.invoiceRecordMapper.selectByExample(invoiceRecordExample);
if(CollectionUtils.isNotEmpty(billDetails2)){
billDetails.addAll(billDetails2);
}
billDetails.addAll(billDetails1);
}
invoiceRecordExample = new InvoiceRecordExample();
invoiceRecordExample.createCriteria().andModifyRevenueCofIdIn(revenueTypeIds)
.andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate))
.andInvoiceTypeEqualTo(InvoiceRecordEnum.InvoiceType.MAPPING.get(billType));
List<InvoiceRecord> billDetails2 = SpringContextUtil.invoiceRecordMapper.selectByExample(invoiceRecordExample);
if(CollectionUtils.isNotEmpty(billDetails2)){
billDetails.addAll(billDetails2);
}
for (InvoiceRecord invoiceRecord : billDetails) {
OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto();
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(invoiceRecord.getInvoiceAmount(),
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
......@@ -156,7 +157,10 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
String[] list = listStr.split(",");
List<PCell> pCells = new ArrayList<>(list.length);
for (String s : list) {
pCells.add(getColumnIndex(s));
if(StringUtils.isNotBlank(s)){
pCells.add(getColumnIndex(s));
}
}
return pCells;
}
......
......@@ -80,4 +80,5 @@ tableau_doc_situation=${tableau_doc_situation}
tableau_global_overview=${tableau_global_overview}
tableau_mexican_tax=${tableau_mexican_tax}
tableau_australian_tax=${tableau_australian_tax}
tableau_brazilian_tax=${tableau_brazilian_tax}
\ No newline at end of file
tableau_brazilian_tax=${tableau_brazilian_tax}
tableau_dashboard=${tableau_dashboard}
\ No newline at end of file
......@@ -70,3 +70,4 @@ tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_2019
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -74,3 +74,5 @@ tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_2019
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -69,3 +69,5 @@ tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_2019
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -74,4 +74,5 @@ tableau_global_overview=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/
tableau_mexican_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://172.20.201.98:8090/trusted/%s/views/UAT_20190409/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_dashboard=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -9,7 +9,7 @@
class="mx-auto d-block"
size="130"
>
<img src="https://demos.creative-tim.com/vue-material-dashboard/img/marc.aba54d65.jpg">
<img src="../assets/dts-mine.png">
</v-avatar>
<v-card-text class="text-xs-center">
<h6 class="category text-gray font-weight-thin mb-9"></h6>
......
......@@ -50,6 +50,7 @@
clipped-right
height="90"
color="#ffffff"
style="border-bottom: 1px solid #dddddd"
>
<!--<v-toolbar-side-icon @click.stop="drawer = !drawer"></v-toolbar-side-icon>
<v-toolbar-title></v-toolbar-title>
......@@ -60,7 +61,7 @@
>
<svg class="icon" aria-hidden="true" ><use
:xlink:href="selectedItem.iconName"></use></svg>
<span style="vertical-align: middle; margin-left: 10px; font-size:27px" v-text="selectedItem.title"></span>
<span style="vertical-align: middle; margin-left: 10px;font-weight:normal; font-size:26px" v-text="selectedItem.title"></span>
<v-icon style="vertical-align: middle;margin-top:5px;float:right;height:28px;width:28px;color:#333333;">menu</v-icon>
</span>
......
......@@ -1905,5 +1905,22 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui.
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
$stateProvider.state({
name: 'analysisDashboard',
url: "/analysis/analysisDashboard",
dsr: true,
views: {
'importContent': {
controller: ['$scope', '$state','appTranslation',
function ($scope, $state, appTranslation) {
$scope.state = $state;
appTranslation.load([appTranslation.appPart]);
}],
template: '<analysis-dashboard></analysis-dashboard>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.analysis),
sticky: true
});
}]);
\ No newline at end of file
......@@ -63,7 +63,7 @@
<!--@Html.AntiForgeryToken()-->
<div class="wrapper">
<app-nav></app-nav>
<div class="page-wrapper" style="position:relative;overflow-x:hidden;overflow-y:auto;margin-top:55px">
<div class="page-wrapper" style="position:relative;overflow-x:hidden;margin-top:55px">
<div class="main-contents" ui-view></div>
<div class="data-import-contents" ui-view="importContent"></div><!--style="display: none"-->
</div>
......
{
"DocumentAttr":"DocumentAttr",
"DocumentType":"DocumentType",
"DocumentName":"DocumentName",
"Document Attribute":"Document Attribute",
"Document Type":"Document Type",
"Document Name":"Document Name",
"IsRequired":"Is Required",
"PleaseChecksRequired":"Please Checks Required",
"BusinessLine":"BusinessLine",
"CorporationName":"CorporationName",
"AvailabilityDate":"AvailabilityDate",
"Duration":"Duration",
"DueDate":"DueDate",
"TaxType":"TaxType",
"EntityIndex":"EntityIndex",
"EntityStorageLocation":"EntityStorageLocation",
"EntityCustodian":"EntityCustodian",
"ApprovalStatus":"ApprovalStatus",
"Business Line":"Business Line",
"Company Name":"Company Name",
"Effective_Date":"Effective_Date",
"Period":"Period",
"Due Date":"Due Date",
"Tax Type":"Tax Type",
"Storage Index":"Storage Index",
"Storage Location":"Storage Location",
"Custodian":"Custodian",
"Approval Status":"Approval Status",
"ApprovalPass":"ApprovalPass",
"ApprovalReject":"ApprovalReject",
"ApprovalStandby":"ApprovalStandby",
"UploadDate":"UploadDate",
"Upload Date":"Upload Date",
"Creator":"Creator",
"Remarks":"Remarks",
"MoreFields":"MoreFields",
"LessFields":"LessFields",
"More":"More",
"Less":"Less",
"Search":"Search",
"Reset":"Reset",
"Preview":"Preview",
"DelRecord":"DelRecord",
"CreateRecord":"CreateRecord",
"ExportTable":"ExportTable",
"DownloadAttachment":"DownloadAttachment",
"Delete Record":"Delete Record",
"Create Record":"Create Record",
"Export Record":"Export Record",
"Download Attachment":"Download Attachment",
"Log":"Log",
"MultiUpload":"MultiUpload",
"Multiple File Upload":"Multiple File Upload",
"MultiUploadFailList":"MultiUploadFailList",
"UnFile":"UnFile",
"UnRecord":"UnRecord",
......@@ -44,18 +44,20 @@
"Edited":"Edited",
"Created":"Created",
"CoverConfirm":"CoverConfirm",
"NoData":"NoData",
"PleaseSelected":"PleaseSelected",
"PleaseType":"PleaseType",
"No Data":"No Data",
"Please Select":"Please Select",
"Please Type":"Please Type",
"Tips":"Tips",
"EntityStorageDescription":"EntityStorageDescription",
"multiUpload":"multiUpload",
"UploadAttach":"UploadAttach",
"Edit":"Edit",
"DocumentPath":"DocumentPath",
"Document Path":"Document Path",
"PreviewFile":"PreviewFile",
"UploadSuccessCount":"UploadSuccessCount",
"UploadFailCount":"UploadFailCount",
"DeleteConfirm":"DeleteConfirm",
"FileTimeDateRangeError":"FileTimeDateRangeError"
"Confirm delete":"Confirm delete",
"FileTimeDateRangeError":"FileTimeDateRangeError",
"Warning":"Warning",
"Page {0} of {1} ({2} items)":"Page {0} of {1} ({2} items)"
}
\ No newline at end of file
......@@ -896,17 +896,18 @@
"InternationalDataImport":"国际税数据",
"TBEBITForm":"TP EBIT 表格",
"ClickEnsureTip": "请点击确定按钮!",
"MenuUnreturnedTax": "未返还税金分析",
"MenuTaxComparison": "未返还/返还后税金比较",
"MenuUnreturnedTax": "税负分析",
"MenuTaxComparison": "返还情况",
"MenuCostAnalysis": "费用分析",
"MenuProfitAndLoss": "利润/亏损分析",
"MenuOtherDomesticData": "其他国内数据",
"MenuProfitAndLoss": "利润分析",
"MenuOtherDomesticData": "个税分析",
"MenuDocSituation": "档案归档情况",
"MenuGlobalOverview": "全球概览",
"MenuMexicanTax": "墨西哥税务分析",
"MenuAustralianTax": "澳洲税务分析",
"MenuBrazilianTax": "巴西税务分析",
"MenuOtherCountries": "其他国家税务分析",
"MenuDashboard": "Dashboard",
"ApproveCommitted":"审核中",
"ApproveAgreed":"通过",
......
{
"DocumentAttr":"档案属性",
"Document Attribute":"档案属性",
"Document":"档案",
"IsRequired":"为必填字段,不能为空,请检查",
"PleaseChecksRequired":"请检查必填字段",
"DocumentType":"档案类型",
"DocumentName":"档案名称",
"BusinessLine":"业务线",
"CorporationName":"公司名称",
"AvailabilityDate":"文件生效日期",
"Duration":"所属期间",
"DueDate":"到期日",
"TaxType":"税种",
"EntityIndex":"实物索引号",
"EntityStorageLocation":"实物存放地点",
"EntityCustodian":"保管人",
"ApprovalStatus":"审批状态",
"Document Type":"档案类型",
"Document Name":"档案名称",
"Business Line":"业务线",
"Company Name":"公司名称",
"Effective_Date":"文件生效日期",
"Period":"所属期间",
"Due Date":"到期日",
"Tax Type":"税种",
"Storage Index":"实物索引号",
"Storage Location":"实物存放地点",
"Custodian":"保管人",
"Approval Status":"审批状态",
"ApprovalPass":"审批通过",
"ApprovalReject":"拒绝审批",
"ApprovalStandby":"待审批",
"UploadDate":"上传日期",
"Upload Date":"上传日期",
"Creator":"创建人",
"Remarks":"档案备注",
"MoreFields":"查看更多",
"LessFields":"收起",
"More":"查看更多",
"Less":"收起",
"Search":"查询",
"Reset":"重置",
"Preview":"预览",
"DelRecord":"删除记录",
"CreateRecord":"新建记录",
"ExportTable":"导出列表",
"DownloadAttachment":"下载附件",
"Delete Record":"删除记录",
"Create Record":"新建记录",
"Export Record":"导出列表",
"Download Attachment":"下载附件",
"Log":"日志",
"MultiUpload":"批量上传",
"Multiple File Upload":"批量上传",
"MultiUploadFailList":"批量上传失败列表",
"UnFile":"未支持的文件类型",
"UnRecord":"当前记录没有附件信息",
......@@ -46,17 +46,19 @@
"Created":"新建成功",
"CoverConfirm":"当前记录已经存在,是否进行覆盖?",
"NoData":"当前无数据可下载",
"PleaseSelected":"请选择",
"PleaseType":"请输入",
"Please Select":"请选择",
"Please Type":"请输入",
"Tips":"提示讯息",
"EntityStorageDescription":"请将实物档案存放地址精确到某个档案柜",
"multiUpload":"批量上传",
"UploadAttach":"上传附件",
"Edit":"编辑",
"DocumentPath":"档案路径",
"Document Path":"档案路径",
"PreviewFile":"预览文件",
"UploadSuccessCount":"个档案上传成功:",
"UploadFailCount":"个档案上传失败:",
"DeleteConfirm":"是否确认删除记录?",
"FileTimeDateRangeError": "'到期日'不能早于'文件生效日期'"
"Confirm delete":"是否确认删除记录?",
"FileTimeDateRangeError": "'到期日'不能早于'文件生效日期'",
"Warning":"提示",
"Page {0} of {1} ({2} items)":"当前 {0}页 /共 {1}页 ({2} 项)"
}
\ No newline at end of file
......@@ -780,6 +780,7 @@
"ImportShipmentList": "导入发车清单",
"ImportShipmentListGd": "导入发车清单-GD",
"ImportSuccess": "导入成功",
"ImportSuccessCount": "导入成功,验证失败:",
"ImportTrialBalance": "导入试算平衡表",
"ImportTypeTip": "需要清除本月导入的财务数据,是否确认?",
"Import_AccountMapping": "科目对应",
......
analysisModule.controller('AnalysisDashboardController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
'apiConfig',
function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
'use strict';
function init() {
$http.get('/tableau/dashboard', apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var placeholderDiv = document.getElementById('vizContainer');
var url = res.data;
var options = {
onFirstInteractive: function() {
// The viz is now ready and can be safely used.
console.log("Run this code when the viz has finished loading.");
}
};
try{
new tableau.Viz(placeholderDiv, url, options);
}catch (e) {
}
}else {
SweetAlert.error($translate.instant('SystemError'));
}
});
}
init();
(function initialize() {
})();
}
]);
\ No newline at end of file
<div id="vizContainer" style="display: flex; justify-content: center; height: 90%"></div>
\ No newline at end of file
analysisModule.directive('analysisDashboard', ['$log',
function ($log) {
'use strict';
return {
restrict: 'E',
templateUrl: '/app/analysis/dashboard/dashboard/dashboard.html' + '?_=' + Math.random(),
scope: {
serviceTypeId: "=?",
periodId: "=?"
},
controller: 'AnalysisDashboardController',
link: function (scope, element) {
$('.main-contents')[0].style.width = "260px";
$('.data-import-contents')[0].style.display = "block";
$('.main-contents')[0].style.float = "left";
$('.main-contents')[0].style.styleFloat = "left";
$('.main-contents')[0].style.cssFloat = "left";
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
\ No newline at end of file
......@@ -71,7 +71,9 @@
</div>
</div>
</form>
<div id="progress">
<div id="progressBarStatus" dx-progress-bar="progressBarOptions"></div>
</div>
<div class="dt-init-wrapper">
<div class="dx-viewport grid-container">
<div id="taxGridContainer" dx-data-grid="taxGridOptions"
......
......@@ -206,6 +206,7 @@
withCredentials: true
}).then(function (resp) {
var ret = resp.data;
$scope.fileName = '';
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
......@@ -640,6 +641,7 @@
$scope.selectType = i.type;
$scope.showInternationalBUDataGrid = false;
$scope.showInternationalTaxDataGrid = false;
$scope.fileName='';
switch (i.code) {
case 100:
$scope.showInternationalBUDataGrid = true;
......
......@@ -171,7 +171,7 @@
__RequestVerificationToken: token,
withCredentials: true
}).then(function(data) {
$scope.fileName='';
$scope.fileNameShow=false;
$('#busy-indicator-container').hide();
var resp = data.data;
deferred.resolve();
......
......@@ -42,7 +42,7 @@
<i class="fa fa-calendar imp-subheader red-color" style="width:20px;"></i>
</div>
</div>
<div ng-show="fileName" style="display:inline-block">
<div ng-show="fileNameShow" style="display:inline-block">
<span title="{{fileName}}">{{'FileName' | translate}}{{fileName | limitString:20}}</span>
</div>
<div class="form-group">
......
......@@ -192,6 +192,7 @@
withCredentials: true
}).then(function(resp) {
var ret = resp.data;
$('#busy-indicator-container').hide();
deferred.resolve();
if (ret.result) {
......
......@@ -210,7 +210,6 @@
vatOperationLogService.addOperationLog(logDto);
}
getImportRLITStatus();
}, function(resp) {
deferred.resolve();
if (resp.statusText === 'HttpRequestValidationException') {
......
......@@ -133,7 +133,6 @@
//todo:注册之后这里去掉注释
//var sheet = spread.getActiveSheet();
var sheet;
if (constant.regesterInformation.active) {
sheet = spread.getActiveSheet();
......
......@@ -1234,6 +1234,5 @@
_.extend(scope.selectOrgOptions, exp);
};
/*-----------------------------------------------------------------------------------------*/
})(window)
\ No newline at end of file
......@@ -78,7 +78,7 @@ frameworkModule.controller('appUsrOperateLogController',
},
pager: {
allowedPageSizes: 5,
infoText: "当前 {0}页 /共 {1}页 ({2} 项)",
infoText:$translate.instant('Page {0} of {1} ({2} items)'),
showInfo: true,
showNavigationButtons: true,
showPageSizeSelector: true,
......
......@@ -40,7 +40,7 @@
<button class="btn log-export-btn" ng-click="exportTableData()">
<i class="fa fa-file-excel-o"></i>
<span translate="ExportTable"></span>
<span translate="Export Record"></span>
</button>
<div dx-data-grid="dataGridOptions"></div>
</div>
......
......@@ -134,7 +134,21 @@ taxDocumentManageModule.factory('taxDocumentListService',
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/previewExcelToJson', params);
},
readPDF:function(params){
return jqFetch.post(apiInterceptor.webApiHostUrl + '/taxDoc/previewPDF', params);
$('#busy-indicator-container').show();
var defer = $q.defer();
var xhr = new XMLHttpRequest();
xhr.onload = function(result) {
if (this.status == 200) {
var blob = this.response;
defer.resolve(blob,xhr.status,xhr.getAllResponseHeaders());
}
};
xhr.open("post", apiInterceptor.webApiHostUrl + "/taxDoc/previewPDF", true);
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType="blob";
xhr.send(JSON.stringify(params));
return defer.promise;
},
getBinaryData:function(url){
var defer = $q.defer();
......@@ -169,12 +183,17 @@ taxDocumentManageModule.factory('taxDocumentListService',
return defer.promise;
},
viewExcelBySpread:function (url) {
viewExcelBySpread:function (fileType,url) {
var deferred = $q.defer();
var promise = deferred.promise;
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true); // 也可以使用POST方式,根据接口
if("xls"==fileType){
xhr.open('POST', apiInterceptor.webApiHostUrl + '/taxDoc/convertExcel', true);
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
}else{
xhr.open('GET', url, true);
}
xhr.responseType = "blob"; // 返回类型blob
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
xhr.onload = function () {
......@@ -193,7 +212,9 @@ taxDocumentManageModule.factory('taxDocumentListService',
}
};
// 发送ajax请求
xhr.send();
var data=new FormData();
data.append("url",url);
xhr.send(data);
return promise;
}
};
......
.color_active[data-v-1ced4d0d]{color:red!important}.head[data-v-0817fb63]{height:90px;background-color:red}.icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.color_active{color:red!important}
\ No newline at end of file
.color_active[data-v-1ced4d0d]{color:red!important}.head[data-v-579027fe]{height:90px;background-color:red}.icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}
\ No newline at end of file
......@@ -49,4 +49,4 @@
//send 发送
xmlhttp.send();
}*/</script><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href=font_roboto.css><link rel=stylesheet href=font_material.css><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.8f5ac7e7.css rel=preload as=style><link href=css/chunk-vendors.ce5e3dd4.css rel=preload as=style><link href=js/app.cf3691a6.js rel=preload as=script><link href=js/chunk-vendors.670ff040.js rel=preload as=script><link href=css/chunk-vendors.ce5e3dd4.css rel=stylesheet><link href=css/app.8f5ac7e7.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.670ff040.js></script><script src=js/app.cf3691a6.js></script></body></html>
\ No newline at end of file
}*/</script><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href=font_roboto.css><link rel=stylesheet href=font_material.css><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.e87f05ce.css rel=preload as=style><link href=css/chunk-vendors.ce5e3dd4.css rel=preload as=style><link href=js/app.6ae9ce65.js rel=preload as=script><link href=js/chunk-vendors.670ff040.js rel=preload as=script><link href=css/chunk-vendors.ce5e3dd4.css rel=stylesheet><link href=css/app.e87f05ce.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.670ff040.js></script><script src=js/app.6ae9ce65.js></script></body></html>
\ No newline at end of file
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