You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
5.6 KiB
126 lines
5.6 KiB
3 years ago
|
package com.eco.plugin.xx.jlyhsjtb.utils;
|
||
|
|
||
|
import com.eco.plugin.xx.jlyhsjtb.db.bean.OrgEntity;
|
||
|
import com.eco.plugin.xx.jlyhsjtb.db.bean.UserEntity;
|
||
|
import com.eco.plugin.xx.jlyhsjtb.db.controller.DBController;
|
||
|
import com.fr.json.JSONObject;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* 公共工具类
|
||
|
*/
|
||
|
public class PubUtils {
|
||
|
|
||
|
/**
|
||
|
* 添加或修改用户 包含对数据库及帆软用户的操作
|
||
|
* @param userList
|
||
|
* @param userEntity
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
public static void addOrUpdateUser(List<UserEntity> userList, UserEntity userEntity) throws Exception {
|
||
|
FRUtils.FRLogInfo("addOrUpdateUser:"+userEntity.getEmplyNo() + ";time:"+DateUtilSelf.getNow());
|
||
|
|
||
|
//将用户数据添加到数据库表中
|
||
|
DBController.batchUser(userList,null);
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* json数据转换为Userentity实体
|
||
|
* @param userJson
|
||
|
* @return
|
||
|
*/
|
||
|
public static UserEntity jsonObjToUserEntity(JSONObject userJson){
|
||
|
UserEntity userEntity = new UserEntity();
|
||
|
|
||
|
userEntity.setType(userJson.getString("oprlTp"));
|
||
|
userEntity.setId(userJson.getString("usrId"));
|
||
|
userEntity.setUsrId(userJson.getString("usrId"));
|
||
|
userEntity.setSurnmNm(userJson.getString("surnmNm"));
|
||
|
userEntity.setEmplyNo(userJson.getString("emplyNo"));
|
||
|
userEntity.setPassword(userJson.getString("password"));
|
||
|
userEntity.setCrnSt(userJson.getString("crnSt"));
|
||
|
userEntity.setLoCo(userJson.getString("loCo"));
|
||
|
userEntity.setLoDept(userJson.getString("loDept"));
|
||
|
userEntity.setIdentTp(userJson.getString("identTp"));
|
||
|
userEntity.setIdentNo(userJson.getString("identNo"));
|
||
|
userEntity.setGender(userJson.getString("gender"));
|
||
|
userEntity.setBrthDt(userJson.getString("brthDt"));
|
||
|
userEntity.setNation(userJson.getString("nation"));
|
||
|
userEntity.setNtvPlc(userJson.getString("ntvPlc"));
|
||
|
userEntity.setDomcChrctrstc(userJson.getString("domcChrctrstc"));
|
||
|
userEntity.setMrtlSt(userJson.getString("mrtlSt"));
|
||
|
userEntity.setPltclSt(userJson.getString("pltclSt"));
|
||
|
userEntity.setInParDt(userJson.getString("inParDt"));
|
||
|
userEntity.setHltStatus(userJson.getString("hltStatus"));
|
||
|
userEntity.setRsdnAdr(userJson.getString("rsdnAdr"));
|
||
|
userEntity.setPst(userJson.getString("pst"));
|
||
|
userEntity.setPosition(userJson.getString("position"));
|
||
|
userEntity.setPstPostnLvl(userJson.getString("pstPostnLvl"));
|
||
|
userEntity.setMblNo(userJson.getString("mblNo"));
|
||
|
userEntity.setMailBox(userJson.getString("mailBox"));
|
||
|
userEntity.setPstlCd(userJson.getString("pstlCd"));
|
||
|
userEntity.setEdctHist(userJson.getString("edctHist"));
|
||
|
userEntity.setDplma(userJson.getString("dplma"));
|
||
|
userEntity.setIfHestEdctHist(userJson.getString("ifHestEdctHist"));
|
||
|
userEntity.setCtfInfArray(userJson.getString("ctfInfArray"));
|
||
|
userEntity.setFamMbrInfArray(userJson.getString("famMbrInfArray"));
|
||
|
|
||
|
return userEntity;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* json数据转换为Orgentity实体
|
||
|
* @param orgJson
|
||
|
* @return
|
||
|
*/
|
||
|
public static OrgEntity jsonObjToOrgEntity(JSONObject orgJson){
|
||
|
OrgEntity orgEntity = new OrgEntity();
|
||
|
|
||
|
orgEntity.setType(orgJson.getString("oprlTp"));
|
||
|
orgEntity.setId(orgJson.getString("brId"));
|
||
|
orgEntity.setBrId(orgJson.getString("brId"));
|
||
|
orgEntity.setBrNm(orgJson.getString("brNm"));
|
||
|
orgEntity.setBrCd(orgJson.getString("brCd"));
|
||
|
orgEntity.setSprBrId(orgJson.getString("sprBrId"));
|
||
|
orgEntity.setBrTreeId(orgJson.getString("brTreeId"));
|
||
|
orgEntity.setBrCtgry(orgJson.getString("brCtgry"));
|
||
|
orgEntity.setBrTp(orgJson.getString("brTp"));
|
||
|
orgEntity.setBrAcbPrsnNm(orgJson.getString("brAcbPrsnNm"));
|
||
|
orgEntity.setSatrapLdr(orgJson.getString("satrapLdr"));
|
||
|
orgEntity.setBrChrctrstc(orgJson.getString("brChrctrstc"));
|
||
|
orgEntity.setBrSt(orgJson.getString("brSt"));
|
||
|
orgEntity.setLoDstc(orgJson.getString("loDstc"));
|
||
|
orgEntity.setPstlId(orgJson.getString("pstlId"));
|
||
|
orgEntity.setTelNo(orgJson.getString("telNo"));
|
||
|
orgEntity.setRgstrtnAdr(orgJson.getString("rgstrtnAdr"));
|
||
|
orgEntity.setOfcAdr(orgJson.getString("ofcAdr"));
|
||
|
orgEntity.setCmpilPplCnt(orgJson.getString("cmpilPplCnt"));
|
||
|
orgEntity.setActPplCnt(orgJson.getString("actPplCnt"));
|
||
|
orgEntity.setOvCmpilPplCnt(orgJson.getString("ovCmpilPplCnt"));
|
||
|
orgEntity.setOvGapPplCnt(orgJson.getString("ovGapPplCnt"));
|
||
|
orgEntity.setAprvdPrefNo(orgJson.getString("aprvdPrefNo"));
|
||
|
orgEntity.setBrRspbl(orgJson.getString("brRspbl"));
|
||
|
orgEntity.setBrBlngBarLine(orgJson.getString("brBlngBarLine"));
|
||
|
|
||
|
orgEntity.setAprvdFoundTm(orgJson.getString("aprvdFoundTm"));
|
||
|
orgEntity.setLoCity(orgJson.getString("loCity"));
|
||
|
orgEntity.setFnPrmt(orgJson.getString("fnPrmt"));
|
||
|
orgEntity.setCrtDt(orgJson.getString("crtDt"));
|
||
|
orgEntity.setBsnLicNo(orgJson.getString("bsnLicNo"));
|
||
|
orgEntity.setLgtLtt(orgJson.getString("lgtLtt"));
|
||
|
orgEntity.setfICd(orgJson.getString("fICd"));
|
||
|
orgEntity.setLglPrsn(orgJson.getString("lglPrsn"));
|
||
|
orgEntity.setLoProv(orgJson.getString("loProv"));
|
||
|
orgEntity.setBrLyrdLvl(orgJson.getString("brLyrdLvl"));
|
||
|
orgEntity.setBrAcbPrsnCtcTel(orgJson.getString("brAcbPrsnCtcTel"));
|
||
|
orgEntity.setBrShrtNm(orgJson.getString("brShrtNm"));
|
||
|
orgEntity.setZoneInOutFlg(orgJson.getString("zoneInOutFlg"));
|
||
|
orgEntity.setAdmnstvDstc(orgJson.getString("admnstvDstc"));
|
||
|
|
||
|
|
||
|
return orgEntity;
|
||
|
}
|
||
|
}
|