|
|
|
@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -139,11 +140,16 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
/** |
|
|
|
|
* 编辑数据 |
|
|
|
|
* |
|
|
|
|
* @param id id |
|
|
|
|
* @param pramsMap |
|
|
|
|
* @return 删除结果 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/delete") |
|
|
|
|
public ResponseEntity<R> delete(@RequestParam String id) { |
|
|
|
|
public ResponseEntity<R> delete(@RequestBody Map<String, Object> pramsMap) { |
|
|
|
|
|
|
|
|
|
String id = pramsMap.get("id").toString(); |
|
|
|
|
|
|
|
|
|
log.info("传入的删除参数id={}",id); |
|
|
|
|
|
|
|
|
|
DynamicContextHolder.push(DbConstant.BASICS_READ); |
|
|
|
|
boolean b = emailMaintainService.deleteById(id); |
|
|
|
|
if(b){ |
|
|
|
@ -173,9 +179,11 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
} |
|
|
|
|
List<String> errorMsgList = Lists.newArrayList(); |
|
|
|
|
List<EmailMaintainVo> mailList = Lists.newArrayList(); |
|
|
|
|
|
|
|
|
|
int resultIndex = 2; |
|
|
|
|
List<String> mailTitleList = new ArrayList<>(); |
|
|
|
|
int resultIndex = 1; |
|
|
|
|
for (EmailMaintainExcel maintainExcel : emailMaintainExcels) { |
|
|
|
|
|
|
|
|
|
resultIndex++; |
|
|
|
|
String userId = maintainExcel.getUserId(); |
|
|
|
|
if (StringUtils.isBlank(userId)) { |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,用户编码不能为空"); |
|
|
|
@ -192,7 +200,7 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,邮箱地址不能为空"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if(!"@qq.com".equals(address) || !"@163.com".equals(address)){ |
|
|
|
|
if(!address.contains("@qq.com") && !address.contains("@163.com")){ |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,不支持该邮箱类型"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
@ -201,9 +209,17 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,授权码不能为空"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(mailTitleList.contains(maintainExcel.getEmailAddress())){ |
|
|
|
|
errorMsgList.add("第" + resultIndex + "行,用户邮箱地址重复,请核实!"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
mailTitleList.add(maintainExcel.getEmailAddress()); |
|
|
|
|
|
|
|
|
|
EmailMaintainVo maintainVo = new EmailMaintainVo(); |
|
|
|
|
maintainVo.setId(UUIDUtils.generateShortUuid()); |
|
|
|
|
maintainVo.setCompanyCode(deptId); |
|
|
|
|
maintainVo.setDeptId(deptId); |
|
|
|
|
maintainVo.setDeptName(deptName); |
|
|
|
|
maintainVo.setUsername(userName); |
|
|
|
|
maintainVo.setUserId(userId); |
|
|
|
@ -215,7 +231,6 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
maintainVo.setCreateTime(new Date()); |
|
|
|
|
maintainVo.setModifyTime(new Date()); |
|
|
|
|
mailList.add(maintainVo); |
|
|
|
|
resultIndex++; |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isNotEmpty(errorMsgList)) { |
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
|