|
@@ -4,6 +4,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
@@ -46,9 +47,14 @@ public class EmployeeInfoController extends BaseController {
|
|
|
if (sysUser == null) {
|
|
|
return failed("用户信息获取失败");
|
|
|
}
|
|
|
- EmployeeInfo info = employeeInfoService.findByPhone(employeeInfo.getMobileNo());
|
|
|
- if(info != null && !employeeInfo.getCover()){
|
|
|
+ List<EmployeeInfo> infoList = employeeInfoService.findByPhone(employeeInfo.getMobileNo());
|
|
|
+ if(infoList != null && infoList.size() > 2){
|
|
|
+ return failed("该手机号已在系统中存在多条,请更新原有数据");
|
|
|
+ }
|
|
|
+ if(infoList != null && infoList.size() > 0){
|
|
|
if(employeeInfo.getCover()){
|
|
|
+ EmployeeInfo info = infoList.get(0);
|
|
|
+ employeeInfo.setId(info.getId());
|
|
|
employeeInfo.setOperatorId(sysUser.getId());
|
|
|
Date date = new Date();
|
|
|
employeeInfo.setUpdateTime(date);
|