Commit 3230b2bb authored by zhkwei's avatar zhkwei

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

parents 6badbf04 41515c6b
...@@ -12,7 +12,7 @@ public class ErrorMessage { ...@@ -12,7 +12,7 @@ public class ErrorMessage {
public static final String NoSelectSheet = "NoSelectSheet"; public static final String NoSelectSheet = "NoSelectSheet";
public static final String DIDNOTSELECTPERIOD = "You should select period!"; public static final String DIDNOTSELECTPERIOD = "You should select period!";
public static final String ImportFailed = "ImportFailed!"; public static final String ImportFailed = "导入失败!";
public static final String ImportNotMatch = "导入文件与选择机构或期间不匹配!"; public static final String ImportNotMatch = "导入文件与选择机构或期间不匹配!";
public static final String ExportFailed = "ExportFailed!"; public static final String ExportFailed = "ExportFailed!";
public static final String NoData = "无数据!"; public static final String NoData = "无数据!";
......
...@@ -105,8 +105,8 @@ public class AnalysisJobServiceImpl extends BaseService { ...@@ -105,8 +105,8 @@ public class AnalysisJobServiceImpl extends BaseService {
private final static String MONEYTYPE = "CNY"; private final static String MONEYTYPE = "CNY";
private final static List<Integer> YEAR_LIST = Lists.newArrayList(2017, 2018, 2019); private final static List<Integer> YEAR_LIST = Lists.newArrayList(2017, 2018, 2019);
private static List<Integer> periodInit = Lists.newArrayList(); private static List<Integer> periodInit = Lists.newArrayList();
private static final String ZZSNSSBB = "增值税纳税申报表";//增值税申报表(一般纳税人) private static final String ZZSNSSBB = "增值税纳税申报表";//增值税申报表(一般纳税人) todo 模板名称改的话这里也要改
private static final String QYSDSYJB = "企业所得税预缴表";//企业所得税预缴表 private static final String QYSDSYJB = "预缴纳税申报表";//企业所得税预缴表 todo 模板名称改的话这里也要改
private String gzzscode = null;//一般纳税人 private String gzzscode = null;//一般纳税人
private String szzscode = null;//小规模纳税人 private String szzscode = null;//小规模纳税人
...@@ -847,7 +847,7 @@ public class AnalysisJobServiceImpl extends BaseService { ...@@ -847,7 +847,7 @@ public class AnalysisJobServiceImpl extends BaseService {
private String qysdscode = null; private String qysdscode = null;
public void analysisTax(List<Organization> orgs, Integer period, Integer type) { public void analysisTax(List<Organization> orgs, Integer period, Integer type) {
qysdscode = projectMapper.getTemplateCode("1", QYSDSYJB).get(0).getName();//一般纳税人 qysdscode = projectMapper.getTemplateCode("1", QYSDSYJB).size() != 0 ? projectMapper.getTemplateCode("1", QYSDSYJB).get(0).getName() : null;//一般纳税人
List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList()); List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList());
if (type.equals(EnumTbImportType.CoverImport.getCode())) { if (type.equals(EnumTbImportType.CoverImport.getCode())) {
AnalysisTaxExample example = new AnalysisTaxExample(); AnalysisTaxExample example = new AnalysisTaxExample();
......
...@@ -307,6 +307,24 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -307,6 +307,24 @@ public class AnalysisServiceImpl extends BaseService {
return null; return null;
} }
public Organization getOrgById(String organizationId) {
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andIdEqualTo(organizationId);
List<Organization> organizations = organizationMapper.selectByExample(organizationExample);
if (organizations.size() != 0)
return organizations.get(0);
return null;
}
public Organization getOrgByCompanyName(String companyName) {
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andNameEqualTo(companyName);
List<Organization> organizations = organizationMapper.selectByExample(organizationExample);
if (organizations.size() != 0)
return organizations.get(0);
return null;
}
private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) { private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
try { try {
...@@ -392,6 +410,12 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -392,6 +410,12 @@ public class AnalysisServiceImpl extends BaseService {
continue; continue;
} }
model.setCompanyName(getCellStringValue(sheet.getRow(j).getCell(0))); model.setCompanyName(getCellStringValue(sheet.getRow(j).getCell(0)));
try {
model.setSeqNo(getSeqNoByPeriod(getOrgByCompanyName(getCellStringValue(sheet.getRow(j).getCell(0))).getId(), selectedPer));
} catch (Exception e) {
logger.warn(getCellStringValue(sheet.getRow(j).getCell(0)) + "公司名称匹配不成功");
continue;
}
model.setFullTimeAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(1))); model.setFullTimeAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(1)));
model.setInternAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2))); model.setInternAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
model.setVendorAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(3))); model.setVendorAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(3)));
...@@ -521,7 +545,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -521,7 +545,7 @@ public class AnalysisServiceImpl extends BaseService {
} }
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate, private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate,
String companyName, String country) { String organizationId, String country) {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -542,15 +566,22 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -542,15 +566,22 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalTaxData model = new AnalysisInternationalTaxData(); AnalysisInternationalTaxData model = new AnalysisInternationalTaxData();
model.setId(idService.nextId()); model.setId(idService.nextId());
model.setPeriod(selectedPer); model.setPeriod(selectedPer);
model.setCompanyName(companyName); model.setOrganizationId(organizationId);
model.setCompanyName(getOrgById(organizationId).getName());
model.setCountry(country); model.setCountry(country);
try {
model.setSeqNo(getSeqNoByPeriod(organizationId, DateUtils.strToPeriod(periodDate)));
} catch (Exception e) {
continue;
}
model.setTaxCategory(getCellStringValue(sheet.getRow(j).getCell(0))); model.setTaxCategory(getCellStringValue(sheet.getRow(j).getCell(0)));
model.setTaxType(getCellStringValue(sheet.getRow(j).getCell(1))); model.setTaxType(getCellStringValue(sheet.getRow(j).getCell(1)));
model.setTaxAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2))); model.setTaxAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
lists.add(model); lists.add(model);
} }
AnalysisInternationalTaxDataExample example = new AnalysisInternationalTaxDataExample(); AnalysisInternationalTaxDataExample example = new AnalysisInternationalTaxDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName); example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andOrganizationIdEqualTo(organizationId);
analysisInternationalTaxDataMapper.deleteByExample(example); analysisInternationalTaxDataMapper.deleteByExample(example);
lists.forEach(l -> { lists.forEach(l -> {
analysisInternationalTaxDataMapper.insertSelective(l); analysisInternationalTaxDataMapper.insertSelective(l);
...@@ -566,7 +597,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -566,7 +597,7 @@ public class AnalysisServiceImpl extends BaseService {
} }
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate, private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate,
String companyName, String country) { String organizationId, String country) {
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -585,10 +616,12 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -585,10 +616,12 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData(); AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId()); model.setId(idService.nextId());
model.setPeriod(selectedPer); model.setPeriod(selectedPer);
model.setCompanyName(companyName); model.setOrganizationId(organizationId);
model.setCountry(country); model.setCountry(country);
Cell cell1 = sheet.getRow(j).getCell(0); Cell cell1 = sheet.getRow(j).getCell(0);
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) { try {
model.setSeqNo(getSeqNoByPeriod(organizationId, DateUtils.strToPeriod(periodDate)));
} catch (Exception e) {
continue; continue;
} }
model.setGmv(getCellBigDecimalValue(cell1)); model.setGmv(getCellBigDecimalValue(cell1));
...@@ -606,7 +639,7 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -606,7 +639,7 @@ public class AnalysisServiceImpl extends BaseService {
lists.add(model); lists.add(model);
} }
AnalysisInternationalBusinessDataExample example = new AnalysisInternationalBusinessDataExample(); AnalysisInternationalBusinessDataExample example = new AnalysisInternationalBusinessDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName); example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andOrganizationIdEqualTo(organizationId);
analysisInternationalBusinessDataMapper.deleteByExample(example); analysisInternationalBusinessDataMapper.deleteByExample(example);
lists.forEach(l -> { lists.forEach(l -> {
analysisInternationalBusinessDataMapper.insertSelective(l); analysisInternationalBusinessDataMapper.insertSelective(l);
...@@ -848,7 +881,6 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -848,7 +881,6 @@ public class AnalysisServiceImpl extends BaseService {
jdbcTemplate.update(sql); jdbcTemplate.update(sql);
} }
//e.createCriteria().andIsActiveEqualTo(true); //e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e); List<Organization> orgs = organizationMapper.selectByExample(e);
//首先要先初始化master表数据,所有的数据要依赖master表 //首先要先初始化master表数据,所有的数据要依赖master表
......
...@@ -962,10 +962,13 @@ public class DataImportService extends BaseService { ...@@ -962,10 +962,13 @@ public class DataImportService extends BaseService {
rlits.stream().collect(Collectors.groupingBy(RedLetterInfoTable::getSubjectNum)); rlits.stream().collect(Collectors.groupingBy(RedLetterInfoTable::getSubjectNum));
atsGroupRes.forEach((k, v) -> processRlits(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processRlits(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
if(dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData);
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
if (isSuccess < 1) { if (isSuccess < 1) {
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.ImportNotMatch);
} }
return operationResultDto.success(); return operationResultDto.success();
} catch (Exception e) { } catch (Exception e) {
...@@ -1068,6 +1071,8 @@ public class DataImportService extends BaseService { ...@@ -1068,6 +1071,8 @@ public class DataImportService extends BaseService {
atsGroupRes.forEach((k, v) -> processAts(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processAts(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
if(dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData);
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
if (isSuccess < 1) { if (isSuccess < 1) {
return OperationResultDto.error(ErrorMessage.ImportNotMatch); return OperationResultDto.error(ErrorMessage.ImportNotMatch);
...@@ -1172,9 +1177,12 @@ public class DataImportService extends BaseService { ...@@ -1172,9 +1177,12 @@ public class DataImportService extends BaseService {
atsGroupRes.forEach((k, v) -> processCprs(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processCprs(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
if(dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData);
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
if (isSuccess < 1) { if (isSuccess < 1) {
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.ImportNotMatch);
} }
return OperationResultDto.success(); return OperationResultDto.success();
} catch (ServiceException e) { } catch (ServiceException e) {
...@@ -1458,10 +1466,13 @@ public class DataImportService extends BaseService { ...@@ -1458,10 +1466,13 @@ public class DataImportService extends BaseService {
irs.stream().collect(Collectors.groupingBy(InvoiceRecord::getBillingBody)); irs.stream().collect(Collectors.groupingBy(InvoiceRecord::getBillingBody));
atsGroupRes.forEach((k, v) -> processIrs(k, v, orgIds, tmsPeriod, importType, dataImportLogs)); atsGroupRes.forEach((k, v) -> processIrs(k, v, orgIds, tmsPeriod, importType, dataImportLogs));
} }
if(dataImportLogs.size() == 0)
return OperationResultDto.error(ErrorMessage.NoData);
int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count(); int isSuccess = (int) dataImportLogs.stream().filter(di -> Boolean.TRUE.equals(di.getImportResult())).count();
addDataImportLog(dataImportLogs); addDataImportLog(dataImportLogs);
if (isSuccess < 1) { if (isSuccess < 1) {
return OperationResultDto.error(ErrorMessage.NoData); return OperationResultDto.error(ErrorMessage.ImportNotMatch);
} }
return OperationResultDto.success(); return OperationResultDto.success();
} catch (ServiceException e) { } catch (ServiceException e) {
......
...@@ -397,6 +397,7 @@ ...@@ -397,6 +397,7 @@
}; };
var getImportInternationalBUData = function () { var getImportInternationalBUData = function () {
param.type = $scope.importType;
vatImportService.displayAnalysisInternationalImportData(param).success(function (data) { vatImportService.displayAnalysisInternationalImportData(param).success(function (data) {
if (data.data) { if (data.data) {
$scope.internationalBUDataGridSource = data.data; $scope.internationalBUDataGridSource = data.data;
...@@ -475,6 +476,7 @@ ...@@ -475,6 +476,7 @@
}; };
var getImportInternationalTaxData = function () { var getImportInternationalTaxData = function () {
param.type = $scope.importType;
vatImportService.displayAnalysisInternationalImportData(param).success(function (data) { vatImportService.displayAnalysisInternationalImportData(param).success(function (data) {
if (data.data) { if (data.data) {
$scope.internationalTaxDataGridSource = data.data; $scope.internationalTaxDataGridSource = data.data;
......
...@@ -229,8 +229,11 @@ ...@@ -229,8 +229,11 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<!-- <button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"-->
<!-- ng-disabled="!hasEditPermission">{{'Confirm' | translate }}-->
<!-- </button>-->
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()" <button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"
ng-disabled="!hasEditPermission">{{'Confirm' | translate }} >{{'Confirm' | translate }}
</button> </button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled" <button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled"
ng-disabled="isDisabled">{{'ButtonCancel' | translate }} ng-disabled="isDisabled">{{'ButtonCancel' | translate }}
......
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