//
//  M_MineInfo.swift
//  VattiCSS
//
//  Created by Jan on 2023/10/12.
//

import UIKit

struct M_MineInfo {
    // 工程师
    var engineerAddress = ""
    var engineerCertificateNoPic = ""
    var engineerCode = ""
    var engineerLimitTakeOrderName = ""
    var engineerName = ""
    var engineerPic = ""
    var engineerPidPic1 = ""
    var engineerPidPic2 = ""
    var engineerPostStatName = ""
    var engineerSiteName = ""
    var engineerStarRatingName = ""
    var engineerTown = ""
    var engineerMobile = ""
    var engineerAreaName = ""
    
    var engineerAuthLevelName = ""
    var engineerPid = ""
   
    // 服务商
    var siteBankAccount = ""
    var siteBankAccountName = ""
    var siteBankName = ""
    
    var siteBusinessStatName = ""
  
    var siteBusinessphoto = ""
    var siteLegalPersonId = ""
    var siteLegalPersonPhoto = ""
    var siteLegalPersonPhoto2 = ""
    
    var siteMan = ""
    var siteOrgName = ""
    var siteParentSiteName = ""
    var siteShopPhoto = ""
    
    var siteStatName = ""
    var siteTypeName = ""
    var siteUserAccount = ""
    
    var siteUserAddress = ""
    var siteUserAreaName = ""
    var siteUserMobile = ""
    var siteUserName = ""
    
    //方便维护
    var pic1 = "" //身份证1
    var pic2 = "" //身份证2
    var pic3 = "" //图片3
    var pic4 = "" //图片4
    
    init(json:[String:Any]) {
        siteBankAccount = json.stringValue(forKey: "siteBankAccount")
        siteBankAccountName = json.stringValue(forKey: "siteBankAccountName")
        siteBankName = json.stringValue(forKey: "siteBankName")
        
        siteBusinessStatName = json.stringValue(forKey: "siteBusinessStatName")
        siteBusinessphoto = json.stringValue(forKey: "siteBusinessphoto")
        siteLegalPersonId = json.stringValue(forKey: "siteLegalPersonId")
        siteLegalPersonPhoto = json.stringValue(forKey: "siteLegalPersonPhoto")
        siteLegalPersonPhoto2 = json.stringValue(forKey: "siteLegalPersonPhoto2")
        
        //维护图片
        if MyInfo.shareInstance().userRole == .Site || MyInfo.shareInstance().userRole == .Admin{
            pic1 = json.stringValue(forKey: "siteLegalPersonPhoto")
            pic2 = json.stringValue(forKey: "siteLegalPersonPhoto2")
            pic3 = json.stringValue(forKey: "siteBusinessphoto")
            pic4 = json.stringValue(forKey: "siteShopPhoto")
         }
        
        if MyInfo.shareInstance().userRole == .Engineer {
            pic1 = json.stringValue(forKey: "engineerPidPic1")
            pic2 = json.stringValue(forKey: "engineerPidPic2")
            pic3 = json.stringValue(forKey: "engineerPic")
            pic4 = json.stringValue(forKey: "engineerCertificateNoPic")
         }
        
        siteMan = json.stringValue(forKey: "siteMan")
        siteOrgName = json.stringValue(forKey: "siteOrgName")
        siteParentSiteName = json.stringValue(forKey: "siteParentSiteName")
        siteShopPhoto = json.stringValue(forKey: "siteShopPhoto")
        siteStatName = json.stringValue(forKey: "siteStatName")
        siteTypeName = json.stringValue(forKey: "siteTypeName")
        siteUserAccount = json.stringValue(forKey: "siteUserAccount")
        siteUserAddress = json.stringValue(forKey: "siteUserAddress")
        siteUserAreaName = json.stringValue(forKey: "siteUserAreaName")
        
        siteUserMobile = json.stringValue(forKey: "siteUserMobile")
        siteUserName = json.stringValue(forKey: "siteUserName")
      
        //工程师
        engineerAddress = json.stringValue(forKey: "engineerAddress")
        engineerCertificateNoPic = json.stringValue(forKey: "engineerCertificateNoPic")
        engineerCode = json.stringValue(forKey: "engineerCode")
        engineerLimitTakeOrderName = json.stringValue(forKey: "engineerLimitTakeOrderName")
        engineerName = json.stringValue(forKey: "engineerName")
        engineerPic = json.stringValue(forKey: "engineerPic")
        engineerPidPic1 = json.stringValue(forKey: "engineerPidPic1")
        engineerPidPic2 = json.stringValue(forKey: "engineerPidPic2")
        engineerPostStatName = json.stringValue(forKey: "engineerPostStatName")
        engineerSiteName = json.stringValue(forKey: "engineerSiteName")
        engineerStarRatingName = json.stringValue(forKey: "engineerStarRatingName")
        engineerTown = json.stringValue(forKey: "engineerTown")
        engineerMobile = json.stringValue(forKey: "engineerMobile")
        engineerAreaName = json.stringValue(forKey: "engineerAreaName")
        engineerAuthLevelName = json.stringValue(forKey: "engineerAuthLevelName")
        engineerPid = json.stringValue(forKey: "engineerPid")
    }
}
