|
|
|
@ -1,15 +1,10 @@ |
|
|
|
|
package com.dxhy.order.consumer.openapi.api; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.http.HttpUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.dxhy.order.baseservice.config.BaseServiceConfig; |
|
|
|
|
import com.dxhy.order.baseservice.config.UserCenterConfig; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxReqBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxcxRspBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxtbReqBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.GmfxxtbRspBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.*; |
|
|
|
|
import com.dxhy.order.baseservice.module.commodity.model.protocol.SpxxcxReqBO; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.DeptEntity; |
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
@ -24,7 +19,6 @@ import com.dxhy.order.consumer.constant.RespStatusEnum; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.CheckResult; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.CommonRequestParam; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.EsOutput; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.IsInput; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonRequestParam; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.po.PoCommonResponseParam; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v4.fpyl.FpylcxReqBO; |
|
|
|
@ -40,13 +34,11 @@ import com.dxhy.order.consumer.openapi.protocol.v5.order.DdfpcxReqV5; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v5.order.DdfpcxRspV5; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v5.order.DdpcxxRspV5; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v6.hzqrd.QdCommonRspV6; |
|
|
|
|
import com.dxhy.order.baseservice.module.buyer.protocol.MdmGmfxxtbMulticodeValuelistBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.protocol.v6.sdenergy.MdmGmfxxtbReqBO; |
|
|
|
|
import com.dxhy.order.consumer.openapi.service.*; |
|
|
|
|
import com.dxhy.order.consumer.utils.BeanTransitionUtils; |
|
|
|
|
import com.dxhy.order.exception.OrderReceiveException; |
|
|
|
|
import com.dxhy.order.invoice.config.InvoiceConfig; |
|
|
|
|
import com.dxhy.order.model.OrderInvoiceInfo; |
|
|
|
|
import com.dxhy.order.utils.HttpUtils; |
|
|
|
|
import com.dxhy.order.utils.JsonUtils; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
@ -64,7 +56,10 @@ import javax.annotation.Resource; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
import static org.joda.time.DateTime.now; |
|
|
|
|
|
|
|
|
@ -417,43 +412,47 @@ public class InvoiceRestApiV6 { |
|
|
|
|
String result = interfaceServiceV3.syncAccountInfo(requestParam); |
|
|
|
|
log.info("同步报账单引用发票信息推送给税控系统数据返回:{}",result); |
|
|
|
|
return result; |
|
|
|
|
} else if(ConfigurerInfo.SYNC_DEPT_INFO.equals(interfaceName)) { |
|
|
|
|
// /itaxAdmin/api/sys/dept/batchUpdate
|
|
|
|
|
log.info("同步组织信息请求报文:{}",reqStr); |
|
|
|
|
PoCommonRequestParam requestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class); |
|
|
|
|
IsInput isInput = requestParam.getIS_INPUT(); |
|
|
|
|
//JSONObject jsonObject2 = JSONObject.parseObject(reqStr); 正常、注销、划转、下线
|
|
|
|
|
String zdata = isInput.getZDATA();//jsonObject2.getString("ZDATA");
|
|
|
|
|
String bskey = isInput.getBSKEY();//jsonObject2.getString("BSKEY");
|
|
|
|
|
String sapkey = isInput.getSAPKEY();//jsonObject2.getString("SAPKEY");
|
|
|
|
|
String s = ""; |
|
|
|
|
JSONObject result = new JSONObject(); |
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("BSKEY",UUID.randomUUID().toString().replaceAll("-","")); |
|
|
|
|
jsonObject.put("SAPKEY",sapkey); |
|
|
|
|
jsonObject.put("ZTYPE","E"); |
|
|
|
|
jsonObject.put("ZMESSAGE","处理失败"); |
|
|
|
|
try { |
|
|
|
|
if(StringUtils.isNotBlank(zdata)){ |
|
|
|
|
String sysUrl = invoiceConfig.getSysUrl() + "/itax/batchUpdate"; |
|
|
|
|
//String sysUrl = "http://localhost:18100/itax/batchUpdate";
|
|
|
|
|
s = HttpUtils.doPost(sysUrl, zdata); |
|
|
|
|
JSONObject jsonObject1 = JSONObject.parseObject(s); |
|
|
|
|
if(CollectionUtils.isEmpty(jsonObject1.getJSONArray("data"))){ |
|
|
|
|
jsonObject.put("ZTYPE","S"); |
|
|
|
|
jsonObject.put("ZMESSAGE","处理成功"); |
|
|
|
|
jsonObject.put("ZDATA",jsonObject1.getString("data")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
jsonObject.put("ZTYPE","E"); |
|
|
|
|
jsonObject.put("ZMESSAGE","处理失败"); |
|
|
|
|
} |
|
|
|
|
log.info("同步组织信息返回报文:{}",jsonObject.toJSONString()); |
|
|
|
|
result.put("ES_OUTPUT",jsonObject); |
|
|
|
|
return result.toJSONString(); |
|
|
|
|
}else{ |
|
|
|
|
} |
|
|
|
|
//20230426客户说不同步更新组织名称
|
|
|
|
|
// else if(ConfigurerInfo.SYNC_DEPT_INFO.equals(interfaceName)) {
|
|
|
|
|
// // /itaxAdmin/api/sys/dept/batchUpdate
|
|
|
|
|
// log.info("同步组织信息请求报文:{}",reqStr);
|
|
|
|
|
// PoCommonRequestParam requestParam = JsonUtils.getInstance().parseObject(reqStr, PoCommonRequestParam.class);
|
|
|
|
|
// IsInput isInput = requestParam.getIS_INPUT();
|
|
|
|
|
// //JSONObject jsonObject2 = JSONObject.parseObject(reqStr); 正常、注销、划转、下线
|
|
|
|
|
// String zdata = isInput.getZDATA();//jsonObject2.getString("ZDATA");
|
|
|
|
|
// String bskey = isInput.getBSKEY();//jsonObject2.getString("BSKEY");
|
|
|
|
|
// String sapkey = isInput.getSAPKEY();//jsonObject2.getString("SAPKEY");
|
|
|
|
|
// String s = "";
|
|
|
|
|
// JSONObject result = new JSONObject();
|
|
|
|
|
//
|
|
|
|
|
// JSONObject jsonObject = new JSONObject();
|
|
|
|
|
// jsonObject.put("BSKEY",UUID.randomUUID().toString().replaceAll("-",""));
|
|
|
|
|
// jsonObject.put("SAPKEY",sapkey);
|
|
|
|
|
// jsonObject.put("ZTYPE","E");
|
|
|
|
|
// jsonObject.put("ZMESSAGE","处理失败");
|
|
|
|
|
// try {
|
|
|
|
|
// if(StringUtils.isNotBlank(zdata)){
|
|
|
|
|
// String sysUrl = invoiceConfig.getSysUrl() + "/itax/batchUpdate";
|
|
|
|
|
// //String sysUrl = "http://localhost:18100/itax/batchUpdate";
|
|
|
|
|
// s = HttpUtils.doPost(sysUrl, zdata);
|
|
|
|
|
// JSONObject jsonObject1 = JSONObject.parseObject(s);
|
|
|
|
|
// if(CollectionUtils.isEmpty(jsonObject1.getJSONArray("data"))){
|
|
|
|
|
// jsonObject.put("ZTYPE","S");
|
|
|
|
|
// jsonObject.put("ZMESSAGE","处理成功");
|
|
|
|
|
// jsonObject.put("ZDATA",jsonObject1.getString("data"));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// jsonObject.put("ZTYPE","E");
|
|
|
|
|
// jsonObject.put("ZMESSAGE","处理失败");
|
|
|
|
|
// }
|
|
|
|
|
// log.info("同步组织信息返回报文:{}",jsonObject.toJSONString());
|
|
|
|
|
// result.put("ES_OUTPUT",jsonObject);
|
|
|
|
|
// return result.toJSONString();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
else{ |
|
|
|
|
returnJsonString = ""; |
|
|
|
|
} |
|
|
|
|
return returnJsonString; |
|
|
|
|