|
@@ -759,7 +759,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
familyIndex.setIndexData(i);
|
|
familyIndex.setIndexData(i);
|
|
|
familyIndexs.add(familyIndex);
|
|
familyIndexs.add(familyIndex);
|
|
|
ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem data = ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem.builder()
|
|
ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem data = ParentServiceBatchSaveOrUpdateParentsParam.ParentsItem.builder()
|
|
|
- .name(parent.getName())
|
|
|
|
|
|
|
+ .name(parent.getShip())
|
|
|
.phone(parent.getPhone())
|
|
.phone(parent.getPhone())
|
|
|
.index(i)
|
|
.index(i)
|
|
|
.build();
|
|
.build();
|
|
@@ -1118,65 +1118,69 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
if (!schoolClass.equals("班级")) {
|
|
if (!schoolClass.equals("班级")) {
|
|
|
return CommonResult.fail("导入数据第一列为班级");
|
|
return CommonResult.fail("导入数据第一列为班级");
|
|
|
}
|
|
}
|
|
|
- String cardNo = dataFormatter.formatCellValue(row.getCell(2));//学号
|
|
|
|
|
|
|
+ String departmentNo = dataFormatter.formatCellValue(row.getCell(2));//部门
|
|
|
|
|
+ if (!departmentNo.equals("部门")) {
|
|
|
|
|
+ return CommonResult.fail("导入数据第二列为部门");
|
|
|
|
|
+ }
|
|
|
|
|
+ String cardNo = dataFormatter.formatCellValue(row.getCell(3));//学号
|
|
|
if (!cardNo.equals("学号")) {
|
|
if (!cardNo.equals("学号")) {
|
|
|
return CommonResult.fail("导入数据第二列为学号");
|
|
return CommonResult.fail("导入数据第二列为学号");
|
|
|
}
|
|
}
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(3));//姓名
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(4));//姓名
|
|
|
if (!name.equals("姓名")) {
|
|
if (!name.equals("姓名")) {
|
|
|
return CommonResult.fail("导入数据第三列为姓名");
|
|
return CommonResult.fail("导入数据第三列为姓名");
|
|
|
}
|
|
}
|
|
|
- String sex = dataFormatter.formatCellValue(row.getCell(4));//性别
|
|
|
|
|
|
|
+ String sex = dataFormatter.formatCellValue(row.getCell(5));//性别
|
|
|
if (!sex.equals("性别")) {
|
|
if (!sex.equals("性别")) {
|
|
|
return CommonResult.fail("导入数据第四列为性别");
|
|
return CommonResult.fail("导入数据第四列为性别");
|
|
|
}
|
|
}
|
|
|
- String nation = dataFormatter.formatCellValue(row.getCell(5));//民族
|
|
|
|
|
|
|
+ String nation = dataFormatter.formatCellValue(row.getCell(6));//民族
|
|
|
if (!nation.equals("民族")) {
|
|
if (!nation.equals("民族")) {
|
|
|
return CommonResult.fail("导入数据第五列为民族");
|
|
return CommonResult.fail("导入数据第五列为民族");
|
|
|
}
|
|
}
|
|
|
- String cardId = dataFormatter.formatCellValue(row.getCell(6));//身份证
|
|
|
|
|
|
|
+ String cardId = dataFormatter.formatCellValue(row.getCell(7));//身份证
|
|
|
if (!cardId.equals("身份证")) {
|
|
if (!cardId.equals("身份证")) {
|
|
|
return CommonResult.fail("导入数据第六列为身份证");
|
|
return CommonResult.fail("导入数据第六列为身份证");
|
|
|
}
|
|
}
|
|
|
- String headImage = dataFormatter.formatCellValue(row.getCell(7));//照片
|
|
|
|
|
|
|
+ String headImage = dataFormatter.formatCellValue(row.getCell(8));//照片
|
|
|
if (!headImage.equals("照片")) {
|
|
if (!headImage.equals("照片")) {
|
|
|
return CommonResult.fail("导入数据第七列为照片");
|
|
return CommonResult.fail("导入数据第七列为照片");
|
|
|
}
|
|
}
|
|
|
- String timeGroup = dataFormatter.formatCellValue(row.getCell(8));//常规时间组
|
|
|
|
|
|
|
+ String timeGroup = dataFormatter.formatCellValue(row.getCell(9));//常规时间组
|
|
|
if (!timeGroup.equals("常规时间组")) {
|
|
if (!timeGroup.equals("常规时间组")) {
|
|
|
return CommonResult.fail("导入数据第八列为常规时间组");
|
|
return CommonResult.fail("导入数据第八列为常规时间组");
|
|
|
}
|
|
}
|
|
|
- String address = dataFormatter.formatCellValue(row.getCell(9));//住址
|
|
|
|
|
|
|
+ String address = dataFormatter.formatCellValue(row.getCell(10));//住址
|
|
|
if (!address.equals("住址")) {
|
|
if (!address.equals("住址")) {
|
|
|
return CommonResult.fail("导入数据第九列为住址");
|
|
return CommonResult.fail("导入数据第九列为住址");
|
|
|
}
|
|
}
|
|
|
- String phone = dataFormatter.formatCellValue(row.getCell(10));//联系电话
|
|
|
|
|
|
|
+ String phone = dataFormatter.formatCellValue(row.getCell(11));//联系电话
|
|
|
if (!phone.equals("联系电话")) {
|
|
if (!phone.equals("联系电话")) {
|
|
|
return CommonResult.fail("导入数据第十列为联系电话");
|
|
return CommonResult.fail("导入数据第十列为联系电话");
|
|
|
}
|
|
}
|
|
|
- String family = dataFormatter.formatCellValue(row.getCell(11));//家属
|
|
|
|
|
|
|
+ String family = dataFormatter.formatCellValue(row.getCell(12));//家属
|
|
|
if (!family.equals("家属")) {
|
|
if (!family.equals("家属")) {
|
|
|
return CommonResult.fail("导入数据第十一列为家属");
|
|
return CommonResult.fail("导入数据第十一列为家属");
|
|
|
}
|
|
}
|
|
|
- String familyShip = dataFormatter.formatCellValue(row.getCell(12));//家属与本人关系
|
|
|
|
|
|
|
+ String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
|
|
|
if (!familyShip.equals("家属与本人关系")) {
|
|
if (!familyShip.equals("家属与本人关系")) {
|
|
|
return CommonResult.fail("导入数据第十二列为家属与本人关系");
|
|
return CommonResult.fail("导入数据第十二列为家属与本人关系");
|
|
|
}
|
|
}
|
|
|
- String phoneTwo = dataFormatter.formatCellValue(row.getCell(13));//联系电话2
|
|
|
|
|
|
|
+ String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
|
|
|
if (!phoneTwo.equals("联系电话2")) {
|
|
if (!phoneTwo.equals("联系电话2")) {
|
|
|
return CommonResult.fail("导入数据第十三列为联系电话2");
|
|
return CommonResult.fail("导入数据第十三列为联系电话2");
|
|
|
}
|
|
}
|
|
|
- String familyTwo = dataFormatter.formatCellValue(row.getCell(14));//家属2
|
|
|
|
|
|
|
+ String familyTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
|
|
|
if (!familyTwo.equals("家属2")) {
|
|
if (!familyTwo.equals("家属2")) {
|
|
|
return CommonResult.fail("导入数据第十四列为家属2");
|
|
return CommonResult.fail("导入数据第十四列为家属2");
|
|
|
}
|
|
}
|
|
|
- String familyShipTwo = dataFormatter.formatCellValue(row.getCell(15));//家属与本人关系2
|
|
|
|
|
|
|
+ String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
|
|
|
if (!familyShipTwo.equals("家属与本人关系2")) {
|
|
if (!familyShipTwo.equals("家属与本人关系2")) {
|
|
|
return CommonResult.fail("导入数据第十五列为家属与本人关系2");
|
|
return CommonResult.fail("导入数据第十五列为家属与本人关系2");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
SmartUser user = new SmartUser();
|
|
SmartUser user = new SmartUser();
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(3));
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(4));
|
|
|
// if (ObjectUtils.isEmpty(name)) {
|
|
// if (ObjectUtils.isEmpty(name)) {
|
|
|
// return CommonResult.fail("第" + (rowNum + 1) + "条数据的名称不能为空");
|
|
// return CommonResult.fail("第" + (rowNum + 1) + "条数据的名称不能为空");
|
|
|
// }
|
|
// }
|
|
@@ -1195,7 +1199,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//不判断重复性 因为会出现双胞胎
|
|
//不判断重复性 因为会出现双胞胎
|
|
|
- String phone = dataFormatter.formatCellValue(row.getCell(10));
|
|
|
|
|
|
|
+ String phone = dataFormatter.formatCellValue(row.getCell(11));
|
|
|
// if (!ObjectUtils.isEmpty(phone)) {
|
|
// if (!ObjectUtils.isEmpty(phone)) {
|
|
|
// phones.add(phone);
|
|
// phones.add(phone);
|
|
|
// }
|
|
// }
|
|
@@ -1205,35 +1209,50 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
|
|
|
|
|
//性别是否为空判断
|
|
//性别是否为空判断
|
|
|
- String sex = dataFormatter.formatCellValue(row.getCell(4));
|
|
|
|
|
|
|
+ String sex = dataFormatter.formatCellValue(row.getCell(5));
|
|
|
if (ObjectUtils.isEmpty(sex)) {
|
|
if (ObjectUtils.isEmpty(sex)) {
|
|
|
return CommonResult.fail(name + "的性别不能为空");
|
|
return CommonResult.fail(name + "的性别不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//家庭住址是否为空判断
|
|
//家庭住址是否为空判断
|
|
|
- String address = dataFormatter.formatCellValue(row.getCell(9));
|
|
|
|
|
|
|
+ String address = dataFormatter.formatCellValue(row.getCell(10));
|
|
|
|
|
|
|
|
//民族是否为空判断
|
|
//民族是否为空判断
|
|
|
- String nation = dataFormatter.formatCellValue(row.getCell(5));
|
|
|
|
|
|
|
+ String nation = dataFormatter.formatCellValue(row.getCell(6));
|
|
|
if (ObjectUtils.isEmpty(nation)) {
|
|
if (ObjectUtils.isEmpty(nation)) {
|
|
|
return CommonResult.fail(name + "的民族不能为空");
|
|
return CommonResult.fail(name + "的民族不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//部门是否为空判断
|
|
//部门是否为空判断
|
|
|
- String department = dataFormatter.formatCellValue(row.getCell(1)).replace("年级", "") + "学生";
|
|
|
|
|
- if (ObjectUtils.isEmpty(department)) {
|
|
|
|
|
|
|
+ String department = dataFormatter.formatCellValue(row.getCell(2));
|
|
|
|
|
+ if (ObjectUtils.isEmpty(nation)) {
|
|
|
return CommonResult.fail(name + "的部门不能为空");
|
|
return CommonResult.fail(name + "的部门不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ Integer parentDid = null;
|
|
|
Integer departmentId = null;
|
|
Integer departmentId = null;
|
|
|
- Optional<SmartDepartment> departModel = departments.stream().filter(e -> e.getName().equals(department)).findFirst();
|
|
|
|
|
- if (departModel != null && departModel.isPresent()) {
|
|
|
|
|
- departmentId = departModel.get().getId();
|
|
|
|
|
- } else {
|
|
|
|
|
- departmentId = 1;
|
|
|
|
|
|
|
+ String[] departmentStrs = department.split("/");
|
|
|
|
|
+ for (int i = 0; i < departmentStrs.length; i++) {
|
|
|
|
|
+ String departmentName = departmentStrs[i];
|
|
|
|
|
+ Optional<SmartDepartment> oD = departments.stream().filter(e -> e.getName().equals(departmentName)).findFirst();
|
|
|
|
|
+ if(oD != null && oD.isPresent()){
|
|
|
|
|
+ parentDid = oD.get().getId();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ String bsDepartment = insertDepartmentToBs(departmentName);
|
|
|
|
|
+ if(bsDepartment == null){
|
|
|
|
|
+ return CommonResult.fail(name + "的部门添加到百胜失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ SmartDepartment sdParent = new SmartDepartment();
|
|
|
|
|
+ sdParent.setParentId(parentDid);
|
|
|
|
|
+ sdParent.setName(departmentName);
|
|
|
|
|
+ sdParent.setBsDepartmentNo(bsDepartment);
|
|
|
|
|
+ int departmentData = smartDepartmentService.insertSmartDepartment(sdParent);
|
|
|
|
|
+ departmentId = departmentData;
|
|
|
|
|
+ parentDid = departmentData;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//学号重复判断
|
|
//学号重复判断
|
|
|
- String cardNo = dataFormatter.formatCellValue(row.getCell(2));
|
|
|
|
|
|
|
+ String cardNo = dataFormatter.formatCellValue(row.getCell(3));
|
|
|
if (!ObjectUtils.isEmpty(cardNo)) {
|
|
if (!ObjectUtils.isEmpty(cardNo)) {
|
|
|
cardNos.add(cardNo);
|
|
cardNos.add(cardNo);
|
|
|
}
|
|
}
|
|
@@ -1242,7 +1261,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//身份证重复判断
|
|
//身份证重复判断
|
|
|
- String idCard = dataFormatter.formatCellValue(row.getCell(6));
|
|
|
|
|
|
|
+ String idCard = dataFormatter.formatCellValue(row.getCell(7));
|
|
|
if (!ObjectUtils.isEmpty(idCard)) {
|
|
if (!ObjectUtils.isEmpty(idCard)) {
|
|
|
idCards.add(idCard);
|
|
idCards.add(idCard);
|
|
|
}
|
|
}
|
|
@@ -1255,7 +1274,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
user.setIdCard(idCard == null ? "" : idCard);
|
|
user.setIdCard(idCard == null ? "" : idCard);
|
|
|
user.setSexId(sex == null ? eSexStatu.Man.getValue() : eSexStatu.integerOf(sex));
|
|
user.setSexId(sex == null ? eSexStatu.Man.getValue() : eSexStatu.integerOf(sex));
|
|
|
user.setDepartmentId(departmentId);
|
|
user.setDepartmentId(departmentId);
|
|
|
- String cellImage = dataFormatter.formatCellValue(row.getCell(7));
|
|
|
|
|
|
|
+ String cellImage = dataFormatter.formatCellValue(row.getCell(8));
|
|
|
user.setHeadImage(cellImage);
|
|
user.setHeadImage(cellImage);
|
|
|
user.setDormitoryNumber("");
|
|
user.setDormitoryNumber("");
|
|
|
String grade = schoolGrade == null ? "" : schoolGrade;
|
|
String grade = schoolGrade == null ? "" : schoolGrade;
|
|
@@ -1284,7 +1303,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
user.setOfStudent("");
|
|
user.setOfStudent("");
|
|
|
user.setGraduate("");
|
|
user.setGraduate("");
|
|
|
user.setDuties(null);
|
|
user.setDuties(null);
|
|
|
- String timeGroup = dataFormatter.formatCellValue(row.getCell(8));
|
|
|
|
|
|
|
+ String timeGroup = dataFormatter.formatCellValue(row.getCell(9));
|
|
|
Optional<SmartTimeGroup> groupData = timeGroups.stream().filter(e -> e.getName().equals(timeGroup)).findFirst();
|
|
Optional<SmartTimeGroup> groupData = timeGroups.stream().filter(e -> e.getName().equals(timeGroup)).findFirst();
|
|
|
if (groupData != null && groupData.isPresent()) {
|
|
if (groupData != null && groupData.isPresent()) {
|
|
|
user.setTimeGroupId(groupData.get().getId());
|
|
user.setTimeGroupId(groupData.get().getId());
|
|
@@ -1315,7 +1334,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SmartUser familyOne = new SmartUser();
|
|
SmartUser familyOne = new SmartUser();
|
|
|
- String family = dataFormatter.formatCellValue(row.getCell(11));//家属
|
|
|
|
|
|
|
+ String family = dataFormatter.formatCellValue(row.getCell(12));//家属
|
|
|
familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
|
|
familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
|
|
|
familyOne.setDepartmentId(familyDepartmentId);
|
|
familyOne.setDepartmentId(familyDepartmentId);
|
|
|
familyOne.setPhone(phone);
|
|
familyOne.setPhone(phone);
|
|
@@ -1323,18 +1342,18 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
familyOne.setSexId(eSexStatu.Man.getValue());
|
|
familyOne.setSexId(eSexStatu.Man.getValue());
|
|
|
familyOne.setIsCancel(eLogOff.Unlogout.getValue());
|
|
familyOne.setIsCancel(eLogOff.Unlogout.getValue());
|
|
|
familyOne.setAffiliate(user.getCardNo());
|
|
familyOne.setAffiliate(user.getCardNo());
|
|
|
- String familyShip = dataFormatter.formatCellValue(row.getCell(12));//家属与本人关系
|
|
|
|
|
|
|
+ String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
|
|
|
familyOne.setShip(familyShip == null ? "其他" : familyShip);
|
|
familyOne.setShip(familyShip == null ? "其他" : familyShip);
|
|
|
result.add(familyOne);
|
|
result.add(familyOne);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String phoneTwo = dataFormatter.formatCellValue(row.getCell(13));//联系电话2
|
|
|
|
|
|
|
+ String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
|
|
|
if (!ObjectUtils.isEmpty(phoneTwo)) {
|
|
if (!ObjectUtils.isEmpty(phoneTwo)) {
|
|
|
if (phoneTwo.length() != 11) {
|
|
if (phoneTwo.length() != 11) {
|
|
|
return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
|
|
return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
|
|
|
}
|
|
}
|
|
|
SmartUser familyTwo = new SmartUser();
|
|
SmartUser familyTwo = new SmartUser();
|
|
|
- String familyNameTwo = dataFormatter.formatCellValue(row.getCell(14));//家属2
|
|
|
|
|
|
|
+ String familyNameTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
|
|
|
familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
|
|
familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
|
|
|
familyTwo.setDepartmentId(familyDepartmentId);
|
|
familyTwo.setDepartmentId(familyDepartmentId);
|
|
|
familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
|
|
familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
|
|
@@ -1342,21 +1361,21 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
familyTwo.setSexId(eSexStatu.Man.getValue());
|
|
familyTwo.setSexId(eSexStatu.Man.getValue());
|
|
|
familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
|
|
familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
|
|
|
familyTwo.setAffiliate(user.getCardNo());
|
|
familyTwo.setAffiliate(user.getCardNo());
|
|
|
- String familyShipTwo = dataFormatter.formatCellValue(row.getCell(15));//家属与本人关系2
|
|
|
|
|
|
|
+ String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
|
|
|
familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
|
|
familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
|
|
|
result.add(familyTwo);
|
|
result.add(familyTwo);
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//希沃不允许一个学生家长的两个手机号重复 所以做一个重复性判断
|
|
//希沃不允许一个学生家长的两个手机号重复 所以做一个重复性判断
|
|
|
- if (!ObjectUtils.isEmpty(phone) && !ObjectUtils.isEmpty(dataFormatter.formatCellValue(row.getCell(13)))) {
|
|
|
|
|
- if (phone.equals(dataFormatter.formatCellValue(row.getCell(13)))) {
|
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(phone) && !ObjectUtils.isEmpty(dataFormatter.formatCellValue(row.getCell(14)))) {
|
|
|
|
|
+ if (phone.equals(dataFormatter.formatCellValue(row.getCell(14)))) {
|
|
|
return CommonResult.fail(name + "的学生家长手机号不可重复");
|
|
return CommonResult.fail(name + "的学生家长手机号不可重复");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else {
|
|
|
//教师导入
|
|
//教师导入
|
|
|
//使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
|
|
//使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
|
|
|
//所以先使用setCellType()方法先将该单元格的类型设置为STRING
|
|
//所以先使用setCellType()方法先将该单元格的类型设置为STRING
|
|
@@ -1572,65 +1591,69 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
if (!schoolClass.equals("班级")) {
|
|
if (!schoolClass.equals("班级")) {
|
|
|
return CommonResult.fail("导入数据第一列为班级");
|
|
return CommonResult.fail("导入数据第一列为班级");
|
|
|
}
|
|
}
|
|
|
- String cardNo = dataFormatter.formatCellValue(row.getCell(2));//学号
|
|
|
|
|
|
|
+ String departmentNo = dataFormatter.formatCellValue(row.getCell(2));//部门
|
|
|
|
|
+ if (!departmentNo.equals("部门")) {
|
|
|
|
|
+ return CommonResult.fail("导入数据第二列为部门");
|
|
|
|
|
+ }
|
|
|
|
|
+ String cardNo = dataFormatter.formatCellValue(row.getCell(3));//学号
|
|
|
if (!cardNo.equals("学号")) {
|
|
if (!cardNo.equals("学号")) {
|
|
|
return CommonResult.fail("导入数据第二列为学号");
|
|
return CommonResult.fail("导入数据第二列为学号");
|
|
|
}
|
|
}
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(3));//姓名
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(4));//姓名
|
|
|
if (!name.equals("姓名")) {
|
|
if (!name.equals("姓名")) {
|
|
|
return CommonResult.fail("导入数据第三列为姓名");
|
|
return CommonResult.fail("导入数据第三列为姓名");
|
|
|
}
|
|
}
|
|
|
- String sex = dataFormatter.formatCellValue(row.getCell(4));//性别
|
|
|
|
|
|
|
+ String sex = dataFormatter.formatCellValue(row.getCell(5));//性别
|
|
|
if (!sex.equals("性别")) {
|
|
if (!sex.equals("性别")) {
|
|
|
return CommonResult.fail("导入数据第四列为性别");
|
|
return CommonResult.fail("导入数据第四列为性别");
|
|
|
}
|
|
}
|
|
|
- String nation = dataFormatter.formatCellValue(row.getCell(5));//民族
|
|
|
|
|
|
|
+ String nation = dataFormatter.formatCellValue(row.getCell(6));//民族
|
|
|
if (!nation.equals("民族")) {
|
|
if (!nation.equals("民族")) {
|
|
|
return CommonResult.fail("导入数据第五列为民族");
|
|
return CommonResult.fail("导入数据第五列为民族");
|
|
|
}
|
|
}
|
|
|
- String cardId = dataFormatter.formatCellValue(row.getCell(6));//身份证
|
|
|
|
|
|
|
+ String cardId = dataFormatter.formatCellValue(row.getCell(7));//身份证
|
|
|
if (!cardId.equals("身份证")) {
|
|
if (!cardId.equals("身份证")) {
|
|
|
return CommonResult.fail("导入数据第六列为身份证");
|
|
return CommonResult.fail("导入数据第六列为身份证");
|
|
|
}
|
|
}
|
|
|
- String headImage = dataFormatter.formatCellValue(row.getCell(7));//照片
|
|
|
|
|
|
|
+ String headImage = dataFormatter.formatCellValue(row.getCell(8));//照片
|
|
|
if (!headImage.equals("照片")) {
|
|
if (!headImage.equals("照片")) {
|
|
|
return CommonResult.fail("导入数据第七列为照片");
|
|
return CommonResult.fail("导入数据第七列为照片");
|
|
|
}
|
|
}
|
|
|
- String timeGroup = dataFormatter.formatCellValue(row.getCell(8));//常规时间组
|
|
|
|
|
|
|
+ String timeGroup = dataFormatter.formatCellValue(row.getCell(9));//常规时间组
|
|
|
if (!timeGroup.equals("常规时间组")) {
|
|
if (!timeGroup.equals("常规时间组")) {
|
|
|
return CommonResult.fail("导入数据第八列为常规时间组");
|
|
return CommonResult.fail("导入数据第八列为常规时间组");
|
|
|
}
|
|
}
|
|
|
- String address = dataFormatter.formatCellValue(row.getCell(9));//住址
|
|
|
|
|
|
|
+ String address = dataFormatter.formatCellValue(row.getCell(10));//住址
|
|
|
if (!address.equals("住址")) {
|
|
if (!address.equals("住址")) {
|
|
|
return CommonResult.fail("导入数据第九列为住址");
|
|
return CommonResult.fail("导入数据第九列为住址");
|
|
|
}
|
|
}
|
|
|
- String phone = dataFormatter.formatCellValue(row.getCell(10));//联系电话
|
|
|
|
|
|
|
+ String phone = dataFormatter.formatCellValue(row.getCell(11));//联系电话
|
|
|
if (!phone.equals("联系电话")) {
|
|
if (!phone.equals("联系电话")) {
|
|
|
return CommonResult.fail("导入数据第十列为联系电话");
|
|
return CommonResult.fail("导入数据第十列为联系电话");
|
|
|
}
|
|
}
|
|
|
- String family = dataFormatter.formatCellValue(row.getCell(11));//家属
|
|
|
|
|
|
|
+ String family = dataFormatter.formatCellValue(row.getCell(12));//家属
|
|
|
if (!family.equals("家属")) {
|
|
if (!family.equals("家属")) {
|
|
|
return CommonResult.fail("导入数据第十一列为家属");
|
|
return CommonResult.fail("导入数据第十一列为家属");
|
|
|
}
|
|
}
|
|
|
- String familyShip = dataFormatter.formatCellValue(row.getCell(12));//家属与本人关系
|
|
|
|
|
|
|
+ String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
|
|
|
if (!familyShip.equals("家属与本人关系")) {
|
|
if (!familyShip.equals("家属与本人关系")) {
|
|
|
return CommonResult.fail("导入数据第十二列为家属与本人关系");
|
|
return CommonResult.fail("导入数据第十二列为家属与本人关系");
|
|
|
}
|
|
}
|
|
|
- String phoneTwo = dataFormatter.formatCellValue(row.getCell(13));//联系电话2
|
|
|
|
|
|
|
+ String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
|
|
|
if (!phoneTwo.equals("联系电话2")) {
|
|
if (!phoneTwo.equals("联系电话2")) {
|
|
|
return CommonResult.fail("导入数据第十三列为联系电话2");
|
|
return CommonResult.fail("导入数据第十三列为联系电话2");
|
|
|
}
|
|
}
|
|
|
- String familyTwo = dataFormatter.formatCellValue(row.getCell(14));//家属2
|
|
|
|
|
|
|
+ String familyTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
|
|
|
if (!familyTwo.equals("家属2")) {
|
|
if (!familyTwo.equals("家属2")) {
|
|
|
return CommonResult.fail("导入数据第十四列为家属2");
|
|
return CommonResult.fail("导入数据第十四列为家属2");
|
|
|
}
|
|
}
|
|
|
- String familyShipTwo = dataFormatter.formatCellValue(row.getCell(15));//家属与本人关系2
|
|
|
|
|
|
|
+ String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
|
|
|
if (!familyShipTwo.equals("家属与本人关系2")) {
|
|
if (!familyShipTwo.equals("家属与本人关系2")) {
|
|
|
return CommonResult.fail("导入数据第十五列为家属与本人关系2");
|
|
return CommonResult.fail("导入数据第十五列为家属与本人关系2");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
SmartUser user = new SmartUser();
|
|
SmartUser user = new SmartUser();
|
|
|
- String name = dataFormatter.formatCellValue(row.getCell(3));
|
|
|
|
|
|
|
+ String name = dataFormatter.formatCellValue(row.getCell(4));
|
|
|
// if (ObjectUtils.isEmpty(name)) {
|
|
// if (ObjectUtils.isEmpty(name)) {
|
|
|
// return CommonResult.fail("第" + (rowNum + 1) + "条数据的名称不能为空");
|
|
// return CommonResult.fail("第" + (rowNum + 1) + "条数据的名称不能为空");
|
|
|
// }
|
|
// }
|
|
@@ -1649,7 +1672,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//不判断重复性 因为会出现双胞胎
|
|
//不判断重复性 因为会出现双胞胎
|
|
|
- String phone = dataFormatter.formatCellValue(row.getCell(10));
|
|
|
|
|
|
|
+ String phone = dataFormatter.formatCellValue(row.getCell(11));
|
|
|
// if (!ObjectUtils.isEmpty(phone)) {
|
|
// if (!ObjectUtils.isEmpty(phone)) {
|
|
|
// phones.add(phone);
|
|
// phones.add(phone);
|
|
|
// }
|
|
// }
|
|
@@ -1659,35 +1682,50 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
|
|
|
|
|
//性别是否为空判断
|
|
//性别是否为空判断
|
|
|
- String sex = dataFormatter.formatCellValue(row.getCell(4));
|
|
|
|
|
|
|
+ String sex = dataFormatter.formatCellValue(row.getCell(5));
|
|
|
if (ObjectUtils.isEmpty(sex)) {
|
|
if (ObjectUtils.isEmpty(sex)) {
|
|
|
return CommonResult.fail(name + "的性别不能为空");
|
|
return CommonResult.fail(name + "的性别不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//家庭住址是否为空判断
|
|
//家庭住址是否为空判断
|
|
|
- String address = dataFormatter.formatCellValue(row.getCell(9));
|
|
|
|
|
|
|
+ String address = dataFormatter.formatCellValue(row.getCell(10));
|
|
|
|
|
|
|
|
//民族是否为空判断
|
|
//民族是否为空判断
|
|
|
- String nation = dataFormatter.formatCellValue(row.getCell(5));
|
|
|
|
|
|
|
+ String nation = dataFormatter.formatCellValue(row.getCell(6));
|
|
|
if (ObjectUtils.isEmpty(nation)) {
|
|
if (ObjectUtils.isEmpty(nation)) {
|
|
|
return CommonResult.fail(name + "的民族不能为空");
|
|
return CommonResult.fail(name + "的民族不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//部门是否为空判断
|
|
//部门是否为空判断
|
|
|
- String department = dataFormatter.formatCellValue(row.getCell(1)).replace("年级", "") + "学生";
|
|
|
|
|
- if (ObjectUtils.isEmpty(department)) {
|
|
|
|
|
|
|
+ String department = dataFormatter.formatCellValue(row.getCell(2));
|
|
|
|
|
+ if (ObjectUtils.isEmpty(nation)) {
|
|
|
return CommonResult.fail(name + "的部门不能为空");
|
|
return CommonResult.fail(name + "的部门不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ Integer parentDid = null;
|
|
|
Integer departmentId = null;
|
|
Integer departmentId = null;
|
|
|
- Optional<SmartDepartment> departModel = departments.stream().filter(e -> e.getName().equals(department)).findFirst();
|
|
|
|
|
- if (departModel != null && departModel.isPresent()) {
|
|
|
|
|
- departmentId = departModel.get().getId();
|
|
|
|
|
- } else {
|
|
|
|
|
- departmentId = 1;
|
|
|
|
|
|
|
+ String[] departmentStrs = department.split("/");
|
|
|
|
|
+ for (int i = 0; i < departmentStrs.length; i++) {
|
|
|
|
|
+ String departmentName = departmentStrs[i];
|
|
|
|
|
+ Optional<SmartDepartment> oD = departments.stream().filter(e -> e.getName().equals(departmentName)).findFirst();
|
|
|
|
|
+ if(oD != null && oD.isPresent()){
|
|
|
|
|
+ parentDid = oD.get().getId();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ String bsDepartment = insertDepartmentToBs(departmentName);
|
|
|
|
|
+ if(bsDepartment == null){
|
|
|
|
|
+ return CommonResult.fail(name + "的部门添加到百胜失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ SmartDepartment sdParent = new SmartDepartment();
|
|
|
|
|
+ sdParent.setParentId(parentDid);
|
|
|
|
|
+ sdParent.setName(departmentName);
|
|
|
|
|
+ sdParent.setBsDepartmentNo(bsDepartment);
|
|
|
|
|
+ int departmentData = smartDepartmentService.insertSmartDepartment(sdParent);
|
|
|
|
|
+ departmentId = departmentData;
|
|
|
|
|
+ parentDid = departmentData;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//学号重复判断
|
|
//学号重复判断
|
|
|
- String cardNo = dataFormatter.formatCellValue(row.getCell(2));
|
|
|
|
|
|
|
+ String cardNo = dataFormatter.formatCellValue(row.getCell(3));
|
|
|
if (!ObjectUtils.isEmpty(cardNo)) {
|
|
if (!ObjectUtils.isEmpty(cardNo)) {
|
|
|
cardNos.add(cardNo);
|
|
cardNos.add(cardNo);
|
|
|
}
|
|
}
|
|
@@ -1696,7 +1734,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//身份证重复判断
|
|
//身份证重复判断
|
|
|
- String idCard = dataFormatter.formatCellValue(row.getCell(6));
|
|
|
|
|
|
|
+ String idCard = dataFormatter.formatCellValue(row.getCell(7));
|
|
|
if (!ObjectUtils.isEmpty(idCard)) {
|
|
if (!ObjectUtils.isEmpty(idCard)) {
|
|
|
idCards.add(idCard);
|
|
idCards.add(idCard);
|
|
|
}
|
|
}
|
|
@@ -1709,7 +1747,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
user.setIdCard(idCard == null ? "" : idCard);
|
|
user.setIdCard(idCard == null ? "" : idCard);
|
|
|
user.setSexId(sex == null ? eSexStatu.Man.getValue() : eSexStatu.integerOf(sex));
|
|
user.setSexId(sex == null ? eSexStatu.Man.getValue() : eSexStatu.integerOf(sex));
|
|
|
user.setDepartmentId(departmentId);
|
|
user.setDepartmentId(departmentId);
|
|
|
- String cellImage = dataFormatter.formatCellValue(row.getCell(7));
|
|
|
|
|
|
|
+ String cellImage = dataFormatter.formatCellValue(row.getCell(8));
|
|
|
user.setHeadImage(cellImage);
|
|
user.setHeadImage(cellImage);
|
|
|
user.setDormitoryNumber("");
|
|
user.setDormitoryNumber("");
|
|
|
String grade = schoolGrade == null ? "" : schoolGrade;
|
|
String grade = schoolGrade == null ? "" : schoolGrade;
|
|
@@ -1738,7 +1776,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
user.setOfStudent("");
|
|
user.setOfStudent("");
|
|
|
user.setGraduate("");
|
|
user.setGraduate("");
|
|
|
user.setDuties(null);
|
|
user.setDuties(null);
|
|
|
- String timeGroup = dataFormatter.formatCellValue(row.getCell(8));
|
|
|
|
|
|
|
+ String timeGroup = dataFormatter.formatCellValue(row.getCell(9));
|
|
|
Optional<SmartTimeGroup> groupData = timeGroups.stream().filter(e -> e.getName().equals(timeGroup)).findFirst();
|
|
Optional<SmartTimeGroup> groupData = timeGroups.stream().filter(e -> e.getName().equals(timeGroup)).findFirst();
|
|
|
if (groupData != null && groupData.isPresent()) {
|
|
if (groupData != null && groupData.isPresent()) {
|
|
|
user.setTimeGroupId(groupData.get().getId());
|
|
user.setTimeGroupId(groupData.get().getId());
|
|
@@ -1769,7 +1807,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SmartUser familyOne = new SmartUser();
|
|
SmartUser familyOne = new SmartUser();
|
|
|
- String family = dataFormatter.formatCellValue(row.getCell(11));//家属
|
|
|
|
|
|
|
+ String family = dataFormatter.formatCellValue(row.getCell(12));//家属
|
|
|
familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
|
|
familyOne.setName(!ObjectUtils.isEmpty(family) ? family : "家长");
|
|
|
familyOne.setDepartmentId(familyDepartmentId);
|
|
familyOne.setDepartmentId(familyDepartmentId);
|
|
|
familyOne.setPhone(phone);
|
|
familyOne.setPhone(phone);
|
|
@@ -1777,18 +1815,18 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
familyOne.setSexId(eSexStatu.Man.getValue());
|
|
familyOne.setSexId(eSexStatu.Man.getValue());
|
|
|
familyOne.setIsCancel(eLogOff.Unlogout.getValue());
|
|
familyOne.setIsCancel(eLogOff.Unlogout.getValue());
|
|
|
familyOne.setAffiliate(user.getCardNo());
|
|
familyOne.setAffiliate(user.getCardNo());
|
|
|
- String familyShip = dataFormatter.formatCellValue(row.getCell(12));//家属与本人关系
|
|
|
|
|
|
|
+ String familyShip = dataFormatter.formatCellValue(row.getCell(13));//家属与本人关系
|
|
|
familyOne.setShip(familyShip == null ? "其他" : familyShip);
|
|
familyOne.setShip(familyShip == null ? "其他" : familyShip);
|
|
|
result.add(familyOne);
|
|
result.add(familyOne);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- String phoneTwo = dataFormatter.formatCellValue(row.getCell(13));//联系电话2
|
|
|
|
|
|
|
+ String phoneTwo = dataFormatter.formatCellValue(row.getCell(14));//联系电话2
|
|
|
if (!ObjectUtils.isEmpty(phoneTwo)) {
|
|
if (!ObjectUtils.isEmpty(phoneTwo)) {
|
|
|
if (phoneTwo.length() != 11) {
|
|
if (phoneTwo.length() != 11) {
|
|
|
return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
|
|
return CommonResult.fail(name + "的学生家长手机号长度不符合标准");
|
|
|
}
|
|
}
|
|
|
SmartUser familyTwo = new SmartUser();
|
|
SmartUser familyTwo = new SmartUser();
|
|
|
- String familyNameTwo = dataFormatter.formatCellValue(row.getCell(14));//家属2
|
|
|
|
|
|
|
+ String familyNameTwo = dataFormatter.formatCellValue(row.getCell(15));//家属2
|
|
|
familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
|
|
familyTwo.setName(!ObjectUtils.isEmpty(familyNameTwo) ? familyNameTwo : "家长");
|
|
|
familyTwo.setDepartmentId(familyDepartmentId);
|
|
familyTwo.setDepartmentId(familyDepartmentId);
|
|
|
familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
|
|
familyTwo.setPhone(phoneTwo == null ? "" : phoneTwo);
|
|
@@ -1796,15 +1834,15 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
familyTwo.setSexId(eSexStatu.Man.getValue());
|
|
familyTwo.setSexId(eSexStatu.Man.getValue());
|
|
|
familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
|
|
familyTwo.setIsCancel(eLogOff.Unlogout.getValue());
|
|
|
familyTwo.setAffiliate(user.getCardNo());
|
|
familyTwo.setAffiliate(user.getCardNo());
|
|
|
- String familyShipTwo = dataFormatter.formatCellValue(row.getCell(15));//家属与本人关系2
|
|
|
|
|
|
|
+ String familyShipTwo = dataFormatter.formatCellValue(row.getCell(16));//家属与本人关系2
|
|
|
familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
|
|
familyTwo.setShip(familyShipTwo == null ? "其他" : familyShipTwo);
|
|
|
result.add(familyTwo);
|
|
result.add(familyTwo);
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//希沃不允许一个学生家长的两个手机号重复 所以做一个重复性判断
|
|
//希沃不允许一个学生家长的两个手机号重复 所以做一个重复性判断
|
|
|
- if (!ObjectUtils.isEmpty(phone) && !ObjectUtils.isEmpty(dataFormatter.formatCellValue(row.getCell(13)))) {
|
|
|
|
|
- if (phone.equals(dataFormatter.formatCellValue(row.getCell(13)))) {
|
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(phone) && !ObjectUtils.isEmpty(dataFormatter.formatCellValue(row.getCell(14)))) {
|
|
|
|
|
+ if (phone.equals(dataFormatter.formatCellValue(row.getCell(14)))) {
|
|
|
return CommonResult.fail(name + "的学生家长手机号不可重复");
|
|
return CommonResult.fail(name + "的学生家长手机号不可重复");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1973,6 +2011,46 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public String insertDepartmentToBs(String name) throws Exception {
|
|
|
|
|
+ //region 百胜添加部门数据
|
|
|
|
|
+ String appId = controlConfig.getAppId();
|
|
|
|
|
+ String schoolno = controlConfig.getSchoolCode();
|
|
|
|
|
+ String timestamp = TimeExchange.DateNowTimeStamo();
|
|
|
|
|
+ String appSecret = controlConfig.getAppSecret();
|
|
|
|
|
+ String url = controlConfig.getUrl() + "department/create";
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject jsonobject = new JSONObject();
|
|
|
|
|
+ jsonobject.put("appid", appId);
|
|
|
|
|
+ String str = "{\"department_name\":\"" + name + "\"}";
|
|
|
|
|
+ String aesStr = URLEncoder.encode(AesTestOne.encrypt(str, controlConfig.getAppSecret()), "UTF-8");
|
|
|
|
|
+ jsonobject.put("data", aesStr);
|
|
|
|
|
+ jsonobject.put("schoolno", schoolno);
|
|
|
|
|
+ jsonobject.put("timestamp", timestamp);
|
|
|
|
|
+
|
|
|
|
|
+ String md5Str = "appid=" + appId + "&data={\"department_name\":\"" + name + "\"}" + "&schoolno=" + schoolno + "×tamp=" + timestamp + "&key=" + appSecret;
|
|
|
|
|
+ String sign = CommonUtil.MD5(md5Str);
|
|
|
|
|
+ //sign签名
|
|
|
|
|
+ jsonobject.put("sign", sign);
|
|
|
|
|
+
|
|
|
|
|
+ //返回的结果中 code为1表示成功
|
|
|
|
|
+ String bsResult = RequestUtils.httpPost(url, jsonobject.toJSONString());
|
|
|
|
|
+
|
|
|
|
|
+ if (bsResult.contains("添加成功")) {
|
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
|
+ BsDepartmentVo department = objectMapper.readValue(bsResult, BsDepartmentVo.class);
|
|
|
|
|
+
|
|
|
|
|
+ // URL解码
|
|
|
|
|
+ String decodedUrl = URLDecoder.decode(department.getData(), "UTF-8");
|
|
|
|
|
+
|
|
|
|
|
+ BsDepartmentNoVo departmentData = objectMapper.readValue(decrypt(decodedUrl, controlConfig.getAppSecret()), BsDepartmentNoVo.class);
|
|
|
|
|
+
|
|
|
|
|
+ return departmentData.getDepartment_no();
|
|
|
|
|
+ }
|
|
|
|
|
+ //endregion
|
|
|
|
|
+
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 批量更新用户
|
|
//region 批量更新用户
|
|
@@ -2523,7 +2601,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
//region 希沃新增编辑学生家长信息
|
|
//region 希沃新增编辑学生家长信息
|
|
|
if (useXw == 1) {
|
|
if (useXw == 1) {
|
|
|
- CommonResult insertOrUpdateStudent = insertOrUpdateStudentParent(seewoClient, studentDatas, isur.getName(), isur.getPhone(), true);
|
|
|
|
|
|
|
+ CommonResult insertOrUpdateStudent = insertOrUpdateStudentParent(seewoClient, studentDatas, "其他", isur.getPhone(), true);
|
|
|
if (!insertOrUpdateStudent.isSuccess()) {
|
|
if (!insertOrUpdateStudent.isSuccess()) {
|
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdateStudent.getMessage());
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdateStudent.getMessage());
|
|
|
}
|
|
}
|
|
@@ -2855,7 +2933,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
//region 希沃新增编辑学生家长信息
|
|
//region 希沃新增编辑学生家长信息
|
|
|
if (useXw == 1) {
|
|
if (useXw == 1) {
|
|
|
//学生与家长列表,最大100条
|
|
//学生与家长列表,最大100条
|
|
|
- CommonResult insertOrUpdateResult = insertOrUpdateStudentParent(seewoClient, studentDatas, usur.getName(), usur.getPhone(), false);
|
|
|
|
|
|
|
+ CommonResult insertOrUpdateResult = insertOrUpdateStudentParent(seewoClient, studentDatas, "其他", usur.getPhone(), false);
|
|
|
if (!insertOrUpdateResult.isSuccess()) {
|
|
if (!insertOrUpdateResult.isSuccess()) {
|
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdateResult.getMessage());
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdateResult.getMessage());
|
|
|
}
|
|
}
|
|
@@ -2929,7 +3007,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
|
|
return CommonResult.fail("绑定失败,希沃学生家长最多绑定四个家长");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- CommonResult insertOrUpdate = insertOrUpdateStudentParent(seewoClient, studentDatas, su.getName(), su.getPhone(), true);
|
|
|
|
|
|
|
+ CommonResult insertOrUpdate = insertOrUpdateStudentParent(seewoClient, studentDatas, su.getShip(), su.getPhone(), true);
|
|
|
if (!insertOrUpdate.isSuccess()) {
|
|
if (!insertOrUpdate.isSuccess()) {
|
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdate.getMessage());
|
|
return CommonResult.fail("希沃平台:" + insertOrUpdate.getMessage());
|
|
|
}
|
|
}
|
|
@@ -3892,8 +3970,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
//region 希沃新增编辑学生家长信息
|
|
//region 希沃新增编辑学生家长信息
|
|
|
- public CommonResult insertOrUpdateStudentParent(SeewoClient
|
|
|
|
|
- seewoClient, List<SmartUser> studentDatas, String name, String phone, boolean isInsert) {
|
|
|
|
|
|
|
+ public CommonResult insertOrUpdateStudentParent(SeewoClient seewoClient, List<SmartUser> studentDatas, String name, String phone, boolean isInsert) {
|
|
|
|
|
|
|
|
//region 希沃新增编辑学生家长信息
|
|
//region 希沃新增编辑学生家长信息
|
|
|
//学生与家长列表,最大100条
|
|
//学生与家长列表,最大100条
|
|
@@ -5334,8 +5411,8 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
|
|
|
|
|
for (int i = 0; i < vos.size(); i++) {
|
|
for (int i = 0; i < vos.size(); i++) {
|
|
|
StatisticsStatementVo vo = vos.get(i);
|
|
StatisticsStatementVo vo = vos.get(i);
|
|
|
- Row dataRow = sheet.createRow(i+1);
|
|
|
|
|
- dataRow.createCell(0).setCellValue(i+1);
|
|
|
|
|
|
|
+ Row dataRow = sheet.createRow(i + 1);
|
|
|
|
|
+ dataRow.createCell(0).setCellValue(i + 1);
|
|
|
dataRow.createCell(1).setCellValue(vo.getGradeName());
|
|
dataRow.createCell(1).setCellValue(vo.getGradeName());
|
|
|
dataRow.createCell(2).setCellValue(vo.getClassName());
|
|
dataRow.createCell(2).setCellValue(vo.getClassName());
|
|
|
dataRow.createCell(3).setCellValue(vo.getNormal());
|
|
dataRow.createCell(3).setCellValue(vo.getNormal());
|