Commit cad34ca0 authored by chase's avatar chase

fix bug

parent dcfe14a3
...@@ -13,6 +13,7 @@ public enum EnumInvoiceType { ...@@ -13,6 +13,7 @@ public enum EnumInvoiceType {
private int code; private int code;
private String name; private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>(); public static final Map<Integer, String> MAPPING = new HashMap<>();
public static final Map<String, Integer> NAME_MAPPING = new HashMap<>();
EnumInvoiceType(int code, String name) { EnumInvoiceType(int code, String name) {
this.code = code; this.code = code;
this.name = name; this.name = name;
...@@ -29,6 +30,7 @@ public enum EnumInvoiceType { ...@@ -29,6 +30,7 @@ public enum EnumInvoiceType {
static { static {
for (EnumInvoiceType invoiceType : EnumInvoiceType.values()) { for (EnumInvoiceType invoiceType : EnumInvoiceType.values()) {
MAPPING.put(invoiceType.getCode(), invoiceType.getName()); MAPPING.put(invoiceType.getCode(), invoiceType.getName());
NAME_MAPPING.put(invoiceType.getName(), invoiceType.getCode());
} }
} }
} }
package pwc.taxtech.atms.dto.vatdto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
public class FormulaFormlaBlockDto extends PeriodFormulaBlock {
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
@JsonSerialize(using = PwCIdSerialize.class)
private Long reportId;
@JsonSerialize(using = PwCIdSerialize.class)
private Long cellTemplateId;
@JsonSerialize(using = PwCIdSerialize.class)
private Long dataSourceId;
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
@Override
public Long getReportId() {
return reportId;
}
@Override
public void setReportId(Long reportId) {
this.reportId = reportId;
}
@Override
public Long getCellTemplateId() {
return cellTemplateId;
}
@Override
public void setCellTemplateId(Long cellTemplateId) {
this.cellTemplateId = cellTemplateId;
}
@Override
public Long getDataSourceId() {
return dataSourceId;
}
@Override
public void setDataSourceId(Long dataSourceId) {
this.dataSourceId = dataSourceId;
}
}
package pwc.taxtech.atms.dto.vatdto; package pwc.taxtech.atms.dto.vatdto;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import java.util.List; import java.util.List;
public class ReportDataDto { public class ReportDataDto {
private List<CellDataDto> cellData; private List<CellDataDto> cellData;
private List<PeriodFormulaBlock> formulaBlocks; private List<FormulaFormlaBlockDto> formulaBlocks;
private List<DataSourceDtoExtend> manualDataSources; private List<DataSourceDtoExtend> manualDataSources;
private EbitDataDto ebitData; private EbitDataDto ebitData;
...@@ -26,11 +24,11 @@ public class ReportDataDto { ...@@ -26,11 +24,11 @@ public class ReportDataDto {
this.cellData = cellData; this.cellData = cellData;
} }
public List<PeriodFormulaBlock> getFormulaBlocks() { public List<FormulaFormlaBlockDto> getFormulaBlocks() {
return this.formulaBlocks; return this.formulaBlocks;
} }
public void setFormulaBlocks(List<PeriodFormulaBlock> formulaBlocks) { public void setFormulaBlocks(List<FormulaFormlaBlockDto> formulaBlocks) {
this.formulaBlocks = formulaBlocks; this.formulaBlocks = formulaBlocks;
} }
......
...@@ -883,7 +883,8 @@ public class CitReportServiceImpl extends BaseService { ...@@ -883,7 +883,8 @@ public class CitReportServiceImpl extends BaseService {
*/ */
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample); List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks); dataDto.setFormulaBlocks(formulaBlocks.stream()
.map(o -> beanUtil.copyProperties(o, new FormulaFormlaBlockDto())).collect(Collectors.toList()));
//todo: 关键字数据源稍后再加 //todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源 // 获取通过KeyValueDataId关联的数据源,即公式数据源
......
...@@ -116,11 +116,10 @@ public class ReportFileUploadService extends BaseService { ...@@ -116,11 +116,10 @@ public class ReportFileUploadService extends BaseService {
data.setCreator(user.getUserName()); data.setCreator(user.getUserName());
data.setUid(CommonUtils.getUUID()); data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date()); data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename()); if(StringUtils.isBlank(data.getReportFileName())){
if (StringUtils.isBlank(data.getFileUploadId())) { data.setReportFileName(file.getOriginalFilename());
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
} }
if (StringUtils.isBlank(data.getProjectId()) && StringUtils.isNotBlank(data.getOrgId()) && data.getPeriod() != null) { if (StringUtils.isBlank(data.getProjectId()) && StringUtils.isNotBlank(data.getOrgId()) && data.getPeriod() != null) {
ProjectExample projectExample = new ProjectExample(); ProjectExample projectExample = new ProjectExample();
String year = String.valueOf(data.getPeriod()).substring(0,4); String year = String.valueOf(data.getPeriod()).substring(0,4);
...@@ -131,7 +130,10 @@ public class ReportFileUploadService extends BaseService { ...@@ -131,7 +130,10 @@ public class ReportFileUploadService extends BaseService {
}else{ }else{
return; return;
} }
if (StringUtils.isBlank(data.getFileUploadId())) {
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
}
}else { }else {
Project project = projectMapper.selectByPrimaryKey(data.getProjectId()); Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId()); data.setOrgId(project.getOrganizationId());
...@@ -143,7 +145,7 @@ public class ReportFileUploadService extends BaseService { ...@@ -143,7 +145,7 @@ public class ReportFileUploadService extends BaseService {
taxDocument.setEnable("T"); taxDocument.setEnable("T");
taxDocument.setOwnTime(data.getPeriod()); taxDocument.setOwnTime(data.getPeriod());
taxDocument.setFileType(data.getReportType()); taxDocument.setFileType(data.getReportType());
taxDocument.setFileName(data.getReportFileName());
FileTypesExample example = new FileTypesExample(); FileTypesExample example = new FileTypesExample();
example.createCriteria().andFileTypeEqualTo(data.getReportType()); example.createCriteria().andFileTypeEqualTo(data.getReportType());
List<FileTypes> dataList = fileTypesMapper.selectByExample(example); List<FileTypes> dataList = fileTypesMapper.selectByExample(example);
...@@ -151,6 +153,15 @@ public class ReportFileUploadService extends BaseService { ...@@ -151,6 +153,15 @@ public class ReportFileUploadService extends BaseService {
taxDocument.setFileAttr(dataList.get(0).getFileAttr()); taxDocument.setFileAttr(dataList.get(0).getFileAttr());
taxDocument.setFileTypeId(dataList.get(0).getId()); taxDocument.setFileTypeId(dataList.get(0).getId());
} }
//重新命名
String fileName = taxDocument.getCompanyName()+"_"+taxDocument.getFileType()+"_"+taxDocument.getOwnTime();
fileName+=file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
if (StringUtils.isBlank(data.getFileUploadId())) {
FileUpload fileUpload = didiFileUploadService.uploadFile(file, fileName, FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
data.setReportFileName(fileName);
}
taxDocument.setFileName(fileName);
taxDocumentService.addTaxDocumentList(file,taxDocument); taxDocumentService.addTaxDocumentList(file,taxDocument);
} }
ReportFileUploadExample example = new ReportFileUploadExample(); ReportFileUploadExample example = new ReportFileUploadExample();
......
...@@ -169,10 +169,15 @@ public class TaxDocumentServiceImpl { ...@@ -169,10 +169,15 @@ public class TaxDocumentServiceImpl {
try { try {
//上传文件 //上传文件
if(StringUtils.isBlank(taxDocument.getFileUploadId())){ if(StringUtils.isBlank(taxDocument.getFileUploadId())){
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
if(ReportFileUploadEnum.ReportType.MAPPING.containsKey(taxDocument.getFileType())){ if(ReportFileUploadEnum.ReportType.MAPPING.containsKey(taxDocument.getFileType())){
//重新命名
String fileName = taxDocument.getCompanyName()+"_"+taxDocument.getFileType()+"_"+taxDocument.getOwnTime();
fileName+=file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
FileUpload fileUpload = didiFileUploadService.uploadFile(file,fileName, FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
taxDocument.setFileName(fileName);
ReportFileUpload reportFileUpload = new ReportFileUpload(); ReportFileUpload reportFileUpload = new ReportFileUpload();
reportFileUpload.setOrgId(taxDocument.getCompanyId()); reportFileUpload.setOrgId(taxDocument.getCompanyId());
reportFileUpload.setSourceType(ReportFileUploadEnum.SuorceType.RECORD.name()); reportFileUpload.setSourceType(ReportFileUploadEnum.SuorceType.RECORD.name());
...@@ -180,7 +185,12 @@ public class TaxDocumentServiceImpl { ...@@ -180,7 +185,12 @@ public class TaxDocumentServiceImpl {
reportFileUpload.setPeriod(Integer.valueOf(period)); reportFileUpload.setPeriod(Integer.valueOf(period));
reportFileUpload.setFileUploadId(fileUpload.getUid()); reportFileUpload.setFileUploadId(fileUpload.getUid());
reportFileUpload.setReportType(taxDocument.getFileType()); reportFileUpload.setReportType(taxDocument.getFileType());
reportFileUpload.setReportFileName(fileName);
reportFileUploadService.saveData(file,reportFileUpload); reportFileUploadService.saveData(file,reportFileUpload);
}else{
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
} }
} }
//设置创建人 创建时间信息 设置年份区分 //设置创建人 创建时间信息 设置年份区分
......
...@@ -1223,7 +1223,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -1223,7 +1223,9 @@ public class ReportServiceImpl extends BaseService {
*/ */
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample); List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks);
dataDto.setFormulaBlocks(formulaBlocks.stream()
.map(o -> beanUtil.copyProperties(o, new FormulaFormlaBlockDto())).collect(Collectors.toList()));
//todo: 关键字数据源稍后再加 //todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源 // 获取通过KeyValueDataId关联的数据源,即公式数据源
......
...@@ -142,7 +142,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -142,7 +142,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
inputInvoiceDataSourceDto.setCertificationDate(x.getCertifiedDate()); inputInvoiceDataSourceDto.setCertificationDate(x.getCertifiedDate());
inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode()); inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNum()); inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNum());
inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getInvoiceType())); inputInvoiceDataSourceDto.setInvoiceType(EnumInvoiceType.NAME_MAPPING.get(x.getInvoiceType()));
inputInvoiceDataSourceDto.setPeriod(period); inputInvoiceDataSourceDto.setPeriod(period);
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSalesTaxNum()); inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSalesTaxNum());
inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource); inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
...@@ -221,7 +221,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction { ...@@ -221,7 +221,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
//// example.or(criteria1); //// example.or(criteria1);
// } // }
//发票状态 //发票状态
criteria.andInvoiceTypeEqualTo("正常"); // 过滤作废状态 criteria.andInvoiceStatusEqualTo("正常"); // 过滤作废状态
// List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> { // List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> {
// return x.getRZSQ().endsWith("-" + (period.intValue() > 9 ? period.toString() : "0" + period.toString())); // return x.getRZSQ().endsWith("-" + (period.intValue() > 9 ? period.toString() : "0" + period.toString()));
......
jdbc_url=jdbc:mysql://10.158.230.16:3306/tax_admin_didi?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false jdbc_url=jdbc:mysql://47.94.233.173:16000/tax_admin_didi?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false
jdbc_user=root jdbc_user=root
jdbc_password=taxadmin2018 jdbc_password=taxadmin2018
#jdbc_password=111111 #jdbc_password=111111
......
...@@ -52,5 +52,6 @@ ...@@ -52,5 +52,6 @@
"DocumentPath":"DocumentPath", "DocumentPath":"DocumentPath",
"PreviewFile":"PreviewFile", "PreviewFile":"PreviewFile",
"UploadSuccessCount":"UploadSuccessCount", "UploadSuccessCount":"UploadSuccessCount",
"UploadFailCount":"UploadFailCount" "UploadFailCount":"UploadFailCount",
"DeleteConfirm":"DeleteConfirm"
} }
\ No newline at end of file
...@@ -52,5 +52,6 @@ ...@@ -52,5 +52,6 @@
"DocumentPath":"档案路径", "DocumentPath":"档案路径",
"PreviewFile":"预览文件", "PreviewFile":"预览文件",
"UploadSuccessCount":"个档案上传成功", "UploadSuccessCount":"个档案上传成功",
"UploadFailCount":"个档案上传失败" "UploadFailCount":"个档案上传失败",
"DeleteConfirm":"是否确认删除记录?"
} }
\ No newline at end of file
...@@ -9,7 +9,13 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -9,7 +9,13 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.queryFieldModel = {}; $scope.queryFieldModel = {};
$scope.editFieldModel = {}; $scope.editFieldModel = {};
$scope.pagingOptions = {}; //分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 10, //每页多少条数据
pageSizeString: '10',
};
$scope.localData = null; $scope.localData = null;
$scope.loadMainData = function () { $scope.loadMainData = function () {
...@@ -414,11 +420,11 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -414,11 +420,11 @@ taxDocumentManageModule.controller('taxDocumentListController',
if(params[key] === undefined || params[key] === null) params[key] = ""; if(params[key] === undefined || params[key] === null) params[key] = "";
}); });
params.ownTime = $scope.queryOwnTime(params.ownTime, "int"); params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/"); params.effectiveTime ? params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/") : delete params.effectiveTime;
params.fileTime = $scope.getQueryDate(params.fileTime, "/"); params.fileTime ? params.fileTime = $scope.getQueryDate(params.fileTime, "/") : delete params.fileTime;
params.createTime = $scope.getQueryDate(params.createTime, "/"); params.createTime ? params.createTime = $scope.getQueryDate(params.createTime, "/") : delete params.createTime;
params.updateTime = $scope.getQueryDate(params.updateTime, "/"); params.updateTime ? params.updateTime = $scope.getQueryDate(params.updateTime, "/") : delete params.updateTime;
params.uploadTime = $scope.getQueryDate(params.uploadTime, "/"); params.uploadTime ? params.uploadTime = $scope.getQueryDate(params.uploadTime, "/") : delete params.uploadTime;
params.filePositionUrl = encodeURIComponent(params.filePositionUrl); params.filePositionUrl = encodeURIComponent(params.filePositionUrl);
params.auditStatus = $scope.transformAuditStatusToServer(params.auditStatus); params.auditStatus = $scope.transformAuditStatusToServer(params.auditStatus);
taxDocumentListService.editRecord(params).then(function (data) { taxDocumentListService.editRecord(params).then(function (data) {
...@@ -474,21 +480,39 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -474,21 +480,39 @@ taxDocumentManageModule.controller('taxDocumentListController',
delIDs.push(cellId); delIDs.push(cellId);
} }
}); });
taxDocumentListService.delFileRecordItems({ if(delIDs.length ==0){
"ids":delIDs return;
}).then(function (data) { }
if (data) { SweetAlert.swal({
SweetAlert.swal({ title: '提示',
title: $translate.instant("Deleted"), text: $translate.instant("DeleteConfirm"),
type: "success", type: "warning",
confirmButtonText: $translate.instant('Confirm'), showCancelButton: true,
closeOnConfirm: true confirmButtonColor: "#DD6B55",
}, confirmButtonText: $translate.instant('Confirm'),
function (isConfirm) { cancelButtonText: $translate.instant('Cancel'),
if (isConfirm) $scope.loadMainData(); 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() { (function initialize() {
......
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