|
@@ -7,13 +7,16 @@ import com.google.gson.JsonParser;
|
|
|
import com.nokia.domainb.capability.Foreignproduct;
|
|
|
import com.nokia.domainb.capability.QryRouteAll;
|
|
|
import com.nokia.domainb.capability.QryUserIsUdm;
|
|
|
+import com.nokia.domainb.capability.SpThreePartCheck;
|
|
|
import com.nokia.domainb.dto.RouteDTO;
|
|
|
import com.nokia.domainb.dto.SaAndVolteDTO;
|
|
|
import com.nokia.domainb.dto.SaDTO;
|
|
|
+import com.nokia.domainb.dto.UserStateDTO;
|
|
|
import com.nokia.domainb.vo.RouteVO;
|
|
|
import com.nokia.domainb.vo.SaAndVolteVO;
|
|
|
import com.nokia.domainb.vo.SaVO;
|
|
|
import com.nokia.common.http.R;
|
|
|
+import com.nokia.domainb.vo.UserStateVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -133,4 +136,28 @@ public class DomainService {
|
|
|
|
|
|
return R.ok().data(vo);
|
|
|
}
|
|
|
+
|
|
|
+ public R userState(UserStateDTO dto) {
|
|
|
+ R r = route(new RouteDTO(dto.getFromSystem(), dto.getPhoneNumber()));
|
|
|
+ if (Boolean.FALSE.equals(r.getSuccess())) {
|
|
|
+ return r;
|
|
|
+ }
|
|
|
+
|
|
|
+ RouteVO routeVO = (RouteVO) r.getData();
|
|
|
+ SpThreePartCheck spThreePartCheck = new SpThreePartCheck();
|
|
|
+ COMPConnectionContext result = spThreePartCheck.query(dto.getPhoneNumber(), routeVO.getProvinceCode(), false);
|
|
|
+ JsonObject jsonObject = JsonParser.parseString(result.getResponseContext()).getAsJsonObject();
|
|
|
+ JsonObject rsp = jsonObject.getAsJsonObject("UNI_BSS_BODY")
|
|
|
+ .getAsJsonObject("SP_THREEPART_CHECK_RSP")
|
|
|
+ .getAsJsonObject("RSP");
|
|
|
+ String rspCode = rsp.get("RSP_CODE").getAsString();
|
|
|
+ if (!"0000".equals(rspCode)) {
|
|
|
+ String rspDesc = rsp.get("RSP_DESC").getAsString();
|
|
|
+ return R.error().message(rspDesc);
|
|
|
+ }
|
|
|
+
|
|
|
+ JsonObject data = rsp.getAsJsonArray("DATA").get(0).getAsJsonObject();
|
|
|
+ String userState = data.getAsJsonObject("userInfo").get("userState").getAsString();
|
|
|
+ return R.ok().data(new UserStateVO(userState));
|
|
|
+ }
|
|
|
}
|