Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManagerImpl.java =================================================================== diff -u -r21894 -r21955 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManagerImpl.java (.../ExpensiveGoodsGodownEntryManagerImpl.java) (revision 21894) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManagerImpl.java (.../ExpensiveGoodsGodownEntryManagerImpl.java) (revision 21955) @@ -1345,7 +1345,6 @@ @Override public void changeEntryCheckTypeToPrepareCheck_internal(String id) { if(DatabaseUtil.isPoIdValid(id)){ - //权限是否正确 ExpensiveGoodsGodownEntry expensiveGoodsGodownEntry = this.get(id); if(expensiveGoodsGodownEntry!=null){ if(expensiveGoodsGodownEntry.getEntryCheckStatus().equals(ExpensiveGoodsGodownEntry.CHECK_STATUS_NOCHECK)){//判断是否为未验收状态 @@ -1367,8 +1366,6 @@ @Override public void changeEntryCheckTypeToChecked_internal(String id) { if(DatabaseUtil.isPoIdValid(id)){ - //权限是否正确 - ExpensiveGoodsGodownEntry expensiveGoodsGodownEntry = this.get(id); if(expensiveGoodsGodownEntry!=null){ if(!expensiveGoodsGodownEntry.getEntryCheckStatus().equals(ExpensiveGoodsGodownEntry.CHECK_STATUS_CHECKED)){//判断是否不为已验收状态 @@ -1422,18 +1419,21 @@ //获取打印验收单的信息 @Override - public void loadGodownEntryReceivingReportPrintData(String id,JSONObject jsonobject) { - if(!DatabaseUtil.isPoIdValid(id)){ + public void loadGodownEntryReceivingReportPrintData(String godownEntryId,JSONObject jsonobject) { + if(!DatabaseUtil.isPoIdValid(godownEntryId)){ return; } - ExpensiveGoodsGodownEntry expensiveGoodsGodownEntry = this.get(id); + ExpensiveGoodsGodownEntry expensiveGoodsGodownEntry = this.get(godownEntryId); if(expensiveGoodsGodownEntry == null){ return; } List itemvoList = new ArrayList(); @SuppressWarnings("unchecked") - List expensiveGoodsInstanceList = objectDao.findByProperty(ExpensiveGoodsInstance.class.getSimpleName(), - "godownEntryId", id); + String sql = String.format(" where po.godownEntryId = '%s' order by po.expensiveGoods.id,po.expensiveGoodsModelId ", godownEntryId); + List expensiveGoodsInstanceList = objectDao.findBySql( + ExpensiveGoodsInstance.class.getSimpleName(), sql); +// List expensiveGoodsInstanceList = objectDao.findByProperty(ExpensiveGoodsInstance.class.getSimpleName(), +// "godownEntryId", id); Map seriesToVoMap = new HashMap(); for (ExpensiveGoodsInstance expensiveGoodsInstance : expensiveGoodsInstanceList) { Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsGodownEntryAction.java =================================================================== diff -u -r21894 -r21955 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsGodownEntryAction.java (.../ExpensiveGoodsGodownEntryAction.java) (revision 21894) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/action/ExpensiveGoodsGodownEntryAction.java (.../ExpensiveGoodsGodownEntryAction.java) (revision 21955) @@ -739,54 +739,6 @@ return null; } - /** - * 高值耗材入库单验收状态转换为预验收 - */ - public void changeEntryCheckTypeToPrepareCheck(){ - String idStr = StrutsParamUtils.getPraramValue("id", ""); - String message = "预验收成功"; - try { - if(StringUtils.isBlank(idStr)){ - throw new RuntimeException("参数错误,id不能为空!"); - } - expensiveGoodsGodownEntryManager.changeEntryCheckTypeToPrepareCheck_internal(idStr); - } catch (Exception e) { - e.printStackTrace(); - message = e.getMessage(); - } - HttpServletResponse httpServletResponse = StrutsParamUtils.getResponse(); - httpServletResponse.setCharacterEncoding("UTF-8"); - try { - httpServletResponse.getWriter().print("{success:true,message:'" + message + "'}"); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * 高值耗材入库单验收状态转换为已验收 - */ - public void changeEntryCheckTypeToChecked(){ - String idStr = StrutsParamUtils.getPraramValue("id", ""); - String message = "验收成功"; - try { - if(StringUtils.isBlank(idStr)){ - throw new RuntimeException("参数错误,id不能为空!"); - } - expensiveGoodsGodownEntryManager.changeEntryCheckTypeToChecked_internal(idStr); - } catch (Exception e) { - e.printStackTrace(); - message = e.getMessage(); - } - HttpServletResponse httpServletResponse = StrutsParamUtils.getResponse(); - httpServletResponse.setCharacterEncoding("UTF-8"); - try { - httpServletResponse.getWriter().print("{success:true,message:'" + message + "'}"); - } catch (IOException e) { - e.printStackTrace(); - } - } - //打印高值耗材入库单验收单 public void printReceivingReport() { try { Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManager.java =================================================================== diff -u -r21894 -r21955 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManager.java (.../ExpensiveGoodsGodownEntryManager.java) (revision 21894) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsGodownEntryManager.java (.../ExpensiveGoodsGodownEntryManager.java) (revision 21955) @@ -74,14 +74,14 @@ * 设置入库单的验证状态转换为预验收状态 * @param id */ - public void changeEntryCheckTypeToPrepareCheck_internal(String id); + public void changeEntryCheckTypeToPrepareCheck_internal(String godownEntryId); /** * 设置入库单的验证状态转换为已验收状态 * @param id */ - public void changeEntryCheckTypeToChecked_internal(String id); + public void changeEntryCheckTypeToChecked_internal(String godownEntryId); /** * 获取打印验收单的信息 */ - public void loadGodownEntryReceivingReportPrintData(String id,JSONObject jsonobject ); + public void loadGodownEntryReceivingReportPrintData(String godownEntryId,JSONObject jsonobject ); } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManager.java =================================================================== diff -u -r21842 -r21955 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManager.java (.../InvoicePlanManager.java) (revision 21842) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManager.java (.../InvoicePlanManager.java) (revision 21955) @@ -280,13 +280,14 @@ public Map> groupByDepartCoding(List invoicePlans); /** - * 获得高值耗材申请单 + * 获得高值耗材入库可绑定的申请单(若申请单id不为空则根据id获得绑定的申请单) + * @param invoicePlanId 申请单id * @return */ public List> getExpensiveGoodsInvoicePlans(String invoicePlanId); /** - * 根据申请id返回高值耗材申请单详细 + * 根据申请单id获得高值耗材申请单详细 */ - public JSONArray getExpensiveGoodsInvoicePlansDetailById(String id); + public JSONArray getExpensiveGoodsInvoicePlansDetailById(String invoicePlanId); } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java =================================================================== diff -u -r21854 -r21955 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 21854) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/InvoicePlanManagerImpl.java (.../InvoicePlanManagerImpl.java) (revision 21955) @@ -2714,19 +2714,22 @@ String sql = String.format("where po.id = '%s'", invoicePlanId); invoicePlanList = objectDao.findBySql(InvoicePlan.class.getSimpleName(),sql); }else{ - String sql = String.format("where po.type = '%s'", InvoicePlan.TYPE_EXPENSIVEGOODS_FORM); + //获得类型为高值耗材且审核结束的申请单 + String sql = String.format("where po.type = '%s' and po.processStatus = '%s'", + InvoicePlan.TYPE_EXPENSIVEGOODS_FORM,InvoicePlan.PROCESSSTATUS_BE_THROUGH_WITH); invoicePlanList = objectDao.findBySql(InvoicePlan.class.getSimpleName(),sql); if(CollectionUtils.isNotEmpty(invoicePlanList)){ - for (int i = 0; i < invoicePlanList.size(); i++) { - String expensiveGoodsInstanceSql = String.format("where po.invoicePlanId = '%s'", invoicePlanList.get(i).getId()); + //若申请单已被绑定入库且绑定的实例已有使用记录则:不显示该申请单 + for (int i = invoicePlanList.size()-1; i >= 0; i--) { + InvoicePlan invoicePlan = invoicePlanList.get(i); + String expensiveGoodsInstanceSql = String.format("where po.invoicePlanId = '%s'", invoicePlan.getId()); @SuppressWarnings("unchecked") List expensiveGoodsInstanceList = objectDao.findBySql( ExpensiveGoodsInstance.class.getSimpleName(), expensiveGoodsInstanceSql); - //若申请单已被绑定入库且绑定的实例已有使用记录则:不显示该申请单 if(CollectionUtils.isNotEmpty(expensiveGoodsInstanceList)){ for (ExpensiveGoodsInstance expensiveGoodsInstance : expensiveGoodsInstanceList) { if(expensiveGoodsInstance.getReceiveRecordId()!=null){ - invoicePlanList.remove(i); + invoicePlanList.remove(invoicePlan); break; } } @@ -2736,17 +2739,13 @@ } List> list = new ArrayList>(); if(CollectionUtils.isNotEmpty(invoicePlanList)){ - try { - for (InvoicePlan invoicePlan : invoicePlanList) { - Map map = new HashMap(); - map.put("invoicePlanId", invoicePlan.getId()); - map.put("showDetail", "单号:"+invoicePlan.getSerialNumber()+" 病人:"+invoicePlan.getPatient()); - list.add(map); - } - return list; - } catch (Exception e) { - e.printStackTrace(); + for (InvoicePlan invoicePlan : invoicePlanList) { + Map map = new HashMap(); + map.put("invoicePlanId", invoicePlan.getId()); + map.put("showDetail", "单号:"+invoicePlan.getSerialNumber()+" 病人:"+invoicePlan.getPatient()); + list.add(map); } + return list; } return null; } @@ -2765,15 +2764,11 @@ JSONObject jsonObject = new JSONObject(); Long expensiveGoodsId = tousseItem.getExpensiveGoodsId(); ExpensiveGoods expensiveGoods = expensiveGoodsManager.get(expensiveGoodsId); - if(expensiveGoods!=null){ - RegistrationCertification certification = expensiveGoods.getRegistrationCertification(objectDao); - if(certification!=null){ - ExpensiveGoodsSupplier expensiveGoodsSupplier = certification.getExpensiveGoodsSupplier(); - if(expensiveGoodsSupplier!=null){ - jsonObject.put("invoicePlanManufacturerName", expensiveGoodsSupplier.getCompanyName());//生产厂家名字 - jsonObject.put("invoicePlanManufacturerId", expensiveGoodsSupplier.getId());//生产厂家id - } - } + RegistrationCertification certification = expensiveGoods.getRegistrationCertification(objectDao); + if(certification!=null){ + ExpensiveGoodsSupplier expensiveGoodsSupplier = certification.getExpensiveGoodsSupplier(); + jsonObject.put("invoicePlanManufacturerName", expensiveGoodsSupplier.getCompanyName());//生产厂家名字 + jsonObject.put("invoicePlanManufacturerId", expensiveGoodsSupplier.getId());//生产厂家id } jsonObject.put("expensiveGoodsId", tousseItem.getExpensiveGoodsId()); jsonObject.put("amount", tousseItem.getAmount()); Index: ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java =================================================================== diff -u -r21944 -r21955 --- ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java (.../ExpensiveGoodsManager.java) (revision 21944) +++ ssts-expensivegoods/src/main/java/com/forgon/disinfectsystem/expensiveGoods/service/ExpensiveGoodsManager.java (.../ExpensiveGoodsManager.java) (revision 21955) @@ -227,11 +227,11 @@ /** * 根据被授权的供应商获得被授权的高值耗材物品 * 说明:若isValidityTime为true:则获得被授权的高值耗材且授权未过期的高值耗材物品 - * @param keyword - * @param supplierId - * @param isValidityTime - * @param start - * @param limit + * @param keyword 关键词 + * @param supplierId 供应商id + * @param isValidityTime 是否过滤授权未过期 + * @param start 分页的开始 + * @param limit 分页的大小(如果为0则不分页) * @return */ public JSONObject searchAuthorizedExpensiveGoodsBySupplierId(String keyword, Long supplierId,Boolean isValidityTime,int start, int limit);