package jp.co.gunmabank.minefocus.accountApp

import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.util.Base64
import android.view.KeyEvent
import android.view.View
import android.widget.Button
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import com.squareup.okhttp.Request
import io.realm.Realm
import jp.co.gunmabank.common.*
import jp.co.gunmabank.common.Common.encryptDnp
import jp.co.gunmabank.db.DBRealm
import jp.co.gunmabank.entity.*
import jp.co.gunmabank.minefocus.BuildConfig
import jp.co.gunmabank.minefocus.R
import jp.co.gunmabank.minefocus.mainTab.MainTabActivity
import jp.co.gunmabank.util.*
import jp.co.gunmabank.view.AccountConfirmDialog
import jp.co.gunmabank.view.AccountProgressDialogLayout
import jp.co.gunmabank.view.ProgressBarView
import jp.co.gunmabank.view.VerticalProgressBar
import org.json.JSONObject
import java.nio.charset.Charset
import java.util.*
import java.util.regex.Pattern class KozaKaisetsu_06008 : AccountActivity() {
// 口座開設Doc
private var accountApplication: KozaKaisetsuBean? = null
//カードローン情報
private var cardloanInfoBean: CardloanAccountInfoBean? = null
//カード再発行Doc
var cardReissueApplication: CardReissueBean? = null
// 次へ
private var next: Button? = null
// アプリ名;アプリバージョン;機種名;OSバージョン;言語設定
var appUserAgentUtil = AppUserAgentUtil()
// 戻る
private var titleBack: ImageView? = null
// 中断する
private var openAccountClose: TextView? = null
// Title
private var progressBarview: ProgressBarView? = null
// ノード
private var vpProgressBar: VerticalProgressBar? = null
// 始めノード
private var progressStartNumber: Int = 0
// 終瞭ノード
private var progressEndNumber: Int = 40
// 区分 口座 1 カードローン 2 再発行 3
private var values: String? = ""
// データ
private var dataAddUtil = DataAddUtil(this@KozaKaisetsu_06008)
//インターネット支店フラーグ
private var internetFlg: String? = "" private var textRelativeLayout: RelativeLayout? = null
//申込データ作成
private var applicationData: TextView? = null
//本人確認証書データ送信
private var dnpSendTextview: TextView? = null
//申込データ送信
private var dataSeng: TextView? = null
//申込完了
private var applyOk: TextView? = null
//Send Failed Bean
private var list: List<AccountBankName>? = null companion object {
var sendSuccessH: Int? = 0
// 口座開設 データ
var jsonDataDetail = StringBuilder()
var jsonDataDetailAddress = StringBuilder()
// 再発行 データ
var jsonReDataDetail = StringBuilder()
var jsonReDataDetailAddress = StringBuilder()
// realmDb
var realm: Realm? = null
// 勤務
var kinmuJson: String? = ""
// 主婦
var shufuJson: String? = ""
// DNP send
var dnpSendJson: String? = ""
// 店舗マスタから取得 データ OLD
var storeMasterNewUpgradeDataDetailBean = StoreMasterNewUpgradeDataDetailBean()
// 店舗マスタから取得 データ NEW
var storeMasterBean = StoreMasterNewUpgradeDataDetailBean()
// 抽出条件でマスタから取得した母店のコード
var motherStoreMasterBean = StoreMasterNewUpgradeDataDetailBean()
//
var detailStoreMasterBean = StoreMasterNewUpgradeDataDetailBean()
} override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_koza_kaisetsu_06008)
ActivityCollector.addAccountActivity(this@KozaKaisetsu_06008)
// realmDb
realm = Realm.getDefaultInstance()
// 検索口座開設データ
accountApplication = DBRealm.seachAccountSendComplete(realm!!)
// カードローン情報
cardloanInfoBean = DBRealm.seachCardLoanAccountApplication(realm!!)
// カード再発行Doc
cardReissueApplication = DBRealm.seachCardReissueBean(realm!!)
// values取得
val getValue = intent
values = getValue.getStringExtra("mode")
// 画面UI初期化
activityInit()
// 次へ
next!!.setClickable(false)
// 中断する 隠す
openAccountClose!!.visibility = View.INVISIBLE
} /**
* 禁止戻りキー
*/
// override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
// if (keyCode == KeyEvent.KEYCODE_BACK)
// return true
// return super.onKeyDown(keyCode, event)
// } override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (openAccountClose!!.visibility == View.VISIBLE) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
//ダイアログ
val confirmDialog = AccountConfirmDialog(this@KozaKaisetsu_06008, "お申込みの手続きを中断してポータル画面に戻りますか?", "", "はい", "いいえ", true)
//ダイアログ
confirmDialog.setClicklistener(object : AccountConfirmDialog.ClickListenerInterface {
//はい
override fun doConfirm() {
//MainTab画面遷移
val intent = Intent(this@KozaKaisetsu_06008, MainTabActivity::class.java);
startActivity(intent)
ActivityCollector.accountFinishAll()
confirmDialog.dismiss()
} //いいえ
override fun doCancel() {
confirmDialog.dismiss()
}
})
confirmDialog.show()
}
}
return false
} override fun onDestroy() {
super.onDestroy();
if (realm != null) {
realm!!.close();
}
accountApplication = null
cardloanInfoBean = null
cardReissueApplication = null
ActivityCollector.removeAccountActivity(this@KozaKaisetsu_06008)
} /**
* 画面UI初期化
*/
fun activityInit() {
//画面タイトル初期化
activityTitleInit()
//画面UI初期化
activityIdInit()
//口座開設送信
sendKozakaiseInit()
//画面UI初期表示
activityPageInit()
//画面UI事件初期化
activityIdEventInit(values)
} fun getTempSend(temp: Int) {
when (temp) {
0, 1 -> {
if (values == "1") { var netStoreNoStr = ""
if (accountApplication!!.goodsTypeSafeCustody == "1") {
if (accountApplication!!.chooseStore == "0") {
//インターネット支店に開設
netStoreNoStr = "270"
} else {
if (accountApplication!!.havenBankAccount == "0") {
//普通預金口座を開設
netStoreNoStr = accountApplication!!.choiceStoreCode!! } else {
if (accountApplication!!.hasNetAccount == "0") {
netStoreNoStr = accountApplication!!.depositStoreNo!!
} else {
netStoreNoStr = accountApplication!!.netStoreNo!!
}
}
} var strTable = ""
if (accountApplication!!.goodsTypeGeneralPay == "1") {
if (netStoreNoStr == accountApplication!!.choiceStoreCode!!) {
strTable = Common.TENPOMASTER_NEW
} else {
strTable = Common.TENPOMASTER
}
} else {
strTable = Common.TENPOMASTER
} storeMasterNewApi(netStoreNoStr, strTable)
} else {
var detailStoreStr = ""
if (accountApplication!!.havenBankAccount == "0") {
if (accountApplication!!.chooseStore == "0") {
//インターネットバンキング契約あり
detailStoreStr = "270"
} else {
detailStoreStr = accountApplication!!.choiceStoreCode!!
}
} else {
if (accountApplication!!.hasNetAccount == "1") {
//インターネットバンキング契約あり
detailStoreStr = accountApplication!!.netStoreNo!!
} else {
detailStoreStr = accountApplication!!.depositStoreNo!!
}
} detailStoreMasterApi(detailStoreStr, Common.TENPOMASTER)
} } else if (values == "2") {
sendJsonData(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
} else if (values == "3") {
storeMasterNewApi(cardReissueApplication!!.storeNo!!, Common.TENPOMASTER)
}
}
2 -> {
accountImageDNPSendFun()
}
3 -> {
// DNPシステム送信更新
sbcfDnpDataUpdateFun()
}
4 -> {
dataAppend(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
}
5 -> {
// 口座開設情報DATA送信
sbcfMailSendUpdataFun()
}
6 -> {
completeSendDnpModifyFun()
}
}
} /*
* 口座開設送信
*/
fun sendKozakaiseInit() {
var step = "0"
if (values == "1") {
if (!accountApplication!!.sendStep.isNullOrEmpty()) {
step = accountApplication!!.sendStep!!
}
} else if (values == "2") {
if (!cardloanInfoBean!!.sendStep.isNullOrEmpty()) {
step = cardloanInfoBean!!.sendStep!!
}
} else if (values == "3") {
if (!cardReissueApplication!!.sendStep.isNullOrEmpty()) {
step = cardReissueApplication!!.sendStep!!
}
}
when (step.toInt()) {
0, 1 -> {
}
2 -> {
vpProgressBar!!.setImage(1)
progressEndNumber = 40
}
3 -> { }
4 -> {
vpProgressBar!!.setImage(2)
progressEndNumber = 70
progressRun()
}
5 -> {
}
6 -> {
vpProgressBar!!.setImage(3)
progressEndNumber = 100
progressRun()
}
}
getTempSend(step.toInt()) } /**
* 支店電話番号
* 支店住所
* 店舗マスタから取得
*/
fun storeMasterNewApi(str: String, tableName: String) {
// 実の店舗請求Request
val param = getStoreMasterNewParam(str, tableName)
storeMasterNewUpgradeDataDetailBean = StoreMasterNewUpgradeDataDetailBean()
object : Thread() {
override fun run() {
try {
// url
val url = Common.gunmaToApiUrl + "rs/schemaless_data_search"
// POST請求API
val content = CommonCurl.postUrlData(url, param, this@KozaKaisetsu_06008)
runOnUiThread {
// 請求API成功
if (!content.isNullOrEmpty()) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, StoreMasterNewResultResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse.response!!.responseHeader!!.errorList != null) {
sendJsonData(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
} else {
var list = resultResponse!!.response!!.dataList!!
if (list.isNotEmpty()) {
storeMasterNewUpgradeDataDetailBean.teleNumber = resultResponse.response!!.dataList!![0].jsonData!!.teleNumber
storeMasterNewUpgradeDataDetailBean.address2 = resultResponse.response!!.dataList!![0].jsonData!!.address2
storeMasterNewUpgradeDataDetailBean.prefectures = resultResponse.response!!.dataList!![0].jsonData!!.prefectures
storeMasterNewUpgradeDataDetailBean.depositAccountNumber = resultResponse.response!!.dataList!![0].jsonData!!.depositAccountNumber
storeMasterNewUpgradeDataDetailBean.storeName = resultResponse.response!!.dataList!![0].jsonData!!.storeName
storeMasterNewUpgradeDataDetailBean.storeNumber = resultResponse.response!!.dataList!![0].jsonData!!.storeNumber
}
storeMasterApi(storeMasterNewUpgradeDataDetailBean.depositAccountNumber!!, tableName)
}
} else {
errorNextButtonUpdate(1)
}
}
} catch (e: Exception) { }
}
}.start()
} fun errorNextButtonUpdate(step: Int) {
openAccountClose!!.setVisibility(View.VISIBLE)
next!!.setBackgroundColor(Color.parseColor("#00A56F"))
next!!.setClickable(true)
next!!.setText(R.string.account_send_button)
next!!.setOnClickListener(View.OnClickListener {
getTempSend(step)
openAccountClose!!.setVisibility(View.INVISIBLE)
next!!.setBackgroundColor(Color.parseColor("#cccccc"))
next!!.setClickable(false)
next!!.setText(R.string.activity_card_reissue3_1_next_btn)
})
if (values == "1") {
realm!!.beginTransaction()
accountApplication!!.sendStep = step.toString()
realm!!.commitTransaction()
} else if (values == "2") {
realm!!.beginTransaction()
cardloanInfoBean!!.sendStep = step.toString()
realm!!.commitTransaction()
} else if (values == "3") {
realm!!.beginTransaction()
cardReissueApplication!!.sendStep = step.toString()
realm!!.commitTransaction()
}
} /**
* 支店電話番号
* 支店住所
* 店舗マスタから取得
*/
fun storeMasterApi(str: String, tableName: String) {
// 実の店舗請求Request
val param = getStoreMasterNewParam(str, tableName)
storeMasterBean = StoreMasterNewUpgradeDataDetailBean()
object : Thread() {
override fun run() {
try {
// url
val url = Common.gunmaToApiUrl + "rs/schemaless_data_search"
// POST請求API
val content = CommonCurl.postUrlData(url, param, this@KozaKaisetsu_06008)
runOnUiThread {
// 請求API成功
if (!content.isNullOrEmpty()) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, StoreMasterNewResultResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse.response!!.responseHeader!!.errorList != null) {
sendJsonData(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
} else {
var list = resultResponse!!.response!!.dataList!!
if (list.isNotEmpty()) {
storeMasterBean.teleNumber = resultResponse.response!!.dataList!![0].jsonData!!.teleNumber
storeMasterBean.address2 = resultResponse.response!!.dataList!![0].jsonData!!.address2
storeMasterBean.prefectures = resultResponse.response!!.dataList!![0].jsonData!!.prefectures
storeMasterBean.depositAccountNumber = resultResponse.response!!.dataList!![0].jsonData!!.depositAccountNumber
storeMasterBean.storeName = resultResponse.response!!.dataList!![0].jsonData!!.storeName
storeMasterBean.storeNumber = resultResponse.response!!.dataList!![0].jsonData!!.storeNumber
}
var detailStoreStr = ""
if (accountApplication!!.havenBankAccount == "0") {
if (accountApplication!!.chooseStore == "0") {
//インターネットバンキング契約あり
detailStoreStr = "270"
} else {
detailStoreStr = accountApplication!!.choiceStoreCode!!
}
} else {
if (accountApplication!!.hasNetAccount == "1") {
//インターネットバンキング契約あり
detailStoreStr = accountApplication!!.netStoreNo!!
} else {
detailStoreStr = accountApplication!!.depositStoreNo!!
}
}
detailStoreMasterApi(detailStoreStr, Common.TENPOMASTER)
}
} else {
errorNextButtonUpdate(1)
}
}
} catch (e: Exception) { }
}
}.start()
} /**
* 住所変更master
*/
fun detailStoreMasterApi(str: String, detailMaster: String) {
// 実の店舗請求Request
val param = getStoreMasterNewParam(str, detailMaster)
detailStoreMasterBean = StoreMasterNewUpgradeDataDetailBean()
object : Thread() {
override fun run() {
try {
// url
val url = Common.gunmaToApiUrl + "rs/schemaless_data_search"
// POST請求API
val content = CommonCurl.postUrlData(url, param, this@KozaKaisetsu_06008)
runOnUiThread {
// 請求API成功
if (!content.isNullOrEmpty()) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, StoreMasterNewResultResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse.response!!.responseHeader!!.errorList != null) {
sendJsonData(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
} else {
var list = resultResponse!!.response!!.dataList!!
if (list.isNotEmpty()) {
detailStoreMasterBean.teleNumber = resultResponse.response!!.dataList!![0].jsonData!!.teleNumber
detailStoreMasterBean.address2 = resultResponse.response!!.dataList!![0].jsonData!!.address2
detailStoreMasterBean.prefectures = resultResponse.response!!.dataList!![0].jsonData!!.prefectures
detailStoreMasterBean.depositAccountNumber = resultResponse.response!!.dataList!![0].jsonData!!.depositAccountNumber
detailStoreMasterBean.storeName = resultResponse.response!!.dataList!![0].jsonData!!.storeName
detailStoreMasterBean.storeNumber = resultResponse.response!!.dataList!![0].jsonData!!.storeNumber
}
sendJsonData(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
}
} else {
errorNextButtonUpdate(1)
}
}
} catch (e: Exception) { }
}
}.start()
} /**
*
*/
fun getStoreMasterNewParam(str: String, tableName: String): String {
var requestBean = StoreMasterNewRequestBean()
var dataBean = StoreMasterNewRequestData()
var resultRequest = StoreMasterNewResultRequest()
var jsonData = StoreMasterNewDataJson()
var storeCom = ArrayList<String>()
storeCom.add(str)
jsonData.storeNumber.put("\$in", storeCom)
//データクラス
dataBean.dataClass = tableName
dataBean.query = jsonData
requestBean.requestHeader = Common.getRequestHeader()
requestBean.data = dataBean
resultRequest.request = requestBean
val jsonStr = JsonUtil.beanTojson(resultRequest)
return jsonStr
} /**
*口座開設の情報を送信する.
*
* @param 申込み日
* @param 申込み時刻
*/
fun sendJsonData(appDay: String, appTime: String) {
// 取引情報保存Oid発行
val jsonParam = getOidJsonParam() object : Thread() {
override fun run() {
try {
// テータ登録url
val urlOld = Common.gunmaToApiUrl + "rs/schemaless_data_regist"
val contentOid = CommonCurl.postUrlData(urlOld, jsonParam, this@KozaKaisetsu_06008)
runOnUiThread {
Common.cancelLoadingDialog()
if (!contentOid.isNullOrEmpty()) {
// ResultResponse
val resultResponse = JsonUtil.jsonToBean(contentOid, OidRegistResponse::class.java)
// エラー一覧
if (resultResponse != null && resultResponse!!.response!!.responseHeader!!.errorList != null) {
// エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
errorNextButtonUpdate(1)
} else {
if (values == "1") {
// DBに口座情報Oid等を登録
DBRealm.saveKozaInfo(realm!!, resultResponse!!.response!!.data)
} else if (values == "2") {
DBRealm.saveCardLonaInfo(realm!!, resultResponse!!.response!!.data)
} else if (values == "3") {
DBRealm.saveCardReissueInfo(realm!!, resultResponse!!.response!!.data)
}
vpProgressBar!!.setImage(1)
progressEndNumber = 40
// DNP send
accountImageDNPSendFun()
}
} else {
errorNextButtonUpdate(1)
}
} } catch (e: Exception) { }
}
}.start()
} fun updataSbcfFail(step: Int) {
runOnUiThread {
// 口座開設情報DATA送信
val param = getDataRegistParam()
object : Thread() {
override fun run() {
try {
// データ更新url
val url = Common.gunmaToApiUrl + "/rs/schemaless_data_modify"
val content = CommonCurl.postUrlData(url, param, this@KozaKaisetsu_06008)
runOnUiThread {
if (content != null) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, OidModifyResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse!!.response!!.responseHeader!!.errorList != null) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
errorNextButtonUpdate(step)
} else {
}
} else {
errorNextButtonUpdate(step)
}
}
} catch (e: Exception) { }
}
}.start()
}
} /**
* 口座開設情報DATA送信
*/
fun sbcfMailSendUpdataFun() {
val param = getDataRegistParam()
object : Thread() {
override fun run() {
try {
// データ更新url
val url = Common.gunmaToApiUrl + "/rs/schemaless_data_modify"
val content = CommonCurl.postUrlData(url, param, this@KozaKaisetsu_06008)
runOnUiThread {
if (content != null) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, OidModifyResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse!!.response!!.responseHeader!!.errorList != null) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
errorNextButtonUpdate(5)
updateSendStatus("2")
} else {
updateSendStatus("1")
vpProgressBar!!.setImage(3)
progressStartNumber = 70
progressEndNumber = 100
progressRun()
completeSendDnpModifyFun()
}
} else {
errorNextButtonUpdate(5)
}
}
} catch (e: Exception) { }
}
}.start()
} /**
* dev CSV + LinkCSV
*/
var callback = object : OkHttpUtil.ResultCallback<String>() {
override fun onResponse(str: String) {
var xml = ReadXML()
if (BuildConfig.FLAVOR == "dev") { } else {
if (values == "1" || values == "3") {
if (xml.getDetail(str).sendFailedCode != "0") {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
updateDataSendStatus("2", "送信データ異常。Message:" + xml.getDetail(str).sendFailedMsg)
errorNextButtonUpdate(4)
updataSbcfFail(4)
return
}
} else if (values == "2") {
var json = JSONObject(str).get("response")
if (json != "0") {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
updateDataSendStatus("2", "送信データ異常。Message:" + str)
errorNextButtonUpdate(4)
updataSbcfFail(4)
return
}
} }
updateDataSendStatus("1", "")
runOnUiThread {
// 口座開設情報DATA送信
sbcfMailSendUpdataFun()
}
} override fun onError(mailSendmsg: String, request: Request, e: Exception) {
var xml = ReadXML()
if (values == "1" || values == "3") {
if (xml.getDetail(mailSendmsg).sendFailedCode != "0") {
var str = ""
if (mailSendmsg.indexOf("Result") != -1 && mailSendmsg.indexOf("error") != -1) {
str = xml.getDetail(mailSendmsg).sendFailedMsg
}
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
updateDataSendStatus("2", "送信データ異常。Message:" + str)
errorNextButtonUpdate(4)
updataSbcfFail(4)
return
}
} else if (values == "2") {
var json = JSONObject(mailSendmsg).get("response")
if (json != "0") {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
updateDataSendStatus("2", "送信データ異常。Message:" + resources.getString(R.string.cardloan_visitor_info_bad_send_faild))
errorNextButtonUpdate(4)
updataSbcfFail(4)
return
}
} } } /**
* dev CSV
*/
var linkcsvNoCallback = object : OkHttpLinkCSVUtil.ResultCallback<String>() {
override fun onResponse(str: String) { updateDataSendStatus("1", "")
runOnUiThread {
// 口座開設情報DATA送信
sbcfMailSendUpdataFun()
}
} override fun onError(request: Request, e: Exception) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
updateDataSendStatus("2", resources.getString(R.string.account_visitor_info_bad_network))
errorNextButtonUpdate(4)
updataSbcfFail(4)
} } /**
* stg CSV + LinkCSV Shift_JIS
*/
var callbackShift = object : OkHttpShiteJisUtil.ResultCallback<String>() {
override fun onResponse(str: String) {
if (values == "1") {
if (str.indexOf("fields count1: 211") != -1 && str.indexOf("fields count2: 58") != -1) {
stgLinkCsvJisSuccessFun()
} else {
val regEx = "[^0-9]"
val p = Pattern.compile(regEx)
val m = p.matcher(str)
val magStr = m.replaceAll("").trim()
val subMagStr = magStr.substring(1, 4)
val sybMagstr58 = magStr.substring(5, 7) Common.sendAlertMsg(this@KozaKaisetsu_06008, "送信処理に失敗しました。通信環境の良い場所でご利用ください。")
sendSuccessH = 2
updateDataSendStatus("2", "送信データと受取データの項目数が一致しません。送信データ項目数:" + subMagStr + "と" + sybMagstr58)
errorNextButtonUpdate(4)
updataSbcfFail(4)
}
} else if (values == "2") { } else if (values == "3") {
if (str.indexOf("fields count1: 58") != -1 && str.indexOf("fields count2: 58") != -1) {
stgLinkCsvJisSuccessFun()
} else {
val regEx = "[^0-9]"
val p = Pattern.compile(regEx)
val m = p.matcher(str)
val magStr = m.replaceAll("").trim()
val subMagStr = magStr.substring(1, 4)
val sybMagstr58 = magStr.substring(5, 7) Common.sendAlertMsg(this@KozaKaisetsu_06008, "送信処理に失敗しました。通信環境の良い場所でご利用ください。")
sendSuccessH = 2
updateDataSendStatus("2", "送信データと受取データの項目数が一致しません。送信データ項目数:" + subMagStr + "と" + sybMagstr58)
errorNextButtonUpdate(4)
updataSbcfFail(4)
}
} } override fun onError(errorCode: Int, request: Request, e: Exception) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
if (errorCode == 200) {
updateDataSendStatus("2", resources.getString(R.string.account_visitor_info_bad_network))
} else {
updateDataSendStatus("2", "ネットワークもしくは送信先システムの障害により、正常に送信できませんでした。Code:" + errorCode.toString())
}
errorNextButtonUpdate(4)
updataSbcfFail(4)
} } fun stgLinkCsvJisSuccessFun() { updateDataSendStatus("1", "")
runOnUiThread {
// 口座開設情報DATA送信
sbcfMailSendUpdataFun()
}
} /**
* stg CSV Shift_JIS
*/
var callbackNoLinkCsvShift = object : OkHttpNoLinkCSVShiftJisUtil.ResultCallback<String>() {
override fun onResponse(str: String, codeStr: String) {
if (values == "1") {
if (str.indexOf("fields count1: 211") != -1) {
stgSendSuccessFun()
} else {
stgSendFaildFun(str)
}
} else if (values == "2") { } else if (values == "3") {
if (str.indexOf("fields count1: 58") != -1) {
stgSendSuccessFun()
} else {
stgSendFaildFun(str)
}
}
} override fun onError(codeFaild: Int, request: Request, e: Exception) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
sendSuccessH = 2
if (codeFaild == 200) {
updateDataSendStatus("2", resources.getString(R.string.account_visitor_info_bad_network))
} else {
updateDataSendStatus("2", "ネットワークもしくは送信先システムの障害により、正常に送信できませんでした。Code:" + codeFaild.toString())
}
errorNextButtonUpdate(4)
updataSbcfFail(4)
} } fun stgSendSuccessFun() { updateDataSendStatus("1", "")
runOnUiThread {
// 口座開設情報DATA送信
sbcfMailSendUpdataFun()
}
} fun stgSendFaildFun(str: String) {
val regEx = "[^0-9]"
val p = Pattern.compile(regEx)
val m = p.matcher(str)
val magStr = m.replaceAll("").trim()
val subMagStr = magStr.substring(1, 4) Common.sendAlertMsg(this@KozaKaisetsu_06008, "送信処理に失敗しました。通信環境の良い場所でご利用ください。")
sendSuccessH = 2
updateDataSendStatus("2", "送信データと受取データの項目数が一致しません。送信データ項目数:" + subMagStr + "と" + "")
errorNextButtonUpdate(4)
updataSbcfFail(4)
} /**
* DNPシステム送信
*/
var dnpSendCallback = object : OkHttpUtil.ResultCallback<String>() {
override fun onResponse(str: String) {
var xml = ReadXML()
if (BuildConfig.FLAVOR == "dev") { } else {
if (xml.getDetail(str).sendFailedCode != "0") {
dnpErrorFun(xml.getDetail(str).sendFailedMsg)
return
}
} updateDnpSendStatus("1", "")
runOnUiThread {
sendSuccessH = 3
// DNPシステム送信更新
sbcfDnpDataUpdateFun()
}
} override fun onError(dnpSendmsg: String, request: Request, e: Exception) {
var xml = ReadXML()
var str = ""
if (dnpSendmsg.indexOf("Result") != -1 && dnpSendmsg.indexOf("error") != -1) {
str = xml.getDetail(dnpSendmsg).sendFailedMsg
}
//エラー時の処理
dnpErrorFun(dnpSendmsg)
} } fun dnpErrorFun(str: String) {
runOnUiThread {
sendSuccessH = 4
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
updateDnpSendStatus("2", "送信データ異常。Message:" + str)
errorNextButtonUpdate(2)
updataSbcfFail(2)
}
} /**
* DNPシステム送信更新
*/
fun sbcfDnpDataUpdateFun() {
// DNPシステム送信更新
val imageDnpModifyParam = getDnpModifyParam()
object : Thread() {
override fun run() {
try {
// データ更新url
val url = Common.gunmaToApiUrl + "/rs/schemaless_data_modify"
val content = CommonCurl.postUrlData(url, imageDnpModifyParam, this@KozaKaisetsu_06008)
runOnUiThread {
if (content != null) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, OidModifyResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse.response!!.responseHeader!!.errorList != null) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
errorNextButtonUpdate(3)
} else {
vpProgressBar!!.setImage(2)
progressStartNumber = 40
progressEndNumber = 70
progressRun()
dataAppend(DateUtils.convertDate2String(Date(), Common.DATE)!!, DateUtils.convertDate2String(Date(), Common.TIMES)!!)
}
} else {
errorNextButtonUpdate(3)
}
}
} catch (e: Exception) { }
}
}.start()
} // DNPシステム送信更新
fun imageSendDnpModifyFun() {
runOnUiThread {
// DNPシステム送信更新
val imageDnpModifyParam = getDnpModifyParam()
object : Thread() {
override fun run() {
try {
// データ更新url
val url = Common.gunmaToApiUrl + "/rs/schemaless_data_modify"
val content = CommonCurl.postUrlData(url, imageDnpModifyParam, this@KozaKaisetsu_06008)
runOnUiThread {
if (content != null) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, OidModifyResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse!!.response!!.responseHeader!!.errorList != null) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
openAccountClose!!.setVisibility(View.VISIBLE)
updateSendStatus("2")
errorNextButtonUpdate(5)
} else {
updateSendStatus("1")
progressStartNumber = 70
progressEndNumber = 100
progressRun()
vpProgressBar!!.setImage(4)
completeSendDnpModifyFun()
}
}
}
} catch (e: Exception) { }
}
}.start()
}
} /**
* 更新
* 銀行システム送信結果(口座)
* 銀行システム送信結果(住所)
* 銀行システム送信時間(口座)
* 銀行システム送信時間(住所)
*/
fun updateDataSendStatus(dataSendStatus: String, errorMessage: String) {
var comDate = DateUtils.convertDate2String(Date(), Common.DATE_TIME)
if (values == "1") {
val datas = DBRealm.seachAccountSendComplete(realm!!)
realm!!.beginTransaction()
datas!!.bankAccountSendStatus = dataSendStatus
datas.bankAddressSendStatus = dataSendStatus
datas.bankAccountSendDate = comDate
datas.bankAddressSendDate = comDate
datas.errorMsg = errorMessage
realm!!.commitTransaction()
} else if (values == "2") {
val cardLoandatas = DBRealm.seachCardLoanAccountApplication(realm!!)
realm!!.beginTransaction()
cardLoandatas!!.acomSendStatus = dataSendStatus
cardLoandatas.acomSendDate = comDate
cardLoandatas.errorMsg = errorMessage
realm!!.commitTransaction()
} else if (values == "3") {
val cardRedatas = DBRealm.seachCardReissueBean(realm!!)
realm!!.beginTransaction()
cardRedatas!!.bankAccountSendStatus = dataSendStatus
cardRedatas.bankAddressSendStatus = dataSendStatus
cardRedatas.bankAccountSendDate = comDate
cardRedatas.bankAddressSendDate = comDate
cardRedatas.errorMsg = errorMessage
realm!!.commitTransaction()
}
} // DNPシステム送信更新
fun completeSendDnpModifyFun() {
runOnUiThread {
// DNPシステム送信更新
val imageDnpModifyParam = getDnpModifyParam()
object : Thread() {
override fun run() {
try {
// データ更新url
val url = Common.gunmaToApiUrl + "/rs/schemaless_data_modify"
val content = CommonCurl.postUrlData(url, imageDnpModifyParam, this@KozaKaisetsu_06008)
runOnUiThread {
if (content != null) {
//ResultResponse
val resultResponse = JsonUtil.jsonToBean(content, OidModifyResponse::class.java)
//エラー一覧
if (resultResponse != null && resultResponse!!.response!!.responseHeader!!.errorList != null) {
//エラー時の処理
Common.sendAlertMsg(this@KozaKaisetsu_06008, resources.getString(R.string.account_visitor_info_bad_send_faild))
errorNextButtonUpdate(6)
} else {
updateSendComplete()
vpProgressBar!!.setImage(4)
next!!.setBackgroundColor(Color.parseColor("#00A56F"))
next!!.setClickable(true) activityIdEventInit(values)
}
} else {
errorNextButtonUpdate(6)
}
}
} catch (e: Exception) { }
}
}.start()
}
} /**
* 更新
* DNPシステム送信結果
* DNPシステム送信時間
*/
fun updateDnpSendStatus(dnpSendStatus: String, errorMessage: String) {
val comDate = DateUtils.convertDate2String(Date(), Common.DATE_TIME)
if (values == "1") {
val datas = DBRealm.seachAccountSendComplete(realm!!)
realm!!.beginTransaction()
datas!!.dnpSendStatus = dnpSendStatus
datas.dnpSendDate = comDate
datas.errorMsg = errorMessage
realm!!.commitTransaction()
} else if (values == "2") {
val cardLonadatas = DBRealm.seachCardLoanAccountApplication(realm!!)
realm!!.beginTransaction()
cardLonadatas!!.dnpSendStatus = dnpSendStatus
cardLonadatas.dnpSendDate = comDate
cardLonadatas.errorMsg = errorMessage
realm!!.commitTransaction()
} else if (values == "3") {
val cardRedatas = DBRealm.seachCardReissueBean(realm!!)
realm!!.beginTransaction()
cardRedatas!!.dnpSendStatus = dnpSendStatus
cardRedatas.dnpSendDate = comDate
cardRedatas.errorMsg = errorMessage
realm!!.commitTransaction()
}
} /**
* 更新
* 送付状況
* 完了日時
*/
fun updateSendStatus(sendStatus: String) {
val datas = DBRealm.seachAccountSendComplete(realm!!)
val cardLonadatas = DBRealm.seachCardLoanAccountApplication(realm!!)
val cardRedatas = DBRealm.seachCardReissueBean(realm!!)
val compDate = DateUtils.convertDate2String(Date(), Common.DATE_TIME)
if (values == "1") {
realm!!.beginTransaction()
datas!!.sendStatus = sendStatus
datas.compDate = compDate
realm!!.commitTransaction()
} else if (values == "2") {
realm!!.beginTransaction()
cardLonadatas!!.sendStatus = sendStatus
cardLonadatas.compDate = compDate
realm!!.commitTransaction()
} else if (values == "3") {
realm!!.beginTransaction()
cardRedatas!!.sendStatus = sendStatus
cardRedatas.compDate = compDate
realm!!.commitTransaction()
}
} /**
* 更新
* 送付状況
* 完了日時
*/
fun updateSendComplete() { var tmpData = DBRealm.seachAccountSendComplete(realm!!)
var reissueTmpData = DBRealm.seachCardReissueBean(realm!!)
if (values == "1") { //Delete 商品Data
realm!!.beginTransaction()
deleteStoreData(tmpData)
realm!!.commitTransaction() var tmpDataOth = DBRealm.seachAccountSendCompleteOth(realm!!)
if (tmpDataOth != null) {
realm!!.beginTransaction()
tmpDataOth.deleteFromRealm()
realm!!.commitTransaction()
}
} else if (values == "2") {
var cardLonaTmpDataOth = DBRealm.seachCardLoanAccountApplication(realm!!)
if (cardLonaTmpDataOth != null) {
realm!!.beginTransaction()
cardLonaTmpDataOth.deleteFromRealm()
realm!!.commitTransaction()
}
} else if (values == "3") {
var reissueTmpDataOth = DBRealm.seachCardReissueBeanSendComplete(realm!!)
if (reissueTmpDataOth != null) {
realm!!.beginTransaction()
reissueTmpDataOth.deleteFromRealm()
realm!!.commitTransaction()
}
}
realm!!.beginTransaction()
if (values == "1") {
tmpData!!.sendComplete = "1"
internetFlg = tmpData.chooseStore
} else if (values == "3") {
reissueTmpData!!.sendComplete = "1"
}
realm!!.commitTransaction() //TODO
var data = DBRealm.seachAccountSendCompleteOth(realm!!)
realm!!.beginTransaction()
data?.deleteFromRealm()
realm!!.commitTransaction() var cardReissue = DBRealm.seachCardReissueBeanSendComplete(realm!!)
realm!!.beginTransaction()
cardReissue?.deleteFromRealm()
realm!!.commitTransaction()
//TODO //送信完了 中断するGone
openAccountClose!!.visibility = View.INVISIBLE
} /**
* Delete 商品Data
*/
fun deleteStoreData(data: KozaKaisetsuBean?) {
// 定期預金
if (data!!.goodsTypeSavePay == "0") {
data.expirationRemind = ""
data.choosedStoreCode = ""
data.choosedStoreName = ""
data.choicedReason = ""
}
// 投資信託振替決済(保護預り)口座
if (data.goodsTypeSafeCustody == "0") {
data.preventionError = ""
data.tradeMotive = ""
data.tradeThought = ""
data.ivExpCredit = ""
data.ivExpStk = ""
data.ivExpLetter = ""
data.ivExpForLifeFC = ""
data.ivExpFC = ""
data.ivExpPubDebt = ""
data.ivExpOther = ""
data.ivExpOtherInput = ""
data.ivKnowlPubDebt = ""
data.ivKnowlInvTrust = ""
data.ivKnowlLifeInsure = ""
data.ivKnowlFCSave = ""
data.ivKnowlFromNews = ""
data.ivKnowlFromTV = ""
data.ivKnowlFromSmnar = ""
data.ivKnowlFromOther = ""
data.faAssetsTotal = ""
data.ivInfoincome = ""
data.withHoldingTax = ""
data.specificAddressChangeFlag = ""
data.specificPrefecturesChange = ""
data.specificPrefecturesCode = ""
} // NISA(少額投資非課税制度)
if (data.goodsTypeNisa == "0") {
data.residence = ""
data.authority = ""
data.transferencePostCode = ""
data.transferencePrefecturesCode = ""
data.transferenceAddress = ""
data.transferenceDate = ""
data.overseasPostCode = ""
data.overseasPrefecturesCode = ""
data.overseasAddress = ""
} // 内容を確認しました
if (data.goodsTypeForeignCurrencyA == "0") {
data.agreeForAdvice = ""
}
// 商品名:ユーロ建外貨普通預金
if (data.goodsTypeForeignCurrencyE == "0") {
data.agreeForEUNormalAdvice = ""
}
// 商品名:米ドル建オーブン型外貨定期預金(自動継続)
if (data.goodsTypeOpenForeignCurrencyA == "0") {
data.agreeForUSDAdvice = ""
}
// 商品名:ユーロ建オーブン型外貨定期預金(自動継続)
if (data.goodsTypeOpenForeignCurrencyE == "0") {
data.agreeForEUOpenAdvice = ""
}
// 以上
if (data.goodsTypeForeignCurrencyA == "0" && data.goodsTypeForeignCurrencyE == "0" && data.goodsTypeOpenForeignCurrencyA == "0" && data.goodsTypeOpenForeignCurrencyE == "0") {
data.agreeForForeignCurrency = ""
data.agreeForForeignPeriodic = ""
data.report = ""
data.enFirstName = ""
data.enLastName = ""
data.enAddress = ""
data.enCity = ""
data.enPrefectures = ""
data.enCountry = ""
data.investThought = ""
data.creditAcceptanceExp = ""
data.strainExp = ""
data.investmentTrustExp = ""
data.lifeInsuranceExp = ""
data.foreignCurrencyExp = ""
data.debtSocialDebtExp = ""
data.othersExp = ""
data.othersContentsExp = ""
data.debtKnowledge = ""
data.investmentTrustKnowledge = ""
data.lifeInsuranceKnowledge = ""
data.foreignCurrencyKnowledge = ""
data.newsWay = ""
data.tvWay = ""
data.seminarWay = ""
data.otherWay = ""
data.totalFinancialAssets = ""
data.incomeAndTax = ""
data.transactionsMotive = ""
}
} /**
* Oidを取得
*/
fun getOidJsonParam(): String {
var requestBean = OidRequestBean()
var dataBean = OidRequestData()
var resultRequest = OidResultRequest()
var detailRequestData = OidDetailRequestData() requestBean.requestHeader = Common.getRequestHeader() var datas = DBRealm.seachAccountSendComplete(realm!!)
var cardRedatas = DBRealm.seachCardReissueBean(realm!!)
var cardReissuedatas = DBRealm.seachCardReissueBean(realm!!)
if (values == "1") {
if (datas!!.addressChangeFlag == "1") {
detailRequestData.applicationType = "11"
} else {
detailRequestData.applicationType = "10"
}
detailRequestData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
detailRequestData.applicationDate = datas.applicationDate
detailRequestData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
detailRequestData.revisionOid = datas.sendedOid
detailRequestData.bankAccountSendStatus = "0"
detailRequestData.bankAccountSendDate = ""
detailRequestData.bankAddressSendStatus = "0"
detailRequestData.bankAddressSendDate = ""
detailRequestData.dnpSendStatus = "0"
detailRequestData.dnpSendDate = ""
detailRequestData.sendStatus = "0"
detailRequestData.errorMsg = ""
detailRequestData.compDate = ""
} else if (values == "2") {
detailRequestData.applicationType = "30"
detailRequestData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
detailRequestData.applicationDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
detailRequestData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
detailRequestData.dnpSendDate = ""
detailRequestData.dnpSendStatus = "0"
detailRequestData.sendStatus = "0"
detailRequestData.errorMsg = ""
detailRequestData.compDate = ""
detailRequestData.acomSendStatus = "0"
detailRequestData.acomSendDate = ""
} else if (values == "3") {
if (cardReissuedatas!!.addressChangeFlag == "0") {
detailRequestData.applicationType = "21"
} else {
detailRequestData.applicationType = "20"
}
detailRequestData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
detailRequestData.applicationDate = cardReissuedatas.applicationDate
detailRequestData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
detailRequestData.revisionOid = cardRedatas!!.sendedOid
detailRequestData.bankAccountSendStatus = "0"
detailRequestData.bankAccountSendDate = ""
detailRequestData.bankAddressSendStatus = "0"
detailRequestData.bankAddressSendDate = ""
detailRequestData.dnpSendStatus = "0"
detailRequestData.dnpSendDate = ""
detailRequestData.sendStatus = "0"
detailRequestData.errorMsg = ""
detailRequestData.compDate = ""
}
dataBean.jsonData = detailRequestData
dataBean.adminName = "群馬銀行口座開設申込情報"
dataBean.dataClass = "GUNMABANK_ACCOUNT_APPLICATION"
requestBean.data = dataBean
resultRequest.request = requestBean val jsonStr = JsonUtil.beanTojson(resultRequest)
return jsonStr
} /**
*JSONデータを作成
* @param 申込み日
* @param 申込み時刻
*/
fun getDataRegistParam(): String {
var requestBean = KozaKaisetsuRequestBean()
var data = KozaKaisetsuRequestData()
var resultRequest = KozaKaisetsuResultRequest()
var jsonData = KozakesetsuDetailData()
if (values == "1") {
var kozaOid = DBRealm.seachAccountApplication(realm!!)
// oid
data.oid = kozaOid!!.oid
} else if (values == "2") {
var cardLoanOid = DBRealm.seachCardLoanAccountApplication(realm!!)
// oid
data.oid = cardLoanOid!!.oid
} else if (values == "3") {
var cardReissueOid = DBRealm.seachcardReApplication(realm!!)
// oid
data.oid = cardReissueOid!!.oid
} requestBean.requestHeader = Common.getRequestHeader()
// データクラス
data.dataClass = "GUNMABANK_ACCOUNT_APPLICATION"
// 管理名称
data.adminName = "群馬銀行口座開設申込情報"
var datas: KozaKaisetsuBean? = null
var cardLonsdatas: CardloanAccountInfoBean? = null
var cardReissuedatas: CardReissueBean? = null
if (values == "1") {
datas = DBRealm.seachAccountSendComplete(realm!!)!!
} else if (values == "2") {
cardLonsdatas = DBRealm.seachCardLoanAccountApplication(realm!!)
} else if (values == "3") {
cardReissuedatas = DBRealm.seachCardReissueBean(realm!!)
} if (values == "1") {
if (datas!!.addressChangeFlag == "1") {
jsonData.applicationType = "11"
} else {
jsonData.applicationType = "10"
}
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = datas.applicationDate
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.revisionOid = datas.sendedOid
jsonData.bankAccountSendStatus = datas.bankAccountSendStatus
jsonData.bankAccountSendDate = datas.bankAccountSendDate
jsonData.bankAddressSendStatus = datas.bankAddressSendStatus
jsonData.bankAddressSendDate = datas.bankAddressSendDate
jsonData.dnpSendStatus = datas.dnpSendStatus
jsonData.dnpSendDate = datas.dnpSendDate
jsonData.sendStatus = datas.sendStatus
jsonData.errorMsg = datas.errorMsg
jsonData.compDate = datas.compDate
} else if (values == "2") {
jsonData.applicationType = "30"
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.dnpSendStatus = cardLonsdatas!!.dnpSendStatus
jsonData.dnpSendDate = cardLonsdatas.dnpSendDate
jsonData.sendStatus = cardLonsdatas.sendStatus
jsonData.errorMsg = cardLonsdatas.errorMsg
jsonData.compDate = cardLonsdatas.compDate
jsonData.acomSendStatus = cardLonsdatas.acomSendStatus
jsonData.acomSendDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
} else if (values == "3") {
if (cardReissuedatas!!.addressChangeFlag == "0") {
jsonData.applicationType = "21"
} else {
jsonData.applicationType = "20"
}
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = cardReissuedatas.applicationDate
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.revisionOid = cardReissuedatas.sendedOid
jsonData.bankAccountSendStatus = cardReissuedatas.bankAccountSendStatus
jsonData.bankAccountSendDate = cardReissuedatas.bankAccountSendDate
jsonData.bankAddressSendStatus = cardReissuedatas.bankAddressSendStatus
jsonData.bankAddressSendDate = cardReissuedatas.bankAddressSendDate
jsonData.dnpSendStatus = cardReissuedatas.dnpSendStatus
jsonData.dnpSendDate = cardReissuedatas.dnpSendDate
jsonData.sendStatus = cardReissuedatas.sendStatus
jsonData.errorMsg = cardReissuedatas.errorMsg
jsonData.compDate = cardReissuedatas.compDate
}
data.jsonData = jsonData
requestBean.data = data
resultRequest.request = requestBean
val jsonStr = JsonUtil.beanTojson(resultRequest)
return jsonStr
} /**
* 口座開設アプリ
*/
fun getImageSendParam(): String {
var requestBean = ImageSendRequestBean()
var data = ImageSendRequestData()
var resultRequest = ImageSendResultRequest()
var jsonData = ImageSendDataJson()
var kozakaiseBean = DBRealm.seachAccountApplication(realm!!)
var cardLoanOid = DBRealm.seachCardLoanAccountApplication(realm!!)
var cardReissueOid = DBRealm.seachCardReissueBean(realm!!) requestBean.requestHeader = Common.getDnpRequestHeader()
// データクラス
data.dataClass = "GUNMABANK_ACCOUNT_APPLICATION"
// 管理名称
data.adminName = "群馬銀行口座開設申込情報" if (values == "1") {
// koza oid
data.oid = kozakaiseBean!!.oid
} else if (values == "2") {
// cardlona oid
data.oid = cardLoanOid!!.oid
} else if (values == "3") {
// reissue oid
data.oid = cardReissueOid!!.oid
} var appDay = DateUtils.convertDate2String(Date(), Common.DATE)!!
var appTime = DateUtils.convertDate2String(Date(), Common.TIMES)!! if (values == "1") {
jsonData.uk = kozakaiseBean!!.oid
} else if (values == "2") {
jsonData.uk = cardLoanOid!!.oid
} else if (values == "3") {
jsonData.uk = cardReissueOid!!.oid
}
jsonData.ak = Common.dnpKey
jsonData.type = "01"
jsonData.reg_date = appDay + appTime
if (values == "1") {
val lastNameCount = kozakaiseBean!!.lastName!!.length
var firstNameStr = ""
var firstNameCount = 0
if (lastNameCount < 20) {
if (kozakaiseBean.firstName!!.length < 20 - lastNameCount) {
firstNameCount = kozakaiseBean.firstName!!.length
} else {
firstNameCount = 20 - lastNameCount
}
firstNameStr = kozakaiseBean.firstName!!.substring(0, firstNameCount)
}
jsonData.name = kozakaiseBean.lastName + firstNameStr
} else if (values == "2") {
val lastNameCount = cardloanInfoBean!!.pNameF!!.length
var firstNameStr = ""
var firstNameCount = 0
if (lastNameCount < 20) {
if (cardloanInfoBean!!.pNameN!!.length < 20 - lastNameCount) {
firstNameCount = cardloanInfoBean!!.pNameN!!.length
} else {
firstNameCount = 20 - lastNameCount
}
firstNameStr = cardloanInfoBean!!.pNameN!!.substring(0, firstNameCount)
}
jsonData.name = cardLoanOid!!.pNameF + firstNameStr
} else if (values == "3") {
val lastNameCount = cardReissueOid!!.lastName!!.length
var firstNameStr = ""
var firstNameCount = 0
if (lastNameCount < 20) {
if (cardReissueOid.firstName!!.length < 20 - lastNameCount) {
firstNameCount = cardReissueOid.firstName!!.length
} else {
firstNameCount = 20 - lastNameCount
}
firstNameStr = cardReissueOid.firstName!!.substring(0, firstNameCount)
}
jsonData.name = cardReissueOid.lastName + firstNameStr
}
if (values == "1") {
if (BuildConfig.FLAVOR == "dev") {
// 免許書画像(表)
jsonData.image_1 = Base64.encodeToString(bitmapPostScale(kozakaiseBean!!.driverLicenseFront), Base64.NO_WRAP)
// 免許書画像(裏)
jsonData.image_2 = Base64.encodeToString(bitmapPostScale(kozakaiseBean.driverLicenseBack), Base64.NO_WRAP)
// 健康保険書(表)
if (kozakaiseBean.insuranceFront != null) {
jsonData.health_image1 = Base64.encodeToString(bitmapPostScale(kozakaiseBean.insuranceFront), Base64.NO_WRAP)
}
// 健康保険書(裏)
if (kozakaiseBean.insuranceBack != null) {
jsonData.health_image2 = Base64.encodeToString(bitmapPostScale(kozakaiseBean.insuranceBack), Base64.NO_WRAP)
}
// オリジナル券面
if (kozakaiseBean.cardImage != null) {
jsonData.original_image = Base64.encodeToString(kozakaiseBean.cardImage, Base64.NO_WRAP)
}
} else {
// 免許書画像(表)
jsonData.image_1 = encryptDnp(bitmapPostScale(kozakaiseBean!!.driverLicenseFront))
// 免許書画像(裏)
jsonData.image_2 = encryptDnp(bitmapPostScale(kozakaiseBean.driverLicenseBack))
// 健康保険書(表)
if (kozakaiseBean.insuranceFront != null) {
jsonData.health_image1 = encryptDnp(bitmapPostScale(kozakaiseBean.insuranceFront))
}
// 健康保険書(裏)
if (kozakaiseBean.insuranceBack != null) {
jsonData.health_image2 = encryptDnp(bitmapPostScale(kozakaiseBean.insuranceBack))
}
// オリジナル券面
if (kozakaiseBean.cardImage != null) {
jsonData.original_image = encryptDnp(kozakaiseBean.cardImage)
}
}
} else if (values == "2") {
if (BuildConfig.FLAVOR == "dev") {
// 免許書画像(表)
jsonData.image_1 = Base64.encodeToString(bitmapPostScale(cardLoanOid!!.driverLicenseFront), Base64.NO_WRAP)
// 免許書画像(裏)
jsonData.image_2 = Base64.encodeToString(bitmapPostScale(cardLoanOid.driverLicenseBack), Base64.NO_WRAP)
} else {
// 免許書画像(表)
jsonData.image_1 = encryptDnp(bitmapPostScale(cardLoanOid!!.driverLicenseFront))
// 免許書画像(裏)
jsonData.image_2 = encryptDnp(bitmapPostScale(cardLoanOid.driverLicenseBack))
}
} else if (values == "3") {
if (BuildConfig.FLAVOR == "dev") {
// 免許書画像(表)
jsonData.image_1 = Base64.encodeToString(bitmapPostScale(cardReissueOid!!.driverLicenseFront), Base64.NO_WRAP)
// 免許書画像(裏)
jsonData.image_2 = Base64.encodeToString(bitmapPostScale(cardReissueOid.driverLicenseBack), Base64.NO_WRAP)
// 健康保険書(表)
if (cardReissueOid.insuranceFront != null) {
jsonData.health_image1 = Base64.encodeToString(bitmapPostScale(cardReissueOid.insuranceFront), Base64.NO_WRAP)
}
// 健康保険書(裏)
if (cardReissueOid.insuranceBack != null) {
jsonData.health_image2 = Base64.encodeToString(bitmapPostScale(cardReissueOid.insuranceBack), Base64.NO_WRAP)
}
// オリジナル券面
if (cardReissueOid.cardImage != null) {
jsonData.original_image = Base64.encodeToString(cardReissueOid.cardImage, Base64.NO_WRAP)
}
} else {
// 免許書画像(表)
jsonData.image_1 = encryptDnp(bitmapPostScale(cardReissueOid!!.driverLicenseFront))
// 免許書画像(裏)
jsonData.image_2 = encryptDnp(bitmapPostScale(cardReissueOid.driverLicenseBack))
// 健康保険書(表)
if (cardReissueOid.insuranceFront != null) {
jsonData.health_image1 = encryptDnp(bitmapPostScale(cardReissueOid.insuranceFront))
}
// 健康保険書(裏)
if (cardReissueOid.insuranceBack != null) {
jsonData.health_image2 = encryptDnp(bitmapPostScale(cardReissueOid.insuranceBack))
}
// オリジナル券面
if (cardReissueOid.cardImage != null) {
jsonData.original_image = encryptDnp(cardReissueOid.cardImage)
}
}
}
var imageFlg: String? = ""
if (jsonData.image_1 != null && jsonData.image_2 != null && jsonData.health_image1 == null && jsonData.health_image2 == null && jsonData.original_image == null) {
imageFlg = "1"
} else if (jsonData.image_1 != null && jsonData.image_2 != null && jsonData.health_image1 != null && jsonData.health_image2 != null && jsonData.original_image == null) {
imageFlg = "2"
} else if (jsonData.image_1 != null && jsonData.image_2 != null && jsonData.health_image1 == null && jsonData.health_image2 == null && jsonData.original_image != null) {
imageFlg = "3"
} else if (jsonData.image_1 != null && jsonData.image_2 != null && jsonData.health_image1 != null && jsonData.health_image2 != null && jsonData.original_image != null) {
imageFlg = "4"
}
jsonData.image_flg = imageFlg
jsonData.device_os_version = AppUserAgentUtil.version_release
jsonData.device_name = android.os.Build.MODEL
if (values == "1") {
jsonData.tokenkey = SecureHashAlgorithmUTF8.getSHA256StrJava(kozakaiseBean!!.oid + "invest_trust" + appDay + appTime + "openaccount")
} else if (values == "2") {
jsonData.tokenkey = SecureHashAlgorithmUTF8.getSHA256StrJava(cardLoanOid!!.oid + "invest_trust" + appDay + appTime + "openaccount")
} else if (values == "3") {
jsonData.tokenkey = SecureHashAlgorithmUTF8.getSHA256StrJava(cardReissueOid!!.oid + "invest_trust" + appDay + appTime + "openaccount")
}
jsonData.tokendate = appDay + appTime
data.jsonData = jsonData
requestBean.data = data
resultRequest.request = requestBean
val jsonStr = JsonUtil.beanTojson(resultRequest)
return jsonStr
} /*
* DNPシステム送信結果state
* */
fun getDnpModifyParam(): String {
var requestBean = KozaKaisetsuRequestBean()
var data = KozaKaisetsuRequestData()
var resultRequest = KozaKaisetsuResultRequest()
var jsonData = KozakesetsuDetailData()
if (values == "1") {
var kozaOid = DBRealm.seachAccountApplication(realm!!)
// oid
data.oid = kozaOid!!.oid
} else if (values == "2") {
var cardLoanOid = DBRealm.seachCardLoanAccountApplication(realm!!)
// oid
data.oid = cardLoanOid!!.oid
} else if (values == "3") {
var cardReissueOid = DBRealm.seachCardReissueBean(realm!!)
// oid
data.oid = cardReissueOid!!.oid
} requestBean.requestHeader = Common.getRequestHeader()
// データクラス
data.dataClass = "GUNMABANK_ACCOUNT_APPLICATION"
// 管理名称
data.adminName = "群馬銀行口座開設申込情報" var datas: KozaKaisetsuBean? = null
var cardLonsdatas: CardloanAccountInfoBean? = null
var cardReissuedatas: CardReissueBean? = null
if (values == "1") {
datas = DBRealm.seachAccountSendComplete(realm!!)!!
} else if (values == "2") {
cardLonsdatas = DBRealm.seachCardLoanAccountApplication(realm!!)
} else if (values == "3") {
cardReissuedatas = DBRealm.seachCardReissueBean(realm!!)
} if (values == "1") {
if (datas!!.addressChangeFlag == "1") {
jsonData.applicationType = "11"
} else {
jsonData.applicationType = "10"
}
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = datas.applicationDate
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.revisionOid = datas.sendedOid
jsonData.bankAccountSendStatus = datas.bankAccountSendStatus
jsonData.bankAccountSendDate = datas.bankAccountSendDate
jsonData.bankAddressSendStatus = datas.bankAddressSendStatus
jsonData.bankAddressSendDate = datas.bankAddressSendDate
jsonData.dnpSendStatus = datas.dnpSendStatus
jsonData.dnpSendDate = datas.dnpSendDate
jsonData.sendStatus = datas.sendStatus
jsonData.errorMsg = datas.errorMsg
jsonData.compDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
} else if (values == "2") {
jsonData.applicationType = "30"
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.dnpSendStatus = cardLonsdatas!!.dnpSendStatus
jsonData.dnpSendDate = cardLonsdatas.dnpSendDate
jsonData.sendStatus = cardLonsdatas.sendStatus
jsonData.errorMsg = cardLonsdatas.errorMsg
jsonData.compDate = cardLonsdatas.compDate
jsonData.acomSendStatus = cardLonsdatas.acomSendStatus
jsonData.acomSendDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
} else if (values == "3") {
if (cardReissuedatas!!.addressChangeFlag == "0") {
jsonData.applicationType = "21"
} else {
jsonData.applicationType = "20"
}
jsonData.appVer = appUserAgentUtil.getVersionName(this@KozaKaisetsu_06008)
jsonData.applicationDate = cardReissuedatas.applicationDate
jsonData.deviceIdentification = AppUserAgentUtil.device_model + AppUserAgentUtil.version_release + AppUserAgentUtil.version_language
jsonData.revisionOid = cardReissuedatas.sendedOid
jsonData.bankAccountSendStatus = cardReissuedatas.bankAccountSendStatus
jsonData.bankAccountSendDate = cardReissuedatas.bankAccountSendDate
jsonData.bankAddressSendStatus = cardReissuedatas.bankAddressSendStatus
jsonData.bankAddressSendDate = cardReissuedatas.bankAddressSendDate
jsonData.dnpSendStatus = cardReissuedatas.dnpSendStatus
jsonData.dnpSendDate = cardReissuedatas.dnpSendDate
jsonData.sendStatus = cardReissuedatas.sendStatus
jsonData.errorMsg = cardReissuedatas.errorMsg
jsonData.compDate = DateUtils.convertDate2String(Date(), Common.DATE)!! + DateUtils.convertDate2String(Date(), Common.TIMES)!!
}
data.jsonData = jsonData
requestBean.data = data
resultRequest.request = requestBean
val jsonStr = JsonUtil.beanTojson(resultRequest)
return jsonStr
} /**
* 画面タイトル初期化
*/
fun activityTitleInit() {
//title name
val titleText = findViewById(R.id.open_account_title_name) as TextView
if (values == Common.ACCOUNT_SEND) {
titleText.setText(R.string.kozakaisetsu_title_10)
} else if (values == Common.CARDLOAN_SEND) {
titleText.setText(R.string.card_title_10)
} else if (values == Common.CARD_REISSUE_SEND) {
titleText.setText(R.string.card_reissue_title_10)
}
} /**
* 画面UI初期化
*/
fun activityIdInit() {
// 次へ
next = findViewById(R.id.next) as Button
// Title
progressBarview = findViewById(R.id.pro_bar_view) as ProgressBarView
// 戻る
titleBack = findViewById(R.id.open_account_title_back) as ImageView
// 隠す
titleBack!!.setVisibility(View.INVISIBLE)
//中断する
openAccountClose = findViewById(R.id.open_account_close) as TextView
vpProgressBar = findViewById(R.id.vp_progress) as VerticalProgressBar
progressRun() textRelativeLayout = findViewById(R.id.text_relative_layout) as RelativeLayout
//申込データ作成
applicationData = findViewById(R.id.application_data) as TextView
//本人確認証書データ送信
dnpSendTextview = findViewById(R.id.dnp_send_textview) as TextView
//申込データ送信
dataSeng = findViewById(R.id.data_seng) as TextView
//申込完了
applyOk = findViewById(R.id.apply_ok) as TextView textRelativeLayout!!.post(Runnable {
val lp1 = RelativeLayout.LayoutParams(applicationData!!.layoutParams)
lp1.setMargins(0, 0, 0, 0)
//申込データ作成
applicationData!!.setLayoutParams(lp1) val lp2 = RelativeLayout.LayoutParams(dnpSendTextview!!.layoutParams)
lp2.setMargins(0, (textRelativeLayout!!.measuredHeight!! - 1) / 3, 0, 0)
//本人確認証書データ送信
dnpSendTextview!!.setLayoutParams(lp2) val lp3 = RelativeLayout.LayoutParams(dataSeng!!.layoutParams)
lp3.setMargins(0, (textRelativeLayout!!.measuredHeight!! - 1) / 3 * 2 - 10, 0, 0)
//申込データ送信
dataSeng!!.setLayoutParams(lp3) val lp4 = RelativeLayout.LayoutParams(applyOk!!.layoutParams)
lp4.setMargins(0, (textRelativeLayout!!.measuredHeight!! - 1) / 3 * 3 - 63, 0, 0)
applyOk!!.setLayoutParams(lp4)
})
} /**
* 進捗条
*/
private fun progressRun() {
object : Thread() {
override fun run() {
try {
for (i in progressStartNumber..progressEndNumber) {
Thread.sleep(20)
vpProgressBar!!.setProgress(i)
}
} catch (e: InterruptedException) {
e.printStackTrace()
} }
}.start()
} fun sendProgressH(strNo: String?) {
intent.setClass(this@KozaKaisetsu_06008, AccountProgressDialogLayout::class.java)
intent.putExtra("sendProgressText", strNo);
startActivity(intent)
} //画面UI初期表示
fun activityPageInit() {
progressBarview!!.setbar(4)
} /**
* 画面UI事件初期化
*/
fun activityIdEventInit(str: String?) {
next!!.setOnClickListener {
// 画面遷移
intent.setClass(this@KozaKaisetsu_06008, KozaKaisetsu_06008_1::class.java)
intent.putExtra("mode", str)
intent.putExtra("internetflg", internetFlg)
startActivity(intent)
ActivityCollector.accountFinishAll()
}
} fun dataAppend(appDay: String, appTime: String) {
sendProgressH("2")
if (values == "1") {
dataAddUtil.accountData(appDay, appTime)
val jsonDataDetailStr = String(jsonDataDetail.toString().toByteArray(Charset.forName(Common.SHIFTJIS)), Charset.forName(Common.SHIFTJIS))
val jsonDataDetailAddressStr = String(jsonDataDetailAddress.toString().toByteArray(Charset.forName(Common.SHIFTJIS)), Charset.forName(Common.SHIFTJIS))
if (BuildConfig.FLAVOR == "dev") {
if (accountApplication!!.addressChangeFlag == "1") {
OkHttpUtil.postFormAsyn(Common.accountApiUrl, callback, jsonDataDetail.toString(), jsonDataDetailAddress.toString(), Common.CSV, Common.LINKCSV)
} else {
OkHttpLinkCSVUtil.postFormAsyn(Common.accountApiUrl, linkcsvNoCallback, jsonDataDetail.toString(), Common.CSV)
}
} else {
if (accountApplication!!.addressChangeFlag == "1") {
OkHttpShiteJisUtil.postFormAsyn(Common.accountApiUrl, callbackShift, jsonDataDetailStr, jsonDataDetailAddressStr, Common.CSV, Common.LINKCSV)
} else {
OkHttpNoLinkCSVShiftJisUtil.postFormAsyn(Common.accountApiUrl, callbackNoLinkCsvShift, jsonDataDetailStr, Common.CSV)
}
} } else if (values == "2") {
if (cardloanInfoBean!!.workType == "1") {
dataAddUtil.cardLoanKinmuData()
val kinmuEncryJson = Common.encrypt(kinmuJson!!)
if (BuildConfig.FLAVOR == "dev") {
OkHttpUtil.postFormAsynForAUth(Common.cardloanApiUrl, callback, kinmuJson!!, Common.ivKey!!, Common.JSONDATA, Common.IV, Common.VERIFICATIONUSER, Common.VERIFICATIONPWD)
} else {
OkHttpUtil.postFormAsynForAUth(Common.cardloanApiUrl, callback, kinmuEncryJson!!, Common.ivKey!!, Common.JSONDATA, Common.IV, Common.VERIFICATIONUSER, Common.VERIFICATIONPWD)
}
} else if (cardloanInfoBean!!.workType == "3") {
dataAddUtil.cardLoanshufuData()
val shufuEncryJson = Common.encrypt(shufuJson!!)
if (BuildConfig.FLAVOR == "dev") {
OkHttpUtil.postFormAsynForAUth(Common.cardloanApiUrl, callback, shufuJson!!, Common.ivKey!!, Common.JSONDATA, Common.IV, Common.VERIFICATIONUSER, Common.VERIFICATIONPWD)
} else {
OkHttpUtil.postFormAsynForAUth(Common.cardloanApiUrl, callback, shufuEncryJson!!, Common.ivKey!!, Common.JSONDATA, Common.IV, Common.VERIFICATIONUSER, Common.VERIFICATIONPWD)
}
}
} else if (values == "3") {
dataAddUtil.cardReissueData(appDay, appTime)
val jsonReDataDetailStr = String(jsonReDataDetail.toString().toByteArray(Charset.forName(Common.SHIFTJIS)), Charset.forName(Common.SHIFTJIS))
val jsonReDataDetailAddressStr = String(jsonReDataDetailAddress.toString().toByteArray(Charset.forName(Common.SHIFTJIS)), Charset.forName(Common.SHIFTJIS))
if (BuildConfig.FLAVOR == "dev") {
if (cardReissueApplication!!.addressChangeFlag == "1") {
OkHttpUtil.postFormAsyn(Common.accountApiUrl, callback, jsonReDataDetail.toString(), jsonReDataDetailAddress.toString(), Common.CSV, Common.LINKCSV)
} else {
OkHttpLinkCSVUtil.postFormAsyn(Common.accountApiUrl, linkcsvNoCallback, jsonReDataDetail.toString(), Common.CSV)
}
} else {
if (cardReissueApplication!!.addressChangeFlag == "1") {
OkHttpShiteJisUtil.postFormAsyn(Common.accountApiUrl, callbackShift, jsonReDataDetailStr, jsonReDataDetailAddressStr, Common.CSV, Common.LINKCSV)
} else {
OkHttpNoLinkCSVShiftJisUtil.postFormAsyn(Common.accountApiUrl, callbackNoLinkCsvShift, jsonReDataDetailStr, Common.CSV)
}
}
}
} /**
* 口座開設 DNPシステム送信Data
*/
fun accountImageDNPSendFun() {
sendSuccessH = 0
sendProgressH("1")
if (values == "1") {
if (BuildConfig.FLAVOR == "dev") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "stg" || BuildConfig.FLAVOR == "jp") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "pro") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
}
} else if (values == "2") {
if (BuildConfig.FLAVOR == "dev") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "stg" || BuildConfig.FLAVOR == "jp") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "pro") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
}
} else if (values == "3") {
if (BuildConfig.FLAVOR == "dev") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "stg" || BuildConfig.FLAVOR == "jp") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
} else if (BuildConfig.FLAVOR == "pro") {
val param = getImageSendParam()
OkHttpUtil.postJsonAsynForAUth(Common.dnpSendApiUrl, dnpSendCallback, param, Common.IMAGETESTDPOSTUSER, Common.IMAGETESTDPOSTPWD)
}
}
} }

送信 okhttp的更多相关文章

  1. Android okHttp网络请求之Json解析

    前言: 前面两篇文章介绍了基于okHttp的post.get请求,以及文件的上传下载,今天主要介绍一下如何和Json解析一起使用?如何才能提高开发效率? okHttp相关文章地址: Android o ...

  2. okhttp封装时,提示 cannot resolve method OkHttpClient setConnectTimeout() 函数

    如标题所示,okhttp封装时,提示 cannot resolve method  OkHttpClient setConnectTimeout() 函数,有遇到这样现象的朋友吗? 原因:因使用的是 ...

  3. RxAndroid+Retrofit+MVVM(1)OKHttp

    1)Gradlecompile 'com.squareup.okhttp:okhttp:2.4.0'compile 'com.squareup.okio:okio:1.5.0' 2)Get //创建o ...

  4. Android okHttp网络请求之Get/Post请求

    前言: 之前项目中一直使用的Xutils开源框架,从xutils 2.1.5版本使用到最近的xutils 3.0,使用起来也是蛮方便的,只不过最近想着完善一下app中使用的开源框架,由于Xutils里 ...

  5. Android okHttp网络请求之文件上传下载

    前言: 前面介绍了基于okHttp的get.post基本使用(http://www.cnblogs.com/whoislcj/p/5526431.html),今天来实现一下基于okHttp的文件上传. ...

  6. Android okHttp网络请求之缓存控制Cache-Control

    前言: 前面的学习基本上已经可以完成开发需求了,但是在项目中有时会遇到对请求做个缓存,当没网络的时候优先加载本地缓存,基于这个需求我们来学习一直okHttp的Cache-Control. okHttp ...

  7. Android okHttp网络请求之Retrofit+Okhttp+RxJava组合

    前言: 通过上面的学习,我们不难发现单纯使用okHttp来作为网络库还是多多少少有那么一点点不太方便,而且还需自己来管理接口,对于接口的使用的是哪种请求方式也不能一目了然,出于这个目的接下来学习一下R ...

  8. 安卓学习----使用okHttp(get方式)---下载图片

    一首先下载Jar包 https://github.com/square/okhttp 如果使用android studio只需要加入依赖 compile 'com.squareup.okhttp3:o ...

  9. Android 框架学习之 第一天 okhttp & Retrofit

    最近面试,一直被问道新技术新框架,这块是短板,慢慢补吧. 关于框架的学习,分几个步骤 I.框架的使用 II.框架主流使用的版本和Android对应的版本 III.框架的衍生使用比如okhttp就会有R ...

随机推荐

  1. [POJ1185][NOI2001]炮兵阵地 状压DP

    题目链接:http://poj.org/problem?id=1185 很裸的状压,考虑对于一行用二进制储存每一种的状态,但是状态太多了做不了. 观察到有很多状态都是不合法的,于是我们预处理出合法的状 ...

  2. Mysql的Root密码忘记,查看或修改的解决方法

    Mysql的Root密码忘记,查看或修改的解决方法:1.首先启动命令行2.在命令行运行:taskkill /f /im mysqld-nt.exe3.继续在命令行运行:mysqld-nt --skip ...

  3. 使用office 365打开excel文件报错,提示“向程序发送命令时出现问题”

    我买了一套正版的office 365装在我的windows10 上.但是每次打开excel都会报错,如图一.求教了微软技术人员,他们给出了以下办法: 图一 方法一: 修复安装Office ====== ...

  4. 参考别人的代码写的aes加密,记录一下(AES,ECB模式,填充PKCS5Padding,数据块128位,偏移量无,以hex16进制输出)

    package org.jimmy.autosearch2019.test; import java.security.SecureRandom; import javax.crypto.Cipher ...

  5. KeyValuePair的使用

    Dictionary<string, string> dc = new Dictionary<string, string>(); 前台页面: <div id=" ...

  6. lucene4.7实例详解

    java.lang.UnsupportedClassVersionError: org/apache/lucene/index/IndexableField : Unsupported major.m ...

  7. hibernate的注解

    1.many-to-one @ManyToOne @JoinColumn(name = "user_id") 2.many-to-many /** * 双向关联关系中,有且仅有一端 ...

  8. 【Java_多线程并发编程】基础篇——线程状态扭转函数

    1. wait() sleep() yield() join()用法与区别 本文提到的当前线程是指:当前时刻,获得CPU资源正在执行的线程. 1.1 wait()方法 wait()方法定义在Objec ...

  9. verdi知识点

    引用:http://blog.csdn.net/naclkcl9/article/details/5425936 1. verdi 加强了active anotation, active trace和 ...

  10. errno的定义

    ./include/asm-generic/errno-base.h -->包含errno=~ ./arch/arm/include/asm/errno.h -->包含/include/a ...