Commit fbc42d8b authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents bf9b83cb e59e12bc
......@@ -432,7 +432,7 @@
<profiles>
<profile>
<id>dev</id>
<activation>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
......@@ -444,6 +444,8 @@
<env>dev</env>
</properties>
</profile>
<profile>
<id>staging</id>
<build>
......
......@@ -61,7 +61,6 @@ public class AnalysisJob extends QuartzJobBean {
logger.info(String.format("开始分析%税种税金计算数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
}
}
......@@ -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.*;
......@@ -16,6 +15,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.analysis.dao.*;
import pwc.taxtech.atms.analysis.entity.*;
......@@ -35,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;
......@@ -98,6 +99,7 @@ public class AnalysisJobServiceImpl extends BaseService {
private final static List<Integer> MONTH_LIST = Lists.newArrayList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
private final static List<Integer> Q_LIST = Lists.newArrayList(3, 6, 9, 12);
private final static List<Integer> ZZS_DATE_LIST = Lists.newArrayList(1, 4, 7, 10);
/**
......@@ -110,6 +112,7 @@ public class AnalysisJobServiceImpl extends BaseService {
* @author Gary J Li
*/
public void analysisMaster(List<Organization> orgs, Integer period, Integer type) {
List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList());
if (type.equals(EnumTbImportType.CoverImport.getCode())) {
AnalysisMasterExample example = new AnalysisMasterExample();
......@@ -535,7 +538,6 @@ public class AnalysisJobServiceImpl extends BaseService {
*/
public void analysisExpectedTax(List<Organization> orgs, Integer period, Integer type) {
List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList());
if (type.equals(EnumTbImportType.CoverImport.getCode())) {
AnalysisExpectedTaxReturnExample example = new AnalysisExpectedTaxReturnExample();
example.createCriteria().andOrganizationIdIn(orgIds).andPeriodEqualTo(period);
......@@ -553,7 +555,7 @@ public class AnalysisJobServiceImpl extends BaseService {
atMap.forEach((k, v) -> {
try {
List<OrganizationReturnRate> orgsOrr = orrs.stream().filter(orr -> orr.getOrganizationId().equals(k)).collect(Collectors.toList());
//List<OrganizationReturnRate> orgsOrr = orrs.stream().filter(orr -> orr.getOrganizationId().equals(k)).collect(Collectors.toList());
Map<String, List<OrganizationReturnRate>> orgOrrMap = orrs.stream().collect(Collectors.groupingBy(OrganizationReturnRate::getGroupName));
AnalysisExpectedTaxReturn aetr = new AnalysisExpectedTaxReturn();
aetr.setId(idService.nextId());
......@@ -561,13 +563,19 @@ public class AnalysisJobServiceImpl extends BaseService {
for (AnalysisTax at : v) {
if ("增值税".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment1(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate()));
} else if ("附加税".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment2(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate()));
aetr.setSegment1(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate() / 100));
} else if ("个人所得税".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment2(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate()));
aetr.setSegment3(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate() / 100));
} else if ("教育费附加".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment4(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate() / 100));
} else if ("城市教育费附加".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment5(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate() / 100));
} else if ("城建税".equals(at.getTaxGroup()) && orgOrrMap.get(at.getTaxGroup()) != null) {
OrganizationReturnRate orr = orgOrrMap.get(at.getTaxGroup()).get(0);
aetr.setSegment6(new BigDecimal(at.getTaxAmount().floatValue() * orr.getReturnRate() / 100));
}
}
aetr.setOrganizationId(k);
......@@ -611,19 +619,20 @@ public class AnalysisJobServiceImpl extends BaseService {
Organization org = orgMap.get(k);
String subjectCode = tb.getSegment3();
af.setSeqNo(getSeqNoByPeriod(tb.getOrganizationId(), period));
af.setSubject(subjectCode);
af.setFeeClassification1(tb.getAcctName1());
af.setFeeClassification2(tb.getAcctName2());
af.setFeeClassification3(tb.getAcctName3());
// 这里费用取的 本位币本期借方发生额
af.setFee(tb.getPeriodDrBeq());
String interrelatedDeal = "";
if (subjectCode == "60050100") return;
if (subjectCode.startsWith("6")) {
// 这里取得公司间代码是否为0
interrelatedDeal = "0".equals(tb.getSegment8()) ? "否" : "是";
} else if (subjectCode.startsWith("8")) {
} else if (subjectCode.startsWith("8002")) {
interrelatedDeal = "是";
}
af.setSubject(subjectCode.substring(-2) + "00");
af.setInterrelatedDeal(interrelatedDeal);
af.setOrganizationId(org.getId());
af.setCompanyName(org.getName());
......@@ -633,6 +642,7 @@ public class AnalysisJobServiceImpl extends BaseService {
});
}
/**
* 19/03/2019 15:59
* tax_document
......@@ -641,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);
......@@ -659,20 +669,20 @@ public class AnalysisJobServiceImpl extends BaseService {
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;
}
......@@ -698,7 +708,7 @@ public class AnalysisJobServiceImpl extends BaseService {
archivingStatus = taxDocumentMapper.countByExample(example) > 0 ? "已归档" : archivingStatus;
}
afm.setArchivingStatus(archivingStatus);
} else {
}else{
afm.setReportingFrequency("/");
// 由于是根据文档列表查询 必然已归档
afm.setArchivingStatus("已归档");
......@@ -710,6 +720,16 @@ public class AnalysisJobServiceImpl extends BaseService {
}
}
@Autowired
private JdbcTemplate jdbcTemplate;
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;
}
public void analysisTax(List<Organization> orgs, Integer period, Integer type) {
List<String> orgIds = orgs.stream().map(Organization::getId).collect(Collectors.toList());
......@@ -765,7 +785,7 @@ public class AnalysisJobServiceImpl extends BaseService {
values.forEach(v -> {
vMap.put(v.getRowIndex() + ":" + v.getColumnIndex(), v.getData());
});
BigDecimal zzse = getSegmentAmount(vMap, 42, 35).add(getSegmentAmount(vMap, 42, 18));
BigDecimal zzse = getSegmentAmount(vMap, 24, 10);
analysisTaxMapper.insertSelective(as);
} catch (Exception e) {
logger.error(String.format("公司:[%s]生成应缴税额表分析数据失败!", o.getName()), e);
......@@ -776,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;
}
}
}
}
......@@ -1244,33 +1244,35 @@ public class CitReportServiceImpl extends BaseService {
cellData.setFormulaExp(data.getAmount().toString());
}
cellData.setData(sumValue);
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
cellData.setUpdateTime(new Date());
int i = periodCellDataMapper.updateByPrimaryKeySelective(cellData);
/*kevin insert */ // TODO: 3/21/2019 需要验证
// PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
// PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
// criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
// criteria.andProjectIdEqualTo(data.getProjectId());
// PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
// periodCellTemplateConfig.setParsedFormula(sumValue);
// periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
// //更改选中行相关数据
// CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
// citJournalEntryAdjust.setIsSelect("1");
// CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample();
// CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria();
// criteria1.andProjectIdEqualTo(data.getProjectId());
// criteria1.andSubjectCodeEqualTo(data.getAccountCode());
// citJournalEntryAdjustMapper.updateByExample(citJournalEntryAdjust, example1);
//
// JournalEntry journalEntry = new JournalEntry();
// journalEntry.setIsSelect("1");
// JournalEntryExample example2 = new JournalEntryExample();
// JournalEntryExample.Criteria criteria2 = example2.createCriteria();
// criteria2.andProjectIdEqualTo(data.getProjectId());
// criteria2.andSegment3EqualTo(data.getAccountCode());
// journalEntryMapper.updateByExample(journalEntry, example2);
if(sumValue !=null){
PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
criteria.andProjectIdEqualTo(data.getProjectId());
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setParsedFormula(sumValue);
periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
//更改选中行相关数据
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setIsSelect("1");
CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample();
CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria();
criteria1.andProjectIdEqualTo(data.getProjectId());
criteria1.andSubjectCodeEqualTo(data.getAccountCode());
citJournalEntryAdjustMapper.updateByExampleSelective(citJournalEntryAdjust, example1);
JournalEntry journalEntry = new JournalEntry();
journalEntry.setIsSelect("1");
JournalEntryExample example2 = new JournalEntryExample();
JournalEntryExample.Criteria criteria2 = example2.createCriteria();
criteria2.andProjectIdEqualTo(data.getProjectId());
criteria2.andSegment3EqualTo(data.getAccountCode());
journalEntryMapper.updateByExampleSelective(journalEntry, example2);
}
}
List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
......
......@@ -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;
......@@ -1613,7 +1614,7 @@ public class ReportServiceImpl extends BaseService {
ebitDataDto.setEbitRate(ebitRate + "%");
}
ebitDataDto.setSixAddTax(ebitDataDto.getTransactionAmount().multiply(new BigDecimal(0.06)));
ebitDataDto.setTotalAmountTax(ebitDataDto.getTransactionAmount().multiply(new BigDecimal(0.16)));
ebitDataDto.setTotalAmountTax(ebitDataDto.getTransactionAmount().multiply(new BigDecimal(1.06)));
ebitDataDto.setSpecialConsiderations(specialConsiderations);
} catch (Exception e) {
e.printStackTrace();
......@@ -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());
}
}
}
......
......@@ -13,10 +13,12 @@
<property name="queueCapacity" value="100"/>
</bean>
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- quartzScheduler -->
<!-- 配置调度任务-->
<bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="configLocation" value="classpath:job.properties"/>
......@@ -49,45 +51,52 @@
<property name="taskExecutor" ref="executor"/>
</bean>
<!-- 配置Job详情 -->
<!-- lgGlBalanceJob -->
<bean name="lgGlBalanceJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="pwc.taxtech.atms.common.schedule.LgGlBalanceJob"/>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="false"/>
<property name="description" value="科目余额数据同步"/>
</bean>
<!-- 定时任务 -->
<bean id="lgApiJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="lgGlBalanceJob"/>
<property name="cronExpression" value="0 0 1 3 * ?"/>
</bean>
<!--orgSyncJob-->
<bean name="orgSyncJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="pwc.taxtech.atms.common.schedule.OrgSyncJob"/>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="false"/>
<property name="description" value="机构信息同步"/>
</bean>
<!-- 每月1日执行一次-->
<bean id="orgSyncJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="orgSyncJob"/>
<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"/>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="false"/>
<property name="description" value="分析模块"/>
</bean>
<!-- 每月1日执行一次-->
<bean id="orgSyncJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="orgSyncJob"/>
<property name="cronExpression" value="0 0 0 1 * ?"/>
</bean>
<!-- 每天凌晨一点执行一次-->
<bean id="analysisJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="analysisJob"/>
<property name="cronExpression" value="0 0 1 * * ?"/>
</bean>
<!-- 分布式事务配置 end -->
</beans>
\ No newline at end of file
......@@ -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());
}
}
......@@ -41,11 +41,10 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyAnalysisMapper" />
</javaClientGenerator>
<table tableName="analysis_tax_return_end" domainObjectName="AnalysisTaxReturnEnd">
<table tableName="analysis_expected_tax_return" domainObjectName="AnalysisExpectedTaxReturn">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<!--
<table tableName="analysis_actual_tax_return" domainObjectName="AnalysisInternationalTaxData">
<property name="useActualColumnNames" value="false"/>
......
......@@ -41,7 +41,7 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyMapper"/>
</javaClientGenerator>
<table tableName="cit_asset_eam_mapping" domainObjectName="CitAssetEamMapping">
<table tableName="analysis_expected_tax_return" domainObjectName="AnalysisExpectedTaxReturn">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
......
package pwc.taxtech.atms.analysis.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyAnalysisMapper;
import pwc.taxtech.atms.analysis.entity.AnalysisFileManagement;
......@@ -105,4 +105,6 @@ public interface AnalysisFileManagementMapper extends MyAnalysisMapper {
* @mbg.generated
*/
int updateByPrimaryKey(AnalysisFileManagement record);
@Select("#{sql}")
List<AnalysisFileManagement> getYHSsql(@Param("sql") String sql );
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ public class AnalysisExpectedTaxReturn extends BaseEntity implements Serializabl
/**
* Database Column Remarks:
* 预期返还后增值税 预期返还后增值税_ 管理模块 应返还税金自动根据系统管理模块设置的增值税返还率计算。 5685.63
* 预期返还后税额 管理模块 应返还税金自动根据系统管理模块设置的增值税返还率计算。 5685.63
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column analysis_expected_tax_return.segment_1
......@@ -68,6 +68,39 @@ public class AnalysisExpectedTaxReturn extends BaseEntity implements Serializabl
*/
private BigDecimal segment3;
/**
* Database Column Remarks:
* 预期返还后教育费附加
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column analysis_expected_tax_return.segment_4
*
* @mbg.generated
*/
private BigDecimal segment4;
/**
* Database Column Remarks:
* 预期返还后城市教育费附加
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column analysis_expected_tax_return.segment_5
*
* @mbg.generated
*/
private BigDecimal segment5;
/**
* Database Column Remarks:
* 预期返还后城建税
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column analysis_expected_tax_return.segment_6
*
* @mbg.generated
*/
private BigDecimal segment6;
/**
* Database Column Remarks:
* 创建时间
......@@ -251,6 +284,78 @@ public class AnalysisExpectedTaxReturn extends BaseEntity implements Serializabl
this.segment3 = segment3;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column analysis_expected_tax_return.segment_4
*
* @return the value of analysis_expected_tax_return.segment_4
*
* @mbg.generated
*/
public BigDecimal getSegment4() {
return segment4;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column analysis_expected_tax_return.segment_4
*
* @param segment4 the value for analysis_expected_tax_return.segment_4
*
* @mbg.generated
*/
public void setSegment4(BigDecimal segment4) {
this.segment4 = segment4;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column analysis_expected_tax_return.segment_5
*
* @return the value of analysis_expected_tax_return.segment_5
*
* @mbg.generated
*/
public BigDecimal getSegment5() {
return segment5;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column analysis_expected_tax_return.segment_5
*
* @param segment5 the value for analysis_expected_tax_return.segment_5
*
* @mbg.generated
*/
public void setSegment5(BigDecimal segment5) {
this.segment5 = segment5;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column analysis_expected_tax_return.segment_6
*
* @return the value of analysis_expected_tax_return.segment_6
*
* @mbg.generated
*/
public BigDecimal getSegment6() {
return segment6;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column analysis_expected_tax_return.segment_6
*
* @param segment6 the value for analysis_expected_tax_return.segment_6
*
* @mbg.generated
*/
public void setSegment6(BigDecimal segment6) {
this.segment6 = segment6;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column analysis_expected_tax_return.create_time
......@@ -388,6 +493,9 @@ public class AnalysisExpectedTaxReturn extends BaseEntity implements Serializabl
sb.append(", segment1=").append(segment1);
sb.append(", segment2=").append(segment2);
sb.append(", segment3=").append(segment3);
sb.append(", segment4=").append(segment4);
sb.append(", segment5=").append(segment5);
sb.append(", segment6=").append(segment6);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", organizationId=").append(organizationId);
......
......@@ -506,6 +506,186 @@ public class AnalysisExpectedTaxReturnExample {
return (Criteria) this;
}
public Criteria andSegment4IsNull() {
addCriterion("segment_4 is null");
return (Criteria) this;
}
public Criteria andSegment4IsNotNull() {
addCriterion("segment_4 is not null");
return (Criteria) this;
}
public Criteria andSegment4EqualTo(BigDecimal value) {
addCriterion("segment_4 =", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4NotEqualTo(BigDecimal value) {
addCriterion("segment_4 <>", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4GreaterThan(BigDecimal value) {
addCriterion("segment_4 >", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4GreaterThanOrEqualTo(BigDecimal value) {
addCriterion("segment_4 >=", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4LessThan(BigDecimal value) {
addCriterion("segment_4 <", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4LessThanOrEqualTo(BigDecimal value) {
addCriterion("segment_4 <=", value, "segment4");
return (Criteria) this;
}
public Criteria andSegment4In(List<BigDecimal> values) {
addCriterion("segment_4 in", values, "segment4");
return (Criteria) this;
}
public Criteria andSegment4NotIn(List<BigDecimal> values) {
addCriterion("segment_4 not in", values, "segment4");
return (Criteria) this;
}
public Criteria andSegment4Between(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_4 between", value1, value2, "segment4");
return (Criteria) this;
}
public Criteria andSegment4NotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_4 not between", value1, value2, "segment4");
return (Criteria) this;
}
public Criteria andSegment5IsNull() {
addCriterion("segment_5 is null");
return (Criteria) this;
}
public Criteria andSegment5IsNotNull() {
addCriterion("segment_5 is not null");
return (Criteria) this;
}
public Criteria andSegment5EqualTo(BigDecimal value) {
addCriterion("segment_5 =", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5NotEqualTo(BigDecimal value) {
addCriterion("segment_5 <>", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5GreaterThan(BigDecimal value) {
addCriterion("segment_5 >", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5GreaterThanOrEqualTo(BigDecimal value) {
addCriterion("segment_5 >=", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5LessThan(BigDecimal value) {
addCriterion("segment_5 <", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5LessThanOrEqualTo(BigDecimal value) {
addCriterion("segment_5 <=", value, "segment5");
return (Criteria) this;
}
public Criteria andSegment5In(List<BigDecimal> values) {
addCriterion("segment_5 in", values, "segment5");
return (Criteria) this;
}
public Criteria andSegment5NotIn(List<BigDecimal> values) {
addCriterion("segment_5 not in", values, "segment5");
return (Criteria) this;
}
public Criteria andSegment5Between(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_5 between", value1, value2, "segment5");
return (Criteria) this;
}
public Criteria andSegment5NotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_5 not between", value1, value2, "segment5");
return (Criteria) this;
}
public Criteria andSegment6IsNull() {
addCriterion("segment_6 is null");
return (Criteria) this;
}
public Criteria andSegment6IsNotNull() {
addCriterion("segment_6 is not null");
return (Criteria) this;
}
public Criteria andSegment6EqualTo(BigDecimal value) {
addCriterion("segment_6 =", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6NotEqualTo(BigDecimal value) {
addCriterion("segment_6 <>", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6GreaterThan(BigDecimal value) {
addCriterion("segment_6 >", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6GreaterThanOrEqualTo(BigDecimal value) {
addCriterion("segment_6 >=", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6LessThan(BigDecimal value) {
addCriterion("segment_6 <", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6LessThanOrEqualTo(BigDecimal value) {
addCriterion("segment_6 <=", value, "segment6");
return (Criteria) this;
}
public Criteria andSegment6In(List<BigDecimal> values) {
addCriterion("segment_6 in", values, "segment6");
return (Criteria) this;
}
public Criteria andSegment6NotIn(List<BigDecimal> values) {
addCriterion("segment_6 not in", values, "segment6");
return (Criteria) this;
}
public Criteria andSegment6Between(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_6 between", value1, value2, "segment6");
return (Criteria) this;
}
public Criteria andSegment6NotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("segment_6 not between", value1, value2, "segment6");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
......
......@@ -105,7 +105,6 @@ public interface CitAssetEamMappingMapper extends MyMapper {
* @mbg.generated
*/
int updateByPrimaryKey(CitAssetEamMapping record);
int insertBatch(List<CitAssetEamMapping> citAssetEamMappings);
}
\ No newline at end of file
......@@ -11,6 +11,9 @@
<result column="segment_1" jdbcType="DECIMAL" property="segment1" />
<result column="segment_2" jdbcType="DECIMAL" property="segment2" />
<result column="segment_3" jdbcType="DECIMAL" property="segment3" />
<result column="segment_4" jdbcType="DECIMAL" property="segment4" />
<result column="segment_5" jdbcType="DECIMAL" property="segment5" />
<result column="segment_6" jdbcType="DECIMAL" property="segment6" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
......@@ -88,8 +91,8 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, seq_no, segment_1, segment_2, segment_3, create_time, update_time, organization_id,
company_name, period
id, seq_no, segment_1, segment_2, segment_3, segment_4, segment_5, segment_6, create_time,
update_time, organization_id, company_name, period
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.analysis.entity.AnalysisExpectedTaxReturnExample" resultMap="BaseResultMap">
<!--
......@@ -143,11 +146,13 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into analysis_expected_tax_return (id, seq_no, segment_1,
segment_2, segment_3, create_time,
segment_2, segment_3, segment_4,
segment_5, segment_6, create_time,
update_time, organization_id, company_name,
period)
values (#{id,jdbcType=BIGINT}, #{seqNo,jdbcType=VARCHAR}, #{segment1,jdbcType=DECIMAL},
#{segment2,jdbcType=DECIMAL}, #{segment3,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
#{segment2,jdbcType=DECIMAL}, #{segment3,jdbcType=DECIMAL}, #{segment4,jdbcType=DECIMAL},
#{segment5,jdbcType=DECIMAL}, #{segment6,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{organizationId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER})
</insert>
......@@ -173,6 +178,15 @@
<if test="segment3 != null">
segment_3,
</if>
<if test="segment4 != null">
segment_4,
</if>
<if test="segment5 != null">
segment_5,
</if>
<if test="segment6 != null">
segment_6,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -205,6 +219,15 @@
<if test="segment3 != null">
#{segment3,jdbcType=DECIMAL},
</if>
<if test="segment4 != null">
#{segment4,jdbcType=DECIMAL},
</if>
<if test="segment5 != null">
#{segment5,jdbcType=DECIMAL},
</if>
<if test="segment6 != null">
#{segment6,jdbcType=DECIMAL},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -254,6 +277,15 @@
<if test="record.segment3 != null">
segment_3 = #{record.segment3,jdbcType=DECIMAL},
</if>
<if test="record.segment4 != null">
segment_4 = #{record.segment4,jdbcType=DECIMAL},
</if>
<if test="record.segment5 != null">
segment_5 = #{record.segment5,jdbcType=DECIMAL},
</if>
<if test="record.segment6 != null">
segment_6 = #{record.segment6,jdbcType=DECIMAL},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
......@@ -285,6 +317,9 @@
segment_1 = #{record.segment1,jdbcType=DECIMAL},
segment_2 = #{record.segment2,jdbcType=DECIMAL},
segment_3 = #{record.segment3,jdbcType=DECIMAL},
segment_4 = #{record.segment4,jdbcType=DECIMAL},
segment_5 = #{record.segment5,jdbcType=DECIMAL},
segment_6 = #{record.segment6,jdbcType=DECIMAL},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
......@@ -313,6 +348,15 @@
<if test="segment3 != null">
segment_3 = #{segment3,jdbcType=DECIMAL},
</if>
<if test="segment4 != null">
segment_4 = #{segment4,jdbcType=DECIMAL},
</if>
<if test="segment5 != null">
segment_5 = #{segment5,jdbcType=DECIMAL},
</if>
<if test="segment6 != null">
segment_6 = #{segment6,jdbcType=DECIMAL},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -341,6 +385,9 @@
segment_1 = #{segment1,jdbcType=DECIMAL},
segment_2 = #{segment2,jdbcType=DECIMAL},
segment_3 = #{segment3,jdbcType=DECIMAL},
segment_4 = #{segment4,jdbcType=DECIMAL},
segment_5 = #{segment5,jdbcType=DECIMAL},
segment_6 = #{segment6,jdbcType=DECIMAL},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
organization_id = #{organizationId,jdbcType=VARCHAR},
......
......@@ -923,6 +923,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.isSelect != null">
is_select = #{record.isSelect,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=/OrangeHeap/
\ 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*/) {
......@@ -3117,7 +3121,6 @@
var glfy = nullToZero(sheet.getValue(15, 2));//管理费用
var yffy = nullToZero(sheet.getValue(16, 2));//研发费用
var zcjzss = nullToZero(sheet.getValue(18, 2));//资产减值损失
var ts = nullToZero(sheet.getValue(38, 2));
var rate = 1;
if(sheet.getValue(40, 2) != null){
......@@ -3135,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
vatModule.controller('citCalculateDataController', ['$scope', '$log', '$timeout','$interval', '$q', '$translate', 'loginContext',
vatModule.controller('citCalculateDataController', ['$scope', '$log', '$timeout', '$interval', '$q', '$translate', 'loginContext',
'apiInterceptor', 'Upload', 'dataImportService', 'SweetAlert', 'vatReductionService', 'vatSessionService', 'uiGridConstants',
'enums', 'modelConfigurationService', 'citReportService', 'vatCommonService', 'BSPLService', 'vatOperationLogService',
'vatWorkflowService',
......@@ -15,7 +15,7 @@
var initTasks = function () {
var task = function (id, status, name,code) {
var task = function (id, status, name, code) {
this.id = id;
this.name = _.isEmpty(name) ? $translate.instant(id) : name;
this.status = status;
......@@ -123,25 +123,25 @@
// $scope.isMergeManualDataSource ).success(function (data) {
// var data = {result: true};
// updateProgress(data, _this);
//citReportService.getTemplateReferences(vatSessionService.month).then(function (refData) {
// if (refData && refData.data) {
// // 初始化resolve列表
// var newRefData = _.chain(refData.data).reject(function (x) {
// return _.isEmpty(x.referenceFromTemplateID) || _.isEmpty(x.referenceToTemplateID);
// }).map(function (x) {
// return {
// referFrom: x.referenceFromTemplateID,
// referTo: x.referenceToTemplateID,
// resolved: x.isResolved
// };
// }).value();
// $scope.resolveRef.push.apply($scope.resolveRef, newRefData);
// }
// return $q.when(data);
//}).then(function () {
// updateProgress(data, _this);
//});
//citReportService.getTemplateReferences(vatSessionService.month).then(function (refData) {
// if (refData && refData.data) {
// // 初始化resolve列表
// var newRefData = _.chain(refData.data).reject(function (x) {
// return _.isEmpty(x.referenceFromTemplateID) || _.isEmpty(x.referenceToTemplateID);
// }).map(function (x) {
// return {
// referFrom: x.referenceFromTemplateID,
// referTo: x.referenceToTemplateID,
// resolved: x.isResolved
// };
// }).value();
// $scope.resolveRef.push.apply($scope.resolveRef, newRefData);
// }
// return $q.when(data);
//}).then(function () {
// updateProgress(data, _this);
//});
// }).error(function () {
//
// taskError(_this);
......@@ -181,8 +181,7 @@
updateProgress(data, _this, false);
}, 2000);
});
}
else {
} else {
citReportService.generateAllCitReport(vatSessionService.project.id, true, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
updateProgress(data, _this);
}).error(function () {
......@@ -196,7 +195,7 @@
task.prototype.id = null;
task.prototype.status = null;
task.prototype.text = null;
task.prototype.code =null;
task.prototype.code = null;
citReportService.getCitTemplate(vatSessionService.project.id, constant.serviceType.CIT).then(function (report) {
......@@ -204,12 +203,17 @@
// result.push({ name: $translate.instant('ProcessData'), items: [new task('GenerateStdTb', 'unstarted')] });
// result.push({ name: $translate.instant('ProcessData'), items: [new task('CompareUnbilled', 'unstarted')] });
// result.push({ name: $translate.instant('ProcessData'), items: [new task('CaculateUnbilled', 'unstarted'), new task('UpdateReportConfig', 'unstarted'), new task('GenerateFinanceReport', 'unstarted')] });
/* var dataValidateItems = [/!*"本期余额表累计数+导入调整表是否等于本期利润表累计数", "本期余额表本期数+导入调整表是否等于本期利润表本期数", "上期利润表本年累进+本期利润表本期数是否等于本期利润表本年累计",*!/ ""];
var dataValidateCode = [/!*'DA001', 'DA002', 'DA003',*!/ ''];*/
/* var dataValidateItems = [/!*"本期余额表累计数+导入调整表是否等于本期利润表累计数", "本期余额表本期数+导入调整表是否等于本期利润表本期数", "上期利润表本年累进+本期利润表本期数是否等于本期利润表本年累计",*!/ ""];
var dataValidateCode = [/!*'DA001', 'DA002', 'DA003',*!/ ''];*/
//数据配置
result.push({ name: $translate.instant('ProcessData'), items: [new task('UpdateReportConfig', 'unstarted',"","UpdateConfig")] });
result[result.length - 1].items.forEach(function (t) { t.seqNo = result.length - 1 });
result.push({
name: $translate.instant('ProcessData'),
items: [new task('UpdateReportConfig', 'unstarted', "", "UpdateConfig")]
});
result[result.length - 1].items.forEach(function (t) {
t.seqNo = result.length - 1
});
//数据校验
// var reItem = [];
......@@ -248,7 +252,7 @@
i++;
taskList = taskList.concat(item.items);
});
$scope.tasks = result;
getInitTaskStatus();
});
......@@ -287,52 +291,52 @@
// });
}
function doStartCaculate2(isMergeManualDataSource) {
citReportService.generateAllCitReport(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
$scope.readonly = true;
if(data && data.result)
updateTasksStatus(data.data);
if(data.data.jobStatus=='Begin'||data.data.jobStatus=='Running'){
if(!$scope.timer)
$scope.timer= $interval(function(){
citReportService.getJobStatus(vatSessionService.project.id,0,data.data.id).then(function(result){
if(result.data && result.status == 200){
updateTasksStatus(result.data);
}else{
if($scope.timer)
$interval.cancel($scope.timer);
}
});
function doStartCaculate2(isMergeManualDataSource) {
citReportService.generateAllCitReport(vatSessionService.project.id, isMergeManualDataSource, vatSessionService.logUser.id ? vatSessionService.logUser.id : "").success(function (data) {
},1000);
}
}).error(function (data,status,config,statusText) {
if(status==412){
SweetAlert.error('报表提审中!');
}else if(status == 409){
SweetAlert.error('报表已在处理中!');
}
});
$scope.readonly = true;
if (data && data.result)
updateTasksStatus(data.data);
if (data.data.jobStatus == 'Begin' || data.data.jobStatus == 'Running') {
if (!$scope.timer)
$scope.timer = $interval(function () {
}
citReportService.getJobStatus(vatSessionService.project.id, 0, data.data.id).then(function (result) {
function isAllEnd(stepCode,status){
var statusList = JSON.parse(status);
var stepCodes = stepCode.split(",");
if (result.data && result.status == 200) {
updateTasksStatus(result.data);
} else {
if ($scope.timer)
$interval.cancel($scope.timer);
}
});
}
}, 1000);
}
}).error(function (data, status, config, statusText) {
if (status == 412) {
SweetAlert.error('报表提审中!');
} else if (status == 409) {
SweetAlert.error('报表已在处理中!');
}
});
}
function isAllEnd(stepCode, status) {
var statusList = JSON.parse(status);
var stepCodes = stepCode.split(",");
}
var startCaculate = function () {
debugger;
var a = vatSessionService.project.projectStatusList;
if (vatSessionService.project.projectStatusList[0] >= constant.ProjectStatusEnum.Generated) {
if (vatSessionService.project.projectStatusList[-1] >= constant.ProjectStatusEnum.Generated) {
swal({
title: "warning!",
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[vatSessionService.month])}),
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[-1])}),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
......@@ -378,60 +382,58 @@
}
};
var startCaculate2 = function () {
var a = vatSessionService.project.projectStatusList;
if (vatSessionService.project.projectStatusList[vatSessionService.month] >= constant.ProjectStatusEnum.Generated) {
swal({
title: "warning!",
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[vatSessionService.month])}),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#dd6b55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
citReportService.hasManualDataSource(vatSessionService.project.id, vatSessionService.month).then(function (hasManual) {
if (hasManual) {
setTimeout(function () {
swal({
title: "warning!",
text: "是否保留手工数据!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
doStartCaculate2(true);
} else {
doStartCaculate2(false);
}
});
}, 500);
} else {
doStartCaculate2(false);
}
});
}
else {
swal.close();
var startCaculate2 = function () {
debugger;
var a = vatSessionService.project.projectStatusList;
if (vatSessionService.project.projectStatusList[-1] >= constant.ProjectStatusEnum.Generated) {
swal({
title: "warning!",
text: $translate.instant('IsConfirmReCalcuate').formatObj({status: vatCommonService.getProjectStautsEnumDesc(vatSessionService.project.projectStatusList[-1])}),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#dd6b55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
citReportService.hasManualDataSource(vatSessionService.project.id, 0).then(function (hasManual) {
if (hasManual) {
setTimeout(function () {
swal({
title: "warning!",
text: "是否保留手工数据!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('Yes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
doStartCaculate2(true);
} else {
doStartCaculate2(false);
}
});
}, 500);
} else {
doStartCaculate2(false);
}
});
}
else {
doStartCaculate2(false);
}
};
});
} else {
swal.close();
}
});
} else {
doStartCaculate2(false);
}
};
var caculateProgress = function (task) {
......@@ -462,20 +464,19 @@
if (!_.isEmpty($scope.resolveRef)) {
readyTasks = _.reject($scope.tasks[task.seqNo + 1].items, function (t) {
return _.some($scope.resolveRef, function (x) {
if($scope.tasks[task.seqNo + 1].isReportTask)isReport=true;
if ($scope.tasks[task.seqNo + 1].isReportTask) isReport = true;
return !x.resolved && x.referTo === t.id;
});
});
}
else {
} else {
readyTasks = $scope.tasks[task.seqNo + 1].items;
if($scope.tasks[task.seqNo + 1].isReportTask)isReport=true;
if ($scope.tasks[task.seqNo + 1].isReportTask) isReport = true;
}
readyTasks.forEach(function (t) {
if(isReport&&!isGenedAll){
t.doTask();
isGenedAll=true;
if (isReport && !isGenedAll) {
t.doTask();
isGenedAll = true;
}
t.status = 'processing';
......@@ -512,25 +513,24 @@
});
if (!$scope.readonly) {
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated
vatCommonService.setProjectStatus(vatSessionService.project.id, 0, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
}
};
var updateProgress = function (data, task, ifWriteLog) {
if (data && data.result) {
if( $scope.tasks[task.seqNo].isReportTask){
if ($scope.tasks[task.seqNo].isReportTask) {
$scope.tasks[task.seqNo].items.forEach(function (t) {
t.status = 'completed';
t.text = $translate.instant(t.status);
t.status = 'completed';
t.text = $translate.instant(t.status);
});
}else{
task.status = 'completed';
task.text = $translate.instant(task.status);
} else {
task.status = 'completed';
task.text = $translate.instant(task.status);
}
}
else {
} else {
task.status = 'error';
task.text = $translate.instant(task.status);
//SweetAlert.error($translate.instant('PleaseContactAdministrator'));
......@@ -560,8 +560,8 @@
logDto.ModuleID = $scope.moduleid;
logDto.CreatorID = vatSessionService.logUser.ID;
logDto.OperationObject = $translate.instant('vatCaculateDataDesc');
logDto.Comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
logDto.Period = vatSessionService.month;
logDto.Comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + 0 + "月";
logDto.Period = 0;
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
......@@ -573,74 +573,74 @@
vatOperationLogService.addOperationLog(logDto);
};
var updateTasksStatus = function(job){
var updateTasksStatus = function (job) {
var items = $scope.tasks;
var tasks = JSON.parse(job.status);
if(job.jobStatus == 'End'){
items.forEach(function(item,index){
item.status = 'completed';
item.text = $translate.instant('completed');
item.items.forEach(function (_task, index) {
tasks.forEach(function(task){
if(task.code==_task.code){
_task.status = 'completed';
_task.text = $translate.instant(_task.status);
if (job.jobStatus == 'End') {
items.forEach(function (item, index) {
item.status = 'completed';
item.text = $translate.instant('completed');
item.items.forEach(function (_task, index) {
tasks.forEach(function (task) {
if (task.code == _task.code) {
_task.status = 'completed';
_task.text = $translate.instant(_task.status);
}
})
})
});
if ($scope.timer) {
$interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, -1, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
}
} else if (job.jobStatus == 'Running' || job.jobStatus == 'Error') {
var updateConfig = tasks[0];
if (updateConfig.status == 'Error') {
$scope.tasks[0].items[0].status = 'error';
} else if (updateConfig.status == 'End') {
$scope.tasks[0].items[0].status = 'completed';
} else if (updateConfig.status == 'Begin') {
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text = $translate.instant($scope.tasks[0].items[0].status);
/* items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
}
})
})
});
if($scope.timer){
$interval.cancel($scope.timer);
vatCommonService.setProjectStatus(vatSessionService.project.id, -1, constant.ProjectStatusEnum.Generated
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
}
}else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
var updateConfig = tasks[0];
if(updateConfig.status == 'Error'){
$scope.tasks[0].items[0].status = 'error';
}else if(updateConfig.status == 'End'){
$scope.tasks[0].items[0].status = 'completed';
}else if(updateConfig.status == 'Begin'){
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text= $translate.instant($scope.tasks[0].items[0].status);
/* items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
item.text = $translate.instant(item.status);
}
item.text = $translate.instant(item.status);
}
})
});*/
if(job.jobStatus == 'Error'){
if($scope.timer)$interval.cancel($scope.timer);
})
});*/
if (job.jobStatus == 'Error') {
if ($scope.timer) $interval.cancel($scope.timer);
}
}
}
items.forEach(function (item, index) {
items.forEach(function(item,index){
item.items.forEach(function (_task, index) {
tasks.forEach(function(task){
if(task.code==_task.code){
if(task.status == 'Error'){
tasks.forEach(function (task) {
if (task.code == _task.code) {
if (task.status == 'Error') {
_task.status = 'error';
}else if(task.status == 'End'){
} else if (task.status == 'End') {
_task.status = 'completed';
}else if(task.status == 'Begin'){
} else if (task.status == 'Begin') {
_task.status = 'processing';
}
_task.text = $translate.instant(_task.status);
......@@ -650,34 +650,34 @@
});
}
var getInitTaskStatus = function(){
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) {
if(result.data && result.status == 200){
updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
if(!$scope.timer)
$scope.timer= $interval(function(){
citReportService.getJobStatus(vatSessionService.project.id,0,result.data.id)
.then(function(result){
if(result.data && result.status == 200){
updateTasksStatus(result.data);
}else{
if($scope.timer)
$interval.cancel($scope.timer);
}
});
},1000);
}
}else{
$log.debug("not running job");
}
var getInitTaskStatus = function () {
citReportService.getRunningJob(vatSessionService.project.id, 0).then(function (result) {
if (result.data && result.status == 200) {
updateTasksStatus(result.data);
if (result.data.jobStatus == 'Begin' || result.data.jobStatus == 'Running') {
if (!$scope.timer)
$scope.timer = $interval(function () {
citReportService.getJobStatus(vatSessionService.project.id, 0, result.data.id)
.then(function (result) {
if (result.data && result.status == 200) {
updateTasksStatus(result.data);
} else {
if ($scope.timer)
$interval.cancel($scope.timer);
}
});
}, 1000);
}
} else {
$log.debug("not running job");
}
});
}
}
var sendMessage = function (task) {
......@@ -708,8 +708,8 @@
initTasks();
$scope.startCaculate = startCaculate;
$scope.startCaculate2 = startCaculate2;
$scope.$on('$destroy',function(){
if($scope.timer)$interval.cancel($scope.timer);
$scope.$on('$destroy', function () {
if ($scope.timer) $interval.cancel($scope.timer);
});
})();
......
......@@ -897,7 +897,8 @@
};
$scope.exportReportTreeOptions = {
dataSource: [{id: '0', templateId: '0', name: '纳税申报表', items: [], expanded: true}],
dataSource: [{id: '0', templateId: '0', name: '纳税申报表', items: [], expanded: true},
{id: '1', templateId: '1', name: '工作底稿', items: [], expanded: true}],
displayExpr: 'name',
keyExpr: 'id',
selectionMode: 'Multiple',
......@@ -916,7 +917,7 @@
$scope.openExportPop = function (evenType) {
$scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType' || g.name == 'WorkingPaperType';
return g.name == 'TaxReturnType';
});
if (!grp || !grp.children) {
......@@ -928,6 +929,19 @@
return {id: item.reportId, templateId: item.id, name: item.name, parentId: '0'};
});
var grp2 = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'WorkingPaperType'
});
if (!grp2 || !grp2.children) {
return;
}
$scope.exportReportTreeOptions.dataSource[1].items = [];
$scope.exportReportTreeOptions.dataSource[1].items = _.map(grp2.children, function (item) {
return {id: item.reportId, templateId: item.id, name: item.name, parentId: '0'};
});
var parentElem = angular.element($('#exportReportFilesContainer'));
$scope.exportReportInstance = $uibModal.open({
ariaLabelledBy: 'modal-title',
......@@ -958,7 +972,7 @@
//批量导出EXCEL
$scope.export = function () {
debugger;
var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType';
});
......@@ -967,6 +981,14 @@
return;
}
var grp2 = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'WorkingPaperType'
});
if (!grp2 || !grp2.children) {
return;
}
if (!$scope.selectedReportIds || $scope.selectedReportIds.length == 0) {
SweetAlert.warning($translate.instant('ExportReportRequiredCheck'));
return;
......@@ -978,6 +1000,10 @@
item.orderIndex = orderIndex;
orderIndex++;
});
_.each(grp2.children, function (item) {
item.orderIndex = orderIndex;
orderIndex++;
});
var reportArray = $scope.selectedReportIds;
......@@ -996,7 +1022,10 @@
var node = _.first(_.where(grp.children, {reportId: currentVal}));
if (!node) {
return;
node = _.first(_.where(grp2.children, {reportId: currentVal}));
if (!node) {
return;
}
}
var reportPromiss = citReportService.getReportData(node.reportId).success(function (reportData) {
......
......@@ -1442,7 +1442,14 @@ constant.GroupTypeList = [
{code: 4, type: "教育费附加"},
{code: 5, type: "地方教育费附加"},
{code: 6, type: "个人所得税"},
{code: 7, type: "国际税"}
{code: 7, type: "水利建设基金"},
{code: 8, type: "文化事业建设费"},
{code: 9, type: "房产税"},
{code: 10, type: "城建土地使用税"},
{code: 11, type: "工会经费"},
{code: 12, type: "残疾人就业保障基金"},
{code: 13, type: "代扣代缴税费"},
{code: 14, type: "国际税"}
];
constant.InvoiceTypeList = [
......
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.cf16809e.css rel=preload as=style><link href=css/chunk-vendors.2f35f377.css rel=preload as=style><link href=js/app.7e09d0db.js rel=preload as=script><link href=js/chunk-vendors.39b13767.js rel=preload as=script><link href=css/chunk-vendors.2f35f377.css rel=stylesheet><link href=css/app.cf16809e.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.39b13767.js></script><script src=js/app.7e09d0db.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.cf16809e.css rel=preload as=style><link href=css/chunk-vendors.2f35f377.css rel=preload as=style><link href=js/app.c8b0fed0.js rel=preload as=script><link href=js/chunk-vendors.39b13767.js rel=preload as=script><link href=css/chunk-vendors.2f35f377.css rel=stylesheet><link href=css/app.cf16809e.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.39b13767.js></script><script src=js/app.c8b0fed0.js></script></body></html>
\ 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