add java email deal
This commit is contained in:
parent
ba3bf4667f
commit
47f081f5bc
|
@ -1,3 +1,5 @@
|
||||||
*~
|
*~
|
||||||
/.idea
|
/.idea
|
||||||
.*
|
.*
|
||||||
|
*.iml
|
||||||
|
target/
|
||||||
|
|
|
@ -1,78 +0,0 @@
|
||||||
|
|
||||||
public static void main(String[] args){
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
//return "redirect:/index.html?c=scene&key=hot";
|
|
||||||
for (Map.Entry<String, EleDataAtom> entry : eleDataAtomMap.entrySet()) {
|
|
||||||
}
|
|
||||||
String[] strings = os.trim().split("\\s+");
|
|
||||||
|
|
||||||
Calendar cal = Calendar.getInstance();
|
|
||||||
// Specific Day 2017.3.16 00:00:00
|
|
||||||
cal.set(2017, Calendar.MARCH, 16, 0, 0, 0);
|
|
||||||
Date date = cal.getTime();
|
|
||||||
|
|
||||||
// url decode using java
|
|
||||||
String result = java.net.URLDecoder.decode(url, "UTF-8");// java ArrayList swap elements
|
|
||||||
Collections.swap(List<?> list, int i, int j);
|
|
||||||
|
|
||||||
try {
|
|
||||||
//方法一:采用IOUtils
|
|
||||||
InputStream inputStream = request.getInputStream();
|
|
||||||
String rs = IOUtils.toString(inputStream);
|
|
||||||
|
|
||||||
// 方法二:分段读
|
|
||||||
final int bufferSize = 1024;
|
|
||||||
final char[] buffer = new char[bufferSize];
|
|
||||||
final StringBuilder out = new StringBuilder();
|
|
||||||
Reader in = new InputStreamReader(inputStream, "UTF-8");
|
|
||||||
for (; ; ) {
|
|
||||||
int rsz = in.read(buffer, 0, buffer.length);
|
|
||||||
if (rsz < 0)
|
|
||||||
break;
|
|
||||||
out.append(buffer, 0, rsz);
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONArray jsonArray = JSONArray.parseArray(out.toString());
|
|
||||||
} catch (IOException e) {
|
|
||||||
APISysLog.warn("", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// java 7 随机int区间
|
|
||||||
int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否完成了所有审核!!
|
|
||||||
* 判断当前用户执行审核通过之后(当前用户能提交,则肯定是具有相应审核权限的),审核工作是否已经完成
|
|
||||||
* 完成的条件应该是: recordDTO中保存的reviewType + 当前用户审核的 reviewType = 当前运营位所需要的所有reviewType
|
|
||||||
* @return
|
|
||||||
* @param attribute 运营位的审核属性
|
|
||||||
* @param reviewResultVo 当前用户的审核信息
|
|
||||||
* @param recordDTO 数据库中已经拥有的审核信息
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private boolean isFinishReview(SceneAttribute attribute,ReviewResultVo reviewResultVo,RecordDTO recordDTO) {
|
|
||||||
List<Integer> allReviewType = new ArrayList<Integer>();
|
|
||||||
if (attribute.isHasVisionReview()) {
|
|
||||||
allReviewType.add(RecordReviewEnum.VISION.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attribute.isHasContentReview()) {
|
|
||||||
allReviewType.add(RecordReviewEnum.CONTENT.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Integer> hasReviewType = new ArrayList<Integer>();
|
|
||||||
if (StringUtils.isNotBlank(recordDTO.getViewInfo())) {
|
|
||||||
RecordViewInfo recordViewInfo = JSONObject.parseObject(recordDTO.getViewInfo(), RecordViewInfo.class);
|
|
||||||
for (ReviewEvent reviewEvent : recordViewInfo.getEvents()) {
|
|
||||||
hasReviewType.add(reviewEvent.getReviewType());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Integer reviewType : reviewResultVo.getReviewList()) {
|
|
||||||
hasReviewType.add(reviewType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return allReviewType.size() == hasReviewType.size();
|
|
||||||
}
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.github.aborn</groupId>
|
||||||
|
<artifactId>CodeSnippet</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.github.aborn.tools;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author aborn
|
||||||
|
* @date 2021/06/30 10:56 AM
|
||||||
|
*/
|
||||||
|
public class StringTools {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String inputValue = "zhangsan <zhangsan@qq.com>; lisi <lisi@hotmail.com>; ";
|
||||||
|
|
||||||
|
String[] arr = inputValue.split(";");
|
||||||
|
List<String> resultList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (String item : arr) {
|
||||||
|
if (item.contains("<")) {
|
||||||
|
String[] arrItem = item.split("<");
|
||||||
|
if (arrItem.length > 0 && !resultList.contains(arrItem[0].trim())) {
|
||||||
|
resultList.add(arrItem[0].trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(String.join(";", resultList));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.github.aborn.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author aborn
|
||||||
|
* @date 2021/06/30 11:23 AM
|
||||||
|
*/
|
||||||
|
public class NumberUtils {
|
||||||
|
}
|
Loading…
Reference in New Issue