Commit fe5c89dc authored by zhkwei's avatar zhkwei

CIT--fixbug

parent b07b6e3a
......@@ -3,6 +3,7 @@ package pwc.taxtech.atms.common.message;
public class ErrorMessageCN {
public static final String NoCompanyError = "未映射到主体";
public static final String NoProjectError = "未映射到卡片";
public static final String ExistDataPeriodsError = "存在非选择期间数据";
public static final String InconsistentPeriod = "单表中期间不一致";
public static final String DoNotSelectPeriod = "未选择期间";
......
......@@ -9,7 +9,7 @@ public enum FormulaDataSourceDetailType {
InputInvoiceDataSourceDto(3, pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto.class),
InputInvoiceDetailDataSourceDto(4, pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto.class),
OutputInvoiceDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto.class),
AssetDetailDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto.class),
AssetDetailDataSourceDto(21, pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto.class),
ReportCellDataSourceDto(6, pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto.class),
ReportCellTableSUMIFDataSourceDto(7,ReportCellTableSUMIFDataSourceDto.class),
......
......@@ -20,6 +20,7 @@ public class TableRule {
map.put("RGDRZCFZB", "balance_sheet_manual");
map.put("RGDRLRB", "profit_loss_statement_manual");
map.put("RGDRXJLLB", "cash_flow_manual");
map.put("HZXXB", "red_letter_info_table");
map.put("ZXZCFZB", "balance_sheet_final");
map.put("ZXLLB", "profit_loss_statement_final");
......
......@@ -164,7 +164,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
Page page = PageHelper.startPage(citTrialBalanceDto.getPageInfo().getPageIndex(), citTrialBalanceDto.getPageInfo().getPageSize());
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
// citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
List<CitTrialBalanceDto> citTbDtos = Lists.newArrayList();
citTbList.forEach(tb -> {
......@@ -189,7 +189,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
try {
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
// citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
Map<String, String> header = generalTbGeneVerHeader();
......
......@@ -84,9 +84,11 @@ public class CitImportExcelServiceImpl extends BaseService {
OperationResultDto operationResultDto = new OperationResultDto();
InputStream input = file.getInputStream();
//判断期间参数是否为空等
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
//转换期间为整型
Integer period = DateUtils.strToPeriodY(periodDate);
//获取上传文件类型的枚举值
......@@ -166,6 +168,11 @@ public class CitImportExcelServiceImpl extends BaseService {
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
if(StringUtils.isBlank(projectId)){
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.NoProjectError);
return saveResult;
}
}else{
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.NoCompanyError);
......@@ -354,6 +361,7 @@ public class CitImportExcelServiceImpl extends BaseService {
Map<String, Integer> companySuccessMap = new HashMap();
Map<String, Integer> companyFailMap = new HashMap();
Map<String, Integer> noCompanyMap = new HashMap();
Map<String,Integer> noProjectMap = new HashMap<>();
String currentUserName = authUserHelper.getCurrentAuditor().get();
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 8; rowNum <= sheet.getLastRowNum(); rowNum++) {
......@@ -405,6 +413,10 @@ public class CitImportExcelServiceImpl extends BaseService {
companyFailMap.put(sb.toString(),companyFailMap.containsKey(sb.toString())?companyFailMap.get(sb.toString())+1:1);
continue;
}
if(StringUtils.isBlank(projectId)){
noProjectMap.put(sb.toString(),companyFailMap.containsKey(sb.toString())?companyFailMap.get(sb.toString())+1:1);
continue;
}
companySuccessMap.put(sb.toString(),companySuccessMap.containsKey(sb.toString())?companySuccessMap.get(sb.toString())+1:1);
}else{
......@@ -471,6 +483,14 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoCompanyError);
citDataImportLogList.add(citDataImportLogError);
}
for (Map.Entry<String, Integer> entry : noProjectMap.entrySet()) {
CitDataImportLog citDataImportLogError = generalCitDataImportLog(entry.getKey(), "", "",
EnumCitImportType.TrialBalance.getCode(), period,
"", "试算平衡表", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoProjectError);
citDataImportLogList.add(citDataImportLogError);
}
addDataImportLog(citDataImportLogList);
saveResult.setResult(true);
......@@ -624,6 +644,13 @@ public class CitImportExcelServiceImpl extends BaseService {
return saveResult;
}
if(StringUtils.isBlank(projectId)){
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.NoProjectError);
return saveResult;
}
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
......@@ -747,11 +774,17 @@ public class CitImportExcelServiceImpl extends BaseService {
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
return saveResult;
}
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
projectId = getProjectId(orgId, period);
if(StringUtils.isBlank(projectId)){
saveResult.setResult(false);
saveResult.setData(false);
saveResult.setResultMsg(ErrorMessageCN.NoProjectError);
return saveResult;
}
}else{
saveResult.setResult(false);
saveResult.setResultMsg(ErrorMessageCN.DoNotSelectCompany);
......@@ -943,6 +976,7 @@ public class CitImportExcelServiceImpl extends BaseService {
Map<String, Integer> companySuccessMap = new HashMap();
Map<String, Integer> companyFailMap = new HashMap();
Map<String, Integer> noCompanyMap = new HashMap();
Map<String, Integer> noProjectMap = new HashMap();
String currentUserName = authUserHelper.getCurrentAuditor().get();
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for (int rowNum = sheet.getFirstRowNum() + 2; rowNum <= sheet.getLastRowNum(); rowNum++) {
......@@ -974,7 +1008,6 @@ public class CitImportExcelServiceImpl extends BaseService {
orgId = organizations.get(0).getId();
taxPayerId = StringUtils.isNotEmpty(organizations.get(0).getLegalCode()) ?
organizations.get(0).getLegalCode() : organizations.get(0).getTaxPayerNumber();
projectId = getProjectId(orgId, period);
companyName = organizations.get(0).getName();
//拼接公司相关信息,作为键,其Excel出现的数量作为值
......@@ -989,6 +1022,11 @@ public class CitImportExcelServiceImpl extends BaseService {
companyFailMap.put(sb.toString(),companyFailMap.containsKey(sb.toString())?companyFailMap.get(sb.toString())+1:1);
continue;
}
projectId = getProjectId(orgId, period);
if(StringUtils.isBlank(projectId)){
noProjectMap.put(sb.toString(),companyFailMap.containsKey(sb.toString())?companyFailMap.get(sb.toString())+1:1);
continue;
}
companySuccessMap.put(sb.toString(),companySuccessMap.containsKey(sb.toString())?companySuccessMap.get(sb.toString())+1:1);
}else{
......@@ -1076,6 +1114,14 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoCompanyError);
citDataImportLogList.add(citDataImportLogError);
}
for (Map.Entry<String, Integer> entry : noProjectMap.entrySet()) {
CitDataImportLog citDataImportLogError = generalCitDataImportLog(entry.getKey(), "", "",
EnumCitImportType.SalaryAdvance.getCode(), period,
"", "预提重分类数据源", false);
citDataImportLogError.setRecordSize(entry.getValue());
citDataImportLogError.setErrorMsg(ErrorMessageCN.NoProjectError);
citDataImportLogList.add(citDataImportLogError);
}
addDataImportLog(citDataImportLogList);
saveResult.setResult(true);
saveResult.setResultMsg("导入成功");
......
......@@ -345,7 +345,7 @@
org_name, subject_name, accounted_dr, accounted_cr,
created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time
from cit_journal_entry_adjust where project_id=''
from cit_journal_entry_adjust where project_id = #{projectId,jdbcType=VARCHAR}
<if test="orgCode != null">
and org_code = #{orgCode,jdbcType=VARCHAR}
</if>
......@@ -365,7 +365,7 @@
journal_source, category, name, voucher_num, description, segment1 as org_code, segment3 as subject_code,
segment1_name as org_name, segment3_name as subject_name, accounted_dr, accounted_cr,
created_by, created_date, late_updated_by, late_updated_date, create_time, update_time
from journal_entry where project_id=''
from journal_entry where project_id = #{projectId,jdbcType=VARCHAR}
<if test="orgCode != null">
and segment1 = #{orgCode,jdbcType=VARCHAR}
</if>
......
......@@ -359,6 +359,7 @@
cit_draft_account_mapping dam
on
tb.account_code=dam.acct_code
where tb.project_id = #{projectId,jdbcType=VARCHAR}
</select>
......
......@@ -25,11 +25,11 @@
var serviceTypeMapping = {
VAT: $translate.instant('VAT'),
RPT: $translate.instant('RPT'),
// RPT: $translate.instant('RPT'),
CIT: $translate.instant('CIT'),
DTA: $translate.instant('DTA'),
CF: $translate.instant('CashFlow'),
AssetsManage: $translate.instant('AssetsManage')
// DTA: $translate.instant('DTA'),
// CF: $translate.instant('CashFlow'),
// AssetsManage: $translate.instant('AssetsManage')
};
// Config if demo, if current service is only demo, will not validate the formula
......
......@@ -957,6 +957,7 @@
//批量导出EXCEL
$scope.export = function () {
debugger;
var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType';
});
......@@ -991,15 +992,16 @@
var reg = /^([A-Z]+[0-9]+){1}$|^([A-Z]+[0-9]+){1}([\+-]{1}[A-Z]+[0-9]+)+$/g;
var exportReportData = [];
angular.forEach(reportArray, function (currentVal) {
debugger;
var node = _.first(_.where(grp.children, {reportId: currentVal}));
if (!node) {
return;
}
var reportPromiss = citReportService.getReportData(node.reportId).success(function (reportData) {
debugger;
if (reportData && reportData.data && reportData.data.cellData) {
_.each(reportData.data.cellData, function (x) {
x.value = x.cellValue;
if (x.formula && reg.test(x.formula)) {
x.isFormula = true;
......@@ -1025,7 +1027,7 @@
});
for (var j = 0; j < exportReportData.length; j++) {
var report = "<vat-report-sheet id='r_" + exportReportData[j].templateId + "' spread='spreads[" + j + "]' report-source = 'exportReportData[" + j + "]' template-id='\"" + exportReportData[j].templateId + "\"' is-export='true' service-type='6'></vat-report-sheet>";
var report = "<cit-report-sheet id='r_" + exportReportData[j].templateId + "' spread='spreads[" + j + "]' report-source = 'exportReportData[" + j + "]' template-id='\"" + exportReportData[j].templateId + "\"' is-export='true' service-type='6'></cit-report-sheet>";
var html = $compile(report)($scope);
$('.export-container').append(html);
}
......
......@@ -551,7 +551,7 @@ controller('editTemplategroupModalController', ['$scope', '$log', '$translate',
return;
}
//此处报错(Converting circular structure to JSON),因时间关系采取快捷方案
//此处报错(Converting circular structure to JSON),因时间关系采取快捷方案 update by zhikai.z.wei 20190321
var addTemplateGroupModel = {
groupType: $scope.editModel.groupType,
industryIds: $scope.editModel.industryIDs,
......
......@@ -167,7 +167,8 @@
},
__RequestVerificationToken: token,
withCredentials: true
}).then(function (resp) {
}).then(function (data) {
var resp = data.data;
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data || resp.result) {
......@@ -175,17 +176,11 @@
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
} else {
if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.message));
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg));
SweetAlert.warning(resp.resultMsg);
} else {
SweetAlert.error($translate.instant('ImportFailed'));
}
logDto.UpdateState = $translate.instant('ImportFail');
vatOperationLogService.addOperationLog(logDto);
}
......
......@@ -167,7 +167,8 @@
},
__RequestVerificationToken: token,
withCredentials: true
}).then(function(resp) {
}).then(function(data) {
var resp = data.data;
$('#busy-indicator-container').hide();
deferred.resolve();
if (resp.data || resp.result) {
......@@ -175,8 +176,8 @@
vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess'));
} else {
if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg));
if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning(resp.resultMsg);
}else{
SweetAlert.error($translate.instant('ImportFailed'));
}
......
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