|
@@ -134,7 +134,6 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
private SmartOperationUserService smartOperationUserService;
|
|
private SmartOperationUserService smartOperationUserService;
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(SmartUserController.class);
|
|
private static Logger logger = LoggerFactory.getLogger(SmartUserController.class);
|
|
|
|
|
|
|
|
//region 开发自己导数据用的接口
|
|
//region 开发自己导数据用的接口
|
|
@@ -2502,6 +2501,12 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
|
|
+ //查找家长身份是否存在用了该手机号的用户
|
|
|
|
|
+ int existCount = smartUserService.queryParentByCount(isur.getPhone());
|
|
|
|
|
+ if(existCount > 0){
|
|
|
|
|
+ return CommonResult.fail("当前手机号已被其他家长使用");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//拿到被关联学生的信息去获取对应的卡号
|
|
//拿到被关联学生的信息去获取对应的卡号
|
|
|
//有多个学生就循环学生
|
|
//有多个学生就循环学生
|
|
|
|
|
|
|
@@ -2838,6 +2843,11 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
return CommonResult.fail("被关联人不能为空");
|
|
return CommonResult.fail("被关联人不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ SmartUser oldUser = smartUserService.queryParentByPhone(usur.getPhone());
|
|
|
|
|
+ if(oldUser != null && oldUser.getId().intValue() != usur.getId().intValue()){
|
|
|
|
|
+ return CommonResult.fail("当前手机号已被其他家长使用");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
List<SmartUser> studentDatas = smartUserService.getSmartUserIds(usur.getAffiliate());
|
|
List<SmartUser> studentDatas = smartUserService.getSmartUserIds(usur.getAffiliate());
|
|
|
|
|
|
|
|
if (!changeIdentity) {
|
|
if (!changeIdentity) {
|
|
@@ -3359,16 +3369,16 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(newTeachers != null && newTeachers.size() > 0){
|
|
|
|
|
|
|
+ if (newTeachers != null && newTeachers.size() > 0) {
|
|
|
boolean insertEteacher = smartEvaluateTeacherService.saveBatch(newTeachers);
|
|
boolean insertEteacher = smartEvaluateTeacherService.saveBatch(newTeachers);
|
|
|
- if(!insertEteacher){
|
|
|
|
|
|
|
+ if (!insertEteacher) {
|
|
|
return CommonResult.fail("修改失败");
|
|
return CommonResult.fail("修改失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if(updateTeachers != null && updateTeachers.size() > 0){
|
|
|
|
|
|
|
+ if (updateTeachers != null && updateTeachers.size() > 0) {
|
|
|
boolean updateEteacher = smartEvaluateTeacherService.updateBatchById(updateTeachers);
|
|
boolean updateEteacher = smartEvaluateTeacherService.updateBatchById(updateTeachers);
|
|
|
- if(!updateEteacher){
|
|
|
|
|
|
|
+ if (!updateEteacher) {
|
|
|
return CommonResult.fail("修改失败");
|
|
return CommonResult.fail("修改失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -3893,11 +3903,17 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
int index = 0;
|
|
int index = 0;
|
|
|
if (isInsert) {
|
|
if (isInsert) {
|
|
|
List<SmartFamilyIndex> indexs = smartFamilyIndexService.querySmartFamilyByCardNo(student.getCardNo());
|
|
List<SmartFamilyIndex> indexs = smartFamilyIndexService.querySmartFamilyByCardNo(student.getCardNo());
|
|
|
|
|
+
|
|
|
if (indexs != null && indexs.size() >= 4) {
|
|
if (indexs != null && indexs.size() >= 4) {
|
|
|
return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
|
|
return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (indexs != null) {
|
|
if (indexs != null) {
|
|
|
|
|
+ long existCount = indexs.stream().filter(e -> e.getParentPhone().equals(phone)).count();
|
|
|
|
|
+ if(existCount > 0){
|
|
|
|
|
+ return CommonResult.fail("当前家长手机号已绑定该学生,请勿重复绑定");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
for (SmartFamilyIndex data : indexs) {
|
|
for (SmartFamilyIndex data : indexs) {
|
|
|
if (data.getIndexData().intValue() == index && index < 3) {
|
|
if (data.getIndexData().intValue() == index && index < 3) {
|
|
|
index++;
|
|
index++;
|
|
@@ -4873,11 +4889,11 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
@DESRespondSecret(validated = true)
|
|
|
- public CommonResult getPage(int currentPage, int pageCount, String keyWord,String schoolClass) {
|
|
|
|
|
|
|
+ public CommonResult getPage(int currentPage, int pageCount, String keyWord, String schoolClass) {
|
|
|
LambdaQueryWrapper<SmartUser> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<SmartUser> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.like(ObjectUtils.isNotEmpty(keyWord), SmartUser::getName, keyWord);
|
|
wrapper.like(ObjectUtils.isNotEmpty(keyWord), SmartUser::getName, keyWord);
|
|
|
- wrapper.eq(ObjectUtils.isNotEmpty(schoolClass),SmartUser::getSchoolClass,schoolClass);
|
|
|
|
|
- wrapper.eq(SmartUser::getIdentityId,2);
|
|
|
|
|
|
|
+ wrapper.eq(ObjectUtils.isNotEmpty(schoolClass), SmartUser::getSchoolClass, schoolClass);
|
|
|
|
|
+ wrapper.eq(SmartUser::getIdentityId, 2);
|
|
|
IPage<SmartUser> page = smartUserService.page(new Page<>(currentPage, pageCount), wrapper);
|
|
IPage<SmartUser> page = smartUserService.page(new Page<>(currentPage, pageCount), wrapper);
|
|
|
|
|
|
|
|
return CommonResult.ok(page);
|
|
return CommonResult.ok(page);
|
|
@@ -4906,29 +4922,29 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
Set<StatisticsCampusVo> vos = new HashSet<>();
|
|
Set<StatisticsCampusVo> vos = new HashSet<>();
|
|
|
|
|
|
|
|
// 查找门禁记录
|
|
// 查找门禁记录
|
|
|
- List<StatisticsCampusVo> accessVos=smartUserService.getAccessStatisticsCampus(classId,startTime,endTime);
|
|
|
|
|
|
|
+ List<StatisticsCampusVo> accessVos = smartUserService.getAccessStatisticsCampus(classId, startTime, endTime);
|
|
|
for (StatisticsCampusVo accessVo : accessVos) {
|
|
for (StatisticsCampusVo accessVo : accessVos) {
|
|
|
vos.add(accessVo);
|
|
vos.add(accessVo);
|
|
|
}
|
|
}
|
|
|
// 查找打卡记录
|
|
// 查找打卡记录
|
|
|
- List<StatisticsCampusVo> attendanceVos=smartUserService.getAttendanceStatisticsCampus(classId,startTime,endTime);
|
|
|
|
|
|
|
+ List<StatisticsCampusVo> attendanceVos = smartUserService.getAttendanceStatisticsCampus(classId, startTime, endTime);
|
|
|
for (StatisticsCampusVo attendanceVo : attendanceVos) {
|
|
for (StatisticsCampusVo attendanceVo : attendanceVos) {
|
|
|
vos.add(attendanceVo);
|
|
vos.add(attendanceVo);
|
|
|
}
|
|
}
|
|
|
// 查找人脸记录
|
|
// 查找人脸记录
|
|
|
- List<StatisticsCampusVo> faceDiscernVos=smartUserService.getFaceDiscernStatisticsCampus(classId,startTime,endTime);
|
|
|
|
|
|
|
+ List<StatisticsCampusVo> faceDiscernVos = smartUserService.getFaceDiscernStatisticsCampus(classId, startTime, endTime);
|
|
|
for (StatisticsCampusVo faceDiscernVo : faceDiscernVos) {
|
|
for (StatisticsCampusVo faceDiscernVo : faceDiscernVos) {
|
|
|
vos.add(faceDiscernVo);
|
|
vos.add(faceDiscernVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查找请假记录
|
|
// 查找请假记录
|
|
|
- List<StatisticsCampusVo> ackVos= smartUserService.getAckStatisticsCampus(classId,startTime,endTime);
|
|
|
|
|
|
|
+ List<StatisticsCampusVo> ackVos = smartUserService.getAckStatisticsCampus(classId, startTime, endTime);
|
|
|
for (StatisticsCampusVo ackVo : ackVos) {
|
|
for (StatisticsCampusVo ackVo : ackVos) {
|
|
|
vos.add(ackVo);
|
|
vos.add(ackVo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查找该班级下的所有人
|
|
// 查找该班级下的所有人
|
|
|
- List<StatisticsCampusVo> campusVos= smartUserService.getClassStudent(classId);
|
|
|
|
|
|
|
+ List<StatisticsCampusVo> campusVos = smartUserService.getClassStudent(classId);
|
|
|
|
|
|
|
|
// 不在正常记录里面的就是异常记录
|
|
// 不在正常记录里面的就是异常记录
|
|
|
ArrayList<StatisticsCampusVo> abnormalVos = new ArrayList<>();
|
|
ArrayList<StatisticsCampusVo> abnormalVos = new ArrayList<>();
|
|
@@ -4940,21 +4956,21 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
|
|
|
|
|
HashMap<String, Object> normal = new HashMap<>();
|
|
HashMap<String, Object> normal = new HashMap<>();
|
|
|
- normal.put("date",vos);
|
|
|
|
|
- normal.put("count",vos.size());
|
|
|
|
|
|
|
+ normal.put("date", vos);
|
|
|
|
|
+ normal.put("count", vos.size());
|
|
|
|
|
|
|
|
HashMap<String, Object> ack = new HashMap<>();
|
|
HashMap<String, Object> ack = new HashMap<>();
|
|
|
- ack.put("date",ackVos);
|
|
|
|
|
- ack.put("count",ackVos.size());
|
|
|
|
|
|
|
+ ack.put("date", ackVos);
|
|
|
|
|
+ ack.put("count", ackVos.size());
|
|
|
|
|
|
|
|
HashMap<String, Object> abnormal = new HashMap<>();
|
|
HashMap<String, Object> abnormal = new HashMap<>();
|
|
|
- abnormal.put("date",abnormalVos);
|
|
|
|
|
- abnormal.put("count",abnormalVos.size());
|
|
|
|
|
|
|
+ abnormal.put("date", abnormalVos);
|
|
|
|
|
+ abnormal.put("count", abnormalVos.size());
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("normal",normal);
|
|
|
|
|
- jsonObject.put("ack",ack);
|
|
|
|
|
- jsonObject.put("abnormal",abnormal);
|
|
|
|
|
|
|
+ jsonObject.put("normal", normal);
|
|
|
|
|
+ jsonObject.put("ack", ack);
|
|
|
|
|
+ jsonObject.put("abnormal", abnormal);
|
|
|
|
|
|
|
|
return CommonResult.ok(jsonObject);
|
|
return CommonResult.ok(jsonObject);
|
|
|
}
|
|
}
|
|
@@ -4965,31 +4981,31 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
// 获取学生信息
|
|
// 获取学生信息
|
|
|
SmartUser smartById = smartUserService.getSmartById(userId);
|
|
SmartUser smartById = smartUserService.getSmartById(userId);
|
|
|
// 获取家长信息
|
|
// 获取家长信息
|
|
|
- List<SmartUser> list=smartUserService.getAddressBook(userId);
|
|
|
|
|
|
|
+ List<SmartUser> list = smartUserService.getAddressBook(userId);
|
|
|
|
|
|
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
|
- map.put("student",smartById);
|
|
|
|
|
|
|
+ map.put("student", smartById);
|
|
|
|
|
|
|
|
- map.put("patriarch",list);
|
|
|
|
|
|
|
+ map.put("patriarch", list);
|
|
|
|
|
|
|
|
return CommonResult.ok(map);
|
|
return CommonResult.ok(map);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
@DESRespondSecret(validated = true)
|
|
|
- public CommonResult statisticsCampusManage(Integer gradeId,Integer classId, String dateTime,Integer type,String keyWord) {
|
|
|
|
|
|
|
+ public CommonResult statisticsCampusManage(Integer gradeId, Integer classId, String dateTime, Integer type, String keyWord) {
|
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime startTime = LocalDateTime.parse(dateTime, dateTimeFormatter1);
|
|
LocalDateTime startTime = LocalDateTime.parse(dateTime, dateTimeFormatter1);
|
|
|
LocalDateTime endTime = startTime.plusDays(1);
|
|
LocalDateTime endTime = startTime.plusDays(1);
|
|
|
|
|
|
|
|
- List<StatisticsCampusManageVo> ackVos=null;
|
|
|
|
|
|
|
+ List<StatisticsCampusManageVo> ackVos = null;
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- if (3==type) {
|
|
|
|
|
|
|
+ if (3 == type) {
|
|
|
// 请假
|
|
// 请假
|
|
|
// 查找请假记录
|
|
// 查找请假记录
|
|
|
- ackVos= smartUserService.getAckStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
|
|
|
|
|
- jsonObject.put("count",ackVos.size());
|
|
|
|
|
- jsonObject.put("data",ackVos);
|
|
|
|
|
|
|
+ ackVos = smartUserService.getAckStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
|
|
|
|
|
+ jsonObject.put("count", ackVos.size());
|
|
|
|
|
+ jsonObject.put("data", ackVos);
|
|
|
|
|
|
|
|
return CommonResult.ok(jsonObject);
|
|
return CommonResult.ok(jsonObject);
|
|
|
}
|
|
}
|
|
@@ -4998,37 +5014,37 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
Set<StatisticsCampusManageVo> vos = new HashSet<>();
|
|
Set<StatisticsCampusManageVo> vos = new HashSet<>();
|
|
|
|
|
|
|
|
// 查找门禁记录
|
|
// 查找门禁记录
|
|
|
- List<StatisticsCampusManageVo> accessVos=smartUserService.getAccessStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
|
|
|
|
|
|
|
+ List<StatisticsCampusManageVo> accessVos = smartUserService.getAccessStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
|
|
|
for (StatisticsCampusManageVo accessVo : accessVos) {
|
|
for (StatisticsCampusManageVo accessVo : accessVos) {
|
|
|
vos.add(accessVo);
|
|
vos.add(accessVo);
|
|
|
}
|
|
}
|
|
|
// 查找打卡记录
|
|
// 查找打卡记录
|
|
|
- List<StatisticsCampusManageVo> attendanceVos=smartUserService.getAttendanceStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
|
|
|
|
|
|
|
+ List<StatisticsCampusManageVo> attendanceVos = smartUserService.getAttendanceStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
|
|
|
for (StatisticsCampusManageVo attendanceVo : attendanceVos) {
|
|
for (StatisticsCampusManageVo attendanceVo : attendanceVos) {
|
|
|
vos.add(attendanceVo);
|
|
vos.add(attendanceVo);
|
|
|
}
|
|
}
|
|
|
// 查找人脸记录
|
|
// 查找人脸记录
|
|
|
- List<StatisticsCampusManageVo> faceDiscernVos=smartUserService.getFaceDiscernStatisticsCampusManage(gradeId,classId,startTime,endTime,keyWord);
|
|
|
|
|
|
|
+ List<StatisticsCampusManageVo> faceDiscernVos = smartUserService.getFaceDiscernStatisticsCampusManage(gradeId, classId, startTime, endTime, keyWord);
|
|
|
for (StatisticsCampusManageVo faceDiscernVo : faceDiscernVos) {
|
|
for (StatisticsCampusManageVo faceDiscernVo : faceDiscernVos) {
|
|
|
vos.add(faceDiscernVo);
|
|
vos.add(faceDiscernVo);
|
|
|
}
|
|
}
|
|
|
- if (ObjectUtils.isNotEmpty(ackVos)&&ackVos.size()>0) {
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotEmpty(ackVos) && ackVos.size() > 0) {
|
|
|
for (StatisticsCampusManageVo ackVo : ackVos) {
|
|
for (StatisticsCampusManageVo ackVo : ackVos) {
|
|
|
vos.add(ackVo);
|
|
vos.add(ackVo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (2==type) {
|
|
|
|
|
|
|
+ if (2 == type) {
|
|
|
// 正常
|
|
// 正常
|
|
|
- jsonObject.put("count",vos.size());
|
|
|
|
|
- jsonObject.put("data",vos);
|
|
|
|
|
|
|
+ jsonObject.put("count", vos.size());
|
|
|
|
|
+ jsonObject.put("data", vos);
|
|
|
|
|
|
|
|
return CommonResult.ok(jsonObject);
|
|
return CommonResult.ok(jsonObject);
|
|
|
- }else if (1==type){
|
|
|
|
|
|
|
+ } else if (1 == type) {
|
|
|
// 异常
|
|
// 异常
|
|
|
// 查找该班级下的所有人
|
|
// 查找该班级下的所有人
|
|
|
- List<StatisticsCampusManageVo> campusVos= smartUserService.getClassStudentManage(gradeId,classId,keyWord);
|
|
|
|
|
|
|
+ List<StatisticsCampusManageVo> campusVos = smartUserService.getClassStudentManage(gradeId, classId, keyWord);
|
|
|
|
|
|
|
|
// 不在正常记录里面的就是异常记录
|
|
// 不在正常记录里面的就是异常记录
|
|
|
ArrayList<StatisticsCampusManageVo> abnormalVos = new ArrayList<>();
|
|
ArrayList<StatisticsCampusManageVo> abnormalVos = new ArrayList<>();
|
|
@@ -5037,11 +5053,11 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
abnormalVos.add(campusVo);
|
|
abnormalVos.add(campusVo);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- jsonObject.put("count",abnormalVos.size());
|
|
|
|
|
- jsonObject.put("data",abnormalVos);
|
|
|
|
|
|
|
+ jsonObject.put("count", abnormalVos.size());
|
|
|
|
|
+ jsonObject.put("data", abnormalVos);
|
|
|
return CommonResult.ok(jsonObject);
|
|
return CommonResult.ok(jsonObject);
|
|
|
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return CommonResult.fail("查询状态有误");
|
|
return CommonResult.fail("查询状态有误");
|
|
|
}
|
|
}
|
|
|
|
|
|