Browse Source

市认证用户 -> 市认证用户原始表 (同步)

市认证用户原始表 -> 用户业务部 (同步)
v6
蟑螂恶霸 1 year ago
parent
commit
14e0424d6e
  1. 1
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseComplaintController.java
  2. 227
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/SynUserInfoTask.java
  3. 184
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/SynUserInfoTask_bak.java
  4. 4
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/user/service/UserServiceImpl.java
  5. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml
  6. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzDept.java
  7. 538
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzUser.java
  8. 25
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/SrzUserMapper.java
  9. 39
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ISrzUserService.java
  10. 4
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/NonEnforcementRegistrationServiceImpl.java
  11. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzDeptServiceImpl.java
  12. 175
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzUserServiceImpl.java
  13. 12
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java
  14. 181
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/SrzUserOriginalDataTask.java
  15. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  16. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzDeptMapper.xml
  17. 281
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzUserMapper.xml

1
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseComplaintController.java

@ -217,6 +217,7 @@ public class AppEnterpriseComplaintController extends BaseController {
// 获取图片
List<ZdxtFileCommon> files = zdxtFileCommonApi.selectZdxtFileById(id);
resMap.put("file", files);
enterpriseComplaint.setParams(resMap);
return ZDResponse.success("投诉详情查询", enterpriseComplaint);
}

227
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/SynUserInfoTask.java

@ -1,14 +1,22 @@
package com.zdxt.app.task;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.auth.project.system.dept.service.IDeptService;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.auth.project.system.user.dto.UserSearchDto;
import com.zdxt.auth.project.system.user.service.IUserService;
import com.zdxt.code.domain.SrzUser;
import com.zdxt.code.service.ISrzUserService;
import com.zdxt.common.util.IdCardCryptoUtil;
import com.zdxt.domain.auth.DictData;
import com.zdxt.domain.auth.User;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@ -18,6 +26,7 @@ import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -40,22 +49,12 @@ import java.util.stream.Collectors;
@Component("synUserInfoTask")
public class SynUserInfoTask {
@Value("${srnwg.systemCode}")
private String systemCode;
@Value("${srnwg.integrationKey}")
private String integrationKey;
@Value("${srnwg.url}")
private String znwgUrl;
@Value("${srnwg.paasId}")
private String paasId;
@Value("${srnwg.paasToken}")
private String paasToken;
@Value("${srnwg.secretKey}")
private String secretKey;
@Autowired private UserApi userApi;
@Autowired private ISrzUserService iSrzUserService;
@Autowired private IUserService userService;
@Autowired private IDeptService deptService;
@Autowired
private IDictDataService iDictDataService;
@Autowired private IDictDataService iDictDataService;
public static Map<String,String> params = new HashMap<>();
@ -68,121 +67,103 @@ public class SynUserInfoTask {
/** 同步用户数据 */
public void userInfo(){
List<DictData> srz_item = iDictDataService.selectDictDataByType("srz_item");
Map<String,String> map = srz_item.stream().collect(Collectors.toMap(DictData::getDictLabel,DictData::getDictValue));
if(MapUtil.isNotEmpty(map)){
params = map;
}
String token = "";
String destroyTken = "";
int insertNum = 0;
int updateNum = 0;
int rowNom_srz = 0;
try {
// 获取 access_token
String tokenJson = connect("/ebus/sfrzhqxglmk/sysPullLogin?systemCode="+systemCode+"&integrationKey="+integrationKey);
JSONObject tokenObj = JSONObject.parseObject(tokenJson);
log.info("====================== access_token ======================");
log.info("获取市认证令牌:{}",tokenObj);
System.out.println("====================== access_token ======================");
token = tokenObj.getString("data");
// 获取 用户信息
int page = 0;
int pageSize = 500;
List<Map<String, Integer>> sumMap = new ArrayList<>();
// 做个死循环, 一直到查寻不到数据了再break
while (true) {
String userInfoJson = connect("/ebus/sfrzhqxglmk/sysPullTacc?token="+token+"&page="+page+"&pageSize="+pageSize+"&status=0");
JSONObject sourceObj = JSONObject.parseObject(userInfoJson);
JSONObject tmpJsonObj = sourceObj.getJSONObject("data");
if(null==tmpJsonObj) {
log.info("=====================> tmpJsonObj 为空");
break;
List<SrzUser> srzUserList = iSrzUserService.selectUserByNeedUpdate();
// 如果查出结果为空 或 长度为0 则跳出循环
if (srzUserList == null || srzUserList.isEmpty() || srzUserList.size() == 0) break;
// 开始同步更新数据到用户表
for(SrzUser srzUser : srzUserList){
User user = new User();
BeanUtils.copyProperties(srzUser,user);
user.setSex(srzUser.getGenderCode());
user.setDeptId(srzUser.getOrganizationId());
user.setOrganizationId(srzUser.getOrganizationId());
user.setStrUserId(srzUser.getUserId());
user.setSrzUserid(srzUser.getSrzUserid());
user.setFullname(srzUser.getFullname());
user.setUserName(srzUser.getFullname());
user.setTaskId(srzUser.getTaskId());
user.setSystemId(srzUser.getSystemId());
user.setLoginName(srzUser.getUsername());
user.setEffectOn(srzUser.getEffectOn());
user.setIsDisabled(srzUser.getIsDisabled());
user.setIsDeleted(srzUser.getIsDeleted());
user.setCreateAt(srzUser.getCreateAt());
user.setUpdateAt(srzUser.getUpdateAt());
user.setGuid(srzUser.getGuid());
//用户类型 0 系统用户
user.setUserSource(0);
//手机号加密
String mobileNumber = "";
try {
mobileNumber = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, srzUser.getMobileNumber());
} catch (Exception e) {
System.out.println(e.getMessage());
mobileNumber = "";
}
user.setMobileNumber(mobileNumber);
user.setPhonenumber(mobileNumber);
user.setEmail(srzUser.getEmail());
user.setCertificateTypeId(srzUser.getCertificateTypeId());
user.setCertificateTypeIdCode(srzUser.getCertificateTypeIdCode());
//证件号加密
String certificateNumber = "";
try {
certificateNumber = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, srzUser.getCertificateNumber());
} catch (Exception e) {
certificateNumber = "";
}
user.setCertificateNumber(certificateNumber);
user.setIsMappingPerson(srzUser.getIsMappingPerson());
//证件号加密
// String units = "";
// try {
// units = IdCardCryptoUtil.symmetricEncryptIdCard(secretKey, srzUser.getUnits());
// } catch (Exception e) {
// units = "";
// }
// user.setUnits(units);
user.randomSalt();
//新增用户默认不删除标记
user.setDelFlag("0");
//限制只通过用户信息的username来判断,避免登录出现问题
String userName = srzUser.getUsername();
if(StringUtils.isNotEmpty(userName)){
UserSearchDto userSearchDto = new UserSearchDto();
userSearchDto.setUserSource(0);
User uniqueUser = userService.selectUserByLoginName(userName);
if (null != uniqueUser && uniqueUser.getUserId() != null) {
// 更新数据库
user.setUserId(uniqueUser.getUserId());
if (StringUtils.isEmpty(user.getLawCertificateNum())) {
user.setLawCertificateNum(uniqueUser.getLawCertificateNum());
}
int rowNum = userService.updateUser(user);
updateNum += rowNum;
} else {
// 插入数据库
int rowNum = userService.insertUser(user);
insertNum += rowNum;
}
srzUser.setNeedUpdate(1);
int srz_num = iSrzUserService.updateSrzUser(srzUser);
rowNom_srz += srz_num;
}
}
JSONArray dataArr = tmpJsonObj.getJSONArray("data");
log.info("市认证过来的用户信息---> : {}", tmpJsonObj);
if (null == dataArr || dataArr.size()==0) { break; }
Map<String, Integer> resMap = userService.addSrzUser(dataArr, token);
sumMap.add(resMap);
page++;
}
int insertNum = 0;
int updateNum = 0;
for (Map<String, Integer> item : sumMap) {
insertNum += item.get("insertNum");
updateNum += item.get("updateNum");
}
log.info("新增用户数量 : {} / 更新用户数量 : {}", insertNum, updateNum);
// 注销token
destroyTken = connect("/ebus/sfrzhqxglmk/sysPullLogout?token="+token);
System.out.println("====================== destroyTken ======================");
System.out.println(destroyTken);
System.out.println("====================== destroyTken ======================");
log.info("新增用户数量 : {} / 更新用户数量 : {} / 更新原始表数 : {}", insertNum, updateNum, rowNom_srz);
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
private String connect(String apiPath) {
//各种参数
try {
// String params = "{\"uid\":\"5b07b3de672c4e999c4b04f4\"}"; //请求接⼝的参数
String params = ""; //请求接⼝的参数
long now = new Date().getTime();
String timestamp = Long.toString((long) Math.floor(now / 1000));
String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//创建CloseableHttpClient
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
httpPost.setHeader("x-tif-paasid", paasId);
httpPost.setHeader("x-tif-timestamp", timestamp);
httpPost.setHeader("x-tif-signature", signature);
httpPost.setHeader("x-tif-nonce", nonce);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Cache-Control", "no-cache");
HttpEntity entity = new StringEntity(params);
httpPost.setEntity(entity);
CloseableHttpResponse response = client.execute(httpPost);
return EntityUtils.toString(response.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private String toSHA256(String str) throws Exception {
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes(StandardCharsets.UTF_8));
encodeStr = byte2Hex(messageDigest.digest());
} catch (Exception e) {
throw e;
}
return encodeStr;
}
// byte转换成16进制
private String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

184
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/task/SynUserInfoTask_bak.java

@ -0,0 +1,184 @@
//package com.zdxt.app.task;
//
//import cn.hutool.core.map.MapUtil;
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.zdxt.auth.feign.UserApi;
//import com.zdxt.auth.project.system.dept.service.IDeptService;
//import com.zdxt.auth.project.system.dict.service.IDictDataService;
//import com.zdxt.auth.project.system.user.service.IUserService;
//import com.zdxt.domain.auth.DictData;
//import org.apache.http.HttpEntity;
//import org.apache.http.client.methods.CloseableHttpResponse;
//import org.apache.http.client.methods.HttpPost;
//import org.apache.http.entity.StringEntity;
//import org.apache.http.impl.client.CloseableHttpClient;
//import org.apache.http.impl.client.HttpClientBuilder;
//import org.apache.http.util.EntityUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//import java.nio.charset.StandardCharsets;
//import java.security.MessageDigest;
//import java.util.*;
//import java.util.stream.Collectors;
//
//
///**
// * @Author: kylin
// * @Date: 2024/5/9 2:58 下午
// * @Version: 1.0
// * @Desc: TODO
// */
//@Component("synUserInfoTask")
//public class SynUserInfoTask_bak {
//
// @Value("${srnwg.systemCode}")
// private String systemCode;
// @Value("${srnwg.integrationKey}")
// private String integrationKey;
// @Value("${srnwg.url}")
// private String znwgUrl;
// @Value("${srnwg.paasId}")
// private String paasId;
// @Value("${srnwg.paasToken}")
// private String paasToken;
//
// @Autowired private UserApi userApi;
// @Autowired private IUserService userService;
// @Autowired private IDeptService deptService;
// @Autowired
// private IDictDataService iDictDataService;
//
// public static Map<String,String> params = new HashMap<>();
//
// private static final Logger log = LoggerFactory.getLogger(SynUserInfoTask_bak.class);
//
//
// public void run(){
// this.userInfo();
// }
//
// /** 同步用户数据 */
// public void userInfo(){
// List<DictData> srz_item = iDictDataService.selectDictDataByType("srz_item");
// Map<String,String> map = srz_item.stream().collect(Collectors.toMap(DictData::getDictLabel,DictData::getDictValue));
//
// if(MapUtil.isNotEmpty(map)){
// params = map;
// }
// String token = "";
// String destroyTken = "";
// try {
// // 获取 access_token
// String tokenJson = connect("/ebus/sfrzhqxglmk/sysPullLogin?systemCode="+systemCode+"&integrationKey="+integrationKey);
// JSONObject tokenObj = JSONObject.parseObject(tokenJson);
// log.info("====================== access_token ======================");
// log.info("获取市认证令牌:{}",tokenObj);
// System.out.println("====================== access_token ======================");
// token = tokenObj.getString("data");
//
// // 获取 用户信息
// int page = 0;
// int pageSize = 500;
// List<Map<String, Integer>> sumMap = new ArrayList<>();
// while (true) {
// String userInfoJson = connect("/ebus/sfrzhqxglmk/sysPullTacc?token="+token+"&page="+page+"&pageSize="+pageSize+"&status=0");
// JSONObject sourceObj = JSONObject.parseObject(userInfoJson);
// JSONObject tmpJsonObj = sourceObj.getJSONObject("data");
// if(null==tmpJsonObj) {
// log.info("=====================> tmpJsonObj 为空");
// break;
// }
// JSONArray dataArr = tmpJsonObj.getJSONArray("data");
// log.info("市认证过来的用户信息---> : {}", tmpJsonObj);
// if (null == dataArr || dataArr.size()==0) { break; }
// Map<String, Integer> resMap = userService.addSrzUser(dataArr, token);
// sumMap.add(resMap);
// page++;
// }
//
// int insertNum = 0;
// int updateNum = 0;
// for (Map<String, Integer> item : sumMap) {
// insertNum += item.get("insertNum");
// updateNum += item.get("updateNum");
// }
// log.info("新增用户数量 : {} / 更新用户数量 : {}", insertNum, updateNum);
//
// // 注销token
// destroyTken = connect("/ebus/sfrzhqxglmk/sysPullLogout?token="+token);
// System.out.println("====================== destroyTken ======================");
// System.out.println(destroyTken);
// System.out.println("====================== destroyTken ======================");
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//
// private String connect(String apiPath) {
// //各种参数
//
// try {
//// String params = "{\"uid\":\"5b07b3de672c4e999c4b04f4\"}"; //请求接⼝的参数
// String params = ""; //请求接⼝的参数
//
// long now = new Date().getTime();
// String timestamp = Long.toString((long) Math.floor(now / 1000));
// String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
// String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//
//
// //创建CloseableHttpClient
// CloseableHttpClient client = HttpClientBuilder.create().build();
// HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
// httpPost.setHeader("x-tif-paasid", paasId);
// httpPost.setHeader("x-tif-timestamp", timestamp);
// httpPost.setHeader("x-tif-signature", signature);
// httpPost.setHeader("x-tif-nonce", nonce);
// httpPost.setHeader("Content-Type", "application/json");
// httpPost.setHeader("Cache-Control", "no-cache");
// HttpEntity entity = new StringEntity(params);
//
//
// httpPost.setEntity(entity);
//
// CloseableHttpResponse response = client.execute(httpPost);
//
// return EntityUtils.toString(response.getEntity());
// } catch (Exception e) {
// e.printStackTrace();
// }
// return null;
// }
//
// private String toSHA256(String str) throws Exception {
// MessageDigest messageDigest;
// String encodeStr = "";
// try {
// messageDigest = MessageDigest.getInstance("SHA-256");
// messageDigest.update(str.getBytes(StandardCharsets.UTF_8));
// encodeStr = byte2Hex(messageDigest.digest());
// } catch (Exception e) {
// throw e;
// }
// return encodeStr;
// }
//
// // byte转换成16进制
// private String byte2Hex(byte[] bytes) {
// StringBuffer stringBuffer = new StringBuffer();
// String temp = null;
// for (int i = 0; i < bytes.length; i++) {
// temp = Integer.toHexString(bytes[i] & 0xFF);
// if (temp.length() == 1) {
// stringBuffer.append("0");
// }
// stringBuffer.append(temp);
// }
// return stringBuffer.toString();
// }
//}

4
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/user/service/UserServiceImpl.java

@ -347,7 +347,7 @@ public class UserServiceImpl implements IUserService {
@Transactional
public int updateUser(User user) {
Long userId = user.getUserId();
user.setUpdateBy(ShiroUtils.getLoginName());
// user.setUpdateBy(ShiroUtils.getLoginName());
// 删除用户与角色关联
userRoleMapper.deleteUserRoleByUserId(userId);
// 新增用户与角色管理
@ -358,7 +358,7 @@ public class UserServiceImpl implements IUserService {
insertUserPost(user);
int resCount = userMapper.updateUser(user);
return userMapper.updateUser(user);
return resCount;
}
/**

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml

@ -243,7 +243,7 @@
AND (
(u.law_certificate_num is not null AND u.law_certificate_num !="")
or (d.`zone` = 5 or d.`zone` = 15)
or (d.`zone` = 6 or d.`zone` = 16)
or (d.parent_id in (select dept_id from sys_dept where `zone` = 5 or `zone` = 15))
)
</if>
and u.dept_id != 405

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzDept.java

@ -131,6 +131,8 @@ public class SrzDept extends BaseDomain
*/
private String description;
private int needUpdate;
public String getDescription() {
return description;
}
@ -481,4 +483,12 @@ public class SrzDept extends BaseDomain
{
return creditcode;
}
public int getNeedUpdate() {
return needUpdate;
}
public void setNeedUpdate(int needUpdate) {
this.needUpdate = needUpdate;
}
}

538
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SrzUser.java

@ -0,0 +1,538 @@
package com.zdxt.code.domain;
/**
* 市认证对接---组织机构信息对象 srz_dept
*
* @author ruoyi
* @date 2025-08-06
*/
public class SrzUser
{
private static final long serialVersionUID = 1L;
private String ryztCode;
private String mobileNumber;
private String zcgzld;
private String gldw;
private String updateAt;
private String zwjcCode;
private String effectOn;
private String zwjc;
private String organizationId;
private String province;
private String isDisabled;
private String certificateTypeIdCode;
private String jrfs;
private String spareNumber;
private String positionname;
private String pylxcode;
private String jbcc;
private String contractEndTime;
private String sequence;
private String genderCode;
private String zwwxMobile;
private String district;
private String guid;
private String certificateTypeId;
private String contractStartTime;
private String rylydw;
private String telephoneNumber;
private String gender;
private String city;
private String jbccCode;
private String rylb;
private String hometownCode;
private String units;
private String srzUserid;
private String createAt;
private String engName;
private String isDeleted;
private String jrfscode;
private String email;
private String zwbsCode;
private String dwzyld;
private String pylx;
private String systemId;
private String rylbCode;
private String hometown;
private String photo;
private String glzrr;
private String userId;
private String zwwxId;
private String ryzt;
private String certificateNumber;
private String zwbs;
private String faxNumber;
private String fullname;
private String isMappingPerson;
private String taskId;
private String username;
private int needUpdate;
public String getRyztCode() {
return ryztCode;
}
public void setRyztCode(String ryztCode) {
this.ryztCode = ryztCode;
}
public String getMobileNumber() {
return mobileNumber;
}
public void setMobileNumber(String mobileNumber) {
this.mobileNumber = mobileNumber;
}
public String getZcgzld() {
return zcgzld;
}
public void setZcgzld(String zcgzld) {
this.zcgzld = zcgzld;
}
public String getGldw() {
return gldw;
}
public void setGldw(String gldw) {
this.gldw = gldw;
}
public String getUpdateAt() {
return updateAt;
}
public void setUpdateAt(String updateAt) {
this.updateAt = updateAt;
}
public String getZwjcCode() {
return zwjcCode;
}
public void setZwjcCode(String zwjcCode) {
this.zwjcCode = zwjcCode;
}
public String getEffectOn() {
return effectOn;
}
public void setEffectOn(String effectOn) {
this.effectOn = effectOn;
}
public String getZwjc() {
return zwjc;
}
public void setZwjc(String zwjc) {
this.zwjc = zwjc;
}
public String getOrganizationId() {
return organizationId;
}
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getIsDisabled() {
return isDisabled;
}
public void setIsDisabled(String isDisabled) {
this.isDisabled = isDisabled;
}
public String getCertificateTypeIdCode() {
return certificateTypeIdCode;
}
public void setCertificateTypeIdCode(String certificateTypeIdCode) {
this.certificateTypeIdCode = certificateTypeIdCode;
}
public String getJrfs() {
return jrfs;
}
public void setJrfs(String jrfs) {
this.jrfs = jrfs;
}
public String getSpareNumber() {
return spareNumber;
}
public void setSpareNumber(String spareNumber) {
this.spareNumber = spareNumber;
}
public String getPositionname() {
return positionname;
}
public void setPositionname(String positionname) {
this.positionname = positionname;
}
public String getPylxcode() {
return pylxcode;
}
public void setPylxcode(String pylxcode) {
this.pylxcode = pylxcode;
}
public String getJbcc() {
return jbcc;
}
public void setJbcc(String jbcc) {
this.jbcc = jbcc;
}
public String getContractEndTime() {
return contractEndTime;
}
public void setContractEndTime(String contractEndTime) {
this.contractEndTime = contractEndTime;
}
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
public String getGenderCode() {
return genderCode;
}
public void setGenderCode(String genderCode) {
this.genderCode = genderCode;
}
public String getZwwxMobile() {
return zwwxMobile;
}
public void setZwwxMobile(String zwwxMobile) {
this.zwwxMobile = zwwxMobile;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public String getCertificateTypeId() {
return certificateTypeId;
}
public void setCertificateTypeId(String certificateTypeId) {
this.certificateTypeId = certificateTypeId;
}
public String getContractStartTime() {
return contractStartTime;
}
public void setContractStartTime(String contractStartTime) {
this.contractStartTime = contractStartTime;
}
public String getRylydw() {
return rylydw;
}
public void setRylydw(String rylydw) {
this.rylydw = rylydw;
}
public String getTelephoneNumber() {
return telephoneNumber;
}
public void setTelephoneNumber(String telephoneNumber) {
this.telephoneNumber = telephoneNumber;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getJbccCode() {
return jbccCode;
}
public void setJbccCode(String jbccCode) {
this.jbccCode = jbccCode;
}
public String getRylb() {
return rylb;
}
public void setRylb(String rylb) {
this.rylb = rylb;
}
public String getHometownCode() {
return hometownCode;
}
public void setHometownCode(String hometownCode) {
this.hometownCode = hometownCode;
}
public String getUnits() {
return units;
}
public void setUnits(String units) {
this.units = units;
}
public String getSrzUserid() {
return srzUserid;
}
public void setSrzUserid(String srzUserid) {
this.srzUserid = srzUserid;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public String getEngName() {
return engName;
}
public void setEngName(String engName) {
this.engName = engName;
}
public String getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(String isDeleted) {
this.isDeleted = isDeleted;
}
public String getJrfscode() {
return jrfscode;
}
public void setJrfscode(String jrfscode) {
this.jrfscode = jrfscode;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getZwbsCode() {
return zwbsCode;
}
public void setZwbsCode(String zwbsCode) {
this.zwbsCode = zwbsCode;
}
public String getDwzyld() {
return dwzyld;
}
public void setDwzyld(String dwzyld) {
this.dwzyld = dwzyld;
}
public String getPylx() {
return pylx;
}
public void setPylx(String pylx) {
this.pylx = pylx;
}
public String getSystemId() {
return systemId;
}
public void setSystemId(String systemId) {
this.systemId = systemId;
}
public String getRylbCode() {
return rylbCode;
}
public void setRylbCode(String rylbCode) {
this.rylbCode = rylbCode;
}
public String getHometown() {
return hometown;
}
public void setHometown(String hometown) {
this.hometown = hometown;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public String getGlzrr() {
return glzrr;
}
public void setGlzrr(String glzrr) {
this.glzrr = glzrr;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getZwwxId() {
return zwwxId;
}
public void setZwwxId(String zwwxId) {
this.zwwxId = zwwxId;
}
public String getRyzt() {
return ryzt;
}
public void setRyzt(String ryzt) {
this.ryzt = ryzt;
}
public String getCertificateNumber() {
return certificateNumber;
}
public void setCertificateNumber(String certificateNumber) {
this.certificateNumber = certificateNumber;
}
public String getZwbs() {
return zwbs;
}
public void setZwbs(String zwbs) {
this.zwbs = zwbs;
}
public String getFaxNumber() {
return faxNumber;
}
public void setFaxNumber(String faxNumber) {
this.faxNumber = faxNumber;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getIsMappingPerson() {
return isMappingPerson;
}
public void setIsMappingPerson(String isMappingPerson) {
this.isMappingPerson = isMappingPerson;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getNeedUpdate() {
return needUpdate;
}
public void setNeedUpdate(int needUpdate) {
this.needUpdate = needUpdate;
}
}

25
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/SrzUserMapper.java

@ -0,0 +1,25 @@
package com.zdxt.code.mapper;
import com.zdxt.code.domain.SrzUser;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 市认证对接---组织机构信息Mapper接口
*
* @author ruoyi
* @date 2025-08-06
*/
@Repository
public interface SrzUserMapper
{
public int insertUser(SrzUser srzUser);
public int updateUser(SrzUser srzUser);
public SrzUser selectUserByPrimaryKey(String userId);
public List<SrzUser> selectUserByNeedUpdate();
}

39
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/ISrzUserService.java

@ -0,0 +1,39 @@
package com.zdxt.code.service;
import com.alibaba.fastjson.JSONArray;
import com.zdxt.code.domain.SrzUser;
import java.util.List;
import java.util.Map;
/**
* 市认证对接---组织机构信息Service接口
*
* @author ruoyi
* @date 2025-08-06
*/
public interface ISrzUserService
{
/**
* 新增市认证对接---组织机构信息
*
* @param srzUser 市认证对接---组织机构信息
* @return 结果
*/
public int insertSrzUser(SrzUser srzUser);
/**
* 修改市认证对接---组织机构信息
*
* @param srzUser 市认证对接---组织机构信息
* @return 结果
*/
public int updateSrzUser(SrzUser srzUser);
public Map<String, Integer> saveSrzUser(JSONArray dataArr, String token);
public List<SrzUser> selectUserByNeedUpdate();
}

4
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/NonEnforcementRegistrationServiceImpl.java

@ -170,9 +170,9 @@ public class NonEnforcementRegistrationServiceImpl implements INonEnforcementReg
if(StringUtils.isNotEmpty(li.getLawEnforcerOther())){
li.setLawEnforcer(li.getLawEnforcer()+","+li.getLawEnforcerOther());
}
DictData area=areaList.stream().filter(a->li.getEnterpriseAddress().contains(a.getDictLabel())).findFirst().get();
DictData area=areaList.stream().filter(a->li.getEnterpriseAddress().contains(a.getDictLabel())).findFirst().orElse(null);
li.setArea(area!=null?area.getDictLabel():"");
DictData street=streetList.stream().filter(s->li.getEnterpriseAddress().contains(s.getDictLabel())).findFirst().get();
DictData street=streetList.stream().filter(s->li.getEnterpriseAddress().contains(s.getDictLabel())).findFirst().orElse(null);
li.setStreet(street!=null?street.getDictLabel():"");
});
return list;

1
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzDeptServiceImpl.java

@ -91,6 +91,7 @@ public class SrzDeptServiceImpl implements ISrzDeptService
if(srzDept==null)continue;
SrzDept temp = srzDeptMapper.selectSrzDeptById(srzDept.getOrganizationId());
srzDept.setNeedUpdate(0);
if (null != temp && temp.getOrganizationId() != null) {
// 跟新数据库
int rowNum = srzDeptMapper.updateSrzDept(srzDept);

175
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/SrzUserServiceImpl.java

@ -0,0 +1,175 @@
package com.zdxt.code.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.common.utils.StringUtils;
import com.zdxt.code.domain.SrzDept;
import com.zdxt.code.domain.SrzUser;
import com.zdxt.code.mapper.SrzUserMapper;
import com.zdxt.code.service.ISrzUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.security.MessageDigest;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 市认证对接---组织机构信息Service业务层处理
*
* @author ruoyi
* @date 2025-08-06
*/
@Service
@Slf4j
public class SrzUserServiceImpl implements ISrzUserService
{
@Autowired
private SrzUserMapper srzUserMapper;
@Value("${srnwg.url}")
private String znwgUrl;
@Value("${srnwg.paasId}")
private String paasId;
@Value("${srnwg.paasToken}")
private String paasToken;
/**
* 新增市认证对接---组织机构信息
*
* @param srzUser 市认证对接---组织机构信息
* @return 结果
*/
@Override
public int insertSrzUser(SrzUser srzUser)
{
return srzUserMapper.insertUser(srzUser);
}
/**
* 修改市认证对接---组织机构信息
*
* @param srzUser 市认证对接---组织机构信息
* @return 结果
*/
@Override
public int updateSrzUser(SrzUser srzUser)
{
return srzUserMapper.updateUser(srzUser);
}
@Override
public Map<String, Integer> saveSrzUser(JSONArray dataArr, String token) {
int insertNum = 0;
int updateNum = 0;
for (int i = 0; i < dataArr.size(); i++) {
JSONObject jsonObject = dataArr.getJSONObject(i);
if (StringUtils.isEmpty(jsonObject.getString("userId"))) { continue; }
try {
// 返回每条拉取的成功情况
String taskId = jsonObject.getString("taskId");
String params = "{\"token\":\"" + token + "\",\"data\":[{\"taskId\":\"" + taskId + "\",\"result\":\"SUCCESS\"}]}";
String doneStr = connect("/ebus/sfrzhqxglmk/sysDoneTacc", params);
JSONObject doneObj = JSONObject.parseObject(doneStr);
String done = doneObj.getString("success");
log.info("用户拉取完成结果 ========> :{}", done);
} catch (Exception e) {
log.info("用户数据下拉完成异常,异常任务id:{}", jsonObject.getString("taskId"));
e.printStackTrace();
}
SrzUser srzUser=JSONObject.parseObject(jsonObject.toString(),SrzUser.class);
if(srzUser==null)continue;
SrzUser temp = srzUserMapper.selectUserByPrimaryKey(srzUser.getUserId());
srzUser.setNeedUpdate(0);
if (null != temp && temp.getOrganizationId() != null) {
// 跟新数据库
int rowNum = srzUserMapper.updateUser(srzUser);
updateNum += rowNum;
} else {
// 插入数据库
int rowNum = srzUserMapper.insertUser(srzUser);
insertNum += rowNum;
}
}
Map<String, Integer> resMap = new HashedMap();
resMap.put("insertNum", insertNum);
resMap.put("updateNum", updateNum);
return resMap;
}
public List<SrzUser> selectUserByNeedUpdate() {
return srzUserMapper.selectUserByNeedUpdate();
}
private String connect(String apiPath, String params) {
//各种参数
try {
long now = new Date().getTime();
String timestamp = Long.toString((long) Math.floor(now / 1000));
String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//创建CloseableHttpClient
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
httpPost.setHeader("x-tif-paasid", paasId);
httpPost.setHeader("x-tif-timestamp", timestamp);
httpPost.setHeader("x-tif-signature", signature);
httpPost.setHeader("x-tif-nonce", nonce);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Cache-Control", "no-cache");
HttpEntity entity = new StringEntity(params);
httpPost.setEntity(entity);
CloseableHttpResponse response = client.execute(httpPost);
return EntityUtils.toString(response.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private String toSHA256(String str) throws Exception {
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("UTF-8"));
encodeStr = byte2Hex(messageDigest.digest());
} catch (Exception e) {
throw e;
}
return encodeStr;
}
// byte转换成16进制
private String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

12
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/ThirdLoginServiceImpl.java

@ -202,15 +202,9 @@ public class ThirdLoginServiceImpl implements ThirdLoginService {
user.setLawOfficer(false);
}
}
// 如果没有执法证件号, 则再次判断是否为消防
if (!user.getLawOfficer()) {
// 根据执法部门判断如果是公安, 则为执法人员权限 true
DeptBean bureauDept = deptApi.iterationDeptParentToBureauGA(user_source.getDeptId());
if (null != bureauDept && (6 == bureauDept.getZone() || 16 == bureauDept.getZone())) {
user.setLawOfficer(true);
} else {
user.setLawOfficer(false);
}
// 如果没有执法证件号, 则再次判断自己的sys_user表这个用户是否有执法证件号
if (StringUtils.isNotEmpty(user.getLawCertificateNum())) {
user.setLawOfficer(true);
}
Map<String,Object> payload = new HashMap<>();
payload.put("id", user.getUserId());

181
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/task/SrzUserOriginalDataTask.java

@ -0,0 +1,181 @@
package com.zdxt.code.task;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zdxt.auth.project.system.dict.service.IDictDataService;
import com.zdxt.code.service.ISrzUserService;
import com.zdxt.domain.auth.DictData;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.security.MessageDigest;
import java.util.*;
import java.util.stream.Collectors;
/**
* 市认证组织信息表原始数据对接
*/
@Component("srzUserOriginalDataTask")
public class SrzUserOriginalDataTask {
@Value("${srnwg.systemCode}")
private String systemCode;
@Value("${srnwg.integrationKey}")
private String integrationKey;
@Value("${srnwg.url}")
private String znwgUrl;
@Value("${srnwg.paasId}")
private String paasId;
@Value("${srnwg.paasToken}")
private String paasToken;
@Autowired private ISrzUserService srzUserService;
@Autowired
private IDictDataService iDictDataService;
public static Map<String,String> params = new HashMap<>();
private static final Logger log = LoggerFactory.getLogger(SrzUserOriginalDataTask.class);
public void run(){
this.getData();
}
/** 同步部门数据 */
public void getData(){
List<DictData> srz_item = iDictDataService.selectDictDataByType("srz_item");
Map<String,String> map = srz_item.stream().collect(Collectors.toMap(DictData::getDictLabel,DictData::getDictValue));
if(MapUtil.isNotEmpty(map)){
params = map;
}
String token = "";
String destroyTken = "";
try {
// 获取 access_token
String tokenJson = connect("/ebus/sfrzhqxglmk/sysPullLogin?systemCode="+systemCode+"&integrationKey="+integrationKey);
JSONObject tokenObj = JSONObject.parseObject(tokenJson);
log.info("====================== access_token ======================");
log.info("获取市认证令牌:{}",tokenObj);
System.out.println("====================== access_token ======================");
token = tokenObj.getString("data");
// 获取 用户信息
int page = 0;
int pageSize = 500;
List<Map<String, Integer>> sumMap = new ArrayList<>();
int insertNum = 0;
int updateNum = 0;
page = 0;
while (true) {
String userInfoJson = connect("/ebus/sfrzhqxglmk/sysPullTacc?token="+token+"&page="+page+"&pageSize="+pageSize+"&status=0");
JSONObject sourceObj = JSONObject.parseObject(userInfoJson);
JSONObject tmpJsonObj = sourceObj.getJSONObject("data");
if(null==tmpJsonObj) {
log.info("=====================> tmpJsonObj 为空");
break;
}
JSONArray dataArr = tmpJsonObj.getJSONArray("data");
log.info("市认证过来的用户数量---> : {}", tmpJsonObj.get("'total'"));
if (null == dataArr || dataArr.size()==0) { break; }
Map<String, Integer> resMap = srzUserService.saveSrzUser(dataArr, token);
sumMap.add(resMap);
page++;
}
insertNum = 0;
updateNum = 0;
for (Map<String, Integer> item : sumMap) {
insertNum += item.get("insertNum");
updateNum += item.get("updateNum");
}
log.info("新增用户数量 : {} / 更新用户数量 : {}", insertNum, updateNum);
// 注销token
destroyTken = connect("/ebus/sfrzhqxglmk/sysPullLogout?token="+token);
System.out.println("====================== destroyTken ======================");
System.out.println(destroyTken);
System.out.println("====================== destroyTken ======================");
} catch (Exception e) {
e.printStackTrace();
}
}
private String connect(String apiPath) {
//各种参数
try {
String params = ""; //请求接⼝的参数
long now = new Date().getTime();
String timestamp = Long.toString((long) Math.floor(now / 1000));
String nonce = Long.toHexString(now) + "-" + Long.toHexString((long) Math.floor(Math.random() * 0xFFFFFF));
String signature = toSHA256(timestamp + paasToken + nonce + timestamp);
//创建CloseableHttpClient
CloseableHttpClient client = HttpClientBuilder.create().build();
HttpPost httpPost = new HttpPost(znwgUrl + apiPath);
httpPost.setHeader("x-tif-paasid", paasId);
httpPost.setHeader("x-tif-timestamp", timestamp);
httpPost.setHeader("x-tif-signature", signature);
httpPost.setHeader("x-tif-nonce", nonce);
httpPost.setHeader("Content-Type", "application/json");
httpPost.setHeader("Cache-Control", "no-cache");
HttpEntity entity = new StringEntity(params);
httpPost.setEntity(entity);
CloseableHttpResponse response = client.execute(httpPost);
return EntityUtils.toString(response.getEntity());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private String toSHA256(String str) throws Exception {
MessageDigest messageDigest;
String encodeStr = "";
try {
messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(str.getBytes("UTF-8"));
encodeStr = byte2Hex(messageDigest.digest());
} catch (Exception e) {
throw e;
}
return encodeStr;
}
// byte转换成16进制
private String byte2Hex(byte[] bytes) {
StringBuffer stringBuffer = new StringBuffer();
String temp = null;
for (int i = 0; i < bytes.length; i++) {
temp = Integer.toHexString(bytes[i] & 0xFF);
if (temp.length() == 1) {
stringBuffer.append("0");
}
stringBuffer.append(temp);
}
return stringBuffer.toString();
}
}

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -659,7 +659,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
${params.dataScope}
</if>
</where>
GROUP BY IFNULL(unite_check, RAND())
GROUP BY IFNULL(union_no, RAND())
order by enforcement_time desc
</select>

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzDeptMapper.xml

@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitLevelCode != null and unitLevelCode != ''"> and unitLevelCode = #{unitLevelCode}</if>
<if test="unitLevel != null and unitLevel != ''"> and unitLevel = #{unitLevel}</if>
<if test="creditcode != null and creditcode != ''"> and creditcode = #{creditcode}</if>
<if test="needUpdate != null and needUpdate != ''"> and need_update = #{needUpdate}</if>
</where>
</select>
@ -231,6 +232,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unitLevel != null and unitLevel != ''">unitLevel = #{unitLevel},</if>
<if test="creditcode != null and creditcode != ''">creditcode = #{creditcode},</if>
<if test="description != null and description != ''">description=#{description},</if>
<if test="needUpdate != null and needUpdate != ''">need_update=#{needUpdate},</if>
</trim>
where organizationId = #{organizationId}
</update>

281
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/SrzUserMapper.xml

@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zdxt.code.mapper.SrzUserMapper">
<resultMap id="BaseResultMap" type="com.zdxt.code.domain.SrzUser">
<id column="guid" property="guid"/>
<result column="ryztCode" property="ryztCode"/>
<result column="mobileNumber" property="mobileNumber"/>
<result column="zcgzld" property="zcgzld"/>
<result column="gldw" property="gldw"/>
<result column="updateAt" property="updateAt"/>
<result column="zwjcCode" property="zwjcCode"/>
<result column="effectOn" property="effectOn"/>
<result column="zwjc" property="zwjc"/>
<result column="organizationId" property="organizationId"/>
<result column="province" property="province"/>
<result column="isDisabled" property="isDisabled"/>
<result column="certificateTypeIdCode" property="certificateTypeIdCode"/>
<result column="jrfs" property="jrfs"/>
<result column="spareNumber" property="spareNumber"/>
<result column="positionname" property="positionname"/>
<result column="pylxcode" property="pylxcode"/>
<result column="jbcc" property="jbcc"/>
<result column="contractEndTime" property="contractEndTime"/>
<result column="sequence" property="sequence"/>
<result column="genderCode" property="genderCode"/>
<result column="zwwxMobile" property="zwwxMobile"/>
<result column="district" property="district"/>
<result column="certificateTypeId" property="certificateTypeId"/>
<result column="contractStartTime" property="contractStartTime"/>
<result column="rylydw" property="rylydw"/>
<result column="telephoneNumber" property="telephoneNumber"/>
<result column="gender" property="gender"/>
<result column="city" property="city"/>
<result column="jbccCode" property="jbccCode"/>
<result column="rylb" property="rylb"/>
<result column="hometownCode" property="hometownCode"/>
<result column="units" property="units"/>
<result column="srzUserid" property="srzUserid"/>
<result column="createAt" property="createAt"/>
<result column="engName" property="engName"/>
<result column="isDeleted" property="isDeleted"/>
<result column="jrfscode" property="jrfscode"/>
<result column="email" property="email"/>
<result column="zwbsCode" property="zwbsCode"/>
<result column="dwzyld" property="dwzyld"/>
<result column="pylx" property="pylx"/>
<result column="systemId" property="systemId"/>
<result column="rylbCode" property="rylbCode"/>
<result column="hometown" property="hometown"/>
<result column="photo" property="photo"/>
<result column="glzrr" property="glzrr"/>
<result column="userId" property="userId"/>
<result column="zwwxId" property="zwwxId"/>
<result column="ryzt" property="ryzt"/>
<result column="certificateNumber" property="certificateNumber"/>
<result column="zwbs" property="zwbs"/>
<result column="faxNumber" property="faxNumber"/>
<result column="fullname" property="fullname"/>
<result column="isMappingPerson" property="isMappingPerson"/>
<result column="taskId" property="taskId"/>
<result column="username" property="username"/>
<result column="need_update" property="needUpdate"/>
</resultMap>
<sql id="Base_Column_List">
guid, ryztCode, mobileNumber, zcgzld, gldw, updateAt, zwjcCode, effectOn, zwjc,
organizationId, province, isDisabled, certificateTypeIdCode, jrfs, spareNumber, positionname, pylxcode, jbcc,
contractEndTime, sequence, genderCode, zwwxMobile, district, certificateTypeId, contractStartTime, rylydw, telephoneNumber,
gender, city, jbccCode, rylb, hometownCode, units, srzUserid, createAt, engName,
isDeleted, jrfscode, email, zwbsCode, dwzyld, pylx, systemId, rylbCode, hometown,
photo, glzrr, userId, zwwxId, ryzt, certificateNumber, zwbs, faxNumber, fullname,
isMappingPerson, taskId, username, need_update
</sql>
<!-- 安全动态插入:只更新非空字段 -->
<insert id="insertUser" parameterType="com.zdxt.code.domain.SrzUser">
INSERT INTO srz_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="guid != null and guid != ''">guid,</if>
<if test="ryztCode != null and ryztCode != ''">ryztCode,</if>
<if test="mobileNumber != null and mobileNumber != ''">mobileNumber,</if>
<if test="zcgzld != null and zcgzld != ''">zcgzld,</if>
<if test="gldw != null and gldw != ''">gldw,</if>
<if test="updateAt != null and updateAt != ''">updateAt,</if>
<if test="zwjcCode != null and zwjcCode != ''">zwjcCode,</if>
<if test="effectOn != null and effectOn != ''">effectOn,</if>
<if test="zwjc != null and zwjc != ''">zwjc,</if>
<if test="organizationId != null and organizationId != ''">organizationId,</if>
<if test="province != null and province != ''">province,</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled,</if>
<if test="certificateTypeIdCode != null and certificateTypeIdCode != ''">certificateTypeIdCode,</if>
<if test="jrfs != null and jrfs != ''">jrfs,</if>
<if test="spareNumber != null and spareNumber != ''">spareNumber,</if>
<if test="positionname != null and positionname != ''">positionname,</if>
<if test="pylxcode != null and pylxcode != ''">pylxcode,</if>
<if test="jbcc != null and jbcc != ''">jbcc,</if>
<if test="contractEndTime != null and contractEndTime != ''">contractEndTime,</if>
<if test="sequence != null and sequence != ''">sequence,</if>
<if test="genderCode != null and genderCode != ''">genderCode,</if>
<if test="zwwxMobile != null and zwwxMobile != ''">zwwxMobile,</if>
<if test="district != null and district != ''">district,</if>
<if test="certificateTypeId != null and certificateTypeId != ''">certificateTypeId,</if>
<if test="contractStartTime != null and contractStartTime != ''">contractStartTime,</if>
<if test="rylydw != null and rylydw != ''">rylydw,</if>
<if test="telephoneNumber != null and telephoneNumber != ''">telephoneNumber,</if>
<if test="gender != null and gender != ''">gender,</if>
<if test="city != null and city != ''">city,</if>
<if test="jbccCode != null and jbccCode != ''">jbccCode,</if>
<if test="rylb != null and rylb != ''">rylb,</if>
<if test="hometownCode != null and hometownCode != ''">hometownCode,</if>
<if test="units != null and units != ''">units,</if>
<if test="srzUserid != null and srzUserid != ''">srzUserid,</if>
<if test="createAt != null and createAt != ''">createAt,</if>
<if test="engName != null and engName != ''">engName,</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted,</if>
<if test="jrfscode != null and jrfscode != ''">jrfscode,</if>
<if test="email != null and email != ''">email,</if>
<if test="zwbsCode != null and zwbsCode != ''">zwbsCode,</if>
<if test="dwzyld != null and dwzyld != ''">dwzyld,</if>
<if test="pylx != null and pylx != ''">pylx,</if>
<if test="systemId != null and systemId != ''">systemId,</if>
<if test="rylbCode != null and rylbCode != ''">rylbCode,</if>
<if test="hometown != null and hometown != ''">hometown,</if>
<if test="photo != null and photo != ''">photo,</if>
<if test="glzrr != null and glzrr != ''">glzrr,</if>
<if test="userId != null and userId != ''">userId,</if>
<if test="zwwxId != null and zwwxId != ''">zwwxId,</if>
<if test="ryzt != null and ryzt != ''">ryzt,</if>
<if test="certificateNumber != null and certificateNumber != ''">certificateNumber,</if>
<if test="zwbs != null and zwbs != ''">zwbs,</if>
<if test="faxNumber != null and faxNumber != ''">faxNumber,</if>
<if test="fullname != null and fullname != ''">fullname,</if>
<if test="isMappingPerson != null and isMappingPerson != ''">isMappingPerson,</if>
<if test="taskId != null and taskId != ''">taskId,</if>
<if test="username != null and username != ''">username,</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="guid != null and guid != ''">#{guid},</if>
<if test="ryztCode != null and ryztCode != ''">#{ryztCode},</if>
<if test="mobileNumber != null and mobileNumber != ''">#{mobileNumber},</if>
<if test="zcgzld != null and zcgzld != ''">#{zcgzld},</if>
<if test="gldw != null and gldw != ''">#{gldw},</if>
<if test="updateAt != null and updateAt != ''">#{updateAt},</if>
<if test="zwjcCode != null and zwjcCode != ''">#{zwjcCode},</if>
<if test="effectOn != null and effectOn != ''">#{effectOn},</if>
<if test="zwjc != null and zwjc != ''">#{zwjc},</if>
<if test="organizationId != null and organizationId != ''">#{organizationId},</if>
<if test="province != null and province != ''">#{province},</if>
<if test="isDisabled != null and isDisabled != ''">#{isDisabled},</if>
<if test="certificateTypeIdCode != null and certificateTypeIdCode != ''">#{certificateTypeIdCode},</if>
<if test="jrfs != null and jrfs != ''">#{jrfs},</if>
<if test="spareNumber != null and spareNumber != ''">#{spareNumber},</if>
<if test="positionname != null and positionname != ''">#{positionname},</if>
<if test="pylxcode != null and pylxcode != ''">#{pylxcode},</if>
<if test="jbcc != null and jbcc != ''">#{jbcc},</if>
<if test="contractEndTime != null and contractEndTime != ''">#{contractEndTime},</if>
<if test="sequence != null and sequence != ''">#{sequence},</if>
<if test="genderCode != null and genderCode != ''">#{genderCode},</if>
<if test="zwwxMobile != null and zwwxMobile != ''">#{zwwxMobile},</if>
<if test="district != null and district != ''">#{district},</if>
<if test="certificateTypeId != null and certificateTypeId != ''">#{certificateTypeId},</if>
<if test="contractStartTime != null and contractStartTime != ''">#{contractStartTime},</if>
<if test="rylydw != null and rylydw != ''">#{rylydw},</if>
<if test="telephoneNumber != null and telephoneNumber != ''">#{telephoneNumber},</if>
<if test="gender != null and gender != ''">#{gender},</if>
<if test="city != null and city != ''">#{city},</if>
<if test="jbccCode != null and jbccCode != ''">#{jbccCode},</if>
<if test="rylb != null and rylb != ''">#{rylb},</if>
<if test="hometownCode != null and hometownCode != ''">#{hometownCode},</if>
<if test="units != null and units != ''">#{units},</if>
<if test="srzUserid != null and srzUserid != ''">#{srzUserid},</if>
<if test="createAt != null and createAt != ''">#{createAt},</if>
<if test="engName != null and engName != ''">#{engName},</if>
<if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if>
<if test="jrfscode != null and jrfscode != ''">#{jrfscode},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="zwbsCode != null and zwbsCode != ''">#{zwbsCode},</if>
<if test="dwzyld != null and dwzyld != ''">#{dwzyld},</if>
<if test="pylx != null and pylx != ''">#{pylx},</if>
<if test="systemId != null and systemId != ''">#{systemId},</if>
<if test="rylbCode != null and rylbCode != ''">#{rylbCode},</if>
<if test="hometown != null and hometown != ''">#{hometown},</if>
<if test="photo != null and photo != ''">#{photo},</if>
<if test="glzrr != null and glzrr != ''">#{glzrr},</if>
<if test="userId != null and userId != ''">#{userId},</if>
<if test="zwwxId != null and zwwxId != ''">#{zwwxId},</if>
<if test="ryzt != null and ryzt != ''">#{ryzt},</if>
<if test="certificateNumber != null and certificateNumber != ''">#{certificateNumber},</if>
<if test="zwbs != null and zwbs != ''">#{zwbs},</if>
<if test="faxNumber != null and faxNumber != ''">#{faxNumber},</if>
<if test="fullname != null and fullname != ''">#{fullname},</if>
<if test="isMappingPerson != null and isMappingPerson != ''">#{isMappingPerson},</if>
<if test="taskId != null and taskId != ''">#{taskId},</if>
<if test="username != null and username != ''">#{username},</if>
</trim>
</insert>
<!-- 安全动态更新:只更新非空字段 -->
<update id="updateUser" parameterType="com.zdxt.code.domain.SrzUser">
UPDATE srz_user
<trim prefix="SET" suffixOverrides=",">
<if test="ryztCode != null and ryztCode != ''">ryztCode = #{ryztCode},</if>
<if test="mobileNumber != null and mobileNumber != ''">mobileNumber = #{mobileNumber},</if>
<if test="zcgzld != null and zcgzld != ''">zcgzld = #{zcgzld},</if>
<if test="gldw != null and gldw != ''">gldw = #{gldw},</if>
<if test="updateAt != null and updateAt != ''">updateAt = #{updateAt},</if>
<if test="zwjcCode != null and zwjcCode != ''">zwjcCode = #{zwjcCode},</if>
<if test="effectOn != null and effectOn != ''">effectOn = #{effectOn},</if>
<if test="zwjc != null and zwjc != ''">zwjc = #{zwjc},</if>
<if test="organizationId != null and organizationId != ''">organizationId = #{organizationId},</if>
<if test="province != null and province != ''">province = #{province},</if>
<if test="isDisabled != null and isDisabled != ''">isDisabled = #{isDisabled},</if>
<if test="certificateTypeIdCode != null and certificateTypeIdCode != ''">certificateTypeIdCode = #{certificateTypeIdCode},</if>
<if test="jrfs != null and jrfs != ''">jrfs = #{jrfs},</if>
<if test="spareNumber != null and spareNumber != ''">spareNumber = #{spareNumber},</if>
<if test="positionname != null and positionname != ''">positionname = #{positionname},</if>
<if test="pylxcode != null and pylxcode != ''">pylxcode = #{pylxcode},</if>
<if test="jbcc != null and jbcc != ''">jbcc = #{jbcc},</if>
<if test="contractEndTime != null and contractEndTime != ''">contractEndTime = #{contractEndTime},</if>
<if test="sequence != null and sequence != ''">sequence = #{sequence},</if>
<if test="genderCode != null and genderCode != ''">genderCode = #{genderCode},</if>
<if test="zwwxMobile != null and zwwxMobile != ''">zwwxMobile = #{zwwxMobile},</if>
<if test="district != null and district != ''">district = #{district},</if>
<if test="certificateTypeId != null and certificateTypeId != ''">certificateTypeId = #{certificateTypeId},</if>
<if test="contractStartTime != null and contractStartTime != ''">contractStartTime = #{contractStartTime},</if>
<if test="rylydw != null and rylydw != ''">rylydw = #{rylydw},</if>
<if test="telephoneNumber != null and telephoneNumber != ''">telephoneNumber = #{telephoneNumber},</if>
<if test="gender != null and gender != ''">gender = #{gender},</if>
<if test="city != null and city != ''">city = #{city},</if>
<if test="jbccCode != null and jbccCode != ''">jbccCode = #{jbccCode},</if>
<if test="rylb != null and rylb != ''">rylb = #{rylb},</if>
<if test="hometownCode != null and hometownCode != ''">hometownCode = #{hometownCode},</if>
<if test="units != null and units != ''">units = #{units},</if>
<if test="srzUserid != null and srzUserid != ''">srzUserid = #{srzUserid},</if>
<if test="createAt != null and createAt != ''">createAt = #{createAt},</if>
<if test="engName != null and engName != ''">engName = #{engName},</if>
<if test="isDeleted != null and isDeleted != ''">isDeleted = #{isDeleted},</if>
<if test="jrfscode != null and jrfscode != ''">jrfscode = #{jrfscode},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="zwbsCode != null and zwbsCode != ''">zwbsCode = #{zwbsCode},</if>
<if test="dwzyld != null and dwzyld != ''">dwzyld = #{dwzyld},</if>
<if test="pylx != null and pylx != ''">pylx = #{pylx},</if>
<if test="systemId != null and systemId != ''">systemId = #{systemId},</if>
<if test="rylbCode != null and rylbCode != ''">rylbCode = #{rylbCode},</if>
<if test="hometown != null and hometown != ''">hometown = #{hometown},</if>
<if test="photo != null and photo != ''">photo = #{photo},</if>
<if test="glzrr != null and glzrr != ''">glzrr = #{glzrr},</if>
<if test="userId != null and userId != ''">userId = #{userId},</if>
<if test="zwwxId != null and zwwxId != ''">zwwxId = #{zwwxId},</if>
<if test="ryzt != null and ryzt != ''">ryzt = #{ryzt},</if>
<if test="certificateNumber != null and certificateNumber != ''">certificateNumber = #{certificateNumber},</if>
<if test="zwbs != null and zwbs != ''">zwbs = #{zwbs},</if>
<if test="faxNumber != null and faxNumber != ''">faxNumber = #{faxNumber},</if>
<if test="fullname != null and fullname != ''">fullname = #{fullname},</if>
<if test="isMappingPerson != null and isMappingPerson != ''">isMappingPerson = #{isMappingPerson},</if>
<if test="taskId != null and taskId != ''">taskId = #{taskId},</if>
<if test="username != null and username != ''">username = #{username},</if>
<if test="needUpdate != null">need_update = #{needUpdate},</if>
</trim>
WHERE userId = #{userId}
</update>
<!-- 根据主键查询 -->
<select id="selectUserByPrimaryKey" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM srz_user
WHERE userId = #{userId}
</select>
<!-- 需要更新的数据查出前500条(need_update=0) -->
<select id="selectUserByNeedUpdate" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM srz_user
WHERE need_update = 0 limit 500
</select>
</mapper>
Loading…
Cancel
Save