Commit 4310c448 authored by eddie.woo's avatar eddie.woo

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

parents 05a3886a c87e4d86
...@@ -22,6 +22,7 @@ import pwc.taxtech.atms.vat.service.impl.InputInvoiceDataImportServiceImpl; ...@@ -22,6 +22,7 @@ import pwc.taxtech.atms.vat.service.impl.InputInvoiceDataImportServiceImpl;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
...@@ -47,11 +48,14 @@ public class InputInvoiceImportController { ...@@ -47,11 +48,14 @@ public class InputInvoiceImportController {
public void downloadInvoiceQueryData(@RequestBody InputInvoicePreviewQueryParam paras, HttpServletResponse response, public void downloadInvoiceQueryData(@RequestBody InputInvoicePreviewQueryParam paras, HttpServletResponse response,
@RequestHeader("from") String projectId) { @RequestHeader("from") String projectId) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + UUID.randomUUID() + ".xlsx"); response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
response.setHeader("x-file-name", UUID.randomUUID() + ".xlsx"); response.setCharacterEncoding("UTF-8");
String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
OutputStream os = null; OutputStream os = null;
try { try {
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName);
os = response.getOutputStream(); os = response.getOutputStream();
int count = getDownloadFilePath(paras, os, projectId); int count = getDownloadFilePath(paras, os, projectId);
...@@ -97,7 +101,7 @@ public class InputInvoiceImportController { ...@@ -97,7 +101,7 @@ public class InputInvoiceImportController {
List<InputInvoiceExportDto> inputInvoiceExportDtos = Lists.newArrayList(); List<InputInvoiceExportDto> inputInvoiceExportDtos = Lists.newArrayList();
for(InputInvoice inputInvoice : list){ for(InputInvoice inputInvoice : list){
InputInvoiceExportDto inputInvoiceExportDto = new InputInvoiceExportDto(); InputInvoiceExportDto inputInvoiceExportDto = new InputInvoiceExportDto();
inputInvoiceExportDto.setAmount(inputInvoice.getHJJE()); inputInvoiceExportDto.setAmount(inputInvoice.getHJJE() != null ? new BigDecimal(inputInvoice.getHJJE().replace(",","")): BigDecimal.ZERO);
inputInvoiceExportDto.setCertificationDate(inputInvoice.getRZSJ()); inputInvoiceExportDto.setCertificationDate(inputInvoice.getRZSJ());
inputInvoiceExportDto.setInvoiceCode(inputInvoice.getFPDM()); inputInvoiceExportDto.setInvoiceCode(inputInvoice.getFPDM());
inputInvoiceExportDto.setInvoiceDate(inputInvoice.getKPRQ()); inputInvoiceExportDto.setInvoiceDate(inputInvoice.getKPRQ());
...@@ -105,7 +109,7 @@ public class InputInvoiceImportController { ...@@ -105,7 +109,7 @@ public class InputInvoiceImportController {
inputInvoiceExportDto.setInvoiceTypeName(getFplx(inputInvoice.getFPLX())); inputInvoiceExportDto.setInvoiceTypeName(getFplx(inputInvoice.getFPLX()));
inputInvoiceExportDto.setPeriodId(Integer.parseInt(inputInvoice.getRZSJ().substring(5, 7))); inputInvoiceExportDto.setPeriodId(Integer.parseInt(inputInvoice.getRZSJ().substring(5, 7)));
inputInvoiceExportDto.setSellerTaxNumber(inputInvoice.getXFSH()); inputInvoiceExportDto.setSellerTaxNumber(inputInvoice.getXFSH());
inputInvoiceExportDto.setTaxAmount(inputInvoice.getHJSE()); inputInvoiceExportDto.setTaxAmount(inputInvoice.getHJSE() != null ? new BigDecimal(inputInvoice.getHJJE().replace(",","")) : BigDecimal.ZERO);
inputInvoiceExportDtos.add(inputInvoiceExportDto); inputInvoiceExportDtos.add(inputInvoiceExportDto);
} }
Map<String, String> header = new HashMap<>(); Map<String, String> header = new HashMap<>();
...@@ -119,6 +123,12 @@ public class InputInvoiceImportController { ...@@ -119,6 +123,12 @@ public class InputInvoiceImportController {
header.put("TaxAmount", "税额"); header.put("TaxAmount", "税额");
header.put("CertificationDate", "认证日期"); header.put("CertificationDate", "认证日期");
InputInvoiceExportDto inputInvoiceExportDto = new InputInvoiceExportDto();
inputInvoiceExportDto.setTaxAmount(inputInvoiceExportDtos.stream().map(InputInvoiceExportDto::getTaxAmount).reduce(BigDecimal::add).get());
inputInvoiceExportDto.setAmount(inputInvoiceExportDtos.stream().map(InputInvoiceExportDto::getAmount).reduce(BigDecimal::add).get());
InputInvoiceExportDto black = new InputInvoiceExportDto();
inputInvoiceExportDtos.add(black);
inputInvoiceExportDtos.add(inputInvoiceExportDto);
ExcelSheet excelSheetA = new ExcelSheet<>(); ExcelSheet excelSheetA = new ExcelSheet<>();
excelSheetA.setHeaders(header); excelSheetA.setHeaders(header);
excelSheetA.setDataset(inputInvoiceExportDtos); excelSheetA.setDataset(inputInvoiceExportDtos);
...@@ -143,16 +153,26 @@ public class InputInvoiceImportController { ...@@ -143,16 +153,26 @@ public class InputInvoiceImportController {
List<InputInvoiceDetail> inputInvoiceDetailList = inputInvoiceDataImportService.getInputInvoiceItemList(item.getID()); List<InputInvoiceDetail> inputInvoiceDetailList = inputInvoiceDataImportService.getInputInvoiceItemList(item.getID());
for(InputInvoiceDetail inputInvoiceDetail : inputInvoiceDetailList){ for(InputInvoiceDetail inputInvoiceDetail : inputInvoiceDetailList){
InputInvoiceDetailExportDto inputInvoiceDetailExportDto = new InputInvoiceDetailExportDto(); InputInvoiceDetailExportDto inputInvoiceDetailExportDto = new InputInvoiceDetailExportDto();
inputInvoiceDetailExportDto.setAmount(inputInvoiceDetail.getJE()); inputInvoiceDetailExportDto.setAmount(inputInvoiceDetail.getJE() != null ? new BigDecimal(inputInvoiceDetail.getJE().replace(",","")) : BigDecimal.ZERO);
inputInvoiceDetailExportDto.setInvoiceCode(inputInvoiceDetail.getFPDM()); inputInvoiceDetailExportDto.setInvoiceCode(inputInvoiceDetail.getFPDM());
inputInvoiceDetailExportDto.setInvoiceNumber(inputInvoiceDetail.getFPHM()); inputInvoiceDetailExportDto.setInvoiceNumber(inputInvoiceDetail.getFPHM());
inputInvoiceDetailExportDto.setPeriodId(Integer.parseInt(item.getRZSJ().substring(5, 7))); inputInvoiceDetailExportDto.setPeriodId(Integer.parseInt(item.getRZSJ().substring(5, 7)));
inputInvoiceDetailExportDto.setProductionName(inputInvoiceDetail.getSPMC()); inputInvoiceDetailExportDto.setProductionName(inputInvoiceDetail.getSPMC());
inputInvoiceDetailExportDto.setTaxAmount(inputInvoiceDetail.getSE()); inputInvoiceDetailExportDto.setTaxAmount(inputInvoiceDetail.getSE() != null ? new BigDecimal(inputInvoiceDetail.getSE().replace(",","")) : BigDecimal.ZERO);
inputInvoiceDetailExportDto.setTaxRate(inputInvoiceDetail.getSLV()); inputInvoiceDetailExportDto.setTaxRate(inputInvoiceDetail.getSLV());
inputInvoiceItemList.add(inputInvoiceDetailExportDto); inputInvoiceItemList.add(inputInvoiceDetailExportDto);
} }
} }
InputInvoiceDetailExportDto inputInvoiceDetailExportDto = new InputInvoiceDetailExportDto();
inputInvoiceDetailExportDto.setTaxAmount(inputInvoiceItemList.stream().map(InputInvoiceDetailExportDto::getTaxAmount).reduce(BigDecimal::add).get());
inputInvoiceDetailExportDto.setAmount(inputInvoiceItemList.stream().map(InputInvoiceDetailExportDto::getAmount).reduce(BigDecimal::add).get());
InputInvoiceDetailExportDto detailBlack = new InputInvoiceDetailExportDto();
inputInvoiceItemList.add(detailBlack);
inputInvoiceItemList.add(inputInvoiceDetailExportDto);
excelSheetB.setDataset(inputInvoiceItemList); excelSheetB.setDataset(inputInvoiceItemList);
List<ExcelSheet<InputVATInvoiceBaseDto>> sheets = new ArrayList<>(); List<ExcelSheet<InputVATInvoiceBaseDto>> sheets = new ArrayList<>();
sheets.add(excelSheetA); sheets.add(excelSheetA);
......
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil; import com.github.pagehelper.util.StringUtil;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
...@@ -24,6 +25,7 @@ import pwc.taxtech.atms.vat.service.impl.OutputInvoiceServiceImpl; ...@@ -24,6 +25,7 @@ import pwc.taxtech.atms.vat.service.impl.OutputInvoiceServiceImpl;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
...@@ -53,11 +55,14 @@ public class OutputInvoiceController { ...@@ -53,11 +55,14 @@ public class OutputInvoiceController {
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) { public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8"); response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
+ UUID.randomUUID() + ".xls"); String fileName = paras.getPeriodStart() + "-" + paras.getPeriodEnd();
response.setHeader("x-file-name", UUID.randomUUID() + ".xlsx"); response.setCharacterEncoding("UTF-8");
OutputStream os = null; OutputStream os = null;
try { try {
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
response.addHeader("x-file-name", fileName);
os = response.getOutputStream(); os = response.getOutputStream();
int count = getDownloadFilePath(paras, projectId, os); int count = getDownloadFilePath(paras, projectId, os);
...@@ -86,6 +91,13 @@ public class OutputInvoiceController { ...@@ -86,6 +91,13 @@ public class OutputInvoiceController {
if (list.size() == 0) { if (list.size() == 0) {
return 0; return 0;
} }
OutputVATInvoiceInfoDto outputVATInvoiceInfoDto = new OutputVATInvoiceInfoDto();
outputVATInvoiceInfoDto.setTaxAmount(list.stream().map(OutputVATInvoiceInfoDto::getTaxAmount).reduce(BigDecimal::add).get());
outputVATInvoiceInfoDto.setAmount(list.stream().map(OutputVATInvoiceInfoDto::getAmount).reduce(BigDecimal::add).get());
OutputVATInvoiceInfoDto black = new OutputVATInvoiceInfoDto();
list.add(black);
list.add(outputVATInvoiceInfoDto);
List<pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto> list2 = new ArrayList<>(); List<pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto> list2 = new ArrayList<>();
list.stream().forEach(x -> { list.stream().forEach(x -> {
pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto d = pwc.taxtech.atms.dto.vatdto.OutputVATInvoiceInfoDto d =
...@@ -114,6 +126,7 @@ public class OutputInvoiceController { ...@@ -114,6 +126,7 @@ public class OutputInvoiceController {
header.put("TaxRate", "税率"); header.put("TaxRate", "税率");
header.put("TaxAmount", "税额"); header.put("TaxAmount", "税额");
header.put("TaxClassCode", "税收分类编码"); header.put("TaxClassCode", "税收分类编码");
ExcelUtil.exportExcel(header, list2, outputStream); ExcelUtil.exportExcel(header, list2, outputStream);
return list.size(); return list.size();
} }
......
...@@ -33,6 +33,11 @@ public class ReportController { ...@@ -33,6 +33,11 @@ public class ReportController {
return reportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period); return reportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period);
} }
@RequestMapping(value = "filterTemplate/{projectId}/{serviceType}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getFilterTemplate(@PathVariable String projectId, @PathVariable int serviceType, @PathVariable Integer period) {
return reportService.getFilterReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType), period);
}
@RequestMapping(value = "generateByTotal/{projectId}/{mergeManual}/{period}", method = RequestMethod.POST, @RequestMapping(value = "generateByTotal/{projectId}/{mergeManual}/{period}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE) produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity generateAllData(@PathVariable String projectId, @PathVariable Integer period, public ResponseEntity generateAllData(@PathVariable String projectId, @PathVariable Integer period,
...@@ -42,14 +47,17 @@ public class ReportController { ...@@ -42,14 +47,17 @@ public class ReportController {
@RequestMapping(value = "getRunningJob/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getRunningJob/{projectId}/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody @ResponseBody
public PeriodJob getRunningJob(@PathVariable String projectId, @PathVariable Integer period) { public PeriodJobDto getRunningJob(@PathVariable String projectId, @PathVariable Integer period) {
return reportService.getRunningJob(projectId, period); PeriodJob job = reportService.getRunningJob(projectId, period);
if (job != null)
return new PeriodJobDto().copyFromPeriodJob(job);
else return null;
} }
@RequestMapping(value = "getJobStatus/{projectId}//{period}/{jobId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "getJobStatus/{projectId}//{period}/{jobId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody @ResponseBody
public PeriodJob getJobStatus(@PathVariable String projectId, @PathVariable Integer period, @PathVariable String jobId) { public PeriodJobDto getJobStatus(@PathVariable String projectId, @PathVariable Integer period, @PathVariable String jobId) {
return reportService.getJobStatus(projectId, period, jobId); return new PeriodJobDto().copyFromPeriodJob(reportService.getJobStatus(projectId, period, jobId));
} }
@RequestMapping(value = "templateReferences/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "templateReferences/{period}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
......
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.dto.vatdto; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.thirdparty.ExcelCell; import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
public class InputInvoiceDetailExportDto implements Serializable { public class InputInvoiceDetailExportDto implements Serializable {
...@@ -16,10 +17,10 @@ public class InputInvoiceDetailExportDto implements Serializable { ...@@ -16,10 +17,10 @@ public class InputInvoiceDetailExportDto implements Serializable {
private String invoiceNumber; private String invoiceNumber;
@ExcelCell(index=2) @ExcelCell(index=2)
private String amount; private BigDecimal amount;
@ExcelCell(index=1) @ExcelCell(index=1)
private String taxAmount; private BigDecimal taxAmount;
@ExcelCell(index=3) @ExcelCell(index=3)
private String taxRate; private String taxRate;
...@@ -51,19 +52,19 @@ public class InputInvoiceDetailExportDto implements Serializable { ...@@ -51,19 +52,19 @@ public class InputInvoiceDetailExportDto implements Serializable {
this.invoiceNumber = invoiceNumber; this.invoiceNumber = invoiceNumber;
} }
public String getAmount() { public BigDecimal getAmount() {
return amount; return amount;
} }
public void setAmount(String amount) { public void setAmount(BigDecimal amount) {
this.amount = amount; this.amount = amount;
} }
public String getTaxAmount() { public BigDecimal getTaxAmount() {
return taxAmount; return taxAmount;
} }
public void setTaxAmount(String taxAmount) { public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount; this.taxAmount = taxAmount;
} }
......
...@@ -3,11 +3,12 @@ package pwc.taxtech.atms.dto.vatdto; ...@@ -3,11 +3,12 @@ package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.thirdparty.ExcelCell; import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
public class InputInvoiceExportDto implements Serializable { public class InputInvoiceExportDto implements Serializable {
@ExcelCell(index=6) @ExcelCell(index=6)
private int periodId; private Integer periodId;
@ExcelCell(index=7) @ExcelCell(index=7)
private String invoiceDate; private String invoiceDate;
...@@ -25,19 +26,19 @@ public class InputInvoiceExportDto implements Serializable { ...@@ -25,19 +26,19 @@ public class InputInvoiceExportDto implements Serializable {
private String invoiceTypeName; private String invoiceTypeName;
@ExcelCell(index=4) @ExcelCell(index=4)
private String amount; private BigDecimal amount;
@ExcelCell(index=1) @ExcelCell(index=1)
private String taxAmount; private BigDecimal taxAmount;
@ExcelCell(index=2) @ExcelCell(index=2)
private String certificationDate; private String certificationDate;
public int getPeriodId() { public Integer getPeriodId() {
return periodId; return periodId;
} }
public void setPeriodId(int periodId) { public void setPeriodId(Integer periodId) {
this.periodId = periodId; this.periodId = periodId;
} }
...@@ -81,19 +82,19 @@ public class InputInvoiceExportDto implements Serializable { ...@@ -81,19 +82,19 @@ public class InputInvoiceExportDto implements Serializable {
this.invoiceTypeName = invoiceTypeName; this.invoiceTypeName = invoiceTypeName;
} }
public String getAmount() { public BigDecimal getAmount() {
return amount; return amount;
} }
public void setAmount(String amount) { public void setAmount(BigDecimal amount) {
this.amount = amount; this.amount = amount;
} }
public String getTaxAmount() { public BigDecimal getTaxAmount() {
return taxAmount; return taxAmount;
} }
public void setTaxAmount(String taxAmount) { public void setTaxAmount(BigDecimal taxAmount) {
this.taxAmount = taxAmount; this.taxAmount = taxAmount;
} }
......
package pwc.taxtech.atms.dto.vatdto;
import io.jsonwebtoken.lang.Collections;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.PeriodJob;
import java.util.Date;
import java.util.List;
import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
@Getter
@Setter
public class PeriodJobDto {
private String id;
private String name;
private String currentStep;
private String projectId;
private Integer period;
private String stepsCode;
private Date createTime;
private String status;
private String errorMsg;
private String jobStatus;
public PeriodJobDto copyFromPeriodJob(PeriodJob job) {
this.id = job.getId();
this.name = job.getName();
this.currentStep = job.getCurrentStep();
this.projectId = job.getProjectId();
this.period = job.getPeriod();
this.stepsCode = job.getStepsCode();
this.createTime = job.getCreateTime();
this.status = job.getStatus();
this.errorMsg = job.getErrorMsg();
MyAsserts.assertNotEmpty(stepsCode, Exceptions.SERVER_ERROR_EXCEPTION);
if (StringUtils.isBlank(status)) this.jobStatus = STATUS_BEGIN;
else {
List<WrapPeriodJobDto.Task> tasks = WrapPeriodJobDto.fromJson(status);
if (Collections.isEmpty(tasks)) this.jobStatus = STATUS_BEGIN;
else {
String[] codes = stepsCode.split(",");
if (tasks.stream().anyMatch(m -> m.status.equals(STATUS_ERROR))) this.jobStatus = STATUS_ERROR;
else if (tasks.size() < codes.length) this.jobStatus = STATUS_RUNNING;
else this.jobStatus = STATUS_END;
}
}
return this;
}
}
...@@ -20,6 +20,7 @@ import java.util.UUID; ...@@ -20,6 +20,7 @@ import java.util.UUID;
public class WrapPeriodJobDto { public class WrapPeriodJobDto {
public static final String STATUS_BEGIN = "Begin"; public static final String STATUS_BEGIN = "Begin";
public static final String STATUS_RUNNING = "Running";
public static final String STATUS_CANCEL = "Cancel"; public static final String STATUS_CANCEL = "Cancel";
public static final String STATUS_ERROR = "Error"; public static final String STATUS_ERROR = "Error";
public static final String STATUS_END = "End"; public static final String STATUS_END = "End";
......
...@@ -290,7 +290,8 @@ public class CellTemplateServiceImpl extends AbstractService { ...@@ -290,7 +290,8 @@ public class CellTemplateServiceImpl extends AbstractService {
} }
if (nameList.isEmpty()) { if (nameList.isEmpty()) {
return formula; // return formula;
return "报表公式";
} else { } else {
return String.join("+", nameList); return String.join("+", nameList);
} }
......
...@@ -337,6 +337,9 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -337,6 +337,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
List<Template> filePathList = Lists.newArrayList(); List<Template> filePathList = Lists.newArrayList();
Date now = new Date(); Date now = new Date();
TemplateExample t = new TemplateExample();
t.createCriteria().andTemplateGroupIdEqualTo(templateGroupId);
int length = templateMapper.selectByExample(t).size();
for (int i = 0; i < workbook.getNumberOfSheets(); i++) { for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
String sheetName = workbook.getSheetName(i); String sheetName = workbook.getSheetName(i);
String newName = sheetName + CommonUtils.getUUID() + POIUtil.getFileSuffix(fileName).get(); String newName = sheetName + CommonUtils.getUUID() + POIUtil.getFileSuffix(fileName).get();
...@@ -346,7 +349,19 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -346,7 +349,19 @@ public class TemplateGroupServiceImpl extends AbstractService {
throw new ServiceException(ErrorMessage.SystemError); throw new ServiceException(ErrorMessage.SystemError);
} }
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
optional.get().write(bos); Workbook wtemp = optional.get();
Sheet temp = wtemp.getSheetAt(0);
for(int j = temp.getFirstRowNum(); j < temp.getLastRowNum(); j ++){
Row row = temp.getRow(j);
for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){
Cell cell = row.getCell(k);
if(!cell.getCellStyle().getLocked() && StringUtils.isNotBlank(cell.getStringCellValue())
&& cell.getStringCellValue().equalsIgnoreCase("${KeyIn}")){
cell.setCellValue("");
}
}
}
wtemp.write(bos);
String tmpPath = httpFileService.uploadTemplate(newName, file); String tmpPath = httpFileService.uploadTemplate(newName, file);
String[] arr = sheetName.split("_"); String[] arr = sheetName.split("_");
String name = arr.length >= 2 ? arr[1] : arr[0]; String name = arr.length >= 2 ? arr[1] : arr[0];
...@@ -357,7 +372,7 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -357,7 +372,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
template.setIsActiveAssociation(true); template.setIsActiveAssociation(true);
template.setIsSystemType(false); template.setIsSystemType(false);
template.setName(name); template.setName(name);
template.setOrderIndex(i + 1); template.setOrderIndex(i + length);
template.setPath(tmpPath); template.setPath(tmpPath);
template.setReportType(StringUtils.isBlank(reportType) ? null : Integer.valueOf(reportType)); template.setReportType(StringUtils.isBlank(reportType) ? null : Integer.valueOf(reportType));
template.setTemplateGroupId(templateGroupId); template.setTemplateGroupId(templateGroupId);
......
...@@ -15,7 +15,9 @@ import pwc.taxtech.atms.dpo.TemplateUniqDto; ...@@ -15,7 +15,9 @@ import pwc.taxtech.atms.dpo.TemplateUniqDto;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto; import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper; import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample; import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import java.util.*; import java.util.*;
...@@ -27,7 +29,7 @@ import static java.util.stream.Collectors.groupingBy; ...@@ -27,7 +29,7 @@ import static java.util.stream.Collectors.groupingBy;
public class TemplateServiceImpl extends AbstractService { public class TemplateServiceImpl extends AbstractService {
@Autowired @Autowired
private PeriodTemplateMapper periodTemplateMapper; private PeriodReportMapper periodReportMapper;
public void addExistTemplate(TemplateAddExistDto templateAddExistDto){ public void addExistTemplate(TemplateAddExistDto templateAddExistDto){
TemplateExample t = new TemplateExample(); TemplateExample t = new TemplateExample();
...@@ -308,10 +310,10 @@ public class TemplateServiceImpl extends AbstractService { ...@@ -308,10 +310,10 @@ public class TemplateServiceImpl extends AbstractService {
taxReturnGroup.setName(TemplateGroupType.TaxReturn.name()); taxReturnGroup.setName(TemplateGroupType.TaxReturn.name());
List<TemplateDto> templateDtos2 = new ArrayList<>(); List<TemplateDto> templateDtos2 = new ArrayList<>();
templates.stream().filter(x -> { templates.stream().filter(x -> {
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample(); PeriodReportExample periodReportExample = new PeriodReportExample();
periodTemplateExample.createCriteria().andTemplateGroupIdEqualTo(templateGroupId) periodReportExample.createCriteria().andTemplateIdEqualTo(x.getId())
.andTemplateIdEqualTo(x.getId()); .andProjectIdEqualTo(projectId);
return x.getTemplateGroupId().equals(templateGroupId) && periodTemplateMapper.selectByExample(periodTemplateExample).size() > 0; return x.getTemplateGroupId().equals(templateGroupId) && periodReportMapper.selectByExample(periodReportExample).size() > 0;
}).collect(Collectors.toList()).forEach(a -> { }).collect(Collectors.toList()).forEach(a -> {
TemplateDto templateDto = new TemplateDto(); TemplateDto templateDto = new TemplateDto();
CommonUtils.copyProperties(a, templateDto); CommonUtils.copyProperties(a, templateDto);
......
...@@ -3,9 +3,8 @@ package pwc.taxtech.atms.thirdparty; ...@@ -3,9 +3,8 @@ package pwc.taxtech.atms.thirdparty;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.MessageFormat; import java.math.BigDecimal;
import java.text.ParseException; import java.text.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
...@@ -50,6 +49,7 @@ public class ExcelUtil { ...@@ -50,6 +49,7 @@ public class ExcelUtil {
private static Logger LG = LoggerFactory.getLogger(ExcelUtil.class); private static Logger LG = LoggerFactory.getLogger(ExcelUtil.class);
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###,###.00");
/** /**
* 用来验证excel与Vo中的类型是否一致 <br> * 用来验证excel与Vo中的类型是否一致 <br>
* Map<栏位类型,只能是哪些Cell类型> * Map<栏位类型,只能是哪些Cell类型>
...@@ -343,6 +343,8 @@ public class ExcelUtil { ...@@ -343,6 +343,8 @@ public class ExcelUtil {
if (value instanceof Integer) { if (value instanceof Integer) {
int intValue = (Integer) value; int intValue = (Integer) value;
cell.setCellValue(intValue); cell.setCellValue(intValue);
} else if(value instanceof BigDecimal){
textValue = DECIMAL_FORMAT.format(value);
} else if (value instanceof Float) { } else if (value instanceof Float) {
float fValue = (Float) value; float fValue = (Float) value;
cell.setCellValue(fValue); cell.setCellValue(fValue);
......
...@@ -7,6 +7,7 @@ import org.apache.ibatis.session.SqlSession; ...@@ -7,6 +7,7 @@ import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.util.DateUtils; import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.EnumTbImportType; import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.constant.enums.EnumValidationType; import pwc.taxtech.atms.constant.enums.EnumValidationType;
...@@ -67,12 +68,24 @@ public class InputInvoiceDataImportServiceImpl { ...@@ -67,12 +68,24 @@ public class InputInvoiceDataImportServiceImpl {
invoices.stream().forEach(x -> { invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE()))); x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
x.setHJSE(df.format(new BigDecimal(x.getHJSE()))); x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
x.setRZJG(convertRzjg(x.getRZJG()));
} }
); );
PageInfo<InputInvoice> pageInfo = new PageInfo<>(invoices); PageInfo<InputInvoice> pageInfo = new PageInfo<>(invoices);
return pageInfo; return pageInfo;
} }
private String convertRzjg(String rzjg){
if (StringUtils.isEmpty(rzjg)) return "";
switch (rzjg){
case "0":
return "认证成功";
case "1":
return "认证失败";
default:
return "未认证";
}
}
public List<InputVATInvoiceDto> getInputInvoiceList(Integer period) { public List<InputVATInvoiceDto> getInputInvoiceList(Integer period) {
......
...@@ -10,6 +10,7 @@ import org.apache.poi.ss.formula.udf.DefaultUDFFinder; ...@@ -10,6 +10,7 @@ import org.apache.poi.ss.formula.udf.DefaultUDFFinder;
import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.formula.udf.UDFFinder;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -94,6 +95,7 @@ public class ReportGeneratorImpl { ...@@ -94,6 +95,7 @@ public class ReportGeneratorImpl {
String code = sheet.getSheetName(); String code = sheet.getSheetName();
logger.info("-------------------------------------Begin Job [{}]------------------------------------------------------", code); logger.info("-------------------------------------Begin Job [{}]------------------------------------------------------", code);
setStatus(job,code,STATUS_BEGIN); setStatus(job,code,STATUS_BEGIN);
job.setCurrentStep(code);
periodJobMapper.updateByPrimaryKey(job); periodJobMapper.updateByPrimaryKey(job);
Optional<PeriodTemplate> periodTemplate = resources.getPeriodTemplates().stream() Optional<PeriodTemplate> periodTemplate = resources.getPeriodTemplates().stream()
...@@ -198,6 +200,18 @@ public class ReportGeneratorImpl { ...@@ -198,6 +200,18 @@ public class ReportGeneratorImpl {
dataSource.setColumnIndex(colNum - 1); dataSource.setColumnIndex(colNum - 1);
dataSource.setRowIndex(rowNum - 1); dataSource.setRowIndex(rowNum - 1);
if (((XSSFCell) cell).getRawValue() != "#VALUE!") { if (((XSSFCell) cell).getRawValue() != "#VALUE!") {
// if(StringUtils.isNotBlank(cell.getStringCellValue())
// && StringUtils.isNumeric(cell.getStringCellValue().replace(".", ""))){
// dataSource.setAmount(new BigDecimal(cell.getStringCellValue()));
// }
// else if(StringUtils.isBlank(cell.getStringCellValue())){
// dataSource.setAmount(new BigDecimal(Double.toString(cell.getNumericCellValue())));
// }
//// else {
//// cell.setCellFormula(cell.getStringCellValue());
//// FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
//// dataSource.setAmount(new BigDecimal(formulaEvaluator.evaluate(cell).getNumberValue()));
//// }
dataSource.setAmount(new BigDecimal( dataSource.setAmount(new BigDecimal(
((XSSFCell) cell).getRawValue() != null ? ((XSSFCell) cell).getRawValue() != null ?
((XSSFCell) cell).getRawValue() ((XSSFCell) cell).getRawValue()
...@@ -243,10 +257,17 @@ public class ReportGeneratorImpl { ...@@ -243,10 +257,17 @@ public class ReportGeneratorImpl {
.getCell(tempPeriodCellTemplate.get().getColumnIndex()) != null) { .getCell(tempPeriodCellTemplate.get().getColumnIndex()) != null) {
Cell cell = sheet.getRow(tempPeriodCellTemplate.get().getRowIndex()) Cell cell = sheet.getRow(tempPeriodCellTemplate.get().getRowIndex())
.getCell(tempPeriodCellTemplate.get().getColumnIndex()); .getCell(tempPeriodCellTemplate.get().getColumnIndex());
data = ((XSSFCell) cell).getRawValue(); data = ((XSSFCell) cell).getRawValue();
if (data != null && data.equals("#VALUE!")) { if (data != null && data.equals("#VALUE!")) {
FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook);
try{
data = formulaEvaluator.evaluate(cell).getStringValue();
}catch (Exception e){
logger.error(e.getStackTrace().toString());
data = "0.0"; data = "0.0";
} }
}
//evaluator.evaluate(cell); //evaluator.evaluate(cell);
// if (cell.getCellTypeEnum().equals(CellType.NUMERIC)||cell.getCellTypeEnum().equals(CellType.FORMULA)) { // if (cell.getCellTypeEnum().equals(CellType.NUMERIC)||cell.getCellTypeEnum().equals(CellType.FORMULA)) {
// data = Double.toString(cell.getNumericCellValue()); // data = Double.toString(cell.getNumericCellValue());
......
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.service.impl; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
...@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.CommonUtils; 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.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
...@@ -107,6 +109,25 @@ public class ReportServiceImpl { ...@@ -107,6 +109,25 @@ public class ReportServiceImpl {
@Autowired @Autowired
private PeriodApproveMapper periodApprovalMapper; private PeriodApproveMapper periodApprovalMapper;
public OperationResultDto<List<ReportDto>> getFilterReportTemplate(String projectId, EnumServiceType serviceType, Integer periodParam) {
OperationResultDto<List<ReportDto>> result = new OperationResultDto<>();
CommonUtils.copyProperties(getReportTemplate(projectId,serviceType,periodParam),result);
if(!result.getResult() || CollectionUtils.isEmpty(result.getData())) return result;
int period = periodParam != null ? periodParam : 0;
PeriodTemplateExample periodTemplateExample = new PeriodTemplateExample();
periodTemplateExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period);
List<PeriodTemplate> periodTemplateList = periodTemplateMapper.selectByExample(periodTemplateExample);
List<String> ids = Lists.newArrayList();
periodTemplateList.stream().forEach(x -> ids.add(x.getTemplateId() + ""));
List<ReportDto> reportDtos = result.getData().stream().filter(x -> {
return x.getId() != null && ids.contains(x.getTemplateId());
}).collect(Collectors.toList());
result.setData(reportDtos);
return result;
}
public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer periodParam) { public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer periodParam) {
int period = periodParam != null ? periodParam : 0; int period = periodParam != null ? periodParam : 0;
OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>(); OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>();
...@@ -159,7 +180,10 @@ public class ReportServiceImpl { ...@@ -159,7 +180,10 @@ public class ReportServiceImpl {
map.put("projectId", projectId); map.put("projectId", projectId);
map.put("templateGroupID", templateGroupId); map.put("templateGroupID", templateGroupId);
List<ReportDto> reportDtos = templateMapper.getTemplateLeftJoinReport(map); List<ReportDto> reportDtos = templateMapper.getTemplateLeftJoinReport(map);
if (reportDtos.isEmpty()) { if (reportDtos.isEmpty()) {
operationResult.setResultMsg("No Template"); operationResult.setResultMsg("No Template");
return operationResult; return operationResult;
...@@ -492,7 +516,7 @@ public class ReportServiceImpl { ...@@ -492,7 +516,7 @@ public class ReportServiceImpl {
} }
} }
}).start(); }).start();
operationResultDto.setData(genJob); operationResultDto.setData(new PeriodJobDto().copyFromPeriodJob(genJob));
operationResultDto.setResult(true); operationResultDto.setResult(true);
} catch (Exception ex) { } catch (Exception ex) {
operationResultDto.setResult(false); operationResultDto.setResult(false);
......
...@@ -120,7 +120,7 @@ public interface PeriodJobMapper extends MyVatMapper { ...@@ -120,7 +120,7 @@ public interface PeriodJobMapper extends MyVatMapper {
"FROM " + "FROM " +
" PERIOD_JOB " + " PERIOD_JOB " +
"WHERE " + "WHERE " +
" STATUS = 'Begin' " + " STATUS LIKE '%Begin%' " +
" AND PROJECT_ID = #{projectId} " + " AND PROJECT_ID = #{projectId} " +
" AND PERIOD =#{period}") " AND PERIOD =#{period}")
PeriodJob getRunningJob(@Param("projectId") String projectId, @Param("period") Integer period); PeriodJob getRunningJob(@Param("projectId") String projectId, @Param("period") Integer period);
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</where> </where>
</select> </select>
<resultMap id="reportDto" type="pwc.taxtech.atms.dto.vatdto.ReportDto"> <resultMap id="reportDto" type="pwc.taxtech.atms.dpo.ReportDto">
<id column="ID" jdbcType="VARCHAR" property="id"/> <id column="ID" jdbcType="VARCHAR" property="id"/>
<result column="PERIOD" jdbcType="INTEGER" property="period"/> <result column="PERIOD" jdbcType="INTEGER" property="period"/>
<result column="TEMPLATE_ID" jdbcType="INTEGER" property="templateId"/> <result column="TEMPLATE_ID" jdbcType="INTEGER" property="templateId"/>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
headers = headers(); headers = headers();
// Get the filename from the x-filename header or default to "download.bin" // Get the filename from the x-filename header or default to "download.bin"
var filename = decodeURI(headers['x-file-name']) || defaultFileName; var filename = decodeURI(headers['x-file-name']) + defaultFileName;
// Determine the content type from the header or default to "application/octet-stream" // Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime; var contentType = headers['content-type'] || octetStreamMime;
......
...@@ -76,6 +76,13 @@ ...@@ -76,6 +76,13 @@
return $http.get('/Report/template/' + projectId + '/' + serviceType + '/' + period, apiConfig.createVat()); return $http.get('/Report/template/' + projectId + '/' + serviceType + '/' + period, apiConfig.createVat());
}, },
getFilterTemplate: function (projectId, serviceType, period) {
if (!_.isNumber(period)) {
period = 0;
}
return $http.get('/Report/filterTemplate/' + projectId + '/' + serviceType + '/' + period, apiConfig.createVat());
},
getCellVoucher: function (cellDataID) { getCellVoucher: function (cellDataID) {
return $http.get('/Report/cellVoucher/' + cellDataID, apiConfig.createVat()); return $http.get('/Report/cellVoucher/' + cellDataID, apiConfig.createVat());
}, },
......
...@@ -529,7 +529,7 @@ ...@@ -529,7 +529,7 @@
SweetAlert.warning("没有数据可以下载"); SweetAlert.warning("没有数据可以下载");
return; return;
} }
vatExportService.exportToExcel(data, status, headers, '进项发票信息.xlsx'); vatExportService.exportToExcel(data, status, headers, '进项发票信息.xls');
}); });
}; };
...@@ -572,16 +572,16 @@ ...@@ -572,16 +572,16 @@
enableColumnMenus: false, enableColumnMenus: false,
columnDefs: [ columnDefs: [
{ name: $translate.instant('ImportErrorPopUpNoCol'), width: '5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>' }, { name: $translate.instant('ImportErrorPopUpNoCol'), width: '5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.index}}<span></div>' },
{ name: $translate.instant('InvoiceQJ'), width: '8%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.periodID}}<span></div>' }, // { name: $translate.instant('InvoiceQJ'), width: '8%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.periodID}}<span></div>' },
{ name: $translate.instant('InvoiceKPRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}<span></div>' }, { name: $translate.instant('InvoiceKPRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}<span></div>' },
{ name: $translate.instant('InvoiceFPDM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fpdm}}">{{row.entity.fpdm}}</span></div>' }, { name: $translate.instant('InvoiceFPDM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fpdm}}">{{row.entity.fpdm}}</span></div>' },
{ name: $translate.instant('InvoiceFPHM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fphm}}">{{row.entity.fphm}}</span></div>' }, { name: $translate.instant('InvoiceFPHM'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fphm}}">{{row.entity.fphm}}</span></div>' },
{ name: $translate.instant('InvoiceGHFSH'), width: '12%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.xfsh}}">{{row.entity.xfsh}}</span></div>' }, { name: $translate.instant('InvoiceGHFSH'), width: '14%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.xfsh}}">{{row.entity.xfsh}}</span></div>' },
{ name: $translate.instant('InvoiceFPLX'), width: '8%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fplx}}">增值税专票</span></div>' }, { name: $translate.instant('InvoiceFPLX'), width: '9%', cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fplx}}">增值税专票</span></div>' },
{ name: $translate.instant('InvoiceJE'), headerCellClass: 'right', width: '8%', cellTemplate: '<div class="ui-grid-cell-contents right"><span style="float:right">{{row.entity.hjje}}</span></div>' }, { name: $translate.instant('InvoiceJE'), headerCellClass: 'right', width: '9%', cellTemplate: '<div class="ui-grid-cell-contents right"><span style="float:right">{{row.entity.hjje}}</span></div>' },
{ name: $translate.instant('InvoiceSE'), headerCellClass: 'right', width: '8%', cellTemplate: '<div class="ui-grid-cell-contents right"><span style="float:right">{{row.entity.hjse}}</span></div>' }, { name: $translate.instant('InvoiceSE'), headerCellClass: 'right', width: '9%', cellTemplate: '<div class="ui-grid-cell-contents right"><span style="float:right">{{row.entity.hjse}}</span></div>' },
{ name: $translate.instant('InvoiceRZRQ'), width: '10.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.rzsj | date:"yyyy-MM-dd"}}</span></div>' }, { name: $translate.instant('InvoiceRZRQ'), width: '12.5%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.rzsj | date:"yyyy-MM-dd"}}</span></div>' },
{ name: $translate.instant('InvoiceRZJG'), width: '8%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.certificationResult}}</span></div>' } { name: $translate.instant('InvoiceRZJG'), width: '10%', cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.rzjg}}</span></div>' }
], ],
onRegisterApi: function (gridApi) { onRegisterApi: function (gridApi) {
$scope.gridApi = gridApi; $scope.gridApi = gridApi;
......
<div class="vat-preview-input-invoice" id="mainPreviewDiv"> <div class="vat-preview-input-invoice" id="mainPreviewDiv">
<div class="top-area-wrapper"> <div class="top-area-wrapper" style="margin-top: 10px">
<!--<button class="filter-button" <!--<button class="filter-button"
atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()" atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()"
popover-container="body" popover-auto-hide="true" data-overwrite="true" popover-container="body" popover-auto-hide="true" data-overwrite="true"
...@@ -8,10 +8,8 @@ ...@@ -8,10 +8,8 @@
data-templateurl="/app/vat/preview/vat-preview-input-invoice/vat-preview-input-invoice-search.html"> data-templateurl="/app/vat/preview/vat-preview-input-invoice/vat-preview-input-invoice-search.html">
<i class="fa fa-filter" aria-hidden="true"></i> <i class="fa fa-filter" aria-hidden="true"></i>
</button>--> </button>-->
<div></div><div></div>
<span translate="IncomeInvoiceTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span> <span translate="IncomeInvoiceTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle" style="position: relative; top: -30px; left: 130px;" id="input-invoice-period-picker" />
<input type="text" class="form-control input-width-middle" style="position: relative; top: -33px; left: 160px;" id="input-invoice-period-picker" />
<span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span> <span ng-click="downloadInputInvoice()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div> </div>
......
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
SweetAlert.warning("没有数据可以下载"); SweetAlert.warning("没有数据可以下载");
return; return;
} }
vatExportService.exportToExcel(data, status, headers, '销项发票信息.xlsx'); vatExportService.exportToExcel(data, status, headers, '销项发票信息.xls');
}).error(function () { }).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator')); SweetAlert.error($translate.instant('PleaseContactAdministrator'));
}); });
...@@ -480,10 +480,10 @@ ...@@ -480,10 +480,10 @@
name: $translate.instant('ImportErrorPopUpNoCol'), width: '5%', name: $translate.instant('ImportErrorPopUpNoCol'), width: '5%',
cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.index}}<span></div>' cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.index}}<span></div>'
}, },
{ // {
name: $translate.instant('PeriodId'), width: '5%', // name: $translate.instant('PeriodId'), width: '5%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.periodID}}"><span>{{row.entity.periodID}}<span></div>' // cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.periodID}}"><span>{{row.entity.periodID}}<span></div>'
}, // },
{ {
name: $translate.instant('InvoiceDate'), width: '10%', name: $translate.instant('InvoiceDate'), width: '10%',
cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" ><span>{{row.entity.kprq | date:"yyyy-MM-dd"}}</span></div>'
...@@ -501,11 +501,11 @@ ...@@ -501,11 +501,11 @@
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.fphm}}"><span>{{row.entity.fphm}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.fphm}}"><span>{{row.entity.fphm}}</span></div>'
}, },
{ {
name: $translate.instant('BuyerName'), width: '15%', name: $translate.instant('BuyerName'), width: '18%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfmc}}"><span>{{row.entity.gfmc}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfmc}}"><span>{{row.entity.gfmc}}</span></div>'
}, },
{ {
name: $translate.instant('BuyerTaxNumber'), width: '15%', name: $translate.instant('BuyerTaxNumber'), width: '18%',
cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfsh}}"><span>{{row.entity.gfsh}}</span></div>' cellTemplate: '<div class="ui-grid-cell-contents" title="{{row.entity.gfsh}}"><span>{{row.entity.gfsh}}</span></div>'
}, },
//{ //{
......
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
$scope.readonly = true; $scope.readonly = true;
if(data && data.result) if(data && data.result)
updateTasksStatus(data.data); updateTasksStatus(data.data);
if(data.data.status=='Begin'){ if(data.data.jobStatus=='Begin'||data.data.jobStatus=='Running'){
$scope.timer= $interval(function(){ $scope.timer= $interval(function(){
vatReportService.getJobStatus(vatSessionService.project.id,vatSessionService.month,data.data.id).then(function(result){ vatReportService.getJobStatus(vatSessionService.project.id,vatSessionService.month,data.data.id).then(function(result){
if(result.data && result.status == 200){ if(result.data && result.status == 200){
...@@ -299,6 +299,12 @@ ...@@ -299,6 +299,12 @@
} }
}); });
}
function isAllEnd(stepCode,status){
var statusList = JSON.parse(status);
var stepCodes = stepCode.split(",");
} }
var startCaculate = function () { var startCaculate = function () {
...@@ -551,35 +557,39 @@ ...@@ -551,35 +557,39 @@
}else{ }else{
$scope.tasks[0].items[0].status = 'completed'; $scope.tasks[0].items[0].status = 'completed';
$scope.tasks[0].items[0].text= $translate.instant('completed'); $scope.tasks[0].items[0].text= $translate.instant('completed');
var items = $scope.tasks[1].items;
var currentIndex = 0;
items.forEach(function(item,index){
if((job).currentStep == item.code){
currentIndex = index;
}
});
var items = $scope.tasks[1].items;
if(job.jobStatus == 'End'){
items.forEach(function(item,index){ items.forEach(function(item,index){
if(index < currentIndex){
item.status ='completed';
}else if(index == currentIndex){
if(job.status == 'Error'){
item.status = 'error';
}else if(job.status == 'End'){
item.status = 'completed'; item.status = 'completed';
});
if($scope.timer){ if($scope.timer){
$interval.cancel($scope.timer); $interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished); , constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
} }
}else if(job.status == 'Begin'){ }else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
var tasks = JSON.parse(job.status)
items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing'; item.status = 'processing';
} }
}
item.text = $translate.instant(item.status); item.text = $translate.instant(item.status);
}
})
}); });
if(job.jobStatus == 'Error'){
if($scope.timer)$interval.cancel($scope.timer);
}
}
} }
} }
...@@ -587,7 +597,7 @@ ...@@ -587,7 +597,7 @@
vatReportService.getRunningJob(vatSessionService.project.id,vatSessionService.month).then(function (result) { vatReportService.getRunningJob(vatSessionService.project.id,vatSessionService.month).then(function (result) {
if(result.data && result.status == 200){ if(result.data && result.status == 200){
updateTasksStatus(result.data); updateTasksStatus(result.data);
if(result.data.status=='Begin'){ if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
$scope.timer= $interval(function(){ $scope.timer= $interval(function(){
vatReportService.getJobStatus(vatSessionService.project.id,vatSessionService.month,result.data.id) vatReportService.getJobStatus(vatSessionService.project.id,vatSessionService.month,result.data.id)
.success(function(result){ .success(function(result){
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
//projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d'; //projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d';
$q.all([ $q.all([
templateGroupService.getGroupTemplateByGroupID(48372654336679936, projectID), templateGroupService.getGroupTemplateByGroupID(48372654336679936, projectID),
vatReportService.getTemplate(vatSessionService.project.id, constant.serviceType.VAT, vatSessionService.month) vatReportService.getFilterTemplate(vatSessionService.project.id, constant.serviceType.VAT, vatSessionService.month)
]).then(function (result) { ]).then(function (result) {
if (!_.isEmpty(result[0]) && !_.isEmpty(result[0].data) && !_.isEmpty(result[0].data.data) if (!_.isEmpty(result[0]) && !_.isEmpty(result[0].data) && !_.isEmpty(result[0].data.data)
&& !_.isEmpty(result[1]) && !_.isEmpty(result[1].data) && !_.isEmpty(result[1].data.data)) { && !_.isEmpty(result[1]) && !_.isEmpty(result[1].data) && !_.isEmpty(result[1].data.data)) {
......
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