Commit 6059beec authored by kevin's avatar kevin

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

parents fa56df0c a8e01d74
......@@ -57,10 +57,10 @@ public class CitImportExcelController {
opeResultDto = citImportExcelService.citImportExcel(file, orgList, file.getOriginalFilename(), periodDate, importType, importFileType);
return opeResultDto;
}catch (Exception e){
logger.error("资产导入失败,错误信息如下:");
logger.error("文件导入失败,错误信息如下:");
e.printStackTrace();
opeResultDto.setResult(false);
opeResultDto.setResultMsg("资产导入失败");
opeResultDto.setResultMsg("文件导入失败");
return opeResultDto;
}
}
......
......@@ -9,10 +9,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.CitAssetsListDto;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.vatdto.ManualDataSourceDto;
import pwc.taxtech.atms.dto.vatdto.PeriodJobDto;
import pwc.taxtech.atms.dto.vatdto.ReportDataDto;
......@@ -69,6 +66,28 @@ public class CitReportController {
return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator));
}
/**
* 生成CIT总分机构分配表
* @param projectId
* @return
*/
@RequestMapping(value = "generateDistributionTable/{projectId}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ApiResultDto generateDistributionTable(@PathVariable String projectId) {
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("生成成功");
apiResultDto.setData(citReportService.generateTotalBranchOrgDisTable(projectId));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("生成失败");
return apiResultDto;
}
}
/**
* 获取当前卡片所拥有的模板
* @param projectId
......@@ -123,7 +142,7 @@ public class CitReportController {
/**
* 日记账合并版导出
* 固定资产及EAM Mapping导出
* @param paras
* @param response
*/
......@@ -137,6 +156,36 @@ public class CitReportController {
}
}
/**
* 获取 企业所得税汇总纳税分支机构所得税分配表(A202000)
* @param citDistributionDto
* @return
*/
@RequestMapping(value = "/getDistributionTables", method = RequestMethod.POST)
public @ResponseBody
ApiResultDto getCitDistribution(@RequestBody CitDistributionDto citDistributionDto){
logger.info("获取 企业所得税汇总纳税分支机构所得税分配表 的数据");
ApiResultDto apiResultDto = new ApiResultDto();
try{
apiResultDto.setCode(1);
apiResultDto.setMessage("获取成功");
apiResultDto.setData(citReportService.getCitDistribution(citDistributionDto));
return apiResultDto;
}catch(Exception e){
e.printStackTrace();
apiResultDto.setCode(0);
apiResultDto.setMessage("获取失败");
return apiResultDto;
}
}
/**
* 获取单元格相关数据
* @param reportId
* @param from
* @return
*/
@RequestMapping(value = "reportData/{reportId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<ReportDataDto> getReportData(@PathVariable Long reportId, @RequestHeader String from) {
OperationResultDto resultDto = new OperationResultDto();
......@@ -147,6 +196,12 @@ public class CitReportController {
return reportService.getCellData(reportId, from);
}
/**
* 添加手工数据源
* @param data
* @param from
* @return
*/
@RequestMapping(value = "addCellManualData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity addCellManualDataSource(@RequestBody ManualDataSourceDto data, @RequestHeader String from) {
String projectId = StringUtils.EMPTY;
......
......@@ -94,20 +94,21 @@ 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"));
OutputStream ouputStream = response.getOutputStream();
ExcelUtil.exportExcel(headers, TaxDocument, ouputStream);
ouputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -23,6 +23,17 @@ public class DidiFileIUploadParam implements Serializable {
private List<Integer> uploadYears;
//是否转换url为本地url
private boolean isParseUrl = true;
public boolean isParseUrl() {
return isParseUrl;
}
public void setParseUrl(boolean parseUrl) {
isParseUrl = parseUrl;
}
public List<String> getBizSources() {
return bizSources;
}
......
......@@ -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);
}
......
......@@ -1881,11 +1881,12 @@ public class DataImportService extends BaseService {
String effectiveDateTo = param.getEffectiveDateTo();
List<Future> resList = Lists.newArrayList();
List<Integer> dataTypes = param.getDataTypes();
String operator = authUserHelper.getCurrentAuditor().get();
dataTypes.forEach(type -> {
orgs.forEach(o -> {
try {
Callable callEbs = new CallEbsThread(type, o,ebsCallUrl,dataImportLogMapper,authUserHelper,
idService,dtsTokenService,period, effectiveDateFrom, effectiveDateTo);
idService,dtsTokenService,period, effectiveDateFrom, effectiveDateTo, operator);
executorService.submit(callEbs);
// resList.add(future);
} catch (RejectedExecutionException rje) {
......@@ -2004,10 +2005,11 @@ public class DataImportService extends BaseService {
private String effectiveDateFrom;
private String effectiveDateTo;
private String operator;
CallEbsThread(int type, Organization org, String ebsCallUrl, DataImportLogMapper dataImportLogMapper,
AuthUserHelper authUserHelper, DistributedIdService idService, DtsTokenService dtsTokenService,
String period,String effectiveDateFrom, String effectiveDateTo) {
String period,String effectiveDateFrom, String effectiveDateTo, String operator) {
this.type = type;
this.org = org;
this.period = period;
......@@ -2018,6 +2020,7 @@ public class DataImportService extends BaseService {
this.dataImportLogMapper = dataImportLogMapper;
this.effectiveDateFrom = effectiveDateFrom;
this.effectiveDateTo = effectiveDateTo;
this.operator = operator;
}
@Override
......@@ -2038,7 +2041,7 @@ public class DataImportService extends BaseService {
log.setType(EnumImportType.ExtractFinancialData.getCode());
log.setFileType(EnumEbsExtractType.getNameByCode(type));
log.setPeriodStatus("EBS抽取");
log.setOperator(authUserHelper.getCurrentAuditor().get());
log.setOperator(operator);
try {
if (StringUtils.isEmpty(org.getEnterpriseAccountCode())) {
log.setId(idService.nextId());
......
......@@ -35,6 +35,7 @@ import pwc.taxtech.atms.vat.entity.FileUploadLog;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Calendar;
......@@ -74,6 +75,10 @@ public class DidiFileUploadService extends BaseService {
private static final String PROXY_PORT = "11007";
public FileUpload getFileUpload(String uid){
return fileUploadMapper.selectByPrimaryKey(uid);
}
public FileUpload uploadFile(MultipartFile file, String fileName, String bizSource) throws ServiceException {
CloseableHttpClient httpClient = null;
String requestKey = CommonUtils.getUUID();
......@@ -86,7 +91,7 @@ public class DidiFileUploadService extends BaseService {
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl);
String md5Str = getFileMD5String(file);
ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName) ? file.getOriginalFilename() : fileName);
ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName) ? URLEncoder.encode(file.getOriginalFilename(), "UTF-8") : URLEncoder.encode(fileName, "UTF-8"));
StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build();
httpPost.setEntity(httpEntity);
......@@ -134,7 +139,7 @@ public class DidiFileUploadService extends BaseService {
try {
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl);
ByteArrayBody byteBody = new ByteArrayBody(bytes, ContentType.MULTIPART_FORM_DATA, fileName);
ByteArrayBody byteBody = new ByteArrayBody(bytes, ContentType.MULTIPART_FORM_DATA, URLEncoder.encode(fileName, "UTF-8"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).build();
httpPost.setEntity(httpEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
......@@ -192,6 +197,7 @@ public class DidiFileUploadService extends BaseService {
}
public PageInfo<DidiFileUploadDetailResult> queryPage(DidiFileIUploadParam param) {
Page page = null;
if (param.getPageInfo() != null && param.getPageInfo().getPageSize() != null && param.getPageInfo().getPageIndex() != null) {
......@@ -219,7 +225,11 @@ public class DidiFileUploadService extends BaseService {
}
refreshViewUrl(param);
PageInfo<DidiFileUploadDetailResult> pageInfo = new PageInfo<>(fileUploadMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DidiFileUploadDetailResult())).collect(Collectors.toList()));
.map(o -> {
DidiFileUploadDetailResult item = new DidiFileUploadDetailResult();
beanUtil.copyProperties(o, item);
return item;
}).collect(Collectors.toList()));
if (page != null) {
pageInfo.setTotal(page.getTotal());
}
......
......@@ -352,15 +352,18 @@ public class TaxDocumentServiceImpl {
TaxDocumentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(ids);
TaxDocument taxDocument = taxDocumentMapper.selectByExample(example).get(0);
String urlPath = taxDocument.getFilePositionUrl();
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(taxDocument.getFileUploadId()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
String urlPath = uploadDetail.getList().get(0).getViewHttpUrl();
//如果url为null或空字符串而抛出异常
if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + taxDocument.getId());
}
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(taxDocument.getFileName())
String fileName = StringUtils.isBlank(uploadDetail.getList().get(0).getFileName())
? "未知文件(请修改后缀名).xlsx"
: taxDocument.getFileOriginalName();//设置输出流信息
: uploadDetail.getList().get(0).getFileName();//设置输出流信息
try {
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));
......@@ -474,19 +477,39 @@ public class TaxDocumentServiceImpl {
throw new RuntimeException("传入参数错误:空参数数组");
}
criteria.andIdIn(ids);
//查询出根据条件过滤后需要下载的附件数据信息
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(example);
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(taxDocuments.stream()
.map(o -> o.getFileUploadId()).collect(Collectors.toList()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
for (TaxDocument item : taxDocuments) {
//新建一个空集合,记录下载的名字,并用于判断是否重名,重名则修改名字为(n)
List<String> fileNameList = new ArrayList<>();
for (DidiFileUploadDetailResult item : uploadDetail.getList()) {
//文件url
String urlPath = item.getFilePositionUrl();
//如果url为null或空字符串而抛出异常
if (StringUtils.isBlank(urlPath)) {
throw new RuntimeException("文件url为空,id为:" + item.getId());
String urlPath = item.getViewHttpUrl();
// //如果url为null或空字符串而抛出异常
// if (StringUtils.isBlank(urlPath)) {
// throw new RuntimeException("文件url为空,id为:" + item.getId());
// }
//检查文件名是否有重复
int fileNameRepeatTimes = 0;
if (fileNameList.size()>0){
fileNameRepeatTimes = Collections.frequency(fileNameList, item.getFileName());
}
//文件名称(带后缀) 文件名前+7位uuid截取码以防文件名相同
String fileName = StringUtils.isBlank(item.getFileName())
? "未知文件(请修改后缀名).xlsx"
: 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];
......
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.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 +20,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;
......@@ -61,29 +62,14 @@ public class BB extends FunctionBase implements FreeRefFunction {
BigDecimal cellValue = BigDecimal.ZERO;
try {
List<CellTemplatePerGroupDto> cellTemplateDataList;
if (curPeriod.getCurYear() != formulaContext.getYear()) {
Project project = agent.getFixedProject(formulaContext.getProjectId(), curPeriod.getCurYear());
MyAsserts.assertNotNull(project, Exceptions.PROJECT_NOT_FOUND);
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
project.getId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
} else {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
}
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
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) {
......@@ -92,32 +78,45 @@ public class BB extends FunctionBase implements FreeRefFunction {
}
}
}
return returnEval;
} else if (bo.getPeriod().intValue() == 0) {
}
List<CellTemplatePerGroupDto> cellTemplateDataList;
if (curPeriod.getCurYear() != formulaContext.getYear()) {
Project project = agent.getFixedProject(formulaContext.getProjectId(), curPeriod.getCurYear());
// MyAsserts.assertNotNull(project, Exceptions.PROJECT_NOT_FOUND);
if(project == null){
return cellValue;
}
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
project.getId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
} else {
cellTemplateDataList = agent.getCellTemplateGroupDto(formulaContext.getReportTemplateGroupId(),
formulaContext.getProjectId(), bo.getReportCode(), bo.getRowIndex() - 1, bo.getColumnIndex() - 1, curPeriod.getCurPeriod());
}
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if(CollectionUtils.isEmpty(cellTemplateDataList)){
return cellValue;
}
CellTemplatePerGroupDto cellTemplateData = cellTemplateDataList.get(0);
nullCellDto.fixedWithGroup(cellTemplateData);
//当年当期
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()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue);
return cellValue;
}
PeriodCellData cellData = null;
String projectId = agent.getPastProjectId(curPeriod.getCurYear(),
formulaContext.getOrganizationId());
MyAsserts.assertNotEmpty(projectId, Exceptions.PROJECT_EMPTY);
cellData = agent.getCellData(cellTemplateData.getReportTemplateId(),
cellTemplateData.getCellTemplateId(), curPeriod.getCurPeriod(), formulaContext.getProjectId());
List<PeriodDataSource> dss = agent.queryManualDataSource(Long.parseLong(cellTemplateData.getCellTemplateId()),
formulaContext.getProjectId(), bo.getPeriod());
nullCellDto.extractFromGroup(bo, curPeriod, cellData, cellTemplateData);
if (cellData.getData() == null && !dss.isEmpty()) {
cellValue = dss.get(0).getAmount();
} else if (cellData.getData() != null && dss.isEmpty()) {
......@@ -127,14 +126,12 @@ public class BB extends FunctionBase implements FreeRefFunction {
cellValue = dss.get(0).getAmount().add(new BigDecimal(cellData.getData()).setScale(4,
BigDecimal.ROUND_HALF_DOWN));
} else throw Exceptions.BB_CELL_DATA_NULL;
nullCellDto.setAmount(cellValue);
if (rootBo != null) {
rootBo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId()));
} else {
bo.putPeriodCellTempate(curPeriod.getCurPeriod(), Long.parseLong(cellTemplateData.getCellTemplateId()));
}
LOGGER.debug("cell static value ");
return cellValue;
} catch (Exception e) {
......
......@@ -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)) {
......
......@@ -251,9 +251,11 @@ public class FunctionBase {
return bigDecimal;
}
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
if (!dss.isEmpty()){
return dss.get(0).getAmount();}
else {return new BigDecimal(0);}
}
}else{
try {
......@@ -264,9 +266,10 @@ public class FunctionBase {
return bigDecimal;
}
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
if (!dss.isEmpty()){
return dss.get(0).getAmount();}
else {return new BigDecimal(0);}
}
}
......
......@@ -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)) {
......
......@@ -108,8 +108,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
public FormulaDataSourceType selectShow(String tableName) {
if ("CIT_TBAM".equals(tableName)) {
return FormulaDataSourceType.CIT_TBAM;
}else{
return FormulaDataSourceType.Other;
}
return null;
}
public static String getSql (){
......
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;
}
package pwc.taxtech.atms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitDistribution;
import pwc.taxtech.atms.entity.CitDistributionExample;
@Mapper
public interface CitDistributionMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
long countByExample(CitDistributionExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int deleteByExample(CitDistributionExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int insert(CitDistribution record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int insertSelective(CitDistribution record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
List<CitDistribution> selectByExampleWithRowbounds(CitDistributionExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
List<CitDistribution> selectByExample(CitDistributionExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
CitDistribution selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CitDistribution record, @Param("example") CitDistributionExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int updateByExample(@Param("record") CitDistribution record, @Param("example") CitDistributionExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CitDistribution record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_distribution
*
* @mbg.generated
*/
int updateByPrimaryKey(CitDistribution record);
}
\ No newline at end of file
......@@ -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;
/**
......
......@@ -76,6 +76,10 @@
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.dataType != null">#{item.dataType,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
</trim>
</foreach>
;
......
......@@ -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!"
}
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