Merge remote-tracking branch 'origin/pet' into pet

dev-9.10-修复中台bug-xuyifeng
huangyuxuan 2024-09-05 11:38:12 +08:00
commit 5897896094
4 changed files with 173 additions and 34 deletions

View File

@ -1034,7 +1034,7 @@ public class UsersController extends BaseController {
map.put("USER_ID",ID);
map.put("result", errInfo); //返回结果
map.put("code", "0");
map.put("syncInfo", JSONUtils.toJSONString(userinfo));
map.put("syncInfo", JSONUtil.toJsonStr(userinfo));
} else {
map.put("result", "您输入的身份证号和用户名二次校验失败,请确认后重新申请"); //返回结果
}
@ -1056,6 +1056,12 @@ public class UsersController extends BaseController {
pd = this.getPageData();
Map<String, String> returnMap = null;
if (pd.getString("ISPUSH").equals("1")) {
// ------联通人员定位删除人员用------
// 用于获取除UID ISDELETE外的其他信息
PageData detail = usersService.findById(pd);
pd.putAll(detail);
// -------------------------------
pd.put("ISDELETE","1");
HashMap<String, String> param = new HashMap<>();
Set set = pd.keySet();
@ -2589,4 +2595,115 @@ public class UsersController extends BaseController {
}
return returnMap;
}
static String CREATOR = null;
static String OPERATOR = null;
@RequestMapping(value = "/initCore")
@ResponseBody
public Object initCore() throws Exception {
PageData p1d = new PageData();
// pd = this.getPageData();
if (CREATOR == null) {
CREATOR = Jurisdiction.getUSER_ID();
OPERATOR = Jurisdiction.getUSER_ID();
}
List<PageData> pageData = usersService.listAllUser(p1d);
for (PageData pd : pageData) {
try {
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
pd.put("CREATOR", CREATOR); //创建人
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("OPERATOR", OPERATOR); //修改人
PageData sexPd = new PageData();
if (Tools.notEmpty(pd.getString("SEX"))) {
sexPd.put("DICTIONARIES_ID", pd.getString("SEX"));
PageData byId = dictionariesService.findById(sexPd);
if (Tools.notEmpty(byId)) {
pd.put("SEX", byId.getString("NAME"));
}
}
StringBuilder ORG_PATH = new StringBuilder();
boolean hasPid = true;
PageData department = departmentService.findById(pd);
if (department != null) {
ORG_PATH.insert(0, department.getString("NAME"));
String deptId = department.getString("PARENT_ID");
PageData deptPd = new PageData();
deptPd.put("DEPARTMENT_ID", deptId);
if (!"0".equals(department.get("PARENT_ID"))) {
while (hasPid) {
PageData dept = departmentService.findById(deptPd);
if ("0".equals(dept.get("PARENT_ID"))) {
hasPid = false;
} else {
deptId = dept.getString("PARENT_ID");
deptPd.put("DEPARTMENT_ID", deptId);
}
ORG_PATH.insert(0, dept.getString("NAME") + "/");
}
}
pd.put("ORG_PATH", ORG_PATH);
} else {
ORG_PATH.insert(0, "");
}
PageData CorpName = corpInfoService.findById(pd);
pd.put("CORPINFO_NAME", CorpName == null ? "" : CorpName.getString("CORP_NAME"));
pd.put("USER_TYPE", "1");
HashMap<String, Object> param = new HashMap<>();
Set set = pd.keySet();
for (Object key : set) {
param.put(key.toString(), pd.getString(key.toString()));
}
//要推送的照片集合
List<PageData> userPhotoDTOList = new ArrayList<>();
//人脸照片
PageData photoPd = new PageData();
photoPd.put("USER_PHOTO_ID", pd.getString("IMGFILES_ID"));
photoPd.put("USER_ID", pd.getString("FOREIGN_KEY"));
photoPd.put("PHOTO_URL", pd.getString("FILEPATH"));
photoPd.put("PHOTO_TYPE", "1");
photoPd.put("ISDELETE", "0");
userPhotoDTOList.add(photoPd);
param.put("userPhotoDTOList", userPhotoDTOList);
String userResult = HttpClientUtilDoGet.sendHttpGet(tongBuUrl + "/docking/core/user/getUserInfoById" + "?USER_ID=" + pd.getString("USER_ID"));
Map<String, Object> userReturnMap = (Map<String, Object>) JSON.parse(userResult);
if (userReturnMap.get("USERINFO") != null) { //有用户数据获取修改信息
PageData userInfoPd = JSON.parseObject(userReturnMap.get("USERINFO").toString(), PageData.class);
String updateDescription = UpdateEnum.getUpdateDescription(userInfoPd, pd);
param.put("REMARKS", updateDescription);
} else { //没有数据则获取新增信息
String insertDescription = UpdateEnum.getInsertDescription(pd);
param.put("REMARKS", insertDescription);
}
String UserDto = JSON.toJSONString(param);
String result = HttpClientUtilDoGet.sendHttpPost(tongBuUrl + "/docking/core/user/addOrUpdate", UserDto, null);
Map<String, String> returnMap = (Map<String, String>) JSON.parse(result);
if (returnMap.get("result").equals("success")) {
PageData pushPd = new PageData();
pushPd.put("ISPUSH", "1");
if (!Tools.isEmpty(pd.get("operateType")) && pd.getString("operateType").equals("delete")) {
pushPd.put("ISDELETE", "1");
} else {
pushPd.put("ISDELETE", "0");
}
pushPd.put("USER_ID", pd.getString("USER_ID"));
usersService.editPushStatus(pushPd);
}
}catch (Exception e){
}
}
return null;
}
}

View File

@ -27,6 +27,7 @@ import java.util.Map;
*/
@Aspect
@Component
@SuppressWarnings("all")
public class SyncDataAdviceAspect {
@Pointcut(value = "@annotation(com.zcloud.syncData.SyncPlatformAdvice)")

View File

@ -33,6 +33,7 @@ import java.util.Date;
topic = "${mq.consumer.dataChange.tongbu-data-change.topic}",
selectorType = SelectorType.TAG,
messageModel = MessageModel.BROADCASTING) // 添加广播模式
@SuppressWarnings("all")
public class SyncDataListener implements RocketMQListener<String> {
@Autowired
@ -102,10 +103,10 @@ public class SyncDataListener implements RocketMQListener<String> {
// 相关方推送
xgfUserService.edit4Mq(syncInfo);
}
PageData localData = usersService.findById(syncInfo);
if (localData != null && !localData.isEmpty()){
usersService.editUser(syncInfo);
}
// PageData localData = usersService.findById(syncInfo);
// if (localData != null && !localData.isEmpty()){
// usersService.editUser(syncInfo);
// }
// 2024.8.9 按郭跃鹏提出后期各公司从企业端分离后需要其他公司的用户进行SQL联查要求新增一张core_user的同步表用于记录中台的所有用户数据
PageData coreLocalData = coreSyncUserMapper.findById(syncInfo);
@ -134,9 +135,9 @@ public class SyncDataListener implements RocketMQListener<String> {
String str = tenCorpDto.getData().getString("syncInfo");
PageData syncInfo = JSONUtil.toBean(str, PageData.class);
PageData localData = departmentMapper.findById(syncInfo);
if (localData != null && !localData.isEmpty()){
departmentMapper.edit(syncInfo);
}
// if (localData != null && !localData.isEmpty()){
// departmentMapper.edit(syncInfo);
// }
PageData coreLocalData = coreSyncDeptMapper.findById(syncInfo);
try {
@ -161,9 +162,9 @@ public class SyncDataListener implements RocketMQListener<String> {
String str = tenCorpDto.getData().getString("syncInfo");
PageData syncInfo = JSONUtil.toBean(str, PageData.class);
PageData localData = corpinfoMapper.findById(syncInfo);
if (localData != null && !localData.isEmpty()){
corpinfoMapper.edit(syncInfo);
}
// if (localData != null && !localData.isEmpty()){
// corpinfoMapper.edit(syncInfo);
// }
PageData coreLocalData = coreSyncCorpMapper.findById(syncInfo);
try {

View File

@ -391,19 +391,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 修改 -->
<update id="editUser" parameterType="pd" >
update <include refid="tableName"></include>
set NAME = #{NAME},
DEPARTMENT_ID = #{DEPARTMENT_ID},
POST_ID =#{POST_ID},
ROLE_ID = #{ROLE_ID},
ROLE_IDS = #{ROLE_IDS},
BZ = #{BZ},
EMAIL = #{EMAIL},
NUMBER = #{NUMBER},
SORT = #{SORT},
PERSON_TYPE = #{PERSON_TYPE},
IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER},
IS_ONLINELEARNING = #{IS_ONLINELEARNING},
PHONE = #{PHONE}
set
<if test="NAME != null and NAME != ''">
NAME = #{NAME}
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''">
,DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="POST_ID != null and POST_ID != ''">
,POST_ID = #{POST_ID}
</if>
<if test="ROLE_ID != null and ROLE_ID != ''">
,ROLE_ID = #{ROLE_ID}
</if>
<if test="ROLE_IDS != null and ROLE_IDS != ''">
,ROLE_IDS = #{ROLE_IDS}
</if>
<if test="BZ != null and BZ != ''">
,BZ = #{BZ}
</if>
<if test="EMAIL != null and EMAIL != ''">
,EMAIL = #{EMAIL}
</if>
<if test="NUMBER != null and NUMBER != ''">
,NUMBER = #{NUMBER}
</if>
<if test="SORT != null">
,SORT = #{SORT}
</if>
<if test="PERSON_TYPE != null and PERSON_TYPE != ''">
,PERSON_TYPE = #{PERSON_TYPE}
</if>
<if test="IS_HAZARDCONFIRMER != null and IS_HAZARDCONFIRMER != ''">
,IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER}
</if>
<if test="IS_ONLINELEARNING != null and IS_ONLINELEARNING != ''">
,IS_ONLINELEARNING = #{IS_ONLINELEARNING}
</if>
<if test="PHONE != null and PHONE != ''">
,PHONE = #{PHONE}
</if>
<if test="ISPUSH != null and ISPUSH != ''">
,ISPUSH = #{ISPUSH}
</if>
@ -770,17 +797,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 用户列表(全部) -->
<select id="listAllUser" parameterType="pd" resultType="pd" >
select u.USER_ID,
u.USERNAME,
u.PASSWORD,
u.LAST_LOGIN,
u.NAME,
u.IP,
u.EMAIL,
u.NUMBER,
u.PHONE,
select u.*,
r.ROLE_ID,
u.DEPARTMENT_ID,
o.NAME as PID_NAME,
o.PARENT_ID,
d.NAME as DEPARTMENT_NAME,
@ -791,6 +810,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join OA_DEPARTMENT o ON o.DEPARTMENT_ID = d.PARENT_ID
where u.ROLE_ID = r.ROLE_ID
and u.USERNAME != 'admin' and u.ISDELETE = '0'
and (u.ISPUSH != '1' or u.ISPUSH is null)
<!-- and r.PARENT_ID = '1' -->
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and