Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java =================================================================== diff -u -r21994 -r22002 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 21994) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManagerImpl.java (.../ExpensiveGoodsManagerImpl.java) (revision 22002) @@ -2303,8 +2303,13 @@ List> mapList = new ArrayList>(); for (ExpensiveGoods expensiveGoods : eg) { Map temp = new HashMap(); + String name = expensiveGoods.getName(); + //规格不为空,和名称拼接在一起 + if(StringUtils.isNotBlank(expensiveGoods.getSpecification())){ + name += "[" + expensiveGoods.getSpecification() + "]"; + } temp.put("id", expensiveGoods.getId()); - temp.put("name", expensiveGoods.getName()); + temp.put("name", name); mapList.add(temp); } return mapList; Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationView.jsp =================================================================== diff -u -r21990 -r22002 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationView.jsp (.../expensiveGoodsAuthorizationView.jsp) (revision 21990) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationView.jsp (.../expensiveGoodsAuthorizationView.jsp) (revision 22002) @@ -3,7 +3,7 @@ <%@ page import="com.forgon.disinfectsystem.entity.customform.formdefinition.FormDefinitionItem" %> <%@ page import="com.forgon.disinfectsystem.entity.qualitymonitoringmanager.qualitymonitoringconfig.QualityMonitoringDefinition" %> <%@ page import="com.forgon.disinfectsystem.entity.customform.formdefinition.FormDefinition" %> -<%@page import="com.forgon.disinfectsystem.entity.basedatamanager.imagefilemanager.ImageFile"%> +<%@ page import="com.forgon.disinfectsystem.entity.basedatamanager.imagefilemanager.ImageFile"%> <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> @@ -15,6 +15,7 @@ + @@ -23,7 +24,6 @@ - <% LoginUserData userData = AcegiHelper.getLoginUser(); String userName = userData.getUserFullName(); Index: ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js =================================================================== diff -u -r21990 -r22002 --- ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js (.../expensiveGoodsAuthorizationForm.js) (revision 21990) +++ ssts-web/src/main/webapp/disinfectsystem/assestManagement/expensiveGoods/expensiveGoodsAuthorizationForm.js (.../expensiveGoodsAuthorizationForm.js) (revision 22002) @@ -1,5 +1,7 @@ var registrationPanel; +var id; function addExpensiveGoodsAuthorization(id,ishidden,isclear){ + this.id = id; var supplierStore = new top.Ext.data.Store({ pageSize : 100, proxy : new top.Ext.data.HttpProxy({ @@ -18,10 +20,12 @@ configStore = new top.Ext.data.Store({ }); + Ext.BLANK_IMAGE_URL = WWWROOT + '/ext/resources/images/default/s.gif'; + var registrationCertificateConfig = Ext.data.Record.create([ {name : 'id'}, {name : 'certification'}, - {name : 'certificationTime'}, +// {name : 'certificationTime'}, {name : 'type'} ]); @@ -30,7 +34,7 @@ var p = new registrationCertificateConfig({ id : 0, certification : '', - certificationTime : '', +// certificationTime : '', type : '授权证' }); top.Ext.getCmp('configGrid').stopEditing();// 停止编辑 @@ -81,32 +85,32 @@ } } }) +// }, { +// id : 'certificationTime', 保留授权证失效期有关代码。 +// header : "失效期", +// width : 80, +// dataIndex : 'certificationTime', +// renderer: function(v,p,record){ +// v = v||{}; +// if(v.format){ +// return v.format('Y-m-d'); +// }else if(v.year && v.month && v.date){ +// return (v.year + 1900) + "-" + (v.month+1) + "-" + v.date; +// } +// return ""; +// }, +// editor : new top.Ext.form.DateExtensiableField( { +// readOnly : false, +// minWidth:177, +// altFormats : 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', +// format : 'Y-m-d', +// editable : false, +// allowBlank : false +// }) }, { - id : 'certificationTime', - header : "失效期", - width : 80, - dataIndex : 'certificationTime', - renderer: function(v,p,record){ - v = v||{}; - if(v.format){ - return v.format('Y-m-d'); - }else if(v.year && v.month && v.date){ - return (v.year + 1900) + "-" + (v.month+1) + "-" + v.date; - } - return ""; - }, - editor : new top.Ext.form.DateExtensiableField( { - readOnly : false, - minWidth:177, - altFormats : 'Y-m-d|Y-n-j|y-n-j|y-m-j|y-m-d|y-n-d|Y-n-d|Y-m-j|Ymd|Ynj|ynj|ymj|ymd|ynd|Ynd|Ymj|Y/m/d|Y/n/j|y/n/j|y/m/j|y/m/d|y/n/d|Y/n/d|Y/m/j', - format : 'Y-m-d', - editable : false, - allowBlank : false - }) - }, { id:'type', header:"类别", - width : 10, + width : 50, dataIndex:'type', editor : new top.Ext.form.ComboBox({ xtype : 'combo', @@ -423,7 +427,7 @@ width : 400, readOnly : true, allowBlank : false, - format : 'Y-m-d H:i', + format : 'Y-m-d', anchor : '97%' }] }, { @@ -464,22 +468,22 @@ if(sstsConfig.enableExpensiveGoods){ //高值耗材启用才验证 var certificationCount = configStore.getCount(); if (certificationCount <= 0 ){ - showResult('证不能为空!'); + showResult('授权证不能为空!'); this.enable(); return false; } for(var i = 0 ;i < certificationCount;i++){ var certification = top.Ext.getCmp('configGrid').getView().getCell(i,0).firstChild.innerText; if(certification == '' || certification == null || certification == ' '){ - showResult('请填写证号!'); + showResult('请填写授权证号!'); this.enable(); return false; } var validityTime = top.Ext.getCmp('configGrid').getView().getCell(i,1).firstChild.innerText; if(validityTime == '' || validityTime == null || validityTime == ' '){ - showResult("请填写失效日期!"); + showResult("请填写授权证失效日期!"); this.enable(); return false; } @@ -520,7 +524,7 @@ method : 'POST', waitMsg : '正在加载数据,请稍候', success : function(form, action) { - top.Ext.getCmp('validityTime').setValue(Ext.util.Format.date(new Date(action.result.data.validityTime.time),'Y-m-d H:i')); + top.Ext.getCmp('validityTime').setValue(Ext.util.Format.date(new Date(action.result.data.validityTime.time),'Y-m-d')); top.Ext.getCmp('id').setValue(action.result.data.id); top.Ext.getCmp('authorizedCompanyName').setValue(action.result.data.authorizedCompanyId); top.Ext.getCmp('authorizedCompanyName').setRawValue(action.result.data.authorizedCompanyName); @@ -536,7 +540,7 @@ var authorizationCertifications = new registrationCertificateConfig({ id : authorizationCertification.id, certification : authorizationCertification.authorizationNumber, - certificationTime :new Date(authorizationCertification.validityTime.time), +// certificationTime :new Date(authorizationCertification.validityTime.time), type : authorizationCertification.type }); configStore.add(authorizationCertifications); @@ -709,12 +713,12 @@ var record = configStore.getAt(i); var id = configStore.getAt(i).data.id; var certification = record.get('certification'); - var validityTime = record.data.certificationTime.format('Y-m-d'); +// var validityTime = record.data.certificationTime.format('Y-m-d'); var type = record.get('type'); var authorizationCertification = { id : id, certification: certification, - validityTime: validityTime, +// validityTime: validityTime, type: type } authorizationCertifications.push(authorizationCertification); Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAuthorizationAction.java =================================================================== diff -u -r21990 -r22002 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAuthorizationAction.java (.../ExpensiveGoodsAuthorizationAction.java) (revision 21990) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsAuthorizationAction.java (.../ExpensiveGoodsAuthorizationAction.java) (revision 22002) @@ -162,7 +162,7 @@ String expensiveGoodsIds = StrutsParamUtils.getPraramValue("expensiveGoodsIds", ""); if (StringUtils.isNotBlank(StrutsParamUtils.getPraramValue("validityTime", null))) { SimpleDateFormat dateFormat = new SimpleDateFormat( - "yyyy-MM-dd HH:mm"); + "yyyy-MM-dd"); expensiveGoodsAuthorization.setValidityTime(dateFormat .parse(StrutsParamUtils.getPraramValue("validityTime", null))); @@ -223,14 +223,7 @@ if(expensiveGoodsAuthorization.getRelevancyGoodsAuthorization() != null){ count = expensiveGoodsAuthorization.getRelevancyGoodsAuthorization().getImagesCount(objectDao); } - HttpServletResponse httpServletResponse = StrutsParamUtils - .getResponse(); - httpServletResponse.setCharacterEncoding("UTF-8"); - try { - httpServletResponse.getWriter().print(count); - } catch (IOException e) { - e.printStackTrace(); - } + StrutsResponseUtils.output(count); } /** Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsAuthorizationManagerImpl.java =================================================================== diff -u -r21990 -r22002 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsAuthorizationManagerImpl.java (.../ExpensiveGoodsAuthorizationManagerImpl.java) (revision 21990) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsAuthorizationManagerImpl.java (.../ExpensiveGoodsAuthorizationManagerImpl.java) (revision 22002) @@ -82,7 +82,7 @@ for(ExpensiveGoodsAuthorization eg : egaz){ if(eg.getAuthorizerCompanyName().equals(expensiveGoodsAuthorization.getAuthorizedCompanyName()) && eg.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>0 && !DatabaseUtil.isPoIdValid(expensiveGoodsAuthorization.getId())){ - throw new RuntimeException("授权方有授权过被授权方此物品"+ names[i]+"不能再授权!"); + throw new RuntimeException("授权方有授权过被授权方此物品"+ names[i]+"不能再次授权!"); } } ExpensiveGoods expensiveGood = (ExpensiveGoods) objectDao.getByID_ForUpdate(ExpensiveGoods.class.getSimpleName(),Long.parseLong(strs[i])); @@ -98,7 +98,7 @@ if(eg.getRelevancyGoodsAuthorization() != null){ if(eg.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>0 && eg.getValidityTime().getTime() < new Date().getTime() && !DatabaseUtil.isPoIdValid(expensiveGoodsAuthorization.getId())){ - throw new RuntimeException("被授权方有授权过此物品"+ names[i]+"不能再授权!"); + throw new RuntimeException("被授权方有授权过此物品"+ names[i]+"不能再次授权!"); } } if(eg.getValidityTime().getTime() < new Date().getTime()){ @@ -113,35 +113,39 @@ //判断授权方有被授权过这种高值耗材没 String sql = "where 1 = 1 and po.authorizedCompanyId = " + expensiveGoodsAuthorization.getAuthorizerCompanyId(); List egz = objectDao.findBySql(ExpensiveGoodsAuthorization.class.getSimpleName(), sql); - for(ExpensiveGoodsAuthorization e : egz){ - if(e.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>=0 && !DatabaseUtil.isPoIdValid(expensiveGoodsAuthorization.getId())){ - String sql1 = "where 1 = 1 and po.authorizedCompanyId = " + expensiveGoodsAuthorization.getAuthorizedCompanyId(); - List egt = objectDao.findBySql(ExpensiveGoodsAuthorization.class.getSimpleName(), sql1); - for(ExpensiveGoodsAuthorization egc : egt){ - //判断被授权方有被授权过这高值耗材没,并且授权时间已过期,授权方不是此次授权方 - if(egc.getRelevancyGoodsAuthorization() != null){ - if(egc.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>0 && egc.getValidityTime().getTime() < new Date().getTime()){ - throw new RuntimeException("被授权方没授权物品"+ names[i]+"的记录!"); - } - } - if(egc.getValidityTime().getTime() < new Date().getTime()){ - throw new RuntimeException("物品:"+ names[i]+"的授权时间已失效!"); - } - if(egc.getAuthorizerCompanyId().equals(expensiveGoodsAuthorization.getAuthorizerCompanyId()) - && egc.getExpensiveGoodsName().equals(names[i])){ - throw new RuntimeException("被授权方有被同一个授权方授权过"+ names[i]+ "物品!"); - } + if( egz.size() > 0){ + for(ExpensiveGoodsAuthorization e : egz){ + if(e.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>=0 && !DatabaseUtil.isPoIdValid(expensiveGoodsAuthorization.getId())){ + String sql1 = "where 1 = 1 and po.authorizedCompanyId = " + expensiveGoodsAuthorization.getAuthorizedCompanyId(); + List egt = objectDao.findBySql(ExpensiveGoodsAuthorization.class.getSimpleName(), sql1); + for(ExpensiveGoodsAuthorization egc : egt){ + //判断被授权方有被授权过这高值耗材没,并且授权时间已过期,授权方不是此次授权方 + if(egc.getRelevancyGoodsAuthorization() != null){ + if(egc.getRelevancyGoodsAuthorization().getExpensiveGoodsIds().indexOf(strs[i].toString())>0 && egc.getValidityTime().getTime() < new Date().getTime()){ + throw new RuntimeException("被授权方没授权物品"+ names[i]+"的记录!"); + } + } + if(egc.getValidityTime().getTime() < new Date().getTime()){ + throw new RuntimeException("物品:"+ names[i]+"的授权时间已失效!"); + } + if(egc.getAuthorizerCompanyId().equals(expensiveGoodsAuthorization.getAuthorizerCompanyId()) + && egc.getExpensiveGoodsName().equals(names[i])){ + throw new RuntimeException("被授权方有被同一个授权方授权过"+ names[i]+ "物品!"); + } + } + }else{ + throw new RuntimeException("被授权方已有此物品:" + expensiveGood.getName()+ "!"); + } } - }else{ - throw new RuntimeException("被授权方已授权过此物品:" + expensiveGood.getName()); - } + }else{ + throw new RuntimeException("物品"+names[i]+"的生产厂家不是授权方,或者授权方没有此物品的授权权力!"); } } }else{ - throw new RuntimeException("授权方不具备物品"+names[i]+"!"); + throw new RuntimeException("物品"+names[i]+"的生产厂家不是授权方,或者授权方没有此物品的授权权力!"); } }else{ - throw new RuntimeException("授权方不具备物品"+names[i]+"!"); + throw new RuntimeException("物品"+names[i]+"的生产厂家不是授权方,或者授权方没有此物品的授权权力!"); } } RelevancyGoodsAuthorization relevancyGoodsAuthorization = null; @@ -197,19 +201,19 @@ JSONArray jsonArray = JSONArray.fromObject(authorizationCertificationResult); List list = new ArrayList(); //判断前台有没有进行删除授权证设的List集合 String id = null ; - Date date = null ; //初始化date +// Date date = null ; //初始化date 代码保留有关授权失效期的! for (int i = 0; i < jsonArray.size(); i++) { JSONObject obj = jsonArray.getJSONObject(i); String certification = obj.optString("certification"); - String validityTime = obj.optString("validityTime"); +// String validityTime = obj.optString("validityTime"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String type = obj.optString("type"); //失效期转换成date类型 - try { - date = sdf.parse(validityTime); - } catch (Exception e) { - e.printStackTrace(); - } +// try { +// date = sdf.parse(validityTime); +// } catch (Exception e) { +// e.printStackTrace(); +// } id = obj.optString("id"); list.add(Long.parseLong(id)); AuthorizationCertification authorizationCertification; @@ -220,7 +224,7 @@ .getSimpleName(), "id", Long.valueOf(id)); } authorizationCertification.setAuthorizationNumber(certification); //授权证号 - authorizationCertification.setValidityTime(date); //失效期 + authorizationCertification.setValidityTime(expensiveGoodsAuthorization.getValidityTime()); //失效期 authorizationCertification.setType(type); //证件类型 authorizationCertification.setRelevancyGoodsAuthorization(relevancyGoodsAuthorization); objectDao.saveOrUpdate(authorizationCertification);