Commit cad34ca0 authored by chase's avatar chase

fix bug

parent dcfe14a3
......@@ -13,6 +13,7 @@ public enum EnumInvoiceType {
private int code;
private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>();
public static final Map<String, Integer> NAME_MAPPING = new HashMap<>();
EnumInvoiceType(int code, String name) {
this.code = code;
this.name = name;
......@@ -29,6 +30,7 @@ public enum EnumInvoiceType {
static {
for (EnumInvoiceType invoiceType : EnumInvoiceType.values()) {
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;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import java.util.List;
public class ReportDataDto {
private List<CellDataDto> cellData;
private List<PeriodFormulaBlock> formulaBlocks;
private List<FormulaFormlaBlockDto> formulaBlocks;
private List<DataSourceDtoExtend> manualDataSources;
private EbitDataDto ebitData;
......@@ -26,11 +24,11 @@ public class ReportDataDto {
this.cellData = cellData;
}
public List<PeriodFormulaBlock> getFormulaBlocks() {
public List<FormulaFormlaBlockDto> getFormulaBlocks() {
return this.formulaBlocks;
}
public void setFormulaBlocks(List<PeriodFormulaBlock> formulaBlocks) {
public void setFormulaBlocks(List<FormulaFormlaBlockDto> formulaBlocks) {
this.formulaBlocks = formulaBlocks;
}
......
......@@ -883,7 +883,8 @@ public class CitReportServiceImpl extends BaseService {
*/
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks);
dataDto.setFormulaBlocks(formulaBlocks.stream()
.map(o -> beanUtil.copyProperties(o, new FormulaFormlaBlockDto())).collect(Collectors.toList()));
//todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源
......
......@@ -116,11 +116,10 @@ public class ReportFileUploadService extends BaseService {
data.setCreator(user.getUserName());
data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename());
if (StringUtils.isBlank(data.getFileUploadId())) {
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
if(StringUtils.isBlank(data.getReportFileName())){
data.setReportFileName(file.getOriginalFilename());
}
if (StringUtils.isBlank(data.getProjectId()) && StringUtils.isNotBlank(data.getOrgId()) && data.getPeriod() != null) {
ProjectExample projectExample = new ProjectExample();
String year = String.valueOf(data.getPeriod()).substring(0,4);
......@@ -131,7 +130,10 @@ public class ReportFileUploadService extends BaseService {
}else{
return;
}
if (StringUtils.isBlank(data.getFileUploadId())) {
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
}
}else {
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
......@@ -143,7 +145,7 @@ public class ReportFileUploadService extends BaseService {
taxDocument.setEnable("T");
taxDocument.setOwnTime(data.getPeriod());
taxDocument.setFileType(data.getReportType());
taxDocument.setFileName(data.getReportFileName());
FileTypesExample example = new FileTypesExample();
example.createCriteria().andFileTypeEqualTo(data.getReportType());
List<FileTypes> dataList = fileTypesMapper.selectByExample(example);
......@@ -151,6 +153,15 @@ public class ReportFileUploadService extends BaseService {
taxDocument.setFileAttr(dataList.get(0).getFileAttr());
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);
}
ReportFileUploadExample example = new ReportFileUploadExample();
......
......@@ -169,10 +169,15 @@ public class TaxDocumentServiceImpl {
try {
//上传文件
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())){
//重新命名
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.setOrgId(taxDocument.getCompanyId());
reportFileUpload.setSourceType(ReportFileUploadEnum.SuorceType.RECORD.name());
......@@ -180,7 +185,12 @@ public class TaxDocumentServiceImpl {
reportFileUpload.setPeriod(Integer.valueOf(period));
reportFileUpload.setFileUploadId(fileUpload.getUid());
reportFileUpload.setReportType(taxDocument.getFileType());
reportFileUpload.setReportFileName(fileName);
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 {
*/
List<PeriodFormulaBlock> formulaBlocks = periodFormulaBlockMapper.selectByExample(periodFormulaBlockExample);
dataDto.setFormulaBlocks(formulaBlocks);
dataDto.setFormulaBlocks(formulaBlocks.stream()
.map(o -> beanUtil.copyProperties(o, new FormulaFormlaBlockDto())).collect(Collectors.toList()));
//todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源
......
......@@ -142,7 +142,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
inputInvoiceDataSourceDto.setCertificationDate(x.getCertifiedDate());
inputInvoiceDataSourceDto.setInvoiceCode(x.getInvoiceCode());
inputInvoiceDataSourceDto.setInvoiceNumber(x.getInvoiceNum());
inputInvoiceDataSourceDto.setInvoiceType(Integer.parseInt(x.getInvoiceType()));
inputInvoiceDataSourceDto.setInvoiceType(EnumInvoiceType.NAME_MAPPING.get(x.getInvoiceType()));
inputInvoiceDataSourceDto.setPeriod(period);
inputInvoiceDataSourceDto.setSellerTaxNumber(x.getSalesTaxNum());
inputInvoiceDataSourceDto.setName(Constant.DataSourceName.InputDetailInvoiceDataSource);
......@@ -221,7 +221,7 @@ public class JXFP extends FunctionBase implements FreeRefFunction {
//// example.or(criteria1);
// }
//发票状态
criteria.andInvoiceTypeEqualTo("正常"); // 过滤作废状态
criteria.andInvoiceStatusEqualTo("正常"); // 过滤作废状态
// List<InputInvoice> list = inputInvoiceMapper.selectByExample(example).stream().filter(x -> {
// 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_password=taxadmin2018
#jdbc_password=111111
......
......@@ -52,5 +52,6 @@
"DocumentPath":"DocumentPath",
"PreviewFile":"PreviewFile",
"UploadSuccessCount":"UploadSuccessCount",
"UploadFailCount":"UploadFailCount"
"UploadFailCount":"UploadFailCount",
"DeleteConfirm":"DeleteConfirm"
}
\ No newline at end of file
......@@ -52,5 +52,6 @@
"DocumentPath":"档案路径",
"PreviewFile":"预览文件",
"UploadSuccessCount":"个档案上传成功",
"UploadFailCount":"个档案上传失败"
"UploadFailCount":"个档案上传失败",
"DeleteConfirm":"是否确认删除记录?"
}
\ No newline at end of file
......@@ -9,7 +9,13 @@ taxDocumentManageModule.controller('taxDocumentListController',
$scope.queryFieldModel = {};
$scope.editFieldModel = {};
$scope.pagingOptions = {};
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 10, //每页多少条数据
pageSizeString: '10',
};
$scope.localData = null;
$scope.loadMainData = function () {
......@@ -414,11 +420,11 @@ taxDocumentManageModule.controller('taxDocumentListController',
if(params[key] === undefined || params[key] === null) params[key] = "";
});
params.ownTime = $scope.queryOwnTime(params.ownTime, "int");
params.effectiveTime = $scope.getQueryDate(params.effectiveTime, "/");
params.fileTime = $scope.getQueryDate(params.fileTime, "/");
params.createTime = $scope.getQueryDate(params.createTime, "/");
params.updateTime = $scope.getQueryDate(params.updateTime, "/");
params.uploadTime = $scope.getQueryDate(params.uploadTime, "/");
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) {
......@@ -474,21 +480,39 @@ taxDocumentManageModule.controller('taxDocumentListController',
delIDs.push(cellId);
}
});
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();
if(delIDs.length ==0){
return;
}
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() {
......
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