Commit 7db8502a authored by zhkwei's avatar zhkwei

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

parents fe5c89dc 08e321eb
...@@ -60,7 +60,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -60,7 +60,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static TrialBalanceFinalMapper trialBalanceFinalMapper; public static TrialBalanceFinalMapper trialBalanceFinalMapper;
public static ProfitLossStatementMapper profitLossStatementMapper; public static ProfitLossStatementMapper profitLossStatementMapper;
public static RevenueTypeMappingMapper revenueTypeMappingMapper; public static RevenueTypeMappingMapper revenueTypeMappingMapper;
public static BillDetailMapper billDetailMapper; public static InvoiceRecordMapper invoiceRecordMapper;
...@@ -145,7 +145,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -145,7 +145,7 @@ public class SpringContextUtil implements ApplicationContextAware {
balanceSheetMapper = webApplicationContext.getBean(BalanceSheetMapper.class); balanceSheetMapper = webApplicationContext.getBean(BalanceSheetMapper.class);
revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class); revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class);
billDetailMapper = webApplicationContext.getBean(BillDetailMapper.class); invoiceRecordMapper = webApplicationContext.getBean(InvoiceRecordMapper.class);
/* map.put("balance_sheet", balanceMapper); /* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper); map.put("profit_loss_statement",profitLossStatementMapper);
......
...@@ -3,19 +3,19 @@ package pwc.taxtech.atms.constant.enums; ...@@ -3,19 +3,19 @@ package pwc.taxtech.atms.constant.enums;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class BillDetailEnum { public class InvoiceRecordEnum {
/** /**
* 发票类型 * 发票类型
*/ */
public enum BillType { public enum InvoiceType {
ORDINARY(1, "增值税普票"), ORDINARY(1, "增值税普票"),
SPECIAL(2, "增值税专票"); SPECIAL(2, "增值税专票");
private Integer code; private Integer code;
private String name; private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>(); public static final Map<Integer, String> MAPPING = new HashMap<>();
BillType(Integer code, String name) { InvoiceType(Integer code, String name) {
this.code = code; this.code = code;
this.name = name; this.name = name;
} }
...@@ -29,11 +29,40 @@ public class BillDetailEnum { ...@@ -29,11 +29,40 @@ public class BillDetailEnum {
} }
static { static {
for (BillDetailEnum.BillType billType : BillDetailEnum.BillType.values()) { for (InvoiceRecordEnum.InvoiceType invoiceType : InvoiceRecordEnum.InvoiceType.values()) {
MAPPING.put(billType.getCode(), billType.getName()); MAPPING.put(invoiceType.getCode(), invoiceType.getName());
} }
} }
} }
/**
* 金额类型
*/
public enum AmountType {
INVOICE_AMOUNT(1, "开票金额"),
TAX_AMOUNT(2, "税额");
private Integer code;
private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>();
AmountType(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
static {
for (InvoiceRecordEnum.AmountType amountType : InvoiceRecordEnum.AmountType.values()) {
MAPPING.put(amountType.getCode(), amountType.getName());
}
}
}
} }
...@@ -8,18 +8,19 @@ public class TaxesCalculateReportEnum { ...@@ -8,18 +8,19 @@ public class TaxesCalculateReportEnum {
public enum Column { public enum Column {
Column_1(0, "序号"), Column_1(0, "序号"),
Column_2(1, "收入类型名称"), Column_2(1, "税金项目"),
Column_3(2, "税金项目"), Column_3(2, "期间"),
Column_4(3, "期间"), Column_4(3, "账载收入-明细"),
Column_5(4, "账载收入-明细"), Column_5(4, "销项开票收入数-专票"),
Column_6(5, "销项开票收入数-专票"), Column_6(5, "销项开票税额-专票"),
Column_7(6, "销项开票收入数-普票"), Column_7(6, "销项开票收入数-普票"),
Column_8(7, "计税基数(应税收入)"), Column_8(7, "销项开票税额-普票"),
Column_9(8, "税率"), Column_9(8, "计税基数 (应税收入)"),
Column_10(9, "税额(元)"), Column_10(9, "税率"),
Column_11(10, "收入类别"), Column_11(10, "税额(元)"),
Column_12(11, "计税方式"), Column_12(11, "收入类别"),
Column_13(12, "备注") Column_13(12, "计税方式"),
Column_14(13, "备注")
; ;
private Integer index; private Integer index;
private String name; private String name;
......
...@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil; ...@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -92,7 +92,7 @@ public class FileTypesController { ...@@ -92,7 +92,7 @@ public class FileTypesController {
@ResponseBody @ResponseBody
public void exportExcelFile (HttpServletResponse response){ public void exportExcelFile (HttpServletResponse response){
try { try {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new LinkedHashMap<>();
headers.put("id", "id"); headers.put("id", "id");
headers.put("file_attr", "档案属性"); headers.put("file_attr", "档案属性");
headers.put("file_type", "档案类型"); headers.put("file_type", "档案类型");
......
...@@ -12,7 +12,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil; ...@@ -12,7 +12,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -93,7 +93,7 @@ public class OperationLogFileTypeController { ...@@ -93,7 +93,7 @@ public class OperationLogFileTypeController {
public void exportExcelFile (HttpServletResponse response){ public void exportExcelFile (HttpServletResponse response){
// public ReturnData selectListForLog(@RequestBody OperationLogFileType operationLogFileType){ // public ReturnData selectListForLog(@RequestBody OperationLogFileType operationLogFileType){
try { try {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new LinkedHashMap<>();
headers.put("id", "id"); headers.put("id", "id");
// headers.put("operation_content", "操作内容"); // headers.put("operation_content", "操作内容");
// headers.put("module_name", "模块名称"); // headers.put("module_name", "模块名称");
......
...@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil; ...@@ -13,7 +13,7 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -74,7 +74,7 @@ public class OperationLogTaxDocController { ...@@ -74,7 +74,7 @@ public class OperationLogTaxDocController {
// public void exportExcelFile(HttpServletResponse response, @RequestBody OperationLogTaxDocument operationLogTaxDocument) { // public void exportExcelFile(HttpServletResponse response, @RequestBody OperationLogTaxDocument operationLogTaxDocument) {
public void exportExcelFile(HttpServletResponse response) { public void exportExcelFile(HttpServletResponse response) {
try { try {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new LinkedHashMap<>();
headers.put("id", "id"); headers.put("id", "id");
// headers.put("operation_content", "操作内容"); // headers.put("operation_content", "操作内容");
// headers.put("module_name", "模块名称"); // headers.put("module_name", "模块名称");
......
...@@ -30,10 +30,7 @@ import java.net.HttpURLConnection; ...@@ -30,10 +30,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@Controller @Controller
@RequestMapping("/api/v1/taxDoc") @RequestMapping("/api/v1/taxDoc")
...@@ -88,24 +85,24 @@ public class TaxDocumentController { ...@@ -88,24 +85,24 @@ public class TaxDocumentController {
@ResponseBody @ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) { public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
try { try {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new LinkedHashMap<>();
headers.put("id", "id"); headers.put("Id", "序号");
headers.put("file_attr", "档案属性"); headers.put("FileAttr", "档案属性");
headers.put("file_type", "档案类型"); headers.put("FileType", "档案类型");
headers.put("file_name", "档案名称"); headers.put("FileName", "档案名称");
headers.put("business_line", "业务线"); headers.put("BusinessLine", "业务线");
headers.put("company_name", "公司名称"); headers.put("CompanyName", "公司名称");
headers.put("tax_type", "税种"); headers.put("TaxType", "税种");
headers.put("file_time", "文件生效日期"); headers.put("FileTime", "文件生效日期");
headers.put("effective_time", "有效日期"); headers.put("EffectiveTime", "有效日期");
headers.put("creator", "创建人"); headers.put("Creator", "创建人");
headers.put("create_time", "创建时间"); headers.put("CreateTime", "创建时间");
headers.put("upload_time", "上传日期"); headers.put("UploadTime", "上传日期");
headers.put("storage_area", "实物存放地点"); headers.put("StorageArea", "实物存放地点");
headers.put("keeper", "保管人"); headers.put("Keeper", "保管人");
headers.put("remark", "档案备注"); headers.put("Remark", "档案备注");
headers.put("file_position_url", "文件存储的位置"); headers.put("FilePositionUrl", "文件存储的位置");
headers.put("own_time", "所属期间"); headers.put("OwnTime", "所属期间");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto); List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1")); response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
......
...@@ -490,7 +490,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -490,7 +490,7 @@ public class AnalysisServiceImpl extends BaseService {
Sheet sheet = workbook.getSheetAt(i); Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue; if (isSheetEmpty(sheet)) continue;
List<AnalysisInternationalTaxData> lists = Lists.newArrayList(); List<AnalysisInternationalTaxData> lists = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) { for (int j = 1; j <= 1; j++) {
Cell cell1 = sheet.getRow(j).getCell(0); Cell cell1 = sheet.getRow(j).getCell(0);
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) { if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) {
continue; continue;
...@@ -506,7 +506,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -506,7 +506,7 @@ public class AnalysisServiceImpl extends BaseService {
lists.add(model); lists.add(model);
} }
AnalysisInternationalTaxDataExample example = new AnalysisInternationalTaxDataExample(); AnalysisInternationalTaxDataExample example = new AnalysisInternationalTaxDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer); example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName);
analysisInternationalTaxDataMapper.deleteByExample(example); analysisInternationalTaxDataMapper.deleteByExample(example);
lists.forEach(l->{ lists.forEach(l->{
analysisInternationalTaxDataMapper.insertSelective(l); analysisInternationalTaxDataMapper.insertSelective(l);
...@@ -554,7 +554,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -554,7 +554,7 @@ public class AnalysisServiceImpl extends BaseService {
lists.add(model); lists.add(model);
} }
AnalysisInternationalBusinessDataExample example = new AnalysisInternationalBusinessDataExample(); AnalysisInternationalBusinessDataExample example = new AnalysisInternationalBusinessDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer); example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName);
analysisInternationalBusinessDataMapper.deleteByExample(example); analysisInternationalBusinessDataMapper.deleteByExample(example);
lists.forEach(l->{ lists.forEach(l->{
analysisInternationalBusinessDataMapper.insertSelective(l); analysisInternationalBusinessDataMapper.insertSelective(l);
......
...@@ -28,10 +28,7 @@ import java.net.HttpURLConnection; ...@@ -28,10 +28,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Calendar; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
...@@ -350,7 +347,7 @@ public class TaxDocumentServiceImpl { ...@@ -350,7 +347,7 @@ public class TaxDocumentServiceImpl {
} }
public void downloadAllFile(HttpServletResponse response, List<Long> ids) { public void downloadAllFile(HttpServletResponse response, List<Long> ids) {
//如果只选择了一个附件,则不打包 //如果只选择了一个附件,则不打包
if (null != ids &&ids.size()==1){ if (null != ids && ids.size() == 1) {
TaxDocumentExample example = new TaxDocumentExample(); TaxDocumentExample example = new TaxDocumentExample();
TaxDocumentExample.Criteria criteria = example.createCriteria(); TaxDocumentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(ids); criteria.andIdIn(ids);
...@@ -360,8 +357,10 @@ public class TaxDocumentServiceImpl { ...@@ -360,8 +357,10 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isBlank(urlPath)) { if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + taxDocument.getId()); throw new RuntimeException("文件url为空,id为:" + taxDocument.getId());
} }
//文件名称(带后缀) //文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(taxDocument.getFileOriginalName()) ? "未知文件(请修改后缀名).xlsx" : taxDocument.getFileOriginalName(); String fileName = StringUtils.isBlank(taxDocument.getFileName())
? "未知文件(请修改后缀名).xlsx"
: UUID.randomUUID().toString().substring(0, 6) + "_" + taxDocument.getFileOriginalName();
//设置输出流信息 //设置输出流信息
try { try {
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
...@@ -399,27 +398,27 @@ public class TaxDocumentServiceImpl { ...@@ -399,27 +398,27 @@ public class TaxDocumentServiceImpl {
out.write(buffer, 0, len); out.write(buffer, 0, len);
} }
} catch (IOException e) { } catch (IOException e) {
log.error("单个附件下载异常:"+e.getMessage()); log.error("单个附件下载异常:" + e.getMessage());
} finally { } finally {
if (null != out){ if (null != out) {
try { try {
out.close(); out.close();
} catch (IOException e) { } catch (IOException e) {
log.error("关闭输出流错误:"+e.getMessage()); log.error("关闭输出流错误:" + e.getMessage());
} }
} }
if (null != is) { if (null != is) {
try { try {
is.close(); is.close();
} catch (IOException e) { } catch (IOException e) {
log.error("关闭输入流错误:"+e.getMessage()); log.error("关闭输入流错误:" + e.getMessage());
} }
} }
if (null != in) { if (null != in) {
try { try {
in.close(); in.close();
} catch (IOException e) { } catch (IOException e) {
log.error("关闭缓存输入流错误:"+e.getMessage()); log.error("关闭缓存输入流错误:" + e.getMessage());
} }
} }
} }
...@@ -485,8 +484,10 @@ public class TaxDocumentServiceImpl { ...@@ -485,8 +484,10 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isBlank(urlPath)) { if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId()); throw new RuntimeException("文件url为空,id为:" + item.getId());
} }
//文件名称(带后缀) //文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(item.getFileOriginalName()) ? "未知文件(请修改后缀名).xlsx" : item.getFileOriginalName(); String fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: UUID.randomUUID().toString().substring(0, 6) + "_" + item.getFileName();
InputStream is = null; InputStream is = null;
BufferedInputStream in = null; BufferedInputStream in = null;
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
......
...@@ -368,18 +368,22 @@ public class ReportServiceImpl extends BaseService { ...@@ -368,18 +368,22 @@ public class ReportServiceImpl extends BaseService {
public void assemblePeriodTemplate(Template template, Workbook workbook, String projectId, Integer period, List<Long> configIds) throws ServiceException { public void assemblePeriodTemplate(Template template, Workbook workbook, String projectId, Integer period, List<Long> configIds) throws ServiceException {
int addRowIndex = configIds.size(); int addRowIndex = configIds.size();
List<Integer> hasHandDatas = Arrays.asList( List<Integer> hasHandDatas = Arrays.asList(
TaxesCalculateReportEnum.Column.Column_4.getIndex(),
TaxesCalculateReportEnum.Column.Column_5.getIndex(), TaxesCalculateReportEnum.Column.Column_5.getIndex(),
TaxesCalculateReportEnum.Column.Column_6.getIndex(), TaxesCalculateReportEnum.Column.Column_6.getIndex(),
TaxesCalculateReportEnum.Column.Column_7.getIndex(), TaxesCalculateReportEnum.Column.Column_7.getIndex(),
TaxesCalculateReportEnum.Column.Column_8.getIndex(), TaxesCalculateReportEnum.Column.Column_8.getIndex(),
TaxesCalculateReportEnum.Column.Column_10.getIndex()); TaxesCalculateReportEnum.Column.Column_9.getIndex(),
TaxesCalculateReportEnum.Column.Column_11.getIndex());
List<Integer> hasFormulaDatas = Arrays.asList( List<Integer> hasFormulaDatas = Arrays.asList(
TaxesCalculateReportEnum.Column.Column_3.getIndex(),
TaxesCalculateReportEnum.Column.Column_4.getIndex(), TaxesCalculateReportEnum.Column.Column_4.getIndex(),
TaxesCalculateReportEnum.Column.Column_5.getIndex(), TaxesCalculateReportEnum.Column.Column_5.getIndex(),
TaxesCalculateReportEnum.Column.Column_6.getIndex(), TaxesCalculateReportEnum.Column.Column_6.getIndex(),
TaxesCalculateReportEnum.Column.Column_7.getIndex(), TaxesCalculateReportEnum.Column.Column_7.getIndex(),
TaxesCalculateReportEnum.Column.Column_8.getIndex(), TaxesCalculateReportEnum.Column.Column_8.getIndex(),
TaxesCalculateReportEnum.Column.Column_10.getIndex()); TaxesCalculateReportEnum.Column.Column_9.getIndex(),
TaxesCalculateReportEnum.Column.Column_11.getIndex());
try { try {
Date now = new Date(); Date now = new Date();
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
...@@ -753,11 +757,13 @@ public class ReportServiceImpl extends BaseService { ...@@ -753,11 +757,13 @@ public class ReportServiceImpl extends BaseService {
List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example); List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example);
//合计项map //合计项map
Map<Integer,List<String>> sumMap = new HashMap<>(); Map<Integer,List<String>> sumMap = new HashMap<>();
sumMap.put(TaxesCalculateReportEnum.Column.Column_4.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_5.getIndex(),new ArrayList<>()); sumMap.put(TaxesCalculateReportEnum.Column.Column_5.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_6.getIndex(),new ArrayList<>()); sumMap.put(TaxesCalculateReportEnum.Column.Column_6.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_7.getIndex(),new ArrayList<>()); sumMap.put(TaxesCalculateReportEnum.Column.Column_7.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_8.getIndex(),new ArrayList<>()); sumMap.put(TaxesCalculateReportEnum.Column.Column_8.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_10.getIndex(),new ArrayList<>()); sumMap.put(TaxesCalculateReportEnum.Column.Column_9.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_11.getIndex(),new ArrayList<>());
List<Long> configIds = new ArrayList<>(); List<Long> configIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(dataList)) { if (CollectionUtils.isNotEmpty(dataList)) {
...@@ -770,48 +776,52 @@ public class ReportServiceImpl extends BaseService { ...@@ -770,48 +776,52 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + (dataList.size()+1-rowIndex)); row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + (dataList.size()+1-rowIndex));
row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName()); row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue("PC(\"FilterDate1\",2)");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"FilterDate1\",2)");
//判断帐载收入明细 //判断帐载收入明细
if (0 == config.getAccountType()) {//0值 if (0 == config.getAccountType()) {//0值
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00); row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目 } else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue( row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue(
"DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-" "DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+ "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")"); + "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if (2 == config.getAccountType()) {//手工输入 } else if (2 == config.getAccountType()) {//手工输入
} else { } else {
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("");
} }
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",2)"); row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",2,1)");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",1)"); row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",2,2)");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",1,1)");
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("KPSR(\""+config.getName()+"\",1,2)");
if (1 == config.getTaxBase()) {//账载 if (1 == config.getTaxBase()) {//账载
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"D\")");
} else if (2 == config.getTaxBase()) {//开票收入 } else if (2 == config.getTaxBase()) {//开票收入
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"F\")+" row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")+"
+"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"G\")"); +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"G\")");
} else if (3 == config.getTaxBase()) {//手工录入 } else if (3 == config.getTaxBase()) {//手工录入
} else if (4 == config.getTaxBase()) {//借方发生额 } else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)");
} else if (5 == config.getTaxBase()) {//贷方发生额 } else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + ",1,,)");
}else{ }else{
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue("");
} }
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%"); row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"H\")*" row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")*"
+"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")"); +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"J\")");
row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType())); row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType())); row.getCell(TaxesCalculateReportEnum.Column.Column_13.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
rowIndex++; rowIndex++;
//组装合计项 //组装合计项
sumMap.get(TaxesCalculateReportEnum.Column.Column_4.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_4.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_5.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_5.getIndex()+1,"")+rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_5.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_5.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_6.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_6.getIndex()+1,"")+rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_6.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_6.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_7.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_7.getIndex()+1,"")+rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_7.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_7.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_8.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_8.getIndex()+1,"")+rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_8.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_8.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_10.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_10.getIndex()+1,"")+rowIndex); sumMap.get(TaxesCalculateReportEnum.Column.Column_9.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_9.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_11.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_11.getIndex()+1,"")+rowIndex);
} }
//组装合计项数据 //组装合计项数据
assembleSumRow(sheet.getRow(rowIndex),sumMap); assembleSumRow(sheet.getRow(rowIndex),sumMap);
......
...@@ -5,16 +5,15 @@ import org.apache.poi.ss.formula.OperationEvaluationContext; ...@@ -5,16 +5,15 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.DateUtils;
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;
import pwc.taxtech.atms.constant.enums.BillDetailEnum; import pwc.taxtech.atms.constant.enums.InvoiceRecordEnum;
import pwc.taxtech.atms.constant.enums.EnumOperationType; import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType; import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto; import pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto;
import pwc.taxtech.atms.vat.entity.BillDetail; import pwc.taxtech.atms.vat.entity.InvoiceRecord;
import pwc.taxtech.atms.vat.entity.BillDetailExample; import pwc.taxtech.atms.vat.entity.InvoiceRecordExample;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping; import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample; import pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample;
...@@ -34,16 +33,17 @@ public class KPSR extends FunctionBase implements FreeRefFunction { ...@@ -34,16 +33,17 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
@Override @Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) { public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length < 2) { if (args.length < 3) {
return null; return null;
} }
String revenueTypeName = getStringParam(args[0], ec);//收入类型名称 String revenueTypeName = getStringParam(args[0], ec);//收入类型名称
Integer billType = getIntParam(args[1], ec);//发票类型 Integer billType = getIntParam(args[1], ec);//发票类型
String formulaExpression = "KPSR(\"" + revenueTypeName + "\","+billType+")"; Integer amountType = getIntParam(args[2], ec);//金额类型
String formulaExpression = "KPSR(\"" + revenueTypeName + "\","+billType+ ","+amountType+")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
List<OutputInvoiceDataSourceDto> dataSource = new ArrayList<>(); List<OutputInvoiceDataSourceDto> dataSource = new ArrayList<>();
double result = assembleData(revenueTypeName,dataSource,billType,ec); double result = assembleData(revenueTypeName,dataSource,billType,amountType,ec);
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), FormulaDataSourceDetailType.OutputInvoiceDataSourceDto, new BigDecimal(result), formulaContext.getPeriod(), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), FormulaDataSourceDetailType.OutputInvoiceDataSourceDto, new BigDecimal(result), formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, new BigDecimal(result), dataSoureId, formulaContext.getProjectId()); saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, new BigDecimal(result), dataSoureId, formulaContext.getProjectId());
...@@ -51,7 +51,7 @@ public class KPSR extends FunctionBase implements FreeRefFunction { ...@@ -51,7 +51,7 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
} }
private double assembleData(String revenueTypeName, List<OutputInvoiceDataSourceDto> contain, Integer billType,OperationEvaluationContext ec) { 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()+"")); String queryDate = formulaContext.getYear()+(formulaContext.getPeriod()<10?("0"+formulaContext.getPeriod()):(formulaContext.getPeriod()+""));
RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample(); RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
...@@ -67,30 +67,36 @@ public class KPSR extends FunctionBase implements FreeRefFunction { ...@@ -67,30 +67,36 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
if (CollectionUtils.isEmpty(contens)) { if (CollectionUtils.isEmpty(contens)) {
return 0.0; return 0.0;
} }
BillDetailExample billDetailExample = new BillDetailExample(); InvoiceRecordExample invoiceRecordExample = new InvoiceRecordExample();
BillDetailExample.Criteria c = billDetailExample.createCriteria().andBillContentIn(contens).andProjectIdEqualTo(formulaContext.getProjectId()) InvoiceRecordExample.Criteria c = invoiceRecordExample.createCriteria().andBillingContentIn(contens)
.andProjectIdEqualTo(formulaContext.getProjectId())
.andPeriodEqualTo(Integer.valueOf(queryDate)) .andPeriodEqualTo(Integer.valueOf(queryDate))
.andBillTypeEqualTo(BillDetailEnum.BillType.MAPPING.get(billType)); .andInvoiceTypeEqualTo(InvoiceRecordEnum.InvoiceType.MAPPING.get(billType));
List<BillDetail> billDetails = SpringContextUtil.billDetailMapper.selectByExample(billDetailExample); List<InvoiceRecord> billDetails = SpringContextUtil.invoiceRecordMapper.selectByExample(invoiceRecordExample);
for (BillDetail billDetail : billDetails) { for (InvoiceRecord invoiceRecord : billDetails) {
OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto(); OutputInvoiceDataSourceDto outputInvoiceDataSourceDto = new OutputInvoiceDataSourceDto();
outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(billDetail.getBillAmount(), outputInvoiceDataSourceDto.setAmount(FormulaHelper.roundValue(invoiceRecord.getInvoiceAmount(),
KeyValueConfigResultType.Accounting, null, formulaContext)); KeyValueConfigResultType.Accounting, null, formulaContext));
outputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode()); outputInvoiceDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
outputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(billDetail.getTaxAmount(), outputInvoiceDataSourceDto.setTaxAmount(FormulaHelper.roundValue(invoiceRecord.getTaxAmount(),
KeyValueConfigResultType.Accounting, null, formulaContext)); KeyValueConfigResultType.Accounting, null, formulaContext));
outputInvoiceDataSourceDto.setTaxRate(billDetail.getTaxRate()); outputInvoiceDataSourceDto.setTaxRate(invoiceRecord.getTaxRate());
outputInvoiceDataSourceDto.setBuyerName(billDetail.getCustomer()); outputInvoiceDataSourceDto.setBuyerName(invoiceRecord.getCustomerCompanyName());
outputInvoiceDataSourceDto.setInvoiceCode(billDetail.getBillCode()); outputInvoiceDataSourceDto.setInvoiceCode(invoiceRecord.getInvoiceCode());
outputInvoiceDataSourceDto.setInvoiceNumber(billDetail.getBillNo()); outputInvoiceDataSourceDto.setInvoiceNumber(invoiceRecord.getInvoiceNum());
outputInvoiceDataSourceDto.setInvoiceDate(DateUtils.strToDate(billDetail.getBillDate())); outputInvoiceDataSourceDto.setInvoiceDate(invoiceRecord.getBillingDate());
outputInvoiceDataSourceDto.setInvoiceType(billType); outputInvoiceDataSourceDto.setInvoiceType(billType);
outputInvoiceDataSourceDto.setPeriod(formulaContext.getPeriod()); outputInvoiceDataSourceDto.setPeriod(formulaContext.getPeriod());
outputInvoiceDataSourceDto.setName(Constant.DataSourceName.OutputInvoiceDataSource); outputInvoiceDataSourceDto.setName(Constant.DataSourceName.OutputInvoiceDataSource);
outputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode()); outputInvoiceDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
contain.add(outputInvoiceDataSourceDto); contain.add(outputInvoiceDataSourceDto);
} }
return billDetails.stream().mapToDouble(a -> a.getBillAmount().doubleValue()).sum(); if(InvoiceRecordEnum.AmountType.INVOICE_AMOUNT.getCode().equals(amountType)){
return billDetails.stream().mapToDouble(a -> a.getInvoiceAmount().doubleValue()).sum();
}else if (InvoiceRecordEnum.AmountType.TAX_AMOUNT.getCode().equals(amountType)){
return billDetails.stream().mapToDouble(a -> a.getTaxAmount().doubleValue()).sum();
}
return 0;
} }
......
...@@ -996,6 +996,8 @@ ...@@ -996,6 +996,8 @@
"PleaseSelect": "Please Select...", "PleaseSelect": "Please Select...",
"PleaseSelectColumn": "Please Select Column Name", "PleaseSelectColumn": "Please Select Column Name",
"PleaseSelectFileFirst": "Please Choose at Lease One File!", "PleaseSelectFileFirst": "Please Choose at Lease One File!",
"PleaseSelectCountryFirst": "Please Choose at one country!",
"PleaseSelectCompanyFirst": "Please Choose at one company!",
"PostedBy": "Posted by", "PostedBy": "Posted by",
"PostingPeriod": "Posting Period", "PostingPeriod": "Posting Period",
"PreVoucherNumber": "Initial Value of Voucher Number", "PreVoucherNumber": "Initial Value of Voucher Number",
......
...@@ -1293,6 +1293,8 @@ ...@@ -1293,6 +1293,8 @@
"PleaseSelectColumn": "请选择列名", "PleaseSelectColumn": "请选择列名",
"PleaseSelectFile": "请先选择文件", "PleaseSelectFile": "请先选择文件",
"PleaseSelectFileFirst": "请先选择文件!", "PleaseSelectFileFirst": "请先选择文件!",
"PleaseSelectCountryFirst": "请先选择国家!",
"PleaseSelectCompanyFirst": "请先选择公司!",
"PleaseSelectProductType": "请选择商品种类", "PleaseSelectProductType": "请选择商品种类",
"PleaseSelectRecordToDelete": "请选择需要删除的记录!", "PleaseSelectRecordToDelete": "请选择需要删除的记录!",
"PleaseSelectServiceType": "请选择服务类型", "PleaseSelectServiceType": "请选择服务类型",
......
...@@ -30,11 +30,8 @@ ...@@ -30,11 +30,8 @@
$scope.showTotalSecondRow = false; $scope.showTotalSecondRow = false;
$scope.importExcelFileUrlList = { $scope.importExcelFileUrlList = {
taxData : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile', internationalBU : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
returnTax : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile', internationalTax : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile'
gmvSubsidy : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
employeeNum : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
driverNum : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile'
}; };
$scope.maxTitleLength = constant.maxButtonTitleLength; $scope.maxTitleLength = constant.maxButtonTitleLength;
...@@ -197,10 +194,21 @@ ...@@ -197,10 +194,21 @@
return; return;
} }
if (!$scope.selectCountry||''===$scope.selectCountry){
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
return;
}
if (!$scope.selectCompany||''===$scope.selectCompany){
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
return;
}
var url = getUploadUrl(); var url = getUploadUrl();
var period = $scope.UploadPeriodTime; var period = $scope.UploadPeriodTime;
Upload.upload({ Upload.upload({
url: url, url: url,
data: { data: {
...@@ -254,10 +262,10 @@ ...@@ -254,10 +262,10 @@
var url = ""; var url = "";
switch ($scope.importType) { switch ($scope.importType) {
case 100: case 100:
url = $scope.importExcelFileUrlList.taxData; url = $scope.importExcelFileUrlList.internationalBU;
break; break;
case 101: case 101:
url = $scope.importExcelFileUrlList.returnTax; url = $scope.importExcelFileUrlList.internationalTax;
break; break;
default: default:
break; break;
...@@ -300,39 +308,34 @@ ...@@ -300,39 +308,34 @@
columns: [ columns: [
{ {
dataField: "gmv", dataField: "gmv",
width: '14%', width: '16%',
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: 'Gmv' caption: 'Gmv'
}, { }, {
dataField: "trips", dataField: "trips",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: 'Trips', caption: 'Trips',
width: '14%' width: '16%'
}, { }, {
dataField: "subsidyB", dataField: "subsidyB",
allowHeaderFiltering: false, allowHeaderFiltering: false,
width: '14%', width: '16%',
caption: 'SubsidyB' caption: 'SubsidyB'
}, { }, {
dataField: "subsidyC", dataField: "subsidyC",
allowHeaderFiltering: false, allowHeaderFiltering: false,
width: '14%', width: '16%',
caption: 'SubsidyC' caption: 'SubsidyC'
}, { }, {
dataField: "revenue", dataField: "revenue",
allowHeaderFiltering: false, allowHeaderFiltering: false,
width: '14%', width: '16%',
caption: 'Revenue' caption: 'Revenue'
}, { }, {
dataField: "profit", dataField: "profit",
allowHeaderFiltering: false, allowHeaderFiltering: false,
width: '14%', width: '16%',
caption: 'Profit' caption: 'Profit'
}, {
dataField: "exchangeRate",
allowHeaderFiltering: false,
width: '14%',
caption: 'ExchangeRate'
}], }],
onContentReady: function (e) { onContentReady: function (e) {
$scope.accountingRateListInstance = e.component; $scope.accountingRateListInstance = e.component;
......
...@@ -642,6 +642,9 @@ ...@@ -642,6 +642,9 @@
|| $scope.selectedTabIndex === enums.formulaDataSourceType.InputInvoiceDetail || $scope.selectedTabIndex === enums.formulaDataSourceType.InputInvoiceDetail
|| $scope.selectedTabIndex === enums.formulaDataSourceType.OutputInvoice || $scope.selectedTabIndex === enums.formulaDataSourceType.OutputInvoice
|| $scope.selectedTabIndex === enums.formulaDataSourceType.InvoiceFilter) { || $scope.selectedTabIndex === enums.formulaDataSourceType.InvoiceFilter) {
if(new Number($scope.detail.cellTemplateId)<0){
$("#dataGridFooterSummary").html("");
}else{
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) { evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
if(x.money){ if(x.money){
return memo + x.money; return memo + x.money;
...@@ -667,6 +670,7 @@ ...@@ -667,6 +670,7 @@
+ evalVal.formatAmount(precition) + '&nbsp;&nbsp;&nbsp;&nbsp;' + $translate.instant('TaxAmount') + evalVal.formatAmount(precition) + '&nbsp;&nbsp;&nbsp;&nbsp;' + $translate.instant('TaxAmount')
+ ':&nbsp;&nbsp;&nbsp;&nbsp;' + evalTaxVal.formatAmount(precition)); + ':&nbsp;&nbsp;&nbsp;&nbsp;' + evalTaxVal.formatAmount(precition));
} }
}
else if ($scope.selectedTabIndex === enums.formulaDataSourceType.Voucher) { else if ($scope.selectedTabIndex === enums.formulaDataSourceType.Voucher) {
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) { evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
return memo + x.debit - x.credit; return memo + x.debit - x.credit;
......
...@@ -875,9 +875,9 @@ taxDocumentManageModule.directive('multiFileUploader', function () { ...@@ -875,9 +875,9 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-"); params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "-");
_taxDocumentListService.verifyDuplicate(params).then(function (data) { _taxDocumentListService.verifyDuplicate(params).then(function (data) {
if (data == true) { if (data == true) {
_fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/add"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
} else { } else {
_fileItem.url = "http://etms.longi-silicon.com:8180//api/v1/taxDoc/edit"; _fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
} }
_multiUploader.uploadItem(_i); _multiUploader.uploadItem(_i);
}); });
...@@ -1543,8 +1543,9 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -1543,8 +1543,9 @@ taxDocumentManageModule.directive('downLoadModule', function () {
controller: ['$scope', 'taxDocumentListService', '$translate','SweetAlert', controller: ['$scope', 'taxDocumentListService', '$translate','SweetAlert',
function ($scope, taxDocumentListService, $translate,SweetAlert) { function ($scope, taxDocumentListService, $translate,SweetAlert) {
/* $scope.downloadAttachment = function () { $scope.downloadAttachment = function () {
var checkedIDs = [ var checkedIDs = [];
var checkedUrls = [
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=', // 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=', // 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=', // 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
...@@ -1553,14 +1554,40 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -1553,14 +1554,40 @@ taxDocumentManageModule.directive('downLoadModule', function () {
$("input[name='dataGridCheckBox']").each(function (index, item) { $("input[name='dataGridCheckBox']").each(function (index, item) {
if (item.checked) { if (item.checked) {
var cellId = $(item).attr("data-id"); var cellId = $(item).attr("data-id");
var cellUrl = $(item).attr("data-url");
checkedIDs.push(cellId); checkedIDs.push(cellId);
checkedUrls.push(cellUrl);
} }
}); });
if(checkedIDs.length === 1 && checkedUrls.length === 1){
simpDownload(checkedUrls[0]);
}else{
multiDownToZip(checkedIDs);
}
};
function simpDownload(url){
if (!url) return SweetAlert.warning($translate.instant("NeedChecked"));
// setTimeout(function () {
var frame = $('<iframe style="display: none;" class="multi-download"></iframe>');
frame.attr('src', url);
document.body.appendChild(frame[0]);
setTimeout(function () {
frame.remove();
}, 1000);
// }, 100);
}
function multiDownToZip(ids){
if (!ids.length) return SweetAlert.warning($translate.instant("NeedChecked"));
setTimeout(function(){
taxDocumentListService.downloadAllFile({ taxDocumentListService.downloadAllFile({
"ids":checkedIDs "ids":ids
}); });
};*/ },500);
$scope.downloadAttachment = function () { }
/*$scope.downloadAttachment = function () {
var checkedURLs = [ var checkedURLs = [
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=', // 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
// 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=', // 'http://47.94.233.173:11007/static/erp_tax_system/3221D133-85B8-4E22-AE9B-DBEBD942D217?expire=1552361736&signiture=_Wz1_8Z6T8h5qnZAGpoRa8kNZeqmE7KoztKeehzYK4U=',
...@@ -1589,7 +1616,7 @@ taxDocumentManageModule.directive('downLoadModule', function () { ...@@ -1589,7 +1616,7 @@ taxDocumentManageModule.directive('downLoadModule', function () {
}, _removeDelay); }, _removeDelay);
}, _triggerDelay); }, _triggerDelay);
} }
}; };*/
}] }]
} }
}); });
......
...@@ -79,6 +79,7 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -79,6 +79,7 @@ taxDocumentManageModule.factory('taxDocumentListService',
return jqFetch.get(apiInterceptor.webApiHostUrl + '/businessunit/getlist', params); return jqFetch.get(apiInterceptor.webApiHostUrl + '/businessunit/getlist', params);
}, },
downloadAllFile:function(params){ downloadAllFile:function(params){
$('#busy-indicator-container').show();
//post请求会自带http://etms.longi-silicon.com:8180//api/v1的前缀路径,get请求不会 //post请求会自带http://etms.longi-silicon.com:8180//api/v1的前缀路径,get请求不会
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', apiInterceptor.webApiHostUrl + "/taxDoc/downloadAllFile", true); xhr.open('POST', apiInterceptor.webApiHostUrl + "/taxDoc/downloadAllFile", true);
...@@ -119,6 +120,7 @@ taxDocumentManageModule.factory('taxDocumentListService', ...@@ -119,6 +120,7 @@ taxDocumentManageModule.factory('taxDocumentListService',
} else { } else {
window.location = objectUrl; window.location = objectUrl;
} }
$('#busy-indicator-container').hide();
} }
} }
}; };
......
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