package com.changhong.epc; import ch.qos.logback.core.pattern.FormatInfo; import com.changhong.epc.bean.count.format.FormInfo; import com.changhong.epc.count.service.count.model.CountParamMax; import com.changhong.epc.count.service.count.model.CountResultLast; import com.changhong.epc.count.service.format.impl.FormatFormInfoCount; import com.iemsoft.framework.cloud.core.tools.JSONTool; import org.junit.Before; import org.junit.Test; public class CountTest { FormInfo formInfo; FormatFormInfoCount formatFormInfoCount; // @Before public void befor(){ formInfo = JSONTool.toObj("{\"data\":[{\"fieldKey\":\"number_expend\",\"mdCode\":\"\",\"value\":\"Rt00000020\",\"type\":\"auto\"},{\"fieldKey\":\"reimburseMan\",\"mdCode\":\"F000048\",\"value\":[\"20119064\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"budgetStartDate\",\"mdCode\":\"\",\"value\":\"2019-05-01\",\"type\":\"calendar\"},{\"fieldKey\":\"toWriteBudget\",\"mdCode\":\"\",\"value\":\"17\",\"type\":\"mytext\"},{\"fieldKey\":\"expend_department\",\"mdCode\":\"F319\",\"value\":[\"01010000100008\"],\"type\":\"tree\"},{\"fieldKey\":\"currency\",\"mdCode\":\"F000060\",\"value\":[\"RMB\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"C_Type\",\"mdCode\":\"F000001\",\"value\":[],\"type\":\"tree\"},{\"fieldKey\":\"employeePosition\",\"mdCode\":\"\",\"value\":\"工艺主管\",\"type\":\"text\"},{\"fieldKey\":\"activityTheme\",\"mdCode\":\"F000054\",\"value\":[\"F000001\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"expendUseMoney\",\"mdCode\":\"\",\"value\":\"2616.00\",\"type\":\"number\"},{\"fieldKey\":\"amount\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"travelAmount\",\"mdCode\":\"\",\"value\":\"2616.00\",\"type\":\"number\"},{\"fieldKey\":\"debitItem\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"Remarks\",\"mdCode\":\"\",\"value\":\"李明2019年5月20日至22日广州出差\",\"type\":\"text\"},{\"fieldKey\":\"E_OtherAmount\",\"mdCode\":\"\",\"value\":\"0.00\",\"type\":\"number\"},{\"fieldKey\":\"applyUseMoney\",\"mdCode\":\"\",\"value\":\"2108.00\",\"type\":\"number\"},{\"fieldKey\":\"Remark\",\"mdCode\":\"\",\"value\":\"李明2019年5月20日至22日广州出差\",\"type\":\"text\"},{\"fieldKey\":\"conformingstate\",\"mdCode\":\"\",\"value\":[],\"type\":\"dropdownlist\"},{\"fieldKey\":\"voucherno\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"loanAmount\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"tradeNumber\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"whetherCashier\",\"mdCode\":\"\",\"value\":\"true\",\"type\":\"text\"},{\"fieldKey\":\"单行文本70\",\"mdCode\":\"\",\"value\":\"收款方:\",\"type\":\"text\"},{\"fieldKey\":\"repaymentStatement\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"单行文本77\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"repaymentMethod\",\"mdCode\":\"F000087\",\"value\":[],\"type\":\"dropdownlist\"},{\"fieldKey\":\"AmountRepayment\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"department1\",\"mdCode\":\"\",\"value\":\"美菱经营体\",\"type\":\"text\"},{\"fieldKey\":\"单行文本83\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"RepaymentAccount\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"RepaymentAccountN\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"journey\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"subform\",\"child\":[{\"items\":[{\"fieldKey\":\"DATAROWNUM\",\"mdCode\":\"\",\"value\":\"218\",\"type\":\"text\"},{\"fieldKey\":\"From_site\",\"mdCode\":\"F000063\",\"value\":[\"F144481\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"From_site_land\",\"mdCode\":\"F000073\",\"value\":[\"340100000000\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"FromDate\",\"mdCode\":\"\",\"value\":\"2019-05-20 08:26\",\"type\":\"calendar\"},{\"fieldKey\":\"To_site\",\"mdCode\":\"F000063\",\"value\":[\"F144308\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"To_site_land\",\"mdCode\":\"F000073\",\"value\":[],\"type\":\"dropdownlist\"},{\"fieldKey\":\"LeaveDate\",\"mdCode\":\"\",\"value\":\"2019-05-22 07:22\",\"type\":\"calendar\"},{\"fieldKey\":\"trafficType\",\"mdCode\":\"F000057\",\"value\":[\"F066002\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"SeatLevel\",\"mdCode\":\"F000058\",\"value\":[\"JTXB000009\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"carFare\",\"mdCode\":\"\",\"value\":\"1188.00\",\"type\":\"number\"},{\"fieldKey\":\"Trains\",\"mdCode\":\"\",\"value\":\"G1113\",\"type\":\"text\"},{\"fieldKey\":\"foodSubsidy\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"DaysOfAccommodation\",\"mdCode\":\"\",\"value\":\"1.00\",\"type\":\"number\"},{\"fieldKey\":\"chaiqinbz\",\"mdCode\":\"\",\"value\":\"140\",\"type\":\"text\"},{\"fieldKey\":\"foodAllowance\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"quarterage\",\"mdCode\":\"\",\"value\":\"240\",\"type\":\"text\"},{\"fieldKey\":\"accommodationAllowance\",\"mdCode\":\"\",\"value\":\"240.00\",\"type\":\"number\"},{\"fieldKey\":\"otherCost\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"Remarks1\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"}],\"cid\":\"218\"},{\"items\":[{\"fieldKey\":\"DATAROWNUM\",\"mdCode\":\"\",\"value\":\"219\",\"type\":\"text\"},{\"fieldKey\":\"From_site\",\"mdCode\":\"F000063\",\"value\":[\"F144308\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"From_site_land\",\"mdCode\":\"F000073\",\"value\":[],\"type\":\"dropdownlist\"},{\"fieldKey\":\"FromDate\",\"mdCode\":\"\",\"value\":\"2019-05-22 07:22\",\"type\":\"calendar\"},{\"fieldKey\":\"To_site\",\"mdCode\":\"F000063\",\"value\":[\"F144140\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"To_site_land\",\"mdCode\":\"F000073\",\"value\":[\"340100000000\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"LeaveDate\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"calendar\"},{\"fieldKey\":\"trafficType\",\"mdCode\":\"F000057\",\"value\":[\"F066002\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"SeatLevel\",\"mdCode\":\"F000058\",\"value\":[\"JTXB000009\"],\"type\":\"dropdownlist\"},{\"fieldKey\":\"carFare\",\"mdCode\":\"\",\"value\":\"1188.00\",\"type\":\"number\"},{\"fieldKey\":\"Trains\",\"mdCode\":\"\",\"value\":\"G1748\",\"type\":\"text\"},{\"fieldKey\":\"foodSubsidy\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"DaysOfAccommodation\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"chaiqinbz\",\"mdCode\":\"\",\"value\":\"140\",\"type\":\"text\"},{\"fieldKey\":\"foodAllowance\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"quarterage\",\"mdCode\":\"\",\"value\":\"240\",\"type\":\"text\"},{\"fieldKey\":\"accommodationAllowance\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"otherCost\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"number\"},{\"fieldKey\":\"Remarks1\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"}],\"cid\":\"219\"}]},{\"fieldKey\":\"payinfo\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"subform\",\"child\":[{\"items\":[{\"fieldKey\":\"DATAROWNUM\",\"mdCode\":\"\",\"value\":\"47\",\"type\":\"text\"},{\"fieldKey\":\"zrcvert\",\"mdCode\":\"\",\"value\":\"李明\",\"type\":\"text\"},{\"fieldKey\":\"zracct\",\"mdCode\":\"\",\"value\":\"6228480669216010175\",\"type\":\"text\"},{\"fieldKey\":\"bankl\",\"mdCode\":\"\",\"value\":\"103361018909\",\"type\":\"text\"},{\"fieldKey\":\"zzjjhh\",\"mdCode\":\"\",\"value\":\"\",\"type\":\"text\"},{\"fieldKey\":\"creditItem\",\"mdCode\":\"\",\"value\":\"收款方:20119064李明\",\"type\":\"text\"},{\"fieldKey\":\"netMoney\",\"mdCode\":\"\",\"value\":\"0.00\",\"type\":\"number\"},{\"fieldKey\":\"payWay\",\"mdCode\":\"\",\"value\":\"长虹财务公司合肥模塑一般结算户53110011010210019001\",\"type\":\"text\"},{\"fieldKey\":\"BeneficiaryBankN\",\"mdCode\":\"\",\"value\":\"中国农业银行股份有限公司合肥经济技术开发区支行\",\"type\":\"text\"}],\"cid\":\"47\"}]}],\"formId\":\"WkwGE9ti\",\"id\":20,\"orderCode\":\"1018500190500038\",\"tenantID\":\"100000001\"}", FormInfo.class); formatFormInfoCount = new FormatFormInfoCount(); } // @Test public void test(){ CountParamMax countParamMax = formatFormInfoCount.formatParam(formInfo); formatFormInfoCount.formatResult(formInfo, new CountResultLast()); System.out.println(JSONTool.toJson(countParamMax)); } }