| | |
| | | @ApiOperation("è·åé访ç»è®¡æ¯ä¾") |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/getSfStatistics") |
| | | public AjaxResult getSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | public Map<String, Object> getSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { |
| | | if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { |
| | | return error("æå¡ç±»åä¸è½ä¸ºç©º"); |
| | | } |
| | | Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); |
| | | serviceSubtaskCountReq.setPageNum(offset); |
| | | |
| | | String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid()); |
| | | if (ObjectUtils.isNotEmpty(followUpCountStyle)) { |
| | | serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle); |
| | | } else { |
| | | serviceSubtaskCountReq.setFollowUpCountStyle("1"); |
| | | } |
| | | return success(serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq)); |
| | | serviceSubtaskCountReq.setPageNum(null); |
| | | serviceSubtaskCountReq.setPageSize(null); |
| | | List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq); |
| | | return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å»¶ç»æ¤çç»è®¡ |
| | | */ |
| | |
| | | } |
| | | return success(serviceSubtaskService.getContinueNurseCount(serviceSubtaskCotinueCountVO)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | rspData.put("total", total); |
| | | return rspData; |
| | | } |
| | | protected Map<String, Object> getDataTable4(long total, Object object) { |
| | | Map<String, Object> rspData = new TreeMap<>(); |
| | | rspData.put("code", HttpStatus.SUCCESS); |
| | | rspData.put("msg", "æ¥è¯¢æå"); |
| | | rspData.put("data", object); |
| | | rspData.put("total", total); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * è¿åæå |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> |
| | | <wsdl:types> |
| | | <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> |
| | | <s:element name="SMSMessageAccept"> |
| | | <s:complexType> |
| | | <s:sequence> |
| | | <s:element minOccurs="0" maxOccurs="1" name="xmlReq" type="s:string" /> |
| | | </s:sequence> |
| | | </s:complexType> |
| | | </s:element> |
| | | <s:element name="SMSMessageAcceptResponse"> |
| | | <s:complexType> |
| | | <s:sequence> |
| | | <s:element minOccurs="1" maxOccurs="1" name="SMSMessageAcceptResult" type="s:int" /> |
| | | <s:element minOccurs="0" maxOccurs="1" name="xmlResp" type="s:string" /> |
| | | </s:sequence> |
| | | </s:complexType> |
| | | </s:element> |
| | | </s:schema> |
| | | </wsdl:types> |
| | | <wsdl:message name="SMSMessageAcceptSoapIn"> |
| | | <wsdl:part name="parameters" element="tns:SMSMessageAccept" /> |
| | | </wsdl:message> |
| | | <wsdl:message name="SMSMessageAcceptSoapOut"> |
| | | <wsdl:part name="parameters" element="tns:SMSMessageAcceptResponse" /> |
| | | </wsdl:message> |
| | | <wsdl:portType name="MessagingInsertSoap"> |
| | | <wsdl:operation name="SMSMessageAccept"> |
| | | <wsdl:input message="tns:SMSMessageAcceptSoapIn" /> |
| | | <wsdl:output message="tns:SMSMessageAcceptSoapOut" /> |
| | | </wsdl:operation> |
| | | </wsdl:portType> |
| | | <wsdl:binding name="MessagingInsertSoap" type="tns:MessagingInsertSoap"> |
| | | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> |
| | | <wsdl:operation name="SMSMessageAccept"> |
| | | <soap:operation soapAction="http://tempuri.org/SMSMessageAccept" style="document" /> |
| | | <wsdl:input> |
| | | <soap:body use="literal" /> |
| | | </wsdl:input> |
| | | <wsdl:output> |
| | | <soap:body use="literal" /> |
| | | </wsdl:output> |
| | | </wsdl:operation> |
| | | </wsdl:binding> |
| | | <wsdl:binding name="MessagingInsertSoap12" type="tns:MessagingInsertSoap"> |
| | | <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> |
| | | <wsdl:operation name="SMSMessageAccept"> |
| | | <soap12:operation soapAction="http://tempuri.org/SMSMessageAccept" style="document" /> |
| | | <wsdl:input> |
| | | <soap12:body use="literal" /> |
| | | </wsdl:input> |
| | | <wsdl:output> |
| | | <soap12:body use="literal" /> |
| | | </wsdl:output> |
| | | </wsdl:operation> |
| | | </wsdl:binding> |
| | | <wsdl:service name="MessagingInsert"> |
| | | <wsdl:port name="MessagingInsertSoap" binding="tns:MessagingInsertSoap"> |
| | | <soap:address location="http://218.108.11.29:8081/MessagingInsert.asmx" /> |
| | | </wsdl:port> |
| | | <wsdl:port name="MessagingInsertSoap12" binding="tns:MessagingInsertSoap12"> |
| | | <soap12:address location="http://218.108.11.29:8081/MessagingInsert.asmx" /> |
| | | </wsdl:port> |
| | | </wsdl:service> |
| | | </wsdl:definitions> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * MessagingInsert.java |
| | | * |
| | | * This file was auto-generated from WSDL |
| | | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | */ |
| | | |
| | | package WebServiceClient; |
| | | |
| | | public interface MessagingInsert extends javax.xml.rpc.Service { |
| | | public String getMessagingInsertSoap12Address(); |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap12() throws javax.xml.rpc.ServiceException; |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap12(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; |
| | | public String getMessagingInsertSoapAddress(); |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap() throws javax.xml.rpc.ServiceException; |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * MessagingInsertLocator.java |
| | | * |
| | | * This file was auto-generated from WSDL |
| | | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | */ |
| | | |
| | | package WebServiceClient; |
| | | |
| | | public class MessagingInsertLocator extends org.apache.axis.client.Service implements MessagingInsert { |
| | | |
| | | public MessagingInsertLocator() { |
| | | } |
| | | |
| | | |
| | | public MessagingInsertLocator(org.apache.axis.EngineConfiguration config) { |
| | | super(config); |
| | | } |
| | | |
| | | public MessagingInsertLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { |
| | | super(wsdlLoc, sName); |
| | | } |
| | | |
| | | // Use to get a proxy class for MessagingInsertSoap12 |
| | | private String MessagingInsertSoap12_address = "http://218.108.11.29:8081/MessagingInsert.asmx"; |
| | | |
| | | public String getMessagingInsertSoap12Address() { |
| | | return MessagingInsertSoap12_address; |
| | | } |
| | | |
| | | // The WSDD service name defaults to the port name. |
| | | private String MessagingInsertSoap12WSDDServiceName = "MessagingInsertSoap12"; |
| | | |
| | | public String getMessagingInsertSoap12WSDDServiceName() { |
| | | return MessagingInsertSoap12WSDDServiceName; |
| | | } |
| | | |
| | | public void setMessagingInsertSoap12WSDDServiceName(String name) { |
| | | MessagingInsertSoap12WSDDServiceName = name; |
| | | } |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap12() throws javax.xml.rpc.ServiceException { |
| | | java.net.URL endpoint; |
| | | try { |
| | | endpoint = new java.net.URL(MessagingInsertSoap12_address); |
| | | } |
| | | catch (java.net.MalformedURLException e) { |
| | | throw new javax.xml.rpc.ServiceException(e); |
| | | } |
| | | return getMessagingInsertSoap12(endpoint); |
| | | } |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap12(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { |
| | | try { |
| | | MessagingInsertSoap12Stub _stub = new MessagingInsertSoap12Stub(portAddress, this); |
| | | _stub.setPortName(getMessagingInsertSoap12WSDDServiceName()); |
| | | return _stub; |
| | | } |
| | | catch (org.apache.axis.AxisFault e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public void setMessagingInsertSoap12EndpointAddress(String address) { |
| | | MessagingInsertSoap12_address = address; |
| | | } |
| | | |
| | | |
| | | // Use to get a proxy class for MessagingInsertSoap |
| | | private String MessagingInsertSoap_address = "http://218.108.11.29:8081/MessagingInsert.asmx"; |
| | | |
| | | public String getMessagingInsertSoapAddress() { |
| | | return MessagingInsertSoap_address; |
| | | } |
| | | |
| | | // The WSDD service name defaults to the port name. |
| | | private String MessagingInsertSoapWSDDServiceName = "MessagingInsertSoap"; |
| | | |
| | | public String getMessagingInsertSoapWSDDServiceName() { |
| | | return MessagingInsertSoapWSDDServiceName; |
| | | } |
| | | |
| | | public void setMessagingInsertSoapWSDDServiceName(String name) { |
| | | MessagingInsertSoapWSDDServiceName = name; |
| | | } |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap() throws javax.xml.rpc.ServiceException { |
| | | java.net.URL endpoint; |
| | | try { |
| | | endpoint = new java.net.URL(MessagingInsertSoap_address); |
| | | } |
| | | catch (java.net.MalformedURLException e) { |
| | | throw new javax.xml.rpc.ServiceException(e); |
| | | } |
| | | return getMessagingInsertSoap(endpoint); |
| | | } |
| | | |
| | | public MessagingInsertSoap_PortType getMessagingInsertSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { |
| | | try { |
| | | MessagingInsertSoap_BindingStub _stub = new MessagingInsertSoap_BindingStub(portAddress, this); |
| | | _stub.setPortName(getMessagingInsertSoapWSDDServiceName()); |
| | | return _stub; |
| | | } |
| | | catch (org.apache.axis.AxisFault e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public void setMessagingInsertSoapEndpointAddress(String address) { |
| | | MessagingInsertSoap_address = address; |
| | | } |
| | | |
| | | /** |
| | | * For the given interface, get the stub implementation. |
| | | * If this service has no port for the given interface, |
| | | * then ServiceException is thrown. |
| | | * This service has multiple ports for a given interface; |
| | | * the proxy implementation returned may be indeterminate. |
| | | */ |
| | | public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { |
| | | try { |
| | | if (MessagingInsertSoap_PortType.class.isAssignableFrom(serviceEndpointInterface)) { |
| | | MessagingInsertSoap12Stub _stub = new MessagingInsertSoap12Stub(new java.net.URL(MessagingInsertSoap12_address), this); |
| | | _stub.setPortName(getMessagingInsertSoap12WSDDServiceName()); |
| | | return _stub; |
| | | } |
| | | if (MessagingInsertSoap_PortType.class.isAssignableFrom(serviceEndpointInterface)) { |
| | | MessagingInsertSoap_BindingStub _stub = new MessagingInsertSoap_BindingStub(new java.net.URL(MessagingInsertSoap_address), this); |
| | | _stub.setPortName(getMessagingInsertSoapWSDDServiceName()); |
| | | return _stub; |
| | | } |
| | | } |
| | | catch (Throwable t) { |
| | | throw new javax.xml.rpc.ServiceException(t); |
| | | } |
| | | throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); |
| | | } |
| | | |
| | | /** |
| | | * For the given interface, get the stub implementation. |
| | | * If this service has no port for the given interface, |
| | | * then ServiceException is thrown. |
| | | */ |
| | | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { |
| | | if (portName == null) { |
| | | return getPort(serviceEndpointInterface); |
| | | } |
| | | String inputPortName = portName.getLocalPart(); |
| | | if ("MessagingInsertSoap12".equals(inputPortName)) { |
| | | return getMessagingInsertSoap12(); |
| | | } |
| | | else if ("MessagingInsertSoap".equals(inputPortName)) { |
| | | return getMessagingInsertSoap(); |
| | | } |
| | | else { |
| | | java.rmi.Remote _stub = getPort(serviceEndpointInterface); |
| | | ((org.apache.axis.client.Stub) _stub).setPortName(portName); |
| | | return _stub; |
| | | } |
| | | } |
| | | |
| | | public javax.xml.namespace.QName getServiceName() { |
| | | return new javax.xml.namespace.QName("http://tempuri.org/", "MessagingInsert"); |
| | | } |
| | | |
| | | private java.util.HashSet ports = null; |
| | | |
| | | public java.util.Iterator getPorts() { |
| | | if (ports == null) { |
| | | ports = new java.util.HashSet(); |
| | | ports.add(new javax.xml.namespace.QName("http://tempuri.org/", "MessagingInsertSoap12")); |
| | | ports.add(new javax.xml.namespace.QName("http://tempuri.org/", "MessagingInsertSoap")); |
| | | } |
| | | return ports.iterator(); |
| | | } |
| | | |
| | | /** |
| | | * Set the endpoint address for the specified port name. |
| | | */ |
| | | public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException { |
| | | |
| | | if ("MessagingInsertSoap12".equals(portName)) { |
| | | setMessagingInsertSoap12EndpointAddress(address); |
| | | } |
| | | else |
| | | if ("MessagingInsertSoap".equals(portName)) { |
| | | setMessagingInsertSoapEndpointAddress(address); |
| | | } |
| | | else |
| | | { // Unknown Port Name |
| | | throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Set the endpoint address for the specified port name. |
| | | */ |
| | | public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException { |
| | | setEndpointAddress(portName.getLocalPart(), address); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * MessagingInsertSoap12Stub.java |
| | | * <p> |
| | | * This file was auto-generated from WSDL |
| | | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | */ |
| | | |
| | | package WebServiceClient; |
| | | |
| | | public class MessagingInsertSoap12Stub extends org.apache.axis.client.Stub implements MessagingInsertSoap_PortType { |
| | | private java.util.Vector cachedSerClasses = new java.util.Vector(); |
| | | private java.util.Vector cachedSerQNames = new java.util.Vector(); |
| | | private java.util.Vector cachedSerFactories = new java.util.Vector(); |
| | | private java.util.Vector cachedDeserFactories = new java.util.Vector(); |
| | | |
| | | static org.apache.axis.description.OperationDesc[] _operations; |
| | | |
| | | static { |
| | | _operations = new org.apache.axis.description.OperationDesc[1]; |
| | | _initOperationDesc1(); |
| | | } |
| | | |
| | | private static void _initOperationDesc1() { |
| | | org.apache.axis.description.OperationDesc oper; |
| | | org.apache.axis.description.ParameterDesc param; |
| | | oper = new org.apache.axis.description.OperationDesc(); |
| | | oper.setName("SMSMessageAccept"); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "xmlReq"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false); |
| | | param.setOmittable(true); |
| | | oper.addParameter(param); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); |
| | | oper.addParameter(param); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false); |
| | | param.setOmittable(true); |
| | | oper.addParameter(param); |
| | | oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID); |
| | | oper.setStyle(org.apache.axis.constants.Style.WRAPPED); |
| | | oper.setUse(org.apache.axis.constants.Use.LITERAL); |
| | | _operations[0] = oper; |
| | | |
| | | } |
| | | |
| | | public MessagingInsertSoap12Stub() throws org.apache.axis.AxisFault { |
| | | this(null); |
| | | } |
| | | |
| | | public MessagingInsertSoap12Stub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { |
| | | this(service); |
| | | super.cachedEndpoint = endpointURL; |
| | | } |
| | | |
| | | public MessagingInsertSoap12Stub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { |
| | | if (service == null) { |
| | | super.service = new org.apache.axis.client.Service(); |
| | | } else { |
| | | super.service = service; |
| | | } |
| | | ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.1"); |
| | | } |
| | | |
| | | protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { |
| | | try { |
| | | org.apache.axis.client.Call _call = super._createCall(); |
| | | if (super.maintainSessionSet) { |
| | | _call.setMaintainSession(super.maintainSession); |
| | | } |
| | | if (super.cachedUsername != null) { |
| | | _call.setUsername(super.cachedUsername); |
| | | } |
| | | if (super.cachedPassword != null) { |
| | | _call.setPassword(super.cachedPassword); |
| | | } |
| | | if (super.cachedEndpoint != null) { |
| | | _call.setTargetEndpointAddress(super.cachedEndpoint); |
| | | } |
| | | if (super.cachedTimeout != null) { |
| | | _call.setTimeout(super.cachedTimeout); |
| | | } |
| | | if (super.cachedPortName != null) { |
| | | _call.setPortName(super.cachedPortName); |
| | | } |
| | | java.util.Enumeration keys = super.cachedProperties.keys(); |
| | | while (keys.hasMoreElements()) { |
| | | String key = (String) keys.nextElement(); |
| | | _call.setProperty(key, super.cachedProperties.get(key)); |
| | | } |
| | | return _call; |
| | | } catch (Throwable _t) { |
| | | throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); |
| | | } |
| | | } |
| | | |
| | | public Integer SMSMessageAccept(String xmlReq, javax.xml.rpc.holders.IntHolder SMSMessageAcceptResult, javax.xml.rpc.holders.StringHolder xmlResp) throws java.rmi.RemoteException { |
| | | Integer success = null; |
| | | if (super.cachedEndpoint == null) { |
| | | throw new org.apache.axis.NoEndPointException(); |
| | | } |
| | | org.apache.axis.client.Call _call = createCall(); |
| | | _call.setOperation(_operations[0]); |
| | | _call.setUseSOAPAction(true); |
| | | _call.setSOAPActionURI("http://tempuri.org/SMSMessageAccept"); |
| | | _call.setEncodingStyle(null); |
| | | _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); |
| | | _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); |
| | | _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS); |
| | | _call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAccept")); |
| | | |
| | | setRequestHeaders(_call); |
| | | setAttachments(_call); |
| | | try { |
| | | Object _resp = _call.invoke(new Object[]{xmlReq}); |
| | | |
| | | if (_resp instanceof java.rmi.RemoteException) { |
| | | throw (java.rmi.RemoteException) _resp; |
| | | } else { |
| | | extractAttachments(_call); |
| | | java.util.Map _output; |
| | | _output = _call.getOutputParams(); |
| | | try { |
| | | success = ((Integer) _output.get(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult"))).intValue(); |
| | | } catch (Exception _exception) { |
| | | success = ((Integer) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult")), int.class)).intValue(); |
| | | } |
| | | try { |
| | | xmlResp.value = (String) _output.get(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp")); |
| | | } catch (Exception _exception) { |
| | | xmlResp.value = (String) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp")), String.class); |
| | | } |
| | | } |
| | | } catch (org.apache.axis.AxisFault axisFaultException) { |
| | | throw axisFaultException; |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * MessagingInsertSoap_BindingStub.java |
| | | * <p> |
| | | * This file was auto-generated from WSDL |
| | | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | */ |
| | | |
| | | package WebServiceClient; |
| | | |
| | | import org.apache.axis.client.Stub; |
| | | |
| | | public class MessagingInsertSoap_BindingStub extends Stub implements MessagingInsertSoap_PortType { |
| | | private java.util.Vector cachedSerClasses = new java.util.Vector(); |
| | | private java.util.Vector cachedSerQNames = new java.util.Vector(); |
| | | private java.util.Vector cachedSerFactories = new java.util.Vector(); |
| | | private java.util.Vector cachedDeserFactories = new java.util.Vector(); |
| | | |
| | | static org.apache.axis.description.OperationDesc[] _operations; |
| | | |
| | | static { |
| | | _operations = new org.apache.axis.description.OperationDesc[1]; |
| | | _initOperationDesc1(); |
| | | } |
| | | |
| | | private static void _initOperationDesc1() { |
| | | org.apache.axis.description.OperationDesc oper; |
| | | org.apache.axis.description.ParameterDesc param; |
| | | oper = new org.apache.axis.description.OperationDesc(); |
| | | oper.setName("SMSMessageAccept"); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "xmlReq"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false); |
| | | param.setOmittable(true); |
| | | oper.addParameter(param); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"), int.class, false, false); |
| | | oper.addParameter(param); |
| | | param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp"), org.apache.axis.description.ParameterDesc.OUT, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false); |
| | | param.setOmittable(true); |
| | | oper.addParameter(param); |
| | | oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID); |
| | | oper.setStyle(org.apache.axis.constants.Style.WRAPPED); |
| | | oper.setUse(org.apache.axis.constants.Use.LITERAL); |
| | | _operations[0] = oper; |
| | | |
| | | } |
| | | |
| | | public MessagingInsertSoap_BindingStub() throws org.apache.axis.AxisFault { |
| | | this(null); |
| | | } |
| | | |
| | | public MessagingInsertSoap_BindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { |
| | | this(service); |
| | | super.cachedEndpoint = endpointURL; |
| | | } |
| | | |
| | | public MessagingInsertSoap_BindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { |
| | | if (service == null) { |
| | | super.service = new org.apache.axis.client.Service(); |
| | | } else { |
| | | super.service = service; |
| | | } |
| | | ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.1"); |
| | | } |
| | | |
| | | protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { |
| | | try { |
| | | org.apache.axis.client.Call _call = super._createCall(); |
| | | if (super.maintainSessionSet) { |
| | | _call.setMaintainSession(super.maintainSession); |
| | | } |
| | | if (super.cachedUsername != null) { |
| | | _call.setUsername(super.cachedUsername); |
| | | } |
| | | if (super.cachedPassword != null) { |
| | | _call.setPassword(super.cachedPassword); |
| | | } |
| | | if (super.cachedEndpoint != null) { |
| | | _call.setTargetEndpointAddress(super.cachedEndpoint); |
| | | } |
| | | if (super.cachedTimeout != null) { |
| | | _call.setTimeout(super.cachedTimeout); |
| | | } |
| | | if (super.cachedPortName != null) { |
| | | _call.setPortName(super.cachedPortName); |
| | | } |
| | | java.util.Enumeration keys = super.cachedProperties.keys(); |
| | | while (keys.hasMoreElements()) { |
| | | String key = (String) keys.nextElement(); |
| | | _call.setProperty(key, super.cachedProperties.get(key)); |
| | | } |
| | | return _call; |
| | | } catch (Throwable _t) { |
| | | throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); |
| | | } |
| | | } |
| | | |
| | | public Integer SMSMessageAccept(String xmlReq, javax.xml.rpc.holders.IntHolder SMSMessageAcceptResult, javax.xml.rpc.holders.StringHolder xmlResp) throws java.rmi.RemoteException { |
| | | Integer success = null; |
| | | if (super.cachedEndpoint == null) { |
| | | throw new org.apache.axis.NoEndPointException(); |
| | | } |
| | | org.apache.axis.client.Call _call = createCall(); |
| | | _call.setOperation(_operations[0]); |
| | | _call.setUseSOAPAction(true); |
| | | _call.setSOAPActionURI("http://tempuri.org/SMSMessageAccept"); |
| | | _call.setEncodingStyle(null); |
| | | _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); |
| | | _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); |
| | | _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); |
| | | _call.setOperationName(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAccept")); |
| | | |
| | | setRequestHeaders(_call); |
| | | setAttachments(_call); |
| | | try { |
| | | Object _resp = _call.invoke(new Object[]{xmlReq}); |
| | | |
| | | if (_resp instanceof java.rmi.RemoteException) { |
| | | throw (java.rmi.RemoteException) _resp; |
| | | } else { |
| | | extractAttachments(_call); |
| | | java.util.Map _output; |
| | | _output = _call.getOutputParams(); |
| | | try { |
| | | success = ((Integer) _output.get(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult"))).intValue(); |
| | | } catch (Exception _exception) { |
| | | success = ((Integer) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("http://tempuri.org/", "SMSMessageAcceptResult")), int.class)).intValue(); |
| | | } |
| | | try { |
| | | xmlResp.value = (String) _output.get(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp")); |
| | | } catch (Exception _exception) { |
| | | xmlResp.value = (String) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("http://tempuri.org/", "xmlResp")), String.class); |
| | | } |
| | | } |
| | | } catch (org.apache.axis.AxisFault axisFaultException) { |
| | | throw axisFaultException; |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * MessagingInsertSoap_PortType.java |
| | | * |
| | | * This file was auto-generated from WSDL |
| | | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | */ |
| | | |
| | | package WebServiceClient; |
| | | |
| | | public interface MessagingInsertSoap_PortType extends java.rmi.Remote { |
| | | public Integer SMSMessageAccept(String xmlReq, javax.xml.rpc.holders.IntHolder SMSMessageAcceptResult, javax.xml.rpc.holders.StringHolder xmlResp) throws java.rmi.RemoteException; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | ///** |
| | | // * MessagingInsertTestCase.java |
| | | // * <p> |
| | | // * This file was auto-generated from WSDL |
| | | // * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. |
| | | // */ |
| | | // |
| | | //package WebServiceClient; |
| | | // |
| | | //public class MessagingInsertTestCase extends junit.framework.TestCase { |
| | | // public MessagingInsertTestCase(String name) { |
| | | // super(name); |
| | | // } |
| | | // |
| | | // public void testMessagingInsertSoap12WSDL() throws Exception { |
| | | // javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); |
| | | // java.net.URL url = new java.net.URL(new MessagingInsertLocator().getMessagingInsertSoap12Address() + "?WSDL"); |
| | | // javax.xml.rpc.Service service = serviceFactory.createService(url, new MessagingInsertLocator().getServiceName()); |
| | | // assertTrue(service != null); |
| | | // } |
| | | // |
| | | // public void test1MessagingInsertSoap12SMSMessageAccept() throws Exception { |
| | | // MessagingInsertSoap12Stub binding; |
| | | // try { |
| | | // binding = (MessagingInsertSoap12Stub) new MessagingInsertLocator().getMessagingInsertSoap12(); |
| | | // } catch (javax.xml.rpc.ServiceException jre) { |
| | | // if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); |
| | | // throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); |
| | | // } |
| | | // assertNotNull("binding is null", binding); |
| | | // |
| | | // // Time out after a minute |
| | | // binding.setTimeout(60000); |
| | | // |
| | | // // Test operation |
| | | // binding.SMSMessageAccept(new String(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.StringHolder()); |
| | | // // TBD - validate results |
| | | // } |
| | | // |
| | | // public void testMessagingInsertSoapWSDL() throws Exception { |
| | | // javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); |
| | | // java.net.URL url = new java.net.URL(new MessagingInsertLocator().getMessagingInsertSoapAddress() + "?WSDL"); |
| | | // javax.xml.rpc.Service service = serviceFactory.createService(url, new MessagingInsertLocator().getServiceName()); |
| | | // assertTrue(service != null); |
| | | // } |
| | | // |
| | | // public void test2MessagingInsertSoapSMSMessageAccept() throws Exception { |
| | | // MessagingInsertSoap_BindingStub binding; |
| | | // try { |
| | | // binding = (MessagingInsertSoap_BindingStub) new MessagingInsertLocator().getMessagingInsertSoap(); |
| | | // } catch (javax.xml.rpc.ServiceException jre) { |
| | | // if (jre.getLinkedCause() != null) jre.getLinkedCause().printStackTrace(); |
| | | // throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); |
| | | // } |
| | | // assertNotNull("binding is null", binding); |
| | | // |
| | | // // Time out after a minute |
| | | // binding.setTimeout(60000); |
| | | // |
| | | // // Test operation |
| | | // binding.SMSMessageAccept(new String(), new javax.xml.rpc.holders.IntHolder(), new javax.xml.rpc.holders.StringHolder()); |
| | | // // TBD - validate results |
| | | // } |
| | | // |
| | | //} |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUserDept; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ã请填ååè½åç§°ãMapperæ¥å£ |
| | | * |
| | | * @author lihu |
| | | * @date 2024-08-29 |
| | | */ |
| | | @Mapper |
| | | @Component("sysUserDeptSystemMapper") |
| | | public interface SysUserDeptMapper { |
| | | /** |
| | | * æ¥è¯¢ã请填ååè½åç§°ã |
| | | * |
| | | * @param id ã请填ååè½åç§°ãä¸»é® |
| | | * @return ã请填ååè½åç§°ã |
| | | */ |
| | | public SysUserDept selectSysUserDeptById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢ã请填ååè½åç§°ãå表 |
| | | * |
| | | * @param sysUserDept ã请填ååè½åç§°ã |
| | | * @return ã请填ååè½åç§°ãéå |
| | | */ |
| | | public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept); |
| | | |
| | | /** |
| | | * æ°å¢ã请填ååè½åç§°ã |
| | | * |
| | | * @param sysUserDept ã请填ååè½åç§°ã |
| | | * @return ç»æ |
| | | */ |
| | | public int insertSysUserDept(SysUserDept sysUserDept); |
| | | |
| | | /** |
| | | * ä¿®æ¹ã请填ååè½åç§°ã |
| | | * |
| | | * @param sysUserDept ã请填ååè½åç§°ã |
| | | * @return ç»æ |
| | | */ |
| | | public int updateSysUserDept(SysUserDept sysUserDept); |
| | | |
| | | /** |
| | | * å é¤ã请填ååè½åç§°ã |
| | | * |
| | | * @param id ã请填ååè½åç§°ãä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSysUserDeptById(Long id); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢é¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public List<SysDept> selectDeptListByUserId(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ã请填ååè½åç§°ã |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteSysUserDeptByIds(Long[] ids); |
| | | |
| | | public int deleteSysUserDeptByCode(SysUserDept sysUserDept); |
| | | |
| | | public int updateSysUserDeptForSync(SysUserDept sysUserDept); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysUserDeptMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.common.core.domain.entity.SysUserDept" id="SysUserDeptResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="orgid" column="orgid"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="deptId" column="dept_id"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="deptCode" column="dept_code"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="deptType" column="dept_type"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="campusid" column="campusid"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="deptResult" type="com.ruoyi.common.core.domain.entity.SysDept"> |
| | | <id property="deptId" column="dept_id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="deptName" column="dept_name"/> |
| | | <result property="ancestors" column="ancestors"/> |
| | | <result property="orderNum" column="order_num"/> |
| | | <result property="leader" column="leader"/> |
| | | <result property="status" column="dept_status"/> |
| | | <result property="campusid" column="campusid"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSysUserDeptVo"> |
| | | select id, |
| | | user_id, |
| | | dept_id, |
| | | del_flag, |
| | | campusid, |
| | | orgid, |
| | | create_time, |
| | | update_time, |
| | | dept_code, |
| | | dept_name, |
| | | dept_type |
| | | from sys_user_dept |
| | | </sql> |
| | | |
| | | <select id="selectSysUserDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept" |
| | | resultMap="SysUserDeptResult"> |
| | | <include refid="selectSysUserDeptVo"/> |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and orgid=#{orgid} |
| | | <if test="userId != null "> |
| | | and user_id = #{userId} |
| | | </if> |
| | | <if test="deptId != null "> |
| | | and dept_id = #{deptId} |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | and del_flag = #{delFlag} |
| | | </if> |
| | | <if test="createTime != null "> |
| | | and create_time = #{createTime} |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | and update_time = #{updateTime} |
| | | </if> |
| | | <if test="deptType != null "> |
| | | and dept_type = #{deptType} |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | and dept_code = #{deptCode} |
| | | </if> |
| | | <if test="campusid != null "> |
| | | and campusid = #{campusid} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectSysUserDeptById" parameterType="Long" |
| | | resultMap="SysUserDeptResult"> |
| | | <include refid="selectSysUserDeptVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertSysUserDept" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into sys_user_dept |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="userId != null">user_id, |
| | | </if> |
| | | <if test="deptId != null">dept_id, |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | del_flag, |
| | | </if> |
| | | <if test="createTime != null "> |
| | | create_time, |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | update_time, |
| | | </if> |
| | | <if test="deptType != null "> |
| | | dept_type, |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | dept_code, |
| | | </if> |
| | | <if test="deptName != null "> |
| | | dept_name, |
| | | </if> |
| | | <if test="orgid != null "> |
| | | orgid, |
| | | </if> |
| | | <if test="userCode != null "> |
| | | user_code, |
| | | </if> |
| | | <if test="campusid != null "> |
| | | campusid, |
| | | </if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="userId != null">#{userId}, |
| | | </if> |
| | | <if test="deptId != null">#{deptId}, |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | #{delFlag}, |
| | | </if> |
| | | <if test="createTime != null "> |
| | | #{createTime}, |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | #{updateTime}, |
| | | </if> |
| | | <if test="deptType != null "> |
| | | #{deptType}, |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | #{deptCode}, |
| | | </if> |
| | | <if test="deptName != null "> |
| | | #{deptName}, |
| | | </if> |
| | | <if test="orgid != null "> |
| | | #{orgid}, |
| | | </if> |
| | | <if test="userCode != null "> |
| | | #{userCode}, |
| | | </if> |
| | | <if test="campusid != null "> |
| | | #{campusid}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateSysUserDept" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="userId != null">user_id = |
| | | #{userId}, |
| | | </if> |
| | | <if test="deptId != null">dept_id = |
| | | #{deptId}, |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | del_flag = #{delFlag}, |
| | | </if> |
| | | <if test="createTime != null "> |
| | | create_time = #{createTime}, |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | update_time = #{updateTime}, |
| | | </if> |
| | | <if test="deptType != null "> |
| | | dept_type = #{deptType}, |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | dept_code = #{deptCode}, |
| | | </if> |
| | | <if test="deptName != null "> |
| | | dept_name = #{deptName}, |
| | | </if> |
| | | <if test="orgid != null "> |
| | | orgid = #{orgid}, |
| | | </if> |
| | | <if test="campusid != null "> |
| | | campusid = #{campusid}, |
| | | </if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteSysUserDeptById" parameterType="Long"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <select id="selectDeptListByUserId" resultMap="deptResult"> |
| | | select d.dept_id, |
| | | d.dept_name, |
| | | d.parent_id, |
| | | d.ancestors, |
| | | d.dept_name, |
| | | d.order_num, |
| | | d.campusid, |
| | | d.leader, |
| | | d.orgid, |
| | | d.status as dept_status |
| | | from sys_dept d |
| | | left join sys_user_dept ud on d.dept_code = ud.dept_code |
| | | where ud.user_id = #{userId} |
| | | and ud.del_flag = 0 |
| | | and d.del_flag = 0 |
| | | </select> |
| | | |
| | | <update id="deleteSysUserDeptByIds" parameterType="String"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1, |
| | | update_time = sysdate() |
| | | </trim> |
| | | where user_id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <update id="deleteSysUserDeptByCode" parameterType="String"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1, |
| | | update_time = sysdate() |
| | | </trim> |
| | | where user_id =#{userId} and dept_code=#{deptCode} |
| | | </update> |
| | | |
| | | <update id="updateSysUserDeptForSync" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="deptId != null">dept_id = |
| | | #{deptId}, |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | del_flag = #{delFlag}, |
| | | </if> |
| | | <if test="createTime != null "> |
| | | create_time = #{createTime}, |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | update_time = #{updateTime}, |
| | | </if> |
| | | <if test="deptType != null "> |
| | | dept_type = #{deptType}, |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | dept_code = #{deptCode}, |
| | | </if> |
| | | <if test="deptName != null "> |
| | | dept_name = #{deptName}, |
| | | </if> |
| | | <if test="orgid != null "> |
| | | orgid = #{orgid}, |
| | | </if> |
| | | <if test="campusid != null "> |
| | | campusid = #{campusid}, |
| | | </if> |
| | | </trim> |
| | | where user_id =#{userId} |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="campusid != null and campusid != ''"> |
| | | and campusid = #{campusid} |
| | | </if> |
| | | </update> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.common.enums; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * ä½é¢ç¶ææä¸¾ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | public enum InhospStateEnum { |
| | | |
| | | /** |
| | | * é¢å
¥é¢ç¶æ |
| | | */ |
| | | PRE_ADMISSION("3", "é¢å
¥é¢", new String[]{"0"}), |
| | | |
| | | /** |
| | | * å¨é¢ç¶æ |
| | | */ |
| | | IN_HOSPITAL("0", "å¨é¢", new String[]{"1"}), |
| | | |
| | | /** |
| | | * åºé¢ç¶æ |
| | | */ |
| | | DISCHARGED("1", "åºé¢", new String[]{}); |
| | | |
| | | /** |
| | | * ç¶æç |
| | | */ |
| | | private final String code; |
| | | |
| | | /** |
| | | * ç¶ææè¿° |
| | | */ |
| | | private final String description; |
| | | |
| | | /** |
| | | * å
许转æ¢çä¸ä¸ç¶æç éå |
| | | */ |
| | | private final Set<String> allowedNextStates; |
| | | |
| | | InhospStateEnum(String code, String description, String[] allowedNextStates) { |
| | | this.code = code; |
| | | this.description = description; |
| | | this.allowedNextStates = new HashSet<>(Arrays.asList(allowedNextStates)); |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | /** |
| | | * 夿æ¯å¦å
许转æ¢å°ç®æ ç¶æ |
| | | * |
| | | * @param targetStateCode ç®æ ç¶æç |
| | | * @return æ¯å¦å
è®¸è½¬æ¢ |
| | | */ |
| | | public boolean canTransitionTo(String targetStateCode) { |
| | | return allowedNextStates.contains(targetStateCode); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¶æç è·åæä¸¾ |
| | | * |
| | | * @param code ç¶æç |
| | | * @return 对åºçæä¸¾,妿ä¸åå¨è¿ånull |
| | | */ |
| | | public static InhospStateEnum fromCode(String code) { |
| | | for (InhospStateEnum state : values()) { |
| | | if (state.getCode().equals(code)) { |
| | | return state; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * éªè¯ç¶æè½¬æ¢æ¯å¦åæ³ |
| | | * |
| | | * @param currentStateCode å½åç¶æç |
| | | * @param targetStateCode ç®æ ç¶æç |
| | | * @return æ¯å¦å
è®¸è½¬æ¢ |
| | | */ |
| | | public static boolean isValidTransition(String currentStateCode, String targetStateCode) { |
| | | if (currentStateCode == null) { |
| | | // åå§ç¶æï¼åªå
许å建é¢å
¥é¢æå¨é¢ |
| | | return "3".equals(targetStateCode) || "0".equals(targetStateCode); |
| | | } |
| | | |
| | | InhospStateEnum currentState = fromCode(currentStateCode); |
| | | if (currentState == null) { |
| | | return false; |
| | | } |
| | | |
| | | return currentState.canTransitionTo(targetStateCode); |
| | | } |
| | | |
| | | /** |
| | | * è·åææå
许çä¸ä¸ç¶æ |
| | | * |
| | | * @return å
许çä¸ä¸ç¶æéå |
| | | */ |
| | | public Set<String> getAllowedNextStates() { |
| | | return new HashSet<>(allowedNextStates); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.common.exception; |
| | | |
| | | /** |
| | | * ç¶æè½¬æ¢å¼å¸¸ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | public class StateTransitionException extends RuntimeException { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public StateTransitionException(String message) { |
| | | super(message); |
| | | } |
| | | |
| | | public StateTransitionException(String message, Throwable cause) { |
| | | super(message, cause); |
| | | } |
| | | |
| | | public StateTransitionException(String currentState, String targetState) { |
| | | super(String.format("éæ³çç¶æè½¬æ¢: ä» [%s] å° [%s]", currentState, targetState)); |
| | | } |
| | | } |
| | |
| | | |
| | | private Integer visitCount; |
| | | |
| | | /** |
| | | * rateDay 代表å 天忶ç |
| | | */ |
| | | @ApiModelProperty(value = "å 天忶ç") |
| | | private Integer rateDay; |
| | | |
| | | private Integer isVisitAgain; |
| | | |
| | | @ApiModelProperty(value = "å¼å¸¸é¢è¦ï¼0绿è²ï¼1红è²ï¼2é»è²") |
| | |
| | | @Excel(name = " åæ¶ç ") |
| | | private Double rate = 0.0; |
| | | |
| | | @ApiModelProperty(value = "宿ç") |
| | | @Excel(name = " 宿ç ") |
| | | private Double finishRate = 0.0; |
| | | |
| | | @ApiModelProperty(value = "馿¬¡é访ç") |
| | | @Excel(name = " 馿¬¡é访ç ") |
| | | private String followUpRate; |
| | |
| | | @ApiModelProperty(value = "æå¡ç±»å(1ãçæµè¯ä¼°ï¼2ãåºé¢é访ï¼3ãé¨è¯é访ï¼4ã宣æå
³æï¼5ãå¤è¯ç®¡çï¼6ãæ»¡æåº¦è°æ¥ï¼7ãæ£è
æ¥åï¼ 8ãå
¶ä»éç¥ 9使£é访 10.廿é访 11ï¼å½±åä¸ç§é访 12ãå¿çµä¸ç§éè®¿ï¼ 13ä¸ç§é访)") |
| | | private String serviceType; |
| | | |
| | | @ApiModelProperty(value = "æå¡ç±»åéå") |
| | | private List<Long> serviceTypeList; |
| | | |
| | | /** |
| | | * rateDay 代表å 天忶ç |
| | | */ |
| | | @ApiModelProperty(value = "å 天忶ç") |
| | | private Integer rateDay; |
| | | /** |
| | | * æ§å« |
| | | */ |
| | |
| | | @ApiModelProperty(value = "åç»codeéå") |
| | | private List<String> groupKeyList; |
| | | |
| | | // /** |
| | | // * æ¥æéå¶ ç®åç±å端æ§å¶ |
| | | // */ |
| | | // @ApiModelProperty(value = "æ¥æéå¶ï¼0å
¨é¨æå¡ 1æªæ¢å½åæ¥æ") |
| | | // private String dateLimit; |
| | | } |
| | |
| | | ssRate.setStarttime(serviceSubtaskCountReq.getStartTime()); |
| | | ssRate.setEndtime(serviceSubtaskCountReq.getEndTime()); |
| | | ssRate.setVisitCount(serviceSubtaskCountReq.getVisitCount()); |
| | | ssRate.setServiceTypeList(serviceSubtaskCountReq.getServiceType()); |
| | | if (serviceSubtaskCountReq.getEndTime() != null && new Date().before(serviceSubtaskCountReq.getEndTime())) { |
| | | ssRate.setEndtime(new Date()); |
| | | } |
| | | ssRate.setGroupKey(groupKey); |
| | | ssRate.setGroupKeyList(groupKeyList); |
| | | ssRate.setRateDay(serviceSubtaskCountReq.getRateDay()); |
| | | Map<String, Map<String, Object>> jsRates = new HashMap<>(); |
| | | if (!collect.isEmpty()) { |
| | | jsRates = serviceSubtaskMapper.selectTimelyRateBatch(ssRate); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.ruoyi.common.core.service.ISubtaskSmsService; |
| | | import com.smartor.common.LSHospTokenUtil; |
| | | import com.smartor.domain.ServiceSubtask; |
| | | import com.smartor.mapper.ServiceSubtaskMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * çä¿¡åé跨模åæå¡å®ç°ï¼ä¾ ruoyi-system éè¿ SpringUtils è°ç¨ï¼ |
| | | */ |
| | | @Service |
| | | public class SubtaskSmsServiceImpl implements ISubtaskSmsService { |
| | | |
| | | @Autowired |
| | | private ServiceSubtaskMapper serviceSubtaskMapper; |
| | | |
| | | @Override |
| | | public void updateSubtaskVisitNotice(Long subId, Integer visitNotice) { |
| | | ServiceSubtask serviceSubtask = new ServiceSubtask(); |
| | | serviceSubtask.setId(subId); |
| | | serviceSubtask.setVisitNotice(visitNotice); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | |
| | | @Override |
| | | public String getLSHospToken(String orgid, String tokenUrl) { |
| | | return LSHospTokenUtil.getToken(orgid, tokenUrl); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.common.enums.InhospStateEnum; |
| | | import com.smartor.common.exception.StateTransitionException; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.statemachine.handler.InhospStateHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * ä½é¢ç¶ææºç®¡çå¨ |
| | | * è´è´£ç¶æè½¬æ¢çåè°ååå¸å¼é管ç |
| | | * |
| | | * @author smartor |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class InhospStateMachine { |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService patMedInhospService; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | @Autowired |
| | | private List<InhospStateHandler> handlers; |
| | | |
| | | /** |
| | | * ç¶æå¤ç卿 å°è¡¨ |
| | | */ |
| | | private final Map<String, InhospStateHandler> handlerMap = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * åå¸å¼éè¶
æ¶æ¶é´ï¼ç§ï¼ |
| | | */ |
| | | private static final int LOCK_TIMEOUT = 10; |
| | | |
| | | /** |
| | | * åå¸å¼éåç¼ |
| | | */ |
| | | private static final String LOCK_KEY_PREFIX = "inhosp:state:lock:"; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | // åå§åå¤ç卿 å° |
| | | if (CollectionUtils.isNotEmpty(handlers)) { |
| | | for (InhospStateHandler handler : handlers) { |
| | | handlerMap.put(handler.getStateCode(), handler); |
| | | log.info("ãInhospStateMachineãæ³¨åç¶æå¤çå¨ï¼{} -> {}", |
| | | handler.getStateCode(), handler.getClass().getSimpleName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡ç¶æè½¬æ¢ï¼å¸¦åå¸å¼éï¼ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @param targetState ç®æ ç¶æ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean transitionState(PatMedInhosp patMedInhosp, String targetState) { |
| | | String serialnum = StringUtils.trim(patMedInhosp.getSerialnum()); |
| | | String orgid = StringUtils.trim(patMedInhosp.getOrgid()); |
| | | |
| | | if (StringUtils.isEmpty(serialnum) || StringUtils.isEmpty(orgid)) { |
| | | log.error("ãInhospStateMachineãserialnumæorgidä¸ºç©ºï¼æ æ³æ§è¡ç¶æè½¬æ¢"); |
| | | return false; |
| | | } |
| | | |
| | | // çæåå¸å¼ékeyï¼ä¸å
å«stateï¼é使´ä¸ªæ£è
è®°å½ï¼ |
| | | String lockKey = LOCK_KEY_PREFIX + serialnum + ":" + orgid; |
| | | Boolean locked = false; |
| | | |
| | | try { |
| | | // å°è¯è·ååå¸å¼é |
| | | locked = redisTemplate.opsForValue().setIfAbsent(lockKey, "1", LOCK_TIMEOUT, TimeUnit.SECONDS); |
| | | |
| | | if (locked == null) { |
| | | log.warn("ãInhospStateMachineãRedisä¸å¯ç¨ï¼é级为æ éæ§è¡ï¼serialnum={}, orgid={}", serialnum, orgid); |
| | | return executeStateTransition(patMedInhosp, targetState); |
| | | } |
| | | |
| | | if (!Boolean.TRUE.equals(locked)) { |
| | | log.warn("ãInhospStateMachineãè·ååå¸å¼é失败ï¼å
¶ä»çº¿ç¨æ£å¨å¤çï¼serialnum={}, orgid={}", serialnum, orgid); |
| | | return false; |
| | | } |
| | | |
| | | // è·åéæåï¼æ§è¡ç¶æè½¬æ¢ |
| | | return executeStateTransition(patMedInhosp, targetState); |
| | | |
| | | } catch (Exception e) { |
| | | log.error("ãInhospStateMachineãç¶æè½¬æ¢å¼å¸¸ï¼serialnum={}, orgid={}, targetState={}, é误ï¼{}", |
| | | serialnum, orgid, targetState, e.getMessage(), e); |
| | | return false; |
| | | } finally { |
| | | // éæ¾é |
| | | if (Boolean.TRUE.equals(locked)) { |
| | | try { |
| | | redisTemplate.delete(lockKey); |
| | | log.debug("ãInhospStateMachineãéæ¾åå¸å¼éæåï¼lockKey={}", lockKey); |
| | | } catch (Exception e) { |
| | | log.warn("ãInhospStateMachineãéæ¾åå¸å¼é失败ï¼lockKey={}, é误ï¼{}", lockKey, e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ§è¡ç¶æè½¬æ¢é»è¾ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @param targetState ç®æ ç¶æ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | private boolean executeStateTransition(PatMedInhosp patMedInhosp, String targetState) { |
| | | String serialnum = patMedInhosp.getSerialnum(); |
| | | String orgid = patMedInhosp.getOrgid(); |
| | | |
| | | log.info("ãInhospStateMachineãå¼å§æ§è¡ç¶æè½¬æ¢ï¼serialnum={}, orgid={}, targetState={}", |
| | | serialnum, orgid, targetState); |
| | | |
| | | // 1. æ¥è¯¢å½åç¶æ |
| | | PatMedInhosp query = new PatMedInhosp(); |
| | | query.setSerialnum(StringUtils.trim(serialnum)); |
| | | query.setOrgid(StringUtils.trim(orgid)); |
| | | query.setPatno(StringUtils.trim(patMedInhosp.getPatno())); |
| | | query.setInhospstate(null); // æ¥è¯¢ææç¶æ |
| | | |
| | | List<PatMedInhosp> existingRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | String currentState = null; |
| | | |
| | | if (CollectionUtils.isNotEmpty(existingRecords)) { |
| | | // 妿åå¨å¤æ¡è®°å½ï¼åææ°ç䏿¡ï¼ç论ä¸ç»è¿ç¶ææºåä¸åºè¯¥æå¤æ¡ï¼ |
| | | currentState = existingRecords.get(0).getInhospstate(); |
| | | log.info("ãInhospStateMachineãå½åç¶æï¼{}", currentState); |
| | | } |
| | | |
| | | // 2. éªè¯ç¶æè½¬æ¢æ¯å¦åæ³ |
| | | if (!InhospStateEnum.isValidTransition(currentState, targetState)) { |
| | | log.error("ãInhospStateMachineãéæ³çç¶æè½¬æ¢ï¼ä» [{}] å° [{}]ï¼serialnum={}, orgid={}", |
| | | currentState, targetState, serialnum, orgid); |
| | | throw new StateTransitionException(currentState, targetState); |
| | | } |
| | | |
| | | // 3. è·å对åºçç¶æå¤çå¨ |
| | | InhospStateHandler handler = handlerMap.get(targetState); |
| | | if (handler == null) { |
| | | log.error("ãInhospStateMachineãæªæ¾å°ç¶æå¤çå¨ï¼targetState={}", targetState); |
| | | return false; |
| | | } |
| | | |
| | | // 4. æ§è¡ç¶æå¤ç |
| | | boolean result = handler.handle(patMedInhosp); |
| | | |
| | | if (result) { |
| | | log.info("ãInhospStateMachineãç¶æè½¬æ¢æåï¼serialnum={}, orgid={}, {} -> {}", |
| | | serialnum, orgid, currentState, targetState); |
| | | } else { |
| | | log.warn("ãInhospStateMachineãç¶æè½¬æ¢å¤±è´¥ï¼serialnum={}, orgid={}, {} -> {}", |
| | | serialnum, orgid, currentState, targetState); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åç¶æ |
| | | * |
| | | * @param serialnum æµæ°´å· |
| | | * @param orgid æºæID |
| | | * @param patno æ£è
ç¼å· |
| | | * @return å½åç¶æç ï¼å¦æä¸åå¨è¿ånull |
| | | */ |
| | | public String getCurrentState(String serialnum, String orgid, String patno) { |
| | | PatMedInhosp query = new PatMedInhosp(); |
| | | query.setSerialnum(StringUtils.trim(serialnum)); |
| | | query.setOrgid(StringUtils.trim(orgid)); |
| | | query.setPatno(StringUtils.trim(patno)); |
| | | query.setInhospstate(null); |
| | | |
| | | List<PatMedInhosp> records = patMedInhospService.selectPatMedInhosp(query); |
| | | |
| | | if (CollectionUtils.isEmpty(records)) { |
| | | return null; |
| | | } |
| | | |
| | | return records.get(0).getInhospstate(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine; |
| | | |
| | | /** |
| | | * ä½é¢ç¶ææºä½¿ç¨ç¤ºä¾ |
| | | * |
| | | * æ¬ç±»å±ç¤ºå¦ä½å¨ç°æä»£ç ä¸éæç¶ææºï¼ä»
ä¾åèï¼ä¸éè¦è¿è¡ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | public class InhospStateMachineExample { |
| | | |
| | | /** |
| | | * 示ä¾1: å¨ServiceSLTDHealthcareRecordServiceImplä¸ä½¿ç¨ç¶ææº |
| | | * |
| | | * åæ¹æ³ç¾åï¼ |
| | | * private void processPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry) |
| | | * |
| | | * æ¹é æ¹æ¡ï¼ç¨ç¶ææºæ¿æ¢åæçif-elseé»è¾ |
| | | */ |
| | | public void exampleUsageInService() { |
| | | /* |
| | | // å代ç ï¼561-677è¡ï¼æ¹é ä¸ºï¼ |
| | | |
| | | @Autowired |
| | | private InhospStateMachineService stateMachineService; |
| | | |
| | | private void processPatientInhospInfo(ServiceSLTDInhospResDTO dto, PatArchive patArchive, String cry) { |
| | | // æå»ºä½é¢è®°å½å¯¹è±¡ï¼ä¿æåæé»è¾ï¼ |
| | | PatMedInhosp patMedInhosp = buildPatientInhospInfo(dto, patArchive, cry); |
| | | |
| | | // 使ç¨ç¶ææºå¤çç¶æè½¬æ¢ï¼æ¿æ¢åæç大段if-elseï¼ |
| | | boolean success = stateMachineService.processStateChange(patMedInhosp, cry); |
| | | |
| | | if (success) { |
| | | log.info("ãprocessPatientInhospInfoãç¶æè½¬æ¢æåï¼serialnum={}, cry={}", |
| | | patMedInhosp.getSerialnum(), cry); |
| | | } else { |
| | | log.warn("ãprocessPatientInhospInfoãç¶æè½¬æ¢å¤±è´¥æè·³è¿ï¼serialnum={}, cry={}", |
| | | patMedInhosp.getSerialnum(), cry); |
| | | } |
| | | } |
| | | |
| | | // ä¼ç¹ï¼ |
| | | // 1. 代ç ä»100+è¡åå°å°10è¡ |
| | | // 2. ç¶æè½¬æ¢é»è¾æ¸
æ°ï¼æäºç»´æ¤ |
| | | // 3. èªå¨å åå¸å¼éï¼è§£å³å¹¶åé®é¢ |
| | | // 4. ç¶ææ ¡éªè§åéä¸ç®¡ç |
| | | */ |
| | | } |
| | | |
| | | /** |
| | | * 示ä¾2: ç´æ¥ä½¿ç¨ç¶ææºæå¡API |
| | | */ |
| | | public void exampleDirectUsage() { |
| | | /* |
| | | @Autowired |
| | | private InhospStateMachineService stateMachineService; |
| | | |
| | | // å¤çé¢å
¥é¢ |
| | | PatMedInhosp preAdmission = new PatMedInhosp(); |
| | | preAdmission.setSerialnum("202601290001"); |
| | | preAdmission.setOrgid("HOS001"); |
| | | preAdmission.setPatno("P001"); |
| | | // ... 设置å
¶ä»å段 |
| | | |
| | | boolean result1 = stateMachineService.processPreAdmission(preAdmission); |
| | | |
| | | // å¤çå
¥é¢ï¼ä¼èªå¨ä»é¢å
¥é¢ç¶æè½¬æ¢ï¼ |
| | | PatMedInhosp inHospital = new PatMedInhosp(); |
| | | inHospital.setSerialnum("202601290001"); |
| | | inHospital.setOrgid("HOS001"); |
| | | inHospital.setPatno("P001"); |
| | | // ... 设置å
¶ä»å段 |
| | | |
| | | boolean result2 = stateMachineService.processInHospital(inHospital); |
| | | |
| | | // å¤çåºé¢ï¼ä¼èªå¨ä»å
¥é¢ç¶æè½¬æ¢ï¼ |
| | | PatMedInhosp discharge = new PatMedInhosp(); |
| | | discharge.setSerialnum("202601290001"); |
| | | discharge.setOrgid("HOS001"); |
| | | discharge.setPatno("P001"); |
| | | // ... 设置å
¶ä»å段 |
| | | |
| | | boolean result3 = stateMachineService.processDischarge(discharge); |
| | | |
| | | // æ¥è¯¢å½åç¶æ |
| | | String currentState = stateMachineService.getCurrentState("202601290001", "HOS001", "P001"); |
| | | // currentState = "1" (åºé¢ç¶æ) |
| | | */ |
| | | } |
| | | |
| | | /** |
| | | * 示ä¾3: ç¶æè½¬æ¢æ ¡éª |
| | | */ |
| | | public void exampleStateValidation() { |
| | | /* |
| | | // éæ³è½¬æ¢ç¤ºä¾1ï¼é¢å
¥é¢ç´æ¥å°åºé¢ï¼ä¼æåºå¼å¸¸ï¼ |
| | | try { |
| | | PatMedInhosp discharge = new PatMedInhosp(); |
| | | discharge.setSerialnum("202601290002"); |
| | | discharge.setOrgid("HOS001"); |
| | | discharge.setPatno("P002"); |
| | | discharge.setInhospstate("3"); // å½åæ¯é¢å
¥é¢ |
| | | |
| | | stateMachineService.processDischarge(discharge); // å°è¯ç´æ¥åºé¢ |
| | | |
| | | } catch (StateTransitionException e) { |
| | | log.error("ç¶æè½¬æ¢å¤±è´¥ï¼{}", e.getMessage()); |
| | | // è¾åº: éæ³çç¶æè½¬æ¢: ä» [3] å° [1] |
| | | } |
| | | |
| | | // éæ³è½¬æ¢ç¤ºä¾2ï¼éå¤å
¥é¢ï¼ä¼è¢«handleræç»ï¼ |
| | | PatMedInhosp inHospital1 = new PatMedInhosp(); |
| | | inHospital1.setSerialnum("202601290003"); |
| | | inHospital1.setOrgid("HOS001"); |
| | | inHospital1.setPatno("P003"); |
| | | |
| | | stateMachineService.processInHospital(inHospital1); // ç¬¬ä¸æ¬¡å
¥é¢ï¼æå |
| | | |
| | | boolean result = stateMachineService.processInHospital(inHospital1); // ç¬¬äºæ¬¡å
¥é¢ï¼å¤±è´¥ |
| | | // result = falseï¼æ¥å¿è¾åºè¦å |
| | | */ |
| | | } |
| | | |
| | | /** |
| | | * ç¶ææºæ¶æè¯´æ |
| | | * |
| | | * 1. ç¶ææä¸¾ (InhospStateEnum) |
| | | * - å®ä¹ææç¶æåå
许ç转æ¢è§å |
| | | * - PRE_ADMISSION(3) -> IN_HOSPITAL(0) -> DISCHARGED(1) |
| | | * |
| | | * 2. ç¶æå¤çå¨ (InhospStateHandler) |
| | | * - PreAdmissionHandler: å¤çé¢å
¥é¢é»è¾ |
| | | * - InHospitalHandler: å¤çå
¥é¢é»è¾ |
| | | * - DischargeHandler: å¤çåºé¢é»è¾ |
| | | * |
| | | * 3. ç¶ææºç®¡çå¨ (InhospStateMachine) |
| | | * - åè°ç¶æè½¬æ¢ |
| | | * - 管çåå¸å¼é |
| | | * - éªè¯ç¶æåæ³æ§ |
| | | * |
| | | * 4. é¨é¢æå¡ (InhospStateMachineService) |
| | | * - æä¾ä¾¿æ·API |
| | | * - å°è£
夿é»è¾ |
| | | * |
| | | * 5. å¼å¸¸å¤ç (StateTransitionException) |
| | | * - å¤çéæ³ç¶æè½¬æ¢ |
| | | */ |
| | | |
| | | /** |
| | | * æ°æ®åºé
å建议 |
| | | * |
| | | * 1. æ·»å å¯ä¸ç´¢å¼ï¼å»ºè®®ï¼ |
| | | * CREATE UNIQUE INDEX uk_serialnum_orgid_state |
| | | * ON pat_med_inhosp(serialnum, orgid, inhospstate); |
| | | * |
| | | * 2. æè
æ´ä¸¥æ ¼ç约æï¼ç¡®ä¿ä¸ä¸ªæ£è
åªæä¸æ¡è®°å½ï¼ |
| | | * CREATE UNIQUE INDEX uk_serialnum_orgid |
| | | * ON pat_med_inhosp(serialnum, orgid); |
| | | * |
| | | * 注æï¼å¦æä½¿ç¨ç¬¬2ç§ç´¢å¼ï¼éè¦ç¡®ä¿ï¼ |
| | | * - ç¶æåæ´å¿
é¡»èµ°æ´æ°ï¼ä¸è½æå
¥æ°è®°å½ï¼ |
| | | * - éè¦æ¸
çåå²å¤ç¶æè®°å½ |
| | | */ |
| | | |
| | | /** |
| | | * æ¸è¿å¼éææ¹æ¡ |
| | | * |
| | | * é¶æ®µ1ï¼å忍¡å¼ï¼æ¨èï¼ |
| | | * - ä¿çåæä»£ç ä¸å |
| | | * - æ°å¢ç¶ææºè°ç¨ï¼è®°å½æ¥å¿å¯¹æ¯ |
| | | * - éªè¯ç¶ææºé»è¾æ£ç¡®æ§ |
| | | * |
| | | * é¶æ®µ2ï¼ç°åº¦åæ¢ |
| | | * - é¨åcryå¼èµ°ç¶ææº |
| | | * - è§å¯ç产ç¯å¢è¡¨ç° |
| | | * |
| | | * é¶æ®µ3ï¼å®å
¨è¿ç§» |
| | | * - å
¨é¨é»è¾åæ¢å°ç¶ææº |
| | | * - ç§»é¤åæif-else代ç |
| | | */ |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine; |
| | | |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * ä½é¢ç¶ææºæå¡ï¼é¨é¢æ¨¡å¼ï¼ |
| | | * æä¾ä¾¿æ·çç¶æè½¬æ¢æ¹æ³ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class InhospStateMachineService { |
| | | |
| | | @Autowired |
| | | private InhospStateMachine stateMachine; |
| | | |
| | | /** |
| | | * å¤çé¢å
¥é¢ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean processPreAdmission(PatMedInhosp patMedInhosp) { |
| | | log.info("ãInhospStateMachineServiceãå¤çé¢å
¥é¢ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return stateMachine.transitionState(patMedInhosp, "3"); |
| | | } |
| | | |
| | | /** |
| | | * å¤çå
¥é¢ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean processInHospital(PatMedInhosp patMedInhosp) { |
| | | log.info("ãInhospStateMachineServiceãå¤çå
¥é¢ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return stateMachine.transitionState(patMedInhosp, "0"); |
| | | } |
| | | |
| | | /** |
| | | * å¤çåºé¢ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean processDischarge(PatMedInhosp patMedInhosp) { |
| | | log.info("ãInhospStateMachineServiceãå¤çåºé¢ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return stateMachine.transitionState(patMedInhosp, "1"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®cryåæ°å¤çç¶æè½¬æ¢ |
| | | * |
| | | * @param patMedInhosp ä½é¢è®°å½å¯¹è±¡ |
| | | * @param cry ç¶æç ï¼0:å
¥é¢, 1:åºé¢, 3:é¢å
¥é¢ï¼ |
| | | * @return æ¯å¦æå |
| | | */ |
| | | public boolean processStateChange(PatMedInhosp patMedInhosp, String cry) { |
| | | log.info("ãInhospStateMachineServiceãæ ¹æ®cryå¤çç¶æåæ´ï¼serialnum={}, orgid={}, cry={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), cry); |
| | | |
| | | if ("0".equals(cry)) { |
| | | return processInHospital(patMedInhosp); |
| | | } else if ("1".equals(cry)) { |
| | | return processDischarge(patMedInhosp); |
| | | } else if ("3".equals(cry)) { |
| | | return processPreAdmission(patMedInhosp); |
| | | } else { |
| | | log.error("ãInhospStateMachineServiceãæªç¥çcryå¼ï¼{}", cry); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è·åå½åç¶æ |
| | | * |
| | | * @param serialnum æµæ°´å· |
| | | * @param orgid æºæID |
| | | * @param patno æ£è
ç¼å· |
| | | * @return å½åç¶æç |
| | | */ |
| | | public String getCurrentState(String serialnum, String orgid, String patno) { |
| | | return stateMachine.getCurrentState(serialnum, orgid, patno); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine.handler; |
| | | |
| | | import com.smartor.domain.PatMedInhosp; |
| | | |
| | | /** |
| | | * ä½é¢ç¶æå¤ç卿¥å£ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | public interface InhospStateHandler { |
| | | |
| | | /** |
| | | * å¤çç¶æåæ´ |
| | | * |
| | | * @param patMedInhosp å¾
å¤ççä½é¢è®°å½å¯¹è±¡ |
| | | * @return å¤çç»æ(true:æå, false:失败) |
| | | */ |
| | | boolean handle(PatMedInhosp patMedInhosp); |
| | | |
| | | /** |
| | | * è·å该å¤çå¨å¯¹åºçç¶æç |
| | | * |
| | | * @return ç¶æç |
| | | */ |
| | | String getStateCode(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine.handler.impl; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.statemachine.handler.InhospStateHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * åºé¢ç¶æå¤çå¨ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class DischargeHandler implements InhospStateHandler { |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService patMedInhospService; |
| | | |
| | | @Override |
| | | public boolean handle(PatMedInhosp patMedInhosp) { |
| | | log.info("ãDischargeHandlerãå¤çåºé¢é»è¾ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | |
| | | PatMedInhosp query = new PatMedInhosp(); |
| | | query.setPatno(StringUtils.trim(patMedInhosp.getPatno())); |
| | | query.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum())); |
| | | query.setOrgid(StringUtils.trim(patMedInhosp.getOrgid())); |
| | | |
| | | // 1. å
æ£æ¥æ¯å¦å·²åå¨åºé¢è®°å½ |
| | | query.setInhospstate("1"); |
| | | List<PatMedInhosp> dischargedRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(dischargedRecords)) { |
| | | log.warn("ãDischargeHandlerãåºé¢è®°å½å·²åå¨ï¼è·³è¿ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } |
| | | |
| | | // 2. æ£æ¥æ¯å¦åå¨å
¥é¢è®°å½ï¼æ£å¸¸æµç¨ï¼å¿
é¡»å
å
¥é¢æè½åºé¢ï¼ |
| | | query.setInhospstate("0"); |
| | | List<PatMedInhosp> inHospitalRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(inHospitalRecords)) { |
| | | // åå¨å
¥é¢è®°å½ï¼æ§è¡ç¶ææ´æ°ä¸ºåºé¢ |
| | | try { |
| | | patMedInhosp.setInhospstate("1"); |
| | | patMedInhosp.setInhospid(inHospitalRecords.get(0).getInhospid()); |
| | | int updateCount = patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | log.info("ãDischargeHandlerãæ´æ°å
¥é¢è®°å½ä¸ºåºé¢ç¶æï¼serialnum={}, updateCount={}", |
| | | patMedInhosp.getSerialnum(), updateCount); |
| | | return updateCount > 0; |
| | | } catch (Exception e) { |
| | | log.error("ãDischargeHandlerãæ´æ°å
¥é¢è®°å½å¤±è´¥ï¼serialnum={}, orgid={}, é误ï¼{}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), e.getMessage(), e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // 3. æ£æ¥æ¯å¦åå¨é¢å
¥é¢è®°å½ï¼å¼å¸¸æµç¨ï¼ä»é¢å
¥é¢ç´æ¥åºé¢ï¼å¯è½æ¯åæ¶å
¥é¢ï¼ |
| | | query.setInhospstate("3"); |
| | | List<PatMedInhosp> preAdmissionRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(preAdmissionRecords)) { |
| | | log.warn("ãDischargeHandlerãåå¨é¢å
¥é¢è®°å½ä½æªå
¥é¢ï¼ä¸å
è®¸ç´æ¥åºé¢ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | // æ ¹æ®ä¸å¡éæ±å³å®æ¯å¦å
许ä»é¢å
¥é¢ç´æ¥åºé¢ï¼è¿éææ¶ä¸å
许 |
| | | return false; |
| | | } |
| | | |
| | | // 4. ä¸åå¨ä»»ä½è®°å½ï¼å¼å¸¸æ
åµï¼ä¸åºè¯¥æ²¡æå
¥é¢è®°å½å°±åºé¢ |
| | | log.warn("ãDischargeHandlerãæ å
¥é¢è®°å½ï¼ä¸å
è®¸ç´æ¥æå
¥åºé¢è®°å½ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | |
| | | // 妿ä¸å¡å
è®¸ç´æ¥æå
¥åºé¢è®°å½ï¼å¦æ°æ®ä¿®å¤åºæ¯ï¼ï¼å¯ä»¥åæ¶æ³¨é以ä¸ä»£ç |
| | | /* |
| | | try { |
| | | patMedInhosp.setInhospstate("1"); |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | log.info("ãDischargeHandlerãæåæå
¥åºé¢è®°å½ï¼æ å
¥é¢è®°å½ï¼ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | return true; |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("ãDischargeHandlerãåºé¢è®°å½å·²åå¨ï¼å¹¶åæå
¥ï¼ï¼è·³è¿ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("ãDischargeHandlerãæå
¥åºé¢è®°å½å¤±è´¥ï¼serialnum={}, orgid={}, é误ï¼{}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), e.getMessage(), e); |
| | | return false; |
| | | } |
| | | */ |
| | | |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public String getStateCode() { |
| | | return "1"; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine.handler.impl; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.statemachine.handler.InhospStateHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
¥é¢ç¶æå¤çå¨ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class InHospitalHandler implements InhospStateHandler { |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService patMedInhospService; |
| | | |
| | | @Override |
| | | public boolean handle(PatMedInhosp patMedInhosp) { |
| | | log.info("ãInHospitalHandlerãå¤çå
¥é¢é»è¾ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | |
| | | PatMedInhosp query = new PatMedInhosp(); |
| | | query.setPatno(StringUtils.trim(patMedInhosp.getPatno())); |
| | | query.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum())); |
| | | query.setOrgid(StringUtils.trim(patMedInhosp.getOrgid())); |
| | | |
| | | // 1. å
æ£æ¥æ¯å¦å·²åå¨å
¥é¢è®°å½ |
| | | query.setInhospstate("0"); |
| | | List<PatMedInhosp> inHospitalRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(inHospitalRecords)) { |
| | | log.warn("ãInHospitalHandlerãå
¥é¢è®°å½å·²åå¨ï¼è·³è¿ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } |
| | | |
| | | // 2. æ£æ¥æ¯å¦åå¨é¢å
¥é¢è®°å½ |
| | | query.setInhospstate("3"); |
| | | List<PatMedInhosp> preAdmissionRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(preAdmissionRecords)) { |
| | | // åå¨é¢å
¥é¢è®°å½ï¼æ§è¡ç¶ææ´æ° |
| | | try { |
| | | patMedInhosp.setInhospstate("0"); |
| | | patMedInhosp.setInhospid(preAdmissionRecords.get(0).getInhospid()); |
| | | int updateCount = patMedInhospService.updatePatMedInhosp(patMedInhosp); |
| | | log.info("ãInHospitalHandlerãæ´æ°é¢å
¥é¢è®°å½ä¸ºå
¥é¢ç¶æï¼serialnum={}, updateCount={}", |
| | | patMedInhosp.getSerialnum(), updateCount); |
| | | return updateCount > 0; |
| | | } catch (Exception e) { |
| | | log.error("ãInHospitalHandlerãæ´æ°é¢å
¥é¢è®°å½å¤±è´¥ï¼serialnum={}, orgid={}, é误ï¼{}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), e.getMessage(), e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // 3. æ£æ¥æ¯å¦å·²åºé¢ï¼å¦æå·²åºé¢åä¸å
è®¸ç´æ¥å
¥é¢ï¼ |
| | | query.setInhospstate("1"); |
| | | List<PatMedInhosp> dischargedRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | if (CollectionUtils.isNotEmpty(dischargedRecords)) { |
| | | log.warn("ãInHospitalHandlerãæ£è
å·²åºé¢ï¼ä¸å
è®¸åæ¬¡å
¥é¢ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } |
| | | |
| | | // 4. ä¸åå¨ä»»ä½è®°å½ï¼ç´æ¥æå
¥å
¥é¢è®°å½ |
| | | try { |
| | | patMedInhosp.setInhospstate("0"); |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | log.info("ãInHospitalHandlerãæåæå
¥å
¥é¢è®°å½ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | return true; |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("ãInHospitalHandlerãå
¥é¢è®°å½å·²åå¨ï¼å¹¶åæå
¥ï¼ï¼è·³è¿ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("ãInHospitalHandlerãæå
¥å
¥é¢è®°å½å¤±è´¥ï¼serialnum={}, orgid={}, é误ï¼{}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), e.getMessage(), e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getStateCode() { |
| | | return "0"; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.statemachine.handler.impl; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.PatMedInhosp; |
| | | import com.smartor.service.IPatMedInhospService; |
| | | import com.smartor.statemachine.handler.InhospStateHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * é¢å
¥é¢ç¶æå¤çå¨ |
| | | * |
| | | * @author smartor |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class PreAdmissionHandler implements InhospStateHandler { |
| | | |
| | | @Autowired |
| | | private IPatMedInhospService patMedInhospService; |
| | | |
| | | @Override |
| | | public boolean handle(PatMedInhosp patMedInhosp) { |
| | | log.info("ãPreAdmissionHandlerãå¤çé¢å
¥é¢é»è¾ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | |
| | | // æ¥è¯¢æ¯å¦å·²åå¨ä»»ä½ç¶æçè®°å½ |
| | | PatMedInhosp query = new PatMedInhosp(); |
| | | query.setPatno(StringUtils.trim(patMedInhosp.getPatno())); |
| | | query.setSerialnum(StringUtils.trim(patMedInhosp.getSerialnum())); |
| | | query.setOrgid(StringUtils.trim(patMedInhosp.getOrgid())); |
| | | query.setInhospstate(null); // æ¥è¯¢ææç¶æ |
| | | |
| | | List<PatMedInhosp> existingRecords = patMedInhospService.selectPatMedInhosp(query); |
| | | |
| | | if (CollectionUtils.isNotEmpty(existingRecords)) { |
| | | log.warn("ãPreAdmissionHandlerãè®°å½å·²åå¨ï¼è·³è¿é¢å
¥é¢æå
¥ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } |
| | | |
| | | // ä¸åå¨ä»»ä½è®°å½ï¼æ§è¡æå
¥ |
| | | try { |
| | | patMedInhosp.setInhospstate("3"); |
| | | patMedInhospService.insertPatMedInhosp(patMedInhosp); |
| | | log.info("ãPreAdmissionHandlerãæåæå
¥é¢å
¥é¢è®°å½ï¼serialnum={}", patMedInhosp.getSerialnum()); |
| | | return true; |
| | | } catch (org.springframework.dao.DuplicateKeyException e) { |
| | | log.warn("ãPreAdmissionHandlerãé¢å
¥é¢è®°å½å·²åå¨ï¼å¹¶åæå
¥ï¼ï¼è·³è¿ï¼serialnum={}, orgid={}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid()); |
| | | return false; |
| | | } catch (Exception e) { |
| | | log.error("ãPreAdmissionHandlerãæå
¥é¢å
¥é¢è®°å½å¤±è´¥ï¼serialnum={}, orgid={}, é误ï¼{}", |
| | | patMedInhosp.getSerialnum(), patMedInhosp.getOrgid(), e.getMessage(), e); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public String getStateCode() { |
| | | return "3"; |
| | | } |
| | | } |
| | |
| | | ) a |
| | | </select> |
| | | |
| | | <select id="selectTimelyRateBatch" parameterType="com.smartor.domain.ServiceSubtask" resultType="map"> |
| | | <select id="selectTimelyRateBatch" parameterType="com.smartor.domain.entity.ServiceSubtaskEntity" resultType="map"> |
| | | SELECT |
| | | <if test="groupKey != null and groupKey != ''"> |
| | | ${groupKey} as groupKey, |
| | | </if> |
| | | SUM(CASE WHEN DATE(visit_time) < DATE(IFNULL(finishtime, NOW())) THEN 1 ELSE 0 END) / COUNT(*) as rate |
| | | SUM(CASE WHEN finishtime IS NOT NULL AND DATE(visit_time) <= DATE(finishtime) THEN 1 ELSE 0 END) / COUNT(*) AS finishRate, |
| | | <if test="rateDay != null"> |
| | | SUM(CASE WHEN finishtime IS NOT NULL AND DATEDIFF(finishtime, endtime) <= #{rateDay} THEN 1 ELSE 0 END) / COUNT(*) AS rate |
| | | </if> |
| | | <if test="rateDay == null"> |
| | | NULL AS rate |
| | | </if> |
| | | FROM service_subtask |
| | | WHERE del_flag = 0 |
| | | AND visit_time IS NOT NULL |
| | | AND finishtime IS NOT NULL |
| | | <if test="orgid != null">AND orgid = #{orgid}</if> |
| | | <if test="starttime == null and endtime==null"> |
| | | AND visit_time < NOW() |
| | | AND DATE(visit_time) < DATE(NOW()) |
| | | </if> |
| | | <if test="starttime != null and endtime!=null"> |
| | | AND visit_time >= #{starttime} |
| | | AND visit_time < DATE_ADD(#{endtime}, INTERVAL 1 DAY) |
| | | </if> |
| | | <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> |
| | | <if test="orgid != null and orgid != ''">AND orgid = #{orgid}</if> |
| | | <if test="deptcode != null and deptcode != ''">and deptcode = #{deptcode}</if> |
| | | <if test="deptname != null and deptname != ''">and deptname = #{deptname}</if> |
| | | <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> |
| | |
| | | <if test="visitCount != null and visitCount > 1"> |
| | | AND visit_count > 1 |
| | | </if> |
| | | <if test="serviceTypeList != null"> |
| | | AND service_type IN |
| | | <foreach collection="serviceTypeList" item="serviceType" open="(" separator="," |
| | | close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | <if test="groupKey != null and groupKey != ''"> |
| | | AND ${groupKey} IN |
| | | <foreach collection="groupKeyList" item="key" open="(" separator="," |