Commit 79701cd5 authored by chase's avatar chase

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

parents 0a475162 4434e342
package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.CitReportServiceImpl;
import pwc.taxtech.atms.vat.service.impl.ReportServiceImpl;
import java.util.List;
import java.util.Optional;
/**
* @author zhikai.z.wei
* @description CIT报表生成(数据处理)
*/
@RestController
@RequestMapping(value = "api/v1/citReport")
public class CitReportController {
@Autowired
ReportServiceImpl reportService;
@Autowired
CitReportServiceImpl citReportService;
/**
* 获取CIT所有要生成的报表模板相关信息,
* 注意CIT不存在月份期间
* @param projectId
* @param serviceType
* @return
*/
@RequestMapping(value = "citTemplate/{projectId}/{serviceType}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<ReportDto>> getCitTemplate(@PathVariable String projectId, @PathVariable int serviceType) {
return citReportService.getReportTemplate(projectId, EnumServiceType.getEnumByCode(serviceType));
}
/**
* 生成CIT所有的报表
* @param projectId
* @param generator
* @param mergeManual
* @return
*/
@RequestMapping(value = "generateByTotal/{projectId}/{mergeManual}", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity generateAllData(@PathVariable String projectId,
@RequestParam Optional<String> generator, @PathVariable Boolean mergeManual) {
return ResponseEntity.ok(citReportService.generateCitData(projectId, EnumServiceType.CIT, mergeManual,0,null, generator));
}
}
\ No newline at end of file
...@@ -22,4 +22,5 @@ public class Exceptions { ...@@ -22,4 +22,5 @@ public class Exceptions {
public static final FormulaException PROJECT_NOT_FOUND = new FormulaException("project not found");; public static final FormulaException PROJECT_NOT_FOUND = new FormulaException("project not found");;
public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty"); public static final FormulaException PSUM_CELL_TEMP_NULL = new FormulaException("cell template group is null or empty");
public static final ApiException NOT_FOUND_INSTANCE_EXCEPTION = new NotFoundException("not found instance"); public static final ApiException NOT_FOUND_INSTANCE_EXCEPTION = new NotFoundException("not found instance");
public static final FormulaException parameterError = new FormulaException("formula parameter is error");
} }
...@@ -95,8 +95,9 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -95,8 +95,9 @@ public class CitDataPreviewServiceImpl extends BaseService {
* @return * @return
*/ */
public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) { public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) {
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize()); Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalAdjustDto.getProjectId()); List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList(); List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList();
journalMerges.forEach(journal -> { journalMerges.forEach(journal -> {
CitJournalAdjustDto citJournalDto = new CitJournalAdjustDto(); CitJournalAdjustDto citJournalDto = new CitJournalAdjustDto();
...@@ -112,7 +113,8 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -112,7 +113,8 @@ public class CitDataPreviewServiceImpl extends BaseService {
public int exportJournalMergeData(CitJournalAdjustDto citJournalAdjustDto, OutputStream os) { public int exportJournalMergeData(CitJournalAdjustDto citJournalAdjustDto, OutputStream os) {
try { try {
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalAdjustDto.getProjectId()); CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
Map<String, String> header = generalJMHeader(); Map<String, String> header = generalJMHeader();
List<JournalMergeExportDto> cellList = new ArrayList<>(); List<JournalMergeExportDto> cellList = new ArrayList<>();
......
...@@ -72,7 +72,9 @@ public class DataImportService extends BaseService { ...@@ -72,7 +72,9 @@ public class DataImportService extends BaseService {
@Resource @Resource
private AdjustmentTableMapper adjustmentTableMapper; private AdjustmentTableMapper adjustmentTableMapper;
@Resource @Resource
private CashFlowMapper cashFlowMapper; private CashFlowManualMapper cashFlowManualMapper;
@Resource
private CashFlowFinalMapper cashFlowFinalMapper;
@Resource @Resource
private CoupaPurchasingReportMapper coupaPurchasingReportMapper; private CoupaPurchasingReportMapper coupaPurchasingReportMapper;
@Resource @Resource
...@@ -630,12 +632,12 @@ public class DataImportService extends BaseService { ...@@ -630,12 +632,12 @@ public class DataImportService extends BaseService {
// 根据orgId period删除记录 // 根据orgId period删除记录
CashFlowExample cashFlowExample = new CashFlowExample(); CashFlowExample cashFlowExample = new CashFlowExample();
cashFlowExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period); cashFlowExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
cashFlowMapper.deleteByExample(cashFlowExample); cashFlowManualMapper.deleteByExample(cashFlowExample);
if (cashFlowMapper.countByExample(cashFlowExample) > 0) { if (cashFlowFinalMapper.countByExample(cashFlowExample) > 0) {
cashFlowMapper.deleteByExample(cashFlowExample); cashFlowFinalMapper.deleteByExample(cashFlowExample);
} }
} }
cashFlowMapper.insertBatch(cfs); cashFlowManualMapper.insertBatch(cfs);
dataImportLog.setRecordSize(cfs.size()); dataImportLog.setRecordSize(cfs.size());
dataImportLog.setImportResult(true); dataImportLog.setImportResult(true);
dataImportLogs.add(dataImportLog); dataImportLogs.add(dataImportLog);
...@@ -838,9 +840,6 @@ public class DataImportService extends BaseService { ...@@ -838,9 +840,6 @@ public class DataImportService extends BaseService {
InvoiceDataExample invoiceDataExample = new InvoiceDataExample(); InvoiceDataExample invoiceDataExample = new InvoiceDataExample();
invoiceDataExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period); invoiceDataExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
invoiceDataMapper.deleteByExample(invoiceDataExample); invoiceDataMapper.deleteByExample(invoiceDataExample);
if (invoiceDataMapper.countByExample(invoiceDataExample) > 0) {
invoiceDataMapper.deleteByExample(invoiceDataExample);
}
} }
invoiceDataMapper.insertBatch(iDatas); invoiceDataMapper.insertBatch(iDatas);
dataImportLog.setRecordSize(iDatas.size()); dataImportLog.setRecordSize(iDatas.size());
...@@ -1698,8 +1697,7 @@ public class DataImportService extends BaseService { ...@@ -1698,8 +1697,7 @@ public class DataImportService extends BaseService {
OrganizationExample example = new OrganizationExample(); OrganizationExample example = new OrganizationExample();
example.createCriteria().andIdIn(dataExtractParam.getOrgIds()); example.createCriteria().andIdIn(dataExtractParam.getOrgIds());
List<String> codes = organizationMapper.selectByExample(example).stream().map(Organization::getCode).collect(Collectors.toList()); List<String> codes = organizationMapper.selectByExample(example).stream().map(Organization::getCode).collect(Collectors.toList());
// HttpUtil.post();
Integer tmsPeriod = DateUtils.strToPeriod(dataExtractParam.getPeriod()); Integer tmsPeriod = DateUtils.strToPeriod(dataExtractParam.getPeriod());
// data_import_log 日志记录为 EnumImportType.ExtractFinancialData // data_import_log 日志记录为 EnumImportType.ExtractFinancialData
return OperationResultDto.success(); return OperationResultDto.success();
......
...@@ -132,4 +132,11 @@ public class FormulaAgent { ...@@ -132,4 +132,11 @@ public class FormulaAgent {
return cellData; return cellData;
} }
public List<CellTemplatePerGroupDto> getCellDataByPos(Long templateId, Integer period, String cellRow, String cellCol, String projectId){
return adminMp.getCellDataByPos(templateId, period, cellRow, cellCol, projectId);
}
public List<CellTemplatePerGroupDto> getTableData(String tableName, String getField, String selectFilter, String year, String selectPeriod) {
return adminMp.getTableData(tableName, getField, selectFilter, year, selectPeriod);
}
} }
...@@ -552,6 +552,8 @@ public class ReportServiceImpl extends BaseService { ...@@ -552,6 +552,8 @@ public class ReportServiceImpl extends BaseService {
private ProfitLossStatementMapper profitLossStatementMapper; private ProfitLossStatementMapper profitLossStatementMapper;
@Autowired @Autowired
private JournalEntryMapper journalEntryMapper; private JournalEntryMapper journalEntryMapper;
@Autowired
private DataUtil dataUtil;
/* @Autowired /* @Autowired
private CitJour*/ private CitJour*/
//数据校验 //数据校验
...@@ -593,7 +595,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -593,7 +595,7 @@ public class ReportServiceImpl extends BaseService {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("period", periodParam); map.put("period", periodParam);
map.put("projectId", projectId); map.put("projectId", projectId);
Map<String, Object> mapProject = new DataUtil().getProjectById(projectId); Map<String, Object> mapProject = dataUtil.getProjectById(projectId);
map.put("companyCode", mapProject.get("code")); map.put("companyCode", mapProject.get("code"));
map.put("companyName", mapProject.get("name")); map.put("companyName", mapProject.get("name"));
List<JournalEntry> journalEntries = journalEntryMapper.selectNowAdjustData(map2); List<JournalEntry> journalEntries = journalEntryMapper.selectNowAdjustData(map2);
...@@ -623,8 +625,14 @@ public class ReportServiceImpl extends BaseService { ...@@ -623,8 +625,14 @@ public class ReportServiceImpl extends BaseService {
setStatus(genJob, STATUS_END); setStatus(genJob, STATUS_END);
map.put("validateResult", "success"); map.put("validateResult", "success");
map.put("result", ""); map.put("result", "");
map.put("tmsPeriod", journalEntries.get(0).getTmsPeriod()); if(journalEntries.size()==0){
map.put("organizationId", journalEntries.get(0).getOrganizationId()); map.put("tmsPeriod", 0);
}else{
map.put("tmsPeriod", journalEntries.get(0).getTmsPeriod());
}
map.put("organizationId", mapProject.get("organizationId"));
insertDataValidateResult(map); insertDataValidateResult(map);
periodJobMapper.updateByPrimaryKey(genJob); periodJobMapper.updateByPrimaryKey(genJob);
} }
......
...@@ -10,9 +10,8 @@ import org.slf4j.LoggerFactory; ...@@ -10,9 +10,8 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.vat.entity.PeriodDataSource; import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.PeriodDataSourceDetail; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
import java.lang.reflect.Field; import java.lang.reflect.Field;
...@@ -139,7 +138,7 @@ public class FunctionBase { ...@@ -139,7 +138,7 @@ public class FunctionBase {
dataSource.setPeriod(period); dataSource.setPeriod(period);
dataSource.setProjectId(projectId); dataSource.setProjectId(projectId);
SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource); SpringContextUtil.periodDataSourceMapper.insertSelective(dataSource);
if(CollectionUtils.isNotEmpty(dataSourceList)){ if (CollectionUtils.isNotEmpty(dataSourceList)) {
for (Object obj : dataSourceList) { for (Object obj : dataSourceList) {
if (obj.getClass() == java.util.ArrayList.class) { if (obj.getClass() == java.util.ArrayList.class) {
for (Object obj2 : (ArrayList<Object>) obj) { for (Object obj2 : (ArrayList<Object>) obj) {
...@@ -163,7 +162,7 @@ public class FunctionBase { ...@@ -163,7 +162,7 @@ public class FunctionBase {
SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail); SpringContextUtil.periodDataSourceDetailMapper.insertSelective(dataSourceDetail);
} }
} }
}else{ } else {
PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail(); PeriodDataSourceDetail dataSourceDetail = new PeriodDataSourceDetail();
dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId()); dataSourceDetail.setId(SpringContextUtil.distributedIdService.nextId());
dataSourceDetail.setDataSourceId(dataSourceId); dataSourceDetail.setDataSourceId(dataSourceId);
...@@ -214,10 +213,10 @@ public class FunctionBase { ...@@ -214,10 +213,10 @@ public class FunctionBase {
String evalStr = OperandResolver.coerceValueToString(eval); String evalStr = OperandResolver.coerceValueToString(eval);
LOGGER.debug("[Formula_debug] eval other cell value {}", evalStr); LOGGER.debug("[Formula_debug] eval other cell value {}", evalStr);
try { try {
BigDecimal bigDecimal= new BigDecimal(evalStr); BigDecimal bigDecimal = new BigDecimal(evalStr);
if (!dss.isEmpty()) { if (!dss.isEmpty()) {
return bigDecimal.add(dss.get(0).getAmount()); return bigDecimal.add(dss.get(0).getAmount());
}else { } else {
return bigDecimal; return bigDecimal;
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -230,4 +229,35 @@ public class FunctionBase { ...@@ -230,4 +229,35 @@ public class FunctionBase {
return new BigDecimal(0); return new BigDecimal(0);
} }
public String StringBuddler(String target, String design) {
if (target.equals("")) {
target = design;
} else {
target = target + ", " + design;
}
return target;
}
public Long getSUM2Data(Long reportTemplateId, Integer period, Map map) {
String bufferString = "";
Long refValue = null;
PeriodCellTemplateExample example = new PeriodCellTemplateExample();
PeriodCellTemplateExample.Criteria criteria = example.createCriteria();
criteria.andReportTemplateIdEqualTo(reportTemplateId);
criteria.andPeriodEqualTo(period);
criteria.andColumnIndexEqualTo(Integer.parseInt(map.get("colIndex").toString()));
criteria.andRowIndexBetween(Integer.parseInt(map.get("rowIndexBegin").toString()), Integer.parseInt(map.get("rowIndexEnd").toString()));
List<PeriodCellTemplate> periodCellTemplates = SpringContextUtil.periodCellTemplateMapper.selectByExample(example);
for (PeriodCellTemplate p : periodCellTemplates) {
StringBuddler(bufferString, p.getCellTemplateId().toString());
}
List<PeriodCellData> list = SpringContextUtil.periodCellDataMapper.selectDataByCellTemplateIdAround(bufferString);
for (PeriodCellData periodCellData : list) {
if (refValue == null) refValue = Long.parseLong(periodCellData.getData());
refValue += Long.parseLong(periodCellData.getData());
}
return refValue;
}
} }
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.EvaluationException;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.exception.FormulaException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverInteger;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString;
/**
* @ClassName RSUMIF
* Description TODO 公式还需要校验
* @Author pwc kevin
* @Date 3/8/2019 5:21 PM
* Version 1.0
**/
public class RSUMIF extends FunctionBase implements FreeRefFunction {
final static ValueEval defaultEval = new StringEval("0");
static final Logger LOGGER = LoggerFactory.getLogger(BB.class);
String tableName;
String getField;//取值列字段
Map<String, String> fileterMap = new HashMap<String, String>();
String year;
int period;
String selectPeriod = "";
String selectFilter = "";
Long result;
int argsLength;
int selectCount;
public RSUMIF(FormulaContext formulaContext) {
super(formulaContext);
}
@Override
public ValueEval evaluate(ValueEval[] valueEvals, OperationEvaluationContext operationEvaluationContext) {
try {
return wrapExceptionEval(valueEvals, operationEvaluationContext);
} catch (Exception e) {
if (e instanceof FormulaException)
LOGGER.warn("Formula Exception || {}", e.getMessage());
e.printStackTrace();
return defaultEval;
}
}
public ValueEval wrapExceptionEval(ValueEval[] args, OperationEvaluationContext ec) throws Exception {
List<Object> ds = new ArrayList<>();
parameterCheck(args);
setWhere(args, ec);
List<CellTemplatePerGroupDto> tableData = null;
try {
tableData = agent.getTableData(tableName, getField, selectFilter, year, selectPeriod);
} catch (Exception e) {
e.printStackTrace();
throw new Exception("公式参数配置错误");
}
for (CellTemplatePerGroupDto cellTemplatePerGroupDto : tableData) {
result = result + Long.parseLong(cellTemplatePerGroupDto.getData());
}
return new NumberEval(result);
}
//进行参数验证
public void parameterCheck(ValueEval[] args) {
argsLength = args.length;
if (argsLength < 4) {//参数小于3当做异常处理, 最后俩参数可以取默认值
throw Exceptions.parameterError;
}
}
private void setWhere(ValueEval[] args, OperationEvaluationContext ec) {
try {
selectCount = (argsLength - 4) / 2;
tableName = resolverString(args, ec, 0);
getField = resolverString(args, ec, 1);
period = resolverInteger(args, ec, argsLength - 1);//会计期间
year = resolverString(args, ec, argsLength - 2);//会计年度
if (selectCount % 2 != 0)
throw Exceptions.parameterError;
for (int i = 3; i < selectCount * 2 + 3; i++) {
if (i % 2 != 0) {
fileterMap.put(resolverString(args, ec, i), resolverString(args, ec, i + 1));
}
}
if (period == 0) {
selectPeriod = "t.period = " + formulaContext.getPeriod();
} else if (period == -99) {
selectPeriod = "t.period between '0' and " + (formulaContext.getPeriod() - 1);
} else if (period == 99) {
selectPeriod = "t.period between '0' and " + (formulaContext.getPeriod() - 1);
} else {
selectPeriod = "t.period between " + (formulaContext.getPeriod() - period) + " and " + (formulaContext.getPeriod() - 1);
}
for (Map.Entry<String, String> entry : fileterMap.entrySet()) {
if (selectFilter.equals("")) {
selectFilter = "t." + entry.getKey() + entry.getValue();
} else {
selectFilter = selectFilter + " and " + "t." + entry.getKey() + entry.getValue();
}
}
} catch (EvaluationException e) {
e.printStackTrace();
}
}
}
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.EvaluationException;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.exception.Exceptions;
/**
* author kevin
*/
import java.math.BigDecimal;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString;
public class SUM extends FunctionBase implements FreeRefFunction {
final static ValueEval defaultEval = new StringEval("0");
static final Logger LOGGER = LoggerFactory.getLogger(BB.class);
public BigDecimal cellValue;
public SUM(FormulaContext formulaContext) {
super(formulaContext);
}
//检查参数合法性
public String parameter(String parameter) {
if (parameter.length() != 2)
throw Exceptions.parameterError;
return parameter;
}
//数据获取
public BigDecimal getData(String cellPos) {
String cellCol = cellPos.substring(0, 1);
String cellRow = cellPos.substring(1, 1);
Long reportTemplateGroupId = formulaContext.getReportTemplateGroupId();
return BigDecimal.valueOf(Long.parseLong(agent.getCellDataByPos(reportTemplateGroupId, formulaContext.getPeriod(), cellRow, cellCol, formulaContext.getProjectId()).get(0).getData()));
}
//进行sum计算
public BigDecimal sum(BigDecimal bigDecimal) {
cellValue.add(bigDecimal);
return cellValue;
}
@Override
public ValueEval evaluate(ValueEval[] valueEvals, OperationEvaluationContext operationEvaluationContext) {
for (int i = 0, j = valueEvals.length; i < j; i++) {
try {
return new NumberEval(sum(getData(parameter(resolverString(valueEvals, operationEvaluationContext, i)))).doubleValue());
} catch (EvaluationException e) {
e.printStackTrace();
return defaultEval;
}
}
return defaultEval;
}
}
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.EvaluationException;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.StringEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.thirdparty.ExcelCell;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverInteger;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString;
/**
* author kevin
* todo 需要检验公式的准确
*/
public class SUM2 extends FunctionBase implements FreeRefFunction {
final static ValueEval defaultEval = new StringEval("0");
static final Logger LOGGER = LoggerFactory.getLogger(BB.class);
public BigDecimal cellValue;
public SUM2(FormulaContext formulaContext) {
super(formulaContext);
}
//检查参数合法性
public Map parameterCheck(ValueEval[] valueEvals, OperationEvaluationContext ec) {
Map<String, Object> map = new HashMap<String, Object>();
if(valueEvals.length != 2)
throw Exceptions.parameterError;
try {
String argsOne = resolverString(valueEvals, ec, 0);
String argsTwo = resolverString(valueEvals, ec, 1);
if(!argsOne.substring(0,1).equals(argsTwo.substring(0,1)))
throw Exceptions.parameterError;
map.put("colIndex", argsOne.substring(0,1));
map.put("rowIndexBegin", argsOne.substring(1,1));
map.put("rowIndexEnd", argsTwo.subSequence(1,1));
} catch (EvaluationException e) {
e.printStackTrace();
return null;
}
return map;
}
@Override
public ValueEval evaluate(ValueEval[] valueEvals, OperationEvaluationContext operationEvaluationContext) {
Map map = parameterCheck(valueEvals, operationEvaluationContext);
if(map != null){
return new NumberEval(getSUM2Data(formulaContext.getReportTemplateGroupId(), formulaContext.getPeriod(), map));
};
return new NumberEval(0.00);
/* for (int i = 0, j = valueEvals.length; i < j; i++) {
try {
return new NumberEval(sum(getData(parameter(resolverString(valueEvals, operationEvaluationContext, i)))).doubleValue());
} catch (EvaluationException e) {
e.printStackTrace();
return defaultEval;
}
}*/
}
}
This diff is collapsed.
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.io.Files;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.junit.Test; import org.junit.Test;
...@@ -22,6 +23,7 @@ import javax.annotation.Resource; ...@@ -22,6 +23,7 @@ import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
...@@ -80,12 +82,11 @@ public class DataInitTest extends CommonIT { ...@@ -80,12 +82,11 @@ public class DataInitTest extends CommonIT {
public void importOrgJson(){ public void importOrgJson(){
String input = ""; String input = "";
try { try {
String filePath = "C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info.json"; File targetFile = new File("src/main/resources/orgImport/company_info.json");
input = FileUtils.readFileToString(new File(filePath), "UTF-8"); input = FileUtils.readFileToString(targetFile, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
JSONObject object = JSONObject.parseObject(input); JSONObject object = JSONObject.parseObject(input);
Map<String, Object> orgs = object.getInnerMap(); Map<String, Object> orgs = object.getInnerMap();
Map<String, Object> failList = new HashMap<>(); Map<String, Object> failList = new HashMap<>();
...@@ -171,9 +172,9 @@ public class DataInitTest extends CommonIT { ...@@ -171,9 +172,9 @@ public class DataInitTest extends CommonIT {
} }
equityInfos.forEach(ei -> { equityInfos.forEach(ei -> {
// 逐条insert 失败的记录 // 逐条insert 失败的记录
/*if (equityInformationMapper.insertSelective(ei) < 1) { if (equityInformationMapper.insertSelective(ei) < 1) {
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
}*/ }
}); });
} }
} else if ("股东信息".equals(infoK) && equityInfos.isEmpty()) { } else if ("股东信息".equals(infoK) && equityInfos.isEmpty()) {
...@@ -243,9 +244,9 @@ public class DataInitTest extends CommonIT { ...@@ -243,9 +244,9 @@ public class DataInitTest extends CommonIT {
} }
equityInfos1.forEach(ei -> { equityInfos1.forEach(ei -> {
// 逐条insert 失败的记录 // 逐条insert 失败的记录
/* if (equityInformationMapper.insertSelective(ei) < 1) { if (equityInformationMapper.insertSelective(ei) < 1) {
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
}*/ }
}); });
} }
} else if ("变更记录".equals(infoK)) { } else if ("变更记录".equals(infoK)) {
...@@ -271,9 +272,9 @@ public class DataInitTest extends CommonIT { ...@@ -271,9 +272,9 @@ public class DataInitTest extends CommonIT {
}); });
logs.forEach(l -> { logs.forEach(l -> {
// 逐条insert 失败的记录 // 逐条insert 失败的记录
/* if (operationLogEquityMapper.insertSelective(l) < 1) { if (operationLogEquityMapper.insertSelective(l) < 1) {
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
}*/ }
}); });
} }
...@@ -344,7 +345,7 @@ public class DataInitTest extends CommonIT { ...@@ -344,7 +345,7 @@ public class DataInitTest extends CommonIT {
} }
} }
}); });
/* if (organizationMapper.insertSelective(org) < 0) { if (organizationMapper.insertSelective(org) < 0) {
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
} }
if (organizationExtraMapper.insertSelective(orgEx) < 0) { if (organizationExtraMapper.insertSelective(orgEx) < 0) {
...@@ -352,7 +353,7 @@ public class DataInitTest extends CommonIT { ...@@ -352,7 +353,7 @@ public class DataInitTest extends CommonIT {
} }
if (organizationEmployeeMapper.insertSelective(orgEmp) < 0) { if (organizationEmployeeMapper.insertSelective(orgEmp) < 0) {
failList.putIfAbsent(orgK, orgV); failList.putIfAbsent(orgK, orgV);
}*/ }
insertExtraList(orgId); insertExtraList(orgId);
} }
}); });
...@@ -366,7 +367,7 @@ public class DataInitTest extends CommonIT { ...@@ -366,7 +367,7 @@ public class DataInitTest extends CommonIT {
FileWriter writer; FileWriter writer;
FileWriter writer1; FileWriter writer1;
try { try {
writer = new FileWriter("C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info_failed.json"); writer = new FileWriter("src/main/resources/orgImport/company_info_failed.json");
writer.write(failedStr); writer.write(failedStr);
writer.flush(); writer.flush();
writer.close(); writer.close();
...@@ -374,7 +375,7 @@ public class DataInitTest extends CommonIT { ...@@ -374,7 +375,7 @@ public class DataInitTest extends CommonIT {
e.printStackTrace(); e.printStackTrace();
} }
try { try {
writer1 = new FileWriter("C:\\Users\\Gary J Li\\Documents\\PwcDoc\\DD2018\\admin文档\\初始化\\company_info_msg.txt"); writer1 = new FileWriter("src/main/resources/orgImport/company_info_msg.txt");
writer1.write(failMsg.toString()); writer1.write(failMsg.toString());
writer1.flush(); writer1.flush();
writer1.close(); writer1.close();
......
...@@ -126,8 +126,8 @@ public interface CitJournalEntryAdjustMapper extends MyMapper { ...@@ -126,8 +126,8 @@ public interface CitJournalEntryAdjustMapper extends MyMapper {
/** /**
* fetch data by projectId * fetch data by projectId
* *
* @param projectId * @param record
* @return List<CitJournalEntryAdjust> * @return List<CitJournalEntryAdjust>
*/ */
List<CitJournalEntryAdjust> getJournalMerge(String projectId); List<CitJournalEntryAdjust> getJournalMerge(CitJournalEntryAdjust record);
} }
\ No newline at end of file
...@@ -58,7 +58,6 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -58,7 +58,6 @@ public interface FormulaAdminMapper extends MyMapper {
List<GroupId> getTemplateGroupId(@Param("projectId") String projectId); List<GroupId> getTemplateGroupId(@Param("projectId") String projectId);
@Select("SELECT " + @Select("SELECT " +
" p.id " + " p.id " +
"FROM " + "FROM " +
...@@ -97,41 +96,41 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -97,41 +96,41 @@ public interface FormulaAdminMapper extends MyMapper {
" source_cell.row_name AS rowName," + " source_cell.row_name AS rowName," +
" source_cell.data_type AS resultType " + " source_cell.data_type AS resultType " +
"from (" + "from (" +
" select " + " select " +
" template.template_id AS reportTemplateID," + " template.template_id AS reportTemplateID," +
" template.template_group_id AS reportTemplateGroupID," + " template.template_group_id AS reportTemplateGroupID," +
" template.code AS reportCode," + " template.code AS reportCode," +
" cell_template.row_index AS rowIndex " + " cell_template.row_index AS rowIndex " +
" from period_template as template " + " from period_template as template " +
" inner join period_cell_template as cell_template" + " inner join period_cell_template as cell_template" +
" on template.template_id = cell_template.report_template_id" + " on template.template_id = cell_template.report_template_id" +
" where template.template_group_id = #{templateGroupId}" + " where template.template_group_id = #{templateGroupId}" +
" and template.is_active_association = 1" + " and template.is_active_association = 1" +
" and template.code = #{code}" + " and template.code = #{code}" +
" and template.project_id = #{projectId}" + " and template.project_id = #{projectId}" +
" and template.period = #{period}" + " and template.period = #{period}" +
" and cell_template.project_id = #{projectId}" + " and cell_template.project_id = #{projectId}" +
" and cell_template.period = #{period}" + " and cell_template.period = #{period}" +
" and cell_template.column_index = #{rowColumnIndex}" + " and cell_template.column_index = #{rowColumnIndex}" +
" and cell_template.row_name = #{rowName}) as detail," + " and cell_template.row_name = #{rowName}) as detail," +
" period_cell_template as source_cell" + " period_cell_template as source_cell" +
" where source_cell.project_id = #{projectId}" + " where source_cell.project_id = #{projectId}" +
" and source_cell.period = #{period}" + " and source_cell.period = #{period}" +
" and detail.reportTemplateID = source_cell.report_template_id" + " and detail.reportTemplateID = source_cell.report_template_id" +
" and detail.rowIndex = source_cell.row_index" + " and detail.rowIndex = source_cell.row_index" +
" and source_cell.column_index = #{columnIndex}" " and source_cell.column_index = #{columnIndex}"
) )
List<CellTemplatePerGroupDto> getCellTemplateByNameAndIndex( List<CellTemplatePerGroupDto> getCellTemplateByNameAndIndex(
@Param("templateGroupId") Long templateGroupId, @Param("templateGroupId") Long templateGroupId,
@Param("code") String code, @Param("code") String code,
@Param("rowColumnIndex") Integer rowColumnIndex, @Param("rowColumnIndex") Integer rowColumnIndex,
@Param("rowName") String rowName, @Param("rowName") String rowName,
@Param("columnIndex") Integer columnIndex, @Param("columnIndex") Integer columnIndex,
@Param("projectId") String projectId, @Param("projectId") String projectId,
@Param("period") Integer period); @Param("period") Integer period);
List<CellTemplatePerGroupDto> getCellTemplateByTypeAndIndex( List<CellTemplatePerGroupDto> getCellTemplateByTypeAndIndex(
@Param("templateGroupId") Long templateGroupId, @Param("templateGroupId") Long templateGroupId,
@Param("projectId") String projectId, @Param("projectId") String projectId,
@Param("code") String code, @Param("code") String code,
...@@ -144,4 +143,48 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -144,4 +143,48 @@ public interface FormulaAdminMapper extends MyMapper {
@Param("orgId") String orgId, @Param("orgId") String orgId,
@Param("startDate") String startDate, @Param("startDate") String startDate,
@Param("endDate") String endDate); @Param("endDate") String endDate);
@Select("" +
"SELECT " +
" cell_template.cell_template_id AS cellTemplateID, " +
" template.template_id AS reportTemplateID, " +
" template.template_group_id AS reportTemplateGroupID, " +
" cell_template.row_index AS rowIndex, " +
" cell_template.column_index AS columnIndex, " +
" template.code AS reportCode, " +
" cell_template.column_name AS columnName, " +
" cell_template.row_name AS rowName, " +
" cell_template.data_type AS resultType " +
"d.data AS content" +
"FROM " +
" period_template template " +
" LEFT JOIN period_cell_template cell_template ON template.template_id = cell_template.report_template_id " +
" LEFT JOIN period_cell_data d on d.cell_template_id = cell_template.cell_template_id" +
"WHERE " +
" template.template_id IN ( SELECT template_id FROM period_template WHERE template_group_id = #{templateGroupId} " +
" AND is_active_association = 1 AND code = #{code} ) " +
" AND row_index = #{cellRow} " +
" AND column_index = #{cellCol} " +
" AND template.project_id = #{projectId} " +
" AND template.period = #{period} " +
" AND cell_template.project_id = #{projectId} " +
" AND cell_template.period = #{period}" +
"")
List<CellTemplatePerGroupDto> getCellDataByPos(@Param("templateId") Long templateId, @Param("period") Integer period, @Param("cellRow") String cellRow, @Param("cellCol") String cellCol, @Param("projectId") String projectId);
@Select("" +
"SELECT " +
"${getField} as data" +
"FROM ${tableName} " +
"inner join project pro on pro.organization_id = t.organization_id " +
" and ${selectFilter}" +
" and pro.year = #{year}" +
"")
List<CellTemplatePerGroupDto> getTableData(@Param("tableName") String tableName,
@Param("getField") String getField,
@Param("selectFilter") String selectFilter,
@Param("year") String year,
@Param("selectPeriod") String selectPeriod);
} }
...@@ -15,6 +15,24 @@ public class CellTemplatePerGroupDto { ...@@ -15,6 +15,24 @@ public class CellTemplatePerGroupDto {
private String rowName; private String rowName;
private String columnName; private String columnName;
private Integer resultType; private Integer resultType;
private Long Content;
String Data;
public String getData() {
return Data;
}
public void setData(String data) {
Data = data;
}
public Long getContent() {
return Content;
}
public void setContent(Long content) {
Content = content;
}
public String getCellTemplateId() { public String getCellTemplateId() {
return cellTemplateId; return cellTemplateId;
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.CashFlowCondition;
import pwc.taxtech.atms.vat.entity.CashFlow;
import pwc.taxtech.atms.vat.entity.CashFlowExample;
@Mapper
public interface CashFlowFinalMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
long countByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int deleteByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int insert(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int insertSelective(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
List<CashFlow> selectByExampleWithRowbounds(CashFlowExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
List<CashFlow> selectByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
CashFlow selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int updateByExample(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_final
*
* @mbg.generated
*/
int updateByPrimaryKey(CashFlow record);
List<CashFlow> selectByCondition(@Param("cfCondition") CashFlowCondition condition);
Integer selectCountByCondition(@Param("cfCondition") CashFlowCondition condition);
int insertBatch(List<CashFlow> cfs);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.CashFlowCondition;
import pwc.taxtech.atms.vat.entity.CashFlow;
import pwc.taxtech.atms.vat.entity.CashFlowExample;
@Mapper
public interface CashFlowManualMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
long countByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int deleteByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int insert(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int insertSelective(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
List<CashFlow> selectByExampleWithRowbounds(CashFlowExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
List<CashFlow> selectByExample(CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
CashFlow selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int updateByExample(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CashFlow record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cash_flow_manual
*
* @mbg.generated
*/
int updateByPrimaryKey(CashFlow record);
List<CashFlow> selectByCondition(@Param("cfCondition") CashFlowCondition condition);
Integer selectCountByCondition(@Param("cfCondition") CashFlowCondition condition);
int insertBatch(List<CashFlow> cfs);
}
\ No newline at end of file
...@@ -107,4 +107,6 @@ public interface PeriodCellDataMapper extends MyVatMapper { ...@@ -107,4 +107,6 @@ public interface PeriodCellDataMapper extends MyVatMapper {
int updateByPrimaryKey(PeriodCellData record); int updateByPrimaryKey(PeriodCellData record);
int batchInsert(List<PeriodCellData> list); int batchInsert(List<PeriodCellData> list);
List<PeriodCellData> selectDataByCellTemplateIdAround(@Param("bufferString") String bufferString);
} }
\ No newline at end of file
...@@ -198,6 +198,18 @@ ...@@ -198,6 +198,18 @@
created_by, created_date, late_updated_by, created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time late_updated_date, create_time, update_time
from cit_journal_entry_adjust where project_id='' from cit_journal_entry_adjust where project_id=''
<if test="orgCode != null">
and org_code = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null">
and subject_code = #{record.subjectCode,jdbcType=VARCHAR}
</if>
<if test="orgName != null">
and org_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null">
and subject_name = #{subjectName,jdbcType=VARCHAR}
</if>
UNION ALL UNION ALL
select select
id, organization_id, project_id, tms_period as period ,date,source, ledger_id, ledger_name, currency_code, id, organization_id, project_id, tms_period as period ,date,source, ledger_id, ledger_name, currency_code,
...@@ -206,6 +218,18 @@ ...@@ -206,6 +218,18 @@
segment1_name as org_name, segment3_name as subject_name, accounted_dr, accounted_cr, segment1_name as org_name, segment3_name as subject_name, accounted_dr, accounted_cr,
created_by, created_date, late_updated_by, late_updated_date, create_time, update_time created_by, created_date, late_updated_by, late_updated_date, create_time, update_time
from journal_entry where project_id='' from journal_entry where project_id=''
<if test="orgCode != null">
and segment1 = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null">
and segment3 = #{subjectCode,jdbcType=VARCHAR}
</if>
<if test="orgName != null">
and segment1_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null">
and segment3_name = #{subjectName,jdbcType=VARCHAR}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.CashFlowMapper">
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(cfCondition.orgId)">
AND entity_code= #{cfCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="cfCondition.periodStart!=null">
AND tms_period &gt;= #{cfCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="cfCondition.periodEnd!=null">
AND tms_period &lt;= #{cfCondition.periodEnd,jdbcType=INTEGER}
</if>
</sql>
<!--<sql id="Base_Column_List">-->
<!--&lt;!&ndash;-->
<!--WARNING - @mbg.generated-->
<!--This element is automatically generated by MyBatis Generator, do not modify.-->
<!--&ndash;&gt;-->
<!--id, `date`, `source`, period, `status`, ledger_id, ledger_name, ledger_currency_code,-->
<!--entity_code, entity_name, category, frequency, item_name, item_name2, period_amt,-->
<!--ytd_amt, create_time, update_time-->
<!--</sql>-->
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.CashFlowCondition" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from cash_flow_final
where
<include refid="QueryCondition"/>
</select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.CashFlowCondition" resultType="Integer">
select
count(*)
from cash_flow_final
where
<include refid="QueryCondition"/>
</select>
<insert id="insertBatch" parameterType="java.util.List">
insert into cash_flow_final
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.tmsPeriod != null">#{item.tmsPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.status != null">#{item.status,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerId != null">#{item.ledgerId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerName != null">#{item.ledgerName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerCurrencyCode != null">#{item.ledgerCurrencyCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.entityCode != null">#{item.entityCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.entityName != null">#{item.entityName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.category != null">#{item.category,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.frequency != null">#{item.frequency,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.itemName != null">#{item.itemName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.itemName2 != null">#{item.itemName2,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.periodAmt != null">#{item.periodAmt,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.ytdAmt != null">#{item.ytdAmt,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.CashFlowMapper">
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(cfCondition.orgId)">
AND entity_code= #{cfCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="cfCondition.periodStart!=null">
AND tms_period &gt;= #{cfCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="cfCondition.periodEnd!=null">
AND tms_period &lt;= #{cfCondition.periodEnd,jdbcType=INTEGER}
</if>
</sql>
<!--<sql id="Base_Column_List">-->
<!--&lt;!&ndash;-->
<!--WARNING - @mbg.generated-->
<!--This element is automatically generated by MyBatis Generator, do not modify.-->
<!--&ndash;&gt;-->
<!--id, `date`, `source`, period, `status`, ledger_id, ledger_name, ledger_currency_code,-->
<!--entity_code, entity_name, category, frequency, item_name, item_name2, period_amt,-->
<!--ytd_amt, create_time, update_time-->
<!--</sql>-->
<select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.CashFlowCondition" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from cash_flow_manual
where
<include refid="QueryCondition"/>
</select>
<select id="selectCountByCondition" parameterType="pwc.taxtech.atms.vat.dpo.CashFlowCondition" resultType="Integer">
select
count(*)
from cash_flow_manual
where
<include refid="QueryCondition"/>
</select>
<insert id="insertBatch" parameterType="java.util.List">
insert into cash_flow_manual
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.tmsPeriod != null">#{item.tmsPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.status != null">#{item.status,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerId != null">#{item.ledgerId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerName != null">#{item.ledgerName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerCurrencyCode != null">#{item.ledgerCurrencyCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.entityCode != null">#{item.entityCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.entityName != null">#{item.entityName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.category != null">#{item.category,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.frequency != null">#{item.frequency,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.itemName != null">#{item.itemName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.itemName2 != null">#{item.itemName2,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.periodAmt != null">#{item.periodAmt,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.ytdAmt != null">#{item.ytdAmt,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
</mapper>
\ No newline at end of file
...@@ -92,4 +92,11 @@ ...@@ -92,4 +92,11 @@
</foreach>; </foreach>;
SELECT 1 FROM DUAL; SELECT 1 FROM DUAL;
</insert> </insert>
<select id = "selectDataByCellTemplateIdAround" parameterType="java.lang.String" resultType="pwc.taxtech.atms.vat.entity.PeriodCellData">
select * from period_cell_data t where 1=1
<if test="bufferString != null and bufferString != '' ">
and t.cell_template_id in #{bufferString}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -985,7 +985,7 @@ init-row="initRow" init-col="initCol" service-type="\'6\'" is-document-list="tru ...@@ -985,7 +985,7 @@ init-row="initRow" init-col="initCol" service-type="\'6\'" is-document-list="tru
function ($scope, $stateParams, appTranslation) { function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.cit]); appTranslation.load([appTranslation.cit]);
}], }],
template: '<cit-caculate-data></cit-caculate-data>', template: '<cit-calculate-data></cit-calculate-data>',
} }
}, },
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit), resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.cit),
......
...@@ -105,5 +105,6 @@ ...@@ -105,5 +105,6 @@
"CreditAmount": "Credit Amount", "CreditAmount": "Credit Amount",
"BeginningBalance": "Beginning Balance", "BeginningBalance": "Beginning Balance",
"EndingBalance": "Ending Balance", "EndingBalance": "Ending Balance",
"Attribute": "Attribute" "Attribute": "Attribute",
"MainBodyCode": "Main Body Code"
} }
\ No newline at end of file
...@@ -1140,7 +1140,8 @@ ...@@ -1140,7 +1140,8 @@
"citSalaryAdvance" : "预提重分类数据源", "citSalaryAdvance" : "预提重分类数据源",
"assetLabelNumber" : "资产标签号", "assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额", "compensationSaleAmount" : "赔偿/变卖金额",
"EAMDisposal" : "EAM资产处理金额" "EAMDisposal" : "EAM资产处理金额",
"MainBodyCode": "主体代码"
} }
\ No newline at end of file
...@@ -387,10 +387,8 @@ ...@@ -387,10 +387,8 @@
$scope.templateFormulaList = getResult.data.filter(function (item) { $scope.templateFormulaList = getResult.data.filter(function (item) {
return !item.isReadOnly; return !item.isReadOnly;
}); });
refreshSpreadUI(); refreshSpreadUI();
}); });
}; };
// 刷新选中的过滤凭证科目代码 // 刷新选中的过滤凭证科目代码
...@@ -1522,8 +1520,6 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>'); ...@@ -1522,8 +1520,6 @@ ng-show="hasEditPermission && ToggleSaveAs && editModel.hasModel"/>');
$scope.activeSheet.setActiveCell(row.rowIndex, row.columnIndex); $scope.activeSheet.setActiveCell(row.rowIndex, row.columnIndex);
releaseParameter(); releaseParameter();
} }
//spreadJsTipService.setCellTipString(cell, "测试数据源"); //spreadJsTipService.setCellTipString(cell, "测试数据源");
}); });
} }
......
<div class="popover">
<div class="popover-content">
<div>
<table class=" table table-responsive">
<tr>
<td><span translate="TaxAccountDifference"></span></td>
<td>
<!--税会差异的选择-->
<div class="input-group">
<div class="option" style="display: inline-block">
<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>
</div>
</div>
</td>
</tr>
<tr>
<td><span translate="AccountCode"></span></td>
<td>
<div class="input-group">
<input class="form-control " type="text" id="accountCode" placeholder=""
ng-model="filterData.accountCode">
<a class="input-group-addon btn btn-sm" ng-click="popTheParentCode()"><i
class="fa fa-columns" aria-hidden="true"></i></a>
</div>
</td>
</tr>
<tr>
<td><span translate="AccountName"></span></td>
<td><input class="form-control " type="text" id="accountName" placeholder=""
ng-model="filterData.accountName"></td>
</tr>
<tr>
<td><span translate="DebitOpeningBalance"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right;"
type="text" id="debitOpeningBalanceFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.debitOpeningBalanceFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="debitOpeningBalanceTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.debitOpeningBalanceTo">
</div>
</td>
</tr>
<tr>
<td><span translate="CreditOpeningBalance"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="creditOpeningBalanceFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.creditOpeningBalanceFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="creditOpeningBalanceTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.creditOpeningBalanceTo">
</div>
</td>
</tr>
<tr>
<td><span translate="AccumulatedDebitAmount"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="accumulatedDebitAmountFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.accumulatedDebitAmountFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="accumulatedDebitAmountTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.accumulatedDebitAmountTo">
</div>
</td>
</tr>
<tr>
<td><span translate="AccumulatedCreditAmount"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="accumulatedCreditAmountFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.accumulatedCreditAmountFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="accumulatedCreditAmountTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.accumulatedCreditAmountTo">
</div>
</td>
</tr>
<tr>
<td><span translate="DebitClosingBalance"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="debitClosingBalanceFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.debitClosingBalanceFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="debitClosingBalanceTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.debitClosingBalanceTo">
</div>
</td>
</tr>
<tr>
<td><span translate="CreditClosingBalance"></span></td>
<td>
<div>
<input class="form-control input-width-small" style="width: 115px; text-align: right;"
type="text" id="creditClosingBalanceFrom" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.creditClosingBalanceFrom">
-
<input class="form-control input-width-small" style="width: 115px; text-align: right; "
type="text" id="creditClosingBalanceTo" ng-keyup="PWC.inputNumberFormat(this);"
placeholder="" ng-model="filterData.creditClosingBalanceTo">
</div>
</td>
</tr>
</table>
</div>
<div class="row">
<div style="float:right">
<button class="btn btn-default btn-primary" ng-click="doDataFilter()">
<span class="fa fa-chevron-down" aria-hidden="true"> </span> <span translate="Confirm"></span>
</button>
<button class="btn btn-default" style="margin-right:15px" type="button" ng-click="doDataFilterReset()">
<span class="fa fa-times" aria-hidden="true"> </span> <span translate="Reset"></span>
</button>
</div>
</div>
</div>
</div>
...@@ -989,9 +989,9 @@ ...@@ -989,9 +989,9 @@
//scrolling: { mode: "virtual" }, //scrolling: { mode: "virtual" },
noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'), noDataText: $translate.instant('AccountVoucher_DataGrid_NoDataText'),
height: '99%', height: '99%',
filterRow: { // filterRow: {
visible: true // visible: true
}, // },
onRowUpdating: function (e) { onRowUpdating: function (e) {
var data = $.extend({}, e.oldData, e.newData); var data = $.extend({}, e.oldData, e.newData);
if(data.isRetain == true) if(data.isRetain == true)
...@@ -1005,6 +1005,10 @@ ...@@ -1005,6 +1005,10 @@
targetArray.push(data); targetArray.push(data);
}, },
onToolbarPreparing: function (e) { onToolbarPreparing: function (e) {
e.toolbarOptions.items.unshift({
location: "after",
template: "totalGroupCount"
});
var toolbarItems = e.toolbarOptions.items; var toolbarItems = e.toolbarOptions.items;
var savebutton = _.find(e.toolbarOptions.items, function (m) { return m.name === "saveButton" }); var savebutton = _.find(e.toolbarOptions.items, function (m) { return m.name === "saveButton" });
var defaultFun = savebutton.options.onClick; var defaultFun = savebutton.options.onClick;
......
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
<span class="active" ng-click="switchTab($event,2)">{{'FixedAssets' | translate}}</span><span <span class="active" ng-click="switchTab($event,2)">{{'FixedAssets' | translate}}</span><span
ng-click="switchTab($event,3)">{{'LongTermPrepaid' | translate}}</span><span ng-click="switchTab($event,3)">{{'LongTermPrepaid' | translate}}</span><span
ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span> ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span>
<!--税会差异的选择-->
<!--<div class="option" style="display: inline-block">-->
<!--<span>{{'TaxAccountDifference' | translate}}</span>-->
<!--<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>-->
<!--</div>-->
</div> </div>
</div> </div>
<!--导入界面--> <!--导入界面-->
...@@ -50,19 +54,19 @@ ...@@ -50,19 +54,19 @@
<!--</div>--> <!--</div>-->
<div class="form-group"> <div class="form-group">
<div class="col-sm-5"> <div class="col-sm-5">
<input class="form-control" type="text" name="fileName" <input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required> value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx" <button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}} class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button> </button>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn" <button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn"
ng-click="importDataNew()"></button> ng-click="importDataNew()"></button>
</div> </div>
</div> </div>
...@@ -152,11 +156,6 @@ ...@@ -152,11 +156,6 @@
<!--计算结果显示界面--> <!--计算结果显示界面-->
<div id="tab_Assets" ng-if="displayType >1"> <div id="tab_Assets" ng-if="displayType >1">
<!--税会差异的选择-->
<div class="option">
<span>{{'TaxAccountDifference' | translate}}</span>
<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>
</div>
<!--计算结果--> <!--计算结果-->
<div class="total-Wrapper"> <div class="total-Wrapper">
<span>{{'TotalNumber' | translate}}<span class="total_span">{{TotalCount}}</span> {{'RecordCount' | translate}}</span> <span>{{'TotalNumber' | translate}}<span class="total_span">{{TotalCount}}</span> {{'RecordCount' | translate}}</span>
...@@ -170,7 +169,18 @@ ...@@ -170,7 +169,18 @@
<!--资产清单结果集--> <!--资产清单结果集-->
<div class="dt-asset-result"> <div class="dt-asset-result">
<!--<asset-list-edit-modal asset-type="displayType-1" type="0"></asset-list-edit-modal>--> <!--<asset-list-edit-modal asset-type="displayType-1" type="0"></asset-list-edit-modal>-->
<div id="assetsResultGrid" dx-data-grid="assetsResultGridOptions"></div> <div id="assetsResultGrid" dx-data-grid="assetsResultGridOptions">
<div style="display: inline-block" data-options="dxTemplate:{ name:'totalGroupCount' }">
<button class="filter-button"
atms-popover ng-mouseenter="prepareSummary()"
popover-container="body" popover-auto-hide="true" data-overwrite="true"
use-optimized-placement-algorithm="true"
data-placement="bottom"
data-templateurl="/app/cit/import/cit-import-asset-list/cit-import-asset-list-search.html">
<i class="fa fa-filter" aria-hidden="true"></i>
</button>
</div>
</div>
</div> </div>
</div> </div>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
.active { .active {
background-color: #F91000; background-color: #F91000;
} }
} }
} }
...@@ -303,19 +304,6 @@ ...@@ -303,19 +304,6 @@
/*font-size:13px !important;*/ /*font-size:13px !important;*/
} }
} }
.option {
margin-top: 10px;
margin-bottom: 10px;
}
.option > span {
margin-right: 10px;
}
.option > .dx-selectbox {
display: inline-block;
vertical-align: middle;
}
} }
.error-list-modal { .error-list-modal {
...@@ -402,3 +390,62 @@ ...@@ -402,3 +390,62 @@
} }
} }
.option {
margin-top: 10px;
margin-bottom: 10px;
}
.option > span {
margin-right: 10px;
}
.option > .dx-selectbox {
display: inline-block;
vertical-align: middle;
}
.filter-button {
width: 30px;
//margin-top: 16px;
}
.popover {
min-width: 370px;
.arrow {
left: 5% !important;
}
}
.popover-content {
td {
text-align: right;
padding: 6px;
span {
float: left;
}
}
.form-control {
display: inline-block;
&:focus {
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
}
}
.input-width-small {
width: 100px;
}
.input-width-middle {
width: 217px;
}
}
...@@ -5,52 +5,35 @@ ...@@ -5,52 +5,35 @@
<table class="table table-responsive"> <table class="table table-responsive">
<tr> <tr>
<td> <td>
<span translate="TBAccountCode"></span> <span translate="AccountCode"></span>
<input class="form-control input-width-middle" type="text" id="segment3" ng-model="queryParams.segment3" /> <input class="form-control input-width-middle" type="text" id="subjectCode" ng-model="queryParams.subjectCode" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span translate="AccountName"></span> <span translate="AccountName"></span>
<input class="form-control input-width-middle" type="text" id="segment3Name" ng-model="queryParams.segment3Name" /> <input class="form-control input-width-middle" type="text" id="subjectName" ng-model="queryParams.subjectName" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span translate="ProfitCenterCode"></span> <span translate="orgCode"></span>
<input class="form-control input-width-middle" type="text" id="segment5" ng-model="queryParams.segment5" /> <input class="form-control input-width-middle" type="text" id="orgCode" ng-model="queryParams.orgCode" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span translate="ProfitCenterName"></span> <span translate="orgName"></span>
<input class="form-control input-width-middle" type="text" id="segment5Name" ng-model="queryParams.segment5Name" /> <input class="form-control input-width-middle" type="text" id="orgName" ng-model="queryParams.orgName" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<span translate="ProductCode"></span> <span translate="DocumentDate"></span>
<input class="form-control input-width-middle" type="text" id="segment6" ng-model="queryParams.segment6" /> <input class="form-control input-width-middle" type="text" id="documentDate" ng-model="queryParams.documentDate" />
</td>
</tr>
<tr>
<td>
<span translate="TBProductName"></span>
<input class="form-control input-width-middle" type="text" id="segment6Name" ng-model="queryParams.segment6Name" />
</td>
</tr>
<tr>
<td>
<span translate="Summary"></span>
<input class="form-control input-width-middle" type="text" id="description" ng-model="queryParams.description" />
</td>
</tr>
<tr>
<td>
<span translate="IsContainsAdjustmentRecord"></span>
<input class="form-control input-width-middle" type="text" id="containsAdjustmentRecord" ng-model="queryParams.containsAdjustmentRecord" />
</td> </td>
</tr> </tr>
<!--<tr> <!--<tr>
<td> <td>
<span translate="InvoiceFPLXQuery"></span> <span translate="InvoiceFPLXQuery"></span>
......
...@@ -39,15 +39,11 @@ ...@@ -39,15 +39,11 @@
pageInfo: {}, pageInfo: {},
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
// orgId: '', subjectCode: null,
// segment3: null, subjectName: null,
// segment3Name: null, orgCode: null,
// segment5: null, orgName: null,
// segment5Name: null, documentDate: null,
// segment6: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
projectId: vatSessionService.project.id projectId: vatSessionService.project.id
}; };
}; };
...@@ -153,39 +149,33 @@ ...@@ -153,39 +149,33 @@
//将选择了的查询条件显示在grid上方 //将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) { var doDataFilter = function (removeData) {
// if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) { if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
// $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.segment3 === null) { if ($scope.queryParams.subjectCode === null) {
// $scope.queryParams.segment3 = ''; $scope.queryParams.subjectCode = '';
// } }
// if ($scope.queryParams.segment3Name === null) { if ($scope.queryParams.subjectName === null) {
// $scope.queryParams.segment3Name = ''; $scope.queryParams.subjectName = '';
// } }
// if ($scope.queryParams.segment5 === null) { if ($scope.queryParams.orgCode === null) {
// $scope.queryParams.segment5Name = ''; $scope.queryParams.orgCode = '';
// } }
// if ($scope.queryParams.segment6 === null) { if ($scope.queryParams.orgName === null) {
// $scope.queryParams.segment6 = ''; $scope.queryParams.orgName = '';
// } }
// if ($scope.queryParams.segment6Name === null) { if ($scope.queryParams.documentDate === null) {
// $scope.queryParams.segment6Name = ''; $scope.queryParams.documentDate = '';
// } }
// if ($scope.queryParams.description === null) { });
// $scope.queryParams.description = ''; }
// }
// if ($scope.queryParams.invoiceType === null) {
// $scope.InvoiceType.selected = undefined;
// }
// });
// }
loadJournalEntryDataFromDB(1); loadJournalEntryDataFromDB(1);
if ($scope.criteriaList.length > 6) { if ($scope.criteriaList.length > 6) {
...@@ -204,14 +194,11 @@ ...@@ -204,14 +194,11 @@
pageInfo: {}, pageInfo: {},
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
// segment3: null, subjectCode: null,
// segment3Name: null, subjectName: null,
// segment5: null, orgCode: null,
// segment5Name: null, orgName: null,
// segment6: null, documentDate: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
projectId: vatSessionService.project.id projectId: vatSessionService.project.id
}; };
$scope.queryParams.periodStart = $scope.startMonth; $scope.queryParams.periodStart = $scope.startMonth;
...@@ -318,8 +305,10 @@ ...@@ -318,8 +305,10 @@
{ name: $translate.instant('JournalName'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.name}}</span></div>' }, { name: $translate.instant('JournalName'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.name}}</span></div>' },
{ name: $translate.instant('DocumentNo'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.voucherNum}}</span></div>' }, { name: $translate.instant('DocumentNo'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.voucherNum}}</span></div>' },
{ name: $translate.instant('Summary'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.description}}</span></div>' }, { name: $translate.instant('Summary'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.description}}</span></div>' },
{ name: $translate.instant('MainBodyCode'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.orgCode}}</span></div>' },
{ name: $translate.instant('MainBodyDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.orgName}}</span></div>' }, { name: $translate.instant('MainBodyDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.orgName}}</span></div>' },
// { name: $translate.instant('CostCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment2Name}}</span></div>' }, // { name: $translate.instant('CostCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment2Name}}</span></div>' },
{ name: $translate.instant('AccountCode'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.subjectCode}}</span></div>' },
{ name: $translate.instant('SubjectDescription'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.subjectName}}</span></div>' }, { name: $translate.instant('SubjectDescription'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.subjectName}}</span></div>' },
// { name: $translate.instant('AuxiliaryAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4Name}}</span></div>' }, // { name: $translate.instant('AuxiliaryAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4Name}}</span></div>' },
// { name: $translate.instant('ProfitCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5Name}}</span></div>' }, // { name: $translate.instant('ProfitCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5Name}}</span></div>' },
......
<div id="cit-calculate-data">
<div class="cit-calculate-data-title" ng-if="tasks.length > 0">
<!--<span translate="vatCaculateDataDesc"></span>-->
<!--<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate()"></button>-->
<button class="btn btn-vat-primary" translate="startCaculateData" ng-disabled="readonly" ng-click="startCaculate2()"></button>
<span ng-click="showOperateLogPop()"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'Remarks' | translate}}</span>
</div>
<!--<div class="vat-caculate-data-progress progress progress-striped active">
<div class="progress-bar progress-bar-warning" role="progressbar"
aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
ng-style="{width:progress+'%'}">
<span>{{progress}}</span>
</div>
</div>-->
<div class="vat-caculate-data-progress">
<div class="Bar" ng-style="{width:progress+'%'}">
<div>{{progress}}%</div>
</div>
</div>
<div class="vat-caculate-data-list">
<perfect-scrollbar class="scroller" wheel-propagation="true" wheel-speed="1" min-scrollbar-length="20">
<div ng-repeat="group in tasks" ng-include="'group_template'" />
</perfect-scrollbar>
</div>
<script type="text/ng-template" id="group_template">
<div>
<div ng-if="group.items.length >= 1" class="task" style="margin-bottom:5px;padding-left:20px;">{{group.name}}</div>
<ul ng-if="group.items.length >= 1" ng-repeat="task in group.items track by $index">
<li ng-include="'task_template'" />
</ul>
<!-- <div ng-if="group.items.length == 1" ng-repeat="task in group.items track by $index" style="height:42px;" ng-include="'task_template'" />-->
</script>
<script type="text/ng-template" id="task_template">
<div class="task">
<span>{{task.name}}</span>
<span ng-if="task.status == 'unstarted'">{{task.text}}</span>
<span ng-if="task.status == 'unstarted'" style="align-content:center;"><i class="fa fa-hourglass-o" aria-hidden="true" style="font-size:18px;"></i></span>
<span ng-if="task.status == 'completed'">{{task.text}}</span>
<span ng-if="task.status == 'completed'" style="align-content:center;"><i class="fa fa-check" aria-hidden="true" style="color:#73BF00;font-size:28px;"></i></span>
<span ng-if="task.status == 'processing'">{{task.text}}</span>
<!--<span ng-if="task.status == 'processing'" class='loader--audioWave' />-->
<span ng-if="task.status == 'processing'" class='load' style="align-content:center;">
<span class="rect1"></span>
<span class="rect2"></span>
<span class="rect3"></span>
<span class="rect4"></span>
<spanmoduleType class="rect5"></spanmoduleType>
<!--<img src="/app-resources/images/loading.gif" alt="loading...">-->
</span>
<span ng-if="task.status == 'error'" style="color:red;">{{task.text}}</span>
<span ng-if="task.status == 'error'" style="color:red;align-content:center;"><i class="fa fa-times" aria-hidden="true" style="color:red;font-size:28px;"></i></span>
</div>
</script>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
</div>

vatModule.directive('citCalculateData', ['$log',
function ($log) {
'use strict';
$log.debug('citCalculateData.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/cit/reduction/cit-calculate-data/cit-calculate-data.html' + '?_=' + Math.random(),
replace: true,
scope: {},
controller: 'citCalculateDataController',
link: function ($scope, $element, $attr) {
$scope.token = $('input[name="__RequestVerificationToken"]').val();
}
};
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
#cit-calculate-data {
width: 100%;
height: 100%;
padding: 0 10px;
position: relative;
background-color: @color-white;
.cit-calculate-data-title {
margin: 20px 0;
height: 30px;
line-height: 30px;
vertical-align: middle;
/*
span {
font-weight: bold;
}
*/
button {
background-color: @color-deep-red;
color: @color-white;
}
span {
float: right;
margin: 0 0 20px 0;
cursor: pointer;
}
}
.vat-caculate-data-progress {
width: 100%;
border: 1px solid @color-light-gray;
border-radius: 8px;
height: 16px;
text-align: center;
line-height: 16px;
font-weight: bold;
color: #fff;
overflow: hidden;
.Bar {
width: 50%;
height: 16px;
background: @color-red;
}
}
.vat-caculate-data-list {
height: calc(~"100% - 100px");
width: 100%;
margin: 10px 0;
padding: 0 5px;
overflow-y: auto;
font-weight: bold;
font-size: 14px;
.scroller {
/*white-space: pre-line;*/
overflow-y: hidden;
position: relative;
height: 100%;
}
.task {
width: 100%;
height: 40px;
line-height: 40px;
vertical-align: middle;
border-bottom: 1px solid @color-light-gray;
> span:first-child {
margin-left: 20px;
width:auto;
float: left;
}
> span {
float: right;
margin-right: 20px;
width: 80px;
height: 39px;
line-height: 39px;
vertical-align: middle;
align-content:center;
}
}
li {
list-style: none;
img {
width: 28px;
height: 28px;
}
}
.loader--audioWave {
width: 3em;
height: 2em;
background: linear-gradient(@color-orange, @color-orange) 0 50%, linear-gradient(@color-orange, @color-orange) 0.625em 50%, linear-gradient(@color-orange, @color-orange) 1.25em 50%, linear-gradient(@color-orange, @color-orange) 1.875em 50%, linear-gradient(@color-orange, @color-orange) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
animation: audioWave 1.5s linear infinite;
}
@keyframes audioWave {
25% {
background: linear-gradient(#FFD700, #FFD700) 0 50% 0.5em 2em, linear-gradient(@color-orange, @color-orange) 0.625em 50%, linear-gradient(@color-orange, @color-orange) 1.25em 50%, linear-gradient(@color-orange, @color-orange) 1.875em 50%, linear-gradient(@color-orange, @color-orange) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 100%, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
}
37.5% {
background: linear-gradient(@color-orange, @color-orange) 0 50%, linear-gradient(#FFD700, #FFD700) 0.625em 50%, linear-gradient(@color-orange, @color-orange) 1.25em 50%, linear-gradient(@color-orange, @color-orange) 1.875em 50%, linear-gradient(@color-orange, @color-orange) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 0.25em, 0.5em 100%, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em;
}
50% {
background: linear-gradient(@color-orange, @color-orange) 0 50%, linear-gradient(@color-orange, @color-orange) 0.625em 50%, linear-gradient(#FFD700, #FFD700) 1.25em 50%, linear-gradient(@color-orange, @color-orange) 1.875em 50%, linear-gradient(@color-orange, @color-orange) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 100%, 0.5em 0.25em, 0.5em 0.25em;
}
62.5% {
background: linear-gradient(@color-orange, @color-orange) 0 50%, linear-gradient(@color-orange, @color-orange) 0.625em 50%, linear-gradient(@color-orange, @color-orange) 1.25em 50%, linear-gradient(#FFD700, #FFD700) 1.875em 50%, linear-gradient(@color-orange, @color-orange) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 100%, 0.5em 0.25em;
}
75% {
background: linear-gradient(@color-orange, @color-orange) 0 50%, linear-gradient(@color-orange, @color-orange) 0.625em 50%, linear-gradient(@color-orange, @color-orange) 1.25em 50%, linear-gradient(@color-orange, @color-orange) 1.875em 50%, linear-gradient(#FFD700, #FFD700) 2.5em 50%;
background-repeat: no-repeat;
background-size: 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 0.25em, 0.5em 100%;
}
}
.load {
width: 4em;
height: 2em;
> span {
background-color: @color-red;
width: 0.5em;
height: 2em;
display: inline-block;
transform: scaleY(0.125);
animation: stretchdelay 1.5s linear infinite;
}
.rect2 {
-webkit-animation-delay: 0.4s;
animation-delay: 0.4s;
}
.rect3 {
-webkit-animation-delay: 0.6s;
animation-delay: 0.6s;
}
.rect4 {
-webkit-animation-delay: 0.8s;
animation-delay: 0.8s;
}
.rect5 {
-webkit-animation-delay: 1.0s;
animation-delay: 1.0s;
}
}
@keyframes stretchdelay {
20% {
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
background-color: @color-yellow;
}
0%, 40%, 100% {
transform: scaleY(0.125);
-webkit-transform: scaleY(0.125);
}
}
}
}
...@@ -353,7 +353,6 @@ ...@@ -353,7 +353,6 @@
} }
}, 0); }, 0);
} }
return 0; return 0;
}; };
......
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
.checkbox-custom { .checkbox-custom {
float: left; float: left;
position: relative; position: relative;
margin-right : 10px;
margin-top: 0; margin-top: 0;
display: inline-block; display: inline-block;
} }
......
...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
.checkbox-custom { .checkbox-custom {
float: left; float: left;
position: relative; position: relative;
margin-right : 10px;
margin-top: 0; margin-top: 0;
display: inline-block; display: inline-block;
} }
......
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