|
|
@@ -1,16 +1,45 @@
|
|
|
package com.kingdee.eas.custom.abk.dormitory.handler;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.kingdee.bos.BOSException;
|
|
|
+import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.metadata.entity.FilterInfo;
|
|
|
+import com.kingdee.bos.metadata.entity.FilterItemInfo;
|
|
|
+import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
import com.kingdee.bos.sql.ParserException;
|
|
|
+import com.kingdee.eas.common.EASBizException;
|
|
|
+import com.kingdee.eas.custom.dormitorysystem.task.DormitorysystemFacadeFactory;
|
|
|
+import com.kingdee.shr.base.syssetting.context.SHRContext;
|
|
|
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.model.ListUIViewInfo;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.model.TreeNavigationInfo;
|
|
|
import com.kingdee.shr.base.syssetting.web.dynamic.model.UIViewInfo;
|
|
|
import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
public class OccupantsListHandler extends ListHandler {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected FilterInfo getCustomFilter(HttpServletRequest request, HttpServletResponse response) throws SHRWebException {
|
|
|
+ FilterInfo customFilter = super.getCustomFilter(request, response);
|
|
|
+// String parameter = request.getParameter("dormitroy");
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(request.getParameter("custom_params"));
|
|
|
+ String parameter = jsonObject.getString("dormitroy");
|
|
|
+ if (customFilter==null){
|
|
|
+ customFilter = new FilterInfo();
|
|
|
+ }
|
|
|
+ if (parameter!=null&&!parameter.equals("")){
|
|
|
+ customFilter.getFilterItems().add(new FilterItemInfo("Dormitory", parameter,CompareType.EQUALS));
|
|
|
+ customFilter.getFilterItems().add(new FilterItemInfo("CheckOutDate", new Date(),CompareType.GREATER_EQUALS));
|
|
|
+ }
|
|
|
+ return customFilter;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected UIViewInfo getUIViewInfo(HttpServletRequest request) throws SHRWebException {
|
|
|
ListUIViewInfo uiViewInfo = (ListUIViewInfo) super.getUIViewInfo(request);
|
|
|
@@ -48,4 +77,21 @@ public class OccupantsListHandler extends ListHandler {
|
|
|
}
|
|
|
return filterInfo;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Ë¢ÐÂÈëסÈËÊý
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @param modelMap
|
|
|
+ * @throws SHRWebException
|
|
|
+ * @throws BOSException
|
|
|
+ */
|
|
|
+ public void updateDormCheckInCountAction(
|
|
|
+ HttpServletRequest request,
|
|
|
+ HttpServletResponse response,
|
|
|
+ ModelMap modelMap
|
|
|
+ ) throws SHRWebException, BOSException, EASBizException {
|
|
|
+ Context ctx = SHRContext.getInstance().getContext();
|
|
|
+ DormitorysystemFacadeFactory.getLocalInstance(ctx).updateDormCheckInCount();
|
|
|
+ }
|
|
|
}
|