Commit 867bf355 authored by zhkwei's avatar zhkwei

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

parents d78e0abc 07b735d8
......@@ -94,15 +94,15 @@ public class TaxDocumentController {
headers.put("CompanyName", "公司名称");
headers.put("TaxType", "税种");
headers.put("FileTime", "文件生效日期");
headers.put("EffectiveTime", "有效日期");
headers.put("Creator", "创建人");
headers.put("CreateTime", "创建时间");
headers.put("UploadTime", "上传日期");
headers.put("OwnTime", "所属期间");
headers.put("EffectiveTime", "到期日");
headers.put("AuditStatus", "审批状态");
headers.put("PhysicalIndexNumber", "实物索引号");
headers.put("StorageArea", "实物存放地点");
headers.put("Keeper", "保管人");
headers.put("UploadTime", "上传日期");
headers.put("Creator", "创建人");
headers.put("Remark", "档案备注");
headers.put("FilePositionUrl", "文件存储的位置");
headers.put("OwnTime", "所属期间");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
......
......@@ -20,8 +20,8 @@ public class CurrentPeriodBo {
public static CurrentPeriodBo getPeriod(int parameterPeriod, int periodContent) {
int yearOffset = 0;
if (parameterPeriod == -99) {
return new CurrentPeriodBo(parameterPeriod);
if (parameterPeriod == 99) {
return new CurrentPeriodBo(periodContent);
} else if (parameterPeriod <= -1) {
Integer period = parameterPeriod + periodContent;
while (period <= 0) {
......
package pwc.taxtech.atms.security.dd;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -6,12 +7,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.ProjectServiceImpl;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
//import org.apache.tomcat.util.codec.binary.Base64;
import javax.crypto.Cipher;
import java.security.KeyFactory;
import java.security.PublicKey;
import java.security.spec.X509EncodedKeySpec;
......@@ -20,6 +17,7 @@ import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
/**
* @Auther: Gary J Li
* @Date: 20/03/2019 20:41
......@@ -47,11 +45,9 @@ public class DtsTokenService {
* @throws
*/
public String encryptInput(){
BASE64Encoder base64 = new BASE64Encoder();
BASE64Decoder base64Decoder = new BASE64Decoder();
byte[] encodeData;
try {
byte[] publicKey = base64Decoder.decodeBuffer(pubKey);
byte[] publicKey = Base64.decodeBase64(pubKey);
String nonce = generateNonce();
String sDate = generateDate();
long rNum = generateRandomNumber();
......@@ -59,12 +55,12 @@ public class DtsTokenService {
byte[] data1 = inputStr1.getBytes();
logger.debug("原文:" + inputStr1);
encodeData = encryptByPublicKey(data1, publicKey);
logger.debug("公钥加密后:" + base64.encode(encodeData));
logger.debug("公钥加密后:" + Base64.encodeBase64String(encodeData));
} catch (Exception ex) {
throw new ServiceException("cus" + ex);
}
return base64.encode(encodeData);
return Base64.encodeBase64String(encodeData);
}
......
......@@ -474,8 +474,10 @@ public class TaxDocumentServiceImpl {
throw new RuntimeException("传入参数错误:空参数数组");
}
criteria.andIdIn(ids);
//查询出根据条件过滤后需要下载的附件数据信息
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example);
//新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n)
List<String> fileNameList = new ArrayList<>();
for (TaxDocument item : taxDocuments) {
//文件url
String urlPath = item.getFilePositionUrl();
......@@ -483,10 +485,23 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId());
}
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(item.getFileName())
//检查文件名是否有重复
int fileNameRepeatTimes = 0;
if (fileNameList.size()>0){
fileNameRepeatTimes = Collections.frequency(fileNameList, item.getFileName());
}
String fileName;
if (fileNameRepeatTimes > 0) {
fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: "(" + fileNameRepeatTimes + ")" + item.getFileName();
} else {
//文件名称(带后缀
fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: item.getFileName();
}
fileNameList.add(item.getFileName());
InputStream is = null;
BufferedInputStream in = null;
byte[] buffer = new byte[1024];
......
......@@ -22,6 +22,7 @@ import java.text.MessageFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* The <code>ExcelUtil</code> 与 {@link ExcelCell}搭配使用
......@@ -67,17 +68,17 @@ public class ExcelUtil {
* @return
*/
private static String getCellTypeByInt(CellType cellType) {
if(cellType == CellType.BLANK)
if (cellType == CellType.BLANK)
return "Null type";
else if(cellType == CellType.BOOLEAN)
else if (cellType == CellType.BOOLEAN)
return "Boolean type";
else if(cellType == CellType.ERROR)
else if (cellType == CellType.ERROR)
return "Error type";
else if(cellType == CellType.FORMULA)
else if (cellType == CellType.FORMULA)
return "Formula type";
else if(cellType == CellType.NUMERIC)
else if (cellType == CellType.NUMERIC)
return "Numeric type";
else if(cellType == CellType.STRING)
else if (cellType == CellType.STRING)
return "String type";
else
return "Unknown type";
......@@ -96,13 +97,13 @@ public class ExcelUtil {
return null;
}
CellType cellType = cell.getCellTypeEnum();
if(cellType == CellType.BLANK)
if (cellType == CellType.BLANK)
return null;
else if(cellType == CellType.BOOLEAN)
else if (cellType == CellType.BOOLEAN)
return cell.getBooleanCellValue();
else if(cellType == CellType.ERROR)
else if (cellType == CellType.ERROR)
return cell.getErrorCellValue();
else if(cellType == CellType.FORMULA) {
else if (cellType == CellType.FORMULA) {
try {
if (HSSFDateUtil.isCellDateFormatted(cell)) {
return cell.getDateCellValue();
......@@ -112,15 +113,13 @@ public class ExcelUtil {
} catch (IllegalStateException e) {
return cell.getRichStringCellValue();
}
}
else if(cellType == CellType.NUMERIC){
} else if (cellType == CellType.NUMERIC) {
if (DateUtil.isCellDateFormatted(cell)) {
return cell.getDateCellValue();
} else {
return cell.getNumericCellValue();
}
}
else if(cellType == CellType.STRING)
} else if (cellType == CellType.STRING)
return cell.getStringCellValue();
else
return null;
......@@ -136,7 +135,7 @@ public class ExcelUtil {
* javabean属性的数据类型有基本数据类型及String,Date,String[],Double[]
* @param out 与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
*/
public static <T> void exportExcel(Map<String,String> headers, Collection<T> dataset, OutputStream out) {
public static <T> void exportExcel(Map<String, String> headers, Collection<T> dataset, OutputStream out) {
exportExcel(headers, dataset, out, null);
}
......@@ -152,7 +151,7 @@ public class ExcelUtil {
* @param pattern 如果有时间数据,设定输出格式。默认为"yyy-MM-dd"
*/
@SuppressWarnings("resource")
public static <T> void exportExcel(Map<String,String> headers, Collection<T> dataset, OutputStream out,
public static <T> void exportExcel(Map<String, String> headers, Collection<T> dataset, OutputStream out,
String pattern) {
// 声明一个工作薄
HSSFWorkbook workbook = new HSSFWorkbook();
......@@ -249,10 +248,10 @@ public class ExcelUtil {
* @param dataset 数据集合
* @param pattern 日期格式
*/
private static <T> void write2Sheet(HSSFSheet sheet, Map<String,String> headers, Collection<T> dataset,
private static <T> void write2Sheet(HSSFSheet sheet, Map<String, String> headers, Collection<T> dataset,
String pattern) {
//时间格式默认"yyyy-MM-dd"
if (StringUtils.isEmpty(pattern)){
if (StringUtils.isEmpty(pattern)) {
pattern = "yyyy-MM-dd";
}
// 产生表格标题行
......@@ -260,8 +259,8 @@ public class ExcelUtil {
// 标题行转中文
Iterator<Map.Entry<String, String>> it1 = headers.entrySet().iterator();
String key = StringUtils.EMPTY; //存放临时键变量
int c= 0; //标题列数
while (it1.hasNext()){
int c = 0; //标题列数
while (it1.hasNext()) {
key = it1.next().getKey();
if (headers.containsKey(key)) {
HSSFCell cell = row.createCell(c);
......@@ -285,7 +284,7 @@ public class ExcelUtil {
int cellNum = 0;
//遍历列名
Iterator<String> it2 = headers.keySet().iterator();
while (it2.hasNext()){
while (it2.hasNext()) {
key = it2.next();
if (!headers.containsKey(key)) {
LG.error("Map 中 不存在 key [" + key + "]");
......@@ -293,8 +292,8 @@ public class ExcelUtil {
}
Object value = map.get(key);
HSSFCell cell = row.createCell(cellNum);
cellNum = setCellValue(cell,value,pattern,cellNum,null,row);
//TODO
cellNum = setCellValue(cell, value, pattern, cellNum, null, row);
cellNum++;
}
......@@ -307,7 +306,7 @@ public class ExcelUtil {
field.setAccessible(true);
Object value = field.get(t);
cellNum = setCellValue(cell,value,pattern,cellNum,field,row);
cellNum = setCellValue(cell, value, pattern, cellNum, field, row);
cellNum++;
}
......@@ -322,12 +321,24 @@ public class ExcelUtil {
}
}
private static int setCellValue(HSSFCell cell,Object value,String pattern,int cellNum,Field field,HSSFRow row){
private static int setCellValue(HSSFCell cell, Object value, String pattern, int cellNum, Field field, HSSFRow row) {
String textValue = null;
if (value instanceof Integer) {
int intValue = (Integer) value;
//判断int类型上是否有注解ExcelCell注解的isStatus属性
ExcelCell anno = field.getAnnotation(ExcelCell.class);
String status = anno.isStatus();
if (anno != null && StringUtils.isNotBlank(status)) {
//把属性中设置的值分割
List<String> statusList = Arrays.asList(status.split(","));
//获取:前的前缀进行对比
String s = statusList.stream().filter(e -> e.substring(0, e.indexOf(":")).equals(value.toString())).collect(Collectors.toList()).get(0);
//设置:后的后缀值进cell表格中
cell.setCellValue(s.substring(s.indexOf(":") + 1));
} else {
cell.setCellValue(intValue);
} else if(value instanceof BigDecimal){
}
} else if (value instanceof BigDecimal) {
textValue = DECIMAL_FORMAT.format(value);
} else if (value instanceof Float) {
float fValue = (Float) value;
......@@ -372,14 +383,28 @@ public class ExcelUtil {
} else {
// 其它数据类型都当作字符串简单处理
String empty = StringUtils.EMPTY;
if(field != null) {
if (field != null) {
ExcelCell anno = field.getAnnotation(ExcelCell.class);
if (anno != null) {
empty = anno.defaultValue();
}
//判断字段是否有注解ExcelCell注解的isStatus属性
String status = anno.isStatus();
if (anno != null && StringUtils.isNotBlank(status)) {
//把属性中设置的值分割
List<String> statusList = Arrays.asList(status.split(","));
//获取:前的前缀进行对比
List<String> lists = statusList.stream().filter(e -> e.substring(0, e.indexOf(":")).equals(value)).collect(Collectors.toList());
String s = lists.size() > 0 ? lists.get(0) : "";
//设置:后的后缀值进cell表格中
textValue = s == null ? empty : s.substring(s.indexOf(":") + 1);
} else {
textValue = value == null ? empty : value.toString();
}
} else {
textValue = value == null ? empty : value.toString();
}
}
if (textValue != null) {
HSSFRichTextString richString = new HSSFRichTextString(textValue);
cell.setCellValue(richString);
......@@ -391,7 +416,6 @@ public class ExcelUtil {
* 把Excel的数据封装成voList
*
* @param clazz vo的Class
* @param inputStream excel输入流
* @param pattern 如果有时间数据,设定输入格式。默认为"yyy-MM-dd"
* @param logs 错误log集合
* @param arrayCount 如果vo中有数组类型,那就按照index顺序,把数组应该有几个值写上.
......@@ -410,14 +434,13 @@ public class ExcelUtil {
}*/
List<T> list = new ArrayList<>();
Sheet sheet;
if(null == sheetName || sheetName.isEmpty()) {
if (null == sheetName || sheetName.isEmpty()) {
sheet = workBook.getSheetAt(0);
}
else {
} else {
sheet = workBook.getSheet(sheetName);
}
if(sheet == null) {
if (sheet == null) {
return null;
}
......@@ -558,7 +581,6 @@ public class ExcelUtil {
/**
* 读取Excel的Header行, 并封装成Map<String, int)
*
* @param inputStream excel输入流
* @param sheetName sheet名, 如默认只有一个sheet, 传入null
* @return Header Map, Key - 字段名, Value - index
* @throws RuntimeException
......@@ -574,17 +596,16 @@ public class ExcelUtil {
}*/
Sheet sheet;
if(null == sheetName || sheetName.isEmpty()) {
if (null == sheetName || sheetName.isEmpty()) {
sheet = workBook.getSheetAt(0);
}
else {
} else {
sheet = workBook.getSheet(sheetName);
}
if(sheet == null) {
if (sheet == null) {
return null;
}
if(sheet.getFirstRowNum()<0) {
if (sheet.getFirstRowNum() < 0) {
return titleMap;
}
Row headerRow = sheet.getRow(sheet.getFirstRowNum());
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -18,7 +19,6 @@ import pwc.taxtech.atms.exception.FormulaException;
import pwc.taxtech.atms.vat.entity.PeriodCellData;
import pwc.taxtech.atms.vat.entity.PeriodDataSource;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -76,14 +76,14 @@ public class BB extends FunctionBase implements FreeRefFunction {
nullCellDto.fixedWithGroup(cellTemplateData);
// todo: fix datasource name by templateList(neo)
if (curPeriod.getCurPeriod() == -99) {
if (bo.getPeriod().intValue() == 99) {
dataSource.clear();
BigDecimal returnEval = defaultBigDecimal;
if (formulaContext.getPeriod() <= 1) {
return defaultBigDecimal;
}
for (int p = 1; p < formulaContext.getPeriod(); p++) {
//如果是当年取到当期截至,往年取12期
for (int p = 1; p < (curPeriod.getCurYear()==formulaContext.getYear()?formulaContext.getPeriod():12); p++) {
try {
returnEval = returnEval.add(bb(new BBParasBo(bo, p, curPeriod.getCurYear()), ec, dataSource, bo));
} catch (Exception e) {
......@@ -94,7 +94,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
return returnEval;
} else if (bo.getPeriod().intValue() == 0) {
}
if (bo.getPeriod().intValue() == 0 && bo.getYear().intValue() == 0) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, bo.getRowIndex() - 1, bo.getColumnIndex() - 1,
Long.parseLong(cellTemplateData.getCellTemplateId()));
......
......@@ -41,7 +41,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
if(!(args[5] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
String formulaExpression = "DFFS(\"" + code + "\"," + year + "," + period + ","
......@@ -103,7 +103,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<TrialBalance> list = SpringContextUtil.trialBalanceMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
......@@ -138,7 +138,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<AdjustmentTable> list = SpringContextUtil.adjustmentTableMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
......@@ -173,7 +173,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<TrialBalanceFinal> list = SpringContextUtil.trialBalanceFinalMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
......
......@@ -41,7 +41,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
if(!(args[5] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
......@@ -102,7 +102,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<TrialBalance> list = SpringContextUtil.trialBalanceMapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
......@@ -136,7 +136,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<AdjustmentTable> list = SpringContextUtil.adjustmentTableMapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
......@@ -170,7 +170,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
c1.andSegment5EqualTo(segment5);
}
if(StringUtils.isNotBlank(segment6)){
c1.andSegment5EqualTo(segment6);
c1.andSegment6EqualTo(segment6);
}
List<TrialBalanceFinal> list = SpringContextUtil.trialBalanceFinalMapper.selectByExample(example);
if (CollectionUtils.isEmpty(list)) {
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
......@@ -7,13 +8,11 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.TaxCellDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.WPNAMEParasBo;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException;
import java.math.BigDecimal;
......@@ -57,7 +56,10 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
//根据目标列+名称定位数据行,再根据参数列+数据行定位sheet单元格
cellTemplateDataList = agent.getCellTemplateByNameAndIndex(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowColumnIndex()-1,bo.getRowName(), bo.getColumnIndex() - 1, formulaContext.getPeriod());
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
cellTemplateData = cellTemplateDataList.get(0);
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex()-1,
......
......@@ -8,17 +8,14 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.WPTYPEParasBo;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class WPTYPE extends FunctionBase implements FreeRefFunction {
......@@ -61,7 +58,10 @@ public class WPTYPE extends FunctionBase implements FreeRefFunction {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), ec.getRowIndex(), ec.getColumnIndex(), formulaContext.getPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
for (CellTemplatePerGroupDto cellTemplateData : cellTemplateDataList) {
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
BigDecimal curCellVal = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex() - 1,
......
......@@ -45,8 +45,8 @@ log.level=INFO
log.debug=false
env_type=pub
file_upload_post_url=http://100.69.238.155:8000/resource/erp_tax_system
file_upload_query_url=http://100.69.238.155:8001/resource/erp_tax_system
file_upload_post_url=http://10.88.128.214:8000/resource/erp_tax_system
file_upload_query_url=http://10.88.128.214:8001/resource/erp_tax_system
#���ϵ�ַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=true
......@@ -59,18 +59,18 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
ebs_call_url=http://172.20.3.109:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
tableau_unreturned_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_tax_comparison=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet14?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_countries=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Others?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_cost_analysis=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet19?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_profit_and_loss=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet26?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_other_domestic_data=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet32?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_doc_situation=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/sheet40?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_global_overview=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/InternationalOverview?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_mexican_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Mexico?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_australian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Australia?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
tableau_brazilian_tax=http://10.158.230.16:8890/trusted/%s/views/Didi_Tax_20190307/Brazil?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no&:toolbar=no
......@@ -2,7 +2,6 @@ package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Lists;
import org.junit.Test;
......@@ -12,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.schedule.OrgSyncJob;
import pwc.taxtech.atms.common.util.BaseThreadFactory;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.HttpUtil;
......@@ -30,8 +28,6 @@ import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.security.dd.DtsTokenService;
import pwc.taxtech.atms.service.EbsApiService;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource;
import javax.crypto.Cipher;
......@@ -712,11 +708,9 @@ public class EbsApiServiceImplTest extends CommonIT {
public String encryptInput(){
BASE64Encoder base64 = new BASE64Encoder();
BASE64Decoder base64Decoder = new BASE64Decoder();
byte[] encodeData;
try {
byte[] publicKey = base64Decoder.decodeBuffer("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==");
byte[] publicKey = org.apache.commons.codec.binary.Base64.decodeBase64("MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==");
String nonce = generateNonce();
String sDate = generateDate();
long rNum = generateRandomNumber();
......@@ -724,12 +718,11 @@ public class EbsApiServiceImplTest extends CommonIT {
byte[] data1 = inputStr1.getBytes();
logger.debug("原文:" + inputStr1);
encodeData = encryptByPublicKey(data1, publicKey);
logger.debug("公钥加密后:" + base64.encode(encodeData));
} catch (Exception ex) {
throw new ServiceException("cus" + ex);
}
return base64.encode(encodeData);
return org.apache.commons.codec.binary.Base64.encodeBase64String(encodeData);
}
......@@ -737,7 +730,7 @@ public class EbsApiServiceImplTest extends CommonIT {
private String generateNonce() throws Exception {
String dateTimeString = Long.toString(System.currentTimeMillis());
byte[] nonceByte = dateTimeString.getBytes();
return Base64.encodeBase64String(nonceByte);
return Base64.getEncoder().encodeToString(nonceByte);
}
private String generateDate() throws Exception {
......
......@@ -11,7 +11,6 @@ import java.lang.annotation.Target;
/**
* The <code>ExcelCell</code><br>
* 数值型的栏位只能使用Double
* @see {@link pwc.taxtech.atms.thirdparty.sargeraswang.util.ExcelUtil.ExcelUtil#exportExcel}
* @author sargeras.wang
* @version 1.0, Created at 2013年9月14日
* @version 1.1, Updated at 2013年10月20日 ,添加了专用于验证的子注解:Valid
......@@ -83,5 +82,14 @@ public @interface ExcelCell {
* @return le
*/
double le() default Double.NaN;
}
/**
* 如果有状态 或 int类型转换为String
* 可通过此注解转换为String
* 格式: 中间用逗号 , 隔开
* 例 0:待审核,1:审核通过,-1:已拒绝
* @return
*/
String isStatus() default StringUtils.EMPTY;
}
......@@ -147,7 +147,7 @@ public class FileTypes implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=9)
@ExcelCell(index=9,isStatus = "0:停用,1:启用")
private String status;
/**
......
......@@ -140,7 +140,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=9)
@ExcelCell(index=10)
private Date effectiveTime;
/**
......@@ -152,7 +152,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=17)
@ExcelCell(index=9)
private Integer ownTime;
/**
......@@ -173,7 +173,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=10)
@ExcelCell(index=16)
private String creator;
/**
......@@ -183,7 +183,6 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=11)
private Date createTime;
/**
......@@ -204,7 +203,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=12)
@ExcelCell(index=15)
private Date uploadTime;
/**
......@@ -249,6 +248,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=12)
private String physicalIndexNumber;
/**
......@@ -260,7 +260,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=15)
@ExcelCell(index=17)
private String remark;
/**
......@@ -283,7 +283,6 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=16)
private String filePositionUrl;
/**
......@@ -317,6 +316,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
@ExcelCell(index=11,isStatus = "0:未审核,1:审核通过,-1:审核不通过")
private Integer auditStatus;
/**
......
......@@ -33,7 +33,12 @@
<insert id="insertBatch" parameterType="java.util.List">
insert into invoice_record
(<include refid="Base_Column_List"/>)
(id, organization_id, project_id, tms_period, period, seq_no, `source`, billing_body,
customer_company_name, invoice_type, billing_content, invoice_amount, applicant,
oa_application_num, contract_no, contract_amount, department, application_date, billing_date,
billing_month, invoice_code, invoice_num, invoices_amount, customer_company_tax_num,
contract_source_system, tax_rate, tax_amount, invoice_status, remarks, create_time,
update_time)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
......
......@@ -850,5 +850,7 @@
"TBEBITForm":"TB EBIT Form",
"ClickEnsureTip": "Click Ensure Button!",
"ConditionColumnNum": "Search Condition Column Num",
"Condition": "Search Condition",
"RevenueTypeConfiguration":"Revenue Type Config"
}
......@@ -909,6 +909,7 @@
"true": "是",
"false": "否",
"ConditionColumnNum": "条件列",
"Condition": "查询条件",
"~MustBeEndOneApp": "I Must be the End One, please!"
}
......@@ -8,6 +8,7 @@ frameworkModule.controller('appUsrOperateLogController',
// thisTitle:"@",
// thisParams:"=",
$scope.localData = null;
$scope.loadMainData = function () {
$scope.thisModuleId = $scope.thisModuleId ? $scope.thisModuleId : [];
var config = {
......@@ -23,7 +24,17 @@ frameworkModule.controller('appUsrOperateLogController',
$scope.dataGridUpdate(data);
})
};
// $scope.sniffHelpPopRadio = function(){
// taxDocumentListService.getDocumentsAttrAndType({params: {}}).then(function (data) {
// $scope.FileAttrAndTypeCache = data.items;
// //根据文件属性来匹配出 文件类型下拉列表
// $scope.syncFileType($scope.editFieldModel.fileAttr);
// $scope.editFieldModel.fileType = checkedItem.getAttribute("data-fileType");
// $scope.syncRequiredFields($scope.editFieldModel);
// });
//
// $("#helpPopDialog").modal("hide");
// };
// comment: "767"
// createTime: "2019-01-28T11:38:31.000+08:00"
// id: "1"
......@@ -88,6 +99,19 @@ frameworkModule.controller('appUsrOperateLogController',
dataField: "id",
caption: $translate.instant('LogIndex'),
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
var target = $('<span data-name="logCheckedItem" type="checkbox" ' +
'data-id="' + options.data.id + '" ' +
'>' + options.data.id + '</span>');
container.append(target);
var table = $("#appUsrLogTable").find("table");
$(table).off("click").on("click",function(e){
var target = $(e.target);
if(target.parents("tr").length)
target.parents("tr").find("td").toggleClass('log-export-checked-item');
})
}
},
{
dataField: "createTime",
......@@ -173,8 +197,19 @@ frameworkModule.directive('usrLogExportPlugin',function(){
function($scope,SweetAlert,$translate,usrOperateLogService,$q,$log){
$scope.exportTableData = function ()
{
usrOperateLogService[$scope.thisModuleName + "Export"]().then(function (data, status, headers) {
var checkedItems = $(".log-export-checked-item");
var ids = [];
if(checkedItems.length)
checkedItems.find("span[data-name='logCheckedItem']")
.each(function(index,checkedItem){
var idLike = checkedItem.getAttribute('data-id');
if(idLike || idLike == 0){
ids.push(idLike);
}
});
usrOperateLogService[$scope.thisModuleName + "Export"]({
"ids":ids
}).then(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
......
......@@ -10,6 +10,12 @@
.log-export-btn:hover{
background: #E6E6E6;
}
/*事件样式,只发生在事件触发期间,用important影响不大*/
td.log-export-checked-item{
background: #337ab7 !important;
color: #fff !important;
}
</style>
<button class="btn btn-not-important" ng-click="openUsrOperateLogPop()"><i class="material-icons">description</i><span translate="log">日志</span></button>
<script type="text/html" id="usrOperateLogPopContainer">
......@@ -30,7 +36,7 @@
<!--</div>-->
<!--<div ui-grid="operateLogGridOptions" ui-grid-selection style="width:1140px; height:510px;margin:0px;"></div>-->
<div class="dx-viewport demo-container">
<div class="dx-viewport demo-container" id="appUsrLogTable">
<button class="btn log-export-btn" ng-click="exportTableData()">
<i class="fa fa-file-excel-o"></i>
......
......@@ -12,22 +12,22 @@ frameworkModule.factory('usrOperateLogService',
docManageListLog: function (params) {
return jqFetch.post(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectListForLog', params);
},
docManageListLogExport:function(){
docManageListLogExport:function(params){
$('#busy-indicator-container').show();
return exportFn(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/exportExcel');
return exportFn(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/exportExcel',params);
},
docManageTypeLogExport:function(){
docManageTypeLogExport:function(params){
$('#busy-indicator-container').show();
return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel');
return exportFn(apiInterceptor.webApiHostUrl + '/operLogFileTypes/exportExcel',params);
// http://etms.longi-silicon.com:8180//api/v1/operLogFileTypes/exportExcel
}
};
function exportFn(url) {
function exportFn(url,params) {
var defer = $q.defer();
var xhr = new XMLHttpRequest();
......@@ -41,7 +41,7 @@ frameworkModule.factory('usrOperateLogService',
xhr.setRequestHeader("Authorization", apiInterceptor.tokenType + ' ' + apiInterceptor.apiToken());
xhr.setRequestHeader("Content-Type", 'application/json;charset=UTF-8');
xhr.responseType = "arraybuffer";
xhr.send();
xhr.send(JSON.stringify(params));
return defer.promise;
}
......
......@@ -1610,11 +1610,15 @@ taxDocumentManageModule.directive('tempModule', function () {
}
});
taxDocumentListService.getCompanyNameOptions().then(function (data) {
// console.log(data);
if (data) {
$scope.companyNameOptionsMap = data;
taxDocumentListService.getCompanyNameOptions().then(function(res){
if (res && 0 === res.code) {
angular.forEach(res.data, function (item) {
$scope.companyNameOptionsMap[item.id]=item.name;
});
} else {
SweetAlert.error($translate.instant('RevenueGetOrgError'));
}
});
};
$scope.loadSelectMap();
......
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