Browse Source

add: 同步用户信息;

master1
龚宝雄 6 months ago
parent
commit
ed831a4630
  1. 3
      nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java
  2. 13
      nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml
  3. 30
      nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

3
nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java

@ -34,4 +34,7 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
void insertDataPermission(@Param("dataPermission") UserDataPermissionDto dataPermission);
List<String> getUserIdByDeptId(String deptId);
void insertBatch( List<SysUser> userList);
}

13
nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml

@ -150,4 +150,17 @@
</if>
</where>
</select>
<insert id="insertBatch" keyProperty="userId" useGeneratedKeys="true">
insert into sys_user(username, person_name, gender, phone, email, avatar_name, avatar_path, password, is_admin,
is_used, pwd_reset_user_id, pwd_reset_time, create_id, create_name, create_time, update_id, update_name,
update_time, extperson_id, extuser_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.username}, #{entity.personName}, #{entity.gender}, #{entity.phone}, #{entity.email},
#{entity.avatarName}, #{entity.avatarPath}, #{entity.password}, #{entity.isAdmin}, #{entity.isUsed},
#{entity.pwdResetUserId}, #{entity.pwdResetTime}, #{entity.createId}, #{entity.createName},
#{entity.createTime}, #{entity.updateId}, #{entity.updateName}, #{entity.updateTime}, #{entity.extpersonId},
#{entity.extuserId})
</foreach>
</insert>
</mapper>

30
nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

@ -1,40 +1,22 @@
package org.nl.wms.schedule;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.CodeUtil;
import org.nl.common.websocket.SendHomeWebSocketServer;
import org.nl.config.IdUtil;
import org.nl.system.service.user.dao.SysUser;
import org.nl.system.service.user.dao.mapper.SysUserMapper;
import org.nl.wms.database.eas.dao.EasOutInBillDetail;
import org.nl.wms.database.eas.dao.HomeBillCounts;
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
import org.nl.wms.database.eas.dao.mapper.EasOutInBillMapper;
import org.nl.wms.database.eas.service.IeasOutInBillService;
import org.nl.wms.ext.eas.WmsToEasService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.stream.Collectors;
@ -56,7 +38,8 @@ public class EasBillSchedule {
private IeasOutInBillService easOutInBillService;
@Resource
private EasOutInBillDetailMapper easOutInBillDetailMapper;
@Resource
private SysUserMapper sysUserMapper;
/**
* eas单据数据同步
@ -89,13 +72,16 @@ public class EasBillSchedule {
.peek(user -> {
//默认启用
user.setIs_used(true);
user.setIs_admin(true);
user.setPwd_reset_user_id(0L);
user.setCreate_name("admin");
user.setCreate_time(new Date());
user.setPassword("f52020dca765fd3943ed40a615dc2c5c");
})
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(insertUsers)) {
// 批量插入新用户
//this.saveBatch(insertUsers);
sysUserMapper.insertBatch(insertUsers);
}
}

Loading…
Cancel
Save