Commit 300f3d9e authored by yanzg's avatar yanzg

消除成功接收处理

parent d353d6f7
...@@ -619,4 +619,18 @@ public class DateHelper { ...@@ -619,4 +619,18 @@ public class DateHelper {
public static String toYear(Date time) { public static String toYear(Date time) {
return getDateTimeString("yyyy-01-01", time); return getDateTimeString("yyyy-01-01", time);
} }
/**
* 判断是否时时间格式字符串
*
* @param from 来源字符串
* @return 是否时时间字符串
*/
public static boolean isDateFormat(String from) {
try {
return DateAutoHelper.getAutoDate(from) != null;
} catch (Exception ex) {
return false;
}
}
} }
...@@ -5,10 +5,12 @@ import com.yanzuoguang.dao.DaoConst; ...@@ -5,10 +5,12 @@ import com.yanzuoguang.dao.DaoConst;
import com.yanzuoguang.db.Impl.AllBeanRowMapper; import com.yanzuoguang.db.Impl.AllBeanRowMapper;
import com.yanzuoguang.util.base.ObjectHelper; import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.exception.CodeException; import com.yanzuoguang.util.exception.CodeException;
import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.InitDao; import com.yanzuoguang.util.vo.InitDao;
import com.yanzuoguang.util.vo.MapRow; import com.yanzuoguang.util.vo.MapRow;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -309,15 +311,26 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao { ...@@ -309,15 +311,26 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
protected <T extends Object> String getMd5(String sqlName, T model) { protected <T extends Object> String getMd5(String sqlName, T model) {
SqlData sql = this.getSql(sqlName); SqlData sql = this.getSql(sqlName);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
String date = StringHelper.EMPTY;
for (SqlDataField field : sql.sqlDataFields) { for (SqlDataField field : sql.sqlDataFields) {
if (sb.length() > 0) { if (sb.length() > 0) {
sb.append(":"); sb.append(":");
} }
Object item = ObjectHelper.get(model, field.paraName); Object item = ObjectHelper.get(model, field.paraName);
String itemString = String.valueOf(item);
if (item instanceof Date) {
date = DateHelper.getDateTimeString((Date) item);
} else if (DateHelper.isDateFormat(itemString)) {
date = itemString;
}
sb.append(item); sb.append(item);
} }
if (StringHelper.isEmpty(date)) {
return StringHelper.getNewMD5Id(DateHelper.getDateTime(date), sb.toString());
} else {
return StringHelper.md5(sb.toString()); return StringHelper.md5(sb.toString());
} }
}
/** /**
* 添加统计数据列表 * 添加统计数据列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment