Compare commits
14 Commits
2555e3c304
...
ca1c924fbc
Author | SHA1 | Date |
---|---|---|
|
ca1c924fbc | |
|
3be8f4d652 | |
|
b70b874e94 | |
|
28cd719b78 | |
|
df2998ce3f | |
|
baba360775 | |
|
2125d4dce0 | |
|
316e41f21a | |
|
b6f1d11950 | |
|
168f1283e9 | |
|
9f0e7b5d09 | |
|
7342b958d2 | |
|
ef7078fc2b | |
|
ce70df8142 |
|
@ -1,10 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="bin" path="so/src/public"/>
|
||||
<classpathentry kind="src" output="bin" path="so/src/client"/>
|
||||
<classpathentry kind="src" output="bin" path="so/src/private"/>
|
||||
<classpathentry kind="src" output="bin" path="so/src/test"/>
|
||||
<classpathentry kind="src" output="bin" path="so/resources"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/public"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/client"/>
|
||||
<classpathentry kind="src" output="bin" path="pu/src/private"/>
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="gb2312"?>
|
||||
<module name="ic">
|
||||
<public>
|
||||
</public>
|
||||
<private>
|
||||
</private>
|
||||
</module>
|
|
@ -1 +0,0 @@
|
|||
/bin/
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module name="uapbd">
|
||||
<public>
|
||||
<component remote="true" singleton="true" tx="CMT">
|
||||
<interface>nc.pubitf.ic.egap.INCCForEGAPIntf</interface>
|
||||
<implementation>nc.impl.ic.egap.INCCForEGAPImpl</implementation>
|
||||
</component>
|
||||
</public>
|
||||
<private>
|
||||
</private>
|
||||
</module>
|
||||
<?xml version="1.0" encoding='gb2312'?>
|
||||
<module name="uapbd">
|
||||
<public>
|
||||
<component remote="true" singleton="true" tx="CMT">
|
||||
<interface>nc.pubitf.ic.egap.INCCForEGAPIntf</interface>
|
||||
<implementation>nc.impl.ic.egap.INCCForEGAPImpl</implementation>
|
||||
</component>
|
||||
</public>
|
||||
<private>
|
||||
</private>
|
||||
</module>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,46 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/* */ 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 */ }
|
||||
/* */ }
|
|
@ -1,137 +0,0 @@
|
|||
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());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
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";
|
||||
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
<component name="so" displayname="so">
|
||||
<dependencies/>
|
||||
</component>
|
|
@ -1,66 +1,66 @@
|
|||
package nc.impl.ic.egap;
|
||||
|
||||
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import nc.bs.dao.BaseDAO;
|
||||
import nc.bs.pub.egap.EGAPGenJsonBO;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
|
||||
import nc.pubitf.ic.egap.INCCForEGAPIntf;
|
||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
|
||||
import weaver.formmode.webservices.SysFomForHttp;
|
||||
|
||||
public class INCCForEGAPImpl implements INCCForEGAPIntf {
|
||||
|
||||
public BaseDAO dao=null;
|
||||
|
||||
public BaseDAO getDao() {
|
||||
if(dao==null) {
|
||||
dao=new BaseDAO();
|
||||
}
|
||||
return dao;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sendEGAP(String json, String mothodCode,String pk) throws BusinessException {
|
||||
String ulr=getUrl(mothodCode);
|
||||
Map<String, String> headers =new HashMap<String, String>();
|
||||
headers.put("Jsoninfo", json);
|
||||
new SysFomForHttp().doHttpPost(ulr,null,null,headers,json,null);
|
||||
}
|
||||
|
||||
private String getUrl(String string) throws BusinessException {
|
||||
String sql=" select url from pub_url where code='"+string+"' ";
|
||||
|
||||
Object o=getDao().executeQuery(sql, new ColumnProcessor());
|
||||
if(o==null) {
|
||||
throw new BusinessException("编码为"+string+"EPAP接口为空,请设置接口地址");
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sign45(PurchaseInVO inVOs) throws BusinessException {
|
||||
new EGAPGenJsonBO().gen45JsonForSign(inVOs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void unSign45(PurchaseInVO inVOs) throws BusinessException {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package nc.impl.ic.egap;
|
||||
|
||||
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import nc.bs.dao.BaseDAO;
|
||||
import nc.bs.pub.egap.EGAPGenJsonBO;
|
||||
import nc.jdbc.framework.processor.ColumnProcessor;
|
||||
|
||||
import nc.pubitf.ic.egap.INCCForEGAPIntf;
|
||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
|
||||
import weaver.formmode.webservices.SysFomForHttp;
|
||||
|
||||
public class INCCForEGAPImpl implements INCCForEGAPIntf {
|
||||
|
||||
public BaseDAO dao=null;
|
||||
|
||||
public BaseDAO getDao() {
|
||||
if(dao==null) {
|
||||
dao=new BaseDAO();
|
||||
}
|
||||
return dao;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sendEGAP(String json, String mothodCode,String pk) throws BusinessException {
|
||||
String ulr=getUrl(mothodCode);
|
||||
Map<String, String> headers =new HashMap<String, String>();
|
||||
headers.put("Jsoninfo", json);
|
||||
new SysFomForHttp().doHttpPost(ulr,null,null,headers,json,null);
|
||||
}
|
||||
|
||||
private String getUrl(String string) throws BusinessException {
|
||||
String sql=" select url from pub_url where code='"+string+"' ";
|
||||
|
||||
Object o=getDao().executeQuery(sql, new ColumnProcessor());
|
||||
if(o==null) {
|
||||
throw new BusinessException("编码为"+string+"EPAP接口为空,请设置接口地址");
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void sign45(PurchaseInVO inVOs) throws BusinessException {
|
||||
new EGAPGenJsonBO().gen45JsonForSign(inVOs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void unSign45(PurchaseInVO inVOs) throws BusinessException {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,172 +1,172 @@
|
|||
package weaver.formmode.webservices;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import nc.bd.itf.tools.BFPubTools;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
|
||||
|
||||
|
||||
public class SysFomForHttp {
|
||||
|
||||
|
||||
|
||||
public void doHttpPost(String baseUrl, Map<String, String> paramMap, String mediaType1, Map<String, String> headers, String json,String pk) throws BusinessException{
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("multipart/form-data");
|
||||
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
|
||||
.addFormDataPart("JsonInfo",json)
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(baseUrl)
|
||||
.method("POST", body)
|
||||
.addHeader("content-type", "multipart/form-data")
|
||||
.build();
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
if (response.isSuccessful()) {
|
||||
String responseBody = response.body().string(); // »ñÈ¡·µ»ØÐÅÏ¢
|
||||
JSONObject json_test = JSONObject.parseObject(responseBody);
|
||||
if(!json_test.getBoolean("Success")) {
|
||||
throw new BusinessException("EGAP½Ó¿Ú·µ»Ø:"+json_test.getString("Message"));
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String doPost(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json,String pk) throws BusinessException{
|
||||
|
||||
HttpURLConnection urlConnection = null;
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
BufferedReader bufferedReader = null;
|
||||
String result = null;
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(baseUrl);
|
||||
if (paramMap != null) {
|
||||
sb.append("?");
|
||||
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
sb.append(key + "=" + value).append("&");
|
||||
}
|
||||
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
|
||||
}
|
||||
|
||||
|
||||
URL urlObj = new URL(baseUrl);
|
||||
urlConnection = (HttpURLConnection) urlObj.openConnection();
|
||||
urlConnection.setConnectTimeout(50000);
|
||||
urlConnection.setRequestMethod("POST");
|
||||
urlConnection.setDoOutput(true);
|
||||
urlConnection.setDoInput(true);
|
||||
urlConnection.setUseCaches(false);
|
||||
urlConnection.addRequestProperty("content-type", "multipart/form-data");
|
||||
|
||||
|
||||
|
||||
if (headers != null) {
|
||||
for (String key : headers.keySet()) {
|
||||
urlConnection.addRequestProperty(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
out = urlConnection.getOutputStream();
|
||||
out.write(json.getBytes("utf-8"));
|
||||
out.flush();
|
||||
|
||||
int resCode = urlConnection.getResponseCode();
|
||||
if (resCode == HttpURLConnection.HTTP_OK || resCode == HttpURLConnection.HTTP_CREATED || resCode == HttpURLConnection.HTTP_ACCEPTED) {
|
||||
in = urlConnection.getInputStream();
|
||||
} else {
|
||||
in = urlConnection.getErrorStream();
|
||||
}
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(in, "utf-8"));
|
||||
StringBuffer temp = new StringBuffer();
|
||||
String line = bufferedReader.readLine();
|
||||
while (line != null) {
|
||||
temp.append(line).append("\r\n");
|
||||
line = bufferedReader.readLine();
|
||||
}
|
||||
String ecod = urlConnection.getContentEncoding();
|
||||
if (ecod == null) {
|
||||
ecod = Charset.forName("utf-8").name();
|
||||
}
|
||||
result = new String(temp.toString().getBytes("utf-8"), ecod);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
} finally {
|
||||
|
||||
|
||||
if (null != bufferedReader) {
|
||||
try {
|
||||
bufferedReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != out) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != in) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
urlConnection.disconnect();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
package weaver.formmode.webservices;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import nc.bd.itf.tools.BFPubTools;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
|
||||
|
||||
|
||||
public class SysFomForHttp {
|
||||
|
||||
|
||||
|
||||
public void doHttpPost(String baseUrl, Map<String, String> paramMap, String mediaType1, Map<String, String> headers, String json,String pk) throws BusinessException{
|
||||
OkHttpClient client = new OkHttpClient().newBuilder()
|
||||
.build();
|
||||
MediaType mediaType = MediaType.parse("multipart/form-data");
|
||||
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
|
||||
.addFormDataPart("JsonInfo",json)
|
||||
.build();
|
||||
Request request = new Request.Builder()
|
||||
.url(baseUrl)
|
||||
.method("POST", body)
|
||||
.addHeader("content-type", "multipart/form-data")
|
||||
.build();
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
if (response.isSuccessful()) {
|
||||
String responseBody = response.body().string(); // »ñÈ¡·µ»ØÐÅÏ¢
|
||||
JSONObject json_test = JSONObject.parseObject(responseBody);
|
||||
if(!json_test.getBoolean("Success")) {
|
||||
throw new BusinessException("EGAP½Ó¿Ú·µ»Ø:"+json_test.getString("Message"));
|
||||
}
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String doPost(String baseUrl, Map<String, String> paramMap, String mediaType, Map<String, String> headers, String json,String pk) throws BusinessException{
|
||||
|
||||
HttpURLConnection urlConnection = null;
|
||||
InputStream in = null;
|
||||
OutputStream out = null;
|
||||
BufferedReader bufferedReader = null;
|
||||
String result = null;
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(baseUrl);
|
||||
if (paramMap != null) {
|
||||
sb.append("?");
|
||||
for (Map.Entry<String, String> entry : paramMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
sb.append(key + "=" + value).append("&");
|
||||
}
|
||||
baseUrl = sb.toString().substring(0, sb.toString().length() - 1);
|
||||
}
|
||||
|
||||
|
||||
URL urlObj = new URL(baseUrl);
|
||||
urlConnection = (HttpURLConnection) urlObj.openConnection();
|
||||
urlConnection.setConnectTimeout(50000);
|
||||
urlConnection.setRequestMethod("POST");
|
||||
urlConnection.setDoOutput(true);
|
||||
urlConnection.setDoInput(true);
|
||||
urlConnection.setUseCaches(false);
|
||||
urlConnection.addRequestProperty("content-type", "multipart/form-data");
|
||||
|
||||
|
||||
|
||||
if (headers != null) {
|
||||
for (String key : headers.keySet()) {
|
||||
urlConnection.addRequestProperty(key, headers.get(key));
|
||||
}
|
||||
}
|
||||
out = urlConnection.getOutputStream();
|
||||
out.write(json.getBytes("utf-8"));
|
||||
out.flush();
|
||||
|
||||
int resCode = urlConnection.getResponseCode();
|
||||
if (resCode == HttpURLConnection.HTTP_OK || resCode == HttpURLConnection.HTTP_CREATED || resCode == HttpURLConnection.HTTP_ACCEPTED) {
|
||||
in = urlConnection.getInputStream();
|
||||
} else {
|
||||
in = urlConnection.getErrorStream();
|
||||
}
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(in, "utf-8"));
|
||||
StringBuffer temp = new StringBuffer();
|
||||
String line = bufferedReader.readLine();
|
||||
while (line != null) {
|
||||
temp.append(line).append("\r\n");
|
||||
line = bufferedReader.readLine();
|
||||
}
|
||||
String ecod = urlConnection.getContentEncoding();
|
||||
if (ecod == null) {
|
||||
ecod = Charset.forName("utf-8").name();
|
||||
}
|
||||
result = new String(temp.toString().getBytes("utf-8"), ecod);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(e.getMessage());
|
||||
} finally {
|
||||
|
||||
|
||||
if (null != bufferedReader) {
|
||||
try {
|
||||
bufferedReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != out) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (null != in) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
urlConnection.disconnect();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,233 +1,233 @@
|
|||
package nc.bd.itf.tools;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
import nc.vo.pub.lang.UFDate;
|
||||
import nc.vo.pub.lang.UFDateTime;
|
||||
import nc.vo.pub.lang.UFDouble;
|
||||
|
||||
public class BFPubTools
|
||||
{
|
||||
public static UFDouble ZERO = UFDouble.ZERO_DBL;
|
||||
|
||||
public static boolean isEmpty(String value)
|
||||
{
|
||||
return (value == null) || (value.trim().length() == 0);
|
||||
}
|
||||
|
||||
public static UFBoolean getUFBoolean_NullAs(Object value, UFBoolean bDefautValue)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return bDefautValue;
|
||||
if ((value instanceof UFBoolean)) {
|
||||
return (UFBoolean)value;
|
||||
}
|
||||
return new UFBoolean(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDate getUFDate(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDate)) {
|
||||
return (UFDate)value;
|
||||
}
|
||||
return new UFDate(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDateTime getUFDateTime(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDateTime)) {
|
||||
return (UFDateTime)value;
|
||||
}
|
||||
return new UFDateTime(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_NullAsZero(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")) || (value.toString().trim().equals("~")))
|
||||
return ZERO;
|
||||
if ((value instanceof UFDouble))
|
||||
return (UFDouble)value;
|
||||
if ((value instanceof BigDecimal)) {
|
||||
return new UFDouble((BigDecimal)value);
|
||||
}
|
||||
return new UFDouble(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ValueAsValue(double dValue)
|
||||
{
|
||||
if (dValue == 0.0D) {
|
||||
return ZERO;
|
||||
}
|
||||
return new UFDouble(dValue);
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ValueAsValue(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDouble))
|
||||
return (UFDouble)value;
|
||||
if ((value instanceof BigDecimal)) {
|
||||
return new UFDouble((BigDecimal)value);
|
||||
}
|
||||
return new UFDouble(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ZeroAsNull(double dValue)
|
||||
{
|
||||
if (dValue == 0.0D) {
|
||||
return null;
|
||||
}
|
||||
return new UFDouble(dValue);
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ZeroAsNull(Object value)
|
||||
{
|
||||
UFDouble dValue = getUFDouble_NullAsZero(value);
|
||||
if (dValue.compareTo(ZERO) == 0) {
|
||||
return null;
|
||||
}
|
||||
return dValue;
|
||||
}
|
||||
|
||||
public static String getString_TrimZeroLenAsNull(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return null;
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getString_TrimZeroLenAs(Object value, String str)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return str;
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getString_TrimAsNull(Object value) {
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return "";
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getInStr(Collection<?> coll)
|
||||
{
|
||||
String intStr = null;
|
||||
if ((coll != null) && (coll.size() > 0)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String[] values = (String[])coll.toArray(new String[0]);
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
sb.append("'").append(values[i]).append("'");
|
||||
if (i < values.length - 1)
|
||||
sb.append(",");
|
||||
}
|
||||
intStr = sb.toString();
|
||||
}
|
||||
return intStr;
|
||||
}
|
||||
|
||||
public static String getInSqlWithOutAnd(String sFieldName, ArrayList<?> alValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(alValue == null) || (start < 0) || (num < 0))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN (");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((alValue.get(i) != null) &&
|
||||
(alValue.get(i).toString().trim().length() > 0)) {
|
||||
sbSQL.append("'").append(alValue.get(i)).append("'");
|
||||
if ((i != alValue.size() - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
public static String getInSqlWithOutAnd(String sFieldName, List<?> alValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(alValue == null) || (start < 0) || (num < 0))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN (");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((alValue.get(i) != null) &&
|
||||
(alValue.get(i).toString().trim().length() > 0)) {
|
||||
sbSQL.append("'").append(alValue.get(i)).append("'");
|
||||
if ((i != alValue.size() - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
public static String getInSqlWithOutAnd(String sFieldName, String[] saValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(saValue == null) || (start < 0) || (num < 0) ||
|
||||
(saValue.length < start + num))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN ( ");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((saValue[i] != null) && (saValue[i].trim().length() > 0)) {
|
||||
sbSQL.append("'").append(saValue[i]).append("'");
|
||||
if ((i != saValue.length - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
|
||||
public static String getInSqlWithOutAnd(String sFieldName, Object[] oValue, int start, int num) {
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(oValue == null) || (start < 0) || (num < 0) ||
|
||||
(oValue.length < start + num))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN ( ");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
String sValue = getString_TrimZeroLenAsNull(oValue);
|
||||
if (oValue[i] != null) {
|
||||
sbSQL.append("'").append(sValue).append("'");
|
||||
if ((i != oValue.length - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
package nc.bd.itf.tools;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import nc.vo.pub.lang.UFBoolean;
|
||||
import nc.vo.pub.lang.UFDate;
|
||||
import nc.vo.pub.lang.UFDateTime;
|
||||
import nc.vo.pub.lang.UFDouble;
|
||||
|
||||
public class BFPubTools
|
||||
{
|
||||
public static UFDouble ZERO = UFDouble.ZERO_DBL;
|
||||
|
||||
public static boolean isEmpty(String value)
|
||||
{
|
||||
return (value == null) || (value.trim().length() == 0);
|
||||
}
|
||||
|
||||
public static UFBoolean getUFBoolean_NullAs(Object value, UFBoolean bDefautValue)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return bDefautValue;
|
||||
if ((value instanceof UFBoolean)) {
|
||||
return (UFBoolean)value;
|
||||
}
|
||||
return new UFBoolean(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDate getUFDate(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDate)) {
|
||||
return (UFDate)value;
|
||||
}
|
||||
return new UFDate(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDateTime getUFDateTime(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDateTime)) {
|
||||
return (UFDateTime)value;
|
||||
}
|
||||
return new UFDateTime(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_NullAsZero(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")) || (value.toString().trim().equals("~")))
|
||||
return ZERO;
|
||||
if ((value instanceof UFDouble))
|
||||
return (UFDouble)value;
|
||||
if ((value instanceof BigDecimal)) {
|
||||
return new UFDouble((BigDecimal)value);
|
||||
}
|
||||
return new UFDouble(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ValueAsValue(double dValue)
|
||||
{
|
||||
if (dValue == 0.0D) {
|
||||
return ZERO;
|
||||
}
|
||||
return new UFDouble(dValue);
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ValueAsValue(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().equals("")))
|
||||
return null;
|
||||
if ((value instanceof UFDouble))
|
||||
return (UFDouble)value;
|
||||
if ((value instanceof BigDecimal)) {
|
||||
return new UFDouble((BigDecimal)value);
|
||||
}
|
||||
return new UFDouble(value.toString().trim());
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ZeroAsNull(double dValue)
|
||||
{
|
||||
if (dValue == 0.0D) {
|
||||
return null;
|
||||
}
|
||||
return new UFDouble(dValue);
|
||||
}
|
||||
|
||||
public static UFDouble getUFDouble_ZeroAsNull(Object value)
|
||||
{
|
||||
UFDouble dValue = getUFDouble_NullAsZero(value);
|
||||
if (dValue.compareTo(ZERO) == 0) {
|
||||
return null;
|
||||
}
|
||||
return dValue;
|
||||
}
|
||||
|
||||
public static String getString_TrimZeroLenAsNull(Object value)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return null;
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getString_TrimZeroLenAs(Object value, String str)
|
||||
{
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return str;
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getString_TrimAsNull(Object value) {
|
||||
if ((value == null) || (value.toString().trim().length() == 0)) {
|
||||
return "";
|
||||
}
|
||||
return value.toString().trim();
|
||||
}
|
||||
|
||||
public static String getInStr(Collection<?> coll)
|
||||
{
|
||||
String intStr = null;
|
||||
if ((coll != null) && (coll.size() > 0)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String[] values = (String[])coll.toArray(new String[0]);
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
sb.append("'").append(values[i]).append("'");
|
||||
if (i < values.length - 1)
|
||||
sb.append(",");
|
||||
}
|
||||
intStr = sb.toString();
|
||||
}
|
||||
return intStr;
|
||||
}
|
||||
|
||||
public static String getInSqlWithOutAnd(String sFieldName, ArrayList<?> alValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(alValue == null) || (start < 0) || (num < 0))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN (");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((alValue.get(i) != null) &&
|
||||
(alValue.get(i).toString().trim().length() > 0)) {
|
||||
sbSQL.append("'").append(alValue.get(i)).append("'");
|
||||
if ((i != alValue.size() - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
public static String getInSqlWithOutAnd(String sFieldName, List<?> alValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(alValue == null) || (start < 0) || (num < 0))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN (");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((alValue.get(i) != null) &&
|
||||
(alValue.get(i).toString().trim().length() > 0)) {
|
||||
sbSQL.append("'").append(alValue.get(i)).append("'");
|
||||
if ((i != alValue.size() - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
public static String getInSqlWithOutAnd(String sFieldName, String[] saValue, int start, int num)
|
||||
{
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(saValue == null) || (start < 0) || (num < 0) ||
|
||||
(saValue.length < start + num))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN ( ");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
if ((saValue[i] != null) && (saValue[i].trim().length() > 0)) {
|
||||
sbSQL.append("'").append(saValue[i]).append("'");
|
||||
if ((i != saValue.length - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
|
||||
public static String getInSqlWithOutAnd(String sFieldName, Object[] oValue, int start, int num) {
|
||||
if ((sFieldName == null) || (sFieldName.trim().length() == 0) ||
|
||||
(oValue == null) || (start < 0) || (num < 0) ||
|
||||
(oValue.length < start + num))
|
||||
return null;
|
||||
StringBuffer sbSQL = new StringBuffer(200);
|
||||
sbSQL.append(" (").append(sFieldName).append(" IN ( ");
|
||||
int end = start + num;
|
||||
for (int i = start; i < end; i++) {
|
||||
String sValue = getString_TrimZeroLenAsNull(oValue);
|
||||
if (oValue[i] != null) {
|
||||
sbSQL.append("'").append(sValue).append("'");
|
||||
if ((i != oValue.length - 1) && ((i <= 0) || (i % 200 != 0)))
|
||||
sbSQL.append(",");
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if ((i > 0) && (i % 200 == 0))
|
||||
sbSQL.append(" ) OR ").append(sFieldName).append(" IN ( ");
|
||||
}
|
||||
sbSQL.append(" ) )");
|
||||
return sbSQL.toString();
|
||||
}
|
||||
}
|
|
@ -1,21 +1,21 @@
|
|||
package nc.pubitf.ic.egap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import nc.vo.mmpac.dmo.entity.AggDmoVO;
|
||||
import nc.vo.pu.m23.entity.ArriveVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.bd.bankaccount.cust.CustBankaccUnionVO;
|
||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
||||
public interface INCCForEGAPIntf {
|
||||
//json £¬½Ó¿Ú±àÂë £¬µ¥¾Ýpk
|
||||
public void sendEGAP(String json,String mothodCode,String pk)throws BusinessException;
|
||||
|
||||
public void sign45(PurchaseInVO inVOs)throws BusinessException;
|
||||
|
||||
public void unSign45(PurchaseInVO inVOs)throws BusinessException;
|
||||
|
||||
}
|
||||
package nc.pubitf.ic.egap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import nc.vo.mmpac.dmo.entity.AggDmoVO;
|
||||
import nc.vo.pu.m23.entity.ArriveVO;
|
||||
import nc.vo.pub.BusinessException;
|
||||
import nc.vo.bd.bankaccount.cust.CustBankaccUnionVO;
|
||||
import nc.vo.ic.m45.entity.PurchaseInVO;
|
||||
public interface INCCForEGAPIntf {
|
||||
//json £¬½Ó¿Ú±àÂë £¬µ¥¾Ýpk
|
||||
public void sendEGAP(String json,String mothodCode,String pk)throws BusinessException;
|
||||
|
||||
public void sign45(PurchaseInVO inVOs)throws BusinessException;
|
||||
|
||||
public void unSign45(PurchaseInVO inVOs)throws BusinessException;
|
||||
|
||||
}
|
|
@ -5,5 +5,10 @@
|
|||
<interface>nc.itf.pu.dhjyd.dhjydmaster.IDhjydMasterVOService</interface>
|
||||
<implementation>nc.impl.pu.dhjyd.dhjydmaster.DhjydMasterVOServiceImpl</implementation>
|
||||
</component>
|
||||
|
||||
<component priority="0" singleton="true" remote="true" tx="CMT" supportAlias="true">
|
||||
<interface>nc.itf.pu.dhjyd.dhjydmaster.IArriveToDhjyd</interface>
|
||||
<implementation>nc.impl.pu.dhjyd.dhjydmaster.ArriveToDhjydImpl</implementation>
|
||||
</component>
|
||||
</public>
|
||||
</module>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue