【codeReview】标准法规审计
This commit is contained in:
+8
-2
@@ -32,7 +32,13 @@ public class FieldCommon {
|
||||
);
|
||||
|
||||
public static final String MODULE = "module"; // 表名标识
|
||||
public static final String ORDER_BY = "orderBy";
|
||||
public static final String ORDER_BY_FIELD = "orderByField";
|
||||
public static final String ORDER_BY = "orderBy"; // 升序还是倒序标识
|
||||
public static final String ORDER_BY_FIELD = "orderByField"; // 排序字段
|
||||
|
||||
// "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')"
|
||||
public static final String STR_TO_DATE_PREFIX = "str_to_date('"; // 格式化时间格式的前缀
|
||||
public static final String STR_TO_DATE_SUFFIX = "','%Y-%m-%d %H:%i:%s')"; // 格式化时间格式的后缀
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -203,7 +203,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
// 拼接默认的更新语句
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
updateBuilder.append("update_time = " + "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')," +
|
||||
updateBuilder.append("update_time = " + FieldCommon.STR_TO_DATE_PREFIX + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')," +
|
||||
" update_by = " + "'" + sysUser.getUsername() + "'");
|
||||
// 封装参数的更新语句
|
||||
for (Map.Entry<String, Object> entryMap : parameterMap.entrySet()) {
|
||||
@@ -409,7 +409,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
private String setValue(String fieldShowType, String value) {
|
||||
if (LawsFieldTypeEnum.DATE_SINGLE.getValue().equals(fieldShowType)) {
|
||||
// 如果是单日期格式,做格式处理
|
||||
value = "str_to_date('" + value + "','%Y-%m-%d %H:%i:%s')";
|
||||
value = FieldCommon.STR_TO_DATE_PREFIX + value + FieldCommon.STR_TO_DATE_SUFFIX;
|
||||
} else {
|
||||
// 如果是多日期格式做处理
|
||||
value = processDateManyTypeValue(value, fieldShowType);
|
||||
@@ -429,8 +429,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
String id = UUID.randomUUID().toString().replace("-", "");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String commonInsertValues = "'" + id + "','" + sysUser.getUsername() + "',"
|
||||
+ "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')" + ",'" + sysUser.getUsername() + "',"
|
||||
+ "str_to_date('" + sdf.format(new Date()) + "','%Y-%m-%d %H:%i:%s')" + ",'" + sysUser.getOrgCode() + "'";
|
||||
+ FieldCommon.STR_TO_DATE_PREFIX + sdf.format(new Date()) + FieldCommon.STR_TO_DATE_SUFFIX + ",'" + sysUser.getUsername() + "',"
|
||||
+ FieldCommon.STR_TO_DATE_PREFIX + sdf.format(new Date()) + FieldCommon.STR_TO_DATE_SUFFIX + ",'" + sysUser.getOrgCode() + "'";
|
||||
fieldsBuilder.append("id,create_by,create_time,update_by,update_time,sys_code");
|
||||
valuesBuilder.append(commonInsertValues);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user