|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.dgtly.common.utils.ShiroSaltUtil;
|
|
import com.dgtly.common.utils.ShiroSaltUtil;
|
|
|
|
|
+import com.dgtly.common.utils.StringUtils;
|
|
|
import com.dgtly.common.utils.http.HttpUtils;
|
|
import com.dgtly.common.utils.http.HttpUtils;
|
|
|
import com.dgtly.common.utils.security.EncryptPassWordClass;
|
|
import com.dgtly.common.utils.security.EncryptPassWordClass;
|
|
|
import com.dgtly.sync.domain.SyncFailDetail;
|
|
import com.dgtly.sync.domain.SyncFailDetail;
|
|
@@ -117,6 +118,9 @@ public class ShopUserTypeComponent {
|
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
calendar.set(Calendar.MILLISECOND, 0);
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
|
|
String runTime = sdf.format(calendar.getTime());
|
|
String runTime = sdf.format(calendar.getTime());
|
|
|
|
|
+ if (runTime.contains("2025-11-24")){
|
|
|
|
|
+ runTime = "2025-08-28T00:00";
|
|
|
|
|
+ }
|
|
|
stoneParams.put("datetime_start", runTime);
|
|
stoneParams.put("datetime_start", runTime);
|
|
|
}
|
|
}
|
|
|
//TUC仿石漆服务商人员-0
|
|
//TUC仿石漆服务商人员-0
|
|
@@ -203,6 +207,9 @@ public class ShopUserTypeComponent {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
|
|
Date date = sdf.parse(truncatedDate);
|
|
Date date = sdf.parse(truncatedDate);
|
|
|
String runTime = sdf.format(date);
|
|
String runTime = sdf.format(date);
|
|
|
|
|
+ if (runTime.contains("2025-11-24")){
|
|
|
|
|
+ runTime = "2025-08-28T00:00";
|
|
|
|
|
+ }
|
|
|
//获取上次同步时间进行增量同步
|
|
//获取上次同步时间进行增量同步
|
|
|
if(runTime !=null && !runTime.isEmpty()){
|
|
if(runTime !=null && !runTime.isEmpty()){
|
|
|
stoneParams.put("datetime_start", runTime);
|
|
stoneParams.put("datetime_start", runTime);
|
|
@@ -264,6 +271,8 @@ public class ShopUserTypeComponent {
|
|
|
Set<String> loginNameSet = sysUserService.selectAllUserLoginName();
|
|
Set<String> loginNameSet = sysUserService.selectAllUserLoginName();
|
|
|
loginNameSet = loginNameSet.stream().map(String::toUpperCase).collect(Collectors.toSet());
|
|
loginNameSet = loginNameSet.stream().map(String::toUpperCase).collect(Collectors.toSet());
|
|
|
try {
|
|
try {
|
|
|
|
|
+ log.info("原始报文为:{}", jo);
|
|
|
|
|
+ //本次调用是否走了删除方法
|
|
|
String userName = jo.getString("staff_name");
|
|
String userName = jo.getString("staff_name");
|
|
|
String userPhone = jo.getString("staff_mobile");
|
|
String userPhone = jo.getString("staff_mobile");
|
|
|
//是否同步企业微信
|
|
//是否同步企业微信
|
|
@@ -308,14 +317,17 @@ public class ShopUserTypeComponent {
|
|
|
}
|
|
}
|
|
|
//修改用户信息
|
|
//修改用户信息
|
|
|
sysUserMapper.updateUser(user);
|
|
sysUserMapper.updateUser(user);
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ //当登录的用户名为空时且未走原有删除逻辑开始调用新删除方法,结束当前循环
|
|
|
|
|
+ if (StringUtils.isEmpty(jo.getString("wecom_userid"))){
|
|
|
|
|
+ log.info("开始调用新删除方法");
|
|
|
|
|
+ deleteUserAndExt(dataUserId,shopCode,usertype,roleId);
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
if (!loginNameSet.contains(loginName.toUpperCase().trim())) {
|
|
if (!loginNameSet.contains(loginName.toUpperCase().trim())) {
|
|
|
|
|
|
|
|
/** =============用户基本信息构建 start===============*/
|
|
/** =============用户基本信息构建 start===============*/
|
|
@@ -423,6 +435,49 @@ public class ShopUserTypeComponent {
|
|
|
return headers;
|
|
return headers;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @description: 删除用户和角色相关数据
|
|
|
|
|
+ * @param: []
|
|
|
|
|
+ * @return: void
|
|
|
|
|
+ * @author: yousongbo
|
|
|
|
|
+ * @date: 2025/11/30 9:32
|
|
|
|
|
+ */
|
|
|
|
|
+ public void deleteUserAndExt(String dataUserId,String shopCode,String usertype,Long roleId) {
|
|
|
|
|
+ //用户无效后接口获取不到企微id,需从关联表查询
|
|
|
|
|
+
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dataUserId)) {
|
|
|
|
|
+ //用户无效后接口获取不到企微id,需从关联表查询
|
|
|
|
|
+ String loginName = userShopExtMapper.selectLoginNameByUserId(dataUserId, shopCode, usertype);
|
|
|
|
|
+ if (loginName != null && !loginName.isEmpty()) {
|
|
|
|
|
+ //查询用户信息
|
|
|
|
|
+ SysUser user = sysUserMapper.selectUserByLoginName(loginName);
|
|
|
|
|
+ int count = userShopExtMapper.delByDataUserId(dataUserId, shopCode);
|
|
|
|
|
+ log.info("删除门店用户扩展信息成功:" + count);
|
|
|
|
|
+ //去掉该用户和角色的关联关系
|
|
|
|
|
+ userRoleMapper.deleteUserRoleByUserIdAndExt(user.getUserId(), roleId, usertype);
|
|
|
|
|
+ //离职处理以及用户主信息是否有门店账号处理需要添加
|
|
|
|
|
+ //查询门店用户表是否存在用户和其他门店的关联关系,如果存在就不离职,不存在查询是否有经销商的关联关系,如果存在就不离职,不存在就离职
|
|
|
|
|
+ SysUserShopExt shop = new SysUserShopExt();
|
|
|
|
|
+ shop.setUserId(user.getUserId().toString());
|
|
|
|
|
+ shop.setDelFlag("0");
|
|
|
|
|
+ List<SysUserShopExt> shopExtList = userShopExtMapper.selectSysUserShopExtList(shop);
|
|
|
|
|
+ if (shopExtList == null || shopExtList.size() == 0) {
|
|
|
|
|
+ //在查用户经销商扩展信息
|
|
|
|
|
+ SysUserExt userCustomerExt = sysUserExtMapper.selectSysUserExtById(user.getUserId());
|
|
|
|
|
+ user.setIsShopAccount("0");
|
|
|
|
|
+ if (userCustomerExt == null) {
|
|
|
|
|
+ //离职处理2
|
|
|
|
|
+ user.setQuit("2");
|
|
|
|
|
+ }
|
|
|
|
|
+ //修改用户信息
|
|
|
|
|
+ sysUserMapper.updateUser(user);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @description: 新增用户和角色
|
|
* @description: 新增用户和角色
|
|
|
* @param: [user]
|
|
* @param: [user]
|