Commit 52eb9e95 authored by Memorydoc's avatar Memorydoc

#

parent b4f46aa9
......@@ -847,7 +847,7 @@ public class AnalysisJobServiceImpl extends BaseService {
private String qysdscode = null;
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());
if (type.equals(EnumTbImportType.CoverImport.getCode())) {
AnalysisTaxExample example = new AnalysisTaxExample();
......
......@@ -307,6 +307,15 @@ public class AnalysisServiceImpl extends BaseService {
return null;
}
public Organization getOrg(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;
}
private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
try {
......@@ -521,7 +530,7 @@ public class AnalysisServiceImpl extends BaseService {
}
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate,
String companyName, String country) {
String organizationId, String country) {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -542,15 +551,22 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalTaxData model = new AnalysisInternationalTaxData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(companyName);
model.setOrganizationId(organizationId);
model.setCompanyName(getOrg(organizationId).getName());
model.setCountry(country);
try {
model.setSeqNo(getSeqNoByPeriod(organizationId ,DateUtils.strToPeriod(periodDate)));
}catch (Exception e){
continue;
}
model.setTaxCategory(getCellStringValue(sheet.getRow(j).getCell(0)));
model.setTaxType(getCellStringValue(sheet.getRow(j).getCell(1)));
model.setTaxAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
lists.add(model);
}
AnalysisInternationalTaxDataExample example = new AnalysisInternationalTaxDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName);
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andOrganizationIdEqualTo(organizationId);
analysisInternationalTaxDataMapper.deleteByExample(example);
lists.forEach(l -> {
analysisInternationalTaxDataMapper.insertSelective(l);
......@@ -566,7 +582,7 @@ public class AnalysisServiceImpl extends BaseService {
}
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate,
String companyName, String country) {
String organizationId, String country) {
try {
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -585,10 +601,12 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(companyName);
model.setOrganizationId(organizationId);
model.setCountry(country);
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;
}
model.setGmv(getCellBigDecimalValue(cell1));
......@@ -606,7 +624,7 @@ public class AnalysisServiceImpl extends BaseService {
lists.add(model);
}
AnalysisInternationalBusinessDataExample example = new AnalysisInternationalBusinessDataExample();
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andCompanyNameEqualTo(companyName);
example.createCriteria().andPeriodEqualTo(selectedPer).andCountryEqualTo(country).andOrganizationIdEqualTo(organizationId);
analysisInternationalBusinessDataMapper.deleteByExample(example);
lists.forEach(l -> {
analysisInternationalBusinessDataMapper.insertSelective(l);
......@@ -848,7 +866,6 @@ public class AnalysisServiceImpl extends BaseService {
jdbcTemplate.update(sql);
}
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
//首先要先初始化master表数据,所有的数据要依赖master表
......
......@@ -397,6 +397,7 @@
};
var getImportInternationalBUData = function () {
param.type = $scope.importType;
vatImportService.displayAnalysisInternationalImportData(param).success(function (data) {
if (data.data) {
$scope.internationalBUDataGridSource = data.data;
......@@ -475,6 +476,7 @@
};
var getImportInternationalTaxData = function () {
param.type = $scope.importType;
vatImportService.displayAnalysisInternationalImportData(param).success(function (data) {
if (data.data) {
$scope.internationalTaxDataGridSource = data.data;
......
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