删除用友接口

master
erzhongxmu 2023-04-15 09:47:22 +08:00
parent 09a07b3d81
commit 43abaae541
124 changed files with 33 additions and 7806 deletions

View File

@ -9,8 +9,7 @@ import javax.servlet.http.HttpServletResponse;
import com.zzjee.wmutil.dsc.dscUtil; import com.zzjee.wmutil.dsc.dscUtil;
import com.zzjee.wmutil.wmIntUtil; import com.zzjee.wmutil.wmIntUtil;
import com.zzjee.wmutil.yyUtil; import org.apache.log4j.Logger;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;

View File

@ -46,16 +46,14 @@ import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
import com.zzjee.api.ResultDO; import com.zzjee.api.ResultDO;
import com.zzjee.md.entity.MdCusOtherEntity;
import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.md.entity.MvGoodsEntity; import com.zzjee.md.entity.MvGoodsEntity;
import com.zzjee.md.service.MdGoodsServiceI; import com.zzjee.md.service.MdGoodsServiceI;
import com.zzjee.wm.entity.WmOmNoticeHEntity; import com.zzjee.wm.entity.WmOmNoticeHEntity;
import com.zzjee.wm.entity.WmOmNoticeIEntity; import com.zzjee.wm.entity.WmOmNoticeIEntity;
import com.zzjee.wm.service.WmOmNoticeHServiceI; import com.zzjee.wm.service.WmOmNoticeHServiceI;
import com.zzjee.wmutil.wmIntUtil;
import com.zzjee.wmutil.wmUtil; import com.zzjee.wmutil.wmUtil;
import com.zzjee.wmutil.yyUtil;
/** /**
* @Title: Controller * @Title: Controller
@ -280,18 +278,6 @@ public class MdGoodsController extends BaseController {
message = "商品信息读取成功"; message = "商品信息读取成功";
try { try {
if ("U8".equals(ResourceUtil.getConfigByName("interfacetype"))){
yyUtil.getProduct(othercode);
}
if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){
if(StringUtil.isEmpty(formDate)){
formDate = "2011-01-01";
}
wmIntUtil.getproduct(formDate);
}
if ("DSC".equals(ResourceUtil.getConfigByName("interfacetype"))){ if ("DSC".equals(ResourceUtil.getConfigByName("interfacetype"))){
dscUtil.updateGoodsFromDsc(); dscUtil.updateGoodsFromDsc();

View File

@ -2417,14 +2417,7 @@ public class WmImNoticeHController extends BaseController {
String message = null; String message = null;
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
message = "读取成功"; message = "读取成功";
if ("U8".equals(ResourceUtil.getConfigByName("interfacetype"))){
if(StringUtil.isEmpty(formDate)){
formDate = "2011-01-01";
}
yyUtil.getPord(formDate);
yyUtil.getcprd(formDate);
yyUtil.getqtrd(formDate);
}
if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){ if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){
String masterbill[] = {"XKN_TEST","XKN_TEST"}; String masterbill[] = {"XKN_TEST","XKN_TEST"};
for(int m =0;m<masterbill.length;m++) { for(int m =0;m<masterbill.length;m++) {

View File

@ -86,7 +86,7 @@ import com.zzjee.wmutil.resResult;
import com.zzjee.wmutil.sdresult; import com.zzjee.wmutil.sdresult;
import com.zzjee.wmutil.wmIntUtil; import com.zzjee.wmutil.wmIntUtil;
import com.zzjee.wmutil.wmUtil; import com.zzjee.wmutil.wmUtil;
import com.zzjee.wmutil.yyUtil;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
@ -1021,15 +1021,7 @@ public class WmOmNoticeHController extends BaseController {
String message = null; String message = null;
AjaxJson j = new AjaxJson(); AjaxJson j = new AjaxJson();
message = "读取成功"; message = "读取成功";
if ("U8".equals(ResourceUtil.getConfigByName("interfacetype"))){
if(StringUtil.isEmpty(formDate)){
formDate = "2011-01-01";
}
yyUtil.getqtck(formDate);//其他出库
yyUtil.getSdvl(formDate);//销售发货
yyUtil.getclck(formDate);//材料出库
}
if ("DSC".equals(ResourceUtil.getConfigByName("interfacetype"))){ if ("DSC".equals(ResourceUtil.getConfigByName("interfacetype"))){
dscUtil.updateorderFromDsc(); dscUtil.updateorderFromDsc();

View File

@ -4,24 +4,19 @@ import com.zzjee.bireport.entity.RpPeriodInOutEntity;
import com.zzjee.conf.entity.FxjOtherLoginEntity; import com.zzjee.conf.entity.FxjOtherLoginEntity;
import com.zzjee.md.entity.MdBinEntity; import com.zzjee.md.entity.MdBinEntity;
import com.zzjee.md.entity.MdGoodsEntity; import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.md.entity.MvGoodsEntity;
import com.zzjee.sys.entity.SysParaEntity; import com.zzjee.sys.entity.SysParaEntity;
import com.zzjee.wm.entity.WvStockEntity; import com.zzjee.wm.entity.WvStockEntity;
import org.antlr.stringtemplate.language.Cat;
import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.exception.BusinessException;
import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.DateUtils;
import org.jeecgframework.core.util.ResourceUtil; import org.jeecgframework.core.util.ResourceUtil;
import org.jeecgframework.web.system.pojo.base.*; import org.jeecgframework.web.system.pojo.base.*;
import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.web.system.service.SystemService;
import org.jeecgframework.web.system.sms.service.TSSmsSqlServiceI;
import org.jeecgframework.core.common.model.json.DataGrid;
import org.jeecgframework.core.util.ApplicationContextUtil; import org.jeecgframework.core.util.ApplicationContextUtil;
import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.core.util.StringUtil;
import javax.imageio.stream.FileImageOutputStream;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.*; import java.util.*;
/** /**

View File

@ -1,828 +0,0 @@
package com.zzjee.wmutil;
import com.alibaba.fastjson.JSONObject;
import com.xiaoleilu.hutool.http.HttpUtil;
import com.zzjee.ba.entity.BaGoodsTypeEntity;
import com.zzjee.ba.entity.BaUnitEntity;
import com.zzjee.md.entity.MdCusOtherEntity;
import com.zzjee.md.entity.MdGoodsEntity;
import com.zzjee.md.entity.MdSupEntity;
import com.zzjee.md.entity.MvGoodsEntity;
import com.zzjee.wm.entity.WmImNoticeHEntity;
import com.zzjee.wm.entity.WmImNoticeIEntity;
import com.zzjee.wm.entity.WmOmNoticeHEntity;
import com.zzjee.wm.entity.WmOmNoticeIEntity;
import com.zzjee.wm.service.WmImNoticeHServiceI;
import com.zzjee.wm.service.WmOmNoticeHServiceI;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.*;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.*;
import org.jeecgframework.web.system.service.SystemService;
import org.springframework.util.DigestUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.util.*;
public class yyUtil {
/**
* User: caoez
* Date: 18-09-01
* Time: 2:07
*/
public static void getProduct(String othercode) {
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdw=null;
List<Map<String, Object>> resultgt=null;
String querySql = "select * from Inventory";
if(StringUtil.isNotEmpty(othercode)){
querySql = "select * from Inventory where cInvCCode like '%"+ othercode+"%'" ;
}
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
querySql = "select * from ComputationUnit";
if(StringUtils.isNotBlank(dbKey)) {
resultdw = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
querySql = "select * from InventoryClass where iInvCGrade = '1' ";
if(StringUtils.isNotBlank(dbKey)) {
resultgt = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (resultgt!=null&&resultgt.size()>0) {
for (int i = 0; i < resultgt.size(); i++) {
Map<String, Object> prodbo = resultgt.get(i);
BaGoodsTypeEntity mdn = new BaGoodsTypeEntity();
mdn.setGoodsTypeCode(prodbo.get("cInvCCode").toString());
mdn.setGoodsTypeName(prodbo.get("cInvCName").toString());
try {
BaGoodsTypeEntity bagoodsType = systemService.findUniqueByProperty(
BaGoodsTypeEntity.class, "goodsTypeCode", mdn.getGoodsTypeCode());
if(bagoodsType==null){
bagoodsType = new BaGoodsTypeEntity();
MyBeanUtils.copyBeanNotNull2Bean(mdn,bagoodsType);
systemService.save(bagoodsType);
}else{
MyBeanUtils.copyBeanNotNull2Bean(mdn,bagoodsType);
systemService.updateEntitie(bagoodsType);
}
}catch (Exception e){
}
}
}
if (resultdw!=null&&resultdw.size()>0) {
for (int i = 0; i < resultdw.size(); i++) {
Map<String, Object> prodbo = resultdw.get(i);
BaUnitEntity mdn = new BaUnitEntity();
mdn.setUnitCode(prodbo.get("cComunitCode").toString());
mdn.setUnitZhName(prodbo.get("cComUnitName").toString());
try{
mdn.setUnitChange(prodbo.get("iChangRate").toString());
}catch (Exception e){
mdn.setUnitChange("1");
}
try {
BaUnitEntity baunit = systemService.findUniqueByProperty(
BaUnitEntity.class, "unitCode", mdn.getUnitCode());
if(baunit==null){
baunit = new BaUnitEntity();
MyBeanUtils.copyBeanNotNull2Bean(mdn,baunit);
systemService.save(baunit);
}else{
MyBeanUtils.copyBeanNotNull2Bean(mdn,baunit);
systemService.updateEntitie(baunit);
}
}catch (Exception e){
}
}
}
if (result!=null&&result.size()>0){
for(int i = 0;i<result.size();i++){
Map<String, Object> prodbo = result.get(i);
String ShpBianMa = prodbo.get("cInvCode").toString();
MdGoodsEntity mdn = new MdGoodsEntity();
mdn.setShpBianMa(ShpBianMa);
mdn.setSuoShuKeHu("hwm");
mdn.setShpMingCheng(prodbo.get("cInvName").toString());
mdn.setBzhiQi("360");
try{
mdn.setChpShuXing(prodbo.get("cInvCCode").toString().substring(0,2));
}catch (Exception e){
}
// mdn.setChpShuXing("其他");
try{
mdn.setShpGuiGe(prodbo.get("cInvStd").toString());
}catch (Exception e){
}
mdn.setJshDanWei(prodbo.get("cComUnitCode").toString());//拆零单位
BaUnitEntity baunit = systemService.findUniqueByProperty(
BaUnitEntity.class, "unitCode", mdn.getJshDanWei());
if (baunit !=null){
mdn.setJshDanWei(baunit.getUnitZhName());//拆零单位
}
try{
mdn.setShlDanWei(prodbo.get("cSAComUnitCode").toString());//单位
}catch (Exception e){
}
if(StringUtil.isEmpty(mdn.getShlDanWei())){
mdn.setChlShl("1");
mdn.setChlKongZhi("N");
mdn.setShlDanWei(baunit.getUnitZhName());
}else{
try{
BaUnitEntity baunitz = systemService.findUniqueByProperty(
BaUnitEntity.class, "unitCode", mdn.getShlDanWei());
if (baunitz !=null){
mdn.setShlDanWei(baunitz.getUnitZhName());
}
mdn.setChlShl(baunitz.getUnitChange());
mdn.setChlKongZhi("Y");
}catch (Exception e){
}
}
try {
mdn.setShpTiaoMa(prodbo.get("cBarCode").toString());
}catch (Exception e){
}
mdn.setCfWenCeng("低温");
mdn.setJiZhunwendu("1");
mdn.setTiJiCm("1");
mdn.setZhlKg("1");
mdn.setJfShpLei("10");
mdn.setMpCengGao("99");
mdn.setMpDanCeng("99");
try {
MdGoodsEntity mdGoods = systemService.findUniqueByProperty(
MdGoodsEntity.class, "shpBianMa", ShpBianMa);
if(mdGoods==null){
mdGoods = new MdGoodsEntity();
MyBeanUtils.copyBeanNotNull2Bean(mdn,mdGoods);
systemService.save(mdGoods);
}else{
MyBeanUtils.copyBeanNotNull2Bean(mdn,mdGoods);
systemService.updateEntitie(mdGoods);
}
}catch (Exception e){
}
}
}
}
public static void getPord(String indate) {
// PO_Pomain 采购订单主表
// PO_Podetails 采购订单子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord01 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String poid = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(poid)) {
WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
List<WmImNoticeIEntity> wmImNoticeIListnew = new ArrayList<WmImNoticeIEntity>();
wmImNoticeH.setOrderTypeCode("01");
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
wmImNoticeH.setNoticeId(noticeid);
// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId()));
// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass());
// wmImNoticeH.setPiMaster(master);
// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode());
// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode());
// if (mdsup != null) {
// wmImNoticeH.setSupName(mdsup.getZhongWenQch());
// }
try{
wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
wmImNoticeH.setImCusCode(otherid);
String querySqldetail = "select * from RdRecords01 where id = '"+poid+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmImNoticeIEntity wmi = new WmImNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsCode(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User());
// wmi.setOtherId();
wmImNoticeIListnew.add(wmi);
}
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getcprd(String indate) {
// PO_Pomain 成品入库主表
// PO_Podetails 成品入库子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord10 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String poid = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(poid)) {
WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
List<WmImNoticeIEntity> wmImNoticeIListnew = new ArrayList<WmImNoticeIEntity>();
wmImNoticeH.setOrderTypeCode("03");
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
wmImNoticeH.setNoticeId(noticeid);
// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId()));
// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass());
// wmImNoticeH.setPiMaster(master);
// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode());
// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode());
// if (mdsup != null) {
// wmImNoticeH.setSupName(mdsup.getZhongWenQch());
// }
try{
wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
// wmImNoticeH.setImCusCode(poid);
wmImNoticeH.setImCusCode(otherid);
String querySqldetail = "select * from RdRecords10 where id = '"+poid+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmImNoticeIEntity wmi = new WmImNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsCode(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User());
// wmi.setOtherId();
wmImNoticeIListnew.add(wmi);
}
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getqtrd(String indate) {
// PO_Pomain 其他入库主表
// PO_Podetails 其他入库子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord08 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
for (int i = 0; i < result.size(); i++) {
Map<String, Object> prodbo = result.get(i);
String poid = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(poid)) {
WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
List<WmImNoticeIEntity> wmImNoticeIListnew = new ArrayList<WmImNoticeIEntity>();
wmImNoticeH.setOrderTypeCode("09");
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
wmImNoticeH.setNoticeId(noticeid);
// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId()));
// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass());
// wmImNoticeH.setPiMaster(master);
// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode());
// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode());
// if (mdsup != null) {
// wmImNoticeH.setSupName(mdsup.getZhongWenQch());
// }
try{
wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
wmImNoticeH.setImCusCode(otherid);
String querySqldetail = "select * from RdRecords08 where id = '"+poid+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmImNoticeIEntity wmi = new WmImNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsCode(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User());
// wmi.setOtherId();
wmImNoticeIListnew.add(wmi);
}
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getPo(String indate) {
// PO_Pomain 采购订单主表
// PO_Podetails 采购订单子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from PO_Pomain where dpodate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String poid = prodbo.get("poid").toString();
if (StringUtil.isNotEmpty(poid)) {
WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", poid);
if (wmimh == null) {
WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity();
List<WmImNoticeIEntity> wmImNoticeIListnew = new ArrayList<WmImNoticeIEntity>();
wmImNoticeH.setOrderTypeCode("01");
String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode());
wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
wmImNoticeH.setNoticeId(noticeid);
// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId()));
// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass());
// wmImNoticeH.setPiMaster(master);
// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode());
// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode());
// if (mdsup != null) {
// wmImNoticeH.setSupName(mdsup.getZhongWenQch());
// }
try{
wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
wmImNoticeH.setImCusCode(poid);
String querySqldetail = "select * from PO_Podetails where poid = '"+poid+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmImNoticeIEntity wmi = new WmImNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsCode(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User());
// wmi.setOtherId();
wmImNoticeIListnew.add(wmi);
}
wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getSdvl(String indate) {
// / PO_Pomain 采购订单主表
// PO_Podetails 采购订单子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from DispatchList where cvouchtype = '05' and ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmOmNoticeHServiceI wmOmNoticeHService =ApplicationContextUtil.getContext().getBean(WmOmNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String imcuscode = prodbo.get("DLID").toString();
if (StringUtil.isNotEmpty(imcuscode)) {
WmOmNoticeHEntity wmimh = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "imCusCode", imcuscode);
if (wmimh == null) {
WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity();
List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>();
wmOmNoticeH.setOrderTypeCode("11");
wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode());
wmOmNoticeH.setOmNoticeId(noticeid);
wmOmNoticeH.setImCusCode(imcuscode);
try{
wmOmNoticeH.setOmBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
// String querySqldetail = "select * from DispatchLists where cWhCode = '28' and DLID = '"+imcuscode+"'";
String querySqldetail = "select * from DispatchLists where DLID = '"+imcuscode+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsId(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsId());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsQua(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
wmomNoticeIListnew.add(wmi);
}
wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getqtck(String indate) {
// / PO_Pomain 其他出库单主表
// PO_Podetails 其他出库单主表子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord09 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmOmNoticeHServiceI wmOmNoticeHService =ApplicationContextUtil.getContext().getBean(WmOmNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String imcuscode = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(imcuscode)) {
WmOmNoticeHEntity wmimh = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity();
List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>();
wmOmNoticeH.setOrderTypeCode("19");
wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode());
wmOmNoticeH.setOmNoticeId(noticeid);
wmOmNoticeH.setImCusCode(otherid);
try{
wmOmNoticeH.setOmBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
// String querySqldetail = "select * from DispatchLists where cWhCode = '28' and DLID = '"+imcuscode+"'";
String querySqldetail = "select * from RdRecords09 where id = '"+imcuscode+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsId(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsId());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsQua(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
wmomNoticeIListnew.add(wmi);
}
wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getsdck(String indate) {
// / PO_Pomain 其他出库单主表
// PO_Podetails 其他出库单主表子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord32 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmOmNoticeHServiceI wmOmNoticeHService =ApplicationContextUtil.getContext().getBean(WmOmNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String imcuscode = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(imcuscode)) {
WmOmNoticeHEntity wmimh = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity();
List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>();
wmOmNoticeH.setOrderTypeCode("11");
wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode());
wmOmNoticeH.setOmNoticeId(noticeid);
wmOmNoticeH.setImCusCode(otherid);
try{
wmOmNoticeH.setOmBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
// String querySqldetail = "select * from DispatchLists where cWhCode = '28' and DLID = '"+imcuscode+"'";
String querySqldetail = "select * from RdRecords32 where id = '"+imcuscode+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsId(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsId());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsQua(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
wmomNoticeIListnew.add(wmi);
}
wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void getclck(String indate) {
// / PO_Pomain 其他出库单主表
//// PO_Podetails 其他出库单主表子表
String dbKey= ResourceUtil.getConfigByName("yydbkey");
List<Map<String, Object>> result=null;
List<Map<String, Object>> resultdetail=null;
String querySql = "select * from RdRecord11 where ddate = '"+indate+"'";
Map queryparams = new LinkedHashMap<String,Object>();
SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class);
WmOmNoticeHServiceI wmOmNoticeHService =ApplicationContextUtil.getContext().getBean(WmOmNoticeHServiceI.class);
if(StringUtils.isNotBlank(dbKey)) {
result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000));
}
if (result!=null&&result.size()>0) {
for (int i = 0; i < result.size(); i++) {
try{
Thread.sleep(3000);
}catch (Exception e){
}
Map<String, Object> prodbo = result.get(i);
String imcuscode = prodbo.get("id").toString();
String otherid = prodbo.get("cCode").toString();
if (StringUtil.isNotEmpty(imcuscode)) {
WmOmNoticeHEntity wmimh = systemService.findUniqueByProperty(WmOmNoticeHEntity.class, "imCusCode", otherid);
if (wmimh == null) {
WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity();
List<WmOmNoticeIEntity> wmomNoticeIListnew = new ArrayList<WmOmNoticeIEntity>();
wmOmNoticeH.setOrderTypeCode("02");
wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode"));
String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode());
wmOmNoticeH.setOmNoticeId(noticeid);
wmOmNoticeH.setImCusCode(otherid);
try{
wmOmNoticeH.setOmBeizhu(prodbo.get("cMemo").toString());
}catch (Exception e){
}
// String querySqldetail = "select * from DispatchLists where cWhCode = '28' and DLID = '"+imcuscode+"'";
String querySqldetail = "select * from RdRecords11 where id = '"+imcuscode+"'";
if (resultdetail!=null){
resultdetail.clear();
}
resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000));
for (int k = 0; k < resultdetail.size(); k++) {
WmOmNoticeIEntity wmi = new WmOmNoticeIEntity();
Map<String, Object> proddet = resultdetail.get(k);
wmi.setGoodsId(proddet.get("cInvCode").toString());
MvGoodsEntity mvgoods = systemService.findUniqueByProperty(
MvGoodsEntity.class, "goodsCode", wmi.getGoodsId());
if (mvgoods != null) {
wmi.setGoodsName(mvgoods.getGoodsName());
wmi.setGoodsUnit(mvgoods.getShlDanWei());
}
wmi.setGoodsQua(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue()));
wmomNoticeIListnew.add(wmi);
}
wmOmNoticeHService.addMain(wmOmNoticeH, wmomNoticeIListnew);
}
} else {
continue;
}
}
}
}
public static void addOtherOut(Map<String, Object> params){
String to_account = params.get("to_account").toString(); //提供方id String page_index = args[1];// 页号
String jsonBody = params.get("jsonBody").toString();
OtherOutService otherOutService = new OtherOutService();
try {
otherOutService.add(jsonBody, to_account);
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
public static void addOtherIn(Map<String, Object> params){
String to_account = params.get("to_account").toString(); //提供方id String page_index = args[1];// 页号
String jsonBody = params.get("jsonBody").toString();
OtherInService otherInService = new OtherInService();
try {
otherInService.add(jsonBody, to_account);
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,101 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.commons;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.ResourceUtil;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
public class TokenManager {
public static AccessToken accessToken;
public static String getToKenId() {
long nowTime = System.currentTimeMillis();
try {
if (accessToken == null) {
accessToken = getAccessToken();
} else if ((nowTime - accessToken.getCreateTime() + 10000) >= accessToken.getExpiresIn()) {
accessToken = getAccessToken();
}
} catch (OpenAPIException e) {
e.printStackTrace();
}
return accessToken.getId();
}
private static AccessToken getAccessToken() throws OpenAPIException {
// Properties prop = PropUtil.getProperties("/config.properties");
String url = ResourceUtil.getConfigByName("api_url_token_get");
String from_account = ResourceUtil.getConfigByName("from_account");
String app_key = ResourceUtil.getConfigByName("app_key");
String app_secret = ResourceUtil.getConfigByName("app_secret");
url = StringUtils.replace(url, "{from_account}", from_account);
url = StringUtils.replace(url, "{app_key}", app_key);
url = StringUtils.replace(url, "{app_secret}", app_secret);
String str = null;
try {
str = HttpUtil.get(url);
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
JSONObject jsonObject = JSONObject.parseObject(str);
JSONObject tokenObject = jsonObject.getJSONObject("token");
AccessToken token = new AccessToken();
token.setId(tokenObject.getString("id"));
token.setAppKey(tokenObject.getString("appKey"));
token.setCreateTime(System.currentTimeMillis());
token.setExpiresIn(tokenObject.getLongValue("expiresIn"));
return token;
}
public static class AccessToken {
private String id;
private String appKey;
private long createTime;
private long expiresIn;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(long expiresIn) {
this.expiresIn = expiresIn;
}
}
}

View File

@ -1,41 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.commons;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.ResourceUtil;
import java.util.Properties;
public class TradeManager {
public static String getTradeId() throws OpenAPIException {
// Properties prop = PropUtil.getProperties("/config.properties");
// String url = prop.getProperty("api_url_trade_get");
// String from_account = prop.getProperty("from_account");
// String app_key = prop.getProperty("app_key");
String url = ResourceUtil.getConfigByName("api_url_trade_get");
String from_account = ResourceUtil.getConfigByName("from_account");
String app_key = ResourceUtil.getConfigByName("app_key");
String token = TokenManager.getToKenId();
url = StringUtils.replace(url, "{from_account}", from_account);
url = StringUtils.replace(url, "{app_key}", app_key);
url = StringUtils.replace(url, "{token}", token);
String tradeId = null;
try {
String str = HttpUtil.get(url);
JSONObject jsonObject = JSONObject.parseObject(str);
JSONObject tradeObject = jsonObject.getJSONObject("trade");
tradeId = tradeObject.getString("id");
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return tradeId;
}
}

View File

@ -1,32 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.accept;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AcceptService;
/**
*
* @author Administrator
*
*/
public class AcceptAdd {
final static Logger logger = LogManager.getLogger(AcceptAdd.class);
public static void main(String[] args) {
String to_account = args[0];
String jsonBody = args[1];
AcceptService acceptService = new AcceptService();
try {
// 通过平台交易号新增
acceptService.add(jsonBody, to_account);
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.accept;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AcceptService;
/**
*
* @author Administrator
*
*/
public class AcceptAddWithBizId {
final static Logger logger = LogManager.getLogger(AcceptAddWithBizId.class);
public static void main(String[] args) {
String to_account = args[0];
String bizId = args[1];
String jsonBody = args[2];
AcceptService acceptService = new AcceptService();
try {
// 通过自己的交易号新增
JSONObject record = acceptService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,54 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.accept;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AcceptService;
/**
*
*
* @author Administrator
*
*/
public class AcceptBatchGet {
final static Logger logger = LogManager.getLogger(AcceptBatchGet.class);
public static void main(String[] args) {
// 数据提供方id 必填
String to_account = args[0];
// 页号 非必填
String page_index = args[1];
// 每页行数 非必填
String rows_per_page = args[2];
// 起始编号 非必填
String code_begin = args[3];
// 结束编号 非必填
String code_end = args[4];
// 关键字名称 非必填
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("name", name);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
AcceptService acceptService = new AcceptService();
try {
JSONObject record = acceptService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,33 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.accept;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AcceptService;
/**
*
* @author Administrator
*
*/
public class AcceptGet {
final static Logger logger = LogManager.getLogger(AcceptGet.class);
public static void main(String[] args) {
//数据提供方id
String to_account = args[0];
//收款单编号
String id = args[1];
AcceptService acceptService = new AcceptService();
try {
JSONObject record = acceptService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,42 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.account;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AccountService;
public class AccountBatchGet {
final static Logger logger = LogManager.getLogger(AccountBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; //页号
String rows_per_page = args[2]; //每页行数
String code_begin = args[3]; // 起始帐套号
String code_end = args[4]; //结束帐套号
String name = args[5]; //帐套名关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("name", name);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
AccountService ds = new AccountService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.account;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AccountService;
public class AccountGet {
final static Logger logger = LogManager.getLogger(AccountGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; //帐套号
AccountService ds = new AccountService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,53 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.attendance;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.AttendanceService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class AttendanceBatchGet {
final static Logger logger = LogManager.getLogger(AttendanceBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String person_code = args[3];// 员工编码,可以通过 api/person 获取
String dept_name = args[4];// 员工所在部门的名称关键字,可以通过 api/department 获取
String dept_code = args[5];// 员工所在部门的编码,可以通过 api/department 获取
String date_begin = args[6];// 起始日期格式yyyy-MM-dd
String date_end = args[7];// 结束日期格式yyyy-MM-dd
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("dept_code", dept_code);
paramMap.put("dept_name", dept_name);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("person_code", person_code);
paramMap.put("date_begin", date_begin);
paramMap.put("date_end", date_end);
AttendanceService attendanceService = new AttendanceService();
try {
JSONObject record = attendanceService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.businesstravelorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.BusinessTravelOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class BusinessTravelOrderAdd {
final static Logger logger = LogManager.getLogger(BusinessTravelOrderAdd.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String jsonBody = args[1];//body体数据
BusinessTravelOrderService businessTravelOrderService = new BusinessTravelOrderService();
try {
JSONObject record = businessTravelOrderService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,37 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.businesstravelorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.BusinessTravelOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class BusinessTravelOrderAddWithBiz {
final static Logger logger = LogManager.getLogger(BusinessTravelOrderAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String jsonBody = args[1];//body体数据
String bizId = args[2];//业务id
BusinessTravelOrderService businessTravelOrderService = new BusinessTravelOrderService();
try {
JSONObject record = businessTravelOrderService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.businesstravelorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.BusinessTravelOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class BusinessTravelOrderGet {
final static Logger logger = LogManager.getLogger(BusinessTravelOrderGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];//订单号
BusinessTravelOrderService businessTravelOrderService = new BusinessTravelOrderService();
try {
JSONObject record = businessTravelOrderService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.code;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CodeService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class CodeBatchGet {
final static Logger logger = LogManager.getLogger(CodeBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String page_index = args[1];
String rows_per_page = args[2];
String code_begin = args[3];
String code_end = args[4];
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
CodeService ds = new CodeService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.code;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CodeService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class CodeGet {
final static Logger logger = LogManager.getLogger(CodeGet.class);
public static void main(String[] args) {
String to_account = args[0];
String id = args[1];
CodeService ds = new CodeService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.consignment;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.ConsignmentService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class ConsignmentAdd {
final static Logger logger = LogManager.getLogger(ConsignmentAdd.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
ConsignmentService consignmentService = new ConsignmentService();
try {
JSONObject record = consignmentService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.consignment;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.ConsignmentService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class ConsignmentAddWithBiz {
final static Logger logger = LogManager.getLogger(ConsignmentAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];//提供方ID
String jsonBody = args[1];//请求body体数据
String bizId = args[2];//发货单号
ConsignmentService consignmentService = new ConsignmentService();
try {
JSONObject record = consignmentService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,67 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.consignment;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.ConsignmentService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class ConsignmentBatchGet {
final static Logger logger = LogManager.getLogger(ConsignmentBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String code_begin = args[3];// 起始单据编号
String code_end = args[4];// 结束单据编号
String state = args[5];// 订单状态
String date_begin = args[6];// 起始制单日期,格式:yyyy-MM-dd
String date_end = args[7];// 结束制单日期,格式:yyyy-MM-dd
String custcode = args[8];// 客户编码,可以通过 api/customer 获取
String cusname = args[9];// 客户名称关键字,可以通过 api/customer 获取
String personcode = args[10];// 业务员编码,可以通过 api/person 获取
String personname = args[11];// 业务员名称关键字,可以通过 api/person 获取
String deptcode = args[12];// 部门编码,可以通过 api/department 获取
String deptname = args[13];// 部门名称关键字,可以通过 api/department 获取
String remark = args[14];// 备注关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("date_begin", date_begin);
paramMap.put("date_end", date_end);
paramMap.put("state", state);
paramMap.put("custcode", custcode);
paramMap.put("cusname", cusname);
paramMap.put("personcode", personcode);
paramMap.put("personname", personname);
paramMap.put("deptcode", deptcode);
paramMap.put("deptname", deptname);
paramMap.put("remark", remark);
ConsignmentService consignmentService = new ConsignmentService();
try {
JSONObject record = consignmentService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.consignment;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.ConsignmentService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class ConsignmentGet {
final static Logger logger = LogManager.getLogger(ConsignmentGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];//订单号
ConsignmentService consignmentService = new ConsignmentService();
try {
JSONObject record = consignmentService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,58 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.currentstock;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CurrentstockService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class CurrentstockBatchGet {
final static Logger logger = LogManager.getLogger(CurrentstockBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String whcode_begin = args[3];// 起始仓库编码
String whcode_end = args[4];// 结束仓库编码
String whname = args[5];// 仓库名称关键字
String invcode_begin = args[6];// 起始存货编码
String invcode_end = args[7];// 结束存货编码
String invname = args[8];// 存货名称关键字
String batch = args[9];// 批号
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("whcode_begin", whcode_begin);
paramMap.put("whcode_end", whcode_end);
paramMap.put("invcode_begin", invcode_begin);
paramMap.put("invcode_end", invcode_end);
paramMap.put("whname", whname);
paramMap.put("invname", invname);
paramMap.put("batch", batch);
CurrentstockService currentstockService = new CurrentstockService();
try {
JSONObject record = currentstockService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,29 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customer;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerService;
public class CustomerAdd {
final static Logger logger = LogManager.getLogger(CustomerAdd.class);
public static void main(String[] args) {
//提供方id
String to_account = args[0];
//需要提交的json格式数据
String jsonBody = args[1];
CustomerService customerService = new CustomerService();
try {
// 通过平台交易号新增
JSONObject record = customerService.add(jsonBody, to_account);
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,32 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customer;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerService;
public class CustomerAddWithBizId {
final static Logger logger = LogManager.getLogger(CustomerAddWithBizId.class);
public static void main(String[] args) {
//数据提供方id
String to_account = args[0];
//上游主键
String bizId = args[1];
//需要提交的json格式数据
String jsonBody = args[2];
CustomerService customerService = new CustomerService();
try {
// 通过自己的交易号新增
JSONObject record = customerService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,46 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customer;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerService;
public class CustomerBatchGet {
final static Logger logger = LogManager.getLogger(CustomerBatchGet.class);
public static void main(String[] args) {
//数据提供方id 必填
String to_account = args[0];
//页号 非必填
String page_index = args[1];
//每页行数 非必填
String rows_per_page = args[2];
//起始编号 非必填
String code_begin = args[3];
//结束编码 非必填
String code_end = args[4];
//名称关键字 非必填
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
CustomerService ds = new CustomerService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,27 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customer;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class CustomerGet {
final static Logger logger = LogManager.getLogger(CustomerGet.class);
public static void main(String[] args) {
//数据提供方id
String to_account = args[0];
//客户编码
String id = args[1];
CustomerService customerService = new CustomerService();
try {
JSONObject record = customerService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customerclass;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerclassService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class CustomerclassBatchGet {
final static Logger logger = LogManager.getLogger(CustomerclassBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String page_index = args[1];
String rows_per_page = args[2];
String code_begin = args[3];
String code_end = args[4];
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
CustomerclassService ds = new CustomerclassService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.customerclass;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.CustomerclassService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class CustomerclassGet {
final static Logger logger = LogManager.getLogger(CustomerclassGet.class);
public static void main(String[] args) {
String to_account = args[0];
String id = args[1];
CustomerclassService ds = new CustomerclassService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,48 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.department;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DepartmentService;
public class DepartmentBatchGet {
final static Logger logger = LogManager.getLogger(DepartmentBatchGet.class);
public static void main(String[] args) {
//数据提供方id 必填
String to_account = args[0];
//页号 非必填
String page_index = args[1];
//每页行数 非必填
String rows_per_page = args[2];
//起始编号 非必填
String code_begin = args[3];
//结束编码 非必填
String code_end = args[4];
//名称关键字 非必填
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("name", name);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
DepartmentService departmentService = new DepartmentService();
try {
JSONObject record = departmentService.batchGet(paramMap);
logger.info(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,27 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.department;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DepartmentService;
public class DepartmentGet {
final static Logger logger = LogManager.getLogger(DepartmentGet.class);
public static void main(String[] args) {
//数据提供方id
String to_account = args[0];
//部门编码
String id = args[1];
DepartmentService departmentService = new DepartmentService();
try {
JSONObject record = departmentService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.digest;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DigestService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class DigestBatchGet {
final static Logger logger = LogManager.getLogger(DigestBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String page_index = args[1];
String rows_per_page = args[2];
String code_begin = args[3];
String code_end = args[4];
String text = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("text", text);
DigestService ds = new DigestService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.digest;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DigestService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class DigestGet {
final static Logger logger = LogManager.getLogger(DigestGet.class);
public static void main(String[] args) {
String to_account = args[0];
String id = args[1];
DigestService ds = new DigestService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.dsign;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DsignService;
public class DsignBatchGet {
final static Logger logger = LogManager.getLogger(DsignBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; // 每页行数
String id_begin = args[3]; // 起始凭证类别标识
String id_end = args[4]; // 结束凭证类别标识
String type = args[5]; //凭证类别字关键字
String type_name = args[6]; // 凭证类别名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("id_begin", id_begin);
paramMap.put("id_end", id_end);
paramMap.put("type", type);
paramMap.put("type_name", type_name);
DsignService ds = new DsignService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.dsign;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.DsignService;
public class DsignGet {
final static Logger logger = LogManager.getLogger(DsignGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; // 凭证类别标识
DsignService ds = new DsignService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,38 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.fitem;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.FitemService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class FitemBatchGet {
final static Logger logger = LogManager.getLogger(FitemBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String item_class_code = args[1]; // 项目分类编码
String item_class_name = args[2]; // 项目分类名称
String item_name = args[3]; // 项目大类名称
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("item_class_code", item_class_code);
paramMap.put("item_class_name", item_class_name);
paramMap.put("item_name", item_name);
FitemService ds = new FitemService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,46 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.freearch;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.FreearchService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class FreearchBatchGet {
final static Logger logger = LogManager.getLogger(FreearchBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String page_index = args[1];
String rows_per_page = args[2];
String field_name = args[3];
String alias = args[4];
String item = args[5];
String value = args[6];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("field_name", field_name);
paramMap.put("alias", alias);
paramMap.put("item", item);
paramMap.put("value", value);
FreearchService ds = new FreearchService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.freearch;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.FreearchService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class FreearchGet {
final static Logger logger = LogManager.getLogger(FreearchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String id = args[1];
FreearchService ds = new FreearchService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,31 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventory;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.service.InventoryService;
public class InventoryAdd {
final static Logger logger = LogManager.getLogger(InventoryAdd.class);
public static void main(String[] args) {
String to_account = "test_wanxing"; //提供方id
//要新增的存货的json格式
String jsonBody = "{\"inventory\":{\"code\":\"0394\",\"name\":\"0394n\",\"sort_code\":\"03\",\"main_measure\":\"0101\",\"entry\":[{\"invcode\":\"0392\"}]}}";
InventoryService inventoryService = new InventoryService();
try {
//新增时需要手动获取tradeId以保证此次操作唯一
String tradeId = TradeService.getTradeId();
// 通过平台存货新增
JSONObject record = inventoryService.add(jsonBody, to_account, tradeId);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,30 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventory;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.InventoryService;
public class InventoryAddWithBizId {
final static Logger logger = LogManager.getLogger(InventoryAddWithBizId.class);
public static void main(String[] args) {
String to_account = "test_wanxing"; //提供方id
String bizId = "0395"; //上游主键
String jsonBody = "{\"inventory\":{\"code\":\"0395\",\"name\":\"0395n\",\"sort_code\":\"03\",\"main_measure\":\"0101\",\"entry\":[{\"invcode\":\"0392\"}]}}";
InventoryService inventoryService = new InventoryService();
try {
// 通过上游主键新增
JSONObject record = inventoryService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,47 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventory;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.InventoryService;
public class InventoryBatchGet {
final static Logger logger = LogManager.getLogger(InventoryBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; // 每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; // 名称关键字
String sort_code = args[6]; // 分类编码
String sort_name = args[7]; //分类名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
paramMap.put("sort_code", sort_code);
paramMap.put("sort_name", sort_name);
InventoryService ds = new InventoryService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventory;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.InventoryService;
public class InventoryGet {
final static Logger logger = LogManager.getLogger(InventoryGet.class);
public static void main(String[] args) {
String to_account = args[0]; // 提供方id
String id = args[1]; // 存货编码
InventoryService ds = new InventoryService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,45 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventoryclass;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.InventoryClassService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class InventoryClassBatchGet {
final static Logger logger = LogManager.getLogger(InventoryClassBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; // 每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; // 名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
InventoryClassService ds = new InventoryClassService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.inventoryclass;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.InventoryClassService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class InventoryClassGet {
final static Logger logger = LogManager.getLogger(InventoryClassGet.class);
public static void main(String[] args) {
String to_account = args[0]; // 提供方id
String id = args[1]; // 存货分类编码
InventoryClassService ds = new InventoryClassService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.otherout;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OtherOutService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class OtherOutAdd {
final static Logger logger = LogManager.getLogger(OtherOutAdd.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
OtherOutService otherOutService = new OtherOutService();
try {
JSONObject record = otherOutService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.otherout;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OtherOutService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class OtherOutAddWithBiz {
final static Logger logger = LogManager.getLogger(OtherOutAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
String bizId = args[2];//出库单号
OtherOutService otherOutService = new OtherOutService();
try {
JSONObject record = otherOutService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,66 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.otherout;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OtherOutService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class OtherOutBatchGet {
final static Logger logger = LogManager.getLogger(OtherOutBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String code_begin = args[3];// 起始单据编号
String code_end = args[4];// 结束单据编号
String state = args[5];// 单据状态
String date_begin = args[6];// 起始制单日期,格式:yyyy-MM-dd
String date_end = args[7];// 结束制单日期,格式:yyyy-MM-dd
String warehousecode = args[8];// 仓库编码
String warehousename = args[9];// 仓库名称
String maker = args[10];// 制单人
String departmentcode = args[11];// 部门编码,可以通过 api/department 获取
String departmentname = args[12];// 部门名称关键字,可以通过 api/department 获取
String memory = args[13];// 备注关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("date_begin", date_begin);
paramMap.put("date_end", date_end);
paramMap.put("state", state);
paramMap.put("warehousecode", warehousecode);
paramMap.put("warehousename", warehousename);
paramMap.put("maker", maker);
paramMap.put("departmentcode", departmentcode);
paramMap.put("departmentname", departmentname);
paramMap.put("memory", memory);
OtherOutService otherOutService = new OtherOutService();
try {
JSONObject record = otherOutService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.otherout;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OtherOutService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class OtherOutGet {
final static Logger logger = LogManager.getLogger(OtherOutGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String id = args[1];// 单据编号
OtherOutService otherOutService = new OtherOutService();
try {
JSONObject record = otherOutService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,33 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.oughtreceive;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OughtreceiveService;
/**
*
* @author Administrator
*
*/
public class OughtreceiveAdd {
final static Logger logger = LogManager.getLogger(OughtreceiveAdd.class);
public static void main(String[] args) {
String to_account = args[0];
String jsonBody = args[1];
OughtreceiveService oughtreceiveService = new OughtreceiveService();
try {
// 通过平台交易号新增应收单信息
JSONObject record = oughtreceiveService.add(jsonBody, to_account);
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.oughtreceive;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OughtreceiveService;
/**
*
* @author Administrator
*
*/
public class OughtreceiveAddWithBizId {
final static Logger logger = LogManager.getLogger(OughtreceiveAddWithBizId.class);
public static void main(String[] args) {
String to_account = args[0];
String bizId = args[1];
String jsonBody = args[2];
OughtreceiveService oughtreceiveService = new OughtreceiveService();
try {
// 通过上游主键新增
JSONObject record = oughtreceiveService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,54 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.oughtreceive;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OughtreceiveService;
/**
*
* @author Administrator
*
*/
public class OughtreceiveBatchGet {
final static Logger logger = LogManager.getLogger(OughtreceiveBatchGet.class);
public static void main(String[] args) {
//数据提供方id 必填
String to_account = args[0];
//页号 非必填
String page_index = args[1];
//每页行数 非必填
String rows_per_page = args[2];
//起始编号 非必填
String code_begin = args[3];
//结束编号 非必填
String code_end = args[4];
//关键字名称 非必填
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("name", name);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
OughtreceiveService ds = new OughtreceiveService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,34 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.oughtreceive;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.OughtreceiveService;
/**
*
* @author Administrator
*
*/
public class OughtreceiveGet {
final static Logger logger = LogManager.getLogger(OughtreceiveGet.class);
public static void main(String[] args) {
//数据提供方id
String to_account = args[0];
//应收单编号
String id = args[1];
OughtreceiveService oughtreceiveService = new OughtreceiveService();
try {
JSONObject record = oughtreceiveService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.payunit;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PayunitService;
public class PayunitBatchGet {
final static Logger logger = LogManager.getLogger(PayunitBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; //每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; //结束编码
String name = args[5]; //名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
PayunitService ds = new PayunitService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.payunit;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PayunitService;
public class PayunitGet {
final static Logger logger = LogManager.getLogger(PayunitGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; //交易方编码
PayunitService ds = new PayunitService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,43 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.payunitclass;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PayunitClassService;
public class PayunitClassBatchGet {
final static Logger logger = LogManager.getLogger(PayunitClassBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; //页号
String rows_per_page = args[2]; //每页行数
String code_begin = args[3]; //起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; // 名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
PayunitClassService ds = new PayunitClassService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.payunitclass;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PayunitClassService;
public class PayunitClassGet {
final static Logger logger = LogManager.getLogger(PayunitClassGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; //交易方分类编号
PayunitClassService ds = new PayunitClassService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,45 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.person;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PersonService;
public class PersonBatchGet {
final static Logger logger = LogManager.getLogger(PersonBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; //每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; //名称关键字
String property = args[6]; // 属性
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
paramMap.put("property", property);
PersonService ds = new PersonService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.person;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PersonService;
public class PersonGet {
final static Logger logger = LogManager.getLogger(PersonGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; // 人员编码
PersonService ds = new PersonService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,50 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.productprofitability;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.ProductprofitabilityService;
/**
*
* @author Administrator
*
*/
public class ProductprofitabilityBatchGet {
final static Logger logger = LogManager.getLogger(ProductprofitabilityBatchGet.class);
public static void main(String[] args) {
//数据提供方id 必填
String to_account = args[0];
//页号 非必填
String page_index = args[1];
//每页行数 非必填
String rows_per_page = args[2];
//年份 非必填
String year = args[3];
//月份 非必填
String month = args[4];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("year", year);
paramMap.put("month", month);
ProductprofitabilityService productprofitabilityService = new ProductprofitabilityService();
try {
JSONObject record = productprofitabilityService.batchGet(paramMap);
logger.info(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.purchaseorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PurchaseOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class PurchaseOrderAdd {
final static Logger logger = LogManager.getLogger(PurchaseOrderAdd.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
PurchaseOrderService purchaseOrderService = new PurchaseOrderService();
try {
JSONObject record = purchaseOrderService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.purchaseorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PurchaseOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class PurchaseOrderAddWithBiz {
final static Logger logger = LogManager.getLogger(PurchaseOrderAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
String bizId = args[2];//采购订单号
PurchaseOrderService purchaseOrderService = new PurchaseOrderService();
try {
JSONObject record = purchaseOrderService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,68 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.purchaseorder;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PurchaseOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class PurchaseOrderBatchGet {
final static Logger logger = LogManager.getLogger(PurchaseOrderBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String code_begin = args[3];// 起始订单编号
String code_end = args[4];// 结束订单编号
String state = args[5];// 订单状态
String date_begin = args[6];// 起始订单日期,格式:yyyy-MM-dd
String date_end = args[7];// 结束订单日期,格式:yyyy-MM-dd
String vendorcode = args[8];// 供应商编码,可以通过 api/vendor 获取
String vendorname = args[9];// 供应商名称关键字,可以通过 api/vendor 获取
String personcode = args[10];// 业务员编码,可以通过 api/person 获取
String personname = args[11];// 业务员名称关键字,可以通过 api/person 获取
String deptcode = args[12];// 部门编码,可以通过 api/department 获取
String deptname = args[13];// 部门名称关键字,可以通过 api/department 获取
String remark = args[14];// 备注关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("date_begin", date_begin);
paramMap.put("date_end", date_end);
paramMap.put("state", state);
paramMap.put("vendorcode", vendorcode);
paramMap.put("vendorname", vendorname);
paramMap.put("personcode", personcode);
paramMap.put("personname", personname);
paramMap.put("deptcode", deptcode);
paramMap.put("deptname", deptname);
paramMap.put("remark", remark);
PurchaseOrderService purchaseOrderService = new PurchaseOrderService();
try {
JSONObject record = purchaseOrderService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.purchaseorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.PurchaseOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class PurchaseOrderGet {
final static Logger logger = LogManager.getLogger(PurchaseOrderGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];//采购订单号
PurchaseOrderService purchaseOrderService = new PurchaseOrderService();
try {
JSONObject record = purchaseOrderService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,53 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.salary;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SalaryService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SalaryBatchGet {
final static Logger logger = LogManager.getLogger(SalaryBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String code_begin = args[3];//起始编码
String code_end = args[4];// 结束编码
String departmentno = args[5];//员工所在部门的编码,可以通过 api/department 获取
String month = args[6];// 月份
String name = args[7];// 名称关键字
String year = args[8];// 年份
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("departmentno", departmentno);
paramMap.put("month", month);
paramMap.put("name", name);
paramMap.put("year", year);
SalaryService salaryService = new SalaryService();
try {
JSONObject record = salaryService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.salary;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SalaryService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SalaryGet {
final static Logger logger = LogManager.getLogger(SalaryGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];// 员工编码,可以通过 api/person 获取
SalaryService salaryService = new SalaryService();
try {
JSONObject record = salaryService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,51 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.salaryitem;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SalaryItemService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SalaryItemBatchGet {
final static Logger logger = LogManager.getLogger(SalaryItemBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String code_begin = args[3];// 起始编码
String code_end = args[4];// 结束编码
String name = args[5];// 名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
SalaryItemService salaryItemService = new SalaryItemService();
try {
JSONObject record = salaryItemService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.salaryitem;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SalaryItemService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SalaryItemGet {
final static Logger logger = LogManager.getLogger(SalaryItemGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];//工资项目标识
SalaryItemService salaryItemService = new SalaryItemService();
try {
JSONObject record = salaryItemService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.saleorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SaleOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SaleOrderAdd {
final static Logger logger = LogManager.getLogger(SaleOrderAdd.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//body体数据
SaleOrderService orderService = new SaleOrderService();
try {
JSONObject record = orderService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.saleorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SaleOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SaleOrderAddWithBiz {
final static Logger logger = LogManager.getLogger(SaleOrderAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//body体数据
String bizId = args[2];//上游主键
SaleOrderService orderService = new SaleOrderService();
try {
JSONObject record = orderService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,80 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.saleorder;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SaleOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SaleOrderBatchGet {
final static Logger logger = LogManager.getLogger(SaleOrderBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];// 提供方id
String page_index = args[1];// 页号
String rows_per_page = args[2];// 每页行数
String code_begin = args[3];// 起始订单编号
String code_end = args[4];// 结束订单编号
String state = args[5];// 订单状态
String date_begin = args[6];// 起始订单日期,格式:yyyy-MM-dd
String date_end = args[7];// 结束订单日期,格式:yyyy-MM-dd
String dpremodatebt_begin = args[8];// 起始预完工日期,格式:yyyy-MM-dd
String dpremodatebt_end = args[9];// 结束预完工日期,格式:yyyy-MM-dd
String dpredatebt_begin = args[10];// 起始预发货日期,格式:yyyy-MM-dd
String dpredatebt_end = args[11];// 结束预发货日期,格式:yyyy-MM-dd
String custcode = args[12];// 客户编码,可以通过 api/customer 获取
String cusname = args[13];// 客户名称关键字,可以通过 api/customer 获取
String personcode = args[14];// 业务员编码,可以通过 api/person 获取
String personname = args[15];// 业务员名称关键字,可以通过 api/person 获取
String deptcode = args[16];// 部门编码,可以通过 api/department 获取
String deptname = args[17];// 部门名称关键字,可以通过 api/department 获取
String memo = args[18];// 备注关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("date_begin", date_begin);
paramMap.put("date_end", date_end);
paramMap.put("state", state);
paramMap.put("dpremodatebt_begin", dpremodatebt_begin);
paramMap.put("dpremodatebt_end", dpremodatebt_end);
paramMap.put("dpredatebt_begin", dpredatebt_begin);
paramMap.put("dpredatebt_end", dpredatebt_end);
paramMap.put("custcode", custcode);
paramMap.put("cusname", cusname);
paramMap.put("personcode", personcode);
paramMap.put("personname", personname);
paramMap.put("deptcode", deptcode);
paramMap.put("deptname", deptname);
paramMap.put("memo", memo);
SaleOrderService orderService = new SaleOrderService();
try {
JSONObject record = orderService.batchGet(paramMap);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.saleorder;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.SaleOrderService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class SaleOrderGet {
final static Logger logger = LogManager.getLogger(SaleOrderGet.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String id = args[1];// 订单编号
SaleOrderService orderService = new SaleOrderService();
try {
JSONObject record = orderService.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.unit;
import java.util.HashMap;
import java.util.Map;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.UnitService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class UnitBatchGet {
final static Logger logger = LogManager.getLogger(UnitBatchGet.class);
public static void main(String[] args) {
String to_account = args[0];
String page_index = args[1];
String rows_per_page = args[2];
String code_begin = args[3];
String code_end = args[4];
String name = args[5];
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
UnitService ds = new UnitService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.unit;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.UnitService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
public class UnitGet {
final static Logger logger = LogManager.getLogger(UnitGet.class);
public static void main(String[] args) {
String to_account = args[0];
String id = args[1];
UnitService ds = new UnitService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,30 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.user;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.UserService;
public class UserLogin {
final static Logger logger = LogManager.getLogger(UserLogin.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方企业id
String userId = args[1]; //用户id
String password = args[2]; //密码
UserService ds = new UserService();
try {
JSONObject record = ds.login(userId, password, to_account);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,44 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.vendor;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VendorService;
public class VendorBatchGet {
final static Logger logger = LogManager.getLogger(VendorBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; // 每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; // 名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
VendorService ds = new VendorService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.vendor;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VendorService;
public class VendorGet {
final static Logger logger = LogManager.getLogger(VendorGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; // 供应商编码
VendorService ds = new VendorService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,45 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.vendorclass;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VendorClassService;
public class VendorClassBatchGet {
final static Logger logger = LogManager.getLogger(VendorClassBatchGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String page_index = args[1]; // 页号
String rows_per_page = args[2]; // 每页行数
String code_begin = args[3]; // 起始编码
String code_end = args[4]; // 结束编码
String name = args[5]; // 名称关键字
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("to_account", to_account);
paramMap.put("page_index", page_index);
paramMap.put("rows_per_page", rows_per_page);
paramMap.put("code_begin", code_begin);
paramMap.put("code_end", code_end);
paramMap.put("name", name);
VendorClassService ds = new VendorClassService();
try {
JSONObject record = ds.batchGet(paramMap);
logger.debug(record.toJSONString());
} catch (OpenAPIException e) {
logger.error(e.getMessage());
}
}
}

View File

@ -1,25 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.vendorclass;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VendorClassService;
public class VendorClassGet {
final static Logger logger = LogManager.getLogger(VendorClassGet.class);
public static void main(String[] args) {
String to_account = args[0]; //提供方id
String id = args[1]; // 供应商分类编码
VendorClassService ds = new VendorClassService();
try {
JSONObject record = ds.get(id, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.voucher;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VoucherService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class VoucherAdd {
final static Logger logger = LogManager.getLogger(VoucherAdd.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body体数据
VoucherService voucherService = new VoucherService();
try {
JSONObject record = voucherService.add(jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,36 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.examples.voucher;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.service.VoucherService;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserve
*
* @author yanwuyang
* @version <> , 2015129
* @see </>
* @since </>
*/
public class VoucherAddWithBiz {
final static Logger logger = LogManager.getLogger(VoucherAddWithBiz.class);
public static void main(String[] args) {
String to_account = args[0];//提供方id
String jsonBody = args[1];//请求body数据
String bizId = args[2];//上游主键
VoucherService voucherService = new VoucherService();
try {
JSONObject record = voucherService.addByBizId(bizId, jsonBody, to_account);
logger.info(record.toString());
} catch (OpenAPIException e) {
e.printStackTrace();
}
}
}

View File

@ -1,35 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.exception;
import com.alibaba.fastjson.JSONObject;
public class OpenAPIException extends Exception {
private String errcode;
private String errmsg;
public OpenAPIException(JSONObject jo) {
super("\n error:" + jo.getString("errmsg") + " error_code:" + jo.getString("errcode"));
this.errcode = jo.getString("errcode");
this.errmsg = jo.getString("errmsg");
}
public OpenAPIException(String msg, Exception cause) {
super(msg, cause);
}
public String getErrcode() {
return errcode;
}
public void setErrcode(String errcode) {
this.errcode = errcode;
}
public String getErrmsg() {
return errmsg;
}
public void setErrmsg(String errmsg) {
this.errmsg = errmsg;
}
}

View File

@ -1,11 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.model;
import com.alibaba.fastjson.JSONObject;
public class Record extends JSONObject {
public static Record parseRecord(String jsonStr) {
return (Record) parseObject(jsonStr);
}
}

View File

@ -1,53 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.platform;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.ResourceUtil;
import java.util.Properties;
public class OrderstatusService {
/**
*
* @param to_account
* @return
* @throws OpenAPIException
*/
public static String getOrderstatus(String to_account) throws OpenAPIException {
// Properties prop = PropUtil.getProperties("/config.properties");
// String url = prop.getProperty("api_url_orderstatus_get");
// String from_account = prop.getProperty("from_account");
// String app_key = prop.getProperty("app_key");
String url = ResourceUtil.getConfigByName("api_url_orderstatus_get");
String from_account = ResourceUtil.getConfigByName("from_account");
String app_key = ResourceUtil.getConfigByName("app_key");
String token = TokenManager.getToKenId();
url = StringUtils.replace(url, "{from_account}", from_account);
url = StringUtils.replace(url, "{to_account}", to_account);
url = StringUtils.replace(url, "{app_key}", app_key);
url = StringUtils.replace(url, "{token}", token);
String orderstatus = null;
try {
orderstatus = HttpUtil.get(url);
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(),e);
}
return orderstatus;
}
}

View File

@ -1,45 +0,0 @@
/** * @Title: Controller * @Description: 出货通知 * @author erzhongxmu * @date 2017-08-15 23:18:59 * @version V1.0 * */ package com.zzjee.yongyoubase.openapi4j.platform;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.ResourceUtil;
import java.util.Properties;
public class ResultService {
/**
*
* @param requestid
* @return
* @throws OpenAPIException
*/
public static String getResult(String requestid) throws OpenAPIException {
// Properties prop = PropUtil.getProperties("/config.properties");
// String url = prop.getProperty("api_url_result_get");
String url = ResourceUtil.getConfigByName("api_url_result_get");
// String from_account = ResourceUtil.getConfigByName("from_account");
// String app_key = ResourceUtil.getConfigByName("app_key");
url = StringUtils.replace(url, "{requestid}", requestid);
String resultStr = null;
try {
resultStr = HttpUtil.get(url);
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(),e);
}
return resultStr;
}
}

View File

@ -1,54 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.platform;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.commons.lang.StringUtils;
import org.jeecgframework.core.util.ResourceUtil;
import java.util.Properties;
public class TradeService {
/**
*
* @return
* @throws OpenAPIException
*/
public static String getTradeId() throws OpenAPIException {
// Properties prop = PropUtil.getProperties("/config.properties");
// String url = prop.getProperty("api_url_trade_get");
// String from_account = prop.getProperty("from_account");
// String app_key = prop.getProperty("app_key");
String url = ResourceUtil.getConfigByName("api_url_trade_get");
String from_account = ResourceUtil.getConfigByName("from_account");
String app_key = ResourceUtil.getConfigByName("app_key");
String token = TokenManager.getToKenId();
url = StringUtils.replace(url, "{from_account}", from_account);
url = StringUtils.replace(url, "{app_key}", app_key);
url = StringUtils.replace(url, "{token}", token);
String tradeId = null;
try {
String str = HttpUtil.get(url);
JSONObject jsonObject = JSONObject.parseObject(str);
JSONObject tradeObject = jsonObject.getJSONObject("trade");
tradeId = tradeObject.getString("id");
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(),e);
}
return tradeId;
}
}

View File

@ -1,133 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author Administrator
*
*/
public class AcceptService extends BaseService {
final static Logger logger = LogManager.getLogger(AcceptService.class);
public AcceptService() {
this.access_token = TokenManager.getToKenId();
}
public AcceptService(String token) {
this.access_token = token;
}
/**
* id
* @param id
* @param to_account
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("accept/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
* map
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("acceptlist/batch_get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param jsonBody
* @param to_account
* @return
* @throws OpenAPIException
*/
public JSONObject add(String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
String tradeId = TradeService.getTradeId();
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("tradeid", tradeId);
String url = this.createURL("accept/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param bizId
* @param jsonBody
* @param to_account
* @return
* @throws OpenAPIException
*/
public JSONObject addByBizId(String bizId, String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("biz_id", bizId);
String url = this.createURL("accept/add", paramMap);
logger.info(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.info(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,71 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* u8
*/
public class AccountService extends BaseService {
final static Logger logger = LogManager.getLogger(AccountService.class);
public AccountService() {
this.access_token = TokenManager.getToKenId();
}
public AccountService(String token) {
this.access_token = token;
}
/**
* u8
* @param id u8 id
* @param to_account code
* @return u8
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("account/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
* u8
* @param paramMap map
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("account/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,57 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import com.zzjee.yongyoubase.openapi4j.util.PropUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015128
* @see </>
* @since </>
*/
@SuppressWarnings("all")
public class AttendanceService extends BaseService {
private static final long serialVersionUID = 8697005112465513332L;
final static Logger logger = LogManager.getLogger(AccountService.class);
public AttendanceService() {
this.access_token = TokenManager.getToKenId();
}
public AttendanceService(String token) {
this.access_token = token;
}
/**
*
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("attendance/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,50 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.zzjee.wmutil.wmUtil;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import com.zzjee.yongyoubase.openapi4j.util.PropUtil;
import org.jeecgframework.core.util.ResourceUtil;
import java.io.Serializable;
import java.util.Map;
import java.util.Properties;
public class BaseService implements Serializable {
private static final long serialVersionUID = -8280794717935626188L;
protected String access_token;
protected String createURL(String apiName, Map<String, String> paramMap) {
// Properties prop = PropUtil.getProperties("/config.properties");
// String baseURL = prop.getProperty("baseURL");
// String from_account = prop.getProperty("from_account");
// String app_key = prop.getProperty("app_key");
String baseURL = ResourceUtil.getConfigByName("baseURL");
String from_account = ResourceUtil.getConfigByName("from_account");
String app_key = ResourceUtil.getConfigByName("app_key");
StringBuffer url = new StringBuffer();
url.append(baseURL);
url.append(apiName);
url.append("?from_account=" + from_account + "&");
url.append("app_key=" + app_key + "&");
url.append("token=" + access_token + "&");
if (paramMap != null && paramMap.size() > 0) {
for (String key : paramMap.keySet()) {
String value = paramMap.get(key);
url.append(key + "=" + value + "&");
}
}
url.deleteCharAt(url.length() - 1);
return url.toString();
}
}

View File

@ -1,116 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
* @author yanwuyang
* @version <> , 2015128
* @see </>
* @since </>
*/
@SuppressWarnings("all")
public class BusinessTravelOrderService extends BaseService {
private static final long serialVersionUID = 8697005112465513332L;
final static Logger logger = LogManager.getLogger(BusinessTravelOrderService.class);
public BusinessTravelOrderService() {
this.access_token = TokenManager.getToKenId();
}
public BusinessTravelOrderService(String token) {
this.access_token = token;
}
/**
*
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("businesstravelorder/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
*
* @param jsonBody
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject add(String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
String tradeId = TradeService.getTradeId();
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("tradeid", tradeId);
String url = this.createURL("businesstravelorder/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
*
* @param jsonBody
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject addByBizId(String bizId, String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("biz_id", bizId);
String url = this.createURL("businesstravelorder/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,75 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author liujl
* @version <> , 20151220
* @see </>
* @since </>
*/
public class CodeService extends BaseService{
final static Logger logger = LogManager.getLogger(CodeService.class);
public CodeService() {
this.access_token = TokenManager.getToKenId();
}
public CodeService(String token) {
this.access_token = token;
}
/**
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("code/get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("code/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,135 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015128
* @see </>
* @since </>
*/
@SuppressWarnings("all")
public class ConsignmentService extends BaseService {
private static final long serialVersionUID = 8697005112465513332L;
final static Logger logger = LogManager.getLogger(ConsignmentService.class);
public ConsignmentService() {
this.access_token = TokenManager.getToKenId();
}
public ConsignmentService(String token) {
this.access_token = token;
}
/**
*
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("consignment/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("consignmentlist/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
*
* @param jsonBody
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject add(String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
String tradeId = TradeService.getTradeId();
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("tradeid", tradeId);
String url = this.createURL("consignment/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
*
* @param jsonBody
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject addByBizId(String bizId, String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("biz_id", bizId);
String url = this.createURL("consignment/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,56 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author yanwuyang
* @version <> , 2015128
* @see </>
* @since </>
*/
@SuppressWarnings("all")
public class CurrentstockService extends BaseService {
private static final long serialVersionUID = 8697005112465513332L;
final static Logger logger = LogManager.getLogger(CurrentstockService.class);
public CurrentstockService() {
this.access_token = TokenManager.getToKenId();
}
public CurrentstockService(String token) {
this.access_token = token;
}
/**
*
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("currentstock/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,143 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
<<<<<<< HEAD
*
* @author Administrator
*
=======
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author liujl
* @version <> , 20151220
* @see </>
* @since </>
>>>>>>> 4accb8be349427f21d4197b6daf8eb088d1de451
*/
public class CustomerService extends BaseService {
final static Logger logger = LogManager.getLogger(CustomerService.class);
public CustomerService() {
this.access_token = TokenManager.getToKenId();
}
public CustomerService(String token) {
this.access_token = token;
}
/**
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("customer/get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("customer/batch_get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param jsonBody
* @param to_account
* @return
* @throws OpenAPIException
*/
public JSONObject add(String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
String tradeId = TradeService.getTradeId();
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("tradeid", tradeId);
String url = this.createURL("customer/add", paramMap);
logger.debug(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.debug(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param bizId
* @param jsonBody
* @param to_account
* @return
* @throws OpenAPIException
*/
public JSONObject addByBizId(String bizId, String jsonBody, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("biz_id", bizId);
String url = this.createURL("customer/add", paramMap);
logger.info(url);
String resultStr = HttpUtil.post(url, jsonBody);
logger.info(resultStr);
JSONObject resultRecord = Record.parseObject(resultStr);
Thread.sleep(3000);
record = Record.parseObject(HttpUtil.get(resultRecord.getString("url")));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,72 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author liujl
* @version <> , 20151220
* @see </>
* @since </>
*/
public class CustomerclassService extends BaseService{
final static Logger logger = LogManager.getLogger(CustomerclassService.class);
public CustomerclassService() {
this.access_token = TokenManager.getToKenId();
}
public CustomerclassService(String token) {
this.access_token = token;
}
/**
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("customerclass/get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("customerclass/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,76 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author liujl
* @version <> , 20151220
* @see </>
* @since </>
*/
public class DepartmentService extends BaseService {
final static Logger logger = LogManager.getLogger(DepartmentService.class);
public DepartmentService() {
this.access_token = TokenManager.getToKenId();
}
public DepartmentService(String token) {
this.access_token = token;
}
/**
* id
* @param id id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("department/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("department/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,73 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright(c) 2015-2015 by yonyouup. All Rights Reserved
*
* @author liujl
* @version <> , 20151220
* @see </>
* @since </>
*/
public class DigestService extends BaseService{
final static Logger logger = LogManager.getLogger(DigestService.class);
public DigestService() {
this.access_token = TokenManager.getToKenId();
}
public DigestService(String token) {
this.access_token = token;
}
/**
*
* @param id
* @param to_account id
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("digest/get", paramMap);
logger.info(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
// TODO Auto-generated catch block
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("digest/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

View File

@ -1,71 +0,0 @@
package com.zzjee.yongyoubase.openapi4j.service;
import com.alibaba.fastjson.JSONObject;
import com.zzjee.yongyoubase.openapi4j.commons.TokenManager;
import com.zzjee.yongyoubase.openapi4j.exception.OpenAPIException;
import com.zzjee.yongyoubase.openapi4j.model.Record;
import com.zzjee.yongyoubase.openapi4j.platform.TradeService;
import com.zzjee.yongyoubase.openapi4j.util.HttpUtil;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
/**
*
*/
public class DsignService extends BaseService {
final static Logger logger = LogManager.getLogger(DsignService.class);
public DsignService() {
this.access_token = TokenManager.getToKenId();
}
public DsignService(String token) {
this.access_token = token;
}
/**
*
* @param id id
* @param to_account code
* @return
* @throws OpenAPIException
*/
public JSONObject get(String id, String to_account) throws OpenAPIException {
JSONObject record;
try {
Map<String, String> paramMap = new HashMap();
paramMap.put("to_account", to_account);
paramMap.put("id", id);
String url = this.createURL("dsign/get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
/**
*
* @param paramMap map
* @return
* @throws OpenAPIException
*/
public JSONObject batchGet(Map<String, String> paramMap) throws OpenAPIException {
JSONObject record;
try {
String url = this.createURL("dsign/batch_get", paramMap);
logger.debug(url);
record = JSONObject.parseObject(HttpUtil.get(url));
} catch (Exception e) {
throw new OpenAPIException(e.getMessage(), e);
}
return record;
}
}

Some files were not shown because too many files have changed in this diff Show More