|
|
|
@ -12,7 +12,6 @@ import com.elink.esua.epdc.dao.ItemHandleProcessDao; |
|
|
|
import com.elink.esua.epdc.dto.ItemHandleProcessDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.ItemPlatformSyncTaskDispatchFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.ItemPlatformSyncTaskEndFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.TestDTO; |
|
|
|
import com.elink.esua.epdc.dto.result.DataReturnDTO; |
|
|
|
import com.elink.esua.epdc.entity.GridPlatformHandleLogEntity; |
|
|
|
import com.elink.esua.epdc.entity.InterfaceLogEntity; |
|
|
|
@ -40,7 +39,7 @@ import java.util.regex.Pattern; |
|
|
|
* @Date 2019/12/30 16:24 |
|
|
|
*/ |
|
|
|
@WebService(serviceName = "CityGridInterfaceServiceWebService", |
|
|
|
targetNamespace = "http://service.epdc.esua.elink.com", |
|
|
|
targetNamespace = "https://service.epdc.esua.elink.com", |
|
|
|
endpointInterface = "com.elink.esua.epdc.service.CityGridInterfaceServiceWebService") |
|
|
|
@Component |
|
|
|
public class CityGridInterfaceServiceWebServiceImpl implements CityGridInterfaceServiceWebService { |
|
|
|
@ -60,27 +59,43 @@ public class CityGridInterfaceServiceWebServiceImpl implements CityGridInterface |
|
|
|
@Autowired |
|
|
|
private InterfaceLogDao interfaceLogDao; |
|
|
|
|
|
|
|
private Pattern p = Pattern.compile("\\s*|\t|\r|\n"); |
|
|
|
|
|
|
|
/** |
|
|
|
* @param requestXML |
|
|
|
* @param str |
|
|
|
* @return java.lang.String |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试 |
|
|
|
* @Date 2019/12/30 12:46 |
|
|
|
* @Description 去除字符串中的空格、回车、换行符、制表符 |
|
|
|
* @Date 2020/1/3 10:23 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public String test(String requestXML) { |
|
|
|
logger.info("requestXML=" + requestXML); |
|
|
|
TestDTO testDTO = JaxbUtil.converyToJavaBean(requestXML, TestDTO.class); |
|
|
|
String xmlStr = JaxbUtil.convertToXml(testDTO); |
|
|
|
return "调用成功" + xmlStr; |
|
|
|
private String replaceBlank(String str) { |
|
|
|
String dest = ""; |
|
|
|
if (str != null) { |
|
|
|
Matcher m = p.matcher(str); |
|
|
|
dest = m.replaceAll(""); |
|
|
|
} |
|
|
|
return dest; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
DataReturnDTO dataReturnDTO = new DataReturnDTO(); |
|
|
|
System.out.println(JaxbUtil.convertToXmlIgnoreStandalone(dataReturnDTO, "utf-8")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param requestXML |
|
|
|
* @return java.lang.String |
|
|
|
* @Author yinzuomei |
|
|
|
* @Description 测试 |
|
|
|
* @Date 2019/12/30 12:46 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public String test(String requestXML) { |
|
|
|
return "调用成功requestXML=" + requestXML; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param requestXML |
|
|
|
* @return java.lang.String |
|
|
|
@ -121,7 +136,7 @@ public class CityGridInterfaceServiceWebServiceImpl implements CityGridInterface |
|
|
|
} finally { |
|
|
|
// 接口日志表新增一条处理记录
|
|
|
|
insertInterfaceLog(itemGridPlatformEntity, requestXML, |
|
|
|
JaxbUtil.convertToXml(dataReturnDTO), |
|
|
|
replaceBlank(JaxbUtil.convertToXmlIgnoreXmlHead(dataReturnDTO, "utf-8")), |
|
|
|
successFlag, |
|
|
|
InterfaceLogBusinessTypeEnum.SYNC_TASK_DISPATCH.getValue(), |
|
|
|
ItemPlatFormConstant.SyncTaskDispatch); |
|
|
|
@ -129,17 +144,6 @@ public class CityGridInterfaceServiceWebServiceImpl implements CityGridInterface |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private Pattern p = Pattern.compile("\\s*|\t|\r|\n"); |
|
|
|
|
|
|
|
private String replaceBlank(String str) { |
|
|
|
String dest = ""; |
|
|
|
if (str != null) { |
|
|
|
Matcher m = p.matcher(str); |
|
|
|
dest = m.replaceAll(""); |
|
|
|
} |
|
|
|
return dest; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param taskNum |
|
|
|
* @return com.elink.esua.epdc.modules.item.entity.ItemGridPlatformEntity |
|
|
|
@ -266,7 +270,7 @@ public class CityGridInterfaceServiceWebServiceImpl implements CityGridInterface |
|
|
|
throw new Exception("接口异常" + e.getMessage()); |
|
|
|
} finally { |
|
|
|
insertInterfaceLog(itemGridPlatformEntity, requestXML, |
|
|
|
JaxbUtil.convertToXml(dataReturnDTO), |
|
|
|
replaceBlank(JaxbUtil.convertToXmlIgnoreXmlHead(dataReturnDTO, "utf-8")), |
|
|
|
successFlag, |
|
|
|
InterfaceLogBusinessTypeEnum.SYNC_TASK_END.getValue(), |
|
|
|
ItemPlatFormConstant.SyncTaskEnd);//接口日志表新增一条处理记录
|
|
|
|
|