调整客商档案传递开户行名称
This commit is contained in:
parent
72ca4731ea
commit
916a9b9e25
|
@ -12,9 +12,9 @@ import com.hzya.frame.plugin.wscustomersynchronizationevent.entity.WsCustomerSyn
|
|||
import com.hzya.frame.plugin.wscustomersynchronizationevent.service.IWsCustomerSynchronizationEventService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.sun.org.apache.xerces.internal.dom.DeferredEntityReferenceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/***
|
||||
|
@ -26,7 +26,9 @@ import java.util.Map;
|
|||
* @return
|
||||
**/
|
||||
public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCustomerSynchronizationEventEntity, String> implements IWsCustomerSynchronizationEventService {
|
||||
|
||||
//定义两个环境属性,根据环境绑定OA参数
|
||||
private final String TEST = "TEST";
|
||||
private final String DEV = "DEV";
|
||||
private IWsCustomerSynchronizationEventDao wsCustomerSynchronizationEventDao;
|
||||
|
||||
@Autowired
|
||||
|
@ -118,9 +120,6 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -140,7 +139,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
//纳税人登记号
|
||||
String field0007 = formBean.getString("field0007");
|
||||
//绑定客商参数
|
||||
JSONObject requestJson = bindMerchantParameters(data);
|
||||
JSONObject requestJson = bindMerchantParameters(data, DEV);
|
||||
String apiCode = "8000540093";
|
||||
String body = requestApi("optionCustomerSynchronization客商新增", requestJson, "800054", apiCode, null);
|
||||
JSONObject req = JSON.parseObject(body);
|
||||
|
@ -155,7 +154,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
pk_cubasdoc = returnData.getJSONObject(0).getJSONObject("parentvo").getString("pk_cubasdoc");
|
||||
String custcode = returnData.getJSONObject(0).getJSONObject("parentvo").getString("custcode");
|
||||
//执行客商档案编码回传OA
|
||||
updateCustomerCode(formBean.getString("id"),custcode);
|
||||
updateCustomerCode(formBean.getString("id"), custcode,DEV);
|
||||
|
||||
}
|
||||
logger.info("客商新增成功!返回数据", body);
|
||||
|
@ -166,7 +165,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
return BaseResult.getFailureMessageEntity("转发失败!" + req.getJSONObject("attribute").getString("errormsg"));
|
||||
}
|
||||
//绑定客商分配参数
|
||||
requestJson = bindMerchantDefineParameters(data,pk_cubasdoc);
|
||||
requestJson = bindMerchantDefineParameters(data, pk_cubasdoc,DEV);
|
||||
body = requestApi("optionCustomerSynchronization客商分配", requestJson, "800054", "8000540094", null);
|
||||
req = JSON.parseObject(body);
|
||||
flag = req.getBoolean("flag");
|
||||
|
@ -193,7 +192,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
* @param
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject updateCustomerCode(String id,String custcode) {
|
||||
private JSONObject updateCustomerCode(String id, String custcode,String environment ) {
|
||||
String sql = "update formmain_4389 set field0005 = '" + custcode + "' where id = " + id;
|
||||
String md5 = SecureUtil.md5(sql);
|
||||
System.out.println("明文摘要" + md5);
|
||||
|
@ -222,7 +221,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
* @param pk_cubasdoc
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject bindMerchantDefineParameters(JSONObject data, String pk_cubasdoc) {
|
||||
private JSONObject bindMerchantDefineParameters(JSONObject data, String pk_cubasdoc,String environment) {
|
||||
JSONObject formBean = data.getJSONObject("formmain_4389");
|
||||
JSONObject returnData = new JSONObject();
|
||||
JSONArray custbasvo = new JSONArray();
|
||||
|
@ -292,7 +291,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
* @param
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
**/
|
||||
private JSONObject bindMerchantParameters(JSONObject data) {
|
||||
private JSONObject bindMerchantParameters(JSONObject data,String environment) {
|
||||
JSONObject formBean = data.getJSONObject("formmain_4389");
|
||||
JSONObject returnData = new JSONObject();
|
||||
JSONArray cbdocvo = new JSONArray();
|
||||
|
@ -300,9 +299,28 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
JSONObject customer = new JSONObject();
|
||||
JSONArray banks = new JSONArray();
|
||||
JSONObject bank = new JSONObject();
|
||||
JSONObject parentvo = new JSONObject();
|
||||
bank.put("accaddr", "银行地址");
|
||||
String accountproperty = formBean.getString("field0042");
|
||||
|
||||
/** 生产环境和测试环境字段不一致,根据环境切换绑定*/
|
||||
String pk_currtype = null;
|
||||
if(DEV.equals(environment)){
|
||||
//所属地区编码
|
||||
parentvo.put("pk_areacl", formBean.getString("field0060"));
|
||||
//币种类别
|
||||
pk_currtype = formBean.getString("field0062");
|
||||
//银行类别
|
||||
bank.put("banktypename", formBean.getString("field0064"));
|
||||
}else{
|
||||
//所属地区编码
|
||||
parentvo.put("pk_areacl", formBean.getString("field0062"));
|
||||
//币种类别
|
||||
pk_currtype = formBean.getString("field0057");
|
||||
//银行类别 TODO 修改为取编码
|
||||
bank.put("banktypename", formBean.getString("field0036"));
|
||||
}
|
||||
//账户属性
|
||||
String accountproperty = formBean.getString("field0042");
|
||||
switch (accountproperty) {
|
||||
case "-3164025096780690930":
|
||||
accountproperty = "电汇账户";
|
||||
|
@ -328,16 +346,13 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
//开户银行 传递以后名称
|
||||
bank.put("accname", formBean.getString("field0013"));
|
||||
// bank.put("pk_bankdoc", formBean.getString("field0013"));
|
||||
//银行类别 TODO 修改为取编码
|
||||
// bank.put("banktypename", formBean.getString("field0014"));
|
||||
bank.put("banktypename", formBean.getString("field0036"));
|
||||
|
||||
//新增固定传递集团
|
||||
bank.put("pk_corp", formBean.getString("0001"));
|
||||
//币种类别
|
||||
String pk_currtype = formBean.getString("field0057");
|
||||
|
||||
bank.put("pk_currtype", pk_currtype);
|
||||
banks.add(bank);
|
||||
JSONObject parentvo = new JSONObject();
|
||||
|
||||
//创建人 U8C 制单人 admin
|
||||
// parentvo.put("creator",formBean.getString("field0019"));
|
||||
parentvo.put("creator", "admin");
|
||||
|
@ -424,8 +439,7 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
parentvo.put("conaddr", formBean.getString("field0038"));
|
||||
//电话1 取 电话手机
|
||||
parentvo.put("phone1", formBean.getString("field0008"));
|
||||
//所属地区编码 TODO 修改为取编码
|
||||
parentvo.put("pk_areacl",formBean.getString("field0062"));
|
||||
|
||||
//总公司名称 TODO 修改为取编码
|
||||
parentvo.put("pk_cubasdoc1", formBean.getString("field0034"));
|
||||
//纳税人识别号
|
||||
|
@ -439,4 +453,5 @@ public class WsCustomerSynchronizationEventServiceImpl extends BaseService<WsCus
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue