Commit 43c8ed03 authored by Memorydoc's avatar Memorydoc

#

parent 2107edc9
......@@ -432,12 +432,23 @@
<profiles>
<profile>
<id>dev</id>
<build>
<filters>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter>
</filters>
</build>
<properties>
<env>dev</env>
</properties>
</profile>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<filters>
<filter>src/main/resources/conf/conf_profile_dev.properties</filter>
<filter>src/main/resources/conf/conf_profile_dev_local.properties</filter>
</filters>
</build>
<properties>
......
......@@ -21,7 +21,7 @@ public class TemplateHeaderCheck {
};
//职工人数
public static String[] zgrs = {
"公司称", "正式员工", "实习生", "外包", "合计"
"公司称", "正式员工", "实习生", "外包", "合计"
};
//司机人数
public static String[] sjrs = {
......
......@@ -3,7 +3,6 @@ package pwc.taxtech.atms.service.impl;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.*;
......@@ -36,6 +35,7 @@ import pwc.taxtech.atms.vat.dao.TrialBalanceFinalMapper;
import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -642,8 +642,6 @@ public class AnalysisJobServiceImpl extends BaseService {
});
}
@Autowired
private OrganizationApprovedLevyInfoMapper organizationApprovedLevyInfoMapper;
/**
* 19/03/2019 15:59
......@@ -653,9 +651,9 @@ public class AnalysisJobServiceImpl extends BaseService {
* @return
* @author Gary J Li
*/
public void analysisFileManagement(List<Organization> orgs, Integer period, Integer type) {
public void analysisFileManagement(List<Organization> orgs, Integer period,Integer type) {
List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList());
if (type.equals(EnumTbImportType.CoverImport.getCode())) {
if(type.equals(EnumTbImportType.CoverImport.getCode())){
AnalysisFileManagementExample example = new AnalysisFileManagementExample();
example.createCriteria().andOrganizationIdIn(orgIds).andPeriodEqualTo(period);
analysisFileManagementMapper.deleteByExample(example);
......@@ -664,38 +662,35 @@ public class AnalysisJobServiceImpl extends BaseService {
TaxDocumentExample e1 = new TaxDocumentExample();
e1.createCriteria().andCompanyIdIn(orgIds).andOwnTimeEqualTo(period);
List<TaxDocument> taxDocuments = taxDocumentMapper.selectByExample(e1);
List<OrganizationTaxRule> taxRules = organizationTaxRuleMapper.selectByExample(new OrganizationTaxRuleExample());
// Map<String, OrganizationTaxRule> ruleMap = taxRules.stream().collect(Collectors.toMap(OrganizationTaxRule::getGroupName, Function.identity()));
Map<String, List<OrganizationTaxRule>> ruleMap = taxRules.stream().collect(Collectors.groupingBy(OrganizationTaxRule::getGroupName));
for (TaxDocument td : taxDocuments) {
for(TaxDocument td : taxDocuments){
Organization o = orgMap.get(td.getCompanyId());
AnalysisFileManagement afm = new AnalysisFileManagement();
afm.setId(idService.nextId());
afm.setSeqNo(getSeqNoByPeriod(o.getId(), period));
afm.setSeqNo(o.getCode() + "" + period);
afm.setFileType(td.getFileType());
// 周期性上传 校验当年的当前及之前的周期是否有上传文件
if (StringUtils.isNotEmpty(td.getTaxType()) && null != td.getOwnTime()) {
List<OrganizationTaxRule> otrs = ruleMap.get(td.getTaxType());
Optional<OrganizationTaxRule> otrOP = otrs.stream().filter(otr -> otr.getGroupName().equals(td.getTaxType())).map(OrganizationTaxRule::getUpdateTime).max(new ComparatorDate());
Optional<OrganizationTaxRule> otrOP= otrs.stream().filter(otr->otr.getGroupName().equals(td.getTaxType())).map(OrganizationTaxRule::getUpdateTime).max(new ComparatorDate());
OrganizationTaxRule rule = otrOP.get();
if (null == rule) {
if(null==rule){
break;
}
// afm.setReportingFrequency(rule.getTaxDecCycle());
String reporingFrequency = "/";
if (td.getFileType().indexOf("所属期间") != -1 || td.getFileType().indexOf("税种") != -1) {
OrganizationApprovedLevyInfoExample example = new OrganizationApprovedLevyInfoExample();
example.createCriteria().andOrganizationIdEqualTo(o.getId());
List<OrganizationApprovedLevyInfo> organizationApprovedLevyInfos = organizationApprovedLevyInfoMapper.selectByExample(example);
reporingFrequency = organizationApprovedLevyInfos.get(0).getApprovedTaxPeriod();
}
afm.setReportingFrequency(reporingFrequency);
afm.setReportingFrequency(rule.getTaxDecCycle());
String archivingStatus = "未归档";
/*if ("年度".equals(rule.getTaxDecCycle())) {
TaxDocumentExample example = new TaxDocumentExample();
List<Integer> fileterTime = Lists.newArrayList();
if ("年度".equals(rule.getTaxDecCycle())) {
Integer str = DateUtils.getNowYear() * 100;
Integer end = DateUtils.getNowYear() * 100 + 12;
example.createCriteria().andOwnTimeGreaterThanOrEqualTo(str).andOwnTimeLessThanOrEqualTo(end).andFileTypeEqualTo(td.getFileType());
......@@ -711,28 +706,13 @@ public class AnalysisJobServiceImpl extends BaseService {
});
example.createCriteria().andOwnTimeIn(fileterTime).andFileTypeEqualTo(td.getFileType());
archivingStatus = taxDocumentMapper.countByExample(example) > 0 ? "已归档" : archivingStatus;
}*/
if (td.getFileType().indexOf("增值税") != -1) {
if( ZZS_DATE_LIST.contains(td.getOwnTime()%100)){
archivingStatus = "已归档";
}
} else if (td.getFileType().indexOf("印花税") != -1) {
List<AnalysisFileManagement> maps = analysisFileManagementMapper.getYHSsql(getYHSsql(String.valueOf(td.getOwnTime() / 100), td.getFileType()));
if(maps.size() != 0)
archivingStatus = "已归档";
}/*else{
TaxDocumentExample example = new TaxDocumentExample();
example.createCriteria().andOwnTimeEqualTo(td.getOwnTime());
if(taxDocumentMapper.selectByExample(example).size() != 0)
archivingStatus = "已归档";
}*/
}
afm.setArchivingStatus(archivingStatus);
} else {
}else{
afm.setReportingFrequency("/");
// 由于是根据文档列表查询 必然已归档
afm.setArchivingStatus("已归档");
}
afm.setOrganizationId(o.getId());
afm.setCompanyName(o.getName());
afm.setPeriod(period);
......@@ -740,13 +720,14 @@ public class AnalysisJobServiceImpl extends BaseService {
}
}
@Autowired
private JdbcTemplate jdbcTemplate;
public String getYHSsql(String year, String fileType){
public String getYHSsql(String year, String fileType) {
String str = "";
str.format("select * from tax_document t where t.own_time like %s and t.file_type = %s", year, fileType);
return str;
return str;
}
public void analysisTax(List<Organization> orgs, Integer period, Integer type) {
......@@ -815,19 +796,19 @@ public class AnalysisJobServiceImpl extends BaseService {
}
public class ComparatorDate implements Comparator {
public class ComparatorDate implements Comparator {
public static final String TAG = "ComparatorDate";
public static final String TAG = "ComparatorDate";
@Override
public int compare(Object obj1, Object obj2) {
Date d1 = (Date) obj1;
Date d2 = (Date) obj2;
if (d1.before(d2)) {
return 1;
} else {
return -1;
}
@Override
public int compare(Object obj1, Object obj2) {
Date d1 = (Date) obj1;
Date d2 = (Date) obj2;
if (d1.before(d2)) {
return 1;
} else {
return -1;
}
}
}
}
......@@ -10,6 +10,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
......@@ -2356,11 +2357,9 @@ public class ReportServiceImpl extends BaseService {
if (ebitCellDataMapper.selectByExample(example1).size() != 0) {
ebitCellDataMapper.deleteByExample(example1);
}
;
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
if (j <= 36)
continue;
;
for (int k = 1; k < sheet.getRow(0).getLastCellNum(); k++) {
EbitCellData ebitCellData1 = new EbitCellData();
ebitCellData1.setId(idService.nextId());
......@@ -2444,7 +2443,10 @@ public class ReportServiceImpl extends BaseService {
default:
if (i == 0)
break;
sheetAt.getRow(m).getCell(i + 1).setCellValue(getCellStringValue(sheetAt1.getRow(m).getCell(2)));
Cell cell = sheetAt.getRow(m).getCell(i + 1);
cell.setCellValue(getCellStringValue(sheetAt1.getRow(m).getCell(2)));
cell.setCellFormula("B2 + C3");
//cell.setCellType(cellStyle.getAlignment());
}
}
}
......
......@@ -84,9 +84,6 @@
<property name="cronExpression" value="0 0 0 1 * ?"/>
</bean>
<!--analysisJob-->
<bean name="analysisJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="pwc.taxtech.atms.common.schedule.AnalysisJob"/>
......
......@@ -10,7 +10,9 @@ import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Auther: Gary J Li
......@@ -76,23 +78,24 @@ public class AnalysisTest extends CommonIT {
analysisJobService.analysisSales(orgs,period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisTaxReturnEnd(){
public void analysisTax(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisTax(){
public void analysisTaxReturnEnd(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
}
}
......@@ -105,4 +105,6 @@ public interface CitAssetEamMappingMapper extends MyMapper {
* @mbg.generated
*/
int updateByPrimaryKey(CitAssetEamMapping record);
int insertBatch(List<CitAssetEamMapping> citAssetEamMappings);
}
\ No newline at end of file
......@@ -63,7 +63,7 @@
<!--@Html.AntiForgeryToken()-->
<div class="wrapper">
<app-nav></app-nav>
<div class="page-wrapper" style="position:relative;overflow:scroll;margin-top:55px">
<div class="page-wrapper" style="position:relative;overflow-x:hidden;overflow-y:auto;margin-top:55px">
<div class="main-contents" ui-view></div>
<div class="data-import-contents" ui-view="importContent"></div><!--style="display: none"-->
</div>
......
......@@ -310,7 +310,7 @@
dataField: "companyName",
width: '28%',
allowHeaderFiltering: false,
caption: $translate.instant('CompanySimpleName')
caption: $translate.instant('CompanyName')
}, {
dataField: "segment1",
allowHeaderFiltering: false,
......@@ -411,7 +411,7 @@
dataField: "companyName",
width: '25%',
allowHeaderFiltering: false,
caption: $translate.instant('CompanySimpleName')
caption: $translate.instant('CompanyName')
}, {
dataField: "segment1",
allowHeaderFiltering: false,
......
......@@ -29,7 +29,7 @@
</li>
</ul>
</div>
<span class="text-bold" translate="Period"></span>:
<span class="text-bold" style="margin-left: 39px;" translate="Period"></span>:
<div class="period-picker" style="margin-left:10px; width:141px;">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style=" width: 111px;"
readonly="readonly" ng-model="UploadPeriodTime"/>
......
......@@ -2940,7 +2940,6 @@
}).error(function (error) {
});*/
calculateEbitAndInsert($scope.relation.sheet, true);
spreadTODb();
}
var spreadTODb = function (front) {
......@@ -2948,7 +2947,8 @@
SweetAlert.error("请选择机构");
return;
}
var json = $scope.spread.toJSON({includeBindingSource: true});
//{includeBindingSource: true}
var json = $scope.spread.toJSON({includeBindingSource: true});
var excelIo = new GC.Spread.Excel.IO();
var url = apiInterceptor.webApiHostUrl + '/Report/spreadToDb?orgId=' + $scope.relation.orgId + "&period=" + $scope.relation.period;
//var apiTokenObj = JSON.parse(getCookie('AtmsApiToken'));
......@@ -2997,6 +2997,8 @@
return;
}
file = file[0];
// 转圈圈
$('#busy-indicator-container').show();
frontImport(file);//前端导入
/*if(file.length == 0)
return
......@@ -3074,8 +3076,7 @@
if ($scope.spread != undefined && $scope.spread) {
var excelIo = new GC.Spread.Excel.IO();
excelIo.open(file, function (json) {
var workbookObj = json;
$scope.spread.fromJSON(workbookObj);
$scope.spread.fromJSON(json);
var sheet = $scope.spread.sheets[0];
$scope.relation.sheet = $scope.spread.sheets[0];
/*vatReportService.saveAndRefresh($scope.relation.orgId, $scope.relation.period, 0, "1").success(function (res) {
......@@ -3089,7 +3090,10 @@
$scope.relation.addEbitRow(sheet);
calculateEbitAndInsert(sheet, true);
$scope.relation.lockCell($scope.spread);
$('#busy-indicator-container').hide();
//关闭弹出层
spreadTODb(true);
}, function (e) {
alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
......@@ -3134,7 +3138,7 @@
$scope._ebitResult.rate = rate;
$scope._ebitResult.gljyye = Number(((rate/ 100) * $scope._ebitResult.kltsys).toFixed(4));
$scope._ebitResult.sixAddtax = Number((0.06 * $scope._ebitResult.gljyye).toFixed(4));
$scope._ebitResult.tsklys = Number(($scope._ebitResult.gljyye * 0.106).toFixed(4));
$scope._ebitResult.tsklys = Number(($scope._ebitResult.gljyye * 1.06).toFixed(4));
if (insert) {
sheet.setValue(37, 2, $scope._ebitResult.klzcjsz);
sheet.setValue(38, 2, $scope._ebitResult.tsyskl);
......
......@@ -33,7 +33,7 @@
</div>
</div>
</div>
<div class="col-sm-5 bar-export navRight" style=" margin-top: 20px;width: 30%; float: right;">
<div class="col-sm-5 bar-export navRight" style=" margin-top: 20px;width: 38%; float: right;">
<span ngf-select="" ngf-change="upload($files)" accept=".xls,.xlsx" ngf-multiple="false"
ngf-allow-dir="false" class="" ><i class="fa fa-file">&nbsp;{{'uploadProfileTable' | translate}}</i></span>
<span ng-click="saveAndRefresh()"><i class="fa fa-refresh"></i>&nbsp;{{'saveAndRefresh' | translate}}</span>
......@@ -51,8 +51,7 @@
</table-report-sheet>
<form name="myform" style="disply:none;" id="myform" enctype="multipart/form-data" method="post">
    
   </form>
</form>
<a href="#" id = "a"></a>
</div>
</div>
\ No newline at end of file
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