Commit 36e42ede authored by sherlock's avatar sherlock

export order

parent e6927810
...@@ -65,30 +65,6 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -65,30 +65,6 @@ public class SpringContextUtil implements ApplicationContextAware {
return SpringContextUtil.webApplicationContext.getBean(requiredType); return SpringContextUtil.webApplicationContext.getBean(requiredType);
} }
public static AccountMappingMapper getAccountMappingMapper() {
return accountMappingMapper;
}
public static void setAccountMappingMapper(AccountMappingMapper accountMappingMapper) {
SpringContextUtil.accountMappingMapper = accountMappingMapper;
}
public static EnterpriseAccountSetOrgMapper getEnterpriseAccountSetOrgMapper() {
return enterpriseAccountSetOrgMapper;
}
public static void setEnterpriseAccountSetOrgMapper(EnterpriseAccountSetOrgMapper enterpriseAccountSetOrgMapper) {
SpringContextUtil.enterpriseAccountSetOrgMapper = enterpriseAccountSetOrgMapper;
}
public static GlBalanceMapper getGlBalanceMapper() {
return glBalanceMapper;
}
public static void setGlBalanceMapper(GlBalanceMapper glBalanceMapper) {
SpringContextUtil.glBalanceMapper = glBalanceMapper;
}
@Override @Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
webApplicationContext = applicationContext; webApplicationContext = applicationContext;
...@@ -127,5 +103,8 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -127,5 +103,8 @@ public class SpringContextUtil implements ApplicationContextAware {
cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class); cellDataSourceMapper = webApplicationContext.getBean(CellDataSourceMapper.class);
periodCellDataSourceMapper = webApplicationContext.getBean(PeriodCellDataSourceMapper.class); periodCellDataSourceMapper = webApplicationContext.getBean(PeriodCellDataSourceMapper.class);
organizationMapper = webApplicationContext.getBean(OrganizationMapper.class); organizationMapper = webApplicationContext.getBean(OrganizationMapper.class);
enterpriseAccountSetOrgMapper = webApplicationContext.getBean(EnterpriseAccountSetOrgMapper.class);
accountMappingMapper = webApplicationContext.getBean(AccountMappingMapper.class);
glBalanceMapper = webApplicationContext.getBean(GlBalanceMapper.class);
} }
} }
...@@ -73,16 +73,19 @@ public class DataImportService extends BaseService { ...@@ -73,16 +73,19 @@ public class DataImportService extends BaseService {
calendar.set(Calendar.MONTH, i - 1); calendar.set(Calendar.MONTH, i - 1);
GlBalanceExample example = new GlBalanceExample(); GlBalanceExample example = new GlBalanceExample();
//科目段 //科目段
example.createCriteria().andSegment1EqualTo(organization.getClientCode()) GlBalanceExample.Criteria c = example.createCriteria().andSegment1EqualTo(organization.getClientCode())
.andPeriodNameEqualTo(dateFormat.format(calendar.getTime())).andSegment3In(etCodeList); .andPeriodNameEqualTo(dateFormat.format(calendar.getTime()));
if(CollectionUtils.isNotEmpty(etCodeList)){
c.andSegment3In(etCodeList);
}
List<GlBalance> sg3List = glBalanceMapper.selectByExample(example); List<GlBalance> sg3List = glBalanceMapper.selectByExample(example);
GlBalanceExample example2 = new GlBalanceExample(); GlBalanceExample example2 = new GlBalanceExample();
//明细段 //明细段
GlBalanceExample.Criteria c = example2.createCriteria().andSegment1EqualTo(organization.getClientCode()) GlBalanceExample.Criteria c2 = example2.createCriteria().andSegment1EqualTo(organization.getClientCode())
.andPeriodNameEqualTo(dateFormat.format(calendar.getTime())); .andPeriodNameEqualTo(dateFormat.format(calendar.getTime()));
if(CollectionUtils.isNotEmpty(etCodeList)){ if(CollectionUtils.isNotEmpty(etCodeList)){
c.andSegment4In(etCodeList); c2.andSegment4In(etCodeList);
} }
List<GlBalance> sg4List = glBalanceMapper.selectByExample(example2); List<GlBalance> sg4List = glBalanceMapper.selectByExample(example2);
......
package pwc.taxtech.atms.vat.service.impl.report.functions; package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.grapecity.documents.excel.G;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
...@@ -39,7 +38,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -39,7 +38,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
+ year + "," + period + ")"; + year + "," + period + ")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
year = getIntParam(args[2], ec); year = getYear(year);
Integer yearOffset = 0; Integer yearOffset = 0;
period = FormulaHelper.getPeriod(period, yearOffset, formulaContext); period = FormulaHelper.getPeriod(period, yearOffset, formulaContext);
...@@ -62,12 +61,12 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -62,12 +61,12 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
for(AccountMapping a : accountMappings){ for(AccountMapping a : accountMappings){
result += count(a.getEnterpriseAccountCode()); result += count(a.getEnterpriseAccountCode());
} }
new NumberEval(result); return new NumberEval(result);
} else if(type == 1){ } else if(type == 1){
return new NumberEval(count(code)); return new NumberEval(count(code));
} }
return null; return NumberEval.ZERO;
} }
private double count(String code){ private double count(String code){
......
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