From dccbfed64d8154b72a70e7ac34f222f7ec440da2 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 09 Dec 2021 17:41:10 +0800
Subject: [PATCH] 考试签到记录新增,用户测试导入修改
---
src/main/java/org/springblade/modules/signinrecords/entity/SignInRecords.java | 71 +++++++
src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.xml | 44 ++++
src/main/java/org/springblade/modules/signinrecords/service/impl/SignInRecordsServiceImpl.java | 28 ++
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java | 180 +----------------
src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.java | 26 ++
src/main/java/org/springblade/modules/signinrecords/service/SignInRecordsService.java | 20 ++
src/main/java/org/springblade/modules/signinrecords/vo/SignInRecordsVo.java | 41 ++++
src/main/java/org/springblade/modules/system/controller/UserController.java | 40 +++
src/main/java/org/springblade/modules/signinrecords/controller/SignInRecordsController.java | 89 ++++++++
src/main/java/org/springblade/modules/system/vo/UserVO.java | 5
10 files changed, 374 insertions(+), 170 deletions(-)
diff --git a/src/main/java/org/springblade/modules/signinrecords/controller/SignInRecordsController.java b/src/main/java/org/springblade/modules/signinrecords/controller/SignInRecordsController.java
new file mode 100644
index 0000000..5d080f3
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/controller/SignInRecordsController.java
@@ -0,0 +1,89 @@
+package org.springblade.modules.signinrecords.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+import org.springblade.modules.signinrecords.service.SignInRecordsService;
+import org.springblade.modules.signinrecords.vo.SignInRecordsVo;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author zhongrj
+ * @time 2021-12-09
+ * @desc 考试签到记录控制层
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/signInRecords")
+public class SignInRecordsController {
+
+ private final SignInRecordsService signInRecordsService;
+
+
+ /**
+ * 自定义分页
+ * @param query page,size
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @GetMapping("/page")
+ public R<IPage<SignInRecordsVo>> page(SignInRecordsVo signInRecords, Query query) {
+ IPage<SignInRecordsVo> pages = signInRecordsService.selectSignInRecordsPage(Condition.getPage(query), signInRecords);
+ return R.data(pages);
+ }
+
+ /**
+ * 新增
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @PostMapping("/save")
+ @ApiOperation(value = "新增", notes = "传入signInRecords")
+ public R save(@RequestBody SignInRecords signInRecords){
+ return R.data(signInRecordsService.save(signInRecords));
+ }
+
+
+ /**
+ * 修改
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @PostMapping("/update")
+ public R update(@RequestBody SignInRecords signInRecords){
+ return R.status(signInRecordsService.updateById(signInRecords));
+ }
+
+ /**
+ * 新增或修改
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @PostMapping("/submit")
+ public R submit(@RequestBody SignInRecords signInRecords){
+ return R.data(signInRecordsService.saveOrUpdate(signInRecords));
+ }
+
+ /**
+ * 删除
+ * @param ids 考试签到记录信息ids 数组
+ */
+ @PostMapping("/remove")
+ public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
+ return R.status(signInRecordsService.removeByIds(Func.toLongList(ids)));
+ }
+
+ /**
+ * 详情
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @GetMapping("/detail")
+ @ApiOperation(value = "详情", notes = "传入signInRecords")
+ public R<SignInRecords> detail(SignInRecords signInRecords) {
+ SignInRecords detail = signInRecordsService.getOne(Condition.getQueryWrapper(signInRecords));
+ return R.data(detail);
+ }
+
+}
diff --git a/src/main/java/org/springblade/modules/signinrecords/entity/SignInRecords.java b/src/main/java/org/springblade/modules/signinrecords/entity/SignInRecords.java
new file mode 100644
index 0000000..1755033
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/entity/SignInRecords.java
@@ -0,0 +1,71 @@
+package org.springblade.modules.signinrecords.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 缺考记录实体类
+ * @author zhongrj
+ * @time 2021-11-18
+ */
+@Data
+@TableName("sys_sign_in_records")
+public class SignInRecords implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 制证记录主键id,非自增
+ */
+ @TableId(value = "id",type = IdType.ASSIGN_ID)
+ private Long id;
+
+ /**
+ * 签到人 user_id
+ */
+ @TableField("user_id")
+ private Long userId;
+
+
+ /**
+ * 签到时间
+ */
+ @TableField("create_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date createTime;
+
+
+ /**
+ * 考试id
+ */
+ @TableField("exam_id")
+ private Long examId;
+
+ /**
+ * 报名id
+ */
+ @TableField("apply_id")
+ private Long applyId;
+
+ /**
+ * 考生准考证号
+ */
+ @TableField("candidate_no")
+ private String candidateNo;
+
+ /**
+ * 签到时间
+ */
+ @TableField("update_time")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ private Date updateTime;
+}
diff --git a/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.java b/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.java
new file mode 100644
index 0000000..5d86fd8
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.java
@@ -0,0 +1,26 @@
+package org.springblade.modules.signinrecords.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.absentrecords.entity.AbsentRecords;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+import org.springblade.modules.signinrecords.vo.SignInRecordsVo;
+
+import java.util.List;
+
+/**
+ * 考试签到记录Mapper 接口
+ * @author zhongrj
+ */
+public interface SignInRecordsMapper extends BaseMapper<SignInRecords> {
+
+ /**
+ * 自定義分頁
+ * @param page
+ * @param signInRecords
+ * @return
+ */
+ List<SignInRecordsVo> selectSignInRecordsPage(@Param("page") IPage<SignInRecordsVo> page,
+ @Param("signInRecords") SignInRecordsVo signInRecords);
+}
diff --git a/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.xml b/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.xml
new file mode 100644
index 0000000..89d853e
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/mapper/SignInRecordsMapper.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.signinrecords.mapper.SignInRecordsMapper">
+
+ <!--查詢考試簽到記錄分頁數據-->
+ <select id="selectSignInRecordsPage" resultType="org.springblade.modules.signinrecords.vo.SignInRecordsVo">
+ select
+ ssir.*,
+ bu.real_name realName,
+ bu.cardid idCardNo,
+ bd.dept_name deptName
+ from sys_sign_in_records ssir
+ left join
+ blade_user bu
+ on
+ bu.id = ssir.user_id
+ left join
+ blade_dept bd
+ on
+ bu.dept_id = bd.id
+ left join
+ sys_training_registration str
+ on
+ str.id = ssir.apply_id
+ where 1=1
+ <if test="signInRecords.realName!=null and signInRecords.realName!=''">
+ and bu.real_name like concat('%',#{signInRecords.realName},'%')
+ </if>
+ <if test="signInRecords.idCardNo!=null and signInRecords.idCardNo!=''">
+ and bu.cardid like concat('%',#{signInRecords.idCardNo},'%')
+ </if>
+ <if test="signInRecords.deptName!=null and signInRecords.deptName!=''">
+ and bd.dept_name like concat('%',#{signInRecords.deptName},'%')
+ </if>
+ <if test="signInRecords.signTime!=null and signInRecords.signTime!=''">
+ and date_format(ssir.update_time,'%Y-%m-%d') = #{signInRecords.signTime}
+ </if>
+ <if test="signInRecords.trainingUnitId!=null and signInRecords.trainingUnitId!=''">
+ and str.training_unit_id = #{signInRecords.trainingUnitId}
+ </if>
+ order by ssir.id desc
+ </select>
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/signinrecords/service/SignInRecordsService.java b/src/main/java/org/springblade/modules/signinrecords/service/SignInRecordsService.java
new file mode 100644
index 0000000..1773b5a
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/service/SignInRecordsService.java
@@ -0,0 +1,20 @@
+package org.springblade.modules.signinrecords.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+import org.springblade.modules.signinrecords.vo.SignInRecordsVo;
+
+/**
+ * 考试签到记录服务类
+ * @author zhongrj
+ */
+public interface SignInRecordsService extends IService<SignInRecords> {
+
+ /**
+ * 自定义分页
+ * @param query page,size
+ * @param signInRecords 考试签到记录信息对象
+ */
+ IPage<SignInRecordsVo> selectSignInRecordsPage(IPage<SignInRecordsVo> page, SignInRecordsVo signInRecords);
+}
diff --git a/src/main/java/org/springblade/modules/signinrecords/service/impl/SignInRecordsServiceImpl.java b/src/main/java/org/springblade/modules/signinrecords/service/impl/SignInRecordsServiceImpl.java
new file mode 100644
index 0000000..dfb3957
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/service/impl/SignInRecordsServiceImpl.java
@@ -0,0 +1,28 @@
+
+package org.springblade.modules.signinrecords.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.AllArgsConstructor;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+import org.springblade.modules.signinrecords.mapper.SignInRecordsMapper;
+import org.springblade.modules.signinrecords.service.SignInRecordsService;
+import org.springblade.modules.signinrecords.vo.SignInRecordsVo;
+import org.springframework.stereotype.Service;
+
+/**
+ * 考试签到记录服务实现类
+ * @author zhongrj
+ */
+@Service
+@AllArgsConstructor
+public class SignInRecordsServiceImpl extends ServiceImpl<SignInRecordsMapper, SignInRecords> implements SignInRecordsService {
+ /**
+ * 自定义分页
+ * @param signInRecords 考试签到记录信息对象
+ */
+ @Override
+ public IPage<SignInRecordsVo> selectSignInRecordsPage(IPage<SignInRecordsVo> page, SignInRecordsVo signInRecords) {
+ return page.setRecords(baseMapper.selectSignInRecordsPage(page,signInRecords));
+ }
+}
diff --git a/src/main/java/org/springblade/modules/signinrecords/vo/SignInRecordsVo.java b/src/main/java/org/springblade/modules/signinrecords/vo/SignInRecordsVo.java
new file mode 100644
index 0000000..55906f9
--- /dev/null
+++ b/src/main/java/org/springblade/modules/signinrecords/vo/SignInRecordsVo.java
@@ -0,0 +1,41 @@
+package org.springblade.modules.signinrecords.vo;
+
+import lombok.Data;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+
+import java.io.Serializable;
+
+/**
+ * 考试签到记录vo
+ * @author zhongrj
+ * @since 2021-12-09
+ */
+@Data
+public class SignInRecordsVo extends SignInRecords implements Serializable {
+
+ /**
+ * 姓名
+ */
+ private String realName;
+
+ /**
+ * 公司名称
+ **/
+ private String deptName;
+
+ /**
+ * 身份证号
+ */
+ private String idCardNo;
+
+ /**
+ * 签到时间
+ */
+ private String signTime;
+
+ /**
+ * 培训公司id
+ */
+ private String trainingUnitId;
+
+}
diff --git a/src/main/java/org/springblade/modules/system/controller/UserController.java b/src/main/java/org/springblade/modules/system/controller/UserController.java
index e576865..523eeb6 100644
--- a/src/main/java/org/springblade/modules/system/controller/UserController.java
+++ b/src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -62,6 +62,8 @@
import org.springblade.modules.experience.service.IExperienceService;
import org.springblade.modules.jurisdiction.entity.Jurisdiction;
import org.springblade.modules.jurisdiction.service.JurisdictionService;
+import org.springblade.modules.signinrecords.entity.SignInRecords;
+import org.springblade.modules.signinrecords.service.SignInRecordsService;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.entity.Role;
import org.springblade.modules.system.entity.User;
@@ -73,6 +75,8 @@
import org.springblade.modules.system.vo.DeptVO;
import org.springblade.modules.system.vo.UserVO;
import org.springblade.modules.system.wrapper.UserWrapper;
+import org.springblade.modules.training.entity.TrainingRegistration;
+import org.springblade.modules.training.service.TrainingRegistrationService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -115,6 +119,11 @@
private final JurisdictionService jurisdictionService;
private final IDispatcherService dispatcherService;
+
+ private final SignInRecordsService signInRecordsService;
+
+
+ private final TrainingRegistrationService trainingRegistrationService;
/**
* 查询单条
@@ -436,7 +445,7 @@
* 修改
*/
@PostMapping("/updateUserInfo")
- public R updateUserInfo(@Valid @RequestBody User user) throws Exception {
+ public R updateUserInfo(@Valid @RequestBody UserVO user) throws Exception {
String url = null;
if (null!=user.getFingerprint() && !user.getFingerprint().equals("")) {
if (user.getFingerprint().length()>100) {
@@ -452,6 +461,35 @@
//更新
userService.updateById(user);
+ //生成签到记录
+ if (null!=user.getCandidateNo() && !user.getCandidateNo().equals("")){
+ //查询签到记录,如果已有,则更新,没有就新增
+ SignInRecords signInRecords = new SignInRecords();
+ signInRecords.setCandidateNo(user.getCandidateNo());
+ SignInRecords inRecordsServiceOne = signInRecordsService.getOne(Condition.getQueryWrapper(signInRecords));
+ //如果为null
+ if (null==inRecordsServiceOne){
+ //查询报名信息
+ TrainingRegistration trainingRegistration = new TrainingRegistration();
+ trainingRegistration.setCandidateNo(user.getCandidateNo());
+ TrainingRegistration one = trainingRegistrationService.getOne(Condition.getQueryWrapper(trainingRegistration));
+ //新增,数据封装
+ SignInRecords sign = new SignInRecords();
+ sign.setCreateTime(new Date());
+ sign.setUpdateTime(new Date());
+ sign.setCandidateNo(user.getCandidateNo());
+ sign.setUserId(user.getId());
+ sign.setApplyId(one.getId());
+ sign.setExamId(Long.parseLong(one.getTrainExamId()));
+ //新增
+ signInRecordsService.save(sign);
+ }else {
+ //更新
+ inRecordsServiceOne.setUpdateTime(new Date());
+ signInRecordsService.updateById(inRecordsServiceOne);
+ }
+ }
+
//内网同步
String s1 =
"update blade_user set account = " + "'" + user.getCardid() + "'"
diff --git a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
index f68f678..5e31813 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -40,8 +40,6 @@
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.*;
import org.springblade.modules.FTP.FtpUtil;
-import org.springblade.modules.accreditation.entity.AccreditationRecords;
-import org.springblade.modules.accreditation.service.AccreditationRecordsService;
import org.springblade.modules.auth.enums.UserEnum;
import org.springblade.modules.dispatcher.vo.DispatcherVO;
import org.springblade.modules.experience.entity.Experience;
@@ -62,7 +60,6 @@
import org.springblade.modules.system.wrapper.UserWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import sun.java2d.pipe.SpanShapeRenderer;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -1569,27 +1566,11 @@
public void importSecurityTest(List<SecurityExcel> data, Boolean isCovered, String deptId) {
//将不能导入的保安员账号存起来
List<String> errorList = new ArrayList<>();
- //年龄不符的保安员信息存入集合
- List<String> ageErrorList = new ArrayList<>();
- //将需要更新的保安员信息存入集合
- List<User> updateList = new ArrayList<>();
//导入状态,默认为true ,如果有一个出现问题则为 false
+ AtomicInteger count = new AtomicInteger();
AtomicBoolean status = new AtomicBoolean(true);
data.forEach(userExcel -> {
User user = Objects.requireNonNull(BeanUtil.copy(userExcel, User.class));
- //设置部门id
- String deptIds = userDeptService.selectIn(user.getDeptId());
- if (null!=deptIds && !deptIds.equals("")) {
-// if (null != deptId && !deptId.equals("")) {
-// if (!deptId.equals(deptIds)) {
-// throw new ServiceException("导入失败!不能导入不是本公司的保安员数据!");
-// }
-// }
- user.setDeptId(deptIds);
- }else {
- //如果deptIds 为空,则说明还没有改公司
- throw new ServiceException("导入失败!公司名:["+user.getDeptId()+"]不存在!");
- }
//判断当前用户是否已在本单位,如果是的更新数据
User user1 = new User();
user1.setAccount(user.getCardid());
@@ -1597,163 +1578,24 @@
user1.setStatus(1);
User user2 = this.getOne(Condition.getQueryWrapper(user1));
if (null==user2){
- //用户不存在,去新增
- // 设置租户ID
- user.setTenantId("000000");
- //默认在职
- user.setStatus(1);
- user.setIsDeleted(0);
- //判断是否持证
- if (null != userExcel.getHold() && userExcel.getHold() != "") {
- if (userExcel.getHold().equals("是")) {
- user.setHold("1");
- }
- if (userExcel.getHold().equals("否")) {
- user.setHold("2");
- }
- }
- //判断年龄,超过60岁的不入
-// if (AgeUtil.idCardToAge(user.getCardid())<60) {
- //分配保安角色
- Role role = new Role();
- role.setRoleAlias("保安");
- Role oneRole = roleService.getOne(Condition.getQueryWrapper(role));
- user.setRoleId(oneRole.getId().toString());
-
- //性别
- if (null != userExcel.getSex()) {
- if (userExcel.getSex().equals("男")) {
- user.setSex(1);
- }
- if (userExcel.getSex().equals("女")) {
- user.setSex(2);
- }
- }
-
- //设置账号
- user.setAccount(user.getCardid());
- //获取默认密码配置
- user.setPassword(user.getCardid().substring(user.getCardid().length() - 6));
- //加密
- if (Func.isNotEmpty(user.getPassword())) {
- user.setPassword(DigestUtil.encrypt(user.getPassword()));
- }
- Integer userCount = baseMapper.selectCountAccount(user.getAccount());
- if (userCount > 0 && Func.isEmpty(user.getId())) {
- throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
- }
- //新增
- this.save(user);
- //内网同步
- String s = "insert into blade_user(" +
- "id,tenant_id,account,password,name,real_name,avatar,email,phone,sex," +
- "role_id,dept_id,cardid,nativePlace,nation,fingerprint,education," +
- "politicaloutlook,healstats,height,address,registered," +
- "securitynumber,hold,jurisdiction,examination_type,status,is_deleted,dispatch) " +
- "values(" + "'" + user.getId() + "'" +
- "," + "'" + user.getTenantId() + "'" +
- "," + "'" + user.getAccount() + "'" +
- "," + "'" + user.getPassword() + "'" +
- "," + "'" + user.getName() + "'" +
- "," + "'" + user.getRealName() + "'" +
- "," + "'" + user.getAvatar() + "'" +
- "," + "'" + user.getEmail() + "'" +
- "," + "'" + user.getPhone() + "'" +
- "," + "'" + user.getSex() + "'" +
- "," + "'" + user.getRoleId() + "'" +
- "," + "'" + user.getDeptId() + "'" +
- "," + "'" + user.getCardid() + "'" +
- "," + "'" + user.getNativeplace() + "'" +
- "," + "'" + user.getNation() + "'" +
- "," + "'" + user.getFingerprint() + "'" +
- "," + "'" + user.getEducation() + "'" +
- "," + "'" + user.getPoliticaloutlook() + "'" +
- "," + "'" + user.getHealstats() + "'" +
- "," + "'" + user.getHeight() + "'" +
- "," + "'" + user.getAddress() + "'" +
- "," + "'" + user.getRegistered() + "'" +
- "," + "'" + user.getSecuritynumber() + "'" +
- "," + "'" + user.getHold() + "'" +
- "," + "'" + user.getJurisdiction() + "'" +
- "," + "'" + user.getExaminationType() + "'" +
- "," + "'" + user.getStatus() + "'" +
- "," + "'" + user.getIsDeleted() + "'" +
- "," + "'" + user.getDispatch() + "'" + ")";
- FtpUtil.sqlFileUpload(s);
-// }else {
-// agetStatus.set(false);
-// ageErrorList.add(user.getCardid());
-// }
}else {
- //匹配组织机构是否一致,如果不一致
- if(!user2.getDeptId().equals(user.getDeptId())){
- Dept dept = deptService.getById(user2.getDeptId());
- if (dept.getParentId().equals("1432626178757275649")){
- //判断是否持证
- if (null != userExcel.getHold() && userExcel.getHold() != "") {
- if (userExcel.getHold().equals("是") && userExcel.getSecuritynumber()!=null && !userExcel.getSecuritynumber().equals("")) {
- user2.setHold("1");
- //更新保安证编号
- user2.setSecuritynumber(user.getSecuritynumber());
- }
- if (userExcel.getHold().equals("否")) {
- user2.setHold("2");
- }
- }
- if (null!=userExcel.getRegistered()){
- user2.setRegistered(userExcel.getRegistered());
- }else {
- user2.setRegistered("");
- }
- //更新用户数据
- this.updateById(user2);
- String s1 =
- "update blade_user set hold = " + "'" + user2.getHold() + "'"
- + ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
- + ",dept_id = " + "'" + user2.getDeptId() + "'"
- + ",registered = " + "'" + user2.getRegistered() + "'"
- + " " + "where id = " + "'" + user2.getId() + "'";
- FtpUtil.sqlFileUpload(s1);
- }else {
- status.set(false);
- //加入集合
- errorList.add(user.getCardid());
- //forEach 只能使用 return 跳出本次循环
- return;
- }
+ if (null!=userExcel.getRegistered()){
+ user2.setRegistered(userExcel.getRegistered());
}else {
- //如果是一致,则更新用户数据
- //判断是否持证
- if (null != userExcel.getHold() && userExcel.getHold() != "") {
- if (userExcel.getHold().equals("是") && userExcel.getSecuritynumber()!=null && !userExcel.getSecuritynumber().equals("")) {
- user2.setHold("1");
- //更新保安证编号
- user2.setSecuritynumber(user.getSecuritynumber());
- }
- if (userExcel.getHold().equals("否")) {
- user2.setHold("2");
- }
- }
- if (null!=userExcel.getRegistered()){
- user2.setRegistered(userExcel.getRegistered());
- }else {
- user2.setRegistered("");
- }
- //更新用户数据
- this.updateById(user2);
- String s1 =
- "update blade_user set hold = " + "'" + user2.getHold() + "'"
- + ",securitynumber = " + "'" + user2.getSecuritynumber() + "'"
- + ",registered = " + "'" + user2.getRegistered() + "'"
- + " " + "where id = " + "'" + user2.getId() + "'";
- FtpUtil.sqlFileUpload(s1);
+ user2.setRegistered("");
}
+ count.getAndIncrement();
+ //更新用户数据
+ this.updateById(user2);
}
});
//如果所有数据导入有一个异常
if (!status.get()) {
String errorAccount = StringUtils.join(errorList, "\\\n");
- throw new ServiceException("用户:[" + errorAccount + "]导入失败!已在其他单位存在!");
+ throw new ServiceException("用户:[" + errorAccount + "]导入失败!不存在!");
+ }
+ if (status.get()) {
+ System.out.println("共更新 = " + count.get()+" 人!");
}
}
diff --git a/src/main/java/org/springblade/modules/system/vo/UserVO.java b/src/main/java/org/springblade/modules/system/vo/UserVO.java
index 345ad9e..83ee7b2 100644
--- a/src/main/java/org/springblade/modules/system/vo/UserVO.java
+++ b/src/main/java/org/springblade/modules/system/vo/UserVO.java
@@ -128,5 +128,10 @@
*/
private Integer sexs;
+ /**
+ * 准考证号
+ */
+ private String candidateNo;
+
}
--
Gitblit v1.9.3