From 1cdf3d5034f28509be761a77bb6ca7cab9c16582 Mon Sep 17 00:00:00 2001 From: mzr Date: Thu, 8 May 2025 16:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E7=94=B3=E8=AF=B7=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E4=BD=93=E5=AD=97=E6=AE=B5=E7=BC=96=E8=BE=91=E5=90=8E?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/util/DataChangeLogic.java | 454 +++++++++--------- 1 file changed, 234 insertions(+), 220 deletions(-) diff --git a/sscivm/src/client/nccloud/web/sscivm/ivsale/application/util/DataChangeLogic.java b/sscivm/src/client/nccloud/web/sscivm/ivsale/application/util/DataChangeLogic.java index b418fea..3643bb5 100644 --- a/sscivm/src/client/nccloud/web/sscivm/ivsale/application/util/DataChangeLogic.java +++ b/sscivm/src/client/nccloud/web/sscivm/ivsale/application/util/DataChangeLogic.java @@ -5,12 +5,6 @@ package nccloud.web.sscivm.ivsale.application.util; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; import nc.bs.framework.common.NCLocator; import nc.bs.framework.exception.ComponentException; import nc.bs.sscivm.logger.SSCIVMLogger; @@ -22,11 +16,7 @@ import nc.itf.bd.cust.freecust.IFreeCustQueryService; import nc.itf.bd.material.baseinfo.IMaterialBaseInfoQueryService; import nc.itf.uap.IUAPQueryBS; import nc.pubitf.para.SysInitQuery; -import nc.pubitf.uapbd.IAddressPubService; -import nc.pubitf.uapbd.ICustomerPubService; -import nc.pubitf.uapbd.IMaterialPubService; -import nc.pubitf.uapbd.ISupplierPubService; -import nc.pubitf.uapbd.TaxcodeUtil; +import nc.pubitf.uapbd.*; import nc.pubitf.uapbd.taxcode.TaxcodeTaxrateQueryVO; import nc.pubitf.uapbd.taxcode.TaxrateQueryVO; import nc.vo.bd.address.AddressVO; @@ -65,6 +55,7 @@ import nccloud.framework.web.ui.pattern.billcard.CardBodyAfterEditEvent; import nccloud.framework.web.ui.pattern.billcard.CardHeadAfterEditEvent; import nccloud.framework.web.ui.pattern.form.Form; import nccloud.framework.web.ui.pattern.form.FormAfterEditEvent; +import nccloud.framework.web.ui.pattern.grid.ChangedRow; import nccloud.framework.web.ui.pattern.grid.Grid; import nccloud.framework.web.ui.pattern.grid.GridAfterEditEvent; import nccloud.itf.sscivm.ivsale.service.IVApplicationQueryService; @@ -73,10 +64,14 @@ import nccloud.web.sscivm.invoice.util.InvoiceMainUtil; import org.apache.commons.lang3.StringUtils; import uap.json.JSONObject; +import java.util.*; + public class DataChangeLogic { public DataChangeLogic() { } + private static List rowArr = new ArrayList<>(); + public static void setViewScala(BillCard card) throws Exception { Form hTable = card.getHead(); Grid bTable = card.getBody(); @@ -104,7 +99,7 @@ public class DataChangeLogic { if (bTable != null) { Row[] rows = bTable.getModel().getRows(); - for(int i = 0; i < rows.length; ++i) { + for (int i = 0; i < rows.length; ++i) { Row row = rows[i]; if (null != row) { setRowScaleValue(row, "xmje", hlDigit); @@ -122,18 +117,18 @@ public class DataChangeLogic { setRowScaleValue(row, "sl", 2); } - materialPkSet.add((String)row.getCell("pk_materiel").getValue()); + materialPkSet.add((String) row.getCell("pk_materiel").getValue()); } - Map materialMeasdocMap = getUnitFromMaterial((String[])materialPkSet.toArray(new String[materialPkSet.size()])); + Map materialMeasdocMap = getUnitFromMaterial((String[]) materialPkSet.toArray(new String[materialPkSet.size()])); GridPrecisionOperator gridPrecisionOperator = new GridPrecisionOperator(bTable); - for(int i = 0; i < rows.length; ++i) { - String materialPk = (String)rows[i].getCell("pk_materiel").getValue(); + for (int i = 0; i < rows.length; ++i) { + String materialPk = (String) rows[i].getCell("pk_materiel").getValue(); // gridPrecisionOperator.addNumPrecision("xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("caninvoice_xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("invoiceing_xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("invoiced_xmsl", i, (String)materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("caninvoice_xmsl", i, (String) materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("invoiceing_xmsl", i, (String) materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("invoiced_xmsl", i, (String) materialMeasdocMap.get(materialPk)); gridPrecisionOperator.addCurrencyPricePrecision("xmdj", i, orgLocalCurrPK); } @@ -143,7 +138,7 @@ public class DataChangeLogic { if (tspzTable != null) { Row[] rows = tspzTable.getModel().getRows(); - for(int i = 0; i < rows.length; ++i) { + for (int i = 0; i < rows.length; ++i) { Row row = rows[i]; if (null != row) { setRowScaleValue(row, "hjje", hlDigit); @@ -161,12 +156,12 @@ public class DataChangeLogic { if (bTable != null) { Row[] rows = bTable.getModel().getRows(); int hlDigit = 2; - String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK((String)rows[0].getCell("pk_org").getValue()); + String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK((String) rows[0].getCell("pk_org").getValue()); if (orgLocalCurrPK != null) { hlDigit = getIVApplicationService().getCurrDigit(orgLocalCurrPK); } - for(int i = 0; i < rows.length; ++i) { + for (int i = 0; i < rows.length; ++i) { Row row = rows[i]; if (null != row) { setRowScaleValue(row, "xmje", hlDigit); @@ -184,18 +179,18 @@ public class DataChangeLogic { setRowScaleValue(row, "invoiced_xmjshj", hlDigit); } - materialPkSet.add((String)row.getCell("pk_materiel").getValue()); + materialPkSet.add((String) row.getCell("pk_materiel").getValue()); } - Map materialMeasdocMap = getUnitFromMaterial((String[])materialPkSet.toArray(new String[materialPkSet.size()])); + Map materialMeasdocMap = getUnitFromMaterial((String[]) materialPkSet.toArray(new String[materialPkSet.size()])); GridPrecisionOperator gridPrecisionOperator = new GridPrecisionOperator(bTable); - for(int i = 0; i < rows.length; ++i) { - String materialPk = (String)rows[i].getCell("pk_materiel").getValue(); + for (int i = 0; i < rows.length; ++i) { + String materialPk = (String) rows[i].getCell("pk_materiel").getValue(); // gridPrecisionOperator.addNumPrecision("xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("caninvoice_xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("invoiced_xmsl", i, (String)materialMeasdocMap.get(materialPk)); - gridPrecisionOperator.addNumPrecision("invoiceing_xmsl", i, (String)materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("caninvoice_xmsl", i, (String) materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("invoiced_xmsl", i, (String) materialMeasdocMap.get(materialPk)); + gridPrecisionOperator.addNumPrecision("invoiceing_xmsl", i, (String) materialMeasdocMap.get(materialPk)); gridPrecisionOperator.addCurrencyPricePrecision("xmdj", i, orgLocalCurrPK); } @@ -212,10 +207,10 @@ public class DataChangeLogic { return materialDecMap; } - Map pkAndMaterialVOMap = ((IMaterialPubService)ServiceLocator.find(IMaterialPubService.class)).queryMaterialBaseInfoByPks(materialPks, new String[]{"pk_measdoc"}); + Map pkAndMaterialVOMap = ((IMaterialPubService) ServiceLocator.find(IMaterialPubService.class)).queryMaterialBaseInfoByPks(materialPks, new String[]{"pk_measdoc"}); if (pkAndMaterialVOMap != null && pkAndMaterialVOMap.size() > 0) { - for(Map.Entry entry : pkAndMaterialVOMap.entrySet()) { - materialDecMap.put((String)entry.getKey(), ((MaterialVO)entry.getValue()).getPk_measdoc()); + for (Map.Entry entry : pkAndMaterialVOMap.entrySet()) { + materialDecMap.put((String) entry.getKey(), ((MaterialVO) entry.getValue()).getPk_measdoc()); } } } catch (Exception e) { @@ -234,7 +229,7 @@ public class DataChangeLogic { setHeadScaleValue(hTable, "hjje", hlDigit); setHeadScaleValue(hTable, "hjse", hlDigit); if (bTable != null) { - for(int i = 0; i < bTable.getModel().getRows().length; ++i) { + for (int i = 0; i < bTable.getModel().getRows().length; ++i) { Row row = bTable.getModel().getRows()[i]; if (null != row) { setRowScaleValue(row, "xmje", hlDigit); @@ -244,13 +239,13 @@ public class DataChangeLogic { Object sl = row.getCell("sl").getValue(); if (sl != null) { UFDouble ufsl = new UFDouble(sl.toString()); - ufsl = ufsl.multiply((double)100.0F); + ufsl = ufsl.multiply((double) 100.0F); ufsl = ufsl.setScale(2, 4); row.getCell("sl").setValue(ufsl); } - UFDouble xmsl = (UFDouble)row.getCell("xmsl").getValue(); - UFDouble xmdj = (UFDouble)row.getCell("xmdj").getValue(); + UFDouble xmsl = (UFDouble) row.getCell("xmsl").getValue(); + UFDouble xmdj = (UFDouble) row.getCell("xmdj").getValue(); xmsl.setTrimZero(true); xmdj.setTrimZero(true); int xmdjScale = xmdj != null && xmdj.toString().split("\\.") != null && xmdj.toString().split("\\.").length > 1 ? xmdj.toString().split("\\.")[1].length() : 0; @@ -268,7 +263,7 @@ public class DataChangeLogic { if (tspzTable != null) { Row[] rows = tspzTable.getModel().getRows(); - for(int i = 0; i < rows.length; ++i) { + for (int i = 0; i < rows.length; ++i) { Row row = rows[i]; if (null != row) { setRowScaleValue(row, "hjje", hlDigit); @@ -285,12 +280,12 @@ public class DataChangeLogic { Row[] rows = grid.getModel().getRows(); int hlDigit = 2; if (rows != null && rows.length > 0) { - String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK((String)rows[0].getCell("pk_org").getValue()); + String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK((String) rows[0].getCell("pk_org").getValue()); if (orgLocalCurrPK != null) { hlDigit = getIVApplicationService().getCurrDigit(orgLocalCurrPK); } - for(Row row : rows) { + for (Row row : rows) { setRowScaleValue(row, "hjje", hlDigit); setRowScaleValue(row, "hjse", hlDigit); setRowScaleValue(row, "jshj", hlDigit); @@ -312,7 +307,7 @@ public class DataChangeLogic { Row[] rows = grid.getModel().getRows(); int hlDigit = 2; if (rows != null && rows.length > 0) { - for(Row row : rows) { + for (Row row : rows) { setRowScaleValue(row, "hjje", hlDigit); setRowScaleValue(row, "hjse", hlDigit); setRowScaleValue(row, "jshj", hlDigit); @@ -322,8 +317,8 @@ public class DataChangeLogic { } public static BillCard valueChanged(Object afterEditEvent, JSONObject object) throws Exception { - String tableID = (String)object.get("tableID"); - String changeType = (String)object.get("type"); + String tableID = (String) object.get("tableID"); + String changeType = (String) object.get("type"); Form hTable = null; Grid bTable = null; String field = null; @@ -332,30 +327,39 @@ public class DataChangeLogic { IVApplicationAggVO vo = null; String pageCode = null; if ("headcard".equals(changeType)) { - CardHeadAfterEditEvent headEvent = (CardHeadAfterEditEvent)afterEditEvent; + CardHeadAfterEditEvent headEvent = (CardHeadAfterEditEvent) afterEditEvent; hTable = headEvent.getCard().getHead(); bTable = headEvent.getCard().getBody(); field = headEvent.getAttrcode(); newValue = headEvent.getNewvalue().getValue(); } else if ("bodycard".equals(changeType)) { - CardBodyAfterEditEvent bodyEvent = (CardBodyAfterEditEvent)afterEditEvent; + CardBodyAfterEditEvent bodyEvent = (CardBodyAfterEditEvent) afterEditEvent; pageCode = bodyEvent.getCard().getPageid(); hTable = bodyEvent.getCard().getHead(); BillCard billcard = bodyEvent.getCard(); new BillCardOperator(pageCode); BillCardConvertProcessor processor = new BillCardConvertProcessor(); - vo = (IVApplicationAggVO)processor.fromBillCard(billcard); + vo = (IVApplicationAggVO) processor.fromBillCard(billcard); bTable = bodyEvent.getCard().getBody(); field = bodyEvent.getAttrcode(); newValue = bodyEvent.getChangedrows()[0].getNewvalue() == null ? "" : bodyEvent.getChangedrows()[0].getNewvalue().getValue(); - row = bodyEvent.getRow(bodyEvent.getChangedrows()[0]); + ChangedRow[] changedrows = bodyEvent.getChangedrows(); + if (changedrows.length > 1) { + for (ChangedRow changedrow : changedrows) { + Row row1 = bodyEvent.getRow(changedrow); + rowArr.add(row1); + } + } else { + rowArr.clear(); + row = bodyEvent.getRow(changedrows[0]); + } } else if ("form".equals(changeType)) { - FormAfterEditEvent formEvent = (FormAfterEditEvent)afterEditEvent; + FormAfterEditEvent formEvent = (FormAfterEditEvent) afterEditEvent; hTable = formEvent.getForm(); field = formEvent.getAttrcode(); newValue = formEvent.getNewvalue(); } else if ("grid".equals(changeType)) { - GridAfterEditEvent gridEvent = (GridAfterEditEvent)afterEditEvent; + GridAfterEditEvent gridEvent = (GridAfterEditEvent) afterEditEvent; bTable = gridEvent.getGrid(); field = gridEvent.getAttrcode(); newValue = gridEvent.getChangedrows()[0].getNewvalue(); @@ -402,25 +406,40 @@ public class DataChangeLogic { afterEditHeadPKSUPPLIERV(hTable, bTable, pk_supplier_v); } else if ("head".equals(tableID) && "xsf_dz".equals(field)) { String xsf_dz = String.valueOf(newValue); - String xsf_dh = getHeadValue(hTable, "xsf_dh") == null ? "" : (String)getHeadValue(hTable, "xsf_dh"); + String xsf_dh = getHeadValue(hTable, "xsf_dh") == null ? "" : (String) getHeadValue(hTable, "xsf_dh"); afterEditHeadXSFDZDH(hTable, xsf_dz, xsf_dh); } else if ("head".equals(tableID) && "xsf_dh".equals(field)) { String xsf_dh = String.valueOf(newValue); - String xsf_dz = getHeadValue(hTable, "xsf_dz") == null ? "" : (String)getHeadValue(hTable, "xsf_dz"); + String xsf_dz = getHeadValue(hTable, "xsf_dz") == null ? "" : (String) getHeadValue(hTable, "xsf_dz"); afterEditHeadXSFDZDH(hTable, xsf_dz, xsf_dh); } else if ("head".equals(tableID) && "xsf_yh".equals(field)) { String xsf_yh = String.valueOf(newValue); - String xsf_zhh = getHeadValue(hTable, "xsf_zhh") == null ? "" : (String)getHeadValue(hTable, "xsf_zhh"); + String xsf_zhh = getHeadValue(hTable, "xsf_zhh") == null ? "" : (String) getHeadValue(hTable, "xsf_zhh"); afterEditHeadXSFYHZHH(hTable, xsf_yh, xsf_zhh); } else if ("head".equals(tableID) && "xsf_zhh".equals(field)) { String xsf_zhh = String.valueOf(newValue); - String xsf_yh = getHeadValue(hTable, "xsf_yh") == null ? "" : (String)getHeadValue(hTable, "xsf_yh"); + String xsf_yh = getHeadValue(hTable, "xsf_yh") == null ? "" : (String) getHeadValue(hTable, "xsf_yh"); afterEditHeadXSFYHZHH(hTable, xsf_yh, xsf_zhh); } else if ("head".equals(tableID) && "pk_freecustom".equals(field)) { String pk_freeCustom = String.valueOf(newValue); afterEditHeadFreeCustom(hTable, bTable, pk_freeCustom); } + if (rowArr != null && rowArr.size() > 1) { + // 如果改变了多行,循环处理 + for (Row row1 : rowArr) { + setBodySpecField(tableID, field, hTable, bTable, row1, vo, pageCode); + } + } else { + setBodySpecField(tableID, field, hTable, bTable, row, vo, pageCode); + } + BillCard billcard = new BillCard(); + billcard.setHead(hTable); + billcard.setBody(bTable); + return billcard; + } + + private static void setBodySpecField(String tableID, String field, Form hTable, Grid bTable, Row row, IVApplicationAggVO vo, String pageCode) throws Exception { if ("body".equals(tableID) && field.equals("xmdj")) { afterEditBodyMoney(hTable, bTable, row, field); totalBodyMoney(hTable, bTable); @@ -449,11 +468,6 @@ public class DataChangeLogic { } else if ("body".equals(tableID) && field.equals("taxcode")) { afterEditBodyTaxcode(hTable, bTable, row, field); } - - BillCard billcard = new BillCard(); - billcard.setHead(hTable); - billcard.setBody(bTable); - return billcard; } private static void afterEditHeadGMFYHZHH(Form hTable, String gmf_yh, String gmf_zhh) { @@ -476,31 +490,31 @@ public class DataChangeLogic { String pk_org_v = getIVApplicationService().getOrgVersion(IVApplicationHeadVO.class.toString().substring(6), "pk_org", pk_org); setHeadValue(hTable, "pk_org_v", pk_org_v); String orgCode = ""; - OrgVO orgVo = (OrgVO)((IUAPQueryBS)ServiceLocator.find(IUAPQueryBS.class)).retrieveByPK(OrgVO.class, pk_org); + OrgVO orgVo = (OrgVO) ((IUAPQueryBS) ServiceLocator.find(IUAPQueryBS.class)).retrieveByPK(OrgVO.class, pk_org); if (orgVo != null) { orgCode = orgVo.getCode(); } setHeadValue(hTable, "orgcode", orgCode); - setHeadValue(hTable, "pk_dept", (Object)null); - setHeadValue(hTable, "xsf_khh", (Object)null); - setHeadValue(hTable, "xsf_zh", (Object)null); - setHeadValue(hTable, "xsf_dzdh", (Object)null); - setHeadValue(hTable, "xsf_mc", (Object)null); - setHeadValue(hTable, "xsf_nsrsbh", (Object)null); - setHeadValue(hTable, "xsf_yhzh", (Object)null); - setHeadValue(hTable, "gmf_khh", (Object)null); - setHeadValue(hTable, "gmf_zh", (Object)null); - setHeadValue(hTable, "pk_customer", (Object)null); - setHeadValue(hTable, "pk_customer_v", (Object)null); - setHeadValue(hTable, "pk_customer_v", (Object)null); - setHeadValue(hTable, "kpr", (Object)null); - setHeadValue(hTable, "gmf_zh", (Object)null); - setHeadValue(hTable, "gmf_khh", (Object)null); - setHeadValue(hTable, "gmf_yhzh", (Object)null); - setHeadValue(hTable, "gmf_nsrsbh", (Object)null); - setHeadValue(hTable, "gmf_mc", (Object)null); - setHeadValue(hTable, "gmf_dzdh", (Object)null); + setHeadValue(hTable, "pk_dept", (Object) null); + setHeadValue(hTable, "xsf_khh", (Object) null); + setHeadValue(hTable, "xsf_zh", (Object) null); + setHeadValue(hTable, "xsf_dzdh", (Object) null); + setHeadValue(hTable, "xsf_mc", (Object) null); + setHeadValue(hTable, "xsf_nsrsbh", (Object) null); + setHeadValue(hTable, "xsf_yhzh", (Object) null); + setHeadValue(hTable, "gmf_khh", (Object) null); + setHeadValue(hTable, "gmf_zh", (Object) null); + setHeadValue(hTable, "pk_customer", (Object) null); + setHeadValue(hTable, "pk_customer_v", (Object) null); + setHeadValue(hTable, "pk_customer_v", (Object) null); + setHeadValue(hTable, "kpr", (Object) null); + setHeadValue(hTable, "gmf_zh", (Object) null); + setHeadValue(hTable, "gmf_khh", (Object) null); + setHeadValue(hTable, "gmf_yhzh", (Object) null); + setHeadValue(hTable, "gmf_nsrsbh", (Object) null); + setHeadValue(hTable, "gmf_mc", (Object) null); + setHeadValue(hTable, "gmf_dzdh", (Object) null); if (StringUtils.isNotEmpty(pk_org) && !"null".equals(pk_org)) { Integer paramValue = SysInitQuery.getParaInt(pk_org, "SSCIVA01"); setHeadValue(hTable, "kpfs", paramValue == null ? IVAplocationKPFS.ZLKP.toIntValue() : paramValue); @@ -511,40 +525,40 @@ public class DataChangeLogic { public static void afterEditHeadPKSUPPLIERV(Form hTable, Grid bTable, String pk_supplier_v) throws Exception { if (StringUtils.isEmpty(pk_supplier_v)) { - setHeadValue(hTable, "pk_supplier", (Object)null); - afterEditHeadPKSUPPLIER(hTable, bTable, (String)null); + setHeadValue(hTable, "pk_supplier", (Object) null); + afterEditHeadPKSUPPLIER(hTable, bTable, (String) null); } else { - Map map = ((ISupplierPubService)ServiceLocator.find(ISupplierPubService.class)).getSupplierOIDByVid(new String[]{pk_supplier_v}); + Map map = ((ISupplierPubService) ServiceLocator.find(ISupplierPubService.class)).getSupplierOIDByVid(new String[]{pk_supplier_v}); setHeadValue(hTable, "pk_supplier", map.get(pk_supplier_v)); - afterEditHeadPKSUPPLIER(hTable, bTable, (String)map.get(pk_supplier_v)); + afterEditHeadPKSUPPLIER(hTable, bTable, (String) map.get(pk_supplier_v)); } } public static void afterEditHeadPKSUPPLIER(Form hTable, Grid bTable, String pk_supplier) throws Exception { - SupplierVO[] supplierVos = ((ISupplierPubService)ServiceLocator.find(ISupplierPubService.class)).getSupplierVO(new String[]{pk_supplier}, new String[]{"taxpayerid", "name", "corpaddress", "tel1", "tel2", "tel3"}); - setHeadValue(hTable, "xsf_nsrsbh", (Object)null); - setHeadValue(hTable, "xsf_mc", (Object)null); - setHeadValue(hTable, "xsf_dzdh", (Object)null); - setHeadValue(hTable, "xsf_zh", (Object)null); - setHeadValue(hTable, "xsf_khh", (Object)null); - setHeadValue(hTable, "xsf_yhzh", (Object)null); - setHeadValue(hTable, "pk_supplier_v", (Object)null); - setHeadValue(hTable, "xsf_dz", (Object)null); - setHeadValue(hTable, "xsf_dh", (Object)null); - setHeadValue(hTable, "xsf_yh", (Object)null); - setHeadValue(hTable, "xsf_zhh", (Object)null); + SupplierVO[] supplierVos = ((ISupplierPubService) ServiceLocator.find(ISupplierPubService.class)).getSupplierVO(new String[]{pk_supplier}, new String[]{"taxpayerid", "name", "corpaddress", "tel1", "tel2", "tel3"}); + setHeadValue(hTable, "xsf_nsrsbh", (Object) null); + setHeadValue(hTable, "xsf_mc", (Object) null); + setHeadValue(hTable, "xsf_dzdh", (Object) null); + setHeadValue(hTable, "xsf_zh", (Object) null); + setHeadValue(hTable, "xsf_khh", (Object) null); + setHeadValue(hTable, "xsf_yhzh", (Object) null); + setHeadValue(hTable, "pk_supplier_v", (Object) null); + setHeadValue(hTable, "xsf_dz", (Object) null); + setHeadValue(hTable, "xsf_dh", (Object) null); + setHeadValue(hTable, "xsf_yh", (Object) null); + setHeadValue(hTable, "xsf_zhh", (Object) null); if (supplierVos != null && supplierVos.length > 0) { SupplierVO suppliervo = supplierVos[0]; Map map = new HashMap(); - UFDate sqrq = new UFDate((String)getHeadValue(hTable, "preparedate")); + UFDate sqrq = new UFDate((String) getHeadValue(hTable, "preparedate")); map.put(suppliervo.getPk_supplier(), sqrq); - Map idmap = ((ISupplierPubService)ServiceLocator.find(ISupplierPubService.class)).getSupplierLastVIDByOidAndDate(map); + Map idmap = ((ISupplierPubService) ServiceLocator.find(ISupplierPubService.class)).getSupplierLastVIDByOidAndDate(map); setHeadValue(hTable, "pk_supplier_v", idmap.get(suppliervo.getPk_supplier())); setHeadValue(hTable, "xsf_nsrsbh", suppliervo.getTaxpayerid()); setHeadValue(hTable, "xsf_mc", suppliervo.getName()); String addressPk = suppliervo.getCorpaddress(); - AddressVO addressVO = ((IAddressPubService)ServiceLocator.find(IAddressPubService.class)).getAddressVOByPk(addressPk); + AddressVO addressVO = ((IAddressPubService) ServiceLocator.find(IAddressPubService.class)).getAddressVOByPk(addressPk); String dz = ""; if (addressVO != null) { dz = addressVO.getDetailinfo(); @@ -554,14 +568,14 @@ public class DataChangeLogic { setHeadValue(hTable, "xsf_dz", dz); setHeadValue(hTable, "xsf_dh", dh); setHeadValue(hTable, "xsf_dzdh", dz + dh); - List custbankVOS = (List)((IUAPQueryBS)ServiceLocator.find(IUAPQueryBS.class)).retrieveByClause(CustbankVO.class, "pk_cust='" + suppliervo.getPk_supplier() + "'"); + List custbankVOS = (List) ((IUAPQueryBS) ServiceLocator.find(IUAPQueryBS.class)).retrieveByClause(CustbankVO.class, "pk_cust='" + suppliervo.getPk_supplier() + "'"); if (custbankVOS != null && custbankVOS.size() > 0) { - String pk_bankaccbas = ((CustbankVO)custbankVOS.get(0)).getPk_bankaccbas(); - String pk_bankaccsub = ((CustbankVO)custbankVOS.get(0)).getPk_bankaccsub(); - BankAccbasVO[] bankAccbasVOS = ((IBankAccBaseInfoQueryService)ServiceLocator.find(IBankAccBaseInfoQueryService.class)).queryBankAccBasVOByPks(new String[]{pk_bankaccbas}, false); + String pk_bankaccbas = ((CustbankVO) custbankVOS.get(0)).getPk_bankaccbas(); + String pk_bankaccsub = ((CustbankVO) custbankVOS.get(0)).getPk_bankaccsub(); + BankAccbasVO[] bankAccbasVOS = ((IBankAccBaseInfoQueryService) ServiceLocator.find(IBankAccBaseInfoQueryService.class)).queryBankAccBasVOByPks(new String[]{pk_bankaccbas}, false); if (bankAccbasVOS != null && bankAccbasVOS.length > 0 && pk_bankaccsub != null) { BankAccbasVO bankAccbasVO = bankAccbasVOS[0]; - BankdocVO bankdocVO = ((IBankdocQueryService)ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(bankAccbasVO.getPk_bankdoc()); + BankdocVO bankdocVO = ((IBankdocQueryService) ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(bankAccbasVO.getPk_bankdoc()); setHeadValue(hTable, "gmf_zh", pk_bankaccsub); setHeadValue(hTable, "gmf_khh", bankAccbasVO.getPk_bankdoc()); String xsf_yh = bankdocVO.getName() == null ? "" : bankdocVO.getName(); @@ -576,30 +590,30 @@ public class DataChangeLogic { } public static void afterEditHeadPKCUSTOMER(Form hTable, Grid bTable, String pk_customer) throws Exception { - CustomerVO[] customerVoS = ((ICustomerPubService)ServiceLocator.find(ICustomerPubService.class)).getCustomerVO(new String[]{pk_customer}, new String[]{"name", "email", "corpaddress", "tel1", "tel2", "tel3", "taxpayerid"}); + CustomerVO[] customerVoS = ((ICustomerPubService) ServiceLocator.find(ICustomerPubService.class)).getCustomerVO(new String[]{pk_customer}, new String[]{"name", "email", "corpaddress", "tel1", "tel2", "tel3", "taxpayerid"}); Map map = new HashMap(); - UFDate sqrq = new UFDate((String)getHeadValue(hTable, "preparedate")); + UFDate sqrq = new UFDate((String) getHeadValue(hTable, "preparedate")); map.put(pk_customer, sqrq); - Map idMap = ((ICustomerPubService)ServiceLocator.find(ICustomerPubService.class)).getCustomerLastVIDByOidAndDate(map); - setHeadValue(hTable, "gmf_nsrsbh", (Object)null); - setHeadValue(hTable, "gmf_mc", (Object)null); - setHeadValue(hTable, "gmf_dzdh", (Object)null); - setHeadValue(hTable, "gmf_zh", (Object)null); - setHeadValue(hTable, "gmf_khh", (Object)null); - setHeadValue(hTable, "gmf_yhzh", (Object)null); - setHeadValue(hTable, "pk_customer_v", (Object)null); - setHeadValue(hTable, "gmf_dz", (Object)null); - setHeadValue(hTable, "gmf_dh", (Object)null); - setHeadValue(hTable, "gmf_yh", (Object)null); - setHeadValue(hTable, "gmf_zhh", (Object)null); + Map idMap = ((ICustomerPubService) ServiceLocator.find(ICustomerPubService.class)).getCustomerLastVIDByOidAndDate(map); + setHeadValue(hTable, "gmf_nsrsbh", (Object) null); + setHeadValue(hTable, "gmf_mc", (Object) null); + setHeadValue(hTable, "gmf_dzdh", (Object) null); + setHeadValue(hTable, "gmf_zh", (Object) null); + setHeadValue(hTable, "gmf_khh", (Object) null); + setHeadValue(hTable, "gmf_yhzh", (Object) null); + setHeadValue(hTable, "pk_customer_v", (Object) null); + setHeadValue(hTable, "gmf_dz", (Object) null); + setHeadValue(hTable, "gmf_dh", (Object) null); + setHeadValue(hTable, "gmf_yh", (Object) null); + setHeadValue(hTable, "gmf_zhh", (Object) null); if (customerVoS != null && customerVoS.length > 0) { setHeadValue(hTable, "pk_customer_v", idMap.get(pk_customer)); - String pk_org = (String)getHeadValue(hTable, "pk_org"); + String pk_org = (String) getHeadValue(hTable, "pk_org"); if (pk_org == null) { return; } - CusttaxVO taxvo = ((ICustTaxQueryService)NCLocator.getInstance().lookup(ICustTaxQueryService.class)).queryCusttaxVOByOrgID(pk_org, pk_customer); + CusttaxVO taxvo = ((ICustTaxQueryService) NCLocator.getInstance().lookup(ICustTaxQueryService.class)).queryCusttaxVOByOrgID(pk_org, pk_customer); if (taxvo == null) { return; } @@ -622,30 +636,30 @@ public class DataChangeLogic { } public static void afterEditHeadFreeCustom(Form hTable, Grid bTable, String pk_FreeCustom) throws Exception { - setHeadValue(hTable, "gmf_nsrsbh", (Object)null); - setHeadValue(hTable, "gmf_mc", (Object)null); - setHeadValue(hTable, "gmf_dzdh", (Object)null); - setHeadValue(hTable, "gmf_yhzh", (Object)null); - setHeadValue(hTable, "gmf_dz", (Object)null); - setHeadValue(hTable, "gmf_dh", (Object)null); - setHeadValue(hTable, "gmf_yh", (Object)null); - setHeadValue(hTable, "gmf_zhh", (Object)null); - setHeadValue(hTable, "xsf_nsrsbh", (Object)null); - setHeadValue(hTable, "xsf_mc", (Object)null); - setHeadValue(hTable, "xsf_dzdh", (Object)null); - setHeadValue(hTable, "xsf_yhzh", (Object)null); - setHeadValue(hTable, "xsf_dz", (Object)null); - setHeadValue(hTable, "xsf_dh", (Object)null); - setHeadValue(hTable, "xsf_yh", (Object)null); - setHeadValue(hTable, "xsf_zhh", (Object)null); + setHeadValue(hTable, "gmf_nsrsbh", (Object) null); + setHeadValue(hTable, "gmf_mc", (Object) null); + setHeadValue(hTable, "gmf_dzdh", (Object) null); + setHeadValue(hTable, "gmf_yhzh", (Object) null); + setHeadValue(hTable, "gmf_dz", (Object) null); + setHeadValue(hTable, "gmf_dh", (Object) null); + setHeadValue(hTable, "gmf_yh", (Object) null); + setHeadValue(hTable, "gmf_zhh", (Object) null); + setHeadValue(hTable, "xsf_nsrsbh", (Object) null); + setHeadValue(hTable, "xsf_mc", (Object) null); + setHeadValue(hTable, "xsf_dzdh", (Object) null); + setHeadValue(hTable, "xsf_yhzh", (Object) null); + setHeadValue(hTable, "xsf_dz", (Object) null); + setHeadValue(hTable, "xsf_dh", (Object) null); + setHeadValue(hTable, "xsf_yh", (Object) null); + setHeadValue(hTable, "xsf_zhh", (Object) null); if (StringUtils.isNotEmpty(pk_FreeCustom)) { - String pk_customer = (String)getHeadValue(hTable, "pk_customer"); - String pk_supplier = (String)getHeadValue(hTable, "pk_supplier"); - FreeCustomVO[] vos = ((IFreeCustQueryService)ServiceLocator.find(IFreeCustQueryService.class)).queryFreeCustVOsByCondition("pk_freecustom='" + pk_FreeCustom + "'"); + String pk_customer = (String) getHeadValue(hTable, "pk_customer"); + String pk_supplier = (String) getHeadValue(hTable, "pk_supplier"); + FreeCustomVO[] vos = ((IFreeCustQueryService) ServiceLocator.find(IFreeCustQueryService.class)).queryFreeCustVOsByCondition("pk_freecustom='" + pk_FreeCustom + "'"); FreeCustomVO vo = vos[0]; String bankName = ""; if (StringUtils.isNotEmpty(vo.getBank())) { - BankdocVO bankdocVO = ((IBankdocQueryService)ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(vo.getBank()); + BankdocVO bankdocVO = ((IBankdocQueryService) ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(vo.getBank()); bankName = bankdocVO.getName() == null ? "" : bankdocVO.getName(); } @@ -679,26 +693,26 @@ public class DataChangeLogic { public static void afterEditHeadPKCUSTOMERV(Form hTable, Grid bTable, String pk_customer_v) throws Exception { if (pk_customer_v != null && !"".equals(pk_customer_v)) { - Map idMap = ((ICustomerPubService)NCLocator.getInstance().lookup(ICustomerPubService.class)).getCustomerOIDByVid(new String[]{pk_customer_v}); + Map idMap = ((ICustomerPubService) NCLocator.getInstance().lookup(ICustomerPubService.class)).getCustomerOIDByVid(new String[]{pk_customer_v}); setHeadValue(hTable, "pk_customer", idMap.get(pk_customer_v)); - afterEditHeadPKCUSTOMER(hTable, bTable, (String)idMap.get(pk_customer_v)); + afterEditHeadPKCUSTOMER(hTable, bTable, (String) idMap.get(pk_customer_v)); } else { - setHeadValue(hTable, "pk_customer", (Object)null); + setHeadValue(hTable, "pk_customer", (Object) null); afterEditHeadPKCUSTOMER(hTable, bTable, ""); } } public static void afterEditHeadGMFZH(Form hTable, Grid bTable, String gmf_zh) throws Exception { - BankAccSubVO[] bankAccSubVOS = ((IBankAccSubInfoQueryService)ServiceLocator.find(IBankAccSubInfoQueryService.class)).querySubInfosByPKs(new String[]{gmf_zh}); - String pk_customer = (String)getHeadValue(hTable, "pk_customer"); - String pk_supplier = (String)getHeadValue(hTable, "pk_supplier"); + BankAccSubVO[] bankAccSubVOS = ((IBankAccSubInfoQueryService) ServiceLocator.find(IBankAccSubInfoQueryService.class)).querySubInfosByPKs(new String[]{gmf_zh}); + String pk_customer = (String) getHeadValue(hTable, "pk_customer"); + String pk_supplier = (String) getHeadValue(hTable, "pk_supplier"); if (bankAccSubVOS != null && bankAccSubVOS.length > 0) { - BankAccbasVO[] bankAccbasVOS = ((IBankAccBaseInfoQueryService)ServiceLocator.find(IBankAccBaseInfoQueryService.class)).queryBankAccBasVOByPks(new String[]{bankAccSubVOS[0].getPk_bankaccbas()}, false); + BankAccbasVO[] bankAccbasVOS = ((IBankAccBaseInfoQueryService) ServiceLocator.find(IBankAccBaseInfoQueryService.class)).queryBankAccBasVOByPks(new String[]{bankAccSubVOS[0].getPk_bankaccbas()}, false); if (bankAccbasVOS != null && bankAccbasVOS.length > 0) { if (gmf_zh != null) { BankAccbasVO bankAccbasVO = bankAccbasVOS[0]; - BankdocVO bankdocVO = ((IBankdocQueryService)ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(bankAccbasVO.getPk_bankdoc()); + BankdocVO bankdocVO = ((IBankdocQueryService) ServiceLocator.find(IBankdocQueryService.class)).getBankdocVOByPk(bankAccbasVO.getPk_bankdoc()); if (StringUtils.isNotEmpty(pk_customer)) { setHeadValue(hTable, "gmf_zh", gmf_zh); setHeadValue(hTable, "gmf_khh", bankAccbasVO.getPk_bankdoc()); @@ -717,16 +731,16 @@ public class DataChangeLogic { setHeadValue(hTable, "xsf_zhh", bankAccbasVO.getBankaccsub()[0].getAccnum() == null ? "" : bankAccbasVO.getBankaccsub()[0].getAccnum()); } } else { - setHeadValue(hTable, "gmf_zh", (Object)null); - setHeadValue(hTable, "gmf_khh", (Object)null); - setHeadValue(hTable, "gmf_yhzh", (Object)null); - setHeadValue(hTable, "gmf_yh", (Object)null); - setHeadValue(hTable, "gmf_zhh", (Object)null); - setHeadValue(hTable, "xsf_zh", (Object)null); - setHeadValue(hTable, "xsf_khh", (Object)null); - setHeadValue(hTable, "xsf_yhzh", (Object)null); - setHeadValue(hTable, "xsf_yh", (Object)null); - setHeadValue(hTable, "xsf_zhh", (Object)null); + setHeadValue(hTable, "gmf_zh", (Object) null); + setHeadValue(hTable, "gmf_khh", (Object) null); + setHeadValue(hTable, "gmf_yhzh", (Object) null); + setHeadValue(hTable, "gmf_yh", (Object) null); + setHeadValue(hTable, "gmf_zhh", (Object) null); + setHeadValue(hTable, "xsf_zh", (Object) null); + setHeadValue(hTable, "xsf_khh", (Object) null); + setHeadValue(hTable, "xsf_yhzh", (Object) null); + setHeadValue(hTable, "xsf_yh", (Object) null); + setHeadValue(hTable, "xsf_zhh", (Object) null); } } } @@ -734,26 +748,26 @@ public class DataChangeLogic { } public static void afterEditBodyMateriel(Form hTable, Grid bTable, Row row, String cell) throws Exception { - String pk_materiel = (String)getBodyValueByRow(row, "pk_materiel"); - MaterialVO[] materialVOS = ((IMaterialBaseInfoQueryService)ServiceLocator.find(IMaterialBaseInfoQueryService.class)).queryDataByPks(new String[]{pk_materiel}); + String pk_materiel = (String) getBodyValueByRow(row, "pk_materiel"); + MaterialVO[] materialVOS = ((IMaterialBaseInfoQueryService) ServiceLocator.find(IMaterialBaseInfoQueryService.class)).queryDataByPks(new String[]{pk_materiel}); if (materialVOS != null && materialVOS.length > 0 && materialVOS[0] != null) { MaterialVO materialVO = materialVOS[0]; setBodyValueByRow(row, "xmmc", materialVO.getName()); setBodyValueByRow(row, "spbm", materialVO.getCode()); Object var10002 = materialVO.getAttributeValue("materialspec") == null ? "" : materialVO.getAttributeValue("materialspec"); setBodyValueByRow(row, "ggxh", "" + var10002 + (materialVO.getAttributeValue("materialtype") == null ? "" : materialVO.getAttributeValue("materialtype"))); - IVApplicationQueryService ivservice = (IVApplicationQueryService)ServiceLocator.find(IVApplicationQueryService.class); + IVApplicationQueryService ivservice = (IVApplicationQueryService) ServiceLocator.find(IVApplicationQueryService.class); MeasdocVO[] measdocVOS = ivservice.queryMeasdocByPk(materialVO.getPk_measdoc()); if (measdocVOS != null && measdocVOS.length > 0) { - String name = MultiLangUtil.getSuperVONameOfCurrentLang(measdocVOS[0], "name", (String)null); + String name = MultiLangUtil.getSuperVONameOfCurrentLang(measdocVOS[0], "name", (String) null); setBodyValueByRow(row, "dw", name); } else { - setBodyValueByRow(row, "dw", (Object)null); + setBodyValueByRow(row, "dw", (Object) null); } - String pk_org = getHeadValue(hTable, "pk_org") == null ? null : (String)getHeadValue(hTable, "pk_org"); - String pk_customer = getHeadValue(hTable, "pk_customer") == null ? null : (String)getHeadValue(hTable, "pk_customer"); - UFDate date = getHeadValue(hTable, "preparedate") == null ? null : new UFDate((String)getHeadValue(hTable, "preparedate")); + String pk_org = getHeadValue(hTable, "pk_org") == null ? null : (String) getHeadValue(hTable, "pk_org"); + String pk_customer = getHeadValue(hTable, "pk_customer") == null ? null : (String) getHeadValue(hTable, "pk_customer"); + UFDate date = getHeadValue(hTable, "preparedate") == null ? null : new UFDate((String) getHeadValue(hTable, "preparedate")); TaxcodeTaxrateQueryVO taxQueryVO = new TaxcodeTaxrateQueryVO(); taxQueryVO.setReptaxcountryid("0001Z010000000079UJJ"); taxQueryVO.setPursaletype(1); @@ -772,9 +786,9 @@ public class DataChangeLogic { } } } else { - setBodyValueByRow(row, "xmmc", (Object)null); - setBodyValueByRow(row, "ggxh", (Object)null); - setBodyValueByRow(row, "dw", (Object)null); + setBodyValueByRow(row, "xmmc", (Object) null); + setBodyValueByRow(row, "ggxh", (Object) null); + setBodyValueByRow(row, "dw", (Object) null); } } @@ -782,7 +796,7 @@ public class DataChangeLogic { public static void afterEditBodyFphxz(Grid bTable, Row row, String cell) throws Exception { Integer fphxz = getBodyValueByRow(row, "fphxz") == null ? null : Integer.parseInt(String.valueOf(getBodyValueByRow(row, "fphxz"))); if (fphxz == null || fphxz != IVAplocationFPXZ.PFPXZ_BZKH.toIntValue()) { - setBodyValueByRow(row, "zkhhh", (Object)null); + setBodyValueByRow(row, "zkhhh", (Object) null); } } @@ -790,9 +804,9 @@ public class DataChangeLogic { public static void afterEditBodyTaxcode(Form hTable, Grid bTable, Row row, String cell) throws Exception { String taxcode = getBodyValueByRow(row, "taxcode") == null ? null : String.valueOf(getBodyValueByRow(row, "taxcode")); if (taxcode == null) { - setBodyValueByRow(row, "sl", new UFDouble((double)0.0F)); + setBodyValueByRow(row, "sl", new UFDouble((double) 0.0F)); } else { - UFDate date = new UFDate((String)getHeadValue(hTable, "preparedate")); + UFDate date = new UFDate((String) getHeadValue(hTable, "preparedate")); TaxrateQueryVO queryvo = new TaxrateQueryVO(); queryvo.setTaxcodeid(taxcode); queryvo.setBusinessDate(date); @@ -802,10 +816,10 @@ public class DataChangeLogic { if (vos[0].getTaxrate().compareTo(UFDouble.ZERO_DBL) == 0) { setBodyValueByRow(row, "lslbs", vos[0].getZero_tax_tag()); } else { - setBodyValueByRow(row, "lslbs", (Object)null); + setBodyValueByRow(row, "lslbs", (Object) null); } } else { - setBodyValueByRow(row, "sl", new UFDouble((double)0.0F)); + setBodyValueByRow(row, "sl", new UFDouble((double) 0.0F)); } } @@ -814,12 +828,12 @@ public class DataChangeLogic { public static void afterEditBodyMoney(Form hTable, Grid bTable, Row row, String cell) throws Exception { if (null != row) { - UFDouble xmdj = getBodyValueByRow(row, "xmdj") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmdj"))); - UFDouble xmsl = getBodyValueByRow(row, "xmsl") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmsl"))); - UFDouble sl = getBodyValueByRow(row, "sl") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "sl"))); - UFDouble xmje = getBodyValueByRow(row, "xmje") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmje"))); - UFDouble se = getBodyValueByRow(row, "se") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "se"))); - UFDouble xmjshj = getBodyValueByRow(row, "xmjshj") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmjshj"))); + UFDouble xmdj = getBodyValueByRow(row, "xmdj") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmdj"))); + UFDouble xmsl = getBodyValueByRow(row, "xmsl") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmsl"))); + UFDouble sl = getBodyValueByRow(row, "sl") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "sl"))); + UFDouble xmje = getBodyValueByRow(row, "xmje") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmje"))); + UFDouble se = getBodyValueByRow(row, "se") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "se"))); + UFDouble xmjshj = getBodyValueByRow(row, "xmjshj") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmjshj"))); int scale = 2; String pk_org = toString(getBodyValueByRow(row, "pk_org")); String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK(pk_org); @@ -828,15 +842,15 @@ public class DataChangeLogic { } sl = sl.multiply(new UFDouble(0.01)); - if (sl.compareTo(new UFDouble((double)0.0F)) >= 0 && sl.compareTo(new UFDouble(1)) <= 0) { + if (sl.compareTo(new UFDouble((double) 0.0F)) >= 0 && sl.compareTo(new UFDouble(1)) <= 0) { if (!"xmdj".equals(cell) && !"xmsl".equals(cell)) { if ("xmje".equals(cell)) { - if (xmsl.compareTo(new UFDouble((double)0.0F)) != 0) { - xmdj = xmje.compareTo(new UFDouble((double)0.0F)) == 0 ? new UFDouble((double)0.0F) : xmje.div(xmsl); + if (xmsl.compareTo(new UFDouble((double) 0.0F)) != 0) { + xmdj = xmje.compareTo(new UFDouble((double) 0.0F)) == 0 ? new UFDouble((double) 0.0F) : xmje.div(xmsl); setBodyValueByRow(row, "xmdj", xmdj); } - if (sl.compareTo(new UFDouble((double)0.0F)) > 0) { + if (sl.compareTo(new UFDouble((double) 0.0F)) > 0) { UFDouble var30 = xmje.div(new UFDouble(1)).multiply(sl); se = var30.setScale(scale, 4); setBodyValueByRow(row, "se", se); @@ -846,22 +860,22 @@ public class DataChangeLogic { xmjshj = var33.setScale(scale, 4); setBodyValueByRow(row, "xmjshj", xmjshj); } else if ("sl".equals(cell)) { - UFDouble var25 = xmjshj.compareTo(new UFDouble((double)0.0F)) == 0 ? new UFDouble((double)0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); + UFDouble var25 = xmjshj.compareTo(new UFDouble((double) 0.0F)) == 0 ? new UFDouble((double) 0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); xmje = var25.setScale(scale, 4); setBodyValueByRow(row, "xmje", xmje); UFDouble var31 = xmjshj.sub(xmje); se = var31.setScale(scale, 4); setBodyValueByRow(row, "se", se); - if (xmsl.compareTo(new UFDouble((double)0.0F)) != 0 && xmje.compareTo(new UFDouble((double)0.0F)) != 0) { + if (xmsl.compareTo(new UFDouble((double) 0.0F)) != 0 && xmje.compareTo(new UFDouble((double) 0.0F)) != 0) { xmdj = xmje.div(xmsl); setBodyValueByRow(row, "xmdj", xmdj); } - setBodyValueByRow(row, "lslbs", (Object)null); + setBodyValueByRow(row, "lslbs", (Object) null); if (sl.compareTo(UFDouble.ZERO_DBL) == 0) { String taxcode = getBodyValueByRow(row, "taxcode") == null ? null : String.valueOf(getBodyValueByRow(row, "taxcode")); if (taxcode != null) { - UFDate date = new UFDate((String)getHeadValue(hTable, "preparedate")); + UFDate date = new UFDate((String) getHeadValue(hTable, "preparedate")); TaxrateQueryVO queryvo = new TaxrateQueryVO(); queryvo.setTaxcodeid(taxcode); queryvo.setBusinessDate(date); @@ -872,26 +886,26 @@ public class DataChangeLogic { } } } else if ("se".equals(cell)) { - if (xmjshj.compareTo(new UFDouble((double)0.0F)) > 0) { + if (xmjshj.compareTo(new UFDouble((double) 0.0F)) > 0) { UFDouble var26 = xmjshj.sub(se); xmje = var26.setScale(scale, 4); setBodyValueByRow(row, "xmje", xmje); - xmdj = xmsl.compareTo(new UFDouble((double)0.0F)) != 0 && xmje.compareTo(new UFDouble((double)0.0F)) != 0 ? xmje.div(xmsl) : new UFDouble((double)0.0F); + xmdj = xmsl.compareTo(new UFDouble((double) 0.0F)) != 0 && xmje.compareTo(new UFDouble((double) 0.0F)) != 0 ? xmje.div(xmsl) : new UFDouble((double) 0.0F); setBodyValueByRow(row, "xmdj", xmdj); - if (xmje.compareTo(new UFDouble((double)0.0F)) > 0) { + if (xmje.compareTo(new UFDouble((double) 0.0F)) > 0) { sl = se.div(xmje).multiply(new UFDouble(100)); setBodyValueByRow(row, "sl", sl); } } } else if ("xmjshj".equals(cell)) { - if (sl.compareTo(new UFDouble((double)0.0F)) != 0) { - UFDouble var27 = xmjshj.compareTo(new UFDouble((double)0.0F)) == 0 ? new UFDouble((double)0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); + if (sl.compareTo(new UFDouble((double) 0.0F)) != 0) { + UFDouble var27 = xmjshj.compareTo(new UFDouble((double) 0.0F)) == 0 ? new UFDouble((double) 0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); xmje = var27.setScale(scale, 4); setBodyValueByRow(row, "xmje", xmje); UFDouble var32 = xmjshj.sub(xmje); se = var32.setScale(scale, 4); setBodyValueByRow(row, "se", se); - if (xmsl.compareTo(new UFDouble((double)0.0F)) != 0 && xmje.compareTo(new UFDouble((double)0.0F)) != 0) { + if (xmsl.compareTo(new UFDouble((double) 0.0F)) != 0 && xmje.compareTo(new UFDouble((double) 0.0F)) != 0) { xmdj = xmje.div(xmsl); setBodyValueByRow(row, "xmdj", xmdj); } @@ -899,7 +913,7 @@ public class DataChangeLogic { UFDouble var28 = xmjshj.sub(se); xmje = var28.setScale(scale, 4); setBodyValueByRow(row, "xmje", xmje); - xmdj = xmsl.compareTo(new UFDouble((double)0.0F)) != 0 && xmje.compareTo(new UFDouble((double)0.0F)) != 0 ? xmje.div(xmsl) : new UFDouble((double)0.0F); + xmdj = xmsl.compareTo(new UFDouble((double) 0.0F)) != 0 && xmje.compareTo(new UFDouble((double) 0.0F)) != 0 ? xmje.div(xmsl) : new UFDouble((double) 0.0F); setBodyValueByRow(row, "xmdj", xmdj); } } @@ -920,7 +934,7 @@ public class DataChangeLogic { setBodyValueByRow(row, "caninvoice_xmjshj", xmjshj.setScale(scale, 4)); totalBodyMoney(hTable, bTable); } else { - setBodyValueByRow(row, "sl", new UFDouble((double)0.0F)); + setBodyValueByRow(row, "sl", new UFDouble((double) 0.0F)); } } } @@ -933,9 +947,9 @@ public class DataChangeLogic { IVApplicationBodyVO changeBody = null; int changeIndex = 0; - for(int i = 0; i < bodyvos.length; ++i) { + for (int i = 0; i < bodyvos.length; ++i) { IVApplicationBodyVO bodyvo = bodyvos[i]; - String rowid = bodyvo.getAttributeValue("rowid") == null ? "" : (String)bodyvo.getAttributeValue("rowid"); + String rowid = bodyvo.getAttributeValue("rowid") == null ? "" : (String) bodyvo.getAttributeValue("rowid"); if (row.getRowid().equals(rowid)) { changeIndex = i; changeBody = bodyvo; @@ -943,7 +957,7 @@ public class DataChangeLogic { } } - if (changeBody != null && changeBody.getXmjshj() != null && !(changeBody.getXmjshj().doubleValue() < (double)0.0F)) { + if (changeBody != null && changeBody.getXmjshj() != null && !(changeBody.getXmjshj().doubleValue() < (double) 0.0F)) { UFDouble zkje = changeBody.getZkje(); if (zkje != null && zkje.compareTo(changeBody.getXmjshj()) >= 0) { throw new BusinessTypeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("1058ncc_0", "01058ncc-0026"), "warning"); @@ -952,7 +966,7 @@ public class DataChangeLogic { } else { IVApplicationBodyVO zkhBody = null; if (changeBody.getZkhhh() != null) { - for(IVApplicationBodyVO bodyvo : bodyvos) { + for (IVApplicationBodyVO bodyvo : bodyvos) { if (bodyvo.getHh() != null && bodyvo.getHh().equals(changeBody.getZkhhh())) { zkhBody = bodyvo; break; @@ -961,7 +975,7 @@ public class DataChangeLogic { } List newBodys = new ArrayList(); - if (zkje != null && zkje.doubleValue() != (double)0.0F) { + if (zkje != null && zkje.doubleValue() != (double) 0.0F) { boolean addLine = false; if (zkhBody == null) { addLine = true; @@ -970,13 +984,13 @@ public class DataChangeLogic { String hh = "1"; Set hhs = new HashSet(); - for(IVApplicationBodyVO bodyvo : bodyvos) { + for (IVApplicationBodyVO bodyvo : bodyvos) { if (bodyvo.getHh() != null && bodyvo.getStatus() != VOStatus.Deleted.intValue()) { hhs.add(bodyvo.getHh()); } } - while(hhs.contains(hh)) { + while (hhs.contains(hh)) { int var10000 = Integer.parseInt(hh); hh = "" + (var10000 + 1); } @@ -1009,24 +1023,24 @@ public class DataChangeLogic { } changeBody.setFphxz(IVAplocationFPXZ.PFPXZ_BZKH.toIntValue()); - UFDouble xmjshj = zkje.multiply((double)-1.0F); + UFDouble xmjshj = zkje.multiply((double) -1.0F); xmjshj = xmjshj.setScale(scale, 4); zkhBody.setXmjshj(xmjshj); - UFDouble sl = zkhBody.getSl() == null ? new UFDouble((double)0.0F) : zkhBody.getSl(); + UFDouble sl = zkhBody.getSl() == null ? new UFDouble((double) 0.0F) : zkhBody.getSl(); sl = sl.multiply(new UFDouble(0.01)); - if (sl.compareTo(new UFDouble((double)0.0F)) >= 0 && sl.compareTo(new UFDouble(1)) <= 0) { - UFDouble xmje = xmjshj.compareTo(new UFDouble((double)0.0F)) == 0 ? new UFDouble((double)0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); + if (sl.compareTo(new UFDouble((double) 0.0F)) >= 0 && sl.compareTo(new UFDouble(1)) <= 0) { + UFDouble xmje = xmjshj.compareTo(new UFDouble((double) 0.0F)) == 0 ? new UFDouble((double) 0.0F) : xmjshj.div(sl.add(new UFDouble(1))).multiply(new UFDouble(1)); xmje = xmje.setScale(scale, 4); UFDouble se = xmjshj.sub(xmje); se = se.setScale(scale, 4); - UFDouble xmdj = new UFDouble((double)0.0F); - UFDouble xmsl = new UFDouble((double)0.0F); + UFDouble xmdj = new UFDouble((double) 0.0F); + UFDouble xmsl = new UFDouble((double) 0.0F); zkhBody.setXmje(xmje); zkhBody.setSe(se); zkhBody.setXmsl(xmsl); zkhBody.setXmdj(xmdj); } else { - zkhBody.setSl(new UFDouble((double)0.0F)); + zkhBody.setSl(new UFDouble((double) 0.0F)); zkhBody.setSe(UFDouble.ZERO_DBL.setScale(scale, 4)); zkhBody.setXmje(xmjshj); } @@ -1036,16 +1050,16 @@ public class DataChangeLogic { zkhBody.setCaninvoice_xmjshj(zkhBody.getXmjshj()); zkhBody.setCaninvoice_xmsl(zkhBody.getXmsl()); - for(int i = 0; i < bodyvos.length; ++i) { + for (int i = 0; i < bodyvos.length; ++i) { newBodys.add(bodyvos[i]); if (addLine && i == changeIndex) { newBodys.add(zkhBody); } } } else { - for(int i = 0; i < bodyvos.length; ++i) { + for (int i = 0; i < bodyvos.length; ++i) { if (bodyvos[i].getHh() != null && bodyvos[i].getHh().equals(changeBody.getZkhhh())) { - changeBody.setZkhhh((String)null); + changeBody.setZkhhh((String) null); changeBody.setFphxz(IVAplocationFPXZ.FPXZ_ZCH.toIntValue()); bodyvos[i].setStatus(VOStatus.Deleted.intValue()); } @@ -1054,7 +1068,7 @@ public class DataChangeLogic { } } - vo.setChildrenVO((CircularlyAccessibleValueObject[])newBodys.toArray(new IVApplicationBodyVO[0])); + vo.setChildrenVO((CircularlyAccessibleValueObject[]) newBodys.toArray(new IVApplicationBodyVO[0])); BillCardOperator oper = new BillCardOperator(pageCode); BillCard rocard = oper.toCard(vo); bTable = rocard.getBody(); @@ -1068,9 +1082,9 @@ public class DataChangeLogic { public static void totalBodyMoney(Form hTable, Grid bTable) throws Exception { Row[] rows = bTable.getModel().getRows(); - UFDouble xmje = new UFDouble((double)0.0F); - UFDouble se = new UFDouble((double)0.0F); - UFDouble xmjshj = new UFDouble((double)0.0F); + UFDouble xmje = new UFDouble((double) 0.0F); + UFDouble se = new UFDouble((double) 0.0F); + UFDouble xmjshj = new UFDouble((double) 0.0F); int scale = 2; String pk_org = toString(getHeadValue(hTable, "pk_org")); String orgLocalCurrPK = getIVApplicationService().getOrgLocalCurrPK(pk_org); @@ -1079,11 +1093,11 @@ public class DataChangeLogic { } if (rows != null && rows.length > 0) { - for(Row row : rows) { + for (Row row : rows) { if (VOStatus.Deleted.intValue() != row.getStatus().intValue()) { - UFDouble xmjein = getBodyValueByRow(row, "xmje") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmje"))); - UFDouble sein = getBodyValueByRow(row, "se") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "se"))); - UFDouble xmjshjin = getBodyValueByRow(row, "xmjshj") == null ? new UFDouble((double)0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmjshj"))); + UFDouble xmjein = getBodyValueByRow(row, "xmje") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmje"))); + UFDouble sein = getBodyValueByRow(row, "se") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "se"))); + UFDouble xmjshjin = getBodyValueByRow(row, "xmjshj") == null ? new UFDouble((double) 0.0F) : new UFDouble(String.valueOf(getBodyValueByRow(row, "xmjshj"))); xmje = xmje.add(xmjein); se = se.add(sein); xmjshj = xmjshj.add(xmjshjin); @@ -1165,7 +1179,7 @@ public class DataChangeLogic { if (table.getModel() != null && table.getModel().getRows() != null && table.getModel().getRows().length > 0) { Row[] rows = table.getModel().getRows(); - for(Row row : rows) { + for (Row row : rows) { if (null != row.getCell(itemKey)) { row.getCell(itemKey).setValue(value); row.getCell(itemKey).setDisplay(String.valueOf(value == null ? "" : value)); @@ -1202,6 +1216,6 @@ public class DataChangeLogic { } protected static IVApplicationService getIVApplicationService() throws ComponentException { - return (IVApplicationService)ServiceLocator.find(IVApplicationService.class); + return (IVApplicationService) ServiceLocator.find(IVApplicationService.class); } }