81,094
社区成员
发帖
与我相关
我的任务
分享
/**
* 获取所有请假单
*/
public void getAllLeave(){
try {
List list=leaveService.findByUserLeave(1);
String[] keys=new String[]{"leaveId","user","day","applyTime","status","content"};
JSONArray ja=JsonUtils.listToJsonArray(list, keys);
JSONObject jo=new JSONObject();
jo.put("root", ja);
jo.put("total",list.size());
jo.put("success", true);
System.out.println(jo.toString());
outJson(jo.toString());;
} catch (SqlOperationException e) {
outJsonFailure(e.getMessage());
e.printStackTrace();
}
}
<action name="leaveAction" class="leaveAction"></action>
<bean id="leaveService" class="com.airimposition.is.server.sm.db.impl.LeaveServiceImpl">
<property name="leaveDao" ref="leaveDao"/>
<property name="jbpmTemplate" ref="jbpmTemplate"></property>
</bean>
<bean id="leaveAction" class="com.airimposition.is.action.sm.db.LeaveAction" scope="prototype">
<property name="leaveService" ref="leaveService"></property>
</bean>