2 changed files with 24 additions and 9 deletions
@ -1,18 +1,29 @@
@@ -1,18 +1,29 @@
|
||||
package apelet.association.plugin.electronicJournal; |
||||
|
||||
import apelet.association.utils.CreatNumberUtils; |
||||
import apelet.common.core.object.ObjectValue; |
||||
import apelet.common.online.abstractplugin.ExecutePluginParent; |
||||
import apelet.common.online.model.constant.AttributeEnum; |
||||
import apelet.common.orm.impl.Selector; |
||||
import apelet.common.orm.impl.SelectorItem; |
||||
|
||||
public class ElectronicJournalFormPlugin extends ExecutePluginParent { |
||||
|
||||
@Override |
||||
public void formCreated(String widgetVariableName, ObjectValue objectValue) { |
||||
super.formCreated(widgetVariableName, objectValue); |
||||
Object object = objectValue.get("view_count"); |
||||
if(object == null){ |
||||
Object viewCount = objectValue.get("view_count"); |
||||
if(viewCount == null){ |
||||
this.setWidgetAttribute("view_count", AttributeEnum.VALUE_CHANGE,"0"); |
||||
} |
||||
else{ |
||||
objectValue.put("view_count",(Integer)viewCount+1); |
||||
Selector selector = new Selector(); |
||||
selector.getList().add(new SelectorItem("view_count")); |
||||
try { |
||||
ormGenDataSourceUtil().update(objectValue.getTableName(), objectValue, selector); |
||||
} catch (Exception e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
Loading…
Reference in new issue