Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java =================================================================== diff -u -r12553 -r12560 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 12553) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/action/RecyclingRecordAction.java (.../RecyclingRecordAction.java) (revision 12560) @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; import java.sql.ResultSet; import java.sql.SQLException; import java.text.ParseException; @@ -79,6 +80,7 @@ import com.forgon.tools.StrutsParamUtils; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.hibernate.ObjectDao; +import com.forgon.tools.json.JSONUtil; import com.forgon.tools.json.JsonPropertyFilter; import com.forgon.tools.string.StringTools; import com.opensymphony.xwork2.ModelDriven; @@ -1197,14 +1199,20 @@ */ public String getRecyclingRecordList() { Long page = Long.valueOf(StrutsParamUtils.getPraramValue("page", "1")); + String filter = StrutsParamUtils.getPraramValue("filter", ""); + try { + filter = java.net.URLDecoder.decode(filter,"UTF-8"); + } catch (UnsupportedEncodingException e1) { + e1.printStackTrace(); + } long start = (page - 1) * 20 + 1; long end = page * 20; try { HttpServletResponse response = StrutsParamUtils.getResponse(); response.setCharacterEncoding("UTF-8"); response.getWriter().print( recyclingRecordManager.getRecyclingRecordListByJson(start, - end)); + end,filter)); response.getWriter().close(); } catch (IOException e) { e.printStackTrace(); Index: forgon-tools/src/main/java/com/forgon/tools/util/SqlUtils.java =================================================================== diff -u -r12331 -r12560 --- forgon-tools/src/main/java/com/forgon/tools/util/SqlUtils.java (.../SqlUtils.java) (revision 12331) +++ forgon-tools/src/main/java/com/forgon/tools/util/SqlUtils.java (.../SqlUtils.java) (revision 12560) @@ -45,4 +45,27 @@ //sb.append(")"); return sb.toString(); } + /** + * ��ȡ����������ƴ����������sql������� + * @param searchMode ����ģʽ���Ƿ����ƴ������� + * @param simpleSpell ƴ������������ + * @return ��������where������sql�Ӿ� + */ + public static String getSearchSQL(String searchMode, String simpleSpell) { + String sql = ""; + if (StringUtils.isNotBlank(searchMode)) { + if (searchMode.indexOf("ƴ��") != -1) { + sql += "po.spelling like '%" + simpleSpell + "%'"; + } + if (searchMode.indexOf("���") != -1) { + String sqlStr = "po.wbCode like '%" + simpleSpell + "%'"; + sql += (sql.length() == 0 ? sqlStr : (" or " + sqlStr)); + } + sql = " and (" + sql + ")"; + } else { + sql += " and (po.spelling like '%" + simpleSpell + + "%' or po.wbCode like '%" + simpleSpell + "%') "; + } + return sql; + } } Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java =================================================================== diff -u -r12331 -r12560 --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 12331) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordManager.java (.../RecyclingRecordManager.java) (revision 12560) @@ -28,7 +28,10 @@ public RecyclingRecord getByRecyclingApplicationId(String applicationId); - public String getRecyclingRecordListByJson(long start, long end); + //public String getRecyclingRecordListByJson(long start, long end); + public String getRecyclingRecordListByJson(long start, long end,String filterJson); + /*public String getRecyclingRecordListByJson(long start, long end, + String[] departCodes, String[] userNames);*/ public List findApplicationItemVOs( String recyclingRecordId); Index: ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java =================================================================== diff -u --- ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (revision 0) +++ ssts-recyclingrecord/src/main/java/com/forgon/disinfectsystem/recyclingrecord/service/RecyclingRecordListSqlGenerator.java (revision 12560) @@ -0,0 +1,147 @@ +package com.forgon.disinfectsystem.recyclingrecord.service; + +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import net.sf.json.JSONObject; + +import com.forgon.databaseadapter.service.DateQueryAdapter; +import com.forgon.directory.acegi.tools.AcegiHelper; +import com.forgon.tools.SqlBuilder; +import com.forgon.tools.db.DatabaseUtil; +import com.forgon.tools.db.InitDbConnection; +import com.forgon.tools.json.JSONUtil; + +/** + * 历史回收记录过滤条件的sql生成类 + * @author kzh + * + */ +class RecyclingRecordListSqlGenerator { + private InitDbConnection dbConnection; + private String filterJsonStr; + private String recyclingRecordPoName; + private String invoicePlanPoName; + private DateQueryAdapter dateQueryAdapter; + private String filterSql; + private long start = 0; + private long end = 0; + + public RecyclingRecordListSqlGenerator(InitDbConnection dbConnection,long start,long end,String filterJsonStr) { + this.dbConnection = dbConnection; + this.dateQueryAdapter = new DateQueryAdapter(); + this.dateQueryAdapter.setDbConnection(dbConnection); + this.filterJsonStr = filterJsonStr; + this.start = start; + this.end = end; + this.recyclingRecordPoName = "r"; + this.invoicePlanPoName = "p"; + this.filterSql = buildRecyclingRecordFilterSql(); + } + private String buildRecyclingRecordFilterSql(){ + JSONObject jsonObj = JSONObject.fromObject(filterJsonStr); + String departCodesStr = JSONUtil.optString(jsonObj, "departCode", null); + String[] departCodes = (departCodesStr == null || departCodesStr.length() <= 0)?null:departCodesStr.split(";"); + String userNameStr = JSONUtil.optString(jsonObj, "userName", null); + String[] userNames = (userNameStr == null || userNameStr.length() <= 0)?null:userNameStr.split(";"); + String statusStr = JSONUtil.optString(jsonObj, "status", null); + String[] status = (statusStr == null || statusStr.length() <= 0)?null:statusStr.split(";"); + String appTypeStr = JSONUtil.optString(jsonObj, "applicationType", null); + String[] appType = (appTypeStr == null || appTypeStr.length() <= 0)?null:appTypeStr.split(";"); + JSONObject dateRange = jsonObj.optJSONObject("recyclingDateRange"); + String dateRangeSql = buildDateRangeSql(dateRange); + + Map map = new HashMap(); + map.put(recyclingRecordPoName + ".departCode", departCodes); + map.put(recyclingRecordPoName + ".operator", userNames); + map.put(recyclingRecordPoName + ".status", status); + map.put(invoicePlanPoName + ".type", appType); + + return buildRecyclingRecordFilterSql(map) + " and " + dateRangeSql; + } + private String buildRecyclingRecordFilterSql(Map propertyValues){ + String ret = " (1=1) "; + if(propertyValues != null){ + for(String key : propertyValues.keySet()){ + String[] value = propertyValues.get(key); + if(value != null && value.length > 0){ + ret += " and "; + ret += SqlBuilder.build_IN_Statement(key, SqlBuilder.IN, value); + } + } + } + return ret; + } + private String buildDateRangeSql(JSONObject dateRange){ + String ret = " (1=1) "; + if(dateRange != null){ + Date start = getDate(dateRange.optJSONObject("start"),0); + Date end = getDate(dateRange.optJSONObject("end"),59); + if(start != null && end != null && start.before(end)){ + ret = recyclingRecordPoName + ".recyclingTime between " + + dateQueryAdapter.dateAdapter(start) + " and " + + dateQueryAdapter.dateAdapter(end); + return ret; + } + } + return ret; + } + private Date getDate(JSONObject dateJson,int second){ + if(dateJson != null){ + int year = dateJson.optInt("year"); + int month = dateJson.optInt("month"); + int day = dateJson.optInt("day"); + int hour = dateJson.optInt("hour"); + int minute = dateJson.optInt("minute"); + Calendar c = Calendar.getInstance(); + c.set(year,month - 1,day,hour,minute,second); + return c.getTime(); + } + return null; + } + public String getListSql() { + String sql = ""; + + String orgUnitCodingFromSupplyRoomConfig = AcegiHelper.getLoginUser() + .getOrgUnitCodingFromSupplyRoomConfig(); + + if (DatabaseUtil.isSqlServer(dbConnection.getDatabase())) { + + String tempSql = "(SELECT TOP " + + end + + " r.*,p.type FROM RecyclingRecord r left join InvoicePlan p on r.recyclingApplication_id = p.id where r.orgUnitCoding = '" + + orgUnitCodingFromSupplyRoomConfig + + "' and " + + filterSql + + " order by recyclingTime desc) A"; + String tempSql2 = "(SELECT TOP " + + (start - 1) + + " r.id FROM RecyclingRecord r left join InvoicePlan p on r.recyclingApplication_id = p.id where r.orgUnitCoding = '" + + orgUnitCodingFromSupplyRoomConfig + + "' and " + + filterSql + + " order by recyclingTime desc)"; + sql = "SELECT TOP 20 * FROM " + tempSql + " WHERE id not in " + + tempSql2; + } else if (DatabaseUtil.isOracle(dbConnection.getDatabase())) { + sql = "SELECT * FROM (SELECT A.*, ROWNUM RN FROM (SELECT r.*,p.type FROM RecyclingRecord r left join InvoicePlan p on r.recyclingApplication_id = p.id where r.orgUnitCoding = '" + + orgUnitCodingFromSupplyRoomConfig + + "' and " + + filterSql + + " order by recyclingTime desc) A WHERE ROWNUM <= " + + end + + ")WHERE RN >= " + start; + } + return sql; + } + public String getCountSql(){ + String countSql = "select count(*) from RecyclingRecord r left join InvoicePlan p on r.recyclingApplication_id = p.id" + + " where r.orgUnitCoding = '" + + AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig() + + "' and " + + filterSql; + return countSql; + } +} Index: forgon-tools/src/main/java/com/forgon/tools/hibernate/ObjectDao.java =================================================================== diff -u -r12531 -r12560 --- forgon-tools/src/main/java/com/forgon/tools/hibernate/ObjectDao.java (.../ObjectDao.java) (revision 12531) +++ forgon-tools/src/main/java/com/forgon/tools/hibernate/ObjectDao.java (.../ObjectDao.java) (revision 12560) @@ -70,6 +70,13 @@ public int countObjectBySql(String objectPOName, String sql); + /** + * �����ṩ��sql�������� + * @param sql �����IJ�ѯ��� + * @return ��¼������ + */ + public int countBySql(String sql); + public Session getHibernateSession(); public Session openNewSession(); Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1024/images/style.css =================================================================== diff -u -r12331 -r12560 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1024/images/style.css (.../style.css) (revision 12331) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1024/images/style.css (.../style.css) (revision 12560) @@ -168,4 +168,38 @@ .num-ten .search .btn-a:hover{ background-position:0px -429px;} .num-ten .search .btn-b{background:url(pic_bg.jpg) no-repeat -81px -379px; width:75px; height:47px; border:none} .num-ten .search .btn-b:hover{ background-position:-81px -429px;} -.num-ten .search table{ margin:0 auto} \ No newline at end of file +.num-ten .search table{ margin:0 auto} +.selectDate-table{position:absolute; width:675px; height:335px; bottom:90px; left:15px} +.selectDate-table .box{ height:315px; overflow-y:scroll; overflow-x:hidden} +.selectDate-table .box table{ margin:0 auto; width:640px} +.selectDate-table .input-a{ background:url(pic_bg.jpg) no-repeat -174px -48px; border:none; width:158px; height:49px; font-size:22px; padding:0 10px; line-height:40px;} +.selectDate-table .input-b{ background:url(pic_bg.jpg) no-repeat -364px -48px; border:none; width:39px; height:49px; font-size:22px; padding:0 5px; line-height:40px;} +.selectDate-table .add{ background:url(pic_bg.jpg) no-repeat -352px -111px; width:25px; height:49px; display:block; line-height:200px; overflow:hidden;} +.selectDate-table .add:hover{ background-position:-352px -160px} +.selectDate-table .minus{ background:url(pic_bg.jpg) no-repeat -378px -111px; width:23px; height:49px; display:block; line-height:200px; overflow:hidden;} +.selectDate-table .minus:hover{ background-position:-378px -160px} + +.selectDate-table .btn-box{ margin-top:6px;} +.selectDate-table .btn-box table{ margin:0 auto; padding-right: 30px} +.selectDate-table .btn-box input{ background:url(btn-box.jpg) no-repeat; border:none; line-height:200px; overflow:hidden; text-indent:-9999px} +.selectDate-table .btn-box .btn-e{ background:url(btn_save.png) no-repeat; background-position:0 0; width:78px; height:41px; border:none; line-height:200px; overflow:hidden; text-indent:-9999px; display:block;} +.selectDate-table .btn-box .btn-e:hover{ background:url(btn_save1.png) no-repeat; background-position:0 0; width:78px; height:41px; border:none; line-height:200px; overflow:hidden; text-indent:-9999px; display:block;} +.selectDate-table .btn-box .btn-b{ background-position:-81px 0; width:115px; height:42px;} +.selectDate-table .btn-box .btn-b:hover{ background-position:-81px -45px; width:115px; height:42px;} +.selectDate-table .btn-box .btn-c{ background-position:-200px 0; width:78px; height:42px;} +.selectDate-table .btn-box .btn-c:hover{ background-position:-200px -45px; width:78px; height:42px;} +.selectDate-table .btn-box .btn-d{ background:url(btn_cancel.png) no-repeat; background-position:0 0; width:78px; height:41px; border:none; line-height:200px; overflow:hidden; text-indent:-9999px; display:block;} +.selectDate-table .btn-box .btn-d:hover{ background:url(btn_cancel1.png) no-repeat; background-position:0 0; width:78px; height:41px; border:none; line-height:200px; overflow:hidden; text-indent:-9999px; display:block;} +.selectDate-table .btn-box .btn-f{ background:url(btn_exit.png) no-repeat; background-position:0 0; width:78px; height:41px; border:none; line-height:200px; overflow:hidden; text-indent:-9999px; display:block; } +.selectDate-table .btn-box .btn-f:hover{ background:url(btn_exit1.png) no-repeat; background-position:0 0; border:none; width:78px; height:41px; line-height:200px; overflow:hidden; text-indent:-9999px; display:block;} + +.selectDate-table a{line-height:200px; overflow:hidden; display:block} +.selectDate-table .btn-a{background:url(pic_bg.jpg) no-repeat -94px -111px; width:57px; height:49px; } +.selectDate-table .btn-a:hover{ background-position:-94px -160px} +.selectDate-table .btn-b{background:url(pic_bg.jpg) no-repeat -159px -111px; width:57px; height:49px; } +.selectDate-table .btn-b:hover{ background-position:-159px -160px} +.selectDate-table .btn-c{background:url(pic_bg.jpg) no-repeat -226px -111px; width:57px; height:49px; } +.selectDate-table .btn-c:hover{ background-position:-226px -160px} +.selectDate-table .btn-d{background:url(pic_bg.jpg) no-repeat -286px -111px; width:57px; height:49px; } +.selectDate-table .btn-d:hover{ background-position:-286px -160px} +.selectDate-table td{ padding:2px 2px} \ No newline at end of file Index: ssts-web/src/main/java/com/forgon/disinfectsystem/directory/dwr/table/UserTableManager.java =================================================================== diff -u -r12331 -r12560 --- ssts-web/src/main/java/com/forgon/disinfectsystem/directory/dwr/table/UserTableManager.java (.../UserTableManager.java) (revision 12331) +++ ssts-web/src/main/java/com/forgon/disinfectsystem/directory/dwr/table/UserTableManager.java (.../UserTableManager.java) (revision 12560) @@ -15,6 +15,7 @@ import com.forgon.component.grid.GridManager; import com.forgon.component.grid.vo.GridVo; import com.forgon.directory.acegi.tools.AcegiHelper; +import com.forgon.directory.model.OrgUnit; import com.forgon.directory.model.OrgUserRelation; import com.forgon.directory.service.SysUserManager; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; @@ -371,5 +372,22 @@ } return null; } - + public String searchUserBySpellOrWbCode(String simpleSpell) { + List userList = userManager. + findUserBySpellOrWbCode(simpleSpell); + StringBuffer buffer = new StringBuffer(); + int i = 0; + for (User user : userList) { + if (i == 12) { + break; + } + buffer.append(user.getName() + "," + user.getFullName() + + "," + user.getBarcode() + ";"); + i++; + } + if (buffer.length() > 0) { + return buffer.toString().substring(0, buffer.length() - 1); + } + return ""; + } } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1024/images/pic_bg_03.png =================================================================== diff -u Binary files differ Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectUser.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectUser.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectUser.jsp (revision 12560) @@ -0,0 +1,135 @@ + +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +选择操作人 + + + + + + + +
+ +
+ +
/images/tit_bg_0202.jpg" />
+
+
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+
+ +
+ + + Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectStatus.jsp =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectStatus.jsp (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/selectStatus.jsp (revision 12560) @@ -0,0 +1,60 @@ + +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ include file="/common/taglibs.jsp"%> + + + +选择状态 + + + + +
+
    + +
+
+ +
/images/tit_bg_0202.jpg" />
+
+ +
+ +
+ + + Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1024/images/tit_bg_0202.jpg =================================================================== diff -u Binary files differ Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1980/images/styleForWaitList.css =================================================================== diff -u -r12331 -r12560 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1980/images/styleForWaitList.css (.../styleForWaitList.css) (revision 12331) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/1980/images/styleForWaitList.css (.../styleForWaitList.css) (revision 12560) @@ -168,6 +168,7 @@ .mbody_02{ background:url(body_bg_02.jpg) no-repeat; width:1980px; height:1080px; margin:0 auto; position:relative} .pic_bg{ background:url(pic_bg_02.png) no-repeat} +.pic_bg_03{ background:url(pic_bg_03.png) no-repeat} .mbody_02 .back{ position:absolute; left:40px; top:25px;} .mbody_02 .back a{width:66px; height:43px; display:block; line-height:200px; overflow:hidden} .mbody_02 .back a:hover{ background-position:0 -46px;} Index: ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp =================================================================== diff -u -r12331 -r12560 --- ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp (.../awaitForRecycleList.jsp) (revision 12331) +++ ssts-web/src/main/webapp/disinfectsystem/touchScreen/recycle/awaitForRecycleList.jsp (.../awaitForRecycleList.jsp) (revision 12560) @@ -47,7 +47,7 @@ - + @@ -60,8 +60,10 @@ + +