--修改了启用和做法逻辑,将代码处理添加到了后台中
This commit is contained in:
@ -136,6 +136,15 @@ public class LogTableInfo {
|
||||
return YesOrNoEnum.NO.getTextCode().equals(val);
|
||||
}
|
||||
|
||||
public void setEnable(Object entity) {
|
||||
if(entity==null) return;
|
||||
setFieldValue(entity,GlobalConstant.VALID_PROPERTY,YesOrNoEnum.YES.getTextCode());
|
||||
}
|
||||
|
||||
public void setDisable(Object entity) {
|
||||
if(entity==null) return;
|
||||
setFieldValue(entity,GlobalConstant.VALID_PROPERTY,YesOrNoEnum.NO.getTextCode());
|
||||
}
|
||||
|
||||
public Object getFieldValue(Object entity,String field) {
|
||||
if(entity==null) return null;
|
||||
|
||||
@ -399,6 +399,7 @@ public class DataLogTools {
|
||||
T old = findById(klazz, id);
|
||||
if(old==null || tabInfo.isEnable(old)) return null;
|
||||
DataOperationContent<T> content = null;
|
||||
//具体的数据修改是通过函数去处理的后台不用单独处理
|
||||
if(listener!=null) {
|
||||
content = DataOperationContent.of(tabInfo,OperationType.ENABLE,old,old);
|
||||
listener.before(content);
|
||||
@ -410,6 +411,8 @@ public class DataLogTools {
|
||||
content.setObj(entity);
|
||||
DataChangeLog datalog = createLog(klazz,OperationType.ENABLE);
|
||||
datalog.setEntityId(id);
|
||||
tabInfo.setEnable(entity);
|
||||
mapper.updateById(tabInfo.toEntity(entity));
|
||||
buildFields(datalog,tabInfo,entity,old);
|
||||
logs.add(datalog);
|
||||
if(listener!=null) {
|
||||
@ -448,6 +451,7 @@ public class DataLogTools {
|
||||
T old = findById(klazz, id);
|
||||
if(old==null || tabInfo.isDisable(old)) return null;
|
||||
DataOperationContent<T> content = null;
|
||||
//具体的数据修改是通过函数去处理的后台不用单独处理
|
||||
if(listener!=null) {
|
||||
content = DataOperationContent.of(tabInfo,OperationType.DISABLE,old,old);
|
||||
listener.before(content);
|
||||
@ -460,6 +464,8 @@ public class DataLogTools {
|
||||
content.setObj(entity);
|
||||
DataChangeLog datalog = createLog(klazz,OperationType.DISABLE);
|
||||
datalog.setEntityId(id);
|
||||
tabInfo.setDisable(entity);
|
||||
mapper.updateById(tabInfo.toEntity(entity));
|
||||
buildFields(datalog,tabInfo,entity,old);
|
||||
logs.add(datalog);
|
||||
if(listener!=null) {
|
||||
|
||||
Reference in New Issue
Block a user