Commit 36e42ede authored by sherlock's avatar sherlock

export order

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