Commit c81f690f authored by kevin's avatar kevin

#修改添加字段,deebugg自定义公式

parent 9371ad2f
......@@ -153,48 +153,71 @@ public class FormulaAgent {
if (split[0].indexOf(">=") != -1) {
filterValue = "> " + split[1] + "and" + filter + " =" + split[1];
}
if (split[0].indexOf("<=") != -1) {
} else if (split[0].indexOf("<=") != -1) {
filterValue = "< " + split[1] + "and" + filter + " =" + split[1];
} else {
filterValue = split[0] + "'" + split[1] + "'";
}
if ("CITZCFZB".equals(tableName) || ("CITLRB".equals(tableName))) {
if ("cit_balance_sheet_prc_adjust".equals(tableName) || ("cit_profit_prc_adjust".equals(tableName))) {
try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true);
} catch (Exception e) {
e.printStackTrace();
}
}
try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, false);
} catch (Exception e) {
e.printStackTrace();
}
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true);
return null;
}
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) {
String sql = "select " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
String _p = "";
if (formulaContext.getPeriod() - period < 10) {
_p = year + "'0" + (formulaContext.getPeriod() - period) + "'";
} else {
_p = year + (formulaContext.getPeriod() - period);
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) throws Exception {
String sql = "select " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1));
if (!bool) {
if (period == 0) {
sql += " and tms_period = " + year + _period;
} else if (period == -99) {
sql += " and tms_period between " + year + "01 and " + year + per;
} else if (period == 99) {
sql += " and tms_period between " + year + "01 and " + year + _period;
} else {
if (period > 0)
throw new Exception("参数不正确");
sql += " and tms_period between " + year + _p + " and " + year + per;
}
}
if (period == 0) {
sql += " and tms-period = " + formulaContext.getPeriod();
} else if (period == -99) {
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod() - 1);
} else if (period == 99) {
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod());
if (bool)
sql += " and period = " + year;
return sql;
}
public static String insertZero(Integer itr) {
String str = null;
if (itr < 10) {
str = "0" + itr;
} else {
sql += "and tms-period between " + _p + "and " + (formulaContext.getPeriod() - 1);
}
if (bool) {
sql += " and period = '" + year + period + "'";
str = "" + itr;
}
return sql;
return str;
}
@Autowired
JdbcTemplate jdbcTemplate;
public static void main(String[] args) {
System.out.println(buildSql("balance_sheet", "end_bal", "beg_bal", "> 0.00", 201810, "2", null));
;
}
/* public static void main(String[] args) {
FormulaAgent formulaAgent = new FormulaAgent();
FormulaContext formulaContext = new FormulaContext();
formulaContext.setPeriod(3);
formulaAgent.getTableDataByName("CITLRB", "end_bal", "item_name", "= 小帅哥", -3, "2018", formulaContext);
}*/
public Long getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
List<Map<String, Object>> stringObjectMap = jdbcTemplate.queryForList(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
......
......@@ -507,12 +507,9 @@ public class ReportServiceImpl extends BaseService {
@Override
public void run() {
try {
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
//进行数据校验
DataValidation(periodParam, projectId,genJob );
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
templates.stream().map(Template::getId).collect(Collectors.toList()));
......
......@@ -5,13 +5,9 @@ import org.apache.poi.ss.formula.eval.EvaluationException;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TableRule;
import pwc.taxtech.atms.exception.Exceptions;
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;
......@@ -66,7 +62,6 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
e.printStackTrace();
return new NumberEval(0.00);
}
return new NumberEval(0.00);
}
}
......@@ -133,7 +133,22 @@
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
select
id, organization_id as organizationId, project_id as projectId, period, source, occur_period as occurPeriod, asset_label_number as assetLabelNumber,
compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime
compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime,
oa_asset_bill_type oaAssetBillType,
oa_asset_number oaAssetNumber,
scrap_reason scrapReason,
asset_number assetNumber,
asset_label_number assetLabelNumber,
compensation_sale_amount compensationSaleAmount,
liable_employee_num liableEmployeeNum,
liable_employee_name liableEmployeeName,
remit_employee_num remitEmployeeNum,
remit_employee_name remitEmployeeName,
remit_time remitTime,
remit_amount remitAmount,
gathering_company_name gatheringCompanyName,
gathering_company_account gatheringCompanyAccount,
remark
from cit_eam_assets_disposal
WHERE
<include refid="QueryCondition"/>
......
......@@ -209,7 +209,37 @@
advance advance,
approved_standard_invoice_amount approvedStandardInvoiceAmount,
created_by createdBy,
create_time createTime
create_time createTime,
remark,
credit_prepaid_accounts as creditPrepaidAccounts,
debit_advance_gene as debitAdvanceGene,
ledger_id ledgerId,
exchange_rate exchangeRate,
reclassify_amount reclassifyAmount ,
check_one checkOne,
advance_write_off advanceWriteOff,
usable_balance usableBalance,
usable_invoice_amount usableInvoiceAmount,
paid_invoice_amount paidInvoiceAmount,
approved_standard_invoice_amount approvedStandardInvoiceAmount,
unexecuted_service_schedule unexecutedServiceSchedule,
advance advance ,
coupa_total_accept coupaTotalAccept,
executed_service_schedule executedServiceSchedule,
order_amount orderAmount,
currency currency,
standard_money standardMoney,
item item
supplier supplier,
cost_center costCenter,
cost_center_code costCenterCode,
po_subject_code poSubjectCode,
purchase_person purchasePerson,
lading_bill_person ladingBillPerson,
po_row poRow,
po_no poNo,
po_create_time poCreateTime,
from cit_salary_advance
WHERE
<include refid="QueryCondition"/>
......
......@@ -1141,7 +1141,56 @@
"assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额",
"EAMDisposal" : "EAM资产处理金额",
"MainBodyCode": "主体代码"
"MainBodyCode": "主体代码",
"remark" : "摘要",
"creditPrepaidAccounts" : "贷:预付账款",
"debitAdvanceGene" : "借:预提费用-系统生成",
"ledgerId" : "账套",
"exchangeRate" : "汇率",
"reclassifyAmount" : "重分类金额",
"checkOne" : "校验",
"advanceWriteOff" : "预提/(预付)冲销",
"usableBalance" : "可用预付款余额",
"usableInvoiceAmount" : "可用预付款发票金额",
"paidInvoiceAmount" : "已付标准发票总金额",
"approvedStandardInvoiceAmount" : "已批准标准发票金额",
"unexecutedServiceSchedule" : "未执行服务金额",
"advance": "预提",
"coupaTotalAccept": "COUPA接收合计",
"executedServiceSchedule" : "已执行服务进度",
"orderAmount" : "订购金额",
"currency" : "币种",
"standardMoney": "本位币",
"item" : "ITEM",
"supplier" : "供应商",
"costCenter" : "成本中心",
"costCenterCode" : "成本中心CODE",
"poSubjectCode" : "PO主体CODE",
"purchasePerson" : "请购人",
"ladingBillPerson":"提单人",
"poRow":"PO行",
"poNo":"PO号",
"zczzrxx" : "资产责任人信息",
"xkrxx" : "汇款人信息",
"skgsxx" : "收款公司信息",
"occurPeriod": "发生期间",
"oaAssetBillType" : "相关OA资产单单据类型",
"oaAssetNumber" : "相关OA资产单单号",
"scrapReason" : "报废原因",
"assetNumber" : "资产编号",
"assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额",
"liableEmployeeNum" : "员工工号",
"liableEmployeeName" : "员工姓名",
"remitEmployeeNum" : "员工工号",
"remitEmployeeName" : "员工姓名",
"remitTime" : "汇款时间",
"remitAmount" : "汇款金额",
"gatheringCompanyName" : "收款公司名称",
"gatheringCompanyAccount":"收款公司账号"
}
\ No newline at end of file
......@@ -28,12 +28,36 @@
function initAssetResultDxGrid() {
var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false, fixed: true },
{ caption: $translate.instant('period'), dataField: "period", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('source'), dataField: "source", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('assetLabelNumber'), dataField: "assetLabelNumber", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('compensationSaleAmount'), dataField: "compensationSaleAmount", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('createdBy'), dataField: "createBy", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('createTime'), dataField: "createTime", width: '15%', allowEditing: false, fixed: true }
{ caption: $translate.instant('occurPeriod'), dataField: "occurPeriod", allowEditing: false, fixed: true },
{ caption: $translate.instant('oaAssetBillType'), dataField: "oaAssetBillType", allowEditing: false, fixed: true },
{ caption: $translate.instant('oaAssetNumber'), dataField: "oaAssetNumber", allowEditing: false, fixed: true },
{ caption: $translate.instant('scrapReason'), dataField: "scrapReason", allowEditing: false, fixed: true },
{ caption: $translate.instant('assetNumber'), dataField: "assetNumber", allowEditing: false, fixed: true },
{ caption: $translate.instant('assetLabelNumber'), dataField: "assetLabelNumber", allowEditing: false, fixed: true },
{ caption: $translate.instant('compensationSaleAmount'), dataField: "compensationSaleAmount", allowEditing: false, fixed: true },
{
caption: $translate.instant('zczzrxx'), alignment: 'center',
columns: [
{ caption: $translate.instant('liableEmployeeNum'), dataField: "liableEmployeeNum", allowEditing: false, fixed: true },
{ caption: $translate.instant('liableEmployeeName'), dataField: "liableEmployeeName", allowEditing: false, fixed: true }
]
},{
caption: $translate.instant('xkrxx'), alignment: 'center',
columns: [
{ caption: $translate.instant('remitEmployeeNum'), dataField: "remitEmployeeNum", allowEditing: false, fixed: true },
{ caption: $translate.instant('remitEmployeeName'), dataField: "remitEmployeeName", allowEditing: false, fixed: true },
{ caption: $translate.instant('remitTime'), dataField: "remitTime", allowEditing: false, fixed: true },
{ caption: $translate.instant('remitAmount'), dataField: "remitAmount", allowEditing: false, fixed: true }
]
},
{
caption: $translate.instant('skgsxx'), alignment: 'center',
columns: [
{ caption: $translate.instant('gatheringCompanyName'), dataField: "gatheringCompanyName", allowEditing: false, fixed: true },
{ caption: $translate.instant('gatheringCompanyAccount'), dataField: "gatheringCompanyAccount", allowEditing: false, fixed: true }
]
},
{ caption: $translate.instant('remark'), dataField: "remark", allowEditing: false, fixed: true }
];
$scope.assetsResultGridOptions = {
......
......@@ -30,15 +30,36 @@
function initAssetResultDxGrid() {
var dupColumns = [
{ caption: $translate.instant('ImportErrorPopUpNoCol'), dataField: "index", width: 50, allowEditing: false, fixed: true },
{ caption: $translate.instant('poSubjectName'), dataField: "poSubjectName", width: '30%', allowEditing: false, fixed: true },
/* { caption: $translate.instant('organizationId'), dataField: "organizationId", width: 120, allowEditing: false, fixed: true },
{ caption: $translate.instant('ProjectNameCol'), dataField: "projectName", width: 120, allowEditing: false, fixed: true },*/
{ caption: $translate.instant('period'), dataField: "period", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('source'), dataField: "source", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('advancePrice'), dataField: "advance", width: '15%', allowEditing: false, fixed: true },
{ caption: $translate.instant('approvedPrice'), dataField: "approvedStandardInvoiceAmount", width: 200, allowEditing: false, fixed: true },
/* { caption: $translate.instant('createBy'), dataField: "createdBy", width: 200, allowEditing: false, fixed: true },*/
{ caption: $translate.instant('createTime'), dataField: "createTime", width: '15%', allowEditing: false, fixed: true }
{ caption: $translate.instant('poNo'), dataField: "poNo", allowEditing: false, fixed: true },
{ caption: $translate.instant('poRow'), dataField: "poRow", allowEditing: false, fixed: true },
{ caption: "PO创建日期", dataField: "createTime", allowEditing: false, fixed: true },
{ caption: $translate.instant('ladingBillPerson'), dataField: "ladingBillPerson", allowEditing: false, fixed: true },
{ caption: $translate.instant('purchasePerson'), dataField: "purchasePerson", width: 200, allowEditing: false, fixed: true },
{ caption: $translate.instant('poSubjectCode'), dataField: "poSubjectCode", allowEditing: false, fixed: true },
{ caption: $translate.instant('poSubjectName'), dataField: "poSubjectName", allowEditing: false, fixed: true },
{ caption: $translate.instant('costCenterCode'), dataField: "costCenterCode", allowEditing: false, fixed: true },
{ caption: $translate.instant('costCenter'), dataField: "costCenter", allowEditing: false, fixed: true },
{ caption: $translate.instant('supplier'), dataField: "supplier", allowEditing: false, fixed: true },
{ caption: $translate.instant('item'), dataField: "item", allowEditing: false, fixed: true },
{ caption: $translate.instant('standardMoney'), dataField: "standardMoney", allowEditing: false, fixed: true },
{ caption: $translate.instant('currency'), dataField: "currency", allowEditing: false, fixed: true },
{ caption: $translate.instant('orderAmount'), dataField: "orderAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('executedServiceSchedule'), dataField: "executedServiceSchedule", allowEditing: false, fixed: true },
{ caption: $translate.instant('coupaTotalAccept'), dataField: "coupaTotalAccept", allowEditing: false, fixed: true },
{ caption: $translate.instant('advance'), dataField: "advance", allowEditing: false, fixed: true },
{ caption: $translate.instant('unexecutedServiceSchedule'), dataField: "unexecutedServiceSchedule", allowEditing: false, fixed: true },
{ caption: $translate.instant('approvedStandardInvoiceAmount'), dataField: "approvedStandardInvoiceAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('paidInvoiceAmount'), dataField: "paidInvoiceAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('usableInvoiceAmount'), dataField: "usableInvoiceAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('usableBalance'), dataField: "usableBalance", allowEditing: false, fixed: true },
{ caption: $translate.instant('advanceWriteOff'), dataField: "advanceWriteOff", allowEditing: false, fixed: true },
{ caption: $translate.instant('checkOne'), dataField: "checkOne", allowEditing: false, fixed: true },
{ caption: $translate.instant('reclassifyAmount'), dataField: "reclassifyAmount", allowEditing: false, fixed: true },
{ caption: $translate.instant('exchangeRate'), dataField: "exchangeRate", allowEditing: false, fixed: true },
{ caption: $translate.instant('ledgerId'), dataField: "ledgerId", allowEditing: false, fixed: true },
{ caption: $translate.instant('debitAdvanceGene'), dataField: "debitAdvanceGene", allowEditing: false, fixed: true },
{ caption: $translate.instant('creditPrepaidAccounts'), dataField: "creditPrepaidAccounts", allowEditing: false, fixed: true },
{ caption: $translate.instant('remark'), dataField: "remark", allowEditing: false, fixed: true }
];
$scope.assetsResultGridOptions = {
......@@ -77,10 +98,8 @@
visible: true
},
onRowUpdating: function (e) {
},
onToolbarPreparing: function (e) {
}
}
}
......@@ -110,7 +129,6 @@
var initListData = function(){
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope.queryParams).success(function (res) {
$scope.listData = commonWebService._index(res.list);
$scope.queryParams.pagingOptions.totalItems = res.pageInfo.totalCount;
//$scope.$apply();
......
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