Commit 9c4b51f4 authored by zhkwei's avatar zhkwei Committed by Cheng C Yang

CIT导入及预览优化、RSUMIF增加多条件查询

parent 11a2b57a
...@@ -151,6 +151,17 @@ public class DateUtils { ...@@ -151,6 +151,17 @@ public class DateUtils {
return period; return period;
} }
/**
* 将yyyy- 等字符串转换为区间格式 yyyyMM
* @param dateStr
* @return
*/
public static Integer strToPeriodYM(String dateStr) {
dateStr = dateStr.replace("-","");
Integer period = Integer.valueOf(dateStr);
return period;
}
/** /**
* 将yyyymm 字符串转换为区间格式 yyyyMM * 将yyyymm 字符串转换为区间格式 yyyyMM
......
...@@ -45,7 +45,7 @@ public class RSUMIFParasBo { ...@@ -45,7 +45,7 @@ public class RSUMIFParasBo {
StringBuilder expression = new StringBuilder(""); StringBuilder expression = new StringBuilder("");
begin(expression); begin(expression);
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (i >= 4) { if (i >= args.length-2) {
concatPara(expression, resolverInteger(args, ec, i)); concatPara(expression, resolverInteger(args, ec, i));
} else { } else {
concatPara(expression, resolverString(args, ec, i)); concatPara(expression, resolverString(args, ec, i));
......
...@@ -39,7 +39,7 @@ public class CitCommonUtil { ...@@ -39,7 +39,7 @@ public class CitCommonUtil {
Object obj = null; Object obj = null;
//判断单元格是否为null,若为null则直接返回,以防在获取枚举类型时报空指针异常 //判断单元格是否为null,若为null则直接返回,以防在获取枚举类型时报空指针异常
if(cell == null){ if(cell == null){
return obj; return "";
} }
switch (cell.getCellTypeEnum()) { switch (cell.getCellTypeEnum()) {
case BOOLEAN: case BOOLEAN:
...@@ -63,6 +63,9 @@ public class CitCommonUtil { ...@@ -63,6 +63,9 @@ public class CitCommonUtil {
default: default:
break; break;
} }
if(obj == null){
return "";
}
return obj; return obj;
} }
......
...@@ -165,6 +165,13 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -165,6 +165,13 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample(); CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria(); CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId()); citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample); List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
List<CitTrialBalanceDto> citTbDtos = Lists.newArrayList(); List<CitTrialBalanceDto> citTbDtos = Lists.newArrayList();
citTbList.forEach(tb -> { citTbList.forEach(tb -> {
...@@ -216,7 +223,13 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -216,7 +223,13 @@ public class CitDataPreviewServiceImpl extends BaseService {
public int exportTbGeneVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){ public int exportTbGeneVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample(); CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria(); CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
// citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId()); citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample); List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
if(citTbList.size()==0){ if(citTbList.size()==0){
return 0; return 0;
......
...@@ -55,14 +55,17 @@ import java.util.stream.Collectors; ...@@ -55,14 +55,17 @@ import java.util.stream.Collectors;
import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*; import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
/** /**
* CIT报表生成service
* @author zhikai.z.wei * @author zhikai.z.wei
*/ */
@Component @Component
public class CitReportServiceImpl extends BaseService { public class CitReportServiceImpl extends BaseService {
private final static Logger logger = LoggerFactory.getLogger(CitReportServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(CitReportServiceImpl.class);
//报表公式
private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX", private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX",
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR", "WPNAME", "WPTYPE", "SUM2", "RSUMIF", "QMYE", "ZC"}; "JXFP", "PSUM", "DFFS", "JFFS", "WPSR", "WPNAME", "WPTYPE", "SUM2", "RSUMIF", "QMYE", "ZC"};
//生成总分机构分配表时取营业收入时所要用的条件
private final static String[] attributeArr = {"主营业务收入-销售商品收入","主营业务收入-提供劳务收入","其他业务收入-其他"}; private final static String[] attributeArr = {"主营业务收入-销售商品收入","主营业务收入-提供劳务收入","其他业务收入-其他"};
@Autowired @Autowired
...@@ -134,7 +137,13 @@ public class CitReportServiceImpl extends BaseService { ...@@ -134,7 +137,13 @@ public class CitReportServiceImpl extends BaseService {
@Autowired @Autowired
private CitAssetEamMappingMapper citAssetEamMappingMapper; private CitAssetEamMappingMapper citAssetEamMappingMapper;
/**
* 获取当前卡片所对应的所有报表
* @param projectId
* @param serviceType
* @param period
* @return
*/
public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) { public OperationResultDto<List<ReportDto>> getReportTemplate(String projectId, EnumServiceType serviceType, Integer period) {
OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>(); OperationResultDto<List<ReportDto>> operationResult = new OperationResultDto<>();
try { try {
...@@ -204,6 +213,7 @@ public class CitReportServiceImpl extends BaseService { ...@@ -204,6 +213,7 @@ public class CitReportServiceImpl extends BaseService {
@Override @Override
public void run() { public void run() {
try { try {
//清除之前生成的内容并复制报表模板相关内容(各个报表的单元格内容等)
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob); updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
// TODO 进行数据校验 // TODO 进行数据校验
...@@ -211,12 +221,12 @@ public class CitReportServiceImpl extends BaseService { ...@@ -211,12 +221,12 @@ public class CitReportServiceImpl extends BaseService {
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam, PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
templates.stream().map(Template::getId).collect(Collectors.toList())); templates.stream().map(Template::getId).collect(Collectors.toList()));
//把所有的报表弄到一个Excel里面
Workbook workbook = reportGenerator.createWorkBookByPeriodTemplate(resources.getPeriodTemplates(), genJob); Workbook workbook = reportGenerator.createWorkBookByPeriodTemplate(resources.getPeriodTemplates(), genJob);
//注册公式到POI
reportGenerator.addCitFunctionsAndContext(workbook, functions, reportGenerator.initContext(resources, periodParam)); reportGenerator.addCitFunctionsAndContext(workbook, functions, reportGenerator.initContext(resources, periodParam), false);
reportGenerator.setConfigAndDataToWorkBook(workbook, resources); reportGenerator.setConfigAndDataToWorkBook(workbook, resources);
//运行公式
FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator(); FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
evaluator.evaluateAll(); evaluator.evaluateAll();
...@@ -261,7 +271,8 @@ public class CitReportServiceImpl extends BaseService { ...@@ -261,7 +271,8 @@ public class CitReportServiceImpl extends BaseService {
periodCellTemplateConfigDtos.forEach(a -> { periodCellTemplateConfigDtos.forEach(a -> {
workbook4Validate.getSheetAt(a.getSheetNumber() - 1).getRow(a.getRowNumber()).getCell(a.getColNumber()).setCellFormula(a.getParsedValidation()); workbook4Validate.getSheetAt(a.getSheetNumber() - 1).getRow(a.getRowNumber()).getCell(a.getColNumber()).setCellFormula(a.getParsedValidation());
}); });
reportGenerator.addFunctionsAndContext(workbook4Validate, functions, reportGenerator.initContext(resources, periodParam),true); //CIT与VAT所用公式不同,所以拷贝出来一个方法,若有改动请用该方法
reportGenerator.addCitFunctionsAndContext(workbook4Validate, functions, reportGenerator.initContext(resources, periodParam),true);
FormulaEvaluator validateEvaluator = workbook4Validate.getCreationHelper().createFormulaEvaluator(); FormulaEvaluator validateEvaluator = workbook4Validate.getCreationHelper().createFormulaEvaluator();
validateEvaluator.evaluateAll(); validateEvaluator.evaluateAll();
//todo: 4.then save the validation result to cellData table //todo: 4.then save the validation result to cellData table
......
...@@ -1600,9 +1600,18 @@ public class DataImportService extends BaseService { ...@@ -1600,9 +1600,18 @@ public class DataImportService extends BaseService {
continue; continue;
} }
at.setId(plId); at.setId(plId);
String periodStr = getCellStringValue(row.getCell(0)); //第一版方法,因未能识别单元格格式问题,做出改进,只针对该单元格
// String periodStr = getCellStringValue(row.getCell(0));
// Integer period = Integer.valueOf(periodStr.substring(0,4)+periodStr.substring(5,7));
// at.setPeriod(period);
Object value = CitCommonUtil.getValue(row.getCell(0));
if(!"".equals(value)){
String periodStr = value.toString();
Integer period = Integer.valueOf(periodStr.substring(0,4)+periodStr.substring(5,7)); Integer period = Integer.valueOf(periodStr.substring(0,4)+periodStr.substring(5,7));
at.setPeriod(period); at.setPeriod(period);
}
at.setSegment1(getCellStringValue(row.getCell(1))); at.setSegment1(getCellStringValue(row.getCell(1)));
at.setSegment2(getCellStringValue(row.getCell(2))); at.setSegment2(getCellStringValue(row.getCell(2)));
at.setSegment3(getCellStringValue(row.getCell(3))); at.setSegment3(getCellStringValue(row.getCell(3)));
......
...@@ -152,7 +152,7 @@ public class FormulaAgent { ...@@ -152,7 +152,7 @@ public class FormulaAgent {
} }
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) { public static String buildSql(String tableName, String getField, String[] filters, String[] filterValues, Integer period, Integer year, FormulaContext formulaContext) {
/* /*
if (split[0].indexOf(">=") != -1) { if (split[0].indexOf(">=") != -1) {
...@@ -166,13 +166,13 @@ public class FormulaAgent { ...@@ -166,13 +166,13 @@ public class FormulaAgent {
if (tableName.substring(0, 3).equals("cit")) { if (tableName.substring(0, 3).equals("cit")) {
try { try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true, false); return _buildSql(getField, tableName, filters, filterValues, period, formulaContext, year, true, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
try { try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, false, false); return _buildSql(getField, tableName, filters, filterValues, period, formulaContext, year, false, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -180,38 +180,63 @@ public class FormulaAgent { ...@@ -180,38 +180,63 @@ public class FormulaAgent {
} }
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, Integer year, boolean bool, boolean getSql) throws Exception { public static String _buildSql(String getField, String tableName, String[] filters, String[] filterValues, Integer period, FormulaContext formulaContext, Integer year, boolean bool, boolean getSql) throws Exception {
String sql = ""; StringBuilder sql = new StringBuilder();
//统一判断年度 //统一判断年度
year = formulaContext.getYear() + year; year = formulaContext.getYear() + year;
if (getSql) { if (getSql) {
tableName = tableName.toLowerCase(); tableName = tableName.toLowerCase();
sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue; sql.append("select * from ").append(tableName).append(" where 1=1 and ");
return sql + " and project_id = '" + formulaContext.getProjectId() + "'"; for (int i = 0; i < filters.length; i++){
sql.append(filters[i]);
sql.append(filterValues[i]);
if(i < filters.length-1){
sql.append(" and ");
}
}
//注意:如果此处不是return,请另新建一个变量再返回,因StringBuilder操作的是同一个对象
sql.append(" and project_id = '" ).append(formulaContext.getProjectId()).append("'");
return sql.toString();
} else { } else {
sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue; sql.append("select sum(" + getField + ") as ").append(getField).append(" from " ).append(tableName).
append(" where 1=1 and ");
for (int i = 0; i < filters.length; i++){
sql.append(filters[i]);
sql.append(filterValues[i]);
if(i < filters.length-1){
sql.append(" and ");
}
}
// sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
} }
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period)); String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod()); String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1)); String per = insertZero((formulaContext.getPeriod() - 1));
if (!bool) { if (!bool) {
if (period == 0) { if (period == 0) {
sql += " and tms_period = " + Integer.parseInt(year + _period); sql.append(" and tms_period = " ).append( Integer.parseInt(year + _period));
// sql += " and tms_period = " + Integer.parseInt(year + _period);
} else if (period == -99) { } else if (period == -99) {
sql.append(" and tms_period between ").append(Integer.parseInt(year + "01")).append(" and ").append(Integer.parseInt(year + per));
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + per); // sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + per);
} else if (period == 99) { } else if (period == 99) {
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + _period); sql.append(" and tms_period between ").append(Integer.parseInt(year + "01")).append(" and ").append(Integer.parseInt(year + _period));
// sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + _period);
} else { } else {
if (period > 0) if (period > 0){
throw new Exception("参数不正确"); throw new Exception("参数不正确");
sql += " and tms_period between " + Integer.parseInt(year + _p) + " and " + Integer.parseInt(year + per);
} }
sql.append(" and tms_period between ").append(Integer.parseInt(year + _p)).append(" and ").append(Integer.parseInt(year + per));
// sql += " and tms_period between " + Integer.parseInt(year + _p) + " and " + Integer.parseInt(year + per);
}
}
if (bool){
sql.append(" and period = ").append(year);
// sql += " and period = " + year;
} }
if (bool) sql.append(" and project_id = '" ).append(formulaContext.getProjectId()).append("'");
sql += " and period = " + year; // sql += " and project_id = '" + formulaContext.getProjectId() + "'";
sql += " and project_id = '" + formulaContext.getProjectId() + "'"; return sql.toString();
return sql;
} }
public static String insertZero(Integer itr) { public static String insertZero(Integer itr) {
...@@ -232,14 +257,16 @@ public class FormulaAgent { ...@@ -232,14 +257,16 @@ public class FormulaAgent {
FormulaAgent formulaAgent = new FormulaAgent(); FormulaAgent formulaAgent = new FormulaAgent();
FormulaContext formulaContext = new FormulaContext(); FormulaContext formulaContext = new FormulaContext();
formulaContext.setPeriod(3); formulaContext.setPeriod(3);
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, 0, null); String[] filtes = new String[]{"attribute"};
String[] filteValues = new String[]{"= '销售费用-财产损耗、盘亏及毁损损失'"};
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", filtes, filteValues, 0, 0, null);
} }
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) { public BigDecimal getTableDataByName(String tableName, String getField, String[] filters, String[] filterValues, Integer period, Integer year, FormulaContext formulaContext) {
Map<String, Object> stringObjectMap = new HashMap<>(); Map<String, Object> stringObjectMap = new HashMap<>();
try { try {
stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext)); stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filters, filterValues, period, year, formulaContext));
if (stringObjectMap.get(getField) != null) { if (stringObjectMap.get(getField) != null) {
return new BigDecimal(stringObjectMap.get(getField).toString()); return new BigDecimal(stringObjectMap.get(getField).toString());
} }
......
...@@ -617,13 +617,23 @@ public class ReportGeneratorImpl { ...@@ -617,13 +617,23 @@ public class ReportGeneratorImpl {
* *
* @param workbook 工作簿 * @param workbook 工作簿
*/ */
public void addCitFunctionsAndContext(Workbook workbook, String[] functions, FormulaContext formulaContext) { public void addCitFunctionsAndContext(Workbook workbook, String[] functions, FormulaContext formulaContext, Boolean isValidate) {
//**************************** 为CIT复制的一份注册自定义公式 **************************** //**************************** 为CIT复制的一份注册自定义公式 ****************************
FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext), FreeRefFunction[] functionImpls;
if (!isValidate) {
functionImpls = new FreeRefFunction[]{new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext) new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext), , new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext),
new SUM2(formulaContext), new RSUMIF(formulaContext), new QMYE(formulaContext), new ZC(formulaContext)}; //为CIT复制的一份注册自定义公式 new SUM2(formulaContext), new RSUMIF(formulaContext), new QMYE(formulaContext), new ZC(formulaContext)}; //为CIT复制的一份注册自定义公式
} else {
functionImpls = new FreeRefFunction[]{new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
new pwc.taxtech.atms.vat.service.impl.report.functions.validation.BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext),
new SUM2(formulaContext), new RSUMIF(formulaContext), new QMYE(formulaContext), new ZC(formulaContext)}; //为CIT复制的一份注册自定义公式
}
//**************************** 为CIT复制的一份注册自定义公式 **************************** //**************************** 为CIT复制的一份注册自定义公式 ****************************
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls); UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs); UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
......
...@@ -41,21 +41,21 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -41,21 +41,21 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
//进行参数验证 //进行参数验证
public void parameterCheck(ValueEval[] args, OperationEvaluationContext ec) { public void parameterCheck(ValueEval[] args, OperationEvaluationContext ec) {
argsLength = args.length; if (args.length < 6 && (args.length & 1) == 1) {
if (argsLength != 6) //参数小于6当做异常处理, 最后俩参数可以取默认值 //参数小于6且如果是奇数的话当做异常处理, 最后俩参数可以取默认值
throw Exceptions.parameterError; throw Exceptions.parameterError;
}
try { try {
tableName = resolverString(args, ec, 0); tableName = resolverString(args, ec, 0);
if (!_map.containsKey(tableName)) {
if (!_map.containsKey(tableName))
throw Exceptions.parameterError; throw Exceptions.parameterError;
}
} catch (EvaluationException e) { } catch (EvaluationException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
Integer argsLength;
String getField; String getField;
Integer period; Integer period;
Integer year; Integer year;
...@@ -66,6 +66,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -66,6 +66,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
BigDecimal cellValue = BigDecimal.ZERO; BigDecimal cellValue = BigDecimal.ZERO;
String filter = null; String filter = null;
String filterValue = null; String filterValue = null;
//减4的原因是去掉前面两个参数和后面两个参数,剩下的参数才是条件列与条件值的总和,再除以2就是条件列的的数量
String[] filters = new String[(args.length - 4)/2];
String[] filterValues = new String[(args.length - 4)/2];
try { try {
parameterCheck(args, ec); parameterCheck(args, ec);
Map map = new HashMap<String, String>(); Map map = new HashMap<String, String>();
...@@ -75,11 +78,18 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -75,11 +78,18 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
dataSource.add(reportCellTableSUMIFDataSourceDto); dataSource.add(reportCellTableSUMIFDataSourceDto);
tableName = resolverString(args, ec, 0); tableName = resolverString(args, ec, 0);
getField = resolverString(args, ec, 1); getField = resolverString(args, ec, 1);
filter = resolverString(args, ec, 2); //获取条件列及条件值
filterValue = resolverString(args, ec, 3);
year = resolverInteger(args, ec, 4);//会计年度 for (int i = 2; i < args.length - 2; i++) {
period = Integer.parseInt(resolverString(args, ec, 5));//会计期间 filters[(i - 2)/2] = resolverString(args, ec, i);
cellValue = agent.getTableDataByName(tableName, getField, filter, filterValue, period, year, formulaContext); filterValues[(i - 2)/2] = resolverString(args, ec, ++i);
}
resolverFilterAndValues(args);
// filter = resolverString(args, ec, 2);
//// filterValue = resolverString(args, ec, 3);
year = resolverInteger(args, ec, args.length - 2);//会计年度
period = Integer.parseInt(resolverString(args, ec, args.length - 1));//会计期间
cellValue = agent.getTableDataByName(tableName, getField, filters, filterValues, period, year, formulaContext);
return new NumberEval(cellValue.doubleValue()); return new NumberEval(cellValue.doubleValue());
} catch (EvaluationException e) { } catch (EvaluationException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -97,7 +107,7 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -97,7 +107,7 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
dataSourceId = saveDataRSUMIFSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellTableSUMIFDataSourceDto, dataSourceId = saveDataRSUMIFSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellTableSUMIFDataSourceDto,
cellValue, formulaContext.getPeriod(), cellValue, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(), formulaContext.getReportTemplateGroupId(), ec.getColumnIndex(), ec.getRowIndex(),
formulaContext.getProjectId(), selectShow(tableName), FormulaAgent._buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, boo, true)); formulaContext.getProjectId(), selectShow(tableName), FormulaAgent._buildSql(getField, tableName, filters, filterValues, period, formulaContext, year, boo, true));
saveFormulaBlock(formulaContext.getPeriod(), ec, saveFormulaBlock(formulaContext.getPeriod(), ec,
new RSUMIFParasBo().getExpression(args, ec), cellValue, dataSourceId, formulaContext.getProjectId()); new RSUMIFParasBo().getExpression(args, ec), cellValue, dataSourceId, formulaContext.getProjectId());
} catch (Exception e) { } catch (Exception e) {
...@@ -119,4 +129,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction { ...@@ -119,4 +129,9 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
return ""; return "";
} }
public void resolverFilterAndValues(ValueEval[] args) {
}
} }
...@@ -98,7 +98,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable { ...@@ -98,7 +98,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private String poCreateTime; private Date poCreateTime;
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -647,7 +647,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable { ...@@ -647,7 +647,7 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public String getPoCreateTime() { public Date getPoCreateTime() {
return poCreateTime; return poCreateTime;
} }
...@@ -659,8 +659,8 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable { ...@@ -659,8 +659,8 @@ public class CitSalaryAdvance extends BaseEntity implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public void setPoCreateTime(String poCreateTime) { public void setPoCreateTime(Date poCreateTime) {
this.poCreateTime = poCreateTime == null ? null : poCreateTime.trim(); this.poCreateTime = poCreateTime;
} }
/** /**
......
...@@ -676,62 +676,52 @@ public class CitSalaryAdvanceExample { ...@@ -676,62 +676,52 @@ public class CitSalaryAdvanceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeEqualTo(String value) { public Criteria andPoCreateTimeEqualTo(Date value) {
addCriterion("po_create_time =", value, "poCreateTime"); addCriterion("po_create_time =", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeNotEqualTo(String value) { public Criteria andPoCreateTimeNotEqualTo(Date value) {
addCriterion("po_create_time <>", value, "poCreateTime"); addCriterion("po_create_time <>", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeGreaterThan(String value) { public Criteria andPoCreateTimeGreaterThan(Date value) {
addCriterion("po_create_time >", value, "poCreateTime"); addCriterion("po_create_time >", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeGreaterThanOrEqualTo(String value) { public Criteria andPoCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("po_create_time >=", value, "poCreateTime"); addCriterion("po_create_time >=", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeLessThan(String value) { public Criteria andPoCreateTimeLessThan(Date value) {
addCriterion("po_create_time <", value, "poCreateTime"); addCriterion("po_create_time <", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeLessThanOrEqualTo(String value) { public Criteria andPoCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("po_create_time <=", value, "poCreateTime"); addCriterion("po_create_time <=", value, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeLike(String value) { public Criteria andPoCreateTimeIn(List<Date> values) {
addCriterion("po_create_time like", value, "poCreateTime");
return (Criteria) this;
}
public Criteria andPoCreateTimeNotLike(String value) {
addCriterion("po_create_time not like", value, "poCreateTime");
return (Criteria) this;
}
public Criteria andPoCreateTimeIn(List<String> values) {
addCriterion("po_create_time in", values, "poCreateTime"); addCriterion("po_create_time in", values, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeNotIn(List<String> values) { public Criteria andPoCreateTimeNotIn(List<Date> values) {
addCriterion("po_create_time not in", values, "poCreateTime"); addCriterion("po_create_time not in", values, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeBetween(String value1, String value2) { public Criteria andPoCreateTimeBetween(Date value1, Date value2) {
addCriterion("po_create_time between", value1, value2, "poCreateTime"); addCriterion("po_create_time between", value1, value2, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPoCreateTimeNotBetween(String value1, String value2) { public Criteria andPoCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("po_create_time not between", value1, value2, "poCreateTime"); addCriterion("po_create_time not between", value1, value2, "poCreateTime");
return (Criteria) this; return (Criteria) this;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<result column="source" jdbcType="VARCHAR" property="source" /> <result column="source" jdbcType="VARCHAR" property="source" />
<result column="po_no" jdbcType="VARCHAR" property="poNo" /> <result column="po_no" jdbcType="VARCHAR" property="poNo" />
<result column="po_row" jdbcType="VARCHAR" property="poRow" /> <result column="po_row" jdbcType="VARCHAR" property="poRow" />
<result column="po_create_time" jdbcType="VARCHAR" property="poCreateTime" /> <result column="po_create_time" jdbcType="TIMESTAMP" property="poCreateTime" />
<result column="lading_bill_person" jdbcType="VARCHAR" property="ladingBillPerson" /> <result column="lading_bill_person" jdbcType="VARCHAR" property="ladingBillPerson" />
<result column="purchase_person" jdbcType="VARCHAR" property="purchasePerson" /> <result column="purchase_person" jdbcType="VARCHAR" property="purchasePerson" />
<result column="po_subject_code" jdbcType="VARCHAR" property="poSubjectCode" /> <result column="po_subject_code" jdbcType="VARCHAR" property="poSubjectCode" />
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
update_time) update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR},
#{period,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{poNo,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR}, #{poNo,jdbcType=VARCHAR},
#{poRow,jdbcType=VARCHAR}, #{poCreateTime,jdbcType=VARCHAR}, #{ladingBillPerson,jdbcType=VARCHAR}, #{poRow,jdbcType=VARCHAR}, #{poCreateTime,jdbcType=TIMESTAMP}, #{ladingBillPerson,jdbcType=VARCHAR},
#{purchasePerson,jdbcType=VARCHAR}, #{poSubjectCode,jdbcType=VARCHAR}, #{poSubjectName,jdbcType=VARCHAR}, #{purchasePerson,jdbcType=VARCHAR}, #{poSubjectCode,jdbcType=VARCHAR}, #{poSubjectName,jdbcType=VARCHAR},
#{costCenterCode,jdbcType=VARCHAR}, #{costCenter,jdbcType=VARCHAR}, #{supplier,jdbcType=VARCHAR}, #{costCenterCode,jdbcType=VARCHAR}, #{costCenter,jdbcType=VARCHAR}, #{supplier,jdbcType=VARCHAR},
#{item,jdbcType=VARCHAR}, #{standardMoney,jdbcType=VARCHAR}, #{currency,jdbcType=VARCHAR}, #{item,jdbcType=VARCHAR}, #{standardMoney,jdbcType=VARCHAR}, #{currency,jdbcType=VARCHAR},
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
#{poRow,jdbcType=VARCHAR}, #{poRow,jdbcType=VARCHAR},
</if> </if>
<if test="poCreateTime != null"> <if test="poCreateTime != null">
#{poCreateTime,jdbcType=VARCHAR}, #{poCreateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="ladingBillPerson != null"> <if test="ladingBillPerson != null">
#{ladingBillPerson,jdbcType=VARCHAR}, #{ladingBillPerson,jdbcType=VARCHAR},
...@@ -505,7 +505,7 @@ ...@@ -505,7 +505,7 @@
po_row = #{record.poRow,jdbcType=VARCHAR}, po_row = #{record.poRow,jdbcType=VARCHAR},
</if> </if>
<if test="record.poCreateTime != null"> <if test="record.poCreateTime != null">
po_create_time = #{record.poCreateTime,jdbcType=VARCHAR}, po_create_time = #{record.poCreateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.ladingBillPerson != null"> <if test="record.ladingBillPerson != null">
lading_bill_person = #{record.ladingBillPerson,jdbcType=VARCHAR}, lading_bill_person = #{record.ladingBillPerson,jdbcType=VARCHAR},
...@@ -624,7 +624,7 @@ ...@@ -624,7 +624,7 @@
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
po_no = #{record.poNo,jdbcType=VARCHAR}, po_no = #{record.poNo,jdbcType=VARCHAR},
po_row = #{record.poRow,jdbcType=VARCHAR}, po_row = #{record.poRow,jdbcType=VARCHAR},
po_create_time = #{record.poCreateTime,jdbcType=VARCHAR}, po_create_time = #{record.poCreateTime,jdbcType=TIMESTAMP},
lading_bill_person = #{record.ladingBillPerson,jdbcType=VARCHAR}, lading_bill_person = #{record.ladingBillPerson,jdbcType=VARCHAR},
purchase_person = #{record.purchasePerson,jdbcType=VARCHAR}, purchase_person = #{record.purchasePerson,jdbcType=VARCHAR},
po_subject_code = #{record.poSubjectCode,jdbcType=VARCHAR}, po_subject_code = #{record.poSubjectCode,jdbcType=VARCHAR},
...@@ -688,7 +688,7 @@ ...@@ -688,7 +688,7 @@
po_row = #{poRow,jdbcType=VARCHAR}, po_row = #{poRow,jdbcType=VARCHAR},
</if> </if>
<if test="poCreateTime != null"> <if test="poCreateTime != null">
po_create_time = #{poCreateTime,jdbcType=VARCHAR}, po_create_time = #{poCreateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="ladingBillPerson != null"> <if test="ladingBillPerson != null">
lading_bill_person = #{ladingBillPerson,jdbcType=VARCHAR}, lading_bill_person = #{ladingBillPerson,jdbcType=VARCHAR},
...@@ -804,7 +804,7 @@ ...@@ -804,7 +804,7 @@
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
po_no = #{poNo,jdbcType=VARCHAR}, po_no = #{poNo,jdbcType=VARCHAR},
po_row = #{poRow,jdbcType=VARCHAR}, po_row = #{poRow,jdbcType=VARCHAR},
po_create_time = #{poCreateTime,jdbcType=VARCHAR}, po_create_time = #{poCreateTime,jdbcType=TIMESTAMP},
lading_bill_person = #{ladingBillPerson,jdbcType=VARCHAR}, lading_bill_person = #{ladingBillPerson,jdbcType=VARCHAR},
purchase_person = #{purchasePerson,jdbcType=VARCHAR}, purchase_person = #{purchasePerson,jdbcType=VARCHAR},
po_subject_code = #{poSubjectCode,jdbcType=VARCHAR}, po_subject_code = #{poSubjectCode,jdbcType=VARCHAR},
......
...@@ -28,6 +28,26 @@ ...@@ -28,6 +28,26 @@
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when> <when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose>
<when test="item.draftCode != null">#{item.draftCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.draftName != null">#{item.draftName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.largeAttribute != null">#{item.largeAttribute,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.wpPosition != null">#{item.wpPosition,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose> <choose>
<when test="item.acctCode != null">#{item.acctCode,jdbcType=VARCHAR},</when> <when test="item.acctCode != null">#{item.acctCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
...@@ -37,7 +57,19 @@ ...@@ -37,7 +57,19 @@
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose> <choose>
<when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when> <when test="item.plRowSet != null">#{item.plRowSet,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.bsRowSet != null">#{item.bsRowSet,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.fetchNumber != null">#{item.fetchNumber,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.remark != null">#{item.remark,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose> <choose>
......
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<otherwise>'',</otherwise> <otherwise>'',</otherwise>
</choose> </choose>
<choose> <choose>
<when test="item.poCreateTime != null">#{item.poCreateTime,jdbcType=VARCHAR},</when> <when test="item.poCreateTime != null">#{item.poCreateTime,jdbcType=TIMESTAMP},</when>
<otherwise>'',</otherwise> <otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose> </choose>
<choose> <choose>
<when test="item.ladingBillPerson != null">#{item.ladingBillPerson,jdbcType=VARCHAR},</when> <when test="item.ladingBillPerson != null">#{item.ladingBillPerson,jdbcType=VARCHAR},</when>
......
...@@ -360,6 +360,15 @@ ...@@ -360,6 +360,15 @@
on on
tb.account_code=dam.acct_code tb.account_code=dam.acct_code
where tb.project_id = #{projectId,jdbcType=VARCHAR} where tb.project_id = #{projectId,jdbcType=VARCHAR}
<if test="accountCode != null">
and tb.account_code = #{accountCode,jdbcType=VARCHAR}
</if>
<if test="accountDescription != null">
and tb.account_description = #{accountDescription,jdbcType=VARCHAR}
</if>
<if test="attribute != null">
and dam.account_description = #{attribute,jdbcType=VARCHAR}
</if>
</select> </select>
......
...@@ -1149,5 +1149,6 @@ ...@@ -1149,5 +1149,6 @@
"DistributionRatio": "Distribution Ratio", "DistributionRatio": "Distribution Ratio",
"DistributionAmount": "Distribution Amount", "DistributionAmount": "Distribution Amount",
"Subtotal": "Total", "Subtotal": "Total",
"AssetEamMapping": "Asset Eam Mapping" "AssetEamMapping": "Asset Eam Mapping",
"ItemData": "Item Data"
} }
\ No newline at end of file
...@@ -1202,7 +1202,8 @@ ...@@ -1202,7 +1202,8 @@
"TotalAssets": "资产总额", "TotalAssets": "资产总额",
"DistributionRatio": "分配比例", "DistributionRatio": "分配比例",
"DistributionAmount": "分配税额", "DistributionAmount": "分配税额",
"AssetEamMapping": "固资损失计算" "AssetEamMapping": "固资损失计算",
"ItemData": "条数据"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<input class="form-control input-width-middle" type="text" id="orgName" ng-model="queryParams.orgName" /> <input class="form-control input-width-middle" type="text" id="orgName" ng-model="queryParams.orgName" />
</td> </td>
</tr> </tr>
<tr> <tr style="display: none">
<td> <td>
<span translate="DocumentDate"></span> <span translate="DocumentDate"></span>
<input class="form-control input-width-middle" type="text" id="documentDate" ng-model="queryParams.documentDate" /> <input class="form-control input-width-middle" type="text" id="documentDate" ng-model="queryParams.documentDate" />
......
...@@ -159,21 +159,21 @@ ...@@ -159,21 +159,21 @@
removeItem.forEach(function (v) { removeItem.forEach(function (v) {
$scope.queryParams[v] = null; $scope.queryParams[v] = null;
if ($scope.queryParams.subjectCode === null) { // if ($scope.queryParams.subjectCode === null) {
$scope.queryParams.subjectCode = ''; // $scope.queryParams.subjectCode = '';
} // }
if ($scope.queryParams.subjectName === null) { // if ($scope.queryParams.subjectName === null) {
$scope.queryParams.subjectName = ''; // $scope.queryParams.subjectName = '';
} // }
if ($scope.queryParams.orgCode === null) { // if ($scope.queryParams.orgCode === null) {
$scope.queryParams.orgCode = ''; // $scope.queryParams.orgCode = '';
} // }
if ($scope.queryParams.orgName === null) { // if ($scope.queryParams.orgName === null) {
$scope.queryParams.orgName = ''; // $scope.queryParams.orgName = '';
} // }
if ($scope.queryParams.documentDate === null) { // if ($scope.queryParams.documentDate === null) {
$scope.queryParams.documentDate = ''; // $scope.queryParams.documentDate = '';
} // }
}); });
} }
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<div class="input-group"> <div class="input-group">
<input class="form-control " type="text" id="accountCode" placeholder="" <input class="form-control " type="text" id="accountCode" placeholder=""
ng-model="filterData.accountCode"> ng-model="filterData.accountCode">
<a class="input-group-addon btn btn-sm" ng-click="popTheParentCode()"><i <!--<a class="input-group-addon btn btn-sm" ng-click="popTheParentCode()"><i-->
class="fa fa-columns" aria-hidden="true"></i></a> <!--class="fa fa-columns" aria-hidden="true"></i></a>-->
</div> </div>
</td> </td>
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
pageInfo: {}, pageInfo: {},
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
accountCode: '', accountCode: null,
accountDescription: '', accountDescription: null,
projectId: vatSessionService.project.id projectId: vatSessionService.project.id
}; };
}; };
...@@ -150,18 +150,18 @@ ...@@ -150,18 +150,18 @@
// $scope.queryParams.periodEnd = $scope.queryParams.periodStart; // $scope.queryParams.periodEnd = $scope.queryParams.periodStart;
// } // }
设置需要去掉的查询条件的值为空 // 设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) { if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|"); var removeItem = removeData.split("|");
removeItem.forEach(function (v) { removeItem.forEach(function (v) {
$scope.queryParams[v] = null; $scope.queryParams[v] = null;
if ($scope.queryParams.accountCode === null) { // if ($scope.queryParams.accountCode === null) {
$scope.queryParams.accountCode = ''; // $scope.queryParams.accountCode = '';
} // }
if ($scope.queryParams.accountDescription === null) { // if ($scope.queryParams.accountDescription === null) {
$scope.queryParams.accountDescription = ''; // $scope.queryParams.accountDescription = '';
} // }
}); });
} }
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
pageInfo: {}, pageInfo: {},
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
accountCode: '', accountCode: null,
accountDescription: '', accountDescription: null,
attribute : '', attribute : null,
projectId: vatSessionService.project.id projectId: vatSessionService.project.id
}; };
}; };
...@@ -154,21 +154,21 @@ ...@@ -154,21 +154,21 @@
// $scope.queryParams.periodEnd = $scope.queryParams.periodStart; // $scope.queryParams.periodEnd = $scope.queryParams.periodStart;
// } // }
设置需要去掉的查询条件的值为空 // 设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) { if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|"); var removeItem = removeData.split("|");
removeItem.forEach(function (v) { removeItem.forEach(function (v) {
$scope.queryParams[v] = null; $scope.queryParams[v] = null;
if ($scope.queryParams.accountCode === null) { // if ($scope.queryParams.accountCode === null) {
$scope.queryParams.accountCode = ''; // $scope.queryParams.accountCode = '';
} // }
if ($scope.queryParams.accountDescription === null) { // if ($scope.queryParams.accountDescription === null) {
$scope.queryParams.accountDescription = ''; // $scope.queryParams.accountDescription = '';
} // }
if ($scope.queryParams.attribute === null) { // if ($scope.queryParams.attribute === null) {
$scope.queryParams.attribute = ''; // $scope.queryParams.attribute = '';
} // }
}); });
} }
......
...@@ -613,7 +613,7 @@ ...@@ -613,7 +613,7 @@
if (!_.isEmpty(parsedFormula)) { if (!_.isEmpty(parsedFormula)) {
// parsedFormula = 'IFERROR(' + parsedFormula + ', "")'; parsedFormula = 'IFERROR(' + parsedFormula + ', "")';
sheet.setFormula(data.rowIndex, data.columnIndex, '=' + parsedFormula); sheet.setFormula(data.rowIndex, data.columnIndex, '=' + parsedFormula);
// sheet.setValue(data.rowIndex, data.columnIndex, data.value); // sheet.setValue(data.rowIndex, data.columnIndex, data.value);
ifShowParseFloat = false; // 有公式或手工数据源,单元格设置为公式 ifShowParseFloat = false; // 有公式或手工数据源,单元格设置为公式
...@@ -642,6 +642,12 @@ ...@@ -642,6 +642,12 @@
cell.value(0); cell.value(0);
cell.formatter("[=0]——;0.00"); cell.formatter("[=0]——;0.00");
} }
if(sheet.getValue(r,c) === '#VALUE!'){
sheet.setValue(r,c,0.0);
}
if(sheet.getText(r,c) === '#VALUE!'){
sheet.setText(r,c,"0.0");
}
} }
} }
......
...@@ -172,9 +172,9 @@ ...@@ -172,9 +172,9 @@
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
if (resp.resultMsg && resp.resultMsg.length > 0) { if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning(resp.resultMsg); SweetAlert.warning(resp.resultMsg);
......
...@@ -159,13 +159,14 @@ ...@@ -159,13 +159,14 @@
}, },
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}).then(function(resp) { }).then(function(data) {
var resp = data.data;
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + " " + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + " " + $translate.instant('ItemData'));
} else { } else {
if (resp.message && resp.message.length > 0) { if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg)); SweetAlert.warning($translate.instant(resp.resultMsg));
......
...@@ -158,13 +158,14 @@ ...@@ -158,13 +158,14 @@
}, },
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}).then(function(resp) { }).then(function(data) {
var resp = data.data;
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
if (resp.message && resp.message.length > 0) { if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg)); SweetAlert.warning($translate.instant(resp.resultMsg));
......
...@@ -178,9 +178,9 @@ ...@@ -178,9 +178,9 @@
deferred.resolve(); deferred.resolve();
if (resp.result) { if (resp.result) {
debugger; debugger;
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
debugger; debugger;
if (resp.resultMsg && resp.resultMsg.length > 0) { if (resp.resultMsg && resp.resultMsg.length > 0) {
......
...@@ -172,9 +172,9 @@ ...@@ -172,9 +172,9 @@
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
if (resp.resultMsg && resp.resultMsg.length > 0) { if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning(resp.resultMsg); SweetAlert.warning(resp.resultMsg);
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 2; $scope.viewMode = 1;
$scope.dateFormat = $translate.instant('dateFormat4Year'); $scope.dateFormat = $translate.instant('dateFormat4YearMonth');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
...@@ -168,16 +168,18 @@ ...@@ -168,16 +168,18 @@
}, },
__RequestVerificationToken: token, __RequestVerificationToken: token,
withCredentials: true withCredentials: true
}).then(function(resp) { }).then(function(data) {
var resp = data.data;
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
if (resp.message && resp.message.length > 0) { debugger;
SweetAlert.warning($translate.instant(resp.resultMsg)); if (resp.resultMsg && resp.resultMsg.length > 0) {
SweetAlert.warning(resp.resultMsg);
}else{ }else{
SweetAlert.error($translate.instant('ImportFailed')); SweetAlert.error($translate.instant('ImportFailed'));
} }
......
...@@ -174,9 +174,9 @@ ...@@ -174,9 +174,9 @@
$('#busy-indicator-container').hide(); $('#busy-indicator-container').hide();
deferred.resolve(); deferred.resolve();
if (resp.data || resp.result) { if (resp.data || resp.result) {
logDto.UpdateState = $translate.instant('ImportSuccess'); logDto.UpdateState = $translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData');
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
SweetAlert.success($translate.instant('ImportSuccess')); SweetAlert.success($translate.instant('ImportSuccess')+" "+resp.data + $translate.instant('ItemData'));
} else { } else {
if (resp.message && resp.message.length > 0) { if (resp.message && resp.message.length > 0) {
SweetAlert.warning($translate.instant(resp.resultMsg)); SweetAlert.warning($translate.instant(resp.resultMsg));
......
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