Commit 2f69a0c6 authored by zhkwei's avatar zhkwei

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

parents 14fafc39 9536f537
......@@ -53,7 +53,9 @@ public class TaxDocumentDto {
private String physicalIndexNumber;//实物索引号
private Integer ownTime;//所属期间
private Integer ownBeginTime;//所属期间
private Integer ownEndTime;//所属期间
private Integer auditStatus;//审核状态
......@@ -215,12 +217,20 @@ public class TaxDocumentDto {
this.companyId = companyId;
}
public Integer getOwnTime() {
return ownTime;
public Integer getOwnBeginTime() {
return ownBeginTime;
}
public void setOwnBeginTime(Integer ownBeginTime) {
this.ownBeginTime = ownBeginTime;
}
public Integer getOwnEndTime() {
return ownEndTime;
}
public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime;
public void setOwnEndTime(Integer ownEndTime) {
this.ownEndTime = ownEndTime;
}
public String getCompanyName() {
......
......@@ -105,9 +105,13 @@ public class TaxDocumentServiceImpl {
if (null != taxDocumentDto.getFileEndTTime()) {
criteria.andFileTimeLessThanOrEqualTo(taxDocumentDto.getFileEndTTime());
}
//所属时间 ownTime
if (null != taxDocumentDto.getOwnTime()) {
criteria.andOwnTimeEqualTo(taxDocumentDto.getOwnTime());
//所属開始时间 ownBeginTime
if (null != taxDocumentDto.getOwnBeginTime()) {
criteria.andOwnTimeGreaterThanOrEqualTo(taxDocumentDto.getOwnBeginTime());
}
//所属結束时间 ownEndTime
if (null != taxDocumentDto.getOwnEndTime()) {
criteria.andOwnTimeLessThanOrEqualTo(taxDocumentDto.getOwnEndTime());
}
//档案名称 fileName
if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) {
......@@ -200,6 +204,7 @@ public class TaxDocumentServiceImpl {
taxDocument.setCreator(authUserHelper.getCurrentAuditor().get());
taxDocument.setCreatorId(authUserHelper.getCurrentUserId());
taxDocument.setUploadTime(new Date());
taxDocument.setAuditStatus(0);
taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR));
//根据公司Id 设置业务线
String businessLine = organizationService.queryBusinessByCompanyId(taxDocument.getCompanyId());
......
......@@ -305,7 +305,7 @@ public class ReportServiceImpl extends BaseService {
private void updateConfig(String projectId, Integer period, Boolean isMergeManualData, List<Template> templates, PeriodJob job) {
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
//根据收入类型映射生成开票记录关联数据
assembleInvoiceRecord(projectId, period,isMergeManualData);
assembleInvoiceRecord(projectId, period, isMergeManualData);
//生成trial_balance_final数据
assembleTrialBalanceFinal(projectId, period);
clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
......@@ -333,7 +333,7 @@ public class ReportServiceImpl extends BaseService {
trialBalanceFinalMapper.generateFinalData(projectId, Integer.valueOf(queryPeriod), lastProject == null ? "0" : lastProject.getId(), Integer.valueOf(lastPeriod));
}
public void assembleInvoiceRecord(String projectId, Integer period,Boolean isMergeManualData) {
public void assembleInvoiceRecord(String projectId, Integer period, Boolean isMergeManualData) {
Project project = projectMapper.selectByPrimaryKey(projectId);
MyAsserts.assertNotNull(project, Exceptions.NOT_FOUND_REPORT_EXCEPTION);
String queryDate = project.getYear() + "-" + (period < 10 ? ("0" + period) : (period + ""));
......@@ -342,17 +342,15 @@ public class ReportServiceImpl extends BaseService {
andStartDateLessThanOrEqualTo(queryDate).andEndDateGreaterThanOrEqualTo(queryDate).
andStatusEqualTo(0);
List<RevenueTypeMapping> mappingList = revenueTypeMappingMapper.selectByExample(mappingExample);
//先清除数据
InvoiceRecord delRecord = new InvoiceRecord();
delRecord.setRevenueCofId(null);
if(!isMergeManualData){
delRecord.setModifyRevenueCofId(null);
}
InvoiceRecordExample delExample = new InvoiceRecordExample();
delExample.createCriteria().andProjectIdEqualTo(projectId)
.andProjectIdEqualTo(projectId).
delExample.createCriteria().andProjectIdEqualTo(projectId).
andPeriodEqualTo(Integer.valueOf(queryDate.replace("-", "")));
invoiceRecordMapper.deleteByExample(delExample);
if (isMergeManualData) {
invoiceRecordMapper.clearRevenueCof(true, false, delExample);
} else {
invoiceRecordMapper.clearRevenueCof(true, true, delExample);
}
Map<String, Long> map = new HashMap<>();
for (RevenueTypeMapping mapping : mappingList) {
if (!map.containsKey(mapping.getContent())) {
......@@ -472,140 +470,78 @@ public class ReportServiceImpl extends BaseService {
for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell == null) {
continue;//todo cell == null 如何处理
}
if (r <= addRowIndex + 1) {
String cellId = projectId + template.getId() + period + r + c;
if ((r - 1) >= 0 && (r - 1) < configIds.size()) {
cellId += configIds.get(configIds.size() - r);
}
Long cellTemplateId = Long.valueOf(cellId.hashCode());
cellTemplateId = cellTemplateId < 0 ? cellTemplateId : (cellTemplateId * -1);
//更新手工数据源
PeriodDataSourceExample delExample = new PeriodDataSourceExample();
delExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andColumnIndexEqualTo(c).andRowIndexEqualTo(r);
PeriodDataSource dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(999);
dataSource.setRowIndex(999);
periodDataSourceMapper.updateByExampleSelective(dataSource, delExample);
PeriodDataSourceExample updateExample = new PeriodDataSourceExample();
updateExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andCellTemplateIdEqualTo(cellTemplateId);
dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(c);
dataSource.setRowIndex(r);
periodDataSourceMapper.updateByExampleSelective(dataSource, updateExample);
PeriodCellTemplate cellTemplate = new PeriodCellTemplate();
cellTemplate.setPeriod(period);
cellTemplate.setRowName(POIUtil.getCellFormulaString(cell));
cellTemplate.setProjectId(projectId);
cellTemplate.setColumnIndex(c);
cellTemplate.setCreateTime(now);
cellTemplate.setCellTemplateId(cellTemplateId);
cellTemplate.setUpdateTime(now);
cellTemplate.setRowIndex(r);
cellTemplate.setReportTemplateId(template.getId());
cellTemplate.setId(distributedIdService.nextId());
if (cell.getCellComment() != null) {
cellTemplate.setComment(cell.getCellComment().getString().getString());
}
cellTemplate.setIsReadOnly(hasHandDatas.contains(c) ? 0 : 1);
cellTemplateList.add(cellTemplate);
if (r > 0 && hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period);
periodCellTemplateConfig.setCellTemplateId(cellTemplateId);
periodCellTemplateConfig.setReportTemplateId(template.getId());
periodCellTemplateConfig.setDataSourceType(1);
periodCellTemplateConfig.setFormula(POIUtil.getCellFormulaString(cell));
periodCellTemplateConfig.setParsedFormula(null);
if(r == addRowIndex + 1 && c>TaxesCalculateReportEnum.Column.Column_14.getIndex()){
assembleOriginalTemplateData(template,projectId,period,r,c,addRowIndex,cellTemplateList,cellTemplateConfigList);
}else{
String cellId = projectId + template.getId() + period + r + c;
if ((r - 1) >= 0 && (r - 1) < configIds.size()) {
cellId += configIds.get(configIds.size() - r);
}
Long cellTemplateId = Long.valueOf(cellId.hashCode());
cellTemplateId = cellTemplateId < 0 ? cellTemplateId : (cellTemplateId * -1);
//更新手工数据源
PeriodDataSourceExample delExample = new PeriodDataSourceExample();
delExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andColumnIndexEqualTo(c).andRowIndexEqualTo(r);
PeriodDataSource dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(999);
dataSource.setRowIndex(999);
periodDataSourceMapper.updateByExampleSelective(dataSource, delExample);
PeriodDataSourceExample updateExample = new PeriodDataSourceExample();
updateExample.createCriteria().andProjectIdEqualTo(projectId)
.andPeriodEqualTo(period).andTypeEqualTo(10).andCellTemplateIdEqualTo(cellTemplateId);
dataSource = new DataSourceExtendDto();
dataSource.setColumnIndex(c);
dataSource.setRowIndex(r);
periodDataSourceMapper.updateByExampleSelective(dataSource, updateExample);
PeriodCellTemplate cellTemplate = new PeriodCellTemplate();
cellTemplate.setPeriod(period);
cellTemplate.setRowName(POIUtil.getCellFormulaString(cell));
cellTemplate.setProjectId(projectId);
cellTemplate.setColumnIndex(c);
cellTemplate.setCreateTime(now);
cellTemplate.setCellTemplateId(cellTemplateId);
cellTemplate.setUpdateTime(now);
cellTemplate.setRowIndex(r);
cellTemplate.setReportTemplateId(template.getId());
cellTemplate.setId(distributedIdService.nextId());
if (cell.getCellComment() != null) {
cellTemplate.setComment(cell.getCellComment().getString().getString());
}
cellTemplate.setIsReadOnly(hasHandDatas.contains(c) ? 0 : 1);
cellTemplateList.add(cellTemplate);
if (r > 0 && hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period);
periodCellTemplateConfig.setCellTemplateId(cellTemplateId);
periodCellTemplateConfig.setReportTemplateId(template.getId());
periodCellTemplateConfig.setDataSourceType(1);
periodCellTemplateConfig.setFormula(POIUtil.getCellFormulaString(cell));
periodCellTemplateConfig.setParsedFormula(null);
// periodCellTemplateConfig.setCreateBy(authUserHelper.getCurrentUserId());
periodCellTemplateConfig.setCreateTime(now);
periodCellTemplateConfig.setCreateTime(now);
// periodCellTemplateConfig.setUpdateBy(authUserHelper.getCurrentUserId());
periodCellTemplateConfig.setUpdateTime(now);
periodCellTemplateConfig.setFormulaDataSource("报表数据");
periodCellTemplateConfig.setKeyValueParsedFormula(null);
periodCellTemplateConfig.setProjectId(projectId);
fixedParsedFormula(periodCellTemplateConfig);
fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig);
}
if (r > 0 && r <= addRowIndex && hasHandDatas.contains(c)) {
addManualConfig(cellTemplate, cell, now, cellTemplateConfigList);
}
} else {
//查询原来行cell是否有CellTemplate
CellTemplateExample cellTemplateExample = new CellTemplateExample();
cellTemplateExample.createCriteria().andReportTemplateIdEqualTo(template.getId()).andRowIndexEqualTo(r - addRowIndex).andColumnIndexEqualTo(c);
List<CellTemplate> cellTemplates = cellTemplateMapper.selectByExample(cellTemplateExample);
if (CollectionUtils.isNotEmpty(cellTemplates)) {
CellTemplate cellTemplate = cellTemplates.get(0);
PeriodCellTemplate periodCellTemplate = new PeriodCellTemplate();
CommonUtils.copyProperties(cellTemplate, periodCellTemplate);
periodCellTemplate.setId(distributedIdService.nextId());
periodCellTemplate.setPeriod(period);
periodCellTemplate.setReportTemplateId(template.getId());
periodCellTemplate.setRowIndex(r);
periodCellTemplate.setRowName(cellTemplate.getRowName());
periodCellTemplate.setColumnIndex(c);
periodCellTemplate.setColumnName(cellTemplate.getColumnName());
periodCellTemplate.setComment(cellTemplate.getComment());
periodCellTemplate.setCreateTime(cellTemplate.getCreateTime());
periodCellTemplate.setUpdateTime(cellTemplate.getUpdateTime());
periodCellTemplate.setCellTemplateId(cellTemplate.getId());
periodCellTemplate.setDataType(cellTemplate.getDataType());
periodCellTemplate.setIsReadOnly(cellTemplate.getIsReadOnly() ? 1 : 0);
periodCellTemplate.setCopyFromId(cellTemplate.getCopyFromId());
periodCellTemplate.setCreateBy(StringUtils.isBlank(cellTemplate.getCreateBy()) ? "admin" : cellTemplate.getCreateBy());
periodCellTemplate.setUpdateBy(StringUtils.isBlank(cellTemplate.getUpdateBy()) ? "admin" : cellTemplate.getUpdateBy());
periodCellTemplate.setProjectId(projectId);
cellTemplateList.add(periodCellTemplate);
CellTemplateConfigExample configExample = new CellTemplateConfigExample();
configExample.createCriteria().andCellTemplateIdEqualTo(cellTemplate.getId());
List<CellTemplateConfig> configs = cellTemplateConfigMapper.selectByExample(configExample);
if (CollectionUtils.isNotEmpty(configs)) {
for (CellTemplateConfig cellTemplateConfig : configs) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
CommonUtils.copyProperties(cellTemplateConfig, periodCellTemplateConfig);
periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period);
periodCellTemplateConfig.setCellTemplateId(cellTemplateConfig.getCellTemplateId());
periodCellTemplateConfig.setReportTemplateId(template.getId());
periodCellTemplateConfig.setDataSourceType(cellTemplateConfig.getDataSourceType());
periodCellTemplateConfig.setFormula(StringUtils.isBlank(cellTemplateConfig.getFormula()) ? null : cellTemplateConfig.getFormula());
periodCellTemplateConfig.setParsedFormula(null);
periodCellTemplateConfig.setFormulaDescription(cellTemplateConfig.getFormulaDescription());
periodCellTemplateConfig.setAccountCodes(cellTemplateConfig.getAccountCodes());
periodCellTemplateConfig.setInvoiceType(cellTemplateConfig.getInvoiceType());
periodCellTemplateConfig.setTaxRate(cellTemplateConfig.getTaxRate());
periodCellTemplateConfig.setInvoiceAmountType(cellTemplateConfig.getInvoiceAmountType());
periodCellTemplateConfig.setModelIds(cellTemplateConfig.getModelIds());
periodCellTemplateConfig.setCreateBy(StringUtils.isBlank(cellTemplateConfig.getCreateBy()) ? "admin" : cellTemplateConfig.getCreateBy());
periodCellTemplateConfig.setCreateTime(cellTemplateConfig.getCreateTime());
periodCellTemplateConfig.setUpdateBy(StringUtils.isBlank(cellTemplateConfig.getUpdateBy()) ? "admin" : cellTemplateConfig.getUpdateBy());
periodCellTemplateConfig.setUpdateTime(cellTemplateConfig.getUpdateTime());
periodCellTemplateConfig.setInvoiceCategory(cellTemplateConfig.getInvoiceCategory());
periodCellTemplateConfig.setFormulaDataSource(cellTemplateConfig.getFormulaDataSource());
periodCellTemplateConfig.setValidation(cellTemplateConfig.getValidation());
periodCellTemplateConfig.setParsedValidation(null);
periodCellTemplateConfig.setValidationDescription(cellTemplateConfig.getValidationDescription());
periodCellTemplateConfig.setVoucherKeyword(cellTemplateConfig.getVoucherKeyword());
periodCellTemplateConfig.setCellTemplateConfigId(cellTemplateConfig.getId());
periodCellTemplateConfig.setKeyValueParsedFormula(null);
periodCellTemplateConfig.setProjectId(projectId);
fixedParsedFormula(periodCellTemplateConfig);
fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig);
}
periodCellTemplateConfig.setUpdateTime(now);
periodCellTemplateConfig.setFormulaDataSource("报表数据");
periodCellTemplateConfig.setKeyValueParsedFormula(null);
periodCellTemplateConfig.setProjectId(projectId);
fixedParsedFormula(periodCellTemplateConfig);
fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig);
}
if (r > 0 && r <= addRowIndex && hasHandDatas.contains(c)) {
addManualConfig(cellTemplate, cell, now, cellTemplateConfigList);
}
}
} else {
assembleOriginalTemplateData(template,projectId,period,r,c,addRowIndex,cellTemplateList,cellTemplateConfigList);
}
}
}
......@@ -620,6 +556,77 @@ public class ReportServiceImpl extends BaseService {
}
}
public void assembleOriginalTemplateData(Template template, String projectId, Integer period,
Integer r, Integer c, Integer addRowIndex,
List<PeriodCellTemplate> cellTemplateList, List<PeriodCellTemplateConfig> cellTemplateConfigList) {
//查询原来行cell是否有CellTemplate
CellTemplateExample cellTemplateExample = new CellTemplateExample();
cellTemplateExample.createCriteria().andReportTemplateIdEqualTo(template.getId()).andRowIndexEqualTo(r - addRowIndex).andColumnIndexEqualTo(c);
List<CellTemplate> cellTemplates = cellTemplateMapper.selectByExample(cellTemplateExample);
if (CollectionUtils.isNotEmpty(cellTemplates)) {
CellTemplate cellTemplate = cellTemplates.get(0);
PeriodCellTemplate periodCellTemplate = new PeriodCellTemplate();
CommonUtils.copyProperties(cellTemplate, periodCellTemplate);
periodCellTemplate.setId(distributedIdService.nextId());
periodCellTemplate.setPeriod(period);
periodCellTemplate.setReportTemplateId(template.getId());
periodCellTemplate.setRowIndex(r);
periodCellTemplate.setRowName(cellTemplate.getRowName());
periodCellTemplate.setColumnIndex(c);
periodCellTemplate.setColumnName(cellTemplate.getColumnName());
periodCellTemplate.setComment(cellTemplate.getComment());
periodCellTemplate.setCreateTime(cellTemplate.getCreateTime());
periodCellTemplate.setUpdateTime(cellTemplate.getUpdateTime());
periodCellTemplate.setCellTemplateId(cellTemplate.getId());
periodCellTemplate.setDataType(cellTemplate.getDataType());
periodCellTemplate.setIsReadOnly(cellTemplate.getIsReadOnly() ? 1 : 0);
periodCellTemplate.setCopyFromId(cellTemplate.getCopyFromId());
periodCellTemplate.setCreateBy(StringUtils.isBlank(cellTemplate.getCreateBy()) ? "admin" : cellTemplate.getCreateBy());
periodCellTemplate.setUpdateBy(StringUtils.isBlank(cellTemplate.getUpdateBy()) ? "admin" : cellTemplate.getUpdateBy());
periodCellTemplate.setProjectId(projectId);
cellTemplateList.add(periodCellTemplate);
CellTemplateConfigExample configExample = new CellTemplateConfigExample();
configExample.createCriteria().andCellTemplateIdEqualTo(cellTemplate.getId());
List<CellTemplateConfig> configs = cellTemplateConfigMapper.selectByExample(configExample);
if (CollectionUtils.isNotEmpty(configs)) {
for (CellTemplateConfig cellTemplateConfig : configs) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
CommonUtils.copyProperties(cellTemplateConfig, periodCellTemplateConfig);
periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period);
periodCellTemplateConfig.setCellTemplateId(cellTemplateConfig.getCellTemplateId());
periodCellTemplateConfig.setReportTemplateId(template.getId());
periodCellTemplateConfig.setDataSourceType(cellTemplateConfig.getDataSourceType());
periodCellTemplateConfig.setFormula(StringUtils.isBlank(cellTemplateConfig.getFormula()) ? null : cellTemplateConfig.getFormula());
periodCellTemplateConfig.setParsedFormula(null);
periodCellTemplateConfig.setFormulaDescription(cellTemplateConfig.getFormulaDescription());
periodCellTemplateConfig.setAccountCodes(cellTemplateConfig.getAccountCodes());
periodCellTemplateConfig.setInvoiceType(cellTemplateConfig.getInvoiceType());
periodCellTemplateConfig.setTaxRate(cellTemplateConfig.getTaxRate());
periodCellTemplateConfig.setInvoiceAmountType(cellTemplateConfig.getInvoiceAmountType());
periodCellTemplateConfig.setModelIds(cellTemplateConfig.getModelIds());
periodCellTemplateConfig.setCreateBy(StringUtils.isBlank(cellTemplateConfig.getCreateBy()) ? "admin" : cellTemplateConfig.getCreateBy());
periodCellTemplateConfig.setCreateTime(cellTemplateConfig.getCreateTime());
periodCellTemplateConfig.setUpdateBy(StringUtils.isBlank(cellTemplateConfig.getUpdateBy()) ? "admin" : cellTemplateConfig.getUpdateBy());
periodCellTemplateConfig.setUpdateTime(cellTemplateConfig.getUpdateTime());
periodCellTemplateConfig.setInvoiceCategory(cellTemplateConfig.getInvoiceCategory());
periodCellTemplateConfig.setFormulaDataSource(cellTemplateConfig.getFormulaDataSource());
periodCellTemplateConfig.setValidation(cellTemplateConfig.getValidation());
periodCellTemplateConfig.setParsedValidation(null);
periodCellTemplateConfig.setValidationDescription(cellTemplateConfig.getValidationDescription());
periodCellTemplateConfig.setVoucherKeyword(cellTemplateConfig.getVoucherKeyword());
periodCellTemplateConfig.setCellTemplateConfigId(cellTemplateConfig.getId());
periodCellTemplateConfig.setKeyValueParsedFormula(null);
periodCellTemplateConfig.setProjectId(projectId);
fixedParsedFormula(periodCellTemplateConfig);
fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig);
}
}
}
}
private void addManualConfig(PeriodCellTemplate cellTemplate, Cell cell, Date now, List<PeriodCellTemplateConfig> list) {
PeriodCellTemplateConfig configManual = new PeriodCellTemplateConfig();
configManual.setId(distributedIdService.nextId());
......@@ -989,7 +996,7 @@ public class ReportServiceImpl extends BaseService {
Workbook workbook = reportGenerator.createWorkBookByPeriodTemplate(resources.getPeriodTemplates(), genJob);
reportGenerator.addFunctionsAndContext(workbook, functions, reportGenerator.initContext(resources, periodParam),false);
reportGenerator.addFunctionsAndContext(workbook, functions, reportGenerator.initContext(resources, periodParam), false);
reportGenerator.setConfigAndDataToWorkBook(workbook, resources);
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
......@@ -1031,7 +1038,7 @@ public class ReportServiceImpl extends BaseService {
periodCellTemplateConfigDtos.forEach(a -> {
workbook4Validate.getSheetAt(a.getSheetNumber() - 1).getRow(a.getRowNumber()).getCell(a.getColNumber()).setCellFormula(a.getParsedValidation());
});
reportGenerator.addFunctionsAndContext(workbook4Validate, functions, reportGenerator.initContext(resources, periodParam),true);
reportGenerator.addFunctionsAndContext(workbook4Validate, functions, reportGenerator.initContext(resources, periodParam), true);
FormulaEvaluator validateEvaluator = workbook4Validate.getCreationHelper().createFormulaEvaluator();
validateEvaluator.evaluateAll();
//todo: 4.then save the validation result to cellData table
......@@ -2241,7 +2248,7 @@ public class ReportServiceImpl extends BaseService {
pwcReportAttach.setRemarks(remarks);
pwcReportAttachMapper.insert(pwcReportAttach);
System.out.println("==>>>附件绑定成功");
return pwcReportAttach;
return pwcReportAttach;
}
public List<PwcReportAttach> loadAttachList(ReportAttachDto param) {
......@@ -2389,7 +2396,7 @@ public class ReportServiceImpl extends BaseService {
*
* @param requestParameterDto
*/
public void manyExport(RequestParameterDto requestParameterDto, String zipFileName, HttpServletRequest request, HttpServletResponse response, String zipPath) throws Exception {
public void manyExport(RequestParameterDto requestParameterDto, String zipFileName, HttpServletRequest request, HttpServletResponse response, String zipPath) throws Exception {
try {
FileOutputStream out = new FileOutputStream(zipFileName);//要输出的文件名字
} catch (FileNotFoundException e) {
......@@ -2425,8 +2432,8 @@ public class ReportServiceImpl extends BaseService {
}
dataList.add(orgTypeList);
}
if(dataList.size() == 0){
throw new Exception("没有可导出的数据");
if (dataList.size() == 0) {
throw new Exception("没有可导出的数据");
}
if (template.getIsSystemType()) {
try {
......
......@@ -52,19 +52,19 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
private double assembleData(String revenueTypeName, List<OutputInvoiceDataSourceDto> contain, Integer billType, Integer amountType, OperationEvaluationContext ec) {
String queryDate = formulaContext.getYear() + (formulaContext.getPeriod() < 10 ? ("0" + formulaContext.getPeriod()) : (formulaContext.getPeriod() + ""));
RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
typeMappingExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId())
.andRevenueTypeNameEqualTo(revenueTypeName).andStartDateLessThanOrEqualTo(queryDate)
.andEndDateGreaterThanOrEqualTo(queryDate);
List<RevenueTypeMapping> typeMappingList = SpringContextUtil.revenueTypeMappingMapper.selectByExample(typeMappingExample);
if (CollectionUtils.isEmpty(typeMappingList)) {
return 0.0;
}
List<String> revenueTypes = typeMappingList.stream()
.map(o -> o.getRevenueTypeName()).collect(Collectors.toList());
// RevenueTypeMappingExample typeMappingExample = new RevenueTypeMappingExample();
// typeMappingExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId())
// .andRevenueTypeNameEqualTo(revenueTypeName).andStartDateLessThanOrEqualTo(queryDate)
// .andEndDateGreaterThanOrEqualTo(queryDate);
// List<RevenueTypeMapping> typeMappingList = SpringContextUtil.revenueTypeMappingMapper.selectByExample(typeMappingExample);
// if (CollectionUtils.isEmpty(typeMappingList)) {
// return 0.0;
// }
// List<String> revenueTypes = typeMappingList.stream()
// .map(o -> o.getRevenueTypeName()).collect(Collectors.toList());
RevenueConfigExample configExample = new RevenueConfigExample();
configExample.createCriteria().andOrgIdEqualTo(formulaContext.getOrganizationId()).andStartDateLessThanOrEqualTo(queryDate)
.andEndDateGreaterThanOrEqualTo(queryDate).andNameIn(revenueTypes);
.andEndDateGreaterThanOrEqualTo(queryDate).andNameEqualTo(revenueTypeName);
List<RevenueConfig> configDatas = SpringContextUtil.revenueConfigMapper.selectByExample(configExample);
if (CollectionUtils.isEmpty(configDatas)) {
return 0.0;
......
......@@ -1916,72 +1916,72 @@ public class TaxDocumentExample {
}
public Criteria andEnableIsNull() {
addCriterion("enable is null");
addCriterion("`enable` is null");
return (Criteria) this;
}
public Criteria andEnableIsNotNull() {
addCriterion("enable is not null");
addCriterion("`enable` is not null");
return (Criteria) this;
}
public Criteria andEnableEqualTo(String value) {
addCriterion("enable =", value, "enable");
addCriterion("`enable` =", value, "enable");
return (Criteria) this;
}
public Criteria andEnableNotEqualTo(String value) {
addCriterion("enable <>", value, "enable");
addCriterion("`enable` <>", value, "enable");
return (Criteria) this;
}
public Criteria andEnableGreaterThan(String value) {
addCriterion("enable >", value, "enable");
addCriterion("`enable` >", value, "enable");
return (Criteria) this;
}
public Criteria andEnableGreaterThanOrEqualTo(String value) {
addCriterion("enable >=", value, "enable");
addCriterion("`enable` >=", value, "enable");
return (Criteria) this;
}
public Criteria andEnableLessThan(String value) {
addCriterion("enable <", value, "enable");
addCriterion("`enable` <", value, "enable");
return (Criteria) this;
}
public Criteria andEnableLessThanOrEqualTo(String value) {
addCriterion("enable <=", value, "enable");
addCriterion("`enable` <=", value, "enable");
return (Criteria) this;
}
public Criteria andEnableLike(String value) {
addCriterion("enable like", value, "enable");
addCriterion("`enable` like", value, "enable");
return (Criteria) this;
}
public Criteria andEnableNotLike(String value) {
addCriterion("enable not like", value, "enable");
addCriterion("`enable` not like", value, "enable");
return (Criteria) this;
}
public Criteria andEnableIn(List<String> values) {
addCriterion("enable in", values, "enable");
addCriterion("`enable` in", values, "enable");
return (Criteria) this;
}
public Criteria andEnableNotIn(List<String> values) {
addCriterion("enable not in", values, "enable");
addCriterion("`enable` not in", values, "enable");
return (Criteria) this;
}
public Criteria andEnableBetween(String value1, String value2) {
addCriterion("enable between", value1, value2, "enable");
addCriterion("`enable` between", value1, value2, "enable");
return (Criteria) this;
}
public Criteria andEnableNotBetween(String value1, String value2) {
addCriterion("enable not between", value1, value2, "enable");
addCriterion("`enable` not between", value1, value2, "enable");
return (Criteria) this;
}
......
......@@ -129,4 +129,6 @@ public interface InvoiceRecordMapper extends MyVatMapper {
List<String> queryBillTypeGroupBy(@Param("projectId") String projectId,
@Param("period") Integer period);
int clearRevenueCof(@Param("clearRevenue") boolean clearRevenue, @Param("clearModifyRevenue") boolean clearModifyRevenue,@Param("example") InvoiceRecordExample example);
}
\ No newline at end of file
......@@ -2,235 +2,240 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.InvoiceRecordMapper">
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(irCondition.orgId)">
AND organization_id= #{irCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="irCondition.periodStart!=null">
AND tms_period &gt;= #{irCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="irCondition.periodEnd!=null">
AND tms_period &lt;= #{irCondition.periodEnd,jdbcType=INTEGER}
</if>
</sql>
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(irCondition.orgId)">
AND organization_id= #{irCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="irCondition.periodStart!=null">
AND tms_period &gt;= #{irCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="irCondition.periodEnd!=null">
AND tms_period &lt;= #{irCondition.periodEnd,jdbcType=INTEGER}
</if>
</sql>
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from invoice_record
where
<include refid="QueryCondition"/>
</select>
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from invoice_record
where
<include refid="QueryCondition"/>
</select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition" resultType="Integer">
select
count(*)
from invoice_record
where
<include refid="QueryCondition"/>
</select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.InvoiceRecordCondition"
resultType="Integer">
select
count(*)
from invoice_record
where
<include refid="QueryCondition"/>
</select>
<insert id="insertBatch" parameterType="java.util.List">
insert into invoice_record
(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=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.tmsPeriod != null">#{item.tmsPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.seqNo != null">#{item.seqNo,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.billingBody != null">#{item.billingBody,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.customerCompanyName != null">#{item.customerCompanyName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceType != null">#{item.invoiceType,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.billingContent != null">#{item.billingContent,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceAmount != null">#{item.invoiceAmount,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.applicant != null">#{item.applicant,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.oaApplicationNum != null">#{item.oaApplicationNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractNo != null">#{item.contractNo,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractAmount != null">#{item.contractAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.department != null">#{item.department,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.applicationDate != null">#{item.applicationDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.billingDate != null">#{item.billingDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.billingMonth != null">#{item.billingMonth,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.invoiceCode != null">#{item.invoiceCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceNum != null">#{item.invoiceNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoicesAmount != null">#{item.invoicesAmount,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractSourceSystem != null">#{item.contractSourceSystem,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.taxRate != null">#{item.taxRate,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.taxAmount != null">#{item.taxAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.invoiceStatus != null">#{item.invoiceStatus,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.remarks != null">#{item.remarks,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
<insert id="insertBatch" parameterType="java.util.List">
insert into invoice_record
(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=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.tmsPeriod != null">#{item.tmsPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.seqNo != null">#{item.seqNo,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.billingBody != null">#{item.billingBody,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.customerCompanyName != null">#{item.customerCompanyName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceType != null">#{item.invoiceType,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.billingContent != null">#{item.billingContent,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceAmount != null">#{item.invoiceAmount,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.applicant != null">#{item.applicant,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.oaApplicationNum != null">#{item.oaApplicationNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractNo != null">#{item.contractNo,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractAmount != null">#{item.contractAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.department != null">#{item.department,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.applicationDate != null">#{item.applicationDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.billingDate != null">#{item.billingDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.billingMonth != null">#{item.billingMonth,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.invoiceCode != null">#{item.invoiceCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceNum != null">#{item.invoiceNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoicesAmount != null">#{item.invoicesAmount,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.customerCompanyTaxNum != null">#{item.customerCompanyTaxNum,jdbcType=VARCHAR},
</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.contractSourceSystem != null">#{item.contractSourceSystem,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.taxRate != null">#{item.taxRate,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.taxAmount != null">#{item.taxAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.invoiceStatus != null">#{item.invoiceStatus,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.remarks != null">#{item.remarks,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>
;
SELECT 1 FROM DUAL;
</insert>
<select id="queryBillWithRevenueConf" resultType="pwc.taxtech.atms.dpo.BillDetailDto">
select detail.*
from (select bd.id as id,
bd.billing_body as subject,
bd.customer_company_name as customer,
bd.invoice_type as billType,
bd.billing_content as billContent,
bd.invoice_amount as billAmount,
bd.tax_rate as billTaxRat,
bd.tax_amount as billTaxAmount,
bd.oa_application_num as OANo,
bd.department as department,
bd.billing_date as billDate,
bd.invoice_code as billCode,
bd.invoice_num as billNumber,
modfiy_rc.id as modifyRevenueCofId,
modfiy_rc.name as modifyRevenueCofName,
rc.id as revenueCofId,
rc.name as revenueConfName,
case
when rc.id is null then 1
<![CDATA[WHEN rc.id IS NOT NULL and (rc.start_date > #{queryDate} or rc.end_date < #{queryDate}) then 1]]>
<![CDATA[WHEN rc.id IS NOT NULL and rc.start_date <= #{queryDate} and rc.end_date >= #{queryDate} THEN 2]]>
end as emptyCode
from invoice_record as bd
left join revenue_config as rc on rc.org_id = bd.organization_id and rc.id = bd.revenue_cof_id
left join revenue_config as modfiy_rc on modfiy_rc.id = bd.modify_revenue_cof_id
where bd.project_id = #{projectId}
and bd.period = #{period}
<if test="billType != null and billType != ''">
and bd.invoice_type = #{billType}
</if>
<if test="customer != null and customer != ''">
and bd.customer_company_name like concat('%',#{customer},'%')
</if>
<if test="billNumber != null and billNumber != ''">
and bd.invoice_num like concat('%',#{billNumber},'%')
</if>
<if test="revenueCofId != null">
and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id = #{revenueCofId})
</if>
<if test="billContent != null and billContent != ''">
and bd.billing_content like concat('%',#{billContent},'%')
</if>
<if test="department != null and department != ''">
and bd.department like concat('%',#{department},'%')
</if>
<if test="billTaxRat != null">
and bd.tax_rate = #{billTaxRat}
</if>
<if test="billDate != null and billDate != ''">
and bd.billing_date = #{billDate}
</if>
) as detail
order by detail.emptyCode,detail.billDate desc
<select id="queryBillWithRevenueConf" resultType="pwc.taxtech.atms.dpo.BillDetailDto">
select detail.*
from (select bd.id as id,
bd.billing_body as subject,
bd.customer_company_name as customer,
bd.invoice_type as billType,
bd.billing_content as billContent,
bd.invoice_amount as billAmount,
bd.tax_rate as billTaxRat,
bd.tax_amount as billTaxAmount,
bd.oa_application_num as OANo,
bd.department as department,
bd.billing_date as billDate,
bd.invoice_code as billCode,
bd.invoice_num as billNumber,
modfiy_rc.id as modifyRevenueCofId,
modfiy_rc.name as modifyRevenueCofName,
rc.id as revenueCofId,
rc.name as revenueConfName,
case
when rc.id is null then 1
<![CDATA[WHEN rc.id IS NOT NULL and (rc.start_date > #{queryDate} or rc.end_date < #{queryDate}) then 1]]>
<![CDATA[WHEN rc.id IS NOT NULL and rc.start_date <= #{queryDate} and rc.end_date >= #{queryDate} THEN 2]]>
end as emptyCode
from invoice_record as bd
left join revenue_config as rc on rc.org_id = bd.organization_id and rc.id = bd.revenue_cof_id
left join revenue_config as modfiy_rc on modfiy_rc.id = bd.modify_revenue_cof_id
where bd.project_id = #{projectId}
and bd.period = #{period}
<if test="billType != null and billType != ''">
and bd.invoice_type = #{billType}
</if>
<if test="customer != null and customer != ''">
and bd.customer_company_name like concat('%',#{customer},'%')
</if>
<if test="billNumber != null and billNumber != ''">
and bd.invoice_num like concat('%',#{billNumber},'%')
</if>
<if test="revenueCofId != null">
and if(bd.modify_revenue_cof_id is null,bd.revenue_cof_id = #{revenueCofId},bd.modify_revenue_cof_id =
#{revenueCofId})
</if>
<if test="billContent != null and billContent != ''">
and bd.billing_content like concat('%',#{billContent},'%')
</if>
<if test="department != null and department != ''">
and bd.department like concat('%',#{department},'%')
</if>
<if test="billTaxRat != null">
and bd.tax_rate = #{billTaxRat}
</if>
<if test="billDate != null and billDate != ''">
and bd.billing_date = #{billDate}
</if>
) as detail
order by detail.emptyCode,detail.billDate desc
</select>
</select>
<select id="queryBillTypeGroupBy" resultType="java.lang.String">
<select id="queryBillTypeGroupBy" resultType="java.lang.String">
select invoice_type
from invoice_record
where project_id = #{projectId}
......@@ -238,4 +243,18 @@
group by invoice_type;
</select>
<update id="clearRevenueCof">
update invoice_record
<set>
<if test="clearRevenue">
revenue_cof_id = null,
</if>
<if test="clearModifyRevenue">
modify_revenue_cof_id = null,
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
</mapper>
\ No newline at end of file
package pwc.taxtech.atms.orangeheap.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/OrangeHeap/tableau")
public class OrangeHeapController {
}
package pwc.taxtech.atms.orangeheap.service;
public class OrangeHeapService {
}
......@@ -813,6 +813,7 @@
"dateFormat4YearMonthDayCh": "yyyy-mm-dd",
"RecordSize": "Record Size",
"ExtractFile": "Extract File",
"ExtractTaskId": "任务ID",
"TaxPayerIdNum": "纳税人识别号",
"ExtractDistribution": "Extract Distribution",
......
......@@ -857,6 +857,7 @@
"RecordSize": "记录条数",
"ExtractFile": "抽取类型",
"ExtractTaskId": "任务ID",
"TaxPayerIdNum": "纳税人识别号",
"ExtractDistribution": "抽取分发",
"Log":"日志",
......
......@@ -236,6 +236,7 @@
"MessagePushObject": "消息推送对象",
"WorkFlowCode": "流程编号",
"CreatedTime": "创建时间",
"UpdateTime": "更新时间",
"HighPriority": "高级",
"MediumPriority": "中级",
"LowPriority": "低级",
......
......@@ -52,7 +52,7 @@
"DefaultTaxTypeAndReport": "默认纳税类型及报表:",
"DeleteKeyValueConfiguration": "删除关键数据",
"Description": "描述:",
"DescriptionWithOutColon": "描述",
"DescriptionWithOutColon": "说明",
"DirectionDifferent": "借贷方向不一致",
"EnterpriceAccountMapping": "自动对应",
"EtsSubjectNameCol": "对应企业科目",
......
......@@ -136,9 +136,8 @@
showBorders: true,
columns: [{
dataField: "id",
visible: false,
allowHeaderFiltering: false,
caption: $translate.instant('id')
caption: $translate.instant('ExtractTaskId')
}, {
dataField: "taxpayerIdNum",
width: '15%',
......@@ -195,7 +194,10 @@
dataField: "operateTime",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('LogOperationTime')
caption: $translate.instant('LogOperationTime'),
calculateCellValue: function(data) {
return new Date(data).formatDateTime('yyyy-MM-dd hh:mm:ss');
}
}
],
onContentReady: function (e) {
......
......@@ -25,8 +25,8 @@ taxDocumentManageModule.controller('taxDocumentListController',
var params = angular.copy($scope.queryFieldModel);
params.fileBeginTime = getQueryDate(params.fileBeginTime,"-");
params.fileEndTTime = getQueryDate(params.fileEndTTime,"-");
params.ownBeginTime = getQueryDate(params.ownBeginTime,"-");
params.ownEndTime = getQueryDate(params.ownEndTime,"-");
// params.ownBeginTime = getQueryDate(params.ownBeginTime,"-");
// params.ownEndTime = getQueryDate(params.ownEndTime,"-");
params.effectiveBeginTime = getQueryDate(params.effectiveBeginTime,"-");
params.effectiveEndTime = getQueryDate(params.effectiveEndTime,"-");
params.uploadBeginTime = getQueryDate(params.uploadBeginTime,"-");
......@@ -60,6 +60,17 @@ taxDocumentManageModule.controller('taxDocumentListController',
dataSource: 'localData',
},
showBorders: true,
paging: {
enable: true,
pageIndex: 1,
pageSize: 100
},
pager: {
showInfo: false,
showNavigationButtons: false,
showPageSizeSelector: false,
visible: false,
},
sorting: {//排序
ascendingText: "Sort Ascending",
clearText: "Clear Sorting",
......@@ -267,15 +278,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
};
$scope.getTableHeight=function(){
var row_height=$("table").find("tr").height();
if(row_height && $scope.pagingOptions.pageSize==20){
if(row_height){
return {
height:(row_height*12)+"px"
}
}else if(row_height && ($scope.pagingOptions.pageSize==50||$scope.pagingOptions.pageSize==100)){
return {
height:(row_height*12+55)+"px"
}
}else{
}
};
};
......@@ -439,51 +445,65 @@ taxDocumentManageModule.controller('taxDocumentListController',
};
var editDocFileRecord = function (fieldModel, type) {
var params = angular.copy(fieldModel);
// params.ownTime = params.ownTime ? params.ownTime : "";
// var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/";
// params.ownTime = parseInt(params.ownTime.split(splitMark).join(""));
Object.keys(params).forEach(function(key){
if(params[key] === undefined || params[key] === null) params[key] = "";
});
params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.effectiveTime ? params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/") : delete params.effectiveTime;
params.fileTime ? params.fileTime = $scope.getQueryDate(params.fileTime, "/") : delete params.fileTime;
params.createTime ? params.createTime = $scope.getQueryDate(params.createTime, "/") : delete params.createTime;
params.updateTime ? params.updateTime = $scope.getQueryDate(params.updateTime, "/") : delete params.updateTime;
params.uploadTime ? params.uploadTime = $scope.getQueryDate(params.uploadTime, "/") : delete params.uploadTime;
params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
params.auditStatus = $scope.transformAuditStatusToServer(params.auditStatus);
taxDocumentListService.editRecord(params).then(function (data) {
if (data == true) {
if (type == 'simple') {
SweetAlert.swal({
title: $translate.instant("Edited"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
} else {
if ($scope.multiUploadSuccessItems.length == 0) {
SweetAlert.swal({
title: $translate.instant("Uploaded"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
}
SweetAlert.swal({
title: '提示',
text: $translate.instant("CoverConfirm"),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
var params = angular.copy(fieldModel);
// params.ownTime = params.ownTime ? params.ownTime : "";
// var splitMark = params.ownTime.indexOf("-") > -1 ? "-" : "/";
// params.ownTime = parseInt(params.ownTime.split(splitMark).join(""));
Object.keys(params).forEach(function(key){
if(params[key] === undefined || params[key] === null) params[key] = "";
});
params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.effectiveTime ? params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/") : delete params.effectiveTime;
params.fileTime ? params.fileTime = $scope.getQueryDate(params.fileTime, "/") : delete params.fileTime;
params.createTime ? params.createTime = $scope.getQueryDate(params.createTime, "/") : delete params.createTime;
params.updateTime ? params.updateTime = $scope.getQueryDate(params.updateTime, "/") : delete params.updateTime;
params.uploadTime ? params.uploadTime = $scope.getQueryDate(params.uploadTime, "/") : delete params.uploadTime;
params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
params.auditStatus = $scope.transformAuditStatusToServer(params.auditStatus);
taxDocumentListService.editRecord(params).then(function (data) {
if (data == true) {
if (type == 'simple') {
SweetAlert.swal({
title: $translate.instant("Edited"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
} else {
if ($scope.multiUploadSuccessItems.length == 0) {
SweetAlert.swal({
title: $translate.instant("Uploaded"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
}
}
} else {
SweetAlert.warning($translate.instant('SaveFail'));
}
});
}
} else {
SweetAlert.warning($translate.instant('SaveFail'));
}
});
});
$('#simpleUploadPopDialog').modal('hide');
$('#multiUploadPopDialog').modal('hide');
};
......@@ -508,38 +528,39 @@ taxDocumentManageModule.controller('taxDocumentListController',
}
});
if(delIDs.length ==0){
return;
SweetAlert.warning($translate.instant("NeedChecked"));
}else{
SweetAlert.swal({
title: '提示',
text: $translate.instant("DeleteConfirm"),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
taxDocumentListService.delFileRecordItems({
"ids":delIDs
}).then(function (data) {
if (data) {
SweetAlert.swal({
title: $translate.instant("Deleted"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
}
});
}
})
}
SweetAlert.swal({
title: '提示',
text: $translate.instant("DeleteConfirm"),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
taxDocumentListService.delFileRecordItems({
"ids":delIDs
}).then(function (data) {
if (data) {
SweetAlert.swal({
title: $translate.instant("Deleted"),
type: "success",
confirmButtonText: $translate.instant('Confirm'),
closeOnConfirm: true
},
function (isConfirm) {
if (isConfirm) $scope.loadMainData();
});
}
});
}
})
};
(function initialize() {
......@@ -709,6 +730,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploadErrorItems = [];
$scope.multiUploadSuccessItems = [];
$scope.multiUploader = {};
$scope.FileItem={isSuccess:false};
$scope.abandonFileCache = [];
$scope.uploadResultSuccessList = [];
$scope.activeTab = function (activeIndex) {
......@@ -881,6 +903,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
//data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
if (data.id===null|| data.id===undefined) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
_multiUploader.uploadItem(_i);
} else {
//覆盖行为-需上传参数
for (var name in data) {
......@@ -894,11 +917,27 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
}
var cover_fields={};
cover_fields[name] = data[name];
fileItem.formData.push(cover_fields);
_fileItem.formData.push(cover_fields);
}
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
var Cover_Confirm="'"+data.fileName+"' 记录已经存在,是否进行覆盖?";
SweetAlert.swal({
title: '提示',
text: $translate.instant(Cover_Confirm),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
_multiUploader.uploadItem(_i);
}
})
}
_multiUploader.uploadItem(_i);
});
})(i, fileItem, editFieldModel, taxDocumentListService, $scope.multiUploader);
......@@ -913,7 +952,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
if($scope.multiUploadErrorItems.length
|| $scope.uploadResultSuccessList.length)
$("#uploadResultPop").modal("show");
$scope.FileItem.isSuccess=true;//文件上传成功标识
$('#busy-indicator-container').hide();
$scope.loadMainData();
......@@ -930,7 +969,11 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
$scope.multiUploadErrorItems[0].iShow = true;
}
$('#uploadResultPop').modal('hide');
$("#multiUploadPopDialog").modal("show");
if($scope.FileItem.isSuccess==false){
$("#multiUploadPopDialog").modal("show");
}else{
$scope.FileItem.isSuccess=false;
}
};
$scope.closeUploadReview = function () {
......@@ -1056,6 +1099,7 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
//data.id===null|| data.id===undefined,代表可以直接上传,否则属于覆盖行为
if (data.id===null|| data.id===undefined) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/add";
_multiUploader.uploadItem(_i);
} else {
//覆盖行为-需上传参数
for (var name in data) {
......@@ -1069,11 +1113,29 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
}
var cover_fields={};
cover_fields[name] = data[name];
fileItem.formData.push(cover_fields);
_fileItem.formData.push(cover_fields);
}
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
var Cover_Confirm="'"+data.fileName+"' 记录已经存在,是否进行覆盖?";
SweetAlert.swal({
title: '提示',
text: $translate.instant(Cover_Confirm),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Confirm'),
cancelButtonText: $translate.instant('Cancel'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
_fileItem.url = apiInterceptor.webApiHostUrl + "/taxDoc/edit";
_multiUploader.uploadItem(_i);
}
})
}
_multiUploader.uploadItem(_i);
});
})(i, fileItem, editFieldModel, taxDocumentListService, $scope.multiUploader);
......
......@@ -418,12 +418,12 @@
<!--ng-model="queryFieldModel.Duration"/>-->
<input type='text' placeholder="From"
date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.ownBeginTime"
data-min-view-mode="0"/>
data-date-format="yyyymm" ng-model="queryFieldModel.ownBeginTime"
data-min-view-mode="1"/>
<input type='text' placeholder="To"
date-time-picker class="form-control TDL-query-val-multi"
data-date-format="yyyy/mm/dd" ng-model="queryFieldModel.ownEndTime"
data-min-view-mode="0"/>
data-date-format="yyyymm" ng-model="queryFieldModel.ownEndTime"
data-min-view-mode="1"/>
<!--<input type="text" class="form-control radius3" id="period-picker2"/>-->
</div>
......@@ -1407,8 +1407,8 @@
<span>{{item.fileName}}</span>
</li>
</ul>
<p ng-if="multiUploadErrorItems.length">{{multiUploadErrorItems.length}}{{'UploadFailCount'|translate}}</p>
<ul>
<p class="text-danger" ng-if="multiUploadErrorItems.length">{{multiUploadErrorItems.length}}{{'UploadFailCount'|translate}}</p>
<ul class="text-danger">
<li ng-repeat="item in multiUploadErrorItems">
<span>{{item.fileName}}</span>
</li>
......
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