This commit is contained in:
mzr 2024-10-18 09:33:04 +08:00
commit 6b37585947
4 changed files with 306 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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 */ }
/* */ }

View File

@ -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<String,Object> lists=(HashMap<String, Object>) getDao().executeQuery(sql, new MapProcessor());
JSONObject hojson=new JSONObject();
hojson.put("token", EGAPParam.EGAPTOKEN);
JSONObject ohjson=new JSONObject();
JSONObject ojson=new JSONObject();
Iterator<Entry<String, Object>> iterator = lists.entrySet().iterator();
while (iterator.hasNext()) {
Entry<String, Object> 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<HashMap<String,Object>> blists=(ArrayList<HashMap<String, Object>>) getDao().executeQuery(sql, new MapListProcessor());
if(lists!=null&&lists.size()>0) {
for (HashMap<String,Object> map:blists) {
Iterator<Entry<String, Object>> biterator = map.entrySet().iterator();
JSONObject bojson=new JSONObject();
while (biterator.hasNext()) {
Entry<String, Object> 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());
}
}

View File

@ -0,0 +1,55 @@
package nc.bd.itf.tools;
public class EGAPParam {
public static String EGAPTOKEN = "D6467205-7A71-4CF6-BD8C-3F9968BF0826";
// HFNCCINF030 꽃뭔땐데쌈澗
// HFNCCINF031 꽃뭔땐데<EFBFBD>
// HFNCCINF032 꽃뭔땐데契밑균
// HFNCCINF033 꽃뭔땐데契댔역
// HFNCCINF034 꽃뭔箇새데劤藤
// HFNCCINF035 꽃뭔箇새데<EFBFBD>
// HFNCCINF036 꽃뭔흙욋데쌈澗
// HFNCCINF037 꽃뭔흙욋데<EFBFBD>
// HFNCCINF038 饋簡랙튿쌈澗(乞톄데
// HFNCCINF039 饋簡랙튿<EFBFBD>(乞톄데<EFBFBD>
// HFNCCINF040 역튿繫列데쌈澗
// HFNCCINF041 역튿繫列데<EFBFBD>
// HFNCCINF042 꽃뭔땐데獵契固셕깊쌈澗
// HFNCCINF043 醴쇱데쌈澗
// HFNCCINF044 醴쇱데<EFBFBD>
// HFNCCINF045 셍簡욋닸斤口쌈澗
// HFNCCINF046 꽃뭔랙튿股箇NCC
// HFNCCINF047 꽃뭔랙튿낮饋股箇NCC
// HFNCCINF048 냥틔흙욋데股箇NCC
// HFNCCINF049 냥틔흙욋데<EFBFBD>뇜股箇NCC
// HFNCCINF050 饋簡땐데股箇NCC
// HFNCCINF051 饋簡땐데<EFBFBD>뇜股箇NCC
// HFNCCINF052 饋簡랙새股箇NCC
// HFNCCINF053 饋簡랙새<EFBFBD>뇜股箇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";
}