Index: ssts-web/src/main/resources/spring/projects/zsyy/his.xml =================================================================== diff -u -r16814 -r20153 --- ssts-web/src/main/resources/spring/projects/zsyy/his.xml (.../his.xml) (revision 16814) +++ ssts-web/src/main/resources/spring/projects/zsyy/his.xml (.../his.xml) (revision 20153) @@ -125,4 +125,17 @@ + + + + + + + + + + + + \ No newline at end of file Index: ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/dao/InvoicePlanDao.java =================================================================== diff -u --- ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/dao/InvoicePlanDao.java (revision 0) +++ ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/dao/InvoicePlanDao.java (revision 20153) @@ -0,0 +1,79 @@ +package com.forgon.disinfectsystem.inventorymanagement.dao; + +import java.util.Date; +import java.util.List; + +import org.apache.ibatis.annotations.Param; + +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; +import com.forgon.disinfectsystem.inventorymanagement.model.Inventory; +import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntry; +import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntryItem; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; + +public interface InvoicePlanDao { + + /** + * 按时间,分页,已申请一次性申请单单号过滤查找一次性物品申请单 + * @param startDate + * @param endDate + * @param pagesize + * @param pagenumber + * @param serialNumbers + * @return + */ + HrpInvoicePlan[] findInvoicePlanByTimeAndPage( + @Param("startDate") + Date startDate, + @Param("endDate") + Date endDate, + @Param("pagesize") + int pagesize, + @Param("pagenumber") + int pagenumber, + @Param("serialNumbers") + List serialNumbers + ); + + /** + * 按已申请一次性申请单单号查找一次性物品申请单 + * @param serialNumbers + * @return + */ + HrpInvoicePlan[] findHrpInvoicePlanpListByappliedSerialNumbers( + @Param("serialNumbers") + List serialNumbers + ); + /** + * 按时间,已申请一次性申请单单号查找一次性物品申请单总 + * @param startDate + * @param endDate + * @param serialNumbers + * @return + */ + int findInvoicePlanTotalByTime( + @Param("startDate") + Date startDate, + @Param("endDate") + Date endDate, + @Param("serialNumbers") + List serialNumbers + ); + /** + * 根据申请单号获得申请单明细 + * @param serialNumber + * @return + */ + HrpTousseItem[] findTousseItemBySerialNumber(String serialNumber); + /** + * 根据申请单号获得申请单 + * @param serialNumber + * @return + */ + HrpInvoicePlan findHrpInvoicePlanBySerialNumber(String serialNumber); + + + + + +} Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java =================================================================== diff -u -r20058 -r20153 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java (.../RecyclingApplicationAction.java) (revision 20058) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/action/RecyclingApplicationAction.java (.../RecyclingApplicationAction.java) (revision 20153) @@ -56,6 +56,8 @@ import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.exception.RecyclingRecordException; import com.forgon.disinfectsystem.goodFilterConfig.service.GoodFilterConfigManager; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; import com.forgon.disinfectsystem.project.model.ProjectDict; import com.forgon.disinfectsystem.project.service.ProjectManager; import com.forgon.disinfectsystem.recyclingapplication.result.LoadTousseLeaseItemsResultBuilder; @@ -81,6 +83,7 @@ import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.json.JsonPropertyFilter; import com.forgon.tools.string.StringTools; +import com.forgon.tools.util.ForgonDateUtils; import com.forgon.tools.util.PageUtil; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; @@ -1644,4 +1647,131 @@ JSONObject jsonObject = applicationLogManager.loadRecyclingApplicationUpdateDetail(id, PageUtil.getPagePara()); StrutsResponseUtils.output(jsonObject); } + + /** + * 根据时间,分页获得同步申请单 + * @param parameterMap + * @return + */ + public void findStorageInvocePlanByTime(){ + //当天时间 + Date date=new Date(); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String defatultTime=sdf.format(date); + //若传入参数为空,则默认开始时间和结束时间为当天 + String startTimeStr = StrutsParamUtils.getPraramValue("startTime", defatultTime); + String endTimeStr = StrutsParamUtils.getPraramValue("endTime", defatultTime); + //每页行数 + int pagesize = StrutsParamUtils.getPraramValue("limit", 1); + int startParameter = StrutsParamUtils.getPraramValue("start", 0); + //第几页 + int pageNumber = MathTools.div(startParameter, pagesize).intValue() + 1; + + //设定时间时分秒 + Calendar startTime = Calendar.getInstance(); + Calendar endTime = Calendar.getInstance(); + + startTime.setTime(ForgonDateUtils.safelyParseDate(startTimeStr)); + endTime.setTime(ForgonDateUtils.safelyParseDate(endTimeStr)); + + startTime.set(Calendar.HOUR_OF_DAY, 0); + startTime.set(Calendar.MINUTE, 0); + startTime.set(Calendar.SECOND, 0); + + endTime.set(Calendar.HOUR_OF_DAY, 23); + endTime.set(Calendar.MINUTE, 59); + endTime.set(Calendar.SECOND, 59); + + //按分页,时间获得hrp同步申请单的数据(不包括数据库已有的一次性物品申请单) + Collection storageInvoicePlan = recyclingApplicationManager.findInvoicePlanByTimeAndPage(startTime.getTime(), endTime.getTime(),pagesize,pageNumber); + //按时间获得hrp同步申请单的总数(不包括数据库已有的一次性物品申请单) + int total = recyclingApplicationManager.findInvoicePlanTotalByTime(startTime.getTime(),endTime.getTime()); + JSONArray rows = new JSONArray(); + JSONObject row = new JSONObject(); + SimpleDateFormat format=new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); + for (HrpInvoicePlan InvoicePlans : storageInvoicePlan) { + row.put("departCoding", InvoicePlans.getDepartCoding()); + row.put("depart", InvoicePlans.getDepart()); + row.put("applicant", InvoicePlans.getApplicant()); + row.put("applicationTime",format.format(InvoicePlans.getApplicationTime())); + row.put("serialNumber", InvoicePlans.getSerialNumber()); + row.put("remark", InvoicePlans.getRemark()); + rows.add(row); + } + JSONObject result = new JSONObject(); + result.put("totalCount", total); + result.put("data", rows); + + StrutsResponseUtils.output(result); + } + + + /** + * zsyy手动同步一次性申请单 + */ + public void syncApplication() { + String serialNumbers = StrutsParamUtils.getPraramValue("serialNumber", ""); + String message = ""; + String error = ""; + String correct = ""; + int successCount = 0; + try { + if (StringUtils.isNotBlank(serialNumbers)) { + JSONObject res = new JSONObject(); + String[] serialNumberarry = serialNumbers.split(Constants.IDS_SEPARATOR); + //根据申请单号获得HrpInvoicePlan集合(每个HrpInvoicePlan有对应的申请单明细) + ListHrpInvoicePlanList=recyclingApplicationManager.HrpInvoicePlanListByserialNumberS(serialNumberarry); + //开始同步 + res=recyclingApplicationManager.syncHrpDisposableGoodsInvoicePlan(HrpInvoicePlanList); + int total=(int) res.get("total"); + successCount = (int) res.get("successCount"); + int failureCount = (int) res.get("failureCount"); + String successDetail = res.get("successDetail").toString(); + String failureDetail = res.get("failureDetail").toString(); + //是否申请单单同步失败 + if(failureCount>0){ + message = "一共同步"+total+"条申请单!"+"成功同步"+successCount+"条!失败"+failureCount+"条!"; + //有申请单同步失败也有申请单同步成功 + if(successCount>0){ + error="失败原因:"+failureDetail; + correct="成功详细:"+successDetail; + } + //全部申请单同步失败 + else{ + error="失败原因:"+failureDetail; + } + } + //全部申请单同步成功 + else{ + message = "一共同步"+total+"条申请单!"+"成功同步"+successCount+"条!"; + correct = "成功详细:"+successDetail; + } + } + } catch (Exception e) { + message = "同步失败"; + e.printStackTrace(); + } + HttpServletResponse httpServletResponse = StrutsParamUtils.getResponse(); + httpServletResponse.setCharacterEncoding("UTF-8"); + try { + if(!StringTools.isBlank(error)){ + if(successCount>0){ + //有申请单同步失败也有申请单同步成功 + httpServletResponse.getWriter().print("{success:true,message:'" + message + "',error:'"+error+"',correct:'"+correct+"'}"); + }else{ + //全部申请单同步失败 + httpServletResponse.getWriter().print("{success:false,message:'" + message + "',error:'"+error+"'}"); + } + httpServletResponse.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED); //设置失败标识 + }else{ + //全部申请单同步成功 + //httpServletResponse.getWriter().print("{success:true,message:'" + message +"'}"); + httpServletResponse.getWriter().print("{success:true,message:'" + message + "',correct:'"+correct+"'}"); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + } Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/syncDisposableGoodsApplicationForm.js =================================================================== diff -u --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/syncDisposableGoodsApplicationForm.js (revision 0) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/syncDisposableGoodsApplicationForm.js (revision 20153) @@ -0,0 +1,228 @@ +//方法:弹出gridpanel +var sycGridPanel; +function comboApplicationSyn() { + var tbar = [ + {text: '开始日期:'}, + { + xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + fieldLabel: '开始日期', + id: 'startDate2', + format: sstsConfig.timeSearchFmt || 'Y-m-d', + readOnly: true, + editable: false, + width: sstsConfig.timeSearchFmt ? 130 : 100 + }, + { text: '结束日期:'}, + { + xtype: sstsConfig.timeSearchFmt ? 'datefieldWithMin' : 'datefield', + fieldLabel: '结束日期', + name: 'endDate2', + id: 'endDate2', + readOnly: true, + editable: false, + format: sstsConfig.timeSearchFmt || 'Y-m-d', + width: sstsConfig.timeSearchFmt ? 130 : 100 + }, + { + xtype: 'button', + text: '查询', + iconCls: 'icon_search', + handler: reloadTime + }, + { + xtype: 'button', + text: '开始手动同步', + iconCls: 'btn_ext_add', + handler: syncApplication + } + ]; + + + var jsonreader = new micJsonReader({ + totalProperty : 'totalCount', + root : 'data' + },[ + {name : 'departCoding'}, + {name : 'depart'}, + {name : 'applicant'}, + {name : 'applicationTime'}, + {name : 'serialNumber'}, + {name : 'remark'} + ] + ); + + var sycGridPanelStore = new Ext.data.Store({ + proxy : new Ext.data.HttpProxy({ + url : WWWROOT + '/disinfectSystem/recyclingApplicationAction!findStorageInvocePlanByTime.do', + method : 'POST' + }), + autoLoad:{params:{start:0,limit:25}},// + reader:jsonreader + }); + + //勾选框 + var sm = new top.Ext.grid.CheckboxSelectionModel(); + + var sycGridPanelColumns = new top.Ext.grid.ColumnModel([ + sm, + {header : "申请科室编码",width : 100,dataIndex : 'departCoding'}, + {header : "申请科室名称",width : 100,dataIndex : 'depart'}, + {header : "申请人",width : 100,dataIndex : 'applicant'}, + {header : "申请时间",width : 150,dataIndex : 'applicationTime'}, + {header : "申请单号",width : 100,dataIndex : 'serialNumber'}, + {id :'remark',header : "备注",dataIndex : 'remark' } + ]); + + //翻页 + var sycGridPanelPageBbar = new top.Ext.PagingToolbar({ + pageSize: 25,//指出每页显示的记录数 + store :sycGridPanelStore, + displayInfo: true, + displayMsg: '当前显示记录: {0} - {1} 共计: {2}', + emptyMsg: "没有记录可以显示" + }); + + sycGridPanel = new top.Ext.grid.GridPanel({ + anchor:'80% 80%', + autoScroll:true, + id : 'sycGridPanel', + store : sycGridPanelStore, + cm : sycGridPanelColumns, + sm : sm, + autoExpandColumn: 'remark', + tbar : tbar, + bodyStyle: "overflow:auto;", + bbar:sycGridPanelPageBbar + }); + + var win4= new top.Ext.Window({ + id : 'sycvWin', + layout : 'fit', + title : '一次性物品同步申请单', + modal : true, + border:true , + width : 800, + height : 660, + plain : true, + items : [ sycGridPanel ] + }); + win4.show(); + +//////function /////// + /** + * 根据时间查询 + */ + function reloadTime(){ + var startDate = top.Ext.getCmp("startDate2").getValue(); + var endDate = top.Ext.getCmp("endDate2").getValue(); + + if (!startDate || !endDate) { + showResult('开始时间和结束时间都不能为空!'); + return; + } + + if (startDate > endDate) { + showResult('开始时间不能大于结束时间!'); + return; + } + sycGridPanelStore.baseParams.startTime = Ext.util.Format.date(startDate, 'Y-m-d'); + sycGridPanelStore.baseParams.endTime = Ext.util.Format.date(endDate, 'Y-m-d'); + sycGridPanelStore.reload(); + } + + /** + * 默认当天时间 + */ + getServerTime('yyyy-MM-dd', top.Ext,'startDate2'); + getServerTime('yyyy-MM-dd',top.Ext,'endDate2'); + + + + /** + * 手动同步 + */ + function syncApplication() { + var records = sycGridPanel.getSelectionModel().getSelections(); + //alert(' length : ' + records.length); + if (records.length == 0) { + showResult("请选择要同步的申请单 !"); + return false; + } + var serialNumber = null; + for ( var i = 0, len = records.length; i < len; i++) { + if (serialNumber == null) { + serialNumber = records[i].data['serialNumber']; + } else { + serialNumber = serialNumber + ';' + records[i].data['serialNumber']; + } + } + top.Ext.MessageBox.confirm("请确认","是否确定要同步单号为:"+serialNumber+"的申请单?", + function(button, text) { + if ("yes" == button){ + Ext.Ajax.request({ + url : WWWROOT + '/disinfectSystem/recyclingApplicationAction!syncApplication.do', + params : {serialNumber : serialNumber}, + success : function(response, options) { + var result = Ext.decode(response.responseText); + top.Ext.Msg.alert('成功',result.message+"
"+result.correct); + //showResult(result.message); + sycGridPanelStore.reload(); + }, + failure : function(response, options) { + var result = Ext.decode(response.responseText); + if(result.success){ + top.Ext.Msg.alert('失败',result.message+"
"+result.error+"
"+result.correct); + }else{ + top.Ext.Msg.alert('失败',result.message+"
"+result.error); + } + sycGridPanelStore.reload(); + } + }); + } + } + ); + }; + + + /** + * 显示一次性物品申请单明细悬浮框 + */ + var syctableContent; + sycGridPanel.on('mouseover', function(e) {// 添加mouseover事件 + var index = sycGridPanel.getView().findRowIndex(e.getTarget());// 根据mouse所在的target可以取到列的位置 + if (index !== false) {// 当取到了正确的列时,(因为如果传入的target列没有取到的时候会返回false) + var record = this.getStore().getAt(index); + syctableContent = record.data['htmlContent']; + if(!syctableContent){ + var content = ""; + DWREngine.setAsync(false); + RecyclingApplicationTableManager.findHrpTousseItemVOListByserialNumber(record.data['serialNumber'],function(Items){ + var voItems = Ext.decode(Items); + for(var i=0;i" + specification+"" + unit+"" + amount+"" + inventorySerialNumber+""; + content +=""; + } + }); + DWREngine.setAsync(true); + syctableContent = (""); + syctableContent += "" + content + "

物品名称

规格名称

单位

数量

物质编码


"; + record.set("htmlContent",syctableContent); + } + e.getTarget().setAttribute('data-qtip', syctableContent); + e.getTarget().setAttribute('data-qwidth', 1000); + e.getTarget().setAttribute('data-qtitle', ' 申请单明细:'); + } + }); + } + + + Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManagerImpl.java =================================================================== diff -u -r19754 -r20153 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManagerImpl.java (.../InventoryManagerImpl.java) (revision 19754) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManagerImpl.java (.../InventoryManagerImpl.java) (revision 20153) @@ -48,10 +48,13 @@ import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.exception.DataCheckException; import com.forgon.disinfectsystem.inventorymanagement.dao.InventoryDao; +import com.forgon.disinfectsystem.inventorymanagement.dao.InvoicePlanDao; import com.forgon.disinfectsystem.inventorymanagement.dao.WriteBackInventoryDao; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; import com.forgon.disinfectsystem.inventorymanagement.model.Inventory; import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntry; import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntryItem; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; import com.forgon.disinfectsystem.tousse.materialdefinition.service.MaterialDefinitionManager; import com.forgon.disinfectsystem.tousse.materialmanager.service.MaterialEntryManager; import com.forgon.tools.GB2Alpha; @@ -93,6 +96,9 @@ @Autowired private WareHouseManager wareHouseManager; + @Autowired(required=false) + private InvoicePlanDao InvoicePlanDao; + private WriteBackInventoryDao writeBackInventoryDao; public void setWriteBackInventoryDao(WriteBackInventoryDao writeBackInventoryDao) { @@ -1669,5 +1675,40 @@ md.adjustAmount(amountChange); materialDefinitionManager.save(md); } + +/////////zzsyHrp一次性物品申请单//////////// + @Override + public Collection findInvoicePlanByTimeAndPage(Date startDate,Date endDate,int pagesize,int pagenumber,List serialNumbers) { + Collection result; + result = Arrays.asList(InvoicePlanDao.findInvoicePlanByTimeAndPage(startDate,endDate,pagesize,pagenumber,serialNumbers)); + return result; + } + + @Override + public int findInvoicePlanTotalByTime(Date startDate,Date endDate,List serialNumbers) { + int total=InvoicePlanDao.findInvoicePlanTotalByTime(startDate,endDate,serialNumbers); + return total; + } + + @Override + public List findHrpTousseItemBySerialNumber(String SerialNumber) { + Listresult=Arrays.asList(InvoicePlanDao.findTousseItemBySerialNumber(SerialNumber)); + return result; + } + + @Override + public HrpInvoicePlan findHrpInvoicePlanBySerialNumber(String serialNumber) { + HrpInvoicePlan result=InvoicePlanDao.findHrpInvoicePlanBySerialNumber(serialNumber); + return result; + } + + @Override + public List findHrpInvoicePlanpListByappliedSerialNumbers(List serialNumbers) { + List result=Arrays.asList(InvoicePlanDao.findHrpInvoicePlanpListByappliedSerialNumbers(serialNumbers)); + return result; + } + + + } Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js =================================================================== diff -u -r20147 -r20153 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 20147) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.js (.../goodsApplicationView.js) (revision 20153) @@ -2814,6 +2814,15 @@ formPrinted = 1; addAndEditForeignProxyDisinfection(''); } + },{ + text : '同步一次性物品申请单', + id : 'syncStorageApplyDisposableGoods', + iconCls : 'btn_ext_add_tousse', + tooltip : '同步一次性物品申请单', + hidden : !sstsConfig.syncApplicationDisposable, + handler : function() { + comboApplicationSyn(); + } } ]; Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp =================================================================== diff -u -r20147 -r20153 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 20147) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsApplicationView.jsp (.../goodsApplicationView.jsp) (revision 20153) @@ -397,7 +397,7 @@ - + @@ -418,6 +418,7 @@ .script("${ctx}/disinfectsystem/common/cssdUtils.js").wait() .script("goodsApplicationView.js").wait() .script("goodsApplicationForm.js").wait() + .script("syncDisposableGoodsApplicationForm.js") .script("${ctx}/disinfectsystem/goodsBindingConfig/goodsBindHandler.js") .script("goodsAppHelper.js") Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java =================================================================== diff -u -r20123 -r20153 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java (.../RecyclingApplicationTableManager.java) (revision 20123) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/dwr/table/RecyclingApplicationTableManager.java (.../RecyclingApplicationTableManager.java) (revision 20153) @@ -1,5 +1,6 @@ package com.forgon.disinfectsystem.recyclingapplication.dwr.table; +import java.io.IOException; import java.math.BigDecimal; import java.math.MathContext; import java.math.RoundingMode; @@ -14,6 +15,7 @@ import java.util.List; import java.util.Map; +import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; import net.sf.json.JSONException; import net.sf.json.JSONObject; @@ -36,6 +38,7 @@ import com.forgon.directory.service.OrgUnitManager; import com.forgon.disinfectsystem.basedatamanager.supplyroomconfig.service.SupplyRoomConfigManager; import com.forgon.disinfectsystem.basedatamanager.tousseGroup.service.TousseGroupManager; +import com.forgon.disinfectsystem.common.Constants; import com.forgon.disinfectsystem.common.CssdUtils; import com.forgon.disinfectsystem.diposablegoods.service.DiposableGoodsManager; import com.forgon.disinfectsystem.entity.assestmanagement.DiposableGoodsInstance; @@ -48,6 +51,8 @@ import com.forgon.disinfectsystem.entity.printRecyclingApplicationConfig.PrintConfig; import com.forgon.disinfectsystem.entity.recyclingapplication.RecyclingApplication; import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; import com.forgon.disinfectsystem.print.vo.PrintRowVo; import com.forgon.disinfectsystem.print.vo.PrintSummaryVo; import com.forgon.disinfectsystem.printRecyclingApplicationConfig.service.PrintConfigManager; @@ -58,17 +63,22 @@ import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseInstanceManager; import com.forgon.disinfectsystem.tousse.toussedefinition.service.TousseMaterialErrorDamageManager; import com.forgon.disinfectsystem.tousseitem.service.TousseItemManager; +import com.forgon.disinfectsystem.vo.ApplicationItemVO; import com.forgon.disinfectsystem.vo.RecyclingApplicationVo; import com.forgon.results.handler.LendGoodsBriefHandler; import com.forgon.results.handler.ResultBackHandler; import com.forgon.tools.GB2Alpha; import com.forgon.tools.GB2WB; import com.forgon.tools.MathTools; import com.forgon.tools.SqlBuilder; +import com.forgon.tools.StrutsParamUtils; +import com.forgon.tools.StrutsResponseUtils; 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.forgon.tools.util.ForgonDateUtils; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; @@ -1213,4 +1223,15 @@ throw new RuntimeException(e); } } + /** + * 根据Hrp申请单号获得申请单详细 + */ + public String findHrpTousseItemVOListByserialNumber(String serialNumber) { + List tousseItemVOs = recyclingApplicationManager.findHrpTousseItemListByserialNumber(serialNumber); + if (tousseItemVOs != null) { + JSONArray arr = JSONArray.fromObject(tousseItemVOs); + return arr.toString(); + } + return null; + } } Index: ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js =================================================================== diff -u -r20103 -r20153 --- ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js (.../config.js) (revision 20103) +++ ssts-web/src/main/webapp/disinfectsystem/config/zsyy/config.js (.../config.js) (revision 20153) @@ -1,4 +1,4 @@ -var sstsConfig = { +var sstsConfig = { // 禁用标识牌功能 disableIdCard : false, // 审核器械包必须入篮筐(一级供应室) @@ -191,5 +191,7 @@ //是否启用快速回收一键入筐功能 recycleAllTousseIntoBasketInExpressRecycle:true, //待回收界面是否启用器械包分组过滤。与记住回收人的控件位置上重叠,所以同一个项目只能有一个启用 - enableTousseGroupFilterInAwaitRecycling:true + enableTousseGroupFilterInAwaitRecycling:true, + //是否显示一次性物品同步申请单(为true需要显示,为false或者没配都不显示) + syncApplicationDisposable:true } \ No newline at end of file Index: ssts-web/src/main/resources/spring/projects/zsyy/timer.xml =================================================================== diff -u -r19524 -r20153 --- ssts-web/src/main/resources/spring/projects/zsyy/timer.xml (.../timer.xml) (revision 19524) +++ ssts-web/src/main/resources/spring/projects/zsyy/timer.xml (.../timer.xml) (revision 20153) @@ -2,11 +2,34 @@ + + + + + + + + timingSyncHrpDisposableGoodsInvoicePlan + + + + + + + + + + 0 0 7 * * ? + + + + + Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManager.java =================================================================== diff -u -r20109 -r20153 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManager.java (.../RecyclingApplicationManager.java) (revision 20109) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManager.java (.../RecyclingApplicationManager.java) (revision 20153) @@ -20,8 +20,10 @@ import com.forgon.disinfectsystem.entity.tousseitem.TousseItem; import com.forgon.disinfectsystem.exception.RecyclingRecordException; import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; import com.forgon.disinfectsystem.print.vo.PrintSummaryVo; import com.forgon.disinfectsystem.recyclingapplication.vo.ReturnGoodVo; +import com.forgon.disinfectsystem.vo.ApplicationItemVO; import com.forgon.disinfectsystem.vo.RecyclingApplicationVo; import com.forgon.disinfectsystem.vo.TousseItemVo; import com.forgon.tools.hibernate.BasePoManager; @@ -319,4 +321,44 @@ */ public JSONObject syncHrpDisposableGoodsInvoicePlan(List hrpInvoicePlans); + + + /** + * 根据分页,时间,获得:zzsyHrp同步申请单集合(通过已申请的一次性物品申请单过滤) + * @param startDate 开始时间 + * @param endDate 结束时间 + * @param pagesize 第几页 + * @param pagenumber 每页显示多少行 + * @return Collection + */ + public Collection findInvoicePlanByTimeAndPage(Date startDate,Date endDate, int pagesize, int pagenumber); + + /** + * 根据时间:获得zzsyHrp申请单总数(通过已申请的一次性物品申请单过滤) + * @param startDate 开始时间 + * @param endDate 结束时间 + * @return List + */ + public int findInvoicePlanTotalByTime(Date startDate, Date endDate); + + /** + * 根据申请单号数组:获得zzsyHrp申请单明细集合. + * @param serialNumberarry 申请单号数组 + * @return List + */ + public List HrpInvoicePlanListByserialNumberS(String[] serialNumberarry); + + + /** + * 根据申请单号数组:获得zzsyHrp申请单明细集合. + * @param serialNumberarry 申请单号数组 + * @return List + */ + public List findHrpTousseItemListByserialNumber(String serialNumber); + + /** + * zzsyHrp申请单定时同步 + * @return void + */ + public void timingSyncHrpDisposableGoodsInvoicePlan(); } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/Constants.java =================================================================== diff -u -r12331 -r20153 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/Constants.java (.../Constants.java) (revision 12331) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/Constants.java (.../Constants.java) (revision 20153) @@ -37,5 +37,6 @@ public static final int ERROR_TYPE_IS_NOT_NUMBER = 5; // 不是数字 public static final int ERROR_TYPE_IS_NOT_DATE = 6; // 不是日期 public static final int ERROR_TYPE_VALUE_INVALID = 7; // 定义的值无效 + public final static String IDS_SEPARATOR = ";";// id分隔符 } Index: ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java =================================================================== diff -u -r20141 -r20153 --- ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 20141) +++ ssts-recyclingapplication/src/main/java/com/forgon/disinfectsystem/recyclingapplication/service/RecyclingApplicationManagerImpl.java (.../RecyclingApplicationManagerImpl.java) (revision 20153) @@ -40,6 +40,7 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; import com.beust.jcommander.ParameterException; import com.forgon.databaseadapter.service.DateQueryAdapter; @@ -82,6 +83,7 @@ import com.forgon.disinfectsystem.exception.RecyclingRecordException; import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; +import com.forgon.disinfectsystem.inventorymanagement.service.InventoryManager; import com.forgon.disinfectsystem.packing.service.PackingManager; import com.forgon.disinfectsystem.print.vo.PrintPageVo; import com.forgon.disinfectsystem.print.vo.PrintRowVo; @@ -150,7 +152,9 @@ private InvoicePlanManager invoicePlanManagerTarget; private DiposableGoodBatchStockManager diposableGoodBatchStockManager; - + @Autowired + private InventoryManager inventoryManager; + private ApplicationLogManager applicationLogManager; public void setApplicationLogManager(ApplicationLogManager applicationLogManager) { @@ -5291,7 +5295,7 @@ return JSONUtil.buildJsonObject(true, "干预成功!"); } - +//////////////hrp同步//////////////////////////// @Override public JSONObject syncHrpDisposableGoodsInvoicePlan(List hrpInvoicePlans) { JSONObject resultObject = new JSONObject(); @@ -5333,7 +5337,7 @@ } else { disposableGoods = diposableGoodsManager.get(name, specification); if (disposableGoods != null && !StringTools.equals(inventorySerialNumber, disposableGoods.getInventorySerialNumber())) { - goodsDetail = String.format("%sid=%s的物品的物资编码由%s被改成%s;", goodsDetail, disposableGoods.getId(), disposableGoods.getInventorySerialNumber(), inventorySerialNumber); + goodsDetail = String.format("%sid=%s的物品%s的物资编码由%s被改成%s;", goodsDetail, disposableGoods.getId(),disposableGoods.getName(), disposableGoods.getInventorySerialNumber(), inventorySerialNumber); disposableGoods.setInventorySerialNumber(inventorySerialNumber); } } @@ -5458,4 +5462,63 @@ return applyAmount != null ? applyAmount : 0; } + @Override + public Collection findInvoicePlanByTimeAndPage(Date startDate,Date endDate,int pagesize,int pagenumber) { + //获得已申请单的单号 + String hql = "select ip.serialNumber from InvoicePlan ip where ip.type='一次性物品申请单'"; + List serialNumbers = objectDao.findByHql(hql); + Collection InvoicePlan = inventoryManager.findInvoicePlanByTimeAndPage(startDate, endDate, pagesize, pagenumber,serialNumbers) ; + return InvoicePlan; + } + + @Override + public int findInvoicePlanTotalByTime(Date startDate, Date endDate) { + //获得已申请单的单号 + String hql = "select ip.serialNumber from InvoicePlan ip where ip.type='一次性物品申请单'"; + List serialNumbers = objectDao.findByHql(hql); + int total = inventoryManager.findInvoicePlanTotalByTime(startDate, endDate,serialNumbers); + return total; + } + + @Override + public List findHrpTousseItemListByserialNumber(String serialNumber) { + List ApplicationItem = inventoryManager.findHrpTousseItemBySerialNumber(serialNumber); + return ApplicationItem; + } + + @Override + public List HrpInvoicePlanListByserialNumberS(String[] serialNumberArry) { + if(serialNumberArry!=null){ + ListHrpInvoicePlanList = new ArrayList(); + for (String serialNumber : serialNumberArry) { + //根据申请单号获得申请单 + HrpInvoicePlan hrpInvoicePlan = inventoryManager.findHrpInvoicePlanBySerialNumber(serialNumber); + //根据申请单号获得申请单明细 + List HrpTousseItemList = inventoryManager.findHrpTousseItemBySerialNumber(serialNumber); + hrpInvoicePlan.setItems(HrpTousseItemList); + HrpInvoicePlanList.add(hrpInvoicePlan); + } + return HrpInvoicePlanList; + } + return null; + } + + //zzsy一次性申请单定时同步 + @Override + public void timingSyncHrpDisposableGoodsInvoicePlan() { + //获得已申请单的单号 + String hql = "select ip.serialNumber from InvoicePlan ip where ip.type='一次性物品申请单'"; + List serialNumbers = objectDao.findByHql(hql); + + //根据已申请的单号过滤获得hrp申请单单号集合 + List hrpInvoicePlans = inventoryManager.findHrpInvoicePlanpListByappliedSerialNumbers(serialNumbers); + + //根据申请单号获得明细 + for (HrpInvoicePlan hrpInvoicePlan : hrpInvoicePlans) { + List HrpTousseItemList = inventoryManager.findHrpTousseItemBySerialNumber(hrpInvoicePlan.getSerialNumber()); + hrpInvoicePlan.setItems(HrpTousseItemList); + } + //开始同步 + syncHrpDisposableGoodsInvoicePlan(hrpInvoicePlans); + } } Index: ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManager.java =================================================================== diff -u -r19508 -r20153 --- ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManager.java (.../InventoryManager.java) (revision 19508) +++ ssts-datasync/src/main/java/com/forgon/disinfectsystem/inventorymanagement/service/InventoryManager.java (.../InventoryManager.java) (revision 20153) @@ -2,9 +2,12 @@ import java.util.Collection; import java.util.Date; +import java.util.List; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpTousseItem; import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntry; import com.forgon.disinfectsystem.inventorymanagement.model.StorageEntryItem; +import com.forgon.disinfectsystem.inventorymanagement.model.HrpInvoicePlan; import com.google.gson.JsonObject; public interface InventoryManager { @@ -35,5 +38,52 @@ */ public JsonObject prepareSyncReturnEntry(String jsonParamStr, Collection outParam_returnEntrys); + + /** + * 根据分页,时间,已申请的一次性物品申请单号过滤获得:zzsyHrp同步申请单集合. + * @param startDate 开始时间 + * @param endDate 结束时间 + * @param pagesize 第几页 + * @param pagenumber 每页显示多少行 + * @param serialNumbers 已申请的一次性物品申请单号集合 + * @return Collection:HrpInvoicePlan同步申请单集合 + */ + public Collection findInvoicePlanByTimeAndPage(Date startDate, Date endDate,int pagesize,int pagenumber,List serialNumbers); + + /** + * 根据时间,已申请的一次性物品申请单过滤获得:zzsyHrp同步申请单的总数. + * @param startDate 开始时间 + * @param endDate 结束时间 + * @param serialNumbers 已申请的一次性物品申请单号集合 + * @return int 同步申请单的总数 + */ + public int findInvoicePlanTotalByTime(Date startDate,Date endDate, List serialNumbers); + + + /** + * 根据已申请单的申请单号过滤获得:zzsyHrp申请单集合 + * @param serialNumbers 已申请的一次性物品申请单号集合 + * @return List:HrpInvoicePlan同步申请单集合 + */ + public List findHrpInvoicePlanpListByappliedSerialNumbers(List serialNumbers); + + /** + * 根据同步申请单号:获得zzsyHrp申请单明细集合 + * @param serialNumber 同步申请单号 + * @return List:HrpTousseItem同步申请单明细集合 + */ + public List findHrpTousseItemBySerialNumber(String SerialNumber); + + /** + * 根据同步申请单号:获得zzsyHrp申请单 + * @param serialNumber 同步申请单号 + * @return HrpInvoicePlan:HrpInvoicePlan同步申请单 + */ + public HrpInvoicePlan findHrpInvoicePlanBySerialNumber(String serialNumber); + + + + + } \ No newline at end of file Index: ssts-web/src/main/resources/config/zsyy/mybatis/InvoicePlanFromHERP_Mapper.xml =================================================================== diff -u --- ssts-web/src/main/resources/config/zsyy/mybatis/InvoicePlanFromHERP_Mapper.xml (revision 0) +++ ssts-web/src/main/resources/config/zsyy/mybatis/InvoicePlanFromHERP_Mapper.xml (revision 20153) @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + and applicationTime >= #{startDate} + + + + + + and serialNumber not in + + #{serialNumbers} + + + + + + + + + + \ No newline at end of file