diff --git a/src/main/java/com/msdw/tms/api/StudentControllerApi.java b/src/main/java/com/msdw/tms/api/StudentControllerApi.java index faac6bd..9efac77 100644 --- a/src/main/java/com/msdw/tms/api/StudentControllerApi.java +++ b/src/main/java/com/msdw/tms/api/StudentControllerApi.java @@ -38,4 +38,7 @@ public interface StudentControllerApi { @ApiOperation(value = "批量导入学生信息",notes = "批量导入学生信息") public R uploadFile(MultipartFile file) throws IOException; + + @ApiOperation(value = "导入学生失败原因导出",notes = "导入学生失败原因导出") + public void exportFailureRecord(HttpServletResponse response, String token) throws Exception; } diff --git a/src/main/java/com/msdw/tms/controller/StudentController.java b/src/main/java/com/msdw/tms/controller/StudentController.java index 6e21cf6..299bf14 100644 --- a/src/main/java/com/msdw/tms/controller/StudentController.java +++ b/src/main/java/com/msdw/tms/controller/StudentController.java @@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 学生管理 @@ -196,11 +197,12 @@ public class StudentController implements StudentControllerApi{ @PostMapping("/uploadFile") public R uploadFile(MultipartFile file) throws IOException{ Integer schoolId = ConstantUtils.Keda_schoolId; - HashMap upload = studentService.upload(file,schoolId); + Map upload = studentService.upload(file,schoolId); return R.ok().put("data",upload); } - @PostMapping("/export_failure") + @Override + @GetMapping("/export_failure") public void exportFailureRecord(HttpServletResponse response, String token) throws Exception{ studentService.exportFailureRecord(response,token); diff --git a/src/main/java/com/msdw/tms/controller/SystemSettingController.java b/src/main/java/com/msdw/tms/controller/SystemSettingController.java new file mode 100644 index 0000000..99aadbd --- /dev/null +++ b/src/main/java/com/msdw/tms/controller/SystemSettingController.java @@ -0,0 +1,30 @@ +package com.msdw.tms.controller; + +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.common.utils.R; +import com.msdw.tms.entity.vo.StaffVo; +import com.msdw.tms.service.SystemSetttingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 系统设置 + */ +@RestController +@RequestMapping("/tms/system") +public class SystemSettingController { + @Autowired + private SystemSetttingService systemSetttingService; + + @PostMapping("/addStaff") + public R addStaff(@RequestBody StaffVo staffVo){ + systemSetttingService.addStaff(staffVo); + return R.ok(); + } + + @PostMapping("/queryStaff") + public R queryStaff(@RequestBody StaffVo staffVo){ + PageUtils query = systemSetttingService.queryStaff(staffVo); + return R.ok().put("data",query); + } +} diff --git a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java new file mode 100644 index 0000000..c057a88 --- /dev/null +++ b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java @@ -0,0 +1,17 @@ +package com.msdw.tms.dao; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.msdw.tms.entity.vo.StaffVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.poi.ss.formula.functions.T; + +import java.util.List; + +@Mapper +public interface SystemSetttingDao { + + boolean addStaff(StaffVo staffVo); + + IPage queryStaff(Page tPage, String searchContent, StaffVo staffVo); +} diff --git a/src/main/java/com/msdw/tms/dao/UserInfoDao.java b/src/main/java/com/msdw/tms/dao/UserInfoDao.java index c5e8b6f..8fece8a 100644 --- a/src/main/java/com/msdw/tms/dao/UserInfoDao.java +++ b/src/main/java/com/msdw/tms/dao/UserInfoDao.java @@ -1,14 +1,10 @@ package com.msdw.tms.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.msdw.tms.common.utils.R; import com.msdw.tms.entity.StudentEntity; -import com.msdw.tms.entity.UserEntity; import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.vo.StudentVo; -import com.msdw.tms.entity.vo.UserEntityVo; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; import java.util.List; @@ -27,12 +23,13 @@ public interface UserInfoDao extends BaseMapper { Integer disableAccount(StudentVo studentIds); - List queryStudentAccount(String account,Integer schoolId); + List queryStudentAccount(String account, Integer schoolId); - List queryStudentPhone(String phone,Integer schoolId); + List queryStudentPhone(String phone, Integer schoolId); int bacthAddStudents(List students); int batchSaveUserInfo(StudentVo studentVo); + Integer addUserinfo(UserInfoEntity userInfo); } diff --git a/src/main/java/com/msdw/tms/entity/StaffEntity.java b/src/main/java/com/msdw/tms/entity/StaffEntity.java new file mode 100644 index 0000000..490f295 --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/StaffEntity.java @@ -0,0 +1,35 @@ +package com.msdw.tms.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.experimental.Accessors; + +@Data +@Accessors(chain = true) +@TableName("staff") +public class StaffEntity { + + //员工主键id + private Integer staffId; + //员工工号 + private String workNumber; + //绑定年级id + private Integer staffGradeId; + //绑定专业id + private Integer staffProfessionalArchitectureId; + //绑定年级名称 + private String staffGradeName; + //绑定专业名称 + private String staffProfessionalArchitectureName; + //角色id + private Integer roleId; + //绑定学校id + private Integer schoolId; + //绑定用户id + private Integer userId; + //是否删除 + private Integer isdel; + //绑定平台 + private Integer platformId; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/StaffVo.java b/src/main/java/com/msdw/tms/entity/vo/StaffVo.java new file mode 100644 index 0000000..3ab5a0b --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/StaffVo.java @@ -0,0 +1,55 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.entity.UserInfoEntity; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 员工管理 + */ +@Data +@Accessors(chain = true) +public class StaffVo extends UserInfoEntity { + +//---------------------------------员工信息staff(未完全) + //员工主键id + private Integer staffId; + //员工工号 + private String workNumber; + //绑定年级id + private Integer staffGradeId; + //绑定专业id + private Integer staffProfessionalArchitectureId; + //绑定年级名称 + private String staffGradeName; + //绑定专业名称 + private String staffProfessionalArchitectureName; + //绑定平台 + private Integer platformId; + +//----------------------------------分页 + //第几页 + private Integer page; + //每页数据量 + private Integer size; + //搜索内容 + private String searchContent; + +//----------------------------------员工年级staff_grade + //员工年级表主键id +// private Integer staffGradeId; + //员工年纪表名称 +// private String staffGradeName; + //绑定员工专业组织架构id +// private Integer staffProfessionalArchitectureId; +// private Integer isdel; + +//----------------------------------员工组织关系staff_professional_architecture + //员工组织架构主键 +// private Integer staffProfessionalArchitectureId; + //员工组织架构名称 +// private String staffProfessionalArchitectureName; + //绑定学校id +// private Integer schoolId; + // private Integer isdel; +} diff --git a/src/main/java/com/msdw/tms/entity/vo/StudentImportFailureVo.java b/src/main/java/com/msdw/tms/entity/vo/StudentImportFailureVo.java new file mode 100644 index 0000000..9c4429c --- /dev/null +++ b/src/main/java/com/msdw/tms/entity/vo/StudentImportFailureVo.java @@ -0,0 +1,40 @@ +package com.msdw.tms.entity.vo; + +import com.msdw.tms.common.utils.poi.ExcelAttribute; +import lombok.Data; +import lombok.ToString; +import lombok.experimental.Accessors; + +@Data +@ToString +@Accessors(chain = true) +public class StudentImportFailureVo { + + //第几行 + private Long index; + //用户姓名 + @ExcelAttribute(sort = 0) + private String userName; + //所属院校 + @ExcelAttribute(sort = 1) + private String schoolAppellationName; + //账号 + @ExcelAttribute(sort = 2) + private String account; + //学号 + @ExcelAttribute(sort = 3) + private String workNumber; + //手机号码 + @ExcelAttribute(sort = 4) + private String phone; + //邮箱 + @ExcelAttribute(sort = 5) + private String email; + //失败原因 + @ExcelAttribute(sort = 6) + private String failureMsg; + // +// @ExcelAttribute(sort = 7) +// private String message; + +} diff --git a/src/main/java/com/msdw/tms/service/StudentService.java b/src/main/java/com/msdw/tms/service/StudentService.java index d26d8f4..58259c6 100644 --- a/src/main/java/com/msdw/tms/service/StudentService.java +++ b/src/main/java/com/msdw/tms/service/StudentService.java @@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.HashMap; import java.util.List; +import java.util.Map; public interface StudentService extends IService{ @@ -31,7 +32,7 @@ public interface StudentService extends IService{ void downloadFiles(HttpServletResponse response) throws IOException; - HashMap upload(MultipartFile file, Integer schoolId) throws IOException; + Map upload(MultipartFile file, Integer schoolId) throws IOException; - void exportFailureRecord(HttpServletResponse response,String token); + void exportFailureRecord(HttpServletResponse response,String token) throws Exception; } diff --git a/src/main/java/com/msdw/tms/service/SystemSetttingService.java b/src/main/java/com/msdw/tms/service/SystemSetttingService.java new file mode 100644 index 0000000..3199b68 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/SystemSetttingService.java @@ -0,0 +1,11 @@ +package com.msdw.tms.service; + +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.entity.vo.StaffVo; + +public interface SystemSetttingService { + + boolean addStaff(StaffVo staffVo); + + PageUtils queryStaff(StaffVo staffVo); +} diff --git a/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java index 72d6084..930378f 100644 --- a/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/StudentServiceImpl.java @@ -1,16 +1,21 @@ package com.msdw.tms.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.msdw.tms.common.exception.ExceptionCast; import com.msdw.tms.common.utils.*; +import com.msdw.tms.common.utils.poi.ExcelExportUtil; import com.msdw.tms.dao.StudentDao; import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.entity.StudentEntity; import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.XlsxTemplateEntity; import com.msdw.tms.entity.response.CommonCode; +import com.msdw.tms.entity.vo.QuestionsImportFailureVO; +import com.msdw.tms.entity.vo.StudentImportFailureVo; import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.service.AliyunOssService; import com.msdw.tms.service.StudentService; @@ -18,6 +23,9 @@ import com.msdw.tms.service.XlsxTemplateService; import org.apache.commons.lang.StringUtils; import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -25,9 +33,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.TimeUnit; @Service("studentService") public class StudentServiceImpl extends ServiceImpl implements StudentService { @@ -44,6 +52,9 @@ public class StudentServiceImpl extends ServiceImpl im @Autowired private UserInfoDao userInfoDao; + @Resource + StringRedisTemplate stringRedisTemplate; + @Override public Integer queryStudentIdNumber(String workNumber,Integer schoolId) { List result = studentDao.queryStudentIdNumber(workNumber,schoolId); @@ -88,7 +99,7 @@ public class StudentServiceImpl extends ServiceImpl im public boolean updateStudent(StudentVo studentVo) { try { Integer update = studentDao.updateStudent(studentVo); - return true; + return true; }catch (RuntimeException e){ e.printStackTrace(); return false; @@ -105,14 +116,14 @@ public class StudentServiceImpl extends ServiceImpl im R r = new R(); boolean result = studentDao.addStudentInfo(userInfoEntity); if (result==false){ - r.put("code",300); - r.put("errmessage","注册失败!"); - return r; - }else{ - r.put("code",200); - r.put("errmessage","注册成功!"); - return r; - } + r.put("code",300); + r.put("errmessage","注册失败!"); + return r; + }else{ + r.put("code",200); + r.put("errmessage","注册成功!"); + return r; + } } @Override @@ -123,30 +134,40 @@ public class StudentServiceImpl extends ServiceImpl im @Transactional @Override - public HashMap upload(MultipartFile file, Integer schoolId) throws IOException{ + public Map upload(MultipartFile file, Integer schoolId) throws IOException{ List students = ExcelImportHelper.readStudent(file); - + List failVo1 = new ArrayList<>(); // 参数合法性校验,只能上传.xlsx后缀的文件 if (StringUtils.isBlank(file.getOriginalFilename()) || !file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")).equals(Constant.EXCEL_SUFFIX)) { ExceptionCast.cast(CommonCode.EXCEL_FILE_INVALID); } - - HashMap map = new HashMap<>(); + int size = students.size(); + Map map = new HashMap<>(); + Long ii = 1L;//用于记录序列号 try { for (int i = 0;i result1 = studentDao.queryStudentIdNumber(workNumber,schoolId); + List result4 = userInfoDao.queryStudentAccount(account, schoolId); String email = student.getEmail(); if (phone!=null&&phone!=""){ List result2 = userInfoDao.queryStudentPhone(phone, schoolId); if (result2.size()==1){ log.error("该号码已被使用"); - map.put("被占用电话号码序列:"+System.currentTimeMillis(),"电话号码:"+phone); + StudentImportFailureVo vo = new StudentImportFailureVo(); + ++ii; + vo.setIndex(ii).setUserName(student.getUserName()).setSchoolAppellationName(student.getSchoolAppellationName()) + .setAccount(student.getAccount()).setWorkNumber(student.getWorkNumber()).setPhone(student.getPhone()+" (重复的号码)").setEmail(student.getEmail()) + ; +// .setFailureMsg("重复的号码"); + failVo1.add(vo); +// map.put("被占用电话号码序列:"+System.currentTimeMillis(),"电话号码:"+phone); students.remove(i); i--; continue; @@ -161,22 +182,50 @@ public class StudentServiceImpl extends ServiceImpl im studentVo.setUniqueIdentificationAccount(String.valueOf(System.currentTimeMillis())). setPassword(ConstantUtils.INITIAL_PASSWORD) .setSchoolId(ConstantUtils.Keda_schoolId).setRoleId(ConstantUtils.STUDENT_ROLE) - ; + ; studentVo.setAccount(student.getAccount()).setSchoolAppellationName(schoolAppellationName).setUserName(student.getUserName()).setIsdel(Constant.IsDel.NOT_DEL.getType()); if (result1.size()==1){ log.error("该学号已存在"); - map.put("学号已存在序列:"+System.currentTimeMillis(),"学号:"+workNumber); + StudentImportFailureVo vo = new StudentImportFailureVo(); + ++ii; + vo.setIndex(ii).setUserName(student.getUserName()).setSchoolAppellationName(student.getSchoolAppellationName()) + .setAccount(student.getAccount()).setWorkNumber(student.getWorkNumber()+" (重复的学号)").setPhone(student.getPhone()).setEmail(student.getEmail()) + ; +// .setFailureMsg("重复的学号"); + failVo1.add(vo); +// map.put("学号已存在序列:"+System.currentTimeMillis(),"学号:"+workNumber); + students.remove(i); + i--; + continue; + }else if(result4.size()==1){ + log.error("账号已存在"); + StudentImportFailureVo vo = new StudentImportFailureVo(); + ++ii; + vo.setIndex(ii).setUserName(student.getUserName()).setSchoolAppellationName(student.getSchoolAppellationName()) + .setAccount(student.getAccount()+" (重复的账号)").setWorkNumber(student.getWorkNumber()).setPhone(student.getPhone()).setEmail(student.getEmail()) + ; +// .setFailureMsg("重复的账号"); + failVo1.add(vo); +// map.put("学号已存在序列:"+System.currentTimeMillis(),"学号:"+workNumber); students.remove(i); i--; continue; - }else if(result3.size()!=1){ + } + else if(result3.size()!=1){ log.error("不存在该院校"); - map.put("错误的学校名称序列:"+System.currentTimeMillis(),"学校名称:"+schoolAppellationName); + StudentImportFailureVo vo = new StudentImportFailureVo(); + ++ii; + vo.setIndex(ii).setUserName(student.getUserName()).setSchoolAppellationName(student.getSchoolAppellationName()) + .setAccount(student.getAccount()).setWorkNumber(student.getWorkNumber()).setPhone(student.getPhone()).setEmail(student.getEmail()) + .setFailureMsg("不存在的院校"); + failVo1.add(vo); +// map.put("错误的学校名称序列:"+System.currentTimeMillis(),"学校名称:"+schoolAppellationName); students.remove(i); i--; continue; } + ++ii; if (!students.isEmpty()&&students.size()>0){ userInfoDao.batchSaveUserInfo(studentVo); student.setUserId(studentVo.getUserId()).setIsdel(Constant.IsDel.NOT_DEL.getType()).setPlatformId(ConstantUtils.PLATFORMID); @@ -185,18 +234,56 @@ public class StudentServiceImpl extends ServiceImpl im throw new RuntimeException(); } } + + } }catch (RuntimeException e){ log.error(e.getMessage()); + map.put("failura","添加失败"); throw new RuntimeException(); } + String token = ""; + + // 有导入失败的数据,才会存入redis + if (failVo1.size() > 0) { + //生成token + token = "FAILURE_IMPORT" + UUID.randomUUID().toString().replace("-", ""); + + ValueOperations ops = stringRedisTemplate.opsForValue(); + String failureVOJson = JSON.toJSONString(failVo1); + + ops.set(token, failureVOJson, 30 * 60, TimeUnit.SECONDS); + } + map.put("token", token); + map.put("successNum", (size-failVo1.size())+""); + map.put("failureNum", failVo1.size()+""); return map; } @Override - public void exportFailureRecord(HttpServletResponse response,String token) { + public void exportFailureRecord(HttpServletResponse response,String token) throws Exception{ + if (StringUtils.isEmpty(token)) { + return; + } + ValueOperations ops = stringRedisTemplate.opsForValue(); + //获取数据 + String record = ops.get(token); + if (StringUtils.isEmpty(record)) { + return; + } + List parse = JSON.parseObject(record, new TypeReference>() { + }); + + parse.sort(Comparator.comparing(StudentImportFailureVo::getIndex)); + + //2.加载模板流数据 + org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/学生导入失败数据导出模板.xlsx"); + InputStream inputStream = resource.getInputStream(); + //3、通过工具类下载文件 + new ExcelExportUtil(StudentImportFailureVo.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). + export(response, inputStream, parse, "学生信息导入失败表.xlsx"); } // public HashMap readStudent(Integer schoolId, MultipartFile file) { diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java new file mode 100644 index 0000000..f3a2556 --- /dev/null +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -0,0 +1,55 @@ +package com.msdw.tms.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.msdw.tms.common.utils.Constant; +import com.msdw.tms.common.utils.ConstantUtils; +import com.msdw.tms.common.utils.PageUtils; +import com.msdw.tms.dao.SystemSetttingDao; +import com.msdw.tms.dao.UserInfoDao; +import com.msdw.tms.entity.UserInfoEntity; +import com.msdw.tms.entity.vo.StaffVo; +import com.msdw.tms.entity.vo.StudentVo; +import com.msdw.tms.service.SystemSetttingService; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.HashMap; +import java.util.List; + +@Service("systemSetttingService") +public class SystemSettingServiceImpl implements SystemSetttingService { + + @Autowired + private SystemSetttingDao systemSetttingDao; + + @Autowired + private UserInfoDao userInfoDao; + + @Override + @Transactional + public boolean addStaff(StaffVo staffVo) { +// UserInfoEntity userInfo = new UserInfoEntity(); + staffVo.setPlatformId(ConstantUtils.PLATFORMID).setUniqueIdentificationAccount(String.valueOf(System.currentTimeMillis())).setIsdel(Constant.IsDel.NOT_DEL.getType()) + .setSchoolId(ConstantUtils.Keda_schoolId); + Integer userId = userInfoDao.addUserinfo(staffVo); + boolean result = systemSetttingDao.addStaff(staffVo); + if (!result){ + throw new RuntimeException(); + } + return result; + } + + @Override + public PageUtils queryStaff(StaffVo staffVo) { + Page tPage = new Page<>(staffVo.getPage(),staffVo.getSize()); +// IPage saveStudent = studentDao.queryStudent(tPage,searchContent,schoolId); + IPage staff = systemSetttingDao.queryStaff(tPage,staffVo.getSearchContent(),staffVo); + PageUtils pageUtils = new PageUtils(staff); + return pageUtils; + } + + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5537c11..5660afe 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -17,7 +17,7 @@ spring: # port: 6379 # password: huoran redis: - host: 192.168.31.125 + host: 127.0.0.1 port: 6379 password: mybatis-plus: diff --git a/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx b/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx new file mode 100644 index 0000000..d0cb198 Binary files /dev/null and b/src/main/resources/excel-template/学生导入失败数据导出模板.xlsx differ diff --git a/src/main/resources/mapper/tms/SystemSetting.xml b/src/main/resources/mapper/tms/SystemSetting.xml new file mode 100644 index 0000000..292943f --- /dev/null +++ b/src/main/resources/mapper/tms/SystemSetting.xml @@ -0,0 +1,13 @@ + + + + + + INSERT INTO staff (userId,schoolId,workNumber,staffGradeId,staffProfessionalArchitectureId,staffGradeName,staffProfessionalArchitectureName,platformId,roleId) + VALUES + (#{userId},#{schoolId},#{workNumber},#{staffGradeId},#{staffProfessionalArchitectureId},#{staffGradeName},#{staffProfessionalArchitectureName},#{platformId},#{roleId}) + + + \ No newline at end of file diff --git a/src/main/resources/mapper/tms/UserInfoDao.xml b/src/main/resources/mapper/tms/UserInfoDao.xml index 79c66ca..2804ae8 100644 --- a/src/main/resources/mapper/tms/UserInfoDao.xml +++ b/src/main/resources/mapper/tms/UserInfoDao.xml @@ -6,10 +6,10 @@ insert into hr_user_info( userName, uniqueIdentificationAccount, provinceId, - cityId, schoolId, phone,account,password,roleId,schoolAppellationId) + cityId, schoolId, phone,account,password,roleId,schoolAppellationId,creationTime) values( #{userName}, #{uniqueIdentificationAccount}, #{provinceId}, - #{cityId}, #{schoolId},#{phone}, #{account},#{password},#{roleId},#{schoolAppellationId}) + #{cityId}, #{schoolId},#{phone}, #{account},#{password},#{roleId},#{schoolAppellationId},now()) @@ -81,27 +81,32 @@ - INSERT INTO hr_user_info ( userName,email,phone,uniqueIdentificationAccount, schoolId, account,password, roleId,isdel,schoolAppellationId) + INSERT INTO hr_user_info ( userName,email,phone,uniqueIdentificationAccount, schoolId, account,password, roleId,isdel,schoolAppellationId,creationTime) VALUES - ( #{userName},#{email},#{phone},#{uniqueIdentificationAccount}, #{schoolId}, #{account}, #{password}, 4 ,0,#{schoolAppellationId}) + ( #{userName},#{email},#{phone},#{uniqueIdentificationAccount}, #{schoolId}, #{account}, #{password}, 4 ,0,#{schoolAppellationId},now()) insert into hr_user_info( - userName, uniqueIdentificationAccount, schoolId, phone,account,password,roleId, schoolAppellationId) + userName, uniqueIdentificationAccount, schoolId, phone,account,password,roleId, schoolAppellationId,creationTime) values (#{studentVo.userName}, #{studentVo.uniqueIdentificationAccount},#{studentVo.schoolId}, #{studentVo.phone}, #{studentVo.account},#{studentVo.password},#{studentVo.roleId}, - (SELECT schoolId FROM school WHERE schoolName = #{studentVo.schoolAppellationName})) + (SELECT schoolId FROM school WHERE schoolName = #{studentVo.schoolAppellationName}),now()) insert into hr_user_info( - userName, uniqueIdentificationAccount, schoolId, phone,account,password,roleId, schoolAppellationId) + userName, uniqueIdentificationAccount, schoolId, phone,account,password,roleId, schoolAppellationId,creationTime) values (#{userName}, #{uniqueIdentificationAccount},#{schoolId}, #{phone}, #{account},#{password},#{roleId}, - (SELECT schoolId FROM school WHERE schoolName = #{schoolAppellationName})) + (SELECT schoolId FROM school WHERE schoolName = #{schoolAppellationName}),now()) + + + INSERT INTO hr_user_info ( account, userName, roleId, phone, email, uniqueIdentificationAccount, schoolId,creationTime) + VALUES + (#{account},#{userName},#{roleId},#{phone},#{email},#{uniqueIdentificationAccount},#{schoolId},now())