|
|
|
@ -130,6 +130,16 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
if(maintainVo != null && maintainVo.getId().equals(emailMaintain.getId())){ |
|
|
|
|
return ResponseEntity.ok(R.error("邮箱地址已存在!")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String userId = emailMaintain.getUserId(); |
|
|
|
|
|
|
|
|
|
String userName = emailMaintainService.getUserName(userId); |
|
|
|
|
if(StringUtils.isBlank(userName)){ |
|
|
|
|
R data = new R(101, "用户编码在系统中查询不到,请核实!"); |
|
|
|
|
data.put("data", ""); |
|
|
|
|
return ResponseEntity.ok(data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean b = emailMaintainService.update(emailMaintain); |
|
|
|
|
if(b){ |
|
|
|
|
return ResponseEntity.ok(R.ok()); |
|
|
|
@ -214,6 +224,13 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,用户邮箱地址重复,请核实!"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int i = emailMaintainService.selectByEmail(maintainExcel.getEmailAddress()); |
|
|
|
|
if(i>0){ |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,邮箱数据已存在,请核实!"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mailTitleList.add(maintainExcel.getEmailAddress()); |
|
|
|
|
|
|
|
|
|
EmailMaintainVo maintainVo = new EmailMaintainVo(); |
|
|
|
@ -235,7 +252,11 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
if (ObjectUtil.isNotEmpty(errorMsgList)) { |
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
|
json.put("datalist", errorMsgList); |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data",Base64.encode(json.toJSONString()))); |
|
|
|
|
|
|
|
|
|
R data = new R(101, "校验信息有误"); |
|
|
|
|
data.put("data", json); |
|
|
|
|
return ResponseEntity.ok(data); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
int i = emailMaintainService.insertBatch(mailList); |
|
|
|
|
if(i > 0){ |
|
|
|
@ -261,16 +282,16 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
if(StringUtils.isEmpty(userCode)){ |
|
|
|
|
return ResponseEntity.ok(R.error("数据不能为空!")); |
|
|
|
|
} |
|
|
|
|
DynamicContextHolder.push(DbConstant.BASICS_READ); |
|
|
|
|
String userName = emailMaintainService.getUserName(userCode); |
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
|
if(StringUtils.isNotEmpty(userName)){ |
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
|
json.put("datalist", userName); |
|
|
|
|
log.debug("返回结果:{}", json.toJSONString()); |
|
|
|
|
String jsonString = Base64.encode(json.toJSONString()); |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data",jsonString)); |
|
|
|
|
}else{ |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data","未查询到用户名为"+userName+"数据")); |
|
|
|
|
} |
|
|
|
|
return ResponseEntity.ok(R.error("未查询到相应数据!")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|