From ed831a463029f2999b06144b495cc4481acfae5f Mon Sep 17 00:00:00 2001 From: gongbaoxiong <751575283@qq.com> Date: Tue, 4 Jun 2024 11:17:24 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=90=8C=E6=AD=A5=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/dao/mapper/SysUserMapper.java | 3 ++ .../service/user/dao/mapper/SysUserMapper.xml | 13 ++++++++ .../org/nl/wms/schedule/EasBillSchedule.java | 30 +++++-------------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java b/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java index 8ef537b..eb59334 100644 --- a/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java +++ b/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.java @@ -34,4 +34,7 @@ public interface SysUserMapper extends BaseMapper { void insertDataPermission(@Param("dataPermission") UserDataPermissionDto dataPermission); List getUserIdByDeptId(String deptId); + + void insertBatch( List userList); + } diff --git a/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml b/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml index d9a382f..1bb4487 100644 --- a/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml +++ b/nlsso-server/src/main/java/org/nl/system/service/user/dao/mapper/SysUserMapper.xml @@ -150,4 +150,17 @@ + + 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 + + (#{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}) + + diff --git a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java b/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java index 14b5816..b05a94f 100644 --- a/nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java +++ b/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); } }