Merge remote-tracking branch 'origin/ht' into ht

ht
qijirenjian 3 months ago
commit 60353d33f2

@ -0,0 +1,90 @@
package com.weaver.seconddev.interfaces.workflow.action;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.interfaces.k3.CallK3CustomerService;
import com.weaver.seconddev.interfaces.k3.CustomerServiceStub;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-17
* @Description: K3_Check_CustomerInfo
*/
@org.springframework.stereotype.Service("workflow_action_K3_Check_CustomerInfo_Action")
@Slf4j
public class K3_Check_CustomerInfo_Action implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("K3_Check_CustomerInfo_Action execute start");
log.info("K3_Check_CustomerInfo_Action execute params : " + params);
try {
String datacenterid = null2String(params.get("datacenterid")); //数据中心
String custname= null2String(params.get("custname")); //客户名称
String custnumber = null2String(params.get("custnumber")); //客户编号
String code = "0";
String message = "";
String issuccess = "";
String result = "";
CustomerServiceStub.CustomerSearchReq req = new CustomerServiceStub.CustomerSearchReq();
req.setUser("oa");
req.setPwd("k3cloud_htgd");
req.setFName(custname);
req.setFNumber(custnumber);
req.setDataCenterID(datacenterid);
CallK3CustomerService services = new CallK3CustomerService();
CustomerServiceStub.CustomerSearchRes res = services.getCustMsg(req);
code = res.getCode();
message = res.getMessage();
issuccess = res.getIsSuccess();
result = res.getResult();
Map<String, Object> resultJson=new HashMap<>();
resultJson.put("code",code);
resultJson.put("message",message);
resultJson.put("IsSuccess",issuccess);
resultJson.put("result",result);
List<Map<String,Object>> customers = new ArrayList<>();
if(!result.equals("0")) {
CustomerServiceStub.ArrayOfCustSample supsample = res.getCustSamples();
CustomerServiceStub.CustSample[] arrs = supsample.getCustSample();
if (arrs != null && arrs.length > 0) {
for (int i = 0; i < arrs.length; i++) {
Map<String,Object> item = new HashMap<>();
item.put("custname", arrs[i].getFCustName());
item.put("custnumber", arrs[i].getFCustNumber());
customers.add(item);
}
}
}
resultJson.put("customers",customers);
return WeaResult.success(resultJson);
}catch (Exception e){
log.error("K3_Check_CustomerInfo_Action execute error", e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,93 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.interfaces.k3.CallK3SupplierServices;
import com.weaver.seconddev.interfaces.k3.SupplierServiceStub;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-17
* @Description: K3_Check_SupplierInfo
*/
@org.springframework.stereotype.Service("workflow_action_K3_Check_SupplierInfo_Action")
@Slf4j
public class K3_Check_SupplierInfo_Action implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("K3_Check_SupplierInfo_Action execute start");
log.info("K3_Check_SupplierInfo_Action execute params : " + params);
try {
String datacenterid = null2String(params.get("datacenterid")); //数据中心
String supname= null2String(params.get("supname")); //供应商名称
String supnumber = null2String(params.get("supnumber")); //供应商编号
String code = "0";
String message = "";
String issuccess = "";
String result = "";
SupplierServiceStub.SupplierSearchReq req = new SupplierServiceStub.SupplierSearchReq();
req.setUser("oa");
req.setPwd("k3cloud_htgd");
req.setFName(supname);
req.setFNumber(supnumber);
req.setDataCenterID(datacenterid);
CallK3SupplierServices services = new CallK3SupplierServices();
SupplierServiceStub.SupplierSearchRes res = services.getSupMsg(req);
code = res.getCode();
message = res.getMessage();
issuccess = res.getIsSuccess();
result = res.getResult();
Map<String,Object> resultJson=new HashMap<>();
resultJson.put("code",code);
resultJson.put("message",message);
resultJson.put("IsSuccess",issuccess);
resultJson.put("result",result);
List<Map<String,Object>> suppliers = new ArrayList<>();
if(!result.equals("0")) {
SupplierServiceStub.ArrayOfSupSample supsample = res.getSupSamples();
SupplierServiceStub.SupSample[] arrs = supsample.getSupSample();
if (arrs != null && arrs.length > 0) {
for (int i = 0; i < arrs.length; i++) {
Map<String,Object> item = new HashMap<>();
item.put("supname", arrs[i].getFSupName());
item.put("supnumber", arrs[i].getFSupNumber());
suppliers.add(item);
}
}
}
resultJson.put("suppliers",suppliers);
return WeaResult.success(resultJson);
}catch (Exception e){
log.error("K3_Check_SupplierInfo_Action execute error", e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,137 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.interfaces.k3.CallK3CustomerService;
import com.weaver.seconddev.interfaces.k3.CustomerServiceStub;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-17
* @Description: K3_Get_CustomerInfo
*/
@org.springframework.stereotype.Service("workflow_action_K3_Get_CustomerInfo_Action")
@Slf4j
public class K3_Get_CustomerInfo_Action implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("K3_Get_CustomerInfo_Action execute start");
log.info("K3_Get_CustomerInfo_Action execute params : " + params);
try {
String datacenterid = null2String(params.get("datacenterid")); //数据中心
String custname= null2String(params.get("custname")); //供应商名称
String custnumber = null2String(params.get("custnumber")); //供应商编号
String code = "0";
String message = "";
String issuccess = "";
String result = "";
CustomerServiceStub.CustomerSearchReq req = new CustomerServiceStub.CustomerSearchReq();
req.setUser("oa");
req.setPwd("k3cloud_htgd");
req.setFName(custname);
req.setFNumber(custnumber);
req.setDataCenterID(datacenterid);
CallK3CustomerService service = new CallK3CustomerService();
CustomerServiceStub.CustomerReturn res = service.getCustomer(req);
Map<String,Object> resultJson=new HashMap<>();
resultJson.put("code",code);
resultJson.put("message",message);
resultJson.put("IsSuccess",issuccess);
resultJson.put("result",result);
CustomerServiceStub.Customer customer = res.getCustomer();
Map<String,Object> supJson = new HashMap<>();
if(customer!=null){
supJson.put("FCustName",customer.getFCustName());//客户名称
supJson.put("FCustNumber",customer.getFCustNumber());//客户代码
supJson.put("Fgroup",customer.getFGroup());//客户分组分组
supJson.put("FGroupName",customer.getFGroupName());//客户分组名称
supJson.put("FCustClassify",customer.getFCustClassify());//供应商类别
supJson.put("FCustCLASSIFYNAME",customer.getFCustCLASSIFYNAME());//供应商类别名称
supJson.put("FTAXREGISTERCODE",customer.getFTAXREGISTERCODE());//统一社会信用代码
supJson.put("FTRADINGCURRID",customer.getFTRADINGCURRID());//结算币别
supJson.put("FRECCONDITIONID",customer.getFRECCONDITIONID());//付款条件
supJson.put("FTaxRateId",customer.getFTaxRate());//默认税率
supJson.put("F_HTGD_RELATEDTYPE",customer.getF_HTGD_RELATEDTYPE());//关联方属性
CustomerServiceStub.ArrayOfOrganization org = customer.getListOrgs();
String orgcode = "";
String orgname = "";
if (org != null) {
CustomerServiceStub.Organization[] orgArr = org.getOrganization();
if(orgArr!=null){
for(int m=0;m<orgArr.length;m++){
orgcode = orgcode + orgArr[m].getFNumber()+",";
orgname = orgname + orgArr[m].getFName()+",";
}
orgcode = orgcode.substring(0,orgcode.lastIndexOf(","));
orgname = orgname.substring(0,orgname.lastIndexOf(","));
}
}
supJson.put("orgcode",orgcode);//关联方属性
supJson.put("orgname",orgname);//关联方属性
//联系人信息
CustomerServiceStub.CustContact contact = customer.getCustContact();
Map<String,Object> contactJson = new HashMap<>();
if(contact!=null) {
contactJson.put("Fcontact", contact.getFCONTACT()); //联系人
contactJson.put("FBizAddress", contact.getFBIZADDRESS());//通讯地址
contactJson.put("FMobile", contact.getFMOBILE());//手机
contactJson.put("Ftel", contact.getFTEL());//电话
contactJson.put("FFax", contact.getFFAX());//传真
contactJson.put("Femail", contact.getFEMAIL());//电子邮箱
}
supJson.put("contact",contactJson);
CustomerServiceStub.ArrayOfCustBank bankinfo = customer.getBankList();
if(bankinfo!=null) {
CustomerServiceStub.CustBank[] bankarr = bankinfo.getCustBank();
List<Map<String,Object>> bankJsonarr = new ArrayList<>();
if(bankarr!=null && bankarr.length>0){
for (int i=0; i<bankarr.length;i++){
Map<String,Object> item = new HashMap<>();
item.put("FBankHolder",bankarr[i].getFBankHolder());
item.put("FBankCode",bankarr[i].getFBankCode());
item.put("FOPENBANKNAME",bankarr[i].getFOPENBANKNAME());
item.put("FCNAPS",bankarr[i].getFCNAPS());
bankJsonarr.add(item);
}
}
supJson.put("banklist",bankJsonarr);
}else{
supJson.put("banklist",new ArrayList<>());
}
}
resultJson.put("customer",supJson);
return WeaResult.success(resultJson);
}catch (Exception e){
log.error("K3_Get_CustomerInfo_Action execute error : " + e.getMessage());
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}

@ -0,0 +1,136 @@
package com.weaver.seconddev.interfaces.workflow.action;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.interfaces.k3.CallK3SupplierServices;
import com.weaver.seconddev.interfaces.k3.SupplierServiceStub;
import com.weaver.verupgrade.soa.workflow.request.RequestInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: calyrex
* @CreateTime: 2025-01-17
* @Description: K3_Get_SupplierInfo
*/
@org.springframework.stereotype.Service("workflow_action_K3_Get_CustomerInfo_Action")
@Slf4j
public class K3_Get_SupplierInfo_Action implements EsbServerlessRpcRemoteInterface {
@Autowired
private RequestInfo requestInfoTemp;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
log.info("K3_Get_SupplierInfo_Action execute start");
log.info("K3_Get_SupplierInfo_Action execute params : " + params);
try {
String datacenterid = null2String(params.get("datacenterid")); //数据中心
String supname= null2String(params.get("supname")); //供应商名称
String supnumber = null2String(params.get("supnumber")); //供应商编号
String code = "0";
String message = "";
String issuccess = "";
String result = "";
SupplierServiceStub.SupplierSearchReq req = new SupplierServiceStub.SupplierSearchReq();
req.setUser("oa");
req.setPwd("k3cloud_htgd");
req.setFName(supname);
req.setFNumber(supnumber);
req.setDataCenterID(datacenterid);
CallK3SupplierServices services = new CallK3SupplierServices();
SupplierServiceStub.SupplierReturn res = services.getSupplier(req);
Map<String,Object> resultJson=new HashMap<>();
resultJson.put("code",code);
resultJson.put("message",message);
resultJson.put("IsSuccess",issuccess);
resultJson.put("result",result);
SupplierServiceStub.Supplier supplier = res.getSupplier();
Map<String,Object> supJson = new HashMap<>();
if(supplier!=null){
supJson.put("FSupName",supplier.getFSupName());//供应商名称
supJson.put("FSupNumber",supplier.getFSupNumber());//公共上代码
supJson.put("Fgroup",supplier.getFGroup());//供应商分组
supJson.put("FGroupName",supplier.getFGroupName());//供应商分组名称
supJson.put("FSupplierClassify",supplier.getFSupplierClassify());//供应商类别
supJson.put("FSUPPLYCLASSIFYNAME",supplier.getFSUPPLYCLASSIFYNAME());//供应商类别名称
supJson.put("SOCIALCRECODE",supplier.getFSOCIALCRECODE());//统一社会信用代码
supJson.put("FPayCurrencyId",supplier.getFPayCurrencyId());//结算币别
supJson.put("FPayCondition",supplier.getFPayCondition());//付款条件
supJson.put("FTaxRateId",supplier.getFTaxRateId());//默认税率
supJson.put("F_HTGD_RELATEDTYPE",supplier.getF_HTGD_RELATEDTYPE());//关联方属性
SupplierServiceStub.ArrayOfOrganization org = supplier.getListOrgs();
String orgcode = "";
String orgname = "";
if(org!=null){
SupplierServiceStub.Organization[] orgArr = org.getOrganization();
if(orgArr!=null){
for(int m=0;m<orgArr.length;m++){
orgcode = orgcode + orgArr[m].getFNumber()+",";
orgname = orgname + orgArr[m].getFName()+",";
}
orgcode = orgcode.substring(0,orgcode.lastIndexOf(","));
orgname = orgname.substring(0,orgname.lastIndexOf(","));
}
}
supJson.put("orgcode",orgcode);//关联方属性
supJson.put("orgname",orgname);//关联方属性
//联系人信息
SupplierServiceStub.SupContact contact = supplier.getSupContact();
Map<String,Object> contactJson = new HashMap<>();
if(contact!=null) {
contactJson.put("Fcontact", contact.getFCONTACT()); //联系人
contactJson.put("FBizAddress", contact.getFBIZADDRESS());//通讯地址
contactJson.put("FMobile", contact.getFMOBILE());//手机
contactJson.put("Ftel", contact.getFTEL());//电话
contactJson.put("FFax", contact.getFFAX());//传真
contactJson.put("Femail", contact.getFEMAIL());//电子邮箱
}
supJson.put("contact",contactJson);
SupplierServiceStub.ArrayOfSupplierBank bankinfo = supplier.getBankList();
if(bankinfo!=null) {
SupplierServiceStub.SupplierBank[] bankarr = bankinfo.getSupplierBank();
List<Map<String,Object>> bankJsonarr = new ArrayList<>();
if(bankarr!=null && bankarr.length>0){
for (int i=0; i<bankarr.length;i++){
Map<String,Object> item = new HashMap<>();
item.put("FBankHolder",bankarr[i].getFBankHolder());
item.put("FBankCode",bankarr[i].getFBankCode());
item.put("FOPENBANKNAME",bankarr[i].getFOPENBANKNAME());
item.put("FCNAPS",bankarr[i].getFCNAPS());
bankJsonarr.add(item);
}
}
supJson.put("banklist",bankJsonarr);
}else{
supJson.put("banklist",new ArrayList<>());
}
}
resultJson.put("supplier",supJson);
return WeaResult.success(resultJson);
}catch (Exception e){
log.error("K3_Get_SupplierInfo_Action execute error : " , e);
return WeaResult.fail(500, "执行异常", e);
}
}
public static String null2String(String s){
return s == null ? "" : s;
}
public static String null2String(Object o){
return o == null ? "" : o.toString();
}
public static String null2String(String s1,String s2){
return s1 == null ? (s2 == null ? "" : s2) : s1;
}
}
Loading…
Cancel
Save