Commit c950383b authored by pete谢兆麟's avatar pete谢兆麟

工作经验公司基本情况接口及逻辑

parent 22c42aa0
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
040AE9842CE893CC00310241 /* YHWorkExperiencePositionItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */; }; 040AE9842CE893CC00310241 /* YHWorkExperiencePositionItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */; };
040AE9862CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9852CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift */; }; 040AE9862CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9852CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift */; };
040AE9882CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */; }; 040AE9882CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */; };
040AE98A2CEC83FA00310241 /* YHWorkExperienceCompanyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE9892CEC83FA00310241 /* YHWorkExperienceCompanyViewModel.swift */; };
040AE98C2CEC84B400310241 /* YHWorkExperienceCompanyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 040AE98B2CEC84B400310241 /* YHWorkExperienceCompanyModel.swift */; };
04129E862CD0C8490072F87B /* YHAliYunLogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */; }; 04129E862CD0C8490072F87B /* YHAliYunLogManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */; };
041390692C1081FA0098CB8A /* YHFileListEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */; }; 041390692C1081FA0098CB8A /* YHFileListEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */; };
0414708B2C88627B00B7B688 /* YHButlerServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */; }; 0414708B2C88627B00B7B688 /* YHButlerServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */; };
...@@ -1046,6 +1048,8 @@ ...@@ -1046,6 +1048,8 @@
040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionItemView.swift; sourceTree = "<group>"; }; 040AE9832CE893CC00310241 /* YHWorkExperiencePositionItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionItemView.swift; sourceTree = "<group>"; };
040AE9852CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceCompanySelectView.swift; sourceTree = "<group>"; }; 040AE9852CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceCompanySelectView.swift; sourceTree = "<group>"; };
040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionModel.swift; sourceTree = "<group>"; }; 040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperiencePositionModel.swift; sourceTree = "<group>"; };
040AE9892CEC83FA00310241 /* YHWorkExperienceCompanyViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceCompanyViewModel.swift; sourceTree = "<group>"; };
040AE98B2CEC84B400310241 /* YHWorkExperienceCompanyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceCompanyModel.swift; sourceTree = "<group>"; };
04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAliYunLogManager.swift; sourceTree = "<group>"; }; 04129E852CD0C8490072F87B /* YHAliYunLogManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAliYunLogManager.swift; sourceTree = "<group>"; };
041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListEmptyView.swift; sourceTree = "<group>"; }; 041390682C1081FA0098CB8A /* YHFileListEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileListEmptyView.swift; sourceTree = "<group>"; };
0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceManager.swift; sourceTree = "<group>"; }; 0414708A2C88627B00B7B688 /* YHButlerServiceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHButlerServiceManager.swift; sourceTree = "<group>"; };
...@@ -2927,6 +2931,7 @@ ...@@ -2927,6 +2931,7 @@
045EEDC22B9F171A0022A143 /* YHCompanyViewModel.swift */, 045EEDC22B9F171A0022A143 /* YHCompanyViewModel.swift */,
045EEDC32B9F171A0022A143 /* YHWorkItemListViewModel.swift */, 045EEDC32B9F171A0022A143 /* YHWorkItemListViewModel.swift */,
040AE97B2CE7410100310241 /* YHWorkExperiencePositionViewModel.swift */, 040AE97B2CE7410100310241 /* YHWorkExperiencePositionViewModel.swift */,
040AE9892CEC83FA00310241 /* YHWorkExperienceCompanyViewModel.swift */,
); );
path = ViewModel; path = ViewModel;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2941,6 +2946,7 @@ ...@@ -2941,6 +2946,7 @@
045EEDC92B9F171A0022A143 /* YHWorkExperienceProjectModel.swift */, 045EEDC92B9F171A0022A143 /* YHWorkExperienceProjectModel.swift */,
045EEDCA2B9F171A0022A143 /* YHCompanyModel.swift */, 045EEDCA2B9F171A0022A143 /* YHCompanyModel.swift */,
040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */, 040AE9872CEB6DAC00310241 /* YHWorkExperiencePositionModel.swift */,
040AE98B2CEC84B400310241 /* YHWorkExperienceCompanyModel.swift */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -5959,6 +5965,7 @@ ...@@ -5959,6 +5965,7 @@
044D0BF42C21247100C5CF5E /* YHUserInfoSettingViewController.swift in Sources */, 044D0BF42C21247100C5CF5E /* YHUserInfoSettingViewController.swift in Sources */,
040AE9862CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift in Sources */, 040AE9862CEB09ED00310241 /* YHWorkExperienceCompanySelectView.swift in Sources */,
A567E5942BD7643D00D5D5A0 /* YHHomeListModel.swift in Sources */, A567E5942BD7643D00D5D5A0 /* YHHomeListModel.swift in Sources */,
040AE98A2CEC83FA00310241 /* YHWorkExperienceCompanyViewModel.swift in Sources */,
047F3DDB2CE6DE91001B2A6D /* YHEducationMarkView.swift in Sources */, 047F3DDB2CE6DE91001B2A6D /* YHEducationMarkView.swift in Sources */,
04CE1AD82C2AD91F001CB80A /* YHActivityListViewController.swift in Sources */, 04CE1AD82C2AD91F001CB80A /* YHActivityListViewController.swift in Sources */,
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */, A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
...@@ -6028,6 +6035,7 @@ ...@@ -6028,6 +6035,7 @@
045EEF032B9F171A0022A143 /* YHFormItemDoubleChoiceCell.swift in Sources */, 045EEF032B9F171A0022A143 /* YHFormItemDoubleChoiceCell.swift in Sources */,
044F39482CB80626007CA277 /* YHVisaRenewalTipsCell.swift in Sources */, 044F39482CB80626007CA277 /* YHVisaRenewalTipsCell.swift in Sources */,
0430E6842C76D702000511E2 /* YHAddpterViewModel.swift in Sources */, 0430E6842C76D702000511E2 /* YHAddpterViewModel.swift in Sources */,
040AE98C2CEC84B400310241 /* YHWorkExperienceCompanyModel.swift in Sources */,
045EEEAE2B9F171A0022A143 /* YHWorkHighlightsTableViewCell.swift in Sources */, 045EEEAE2B9F171A0022A143 /* YHWorkHighlightsTableViewCell.swift in Sources */,
A567E59A2BD7643D00D5D5A0 /* YHHomeKingKongBlockModel.swift in Sources */, A567E59A2BD7643D00D5D5A0 /* YHHomeKingKongBlockModel.swift in Sources */,
045EEF062B9F171A0022A143 /* YHFormItemQuestionsCell.swift in Sources */, 045EEF062B9F171A0022A143 /* YHFormItemQuestionsCell.swift in Sources */,
......
...@@ -686,6 +686,8 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo ...@@ -686,6 +686,8 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
} else { } else {
if indexPath.row == 0 { if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self) let cell = tableView.dequeueReusableCell(withClass: YHWorkExperienceTableViewCell.self)
cell.orderId = orderID
cell.workId = workExperienceID?.intValue() ?? 0
cell.selectDataSource = getTipsWithType() cell.selectDataSource = getTipsWithType()
cell.selectItem = getSelectCompany() cell.selectItem = getSelectCompany()
cell.dataSource = baseDataSource?[indexPath.row] cell.dataSource = baseDataSource?[indexPath.row]
......
//
// YHWorkExperienceCompanyModel.swift
// galaxy
//
// Created by EDY on 2024/11/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHWorkExperienceCompanyModel: SmartCodable {
var order_id: Int = 0
var work_id: Int = 0
var is_ipo_company: Int = 0
var has_company_equity: Int = 0
var has_sales_reached: Int = 0
var has_ipo_company_equity: Int = 0
var has_ipo_sales_reached: Int = 0
var company_location: String = ""
var has_provide_certificate: Int = 0
required init() {
}
}
...@@ -22,6 +22,8 @@ class YHWorkExperienceItemView: UIView { ...@@ -22,6 +22,8 @@ class YHWorkExperienceItemView: UIView {
var showPromptLabel: UILabel! var showPromptLabel: UILabel!
var longTimeButton:UIButton! var longTimeButton:UIButton!
var country: String = "" var country: String = ""
var workId: Int = 0
var orderId: Int = 0
var dataSource: YHWorkExperienceModel? { var dataSource: YHWorkExperienceModel? {
didSet { didSet {
updateAllViews() updateAllViews()
...@@ -249,7 +251,7 @@ class YHWorkExperienceItemView: UIView { ...@@ -249,7 +251,7 @@ class YHWorkExperienceItemView: UIView {
break break
case .company: case .company:
if dataSource.message == "0" { if dataSource.message == "0" {
messageTextField.text = "未选择" messageTextField.text = ""
} else { } else {
messageTextField.text = "已选择" messageTextField.text = "已选择"
} }
...@@ -509,8 +511,13 @@ class YHWorkExperienceItemView: UIView { ...@@ -509,8 +511,13 @@ class YHWorkExperienceItemView: UIView {
} }
} }
case .company: case .company:
YHWorkExperienceCompanySelectView.show { array in YHWorkExperienceCompanySelectView.show(workId: workId, orderId: orderId) { [weak self] in
guard let self = self else { return }
self.dataSource?.message = "1"
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
} }
case .field: case .field:
YHOtherPickerView.show(type: .field, selectTitle: self.dataSource?.message ?? "") {[weak self] data in YHOtherPickerView.show(type: .field, selectTitle: self.dataSource?.message ?? "") {[weak self] data in
......
...@@ -20,6 +20,8 @@ class YHWorkExperienceTableViewCell: UITableViewCell { ...@@ -20,6 +20,8 @@ class YHWorkExperienceTableViewCell: UITableViewCell {
var titleLabel: UILabel! var titleLabel: UILabel!
var mainItemView: UIView! var mainItemView: UIView!
var selectItem: Int = 5 var selectItem: Int = 5
var workId: Int = 0
var orderId: Int = 0
var dataSource: YHSectionWorkExperienceModel?{ var dataSource: YHSectionWorkExperienceModel?{
didSet { didSet {
updateAllViews() updateAllViews()
...@@ -114,6 +116,8 @@ class YHWorkExperienceTableViewCell: UITableViewCell { ...@@ -114,6 +116,8 @@ class YHWorkExperienceTableViewCell: UITableViewCell {
} }
let itemView = YHWorkExperienceItemView() let itemView = YHWorkExperienceItemView()
itemView.dataSource = data itemView.dataSource = data
itemView.workId = workId
itemView.orderId = orderId
itemView.block = {[weak self] model in itemView.block = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
if let block = self.workExperienceBlock { if let block = self.workExperienceBlock {
......
//
// YHWorkExperienceCompanyViewModel.swift
// galaxy
//
// Created by EDY on 2024/11/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHWorkExperienceCompanyViewModel: YHBaseViewModel {
var model: YHWorkExperienceCompanyModel = YHWorkExperienceCompanyModel()
func requestWorkQuestionDetail(_ workId: Int, _ orderId: Int, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let param: [String: Any] = ["work_id": workId, "order_id": orderId]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.workQuestionDetail
let _ = YHNetRequest.getRequest(url: strUrl, params: param) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let result = YHWorkExperienceCompanyModel.deserialize(from: dic) else {
callBackBlock(false,nil)
return
}
self.model = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
func saveWorkQuestion(model: YHWorkExperienceCompanyModel, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let params: [String : Any] = ["order_id": model.order_id,
"work_id": model.work_id,
"is_ipo_company":model.is_ipo_company,
"has_company_equity": model.has_company_equity,
"has_sales_reached": model.has_sales_reached,
"has_ipo_company_equity": model.has_ipo_company_equity,
"has_ipo_sales_reached": model.has_ipo_sales_reached,
"company_location": model.company_location,
"has_provide_certificate": model.has_provide_certificate]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.saveWorkQuestion
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let result = YHWorkExperiencePositionModel.deserialize(from: dic) else {
callBackBlock(false,nil)
return
}
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
...@@ -157,6 +157,13 @@ class YHWorkExperiencePositionViewModel: YHBaseViewModel { ...@@ -157,6 +157,13 @@ class YHWorkExperiencePositionViewModel: YHBaseViewModel {
} }
func saveWorkPosition(callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) { func saveWorkPosition(callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
var is_location_aboard: Int = 0
let addressCountry = position.work_country
if addressCountry.contains("中国") {
is_location_aboard = 1
} else {
is_location_aboard = 2
}
let params: [String : Any] = ["position_id": position.position_id, let params: [String : Any] = ["position_id": position.position_id,
"order_id": position.order_id, "order_id": position.order_id,
"work_id":position.work_id, "work_id":position.work_id,
...@@ -169,7 +176,8 @@ class YHWorkExperiencePositionViewModel: YHBaseViewModel { ...@@ -169,7 +176,8 @@ class YHWorkExperiencePositionViewModel: YHBaseViewModel {
"work_country": position.work_country, "work_country": position.work_country,
"work_city": position.work_city, "work_city": position.work_city,
"provide_certificate_type": position.provide_certificate_type, "provide_certificate_type": position.provide_certificate_type,
"experience_sub_scope": position.experience_sub_scope] "experience_sub_scope": position.experience_sub_scope,
"is_location_aboard": is_location_aboard]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.saveWorkPosition let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.WorkExperience.saveWorkPosition
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -256,6 +256,9 @@ class YHAllApiName { ...@@ -256,6 +256,9 @@ class YHAllApiName {
static let workPositionDetail = "infoflow/work/v1/workPositionDetail" static let workPositionDetail = "infoflow/work/v1/workPositionDetail"
static let saveWorkPosition = "infoflow/work/v1/SaveWorkPosition" static let saveWorkPosition = "infoflow/work/v1/SaveWorkPosition"
static let deleteWorkPosition = "infoflow/work/v1/deleteWorkPosition" static let deleteWorkPosition = "infoflow/work/v1/deleteWorkPosition"
static let workQuestionDetail = "infoflow/work/v1/workQuestionDetail"
static let saveWorkQuestion = "infoflow/work/v1/SaveWorkQuestion"
} }
//登录 //登录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment