|
|
@@ -104,14 +104,16 @@ public class ShopUserTypeComponent {
|
|
|
stoneParams.put("page", 1);
|
|
|
stoneParams.put("page_size", 100);
|
|
|
String dateString = userShopExtMapper.searchRunTime();
|
|
|
- // 截取前3位毫秒数
|
|
|
- String truncatedDate = dateString.substring(0, dateString.lastIndexOf('.') + 4);
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
|
|
- Date date = sdf.parse(truncatedDate);
|
|
|
- String runTime = sdf.format(date);
|
|
|
- //获取上次同步时间进行增量同步
|
|
|
- if(runTime !=null && !runTime.isEmpty()){
|
|
|
- stoneParams.put("datetime_start", runTime);
|
|
|
+ if(dateString !=null){
|
|
|
+ // 截取前3位毫秒数
|
|
|
+ String truncatedDate = dateString.substring(0, dateString.lastIndexOf('.') + 4);
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
|
|
+ Date date = sdf.parse(truncatedDate);
|
|
|
+ String runTime = sdf.format(date);
|
|
|
+ //获取上次同步时间进行增量同步
|
|
|
+ if(runTime !=null && !runTime.isEmpty()){
|
|
|
+ stoneParams.put("datetime_start", runTime);
|
|
|
+ }
|
|
|
}
|
|
|
//TUC仿石漆服务商人员-0
|
|
|
Long roleId = roleMapper.selectRoleIdByRoleKey("shopStoneLikePaint");
|
|
|
@@ -238,6 +240,7 @@ public class ShopUserTypeComponent {
|
|
|
SysUser userVoExt = sysUserMapper.selectUserByLoginName(loginName);
|
|
|
// 新增用户与角色管理
|
|
|
user.setUserId(userVoExt.getUserId());
|
|
|
+ user.setShopType(usertype);
|
|
|
sysUserService.insertShopUserRole(user);
|
|
|
/**======== 构建门店用户扩展信息表 start===============*/
|
|
|
SysUserShopExt shopExt = new SysUserShopExt();
|
|
|
@@ -283,6 +286,13 @@ public class ShopUserTypeComponent {
|
|
|
//用户id
|
|
|
shopExt.setUserId(user.getUserId().toString());
|
|
|
userShopExtMapper.insertSysUserShopExt(shopExt);
|
|
|
+ //去掉该用户和角色的关联关系
|
|
|
+ userRoleMapper.deleteUserRoleByUserIdAndExt(user.getUserId(),roleId,usertype);
|
|
|
+ user.setRoleId(roleId);
|
|
|
+ user.setUserId(user.getUserId());
|
|
|
+ user.setShopType(usertype);
|
|
|
+ sysUserService.insertShopUserRole(user);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|