diff --git a/ic/src/private/nc/bs/pub/action/N_45_CANCELSIGN.java b/ic/src/private/nc/bs/pub/action/N_45_CANCELSIGN.java new file mode 100644 index 0000000..30a9e46 --- /dev/null +++ b/ic/src/private/nc/bs/pub/action/N_45_CANCELSIGN.java @@ -0,0 +1,46 @@ +package nc.bs.pub.action; + +import java.util.Hashtable; +import nc.bs.framework.common.NCLocator; +import nc.bs.pub.compiler.AbstractCompiler2; +import nc.itf.ic.m45.self.IPurchaseInMaintain; +import nc.pubitf.ic.egap.INCCForEGAPIntf; +import nc.vo.ic.m45.entity.PurchaseInVO; +import nc.vo.ml.NCLangRes4VoTransl; +import nc.vo.pub.BusinessException; +import nc.vo.pub.compiler.PfParameterVO; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; + +public class N_45_CANCELSIGN extends AbstractCompiler2 { + private Hashtable m_methodReturnHas = new Hashtable(); + private Hashtable m_keyHas = null; + + public Object runComClass(PfParameterVO vo) throws BusinessException { + try { + super.m_tmpVo = vo; + PurchaseInVO[] inVOs = (PurchaseInVO[]) ((PurchaseInVO[]) this.getVos()); + inVOs=((IPurchaseInMaintain) NCLocator.getInstance().lookup(IPurchaseInMaintain.class)).cancelSign(inVOs); + ((INCCForEGAPIntf)NCLocator.getInstance().lookup(INCCForEGAPIntf.class)).unSign45(inVOs[0]); + + return inVOs; + } catch (Exception var3) { + ExceptionUtils.marsh(var3); + return null; + } + } + + public String getCodeRemark() { + return NCLangRes4VoTransl.getNCLangRes().getStrByID("4008002_0", "04008002-0076"); + } + + private void setParameter(String key, Object val) { + if (this.m_keyHas == null) { + this.m_keyHas = new Hashtable(); + } + + if (val != null) { + this.m_keyHas.put(key, val); + } + + } +} \ No newline at end of file diff --git a/ic/src/private/nc/bs/pub/action/N_45_SIGN.java b/ic/src/private/nc/bs/pub/action/N_45_SIGN.java new file mode 100644 index 0000000..c890477 --- /dev/null +++ b/ic/src/private/nc/bs/pub/action/N_45_SIGN.java @@ -0,0 +1,68 @@ +/* */ package nc.bs.pub.action; +/* */ +/* */ import java.util.Hashtable; +/* */ import nc.bs.framework.common.NCLocator; +/* */ import nc.bs.pub.compiler.AbstractCompiler2; +/* */ import nc.itf.ic.m45.self.IPurchaseInMaintain; +import nc.pubitf.ic.egap.INCCForEGAPIntf; +/* */ import nc.vo.ic.m45.entity.PurchaseInVO; +/* */ import nc.vo.ml.NCLangRes4VoTransl; +/* */ import nc.vo.pub.BusinessException; +/* */ import nc.vo.pub.compiler.PfParameterVO; +/* */ import nc.vo.pubapp.pattern.exception.ExceptionUtils; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class N_45_SIGN extends AbstractCompiler2 { +/* */ private Hashtable m_methodReturnHas = new Hashtable(); +/* */ private Hashtable m_keyHas = null; +/* */ +/* */ public Object runComClass(PfParameterVO vo) throws BusinessException { +/* */ try { +/* 31 */ super.m_tmpVo = vo; +/* */ +/* 33 */ PurchaseInVO[] inVOs = (PurchaseInVO[])((PurchaseInVO[])this.getVos()); +/* */ +/* */ +/* 36 */ inVOs = ((IPurchaseInMaintain)NCLocator.getInstance().lookup(IPurchaseInMaintain.class)).sign(inVOs); +/* */ + ((INCCForEGAPIntf)NCLocator.getInstance().lookup(INCCForEGAPIntf.class)).sign45(inVOs[0]); +/* */ +/* 40 */ return inVOs; +/* */ +/* 42 */ } catch (Exception var3) { +/* 43 */ ExceptionUtils.marsh(var3); +/* */ +/* 45 */ return null; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getCodeRemark() { +/* 53 */ return NCLangRes4VoTransl.getNCLangRes().getStrByID("4008002_0", "04008002-0076"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private void setParameter(String key, Object val) { +/* 60 */ if (this.m_keyHas == null) { +/* 61 */ this.m_keyHas = new Hashtable(); +/* */ } +/* 63 */ if (val != null) { +/* 64 */ this.m_keyHas.put(key, val); +/* */ } +/* 66 */ } +/* */ } diff --git a/ic/src/private/nc/bs/pub/egap/EGAPGenJsonBO.java b/ic/src/private/nc/bs/pub/egap/EGAPGenJsonBO.java new file mode 100644 index 0000000..c86b75e --- /dev/null +++ b/ic/src/private/nc/bs/pub/egap/EGAPGenJsonBO.java @@ -0,0 +1,137 @@ +package nc.bs.pub.egap; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import nc.bd.itf.tools.EGAPParam; +import nc.bs.dao.BaseDAO; +import nc.bs.framework.common.NCLocator; +import nc.vo.ic.m45.entity.PurchaseInVO; +import nc.vo.pub.BusinessException; +import nc.jdbc.framework.processor.*; +import nc.pubitf.ic.egap.INCCForEGAPIntf; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +public class EGAPGenJsonBO { +public BaseDAO dao=null; + public BaseDAO getDao() { + if(dao==null) { + dao=new BaseDAO(); + } + return dao; + } +public INCCForEGAPIntf iNCCForEGAPIntf =null; + + public INCCForEGAPIntf getiNCCForEGAPIntf() { + if(iNCCForEGAPIntf == null) { + iNCCForEGAPIntf = (INCCForEGAPIntf)NCLocator.getInstance().lookup(INCCForEGAPIntf.class.getName()); + } + return iNCCForEGAPIntf; + } + + public void gen45JsonForSign(PurchaseInVO inVOs) throws BusinessException { + +// { +// "token":"D6467205-7A71-4CF6-BD8C-3F9968BF0826", +// "podata":{ +// "bill":{ +// "erpid":"testfid002", +// "ccompany":"华丰安丘公司", +// "cincode":"RK20240307005", +// "copname":"李金剑", +// "cwhcode":"", +// "cwhname":"", +// "ddate":"2024-09-18 00:00:00", +// "cvencode":"", +// "cvenname":"", +// "cremark":"" +// }, +// "billdetail":[{ +// "cinvcode":"14030096", +// "cinvenginnerno":"14030096", +// "cinvname":"滤清器", +// "cinvstd":"V-0.3/7", +// "cunit":"个", +// "isnullin":"0", +// "iqty":"50", +// "cbatchcode":"", +// "cqualityinfo":"合格", +// "cnote":"", +// "cerpsubid":"test37811", +// "cordercode":"", +// "cfcode":"" +// }] +// } +// } + + //主表 + String sql=" select h.vbillcode cincode,org.name ccompany,psn.name copname,ck.code cwhcode,ck.name cwhname, " + + " h.dbilldate ddate,gys.name cvenname,gys.code cvencode,h.cgeneralhid erpid,h.vnote cremark " + + " from ic_purchasein_h h " + + " left join org_purchaseorg org on h.cpurorgoid=org.pk_purchaseorg " + + " left join bd_psndoc psn on psn.pk_psndoc=h.cbizid " + + " left join bd_stordoc ck on ck.pk_stordoc=h.cwarehouseid " + + " left join bd_supplier gys on gys.pk_supplier=h.cvendorid " + + " where h.cgeneralhid='"+inVOs.getParentVO().getCgeneralhid()+"' "; + HashMap lists=(HashMap) getDao().executeQuery(sql, new MapProcessor()); + + JSONObject hojson=new JSONObject(); + + hojson.put("token", EGAPParam.EGAPTOKEN); + + JSONObject ohjson=new JSONObject(); + JSONObject ojson=new JSONObject(); + + + Iterator> iterator = lists.entrySet().iterator(); + while (iterator.hasNext()) { + Entry entry = iterator.next(); + ojson.put(entry.getKey(), entry.getValue()); + } + ohjson.put("bill", ojson); + + hojson.put("podata", ohjson); + //子表 + sql=" select b.cgeneralbid cerpsubid,wl.code cinvcode,wl.name cinvname,wl.code cinvenginnerno " + + ",wl.materialspec cinvstd,mes.code cunit,b.nassistnum iqty " + + ",case when b.cvmivenderid <> '~' then 1 else 0 end as isnullin, b.vbatchcode cbatchcode,b.vnotebody cnote,b.vfirstbillcode cordercode,b.vsourcebillcode cfcode " + + " from ic_purchasein_b b " + + "inner join bd_material wl on b.cmaterialoid=wl.pk_material " + + "inner join bd_measdoc mes on wl.pk_measdoc=mes.pk_measdoc " + + "where " + + " b.cgeneralhid='"+inVOs.getParentVO().getCgeneralhid()+"' and b.dr=0 "; + JSONArray arraj=new JSONArray(); + ArrayList> blists=(ArrayList>) getDao().executeQuery(sql, new MapListProcessor()); + if(lists!=null&&lists.size()>0) { + for (HashMap map:blists) { + Iterator> biterator = map.entrySet().iterator(); + JSONObject bojson=new JSONObject(); + while (biterator.hasNext()) { + Entry entry = biterator.next(); + bojson.put(entry.getKey(), entry.getValue()); + } + arraj.add(bojson); + } + } + ohjson.put("billdetail", arraj); + + getiNCCForEGAPIntf().sendEGAP(hojson.toJSONString(), EGAPParam.HFNCCINF036, inVOs.getPrimaryKey()); + + } + public void gen45JsonForUnSign(PurchaseInVO inVOs) throws BusinessException { +// { +// "token":"D6467205-7A71-4CF6-BD8C-3F9968BF0826", +// "ERPID":"" +// } + JSONObject ojson=new JSONObject(); + ojson.put("token", EGAPParam.EGAPTOKEN); + ojson.put("ERPID", inVOs.getPrimaryKey()); + + getiNCCForEGAPIntf().sendEGAP(ojson.toJSONString(), EGAPParam.HFNCCINF037, inVOs.getPrimaryKey()); + } + +} diff --git a/ic/src/public/nc/bd/itf/tools/EGAPParam.java b/ic/src/public/nc/bd/itf/tools/EGAPParam.java new file mode 100644 index 0000000..659a68c --- /dev/null +++ b/ic/src/public/nc/bd/itf/tools/EGAPParam.java @@ -0,0 +1,55 @@ +package nc.bd.itf.tools; + +public class EGAPParam { + public static String EGAPTOKEN = "D6467205-7A71-4CF6-BD8C-3F9968BF0826"; +// HFNCCINF030 采购订单接收 +// HFNCCINF031 采购订单删除 +// HFNCCINF032 采购订单行关闭 +// HFNCCINF033 采购订单行打开 +// HFNCCINF034 采购送货单新增 +// HFNCCINF035 采购送货单删除 +// HFNCCINF036 采购入库单接收 +// HFNCCINF037 采购入库单删除 +// HFNCCINF038 销售发票接收(索赔单) +// HFNCCINF039 销售发票删除(索赔单删除) +// HFNCCINF040 开票通知单接收 +// HFNCCINF041 开票通知单删除 +// HFNCCINF042 采购订单执行统计表接收 +// HFNCCINF043 质检单接收 +// HFNCCINF044 质检单删除 +// HFNCCINF045 寄售库存信息接收 +// HFNCCINF046 采购发票推送NCC +// HFNCCINF047 采购发票撤销推送NCC +// HFNCCINF048 成品入库单推送NCC +// HFNCCINF049 成品入库单删除推送NCC +// HFNCCINF050 销售订单推送NCC +// HFNCCINF051 销售订单删除推送NCC +// HFNCCINF052 销售发货推送NCC +// HFNCCINF053 销售发货删除推送NCC + public static String HFNCCINF030 = "HFNCCINF030"; + public static String HFNCCINF031 = "HFNCCINF031"; + public static String HFNCCINF032 = "HFNCCINF032"; + public static String HFNCCINF033 = "HFNCCINF033"; + public static String HFNCCINF034 = "HFNCCINF034"; + public static String HFNCCINF035 = "HFNCCINF035"; + public static String HFNCCINF036 = "HFNCCINF036"; + public static String HFNCCINF037 = "HFNCCINF037"; + public static String HFNCCINF038 = "HFNCCINF038"; + public static String HFNCCINF039 = "HFNCCINF039"; + public static String HFNCCINF040 = "HFNCCINF040"; + public static String HFNCCINF041 = "HFNCCINF041"; + public static String HFNCCINF042 = "HFNCCINF042"; + public static String HFNCCINF043 = "HFNCCINF043"; + public static String HFNCCINF044 = "HFNCCINF044"; + public static String HFNCCINF045 = "HFNCCINF045"; + public static String HFNCCINF046 = "HFNCCINF046"; + public static String HFNCCINF047 = "HFNCCINF047"; + public static String HFNCCINF048 = "HFNCCINF048"; + public static String HFNCCINF049 = "HFNCCINF049"; + public static String HFNCCINF050 = "HFNCCINF050"; + public static String HFNCCINF051 = "HFNCCINF051"; + public static String HFNCCINF052 = "HFNCCINF052"; + public static String HFNCCINF053 = "HFNCCINF053"; +// public static String EGAPTOKEN = "D6467205-7A71-4CF6-BD8C-3F9968BF0826"; + +}