Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

zdm 6 years ago
parent
commit
07410703c3
100 changed files with 2045 additions and 1105 deletions
  1. 1 1
      app/app-iot-server/src/main/resources/application.yml
  2. 10 10
      app/app-iot-server/src/main/webapp/front/js/lib/plugins/dataTables/jquery.dataTables.js
  3. 2 2
      app/app-iot-server/src/main/webapp/front/js/lib/plugins/datapicker/bootstrap-datepicker.js
  4. 1 1
      app/app-iot-server/src/main/webapp/front/js/lib/plugins/flot/jquery.flot.js
  5. 1 1
      app/app-iot-server/src/main/webapp/front/js/lib/plugins/treeview/bootstrap-treeview.js
  6. 5 5
      app/app-iot-server/src/main/webapp/front/js/lib/plugins/vue/vue.js
  7. 1 1
      app/public-health-server/src/main/resources/application.yml
  8. 10 10
      app/public-health-server/src/main/webapp/front/js/lib/plugins/dataTables/jquery.dataTables.js
  9. 2 2
      app/public-health-server/src/main/webapp/front/js/lib/plugins/datapicker/bootstrap-datepicker.js
  10. 1 1
      app/public-health-server/src/main/webapp/front/js/lib/plugins/flot/jquery.flot.js
  11. 1 1
      app/public-health-server/src/main/webapp/front/js/lib/plugins/treeview/bootstrap-treeview.js
  12. 5 5
      app/public-health-server/src/main/webapp/front/js/lib/plugins/vue/vue.js
  13. 23 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java
  14. 15 0
      business/base-service/src/main/java/com/yihu/jw/label/PatientLabelDao.java
  15. 7 1
      business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java
  16. 17 8
      business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java
  17. 5 5
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java
  18. 5 1
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java
  19. 12 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientMedicardCardService.java
  20. 2 2
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  21. 0 46
      business/base-service/src/main/java/com/yihu/jw/security/dao/TokenDao.java
  22. 0 136
      business/base-service/src/main/java/com/yihu/jw/security/service/TokenService.java
  23. 0 19
      business/base-service/src/main/java/com/yihu/jw/utils/SystemData.java
  24. 15 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxPayLogDao.java
  25. 13 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxUrlConfigDao.java
  26. 22 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WeChatQrcodeService.java
  27. 46 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java
  28. 41 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxPayLogService.java
  29. 65 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxUrlConfigService.java
  30. 78 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/label/PatientLabelDO.java
  31. 0 27
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java
  32. 14 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java
  33. 116 252
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  34. 0 13
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java
  35. 6 6
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java
  36. 28 12
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java
  37. 0 29
      common/common-entity/src/main/java/com/yihu/jw/entity/base/security/RSA.java
  38. 0 81
      common/common-entity/src/main/java/com/yihu/jw/entity/base/security/Token.java
  39. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  40. 27 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  41. 107 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPayLogDO.java
  42. 33 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java
  43. 30 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxWechatDO.java
  44. 7 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  45. 26 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
  46. 14 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java
  47. 13 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java
  48. 74 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/label/BasePatientLabelVO.java
  49. 16 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/BaseOrgVO.java
  50. 0 13
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/FeedbackVO.java
  51. 15 21
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/PatientMedicareCardVO.java
  52. 235 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageRecordVO.java
  53. 19 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageVO.java
  54. 62 14
      common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinPayUtils.java
  55. 2 2
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java
  56. 1 1
      gateway/ag-basic/src/main/resources/application.yml
  57. 2 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/SaltUser.java
  58. 21 5
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java
  59. 2 2
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java
  60. 103 9
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  61. 4 7
      server/svr-authentication/src/main/resources/application.yml
  62. 35 35
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java
  63. 0 31
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WechatDao.java
  64. 0 17
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxAccessTokenDao.java
  65. 0 19
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateConfigDao.java
  66. 0 26
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateDao.java
  67. 3 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java
  68. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  69. 6 6
      svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/LoginService.java
  70. 1 1
      svr/svr-manage/src/main/resources/application.yml
  71. 1 1
      svr/svr-manage/src/main/resources/webapp/common/js/jquery/jquery.form.3.51.0.js
  72. 10 10
      svr/svr-manage/src/main/resources/webapp/common/js/plugins/dataTables/jquery.dataTables.js
  73. 2 2
      svr/svr-manage/src/main/resources/webapp/common/js/plugins/datapicker/bootstrap-datepicker.js
  74. 1 1
      svr/svr-manage/src/main/resources/webapp/common/js/plugins/flot/jquery.flot.js
  75. 1 1
      svr/svr-manage/src/main/resources/webapp/common/js/plugins/treeview/bootstrap-treeview.js
  76. 4 4
      svr/svr-manage/src/main/resources/webapp/common/js/vue.js
  77. 4 4
      svr/svr-manage/src/main/resources/webapp/common/js/vue/vue.js
  78. 10 10
      svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/dataTables/jquery.dataTables.js
  79. 2 2
      svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/datapicker/bootstrap-datepicker.js
  80. 1 1
      svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/flot/jquery.flot.js
  81. 1 1
      svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/treeview/bootstrap-treeview.js
  82. 13 2
      svr/svr-patient/sql/sql
  83. 4 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientApplyLogDao.java
  84. 12 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientFamilyMemberDao.java
  85. 0 11
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/PatientDao.java
  86. 0 14
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/security/RSADao.java
  87. 7 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/HelpCenterDao.java
  88. 18 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/config/UrlconfigEndPoint.java
  89. 109 17
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java
  90. 65 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myMessage/MyMessageEndpoint.java
  91. 35 46
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java
  92. 35 13
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientMedicareCardEndpoint.java
  93. 67 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java
  94. 2 2
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java
  95. 2 2
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/FeedbackEndpoint.java
  96. 65 46
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/HelpCenterEndpoint.java
  97. 57 20
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatEndPoint.java
  98. 68 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatPayController.java
  99. 11 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/exception/settings/HelpCenterQesNotFoundException.java
  100. 0 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/message/MyDoctorListService.java

+ 1 - 1
app/app-iot-server/src/main/resources/application.yml

@ -16,7 +16,7 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1  # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      min-idle: 1  # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
  application:
    name: app-iot-server
    message: App IOT Server

+ 10 - 10
app/app-iot-server/src/main/webapp/front/js/lib/plugins/dataTables/jquery.dataTables.js

@ -1178,7 +1178,7 @@
		if ( $.isPlainObject( mSource ) )
		{
			/* Unlike get, only the underscore (global) option is used for for
			 * setting data since we don't know the type here. This is why an object
			 * settings data since we don't know the type here. This is why an object
			 * option is not documented for `mData` (which is read/write), but it is
			 * for `mRender` which is read only.
			 */
@ -1220,7 +1220,7 @@
						b.splice( 0, i+1 );
						innerSrc = b.join('.');
						// Traverse each entry in the array setting the properties requested
						// Traverse each entry in the array settings the properties requested
						for ( var j=0, jLen=val.length ; j<jLen ; j++ )
						{
							o = {};
@ -7220,7 +7220,7 @@
				settings.ajax = url;
			}
			// No need to consider sAjaxSource here since DataTables gives priority
			// to `ajax` over `sAjaxSource`. So setting `ajax` here, renders any
			// to `ajax` over `sAjaxSource`. So settings `ajax` here, renders any
			// value of `sAjaxSource` redundant.
		} );
	} );
@ -7230,7 +7230,7 @@
	 * Load data from the newly set Ajax URL. Note that this method is only
	 * available when `ajax.url()` is used to set a URL. Additionally, this method
	 * has the same effect as calling `ajax.reload()` but is provided for
	 * convenience when setting a new URL. Like `ajax.reload()` it will
	 * convenience when settings a new URL. Like `ajax.reload()` it will
	 * automatically redraw the table once the remote data has been loaded.
	 *
	 * @returns {DataTables.Api} this
@ -9589,7 +9589,7 @@
		 * table has already been initialised, this parameter will cause DataTables
		 * to simply return the object that has already been set up - it will not take
		 * account of any changes you might have made to the initialisation object
		 * passed to DataTables (setting this parameter to true is an acknowledgement
		 * passed to DataTables (settings this parameter to true is an acknowledgement
		 * that you understand this). `destroy` can be used to reinitialise a table if
		 * you need.
		 *  @type boolean
@ -9999,7 +9999,7 @@
		/**
		 * This function allows you to 'post process' each row after it have been
		 * generated for each table draw, but before it is rendered on screen. This
		 * function might be used for setting the row class name etc.
		 * function might be used for settings the row class name etc.
		 *  @type function
		 *  @param {node} row "TR" element for the current row
		 *  @param {array} data Raw data array for this row
@ -10317,7 +10317,7 @@
		/**
		 * Number of rows to display on a single page when using pagination. If
		 * feature enabled (`lengthChange`) then the end user will be able to override
		 * this to a custom setting using a pop-up menu.
		 * this to a custom settings using a pop-up menu.
		 *  @type int
		 *  @default 10
		 *
@ -11396,7 +11396,7 @@
		 *    * Parameters:
		 *      * `{array|object}` The data source for the row
		 *      * `{string}` The type call data requested - this will be 'set' when
		 *        setting data or 'filter', 'display', 'type', 'sort' or undefined
		 *        settings data or 'filter', 'display', 'type', 'sort' or undefined
		 *        when gathering data. Note that when `undefined` is given for the
		 *        type DataTables expects to get the raw data for the object back<
		 *      * `{*}` Data to set when the second parameter is 'set'.
@ -12675,7 +12675,7 @@
		 * Server-side processing - number of records in the result set
		 * (i.e. before filtering), Use fnRecordsTotal rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type int
		 *  @default 0
		 *  @private
@ -12686,7 +12686,7 @@
		 * Server-side processing - number of records in the current display set
		 * (i.e. after filtering). Use fnRecordsDisplay rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type boolean
		 *  @default 0
		 *  @private

+ 2 - 2
app/app-iot-server/src/main/webapp/front/js/lib/plugins/datapicker/bootstrap-datepicker.js

@ -649,11 +649,11 @@
				this.viewDate = new Date(this.o.endDate);
			if (fromArgs){
				// setting date by clicking
				// settings date by clicking
				this.setValue();
			}
			else if (dates.length){
				// setting date by typing
				// settings date by typing
				if (String(oldDates) !== String(this.dates))
					this._trigger('changeDate');
			}

+ 1 - 1
app/app-iot-server/src/main/webapp/front/js/lib/plugins/flot/jquery.flot.js

@ -63,7 +63,7 @@
                    inverseTransform: null, // if transform is set, this should be the inverse function
                    min: null, // min. value to show, null means set automatically
                    max: null, // max. value to show, null means set automatically
                    autoscaleMargin: null, // margin in % to add if auto-setting min/max
                    autoscaleMargin: null, // margin in % to add if auto-settings min/max
                    ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
                    tickFormatter: null, // fn: number -> string
                    labelWidth: null, // size of tick labels in pixels

+ 1 - 1
app/app-iot-server/src/main/webapp/front/js/lib/plugins/treeview/bootstrap-treeview.js

@ -178,7 +178,7 @@
		},
		// On initialization recurses the entire tree structure
		// setting expanded / collapsed states based on initial levels
		// settings expanded / collapsed states based on initial levels
		_setInitialLevels: function(nodes, level) {
			if (!nodes) { return; }

+ 5 - 5
app/app-iot-server/src/main/webapp/front/js/lib/plugins/vue/vue.js

@ -2897,7 +2897,7 @@ function callUpdatedHooks (queue) {
 * The queue will be processed after the entire tree has been patched.
 */
function queueActivatedComponent (vm) {
  // setting _inactive to false here so that a render function can
  // settings _inactive to false here so that a render function can
  // rely on checking whether it's in an inactive tree (e.g. router-view)
  vm._inactive = false;
  activatedChildren.push(vm);
@ -6070,8 +6070,8 @@ function updateAttrs (oldVnode, vnode) {
      setAttr(elm, key, cur);
    }
  }
  // #4391: in IE9, setting type can reset value for input[type=radio]
  // #6666: IE/Edge forces progress value down to 1 before setting a max
  // #4391: in IE9, settings type can reset value for input[type=radio]
  // #6666: IE/Edge forces progress value down to 1 before settings a max
  /* istanbul ignore if */
  if ((isIE9 || isEdge) && attrs.value !== oldAttrs.value) {
    setAttr(elm, 'value', attrs.value);
@ -6559,7 +6559,7 @@ function model (
  var type = el.attrsMap.type;
  {
    // inputs with type="file" are read only and setting the input's
    // inputs with type="file" are read only and settings the input's
    // value will throw an error.
    if (tag === 'input' && type === 'file') {
      warn$1(
@ -7008,7 +7008,7 @@ function updateStyle (oldVnode, vnode) {
  for (name in newStyle) {
    cur = newStyle[name];
    if (cur !== oldStyle[name]) {
      // ie9 setting to null has no effect, must use empty string
      // ie9 settings to null has no effect, must use empty string
      setProp(el, name, cur == null ? '' : cur);
    }
  }

+ 1 - 1
app/public-health-server/src/main/resources/application.yml

@ -16,7 +16,7 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1  # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      min-idle: 1  # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
  application:
    name: app-health-server
    message: App IOT Server

+ 10 - 10
app/public-health-server/src/main/webapp/front/js/lib/plugins/dataTables/jquery.dataTables.js

@ -1178,7 +1178,7 @@
		if ( $.isPlainObject( mSource ) )
		{
			/* Unlike get, only the underscore (global) option is used for for
			 * setting data since we don't know the type here. This is why an object
			 * settings data since we don't know the type here. This is why an object
			 * option is not documented for `mData` (which is read/write), but it is
			 * for `mRender` which is read only.
			 */
@ -1220,7 +1220,7 @@
						b.splice( 0, i+1 );
						innerSrc = b.join('.');
						// Traverse each entry in the array setting the properties requested
						// Traverse each entry in the array settings the properties requested
						for ( var j=0, jLen=val.length ; j<jLen ; j++ )
						{
							o = {};
@ -7220,7 +7220,7 @@
				settings.ajax = url;
			}
			// No need to consider sAjaxSource here since DataTables gives priority
			// to `ajax` over `sAjaxSource`. So setting `ajax` here, renders any
			// to `ajax` over `sAjaxSource`. So settings `ajax` here, renders any
			// value of `sAjaxSource` redundant.
		} );
	} );
@ -7230,7 +7230,7 @@
	 * Load data from the newly set Ajax URL. Note that this method is only
	 * available when `ajax.url()` is used to set a URL. Additionally, this method
	 * has the same effect as calling `ajax.reload()` but is provided for
	 * convenience when setting a new URL. Like `ajax.reload()` it will
	 * convenience when settings a new URL. Like `ajax.reload()` it will
	 * automatically redraw the table once the remote data has been loaded.
	 *
	 * @returns {DataTables.Api} this
@ -9589,7 +9589,7 @@
		 * table has already been initialised, this parameter will cause DataTables
		 * to simply return the object that has already been set up - it will not take
		 * account of any changes you might have made to the initialisation object
		 * passed to DataTables (setting this parameter to true is an acknowledgement
		 * passed to DataTables (settings this parameter to true is an acknowledgement
		 * that you understand this). `destroy` can be used to reinitialise a table if
		 * you need.
		 *  @type boolean
@ -9999,7 +9999,7 @@
		/**
		 * This function allows you to 'post process' each row after it have been
		 * generated for each table draw, but before it is rendered on screen. This
		 * function might be used for setting the row class name etc.
		 * function might be used for settings the row class name etc.
		 *  @type function
		 *  @param {node} row "TR" element for the current row
		 *  @param {array} data Raw data array for this row
@ -10317,7 +10317,7 @@
		/**
		 * Number of rows to display on a single page when using pagination. If
		 * feature enabled (`lengthChange`) then the end user will be able to override
		 * this to a custom setting using a pop-up menu.
		 * this to a custom settings using a pop-up menu.
		 *  @type int
		 *  @default 10
		 *
@ -11396,7 +11396,7 @@
		 *    * Parameters:
		 *      * `{array|object}` The data source for the row
		 *      * `{string}` The type call data requested - this will be 'set' when
		 *        setting data or 'filter', 'display', 'type', 'sort' or undefined
		 *        settings data or 'filter', 'display', 'type', 'sort' or undefined
		 *        when gathering data. Note that when `undefined` is given for the
		 *        type DataTables expects to get the raw data for the object back<
		 *      * `{*}` Data to set when the second parameter is 'set'.
@ -12675,7 +12675,7 @@
		 * Server-side processing - number of records in the result set
		 * (i.e. before filtering), Use fnRecordsTotal rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type int
		 *  @default 0
		 *  @private
@ -12686,7 +12686,7 @@
		 * Server-side processing - number of records in the current display set
		 * (i.e. after filtering). Use fnRecordsDisplay rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type boolean
		 *  @default 0
		 *  @private

+ 2 - 2
app/public-health-server/src/main/webapp/front/js/lib/plugins/datapicker/bootstrap-datepicker.js

@ -649,11 +649,11 @@
				this.viewDate = new Date(this.o.endDate);
			if (fromArgs){
				// setting date by clicking
				// settings date by clicking
				this.setValue();
			}
			else if (dates.length){
				// setting date by typing
				// settings date by typing
				if (String(oldDates) !== String(this.dates))
					this._trigger('changeDate');
			}

+ 1 - 1
app/public-health-server/src/main/webapp/front/js/lib/plugins/flot/jquery.flot.js

@ -63,7 +63,7 @@
                    inverseTransform: null, // if transform is set, this should be the inverse function
                    min: null, // min. value to show, null means set automatically
                    max: null, // max. value to show, null means set automatically
                    autoscaleMargin: null, // margin in % to add if auto-setting min/max
                    autoscaleMargin: null, // margin in % to add if auto-settings min/max
                    ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
                    tickFormatter: null, // fn: number -> string
                    labelWidth: null, // size of tick labels in pixels

+ 1 - 1
app/public-health-server/src/main/webapp/front/js/lib/plugins/treeview/bootstrap-treeview.js

@ -178,7 +178,7 @@
		},
		// On initialization recurses the entire tree structure
		// setting expanded / collapsed states based on initial levels
		// settings expanded / collapsed states based on initial levels
		_setInitialLevels: function(nodes, level) {
			if (!nodes) { return; }

+ 5 - 5
app/public-health-server/src/main/webapp/front/js/lib/plugins/vue/vue.js

@ -2897,7 +2897,7 @@ function callUpdatedHooks (queue) {
 * The queue will be processed after the entire tree has been patched.
 */
function queueActivatedComponent (vm) {
  // setting _inactive to false here so that a render function can
  // settings _inactive to false here so that a render function can
  // rely on checking whether it's in an inactive tree (e.g. router-view)
  vm._inactive = false;
  activatedChildren.push(vm);
@ -6070,8 +6070,8 @@ function updateAttrs (oldVnode, vnode) {
      setAttr(elm, key, cur);
    }
  }
  // #4391: in IE9, setting type can reset value for input[type=radio]
  // #6666: IE/Edge forces progress value down to 1 before setting a max
  // #4391: in IE9, settings type can reset value for input[type=radio]
  // #6666: IE/Edge forces progress value down to 1 before settings a max
  /* istanbul ignore if */
  if ((isIE9 || isEdge) && attrs.value !== oldAttrs.value) {
    setAttr(elm, 'value', attrs.value);
@ -6559,7 +6559,7 @@ function model (
  var type = el.attrsMap.type;
  {
    // inputs with type="file" are read only and setting the input's
    // inputs with type="file" are read only and settings the input's
    // value will throw an error.
    if (tag === 'input' && type === 'file') {
      warn$1(
@ -7008,7 +7008,7 @@ function updateStyle (oldVnode, vnode) {
  for (name in newStyle) {
    cur = newStyle[name];
    if (cur !== oldStyle[name]) {
      // ie9 setting to null has no effect, must use empty string
      // ie9 settings to null has no effect, must use empty string
      setProp(el, name, cur == null ? '' : cur);
    }
  }

+ 23 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java

@ -0,0 +1,23 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO> {
    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
    List<BaseDoctorHospitalDO> findByDoctorCode(String doctorCode);
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/label/PatientLabelDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.label;
import com.yihu.jw.entity.base.label.PatientLabelDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/12/7.
 */
public interface PatientLabelDao extends PagingAndSortingRepository<PatientLabelDO, String>, JpaSpecificationExecutor<PatientLabelDO> {
    public List<PatientLabelDO> findByLabelTypeAndStatus(String labelType,Integer status);
}

+ 7 - 1
business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java

@ -17,9 +17,15 @@ public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, St
    @Query("select m from BaseMessageDO m where m.platform=?1 and m.receiver=?2  and m.del=1 and m.msgTypeCode like ?3  order by m.readState desc")
    List<BaseMessageDO> messageList(Integer platform, String code,String msgTypeCode);
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2  and m.del=1 and m.msgTypeCode like ?3  and m.readState=1")
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2  and m.del=1 and m.msgTypeCode like ?3  and m.readState=0")
    Integer countMessage(Integer platform, String code,String msgTypeCode);
    BaseMessageDO findById(Integer id);
    @Modifying
    @Query("update BaseMessageDO t set t.readState = ?1 where t.id=?2 ")
    int updateStatusById(Integer readState,Integer id);
//    List<BaseMessageDO> getBy(String receiver,String sender,String msgTypeCode,Integer platform);
}

+ 17 - 8
business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java

@ -2,7 +2,6 @@ package com.yihu.jw.message.service;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
@ -10,7 +9,6 @@ import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -76,6 +74,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
        List<Map<String, Object>> unReadResult = messageListSql(platform,code,0,page,unReadPageSize);
        for(Map<String, Object> one:unReadResult){
            Map<String,Object> unReadMap = new HashedMap();
            unReadMap.put("patientCode",one.get("sender"));
            unReadMap.put("name",one.get("sender_name"));
            unReadMap.put("count",one.get("num"));
            unReadMap.put("message",one.get("msg_content"));
@ -87,6 +86,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
            List<Map<String, Object>> readResult = messageListSql(platform,code,1,page,unReadPageSize);
            for(Map<String, Object> one:readResult){
                Map<String,Object> readMap = new HashedMap();
                readMap.put("patientCode",one.get("sender"));
                readMap.put("name",one.get("sender_name"));
                readMap.put("count",one.get("num"));
                readMap.put("message",one.get("msg_content"));
@ -104,9 +104,8 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
    }
    public List<Map<String, Object>> applyMessageList(String patient, Date failureTime, String msgTypeCode){
        String failureTimeStr = DateUtil.dateToStr(failureTime,"yyyy-MM-dd HH:mm:ss");
        String sql = "select m.* from base_message m join patient_apply_for_log l on m.relation_data=l.id where m.failure_Time>='"+failureTimeStr+"' and m.msgTypeCode='"+msgTypeCode+"'";
    public List<Map<String, Object>> applyMessageList(String patient, String msgTypeCode){
        String sql = "select m.* from base_message m join patient_apply_for_log l on m.relation_data=l.id where  m.msg_type_code='"+msgTypeCode+"' and m.receiver='"+patient+"'";
        return jdbcTemplate.queryForList(sql);
//        return messageDao.applyMessageList(patient,failureTime,msgTypeCode);
    }
@ -142,7 +141,8 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
                " AND b.platform = '"+platform+"' " +
                " AND b.receiver = '"+code+"' " +
                " AND b.del = 1 " +
                " AND m.read_state = "+readState;
                " AND b.read_state = "+readState+
                " AND b.msg_type_code like '%03%'";
        return jdbcTemplate.queryForList(sql);
    }
@ -158,9 +158,10 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
                "  GROUP BY " +
                "   m.sender, " +
                "   m.sender_name " ;
        Integer count  = jdbcTemplate.queryForObject(sql,Integer.class);
        List<Map<String, Object>> list  = jdbcTemplate.queryForList(sql);
        Integer count = list.size();
        if(count<=(originalPageSize-2)){
            return page-1;
            return page;
        }else{
            Integer s = (count-(originalPageSize-2))/originalPageSize;
            Integer y = (count-(originalPageSize-2))%originalPageSize;
@ -176,4 +177,12 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
        return messageDao.findById(id);
    }
    public void updateStatusById(Integer readState,Integer id) throws Exception{
        int i = messageDao.updateStatusById(readState,id);
        if(i<0){
            throw new Exception("update data failur !");
        }
    }
}

+ 5 - 5
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java

@ -15,20 +15,20 @@ import java.util.Map;
 */
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<BasePatientDO> {
    BasePatientDO findByIdAndDel(String id, String del);
    BasePatientDO findById(String id);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,mobile as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    List<Map<String,Object>> findByIdcard(String idcard, Pageable pageable);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where name like ?1")
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,mobile as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where name like ?1")
    List<Map<String,Object>> findByName(String name, Pageable pageable);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO")
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,mobile as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO")
    List<Map<String,Object>> findBaseInfo(Pageable pageable);
    boolean existsByIdcardAndIdNot(String idcard,String id);
    boolean existsByIdcard(String idcard);
    boolean existsByIdcardAndDel(String idcard,String del);
    @Query("from BasePatientDO where mobile = ?1")
    List<BasePatientDO> findByMobile(String mobile);

+ 5 - 1
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java

@ -11,7 +11,7 @@ import java.util.Set;
/**
 * Created by Trick on 2018/8/31.
 */
public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, String>, JpaSpecificationExecutor<PatientMedicareCardDO> {
public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, Integer>, JpaSpecificationExecutor<PatientMedicareCardDO> {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
@ -19,4 +19,8 @@ public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<P
    Set<Object> findIdListByPatientCode(String patientCode);
    PatientMedicareCardDO findByCode(String code);
    PatientMedicareCardDO findByTypeAndPatientCodeAndDel(String Type,String patientCode,String del);
    boolean existsByCodeAndDel(String code,String del);
}

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientMedicardCardService.java

@ -70,4 +70,16 @@ public class BasePatientMedicardCardService<T, R extends CrudRepository> extends
        return patientMedicareCard;
    }
    public PatientMedicareCardDO findByTypeAndPatientCodeAndDel(String Type,String patientCode,String del)throws Exception{
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel(Type,patientCode,del);
        return patientMedicareCardDO;
    }
    public boolean existsByCodeAndDel(String code)throws Exception{
        if(StringUtils.isEmpty(code)){
            throw new Exception("社保卡号不能为空");
        }
        return basePatientMedicareCardDao.existsByCodeAndDel(code,"1");
    }
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -169,7 +169,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
     * @return
     */
    public BasePatientDO findByIdAndDel(String patient) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findByIdAndDel(patient,"1");
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        if(basePatientDO==null){
            throw new Exception("not patient");
        }
@ -184,7 +184,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    public BasePatientDO findByMobileAndDel(String mobile) throws Exception{
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list.size()<=0){
            throw new Exception("not patient");
            return null;
        }
        return list.get(0);
    }

+ 0 - 46
business/base-service/src/main/java/com/yihu/jw/security/dao/TokenDao.java

@ -1,46 +0,0 @@
package com.yihu.jw.security.dao;
import com.yihu.jw.entity.base.security.Token;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface TokenDao extends PagingAndSortingRepository<Token, String> {
	
	@Modifying
	@Query("delete Token a where a.user = ?1")
	int deleteByUser(String user);
	@Modifying
	@Query("delete Token a where a.user = ?1 and platform=?2")
	int deleteByUserAndPlatform(String user, Integer platform);
	
	@Modifying
	@Query("delete Token a where a.token = ?1")
	int deleteByToken(String token);
	
//	@Query("select a from Token a where a.user = ?1 and a.platform = ?2 and a.del = '1'")
//	Token findByUser(String user, int platform);
	
//	@Query("select a from Token a where a.user = ?1 and a.del = '1'")
//	Token findByUser(String user);
	
//	@Query("select count(1) from Token a where a.user = ?1 and a.del = '1'")
//	int countByUser(String user);
	
	@Query("select a from Token a where a.token = ?1 and a.del = '1'")
	Token findByToken(String token);
	
	@Query("select a from Token a where a.user = ?1 and a.platform = ?2 and a.del = '1'")
	Token findByPatient(String patient, int platform);
	
	@Modifying
	@Query("delete Token a where a.user = ?1 and a.platform = 3 and a.del = '1'")
	int deleteWxTokenByPatient(String patient);
	@Query("select a from Token a where a.imei = ?1 and a.platform = 3")
	Page<Token> findByOpenid(String openid, Pageable pageable);
}

+ 0 - 136
business/base-service/src/main/java/com/yihu/jw/security/service/TokenService.java

@ -1,136 +0,0 @@
package com.yihu.jw.security.service;
import com.yihu.jw.entity.base.security.Token;
import com.yihu.jw.security.dao.TokenDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.security.MD5;
import com.yihu.jw.utils.SystemData;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.UUID;
@Component
@Transactional(rollbackFor = Exception.class)
public class TokenService extends BaseJpaService<Token, TokenDao> {
	@Autowired
	public TokenDao tokenDao;
	/**
	 * 生成token
	 * @param user 用户标识
	 * @param imei 手机IMEI码
	 * @param platform 1患者,2医生,3患者微信公众号,4pc端医生
	 * @return
	 * @throws Exception
	 */
	public Token newToken(String user, String imei, int platform) throws Exception {
		Date czrq = new Date();
		String tokenStr = platform + imei + System.currentTimeMillis();
		// MD5加密
		tokenStr = MD5.GetMD5Code(tokenStr);
//		Token token = tokenDao.findByPatient(user, platform);
//		if (token == null) {
//			token = new Token();
//		}
		Token token = new Token();
		token.setDel("1");
		token.setPlatform(platform);
		token.setImei(imei);
		// 30天的有限期
		token.setTimeout(DateUtil.strToDate(DateUtil.getNextDay(DateUtil.getStringDate(DateUtil.YYYY_MM_DD), 30), DateUtil.YYYY_MM_DD));
		token.setToken(tokenStr);
		token.setUser(user);
		token.setCzrq(czrq);
		// 先删除防止重复
		tokenDao.deleteByUserAndPlatform(user,platform);
		// 添加新的token
		token = tokenDao.save(token);
		if (token == null) {
			throw new Exception("Token生成失败");
		}
		// 更新token缓存
		if (platform == 3) {
			SystemData.patientTokens.put(user, token);
		} else if (platform == 2) {
			SystemData.doctorTokens.put(user, token);
		}else if(platform == 4){
			SystemData.doctorPCTokens.put(user,token);
		}else if(platform == 5){
			SystemData.doctorWXTokens.put(user,token);
		}
		return token;
	}
	public Token newTxToken(String user, String openid) throws Exception {
		Date czrq = new Date();
		String tokenStr = "";
		if(!StringUtils.isBlank(openid)){
			tokenStr = 3 + openid + System.currentTimeMillis();
		}else{
			tokenStr = 3 +""+ System.currentTimeMillis();
		}
		// MD5加密
		tokenStr = MD5.GetMD5Code(tokenStr);
		Token token = new Token();
		token.setDel("1");
		token.setPlatform(3);
		if(StringUtils.isBlank(openid)){
			token.setImei(UUID.randomUUID().toString().replace("-",""));
		}else{
			token.setImei(openid);
		}
		// 360天的有限期
		token.setTimeout(DateUtil.strToDate(DateUtil.getNextDay(DateUtil.getStringDate(DateUtil.YYYY_MM_DD), 360), DateUtil.YYYY_MM_DD));
		token.setToken(tokenStr);
		token.setUser(user);
		token.setCzrq(czrq);
		// 先删除,防止重复
		tokenDao.deleteByUser(user);
		// 添加新的token
		token = tokenDao.save(token);
		if (token == null) {
			throw new Exception("Token生成失败");
		}
		// 更新token缓存
		SystemData.patientTokens.put(user, token);
		return token;
	}
	/**
	 * 删除token
	 * @param uid 用户code
	 * @return
	 * @throws Exception
	 */
	public void delToken(int platform, String uid) throws Exception {
		// 删除老的token
		tokenDao.deleteByUser(uid);
		// 更新token缓存
		if (platform == 3) {
			SystemData.patientTokens.remove(uid);
		} else if (platform == 2) {
			SystemData.doctorTokens.remove(uid);
		}
	}
	/**
	 * 查询患者的微信token标识
	 * @param patient
	 */
	public Token findWxToken(String patient) {
		return tokenDao.findByPatient(patient, 3);
	}
	/**
	 * 查询doctor的微信token标识
	 * @param user
	 */
	public Token findDoctorToken(String user) {
		return tokenDao.findByPatient(user, 4);
	}
}

+ 0 - 19
business/base-service/src/main/java/com/yihu/jw/utils/SystemData.java

@ -1,19 +0,0 @@
package com.yihu.jw.utils;
import com.yihu.jw.entity.base.security.Token;
import java.util.HashMap;
import java.util.Map;
public class SystemData {
	// 医生app验证信息
	public static Map<String, Token> doctorTokens = new HashMap<String, Token>();  // 2
	// 医生pc端验证信息 取药系统 对外系统
	public static Map<String, Token> doctorPCTokens = new HashMap<String, Token>(); // 4
	// 患者验证信息
	public static Map<String, Token> patientTokens = new HashMap<String, Token>(); // 3
	// 医生验证信息
	public static Map<String, Token> doctorWXTokens = new HashMap<String, Token>(); // 5
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxPayLogDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxPayLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface WxPayLogDao extends PagingAndSortingRepository<WxPayLogDO, String>, JpaSpecificationExecutor<WxPayLogDO> {
    @Query("from WxPayLogDO a where a.seqNo=?1 order by createTime desc")
    List<WxPayLogDO> findBySeqNo(String seqNo);
}

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxUrlConfigDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxUrlConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2018/12/10.
 */
public interface WxUrlConfigDao extends PagingAndSortingRepository<WxUrlConfigDO, String>, JpaSpecificationExecutor<WxUrlConfigDO> {
    WxUrlConfigDO findByUrl(String url);
}

+ 22 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WeChatQrcodeService.java

@ -95,6 +95,28 @@ public class WeChatQrcodeService {
        return "";
    }
    public String getQrcode( String wechatId, String scene) throws Exception{
        String token_url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + wxAccessTokenService.getWxAccessTokenById(wechatId).getAccessToken();
        String params = "{\"action_name\": \"QR_LIMIT_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"" + scene + "\"}}}";
        //服务号必须是通过腾讯认证,每年是300元,如果没有认证而导致的错误提示,那就去认证
        //微信登录提示48001,{"errcode":48001,"errmsg":"api unauthorized, hints: [ req_id: 1QoCla0699ns81 ]"}
        String result = HttpUtil.sendPost(token_url, params);
        if (!StringUtils.isEmpty(result)) {
            JSONObject json = new JSONObject(result);
            if (json.has("ticket")) {
                // 请求输入流
                InputStream inputStream = null;
                // 下载二维码图片
                String  urlGet = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
                        + URLEncoder.encode(json.get("ticket").toString(), "UTF-8");
                return urlGet;
            }
        }
        return "";
    }
//    public void write(InputStream inputStream)throws Exception{
//        String file = "D:\\workspace\\file\\test.png";
//        // 保存文件

+ 46 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java

@ -0,0 +1,46 @@
package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.WechatDao;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class WechatInfoService {
    @Autowired
    private WechatDao wechatDao;
    /**
     * 通过code获取判断openid
     *
     * @param code
     * @return
     */
    public String getOpenidByCode(String code,String appId,String appSecret) throws Exception {
        String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
        String params = "appid=" + appId + "&secret=" +appSecret+ "&code=" + code + "&grant_type=authorization_code";
        String result = HttpUtil.sendGet(token_url, params);
        System.out.println("getOpenidByCode:"+result);
        JSONObject json = new JSONObject(result);
        if (json.has("openid")) {
            return json.get("openid").toString();
        }else{
            throw new Exception(result);
        }
    }
    /**
     * 通过code获取判断openid
     *
     * @param code
     * @return
     */
    public String getOpenidByCode(String code,String wxId) throws Exception {
        //通过wxId获取appId和appSecret
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        return getOpenidByCode(code,wxWechatDO.getAppId(),wxWechatDO.getAppSecret());
    }
}

+ 41 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxPayLogService.java

@ -0,0 +1,41 @@
package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxPayLogDO;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map;
@Service
public class WxPayLogService extends BaseJpaService<WxPayLogDO, WxPayLogDao> {
    @Autowired
    private WxPayLogDao wxPayLogDao;
    public void createLog(Map<String,String> map,String orderPar,Map<String,Object> orderRes){
        WxPayLogDO wxPayLogDO = new WxPayLogDO();
        wxPayLogDO.setSeqNo(map.get("out_trade_no"));
        wxPayLogDO.setOpenId(map.get("openid"));
        wxPayLogDO.setType(0);
        wxPayLogDO.setOrderParams(orderPar);
        wxPayLogDO.setOrderResponse(orderRes.get("wxPayResult").toString());
        String return_code = orderRes.get("return_code").toString();
        if("SUCCESS".equalsIgnoreCase(return_code)){
            wxPayLogDO.setOrderStatus(1);
        }else{
            wxPayLogDO.setOrderStatus(-1);
        }
        wxPayLogDO.setCreateTime(new Date());
        wxPayLogDO.setPayStatus(0);
        this.save(wxPayLogDO);
    }
}

+ 65 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxUrlConfigService.java

@ -0,0 +1,65 @@
package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.wx.WxUrlConfigDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.restmodel.base.wx.WxContants;
import com.yihu.jw.restmodel.base.wx.WxSaasVO;
import com.yihu.jw.restmodel.base.wx.WxWechatVO;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxUrlConfigDao;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2018/12/10.
 */
@Service
public class WxUrlConfigService {
    @Autowired
    private WxUrlConfigDao wxUrlConfigDao;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public Map<String,Object> getWxWechatConfig(String url){
        WxUrlConfigDO wxUrlConfigDO = wxUrlConfigDao.findByUrl(url);
        if(wxUrlConfigDO!=null){
            WxWechatDO wxWechatDO = wechatDao.findById(wxUrlConfigDO.getWxId());
            List<WxSaasVO> saasVOs = getWxSaasVOs(wxWechatDO.getId());
            Map<String,Object> map = new HashedMap();
            map.put("wxId",wxUrlConfigDO.getWxId());
            map.put("wxAppId",wxWechatDO.getAppId());
            map.put("publicType",wxWechatDO.getPublicType());
            map.put("saasVOs",saasVOs);
            return map;
        }else{
            return null;
        }
    }
    public List<WxSaasVO> getWxSaasVOs(String id){
        String sql ="SELECT " +
                " bs.`name` AS saasName, " +
                " bs.id AS saasid" +
                " FROM " +
                " wx_wechat_saas s " +
                " JOIN base_saas bs ON bs.id = s.saas_id " +
                " WHERE " +
                " s.wechat_id = '"+id+"'";
        List<WxSaasVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WxSaasVO.class));
        return list;
    }
}

+ 78 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/label/PatientLabelDO.java

@ -0,0 +1,78 @@
package com.yihu.jw.entity.base.label;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2018/12/7.
 */
@Entity
@Table(name = "base_patient_label")
public class PatientLabelDO extends UuidIdentityEntityWithOperator implements java.io.Serializable{
    private String labelCode;//标签标识',
    private String labelName;//标签名称',
    private String labelType;//标签类型(1:卫计委三大分组 2:健康状况 3:疾病类型 4:自定义标签5.周月标签 6.老年人标识 7.专病类型,8.健康情况)',
    private Integer isSystem;//是否系统标签(0:否 1是)',
    private String teamCode;//团队code',
    private Integer sort;//排序',
    private Integer status;//状态(0:无效 1:有效)',
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 0 - 27
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java

@ -113,16 +113,6 @@ public class BaseMessageDO extends IntegerIdentityEntity {
     */
    private String relationData;
    /**
     * 消息存续类型(1、时效性,2、非时效性)
     */
    private Integer type;
    /**
     * 消息失效时间
     */
    private Date failureTime;
    @Column(name = "receiver")
    public String getReceiver() {
        return receiver;
@ -294,21 +284,4 @@ public class BaseMessageDO extends IntegerIdentityEntity {
        this.relationData = relationData;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "failure_time")
    public Date getFailureTime() {
        return failureTime;
    }
    public void setFailureTime(Date failureTime) {
        this.failureTime = failureTime;
    }
}

+ 14 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java

@ -145,6 +145,13 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
	 */
	private String del;
    /**
     * 11一级甲等 12一级乙等 13一级丙等
     * 21二级甲等 22二级乙等 23二级丙等
     * 31三级特等 32三级甲等 33三级乙等 34三级丙级
     */
    private Integer level;
    public BaseOrgDO() {
    }
@ -360,6 +367,12 @@ public class BaseOrgDO extends UuidIdentityEntityWithOperator {
        this.del = del;
    }
    @Column(name = "level")
    public Integer getLevel() {
        return level;
    }
    public void setLevel(Integer level) {
        this.level = level;
    }
}

+ 116 - 252
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -10,73 +10,65 @@ import java.util.Date;
/**
* 居民信息(居民就是患者)实体
*
* @author Administrator on  2018年09月05日
*
*/
 * 居民信息(居民就是患者)实体
 *
 * @author Administrator on  2018年09月05日
 *
 */
@Entity
@Table(name = "base_patient")
public class BasePatientDO extends UuidIdentityEntityWithOperator {
    /**
	 * saas配置id
	 */
     * saas配置id
     */
//    @NotNull(message = "saasid不可为空")
	private String saasId;
    private String saasId;
    /**
	 * 身份证号
	 */
     * 身份证号
     */
//    @NotNull(message = "身份证号不可为空")
	private String idcard;
    private String idcard;
    /**
	 * 登录密码
	 */
	private String password;
     * 登录密码
     */
    private String password;
    /**
	 *
	 */
	private String salt;
     *
     */
    private String salt;
    /**
	 * 姓名
	 */
	private String name;
     * 姓名
     */
    private String name;
    /**
	 * 生日
	 */
     * 生日
     */
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date birthday;
    private Date birthday;
    /**
	 * 性别,1男,2女
	 */
     * 性别,1男,2女
     */
//    @Range(min = 1, max = 2, message = "1-男,2-女")
	private Integer sex;
    private Integer sex;
    /**
	 * 手机号
	 */
     * 手机号
     */
//    @Length(min = 11,max = 11,message = "手机号长度为11位")
	private String mobile;
    private String mobile;
    /**
	 * 联系电话
	 */
	private String phone;
    /**
     * 社保卡号
     */
	private String ssc;
    /**
	 * 头像http地址
	 */
	private String photo;
     * 头像http地址
     */
    private String photo;
    /**
     * 省代码
@ -117,32 +109,63 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
     * 街道名称
     */
    private String streetName;
    /**
     * 居住居委会代码
     * 地址
     */
    private String committeeCode;
    private String address;
    /**
     * 居住居委会名称
     * 居住省代码
     */
    private String committeeName;
    private String liveProvinceCode;
    /**
     * 地址
     * 居住省名称
     */
    private String address;
    private String liveProvinceName;
    /**
     * 居住市代码
     */
    private String liveCityCode;
    /**
     * 居住市名称
     */
    private String liveCityName;
    /**
     * 居住区县代码
     */
    private String liveTownCode;
    /**
     * 疾病类型,0健康,1高血压,2糖尿病,3高血压+糖尿病
     * 居住区县名称
     */
    private String disease;
    private String liveTownName;
    /**
     * 病情:0绿标,1黄标,2红标,3重点关注
     * 居住街道代码
     */
    private String liveStreetCode;
    /**
     * 居住街道名称
     */
    private String diseaseCondition;
    private String liveStreetName;
    /**
     * 居住居委会代码
     */
    private String committeeCode;
    /**
     * 居住居委会名称
     */
    private String committeeName;
    /**
     * 总积分
     */
@ -179,37 +202,11 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
     */
    private String principalCode;
    /**
     * 是否绑定电子社保卡 (0否 1是)
     */
    private String sicardStatus;
    /**
     * 电子社保卡绑定时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date sicardTime;
    /**
     * 是否分配过微信标签
     */
    private Integer isWxtag;
    /**
     * 微信tagId
     */
    private String wxtagid;
    /**
     * 居民预警状态:0为标准,1为预警状态
     */
    private Integer standardStatus;
    /**
     * 医疗保险号
     */
    private String medicareNumber;
    /**
     * unionId 开发平台唯一标识
     */
@ -221,81 +218,37 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String del;
    /**
     * 登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date loginDate;
    /**
     * 锁定时间
     * 备注
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date lockedDate;
    private String remark;
    /**
     * 是否被锁定;1为锁定,0为可用
     * 账号是否被锁定
     */
    private Integer locked;
    /**
     * 是否可用
     * 是否可以登录
     */
    private Integer enabled;
    /**
     * 备注
     */
    private String remark;
    /**
     * 登录失败次数
     */
    private Integer loginFailureCount;
    /**
     * 居住区县代码
     */
    private String liveTownCode;
    /**
     * 居住区县名称
     */
    private String liveTownName;
    /**
     * 居住市代码
     * 锁定日期
     */
    private String liveCityCode;
    /**
     * 居住市名称
     */
    private String liveCityName;
    /**
     * 居住省代码
     */
    private String liveProvinceCode;
    /**
     * 居住省名称
     */
    private String liveProvinceName;
    private Date lockedDate;
    /**
     * 居住街道代码
     * 登录日期
     */
    private String liveStreetCode;
    /**
     * 居住街道名称
     */
    private String liveStreetName;
    private Date loginDate;
	@Column(name = "saas_id")
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -303,7 +256,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.saasId = saasId;
    }
	@Column(name = "idcard")
    @Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
@ -311,7 +264,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.idcard = idcard;
    }
	@Column(name = "password")
    @Column(name = "password")
    public String getPassword() {
        return password;
    }
@ -319,7 +272,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.password = password;
    }
	@Column(name = "salt")
    @Column(name = "salt")
    public String getSalt() {
        return salt;
    }
@ -327,7 +280,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.salt = salt;
    }
	@Column(name = "name")
    @Column(name = "name")
    public String getName() {
        return name;
    }
@ -335,7 +288,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.name = name;
    }
	@Column(name = "birthday")
    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }
@ -343,7 +296,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.birthday = birthday;
    }
	@Column(name = "sex")
    @Column(name = "sex")
    public Integer getSex() {
        return sex;
    }
@ -351,7 +304,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.sex = sex;
    }
	@Column(name = "mobile")
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
@ -359,15 +312,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.mobile = mobile;
    }
	@Column(name = "phone")
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
	@Column(name = "photo")
    @Column(name = "photo")
    public String getPhoto() {
        return photo;
    }
@ -474,7 +419,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.points = points;
    }
	@Column(name = "record_amount")
    @Column(name = "record_amount")
    public String getRecordAmount() {
        return recordAmount;
    }
@ -482,7 +427,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.recordAmount = recordAmount;
    }
	@Column(name = "openid")
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }
@ -490,7 +435,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.openid = openid;
    }
	@Column(name = "patient_status")
    @Column(name = "patient_status")
    public String getPatientStatus() {
        return patientStatus;
    }
@ -498,7 +443,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.patientStatus = patientStatus;
    }
	@Column(name = "mobile_remarks")
    @Column(name = "mobile_remarks")
    public String getMobileRemarks() {
        return mobileRemarks;
    }
@ -506,7 +451,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.mobileRemarks = mobileRemarks;
    }
	@Column(name = "openid_time")
    @Column(name = "openid_time")
    public Date getOpenidTime() {
        return openidTime;
    }
@ -514,7 +459,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.openidTime = openidTime;
    }
	@Column(name = "principal_code")
    @Column(name = "principal_code")
    public String getPrincipalCode() {
        return principalCode;
    }
@ -522,39 +467,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.principalCode = principalCode;
    }
	@Column(name = "sicard_status")
    public String getSicardStatus() {
        return sicardStatus;
    }
    public void setSicardStatus(String sicardStatus) {
        this.sicardStatus = sicardStatus;
    }
	@Column(name = "sicard_time")
    public Date getSicardTime() {
        return sicardTime;
    }
    public void setSicardTime(Date sicardTime) {
        this.sicardTime = sicardTime;
    }
	@Column(name = "is_wxtag")
    public Integer getIsWxtag() {
        return isWxtag;
    }
    public void setIsWxtag(Integer isWxtag) {
        this.isWxtag = isWxtag;
    }
	@Column(name = "wxtagid")
    public String getWxtagid() {
        return wxtagid;
    }
    public void setWxtagid(String wxtagid) {
        this.wxtagid = wxtagid;
    }
	@Column(name = "standard_status")
    @Column(name = "standard_status")
    public Integer getStandardStatus() {
        return standardStatus;
    }
@ -562,7 +475,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.standardStatus = standardStatus;
    }
	@Column(name = "unionid")
    @Column(name = "unionid")
    public String getUnionid() {
        return unionid;
    }
@ -570,7 +483,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.unionid = unionid;
    }
	@Column(name = "del")
    @Column(name = "del")
    public String getDel() {
        return del;
    }
@ -578,16 +491,14 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.del = del;
    }
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    @Column(name = "remark")
    public void setRemark(String remark) {
        this.remark = remark;
    }
    @Column(name = "live_province_code")
    public String getLiveProvinceCode() {
        return liveProvinceCode;
    }
@ -596,7 +507,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceCode = liveProvinceCode;
    }
    @Column(name = "live_province_name")
    public String getLiveProvinceName() {
        return liveProvinceName;
    }
@ -605,7 +515,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveProvinceName = liveProvinceName;
    }
    @Column(name = "live_city_code")
    public String getLiveCityCode() {
        return liveCityCode;
    }
@ -614,7 +523,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityCode = liveCityCode;
    }
    @Column(name = "live_city_name")
    public String getLiveCityName() {
        return liveCityName;
    }
@ -623,7 +531,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveCityName = liveCityName;
    }
    @Column(name = "live_town_code")
    public String getLiveTownCode() {
        return liveTownCode;
    }
@ -632,7 +539,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveTownCode = liveTownCode;
    }
    @Column(name = "live_town_name")
    public String getLiveTownName() {
        return liveTownName;
    }
@ -658,62 +564,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.liveStreetName = liveStreetName;
    }
    @Column(name = "ssc")
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    @Column(name = "disease")
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
    @Column(name = "disease_condition")
    public String getDiseaseCondition() {
        return diseaseCondition;
    }
    public void setDiseaseCondition(String diseaseCondition) {
        this.diseaseCondition = diseaseCondition;
    }
    @Column(name = "medicare_number")
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }
    @Column(name = "login_date")
    public Date getLoginDate() {
        return loginDate;
    }
    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
    @Column(name = "locked_date")
    public Date getLockedDate() {
        return lockedDate;
    }
    public void setLockedDate(Date lockedDate) {
        this.lockedDate = lockedDate;
    }
    @Column(name = "locked")
    public Integer getLocked() {
        return locked;
    }
@ -722,7 +572,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.locked = locked;
    }
    @Column(name = "enabled")
    public Integer getEnabled() {
        return enabled;
    }
@ -731,7 +580,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.enabled = enabled;
    }
    @Column(name = "login_failure_count")
    public Integer getLoginFailureCount() {
        return loginFailureCount;
    }
@ -739,4 +587,20 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    public void setLoginFailureCount(Integer loginFailureCount) {
        this.loginFailureCount = loginFailureCount;
    }
    public Date getLockedDate() {
        return lockedDate;
    }
    public void setLockedDate(Date lockedDate) {
        this.lockedDate = lockedDate;
    }
    public Date getLoginDate() {
        return loginDate;
    }
    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
}

+ 0 - 13
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java

@ -50,11 +50,6 @@ public class FeedbackDO extends IntegerIdentityEntity {
	 */
	private String feedbackContent;
    /**
	 * 问题回答
	 */
	private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
@ -81,14 +76,6 @@ public class FeedbackDO extends IntegerIdentityEntity {
        this.feedbackContent = feedbackContent;
    }
	@Column(name = "answer")
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
	@Column(name = "img")
    public String getImg() {
        return img;

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java

@ -39,12 +39,12 @@ public class HelpCenterDO extends IntegerIdentityEntity {
    /**
	 * 有用次数
	 */
	private String usefulCount;
	private Integer usefulCount;
    /**
	 * 无用次数
	 */
	private String unusefulCount;
	private Integer unusefulCount;
	@Column(name = "parent_type")
@ -80,18 +80,18 @@ public class HelpCenterDO extends IntegerIdentityEntity {
    }
	@Column(name = "useful_count")
    public String getUsefulCount() {
    public Integer getUsefulCount() {
        return usefulCount;
    }
    public void setUsefulCount(String usefulCount) {
    public void setUsefulCount(Integer usefulCount) {
        this.usefulCount = usefulCount;
    }
	@Column(name = "unuseful_count")
    public String getUnusefulCount() {
    public Integer getUnusefulCount() {
        return unusefulCount;
    }
    public void setUnusefulCount(String unusefulCount) {
    public void setUnusefulCount(Integer unusefulCount) {
        this.unusefulCount = unusefulCount;
    }

+ 28 - 12
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java

@ -29,13 +29,28 @@ public class PatientMedicareCardDO extends IntegerIdentityEntity {
            this.type = type;
            this.desc = desc;
        }
    }
       public String getType() {
           return type;
       }
       public void setType(String type) {
           this.type = type;
       }
       public String getDesc() {
           return desc;
       }
       public void setDesc(String desc) {
           this.desc = desc;
       }
   }
   public enum Type {
        MedicareCard("A_01", "医保卡"),
        SocialSecurityCard("A_02", "电子社保卡"),
        PatientIDCard("A_03", "电子就诊卡");
        MedicareCard("A_01", "医(社)保卡"),
        PatientIDCard("A_02", "电子就诊卡");
        private String type;
        private String desc;
@ -83,9 +98,9 @@ public class PatientMedicareCardDO extends IntegerIdentityEntity {
	private String patientCode;
    /**
	 * 绑定密码
	 * 医社保卡缴交的城市
	 */
	private String password;
	private String cityCode;
    /**
	 * 微信openid,有些卡会绑定微信
@ -140,15 +155,16 @@ public class PatientMedicareCardDO extends IntegerIdentityEntity {
        this.patientCode = patientCode;
    }
	@Column(name = "password")
    public String getPassword() {
        return password;
    @Column(name = "city_code")
    public String getCityCode() {
        return cityCode;
    }
    public void setPassword(String password) {
        this.password = password;
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
	@Column(name = "wx_openid")
    @Column(name = "wx_openid")
    public String getWxOpenid() {
        return wxOpenid;
    }

+ 0 - 29
common/common-entity/src/main/java/com/yihu/jw/entity/base/security/RSA.java

@ -1,29 +0,0 @@
package com.yihu.jw.entity.base.security;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
/**
 * 非对象算法加密信息
 * @author George
 *
 */
@Entity
@Table(name = "dm_rsa")
public class RSA extends UuidIdentityEntity {
	private static final long serialVersionUID = 7832717679571844202L;
	
	private byte[] data;
	@Lob
	public byte[] getData() {
	    return data;
	}
	
	public void setData(byte[] data){
		this.data = data;
	}
}

+ 0 - 81
common/common-entity/src/main/java/com/yihu/jw/entity/base/security/Token.java

@ -1,81 +0,0 @@
package com.yihu.jw.entity.base.security;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "wlyy_token")
public class Token extends UuidIdentityEntity {
	private static final long serialVersionUID = -3297644428262254694L;
	private String user;
	private Integer platform;   // 1患者端,2医生端app,3微信公众号wechat,4医生端pc
	private Date timeout;
	private String imei;
	private String token;
	private Date czrq;
	private String del;
	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
	public Integer getPlatform() {
		return platform;
	}
	public void setPlatform(Integer platform) {
		this.platform = platform;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getTimeout() {
		return timeout;
	}
	public void setTimeout(Date timeout) {
		this.timeout = timeout;
	}
	public String getImei() {
		return imei;
	}
	public void setImei(String imei) {
		this.imei = imei;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCzrq() {
		return czrq;
	}
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	public String getDel() {
		return del;
	}
	public void setDel(String del) {
		this.del = del;
	}
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -92,6 +92,7 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    private String introduce;//服务介绍
    private String endIntroduce;//过期时间说明
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Date endTime;//结束时间
    private Integer del;//是否有效(1有效,0失效)
    private Integer sort;//排序
@ -240,4 +241,12 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}

+ 27 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java

@ -35,6 +35,9 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    private String doctorTeamCode;//医生服务团队code
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
    private Integer sort;//排序:0 待支付,1未通过,2未通过,3待审核,4.生效
    private String cancelReason;//取消原因
    private String reviewReason;//审核原因
    @Column(name = "saas_id")
    public String getSaasId() {
@ -198,4 +201,28 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    public void setOperator(String operator) {
        this.operator = operator;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
    public String getReviewReason() {
        return reviewReason;
    }
    public void setReviewReason(String reviewReason) {
        this.reviewReason = reviewReason;
    }
}

+ 107 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPayLogDO.java

@ -0,0 +1,107 @@
package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by Trick on 2018/11/8.
 */
@Entity(name = "WxPayLogDO")
@Table(name = "wlyy_wx_pay_log")
public class WxPayLogDO extends IntegerIdentityEntity {
    private String seqNo;//支付订单号',
    private String openId;//openid,
    private Integer type;//支付的类型(预留字段) 0:服务包签约
    private String orderParams;//统一下单参数XML',
    private String orderResponse;//统一下单返回XML',
    private Integer orderStatus;//统一下单状态,1为成功。0为默认,-1为失败',
    private String payResponse;//支付回调XML',
    private Date createTime;//'统一下单时间',
    private Date payTime;//支付回调时间',
    private Integer payStatus;//支付回调状态1为成功,0为默认,-1为失败',
    public String getSeqNo() {
        return seqNo;
    }
    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }
    public String getOpenId() {
        return openId;
    }
    public void setOpenId(String openId) {
        this.openId = openId;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getOrderParams() {
        return orderParams;
    }
    public void setOrderParams(String orderParams) {
        this.orderParams = orderParams;
    }
    public String getOrderResponse() {
        return orderResponse;
    }
    public void setOrderResponse(String orderResponse) {
        this.orderResponse = orderResponse;
    }
    public Integer getOrderStatus() {
        return orderStatus;
    }
    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }
    public String getPayResponse() {
        return payResponse;
    }
    public void setPayResponse(String payResponse) {
        this.payResponse = payResponse;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getPayTime() {
        return payTime;
    }
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }
    public Integer getPayStatus() {
        return payStatus;
    }
    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }
}

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java

@ -0,0 +1,33 @@
package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2018/12/10.
 */
@Entity
@Table(name = "wx_url_config")
public class WxUrlConfigDO extends IntegerIdentityEntity {
    private String url;
    private String wxId;
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getWxId() {
        return wxId;
    }
    public void setWxId(String wxId) {
        this.wxId = wxId;
    }
}

+ 30 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxWechatDO.java

@ -33,6 +33,9 @@ public class WxWechatDO extends UuidIdentityEntityWithOperator implements java.i
    private String password;//用户密码
    private String publicType;//1.自运营,2.外接
    private String remark;//'备注'
    private String mchId;//商户id
    private String cerfiticate;//商户证书(预留字段,保存证书路径??) 目前暂未使用到
    private String appKey;//appKey
    @Transient
@ -188,4 +191,31 @@ public class WxWechatDO extends UuidIdentityEntityWithOperator implements java.i
    public void setPublicType(String publicType) {
        this.publicType = publicType;
    }
    @Column(name = "mch_id")
    public String getMchId() {
        return mchId;
    }
    public void setMchId(String mchId) {
        this.mchId = mchId;
    }
    @Column(name = "cerfiticate")
    public String getCerfiticate() {
        return cerfiticate;
    }
    public void setCerfiticate(String cerfiticate) {
        this.cerfiticate = cerfiticate;
    }
    @Column(name="app_key")
    public String getAppKey() {
        return appKey;
    }
    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }
}

+ 7 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -472,6 +472,7 @@ public class BaseRequestMapping {
        public static final String idcardOccupied  = "/idcardOccupied";
        public static final String updateMobile  = "/updateMobile";
        public static final String resetPassword  = "/resetPassword";
        public static final String ForgetPwd  = "/forgetPwd";
        public static final String Regist = "regist";
        public static final String GetKey = "getKey";
        public static final String Login = "login";
@ -488,6 +489,10 @@ public class BaseRequestMapping {
        public static final String bindPatientIDCard  = "/bindPatientIDCard";
        public static final String bindSocialSecurityCard  = "/bindSocialSecurityCard";
        public static final String unBindCard  = "/unBindCard";
        public static final String cardList  = "/cardList";
        public static final String cardOrgList  = "/cardOrgList";
        public static final String sortProList  = "/sortProList";
        public static final String sortCityList  = "/sortCityList";
    }
@ -510,6 +515,8 @@ public class BaseRequestMapping {
     */
    public static class HelpCenter extends Basic {
        public static final String PREFIX  = "/helpCenter";
        public static final String getAnswerByType  = "/getAnswerByType";
        public static final String commentAnswer  = "/commentAnswer";
    }

+ 26 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java

@ -17,14 +17,24 @@ public class PatientRequestMapping {
        public static final String LIST = "/list";
    }
    public static class open extends Basic{
        public static final String openUrl = "/open";
        public static final String findwxConfig ="/findwxConfig";
    }
    public abstract static class Wechat extends Basic{
        public static final String wxBase =  "/wxBase";
        public static final String api_success ="success";
        public static final String api_error ="error";
        public static final String getSign ="/getSign";
        public static final String getWxWechatConfig ="/getWxWechatConfig";
    }
    public abstract static class WechatPay extends Basic{
        public static final String PRE_URL =  "/wechatPay";
        public static final String Notify =  "/notify";
    }
    /**
     * signPackage
@ -41,6 +51,10 @@ public class PatientRequestMapping {
        public static final String findDoctorById  = "/findDoctorById";
        public static final String findOrgByCode  = "/findOrgByCode";
        public static final String findPatientSignExist  = "/findPatientSignExist";
        public static final String findPatientSignPackage  = "/findPatientSignPackage";
        public static final String findLabelByLabelType  = "/findLabelByLabelType";
        public static final String findSingleSignPackageById  = "/findSingleSignPackageById";
        public static final String signPackageAndFamily  = "/signPackageAndFamily";
    }
    /**
     * myFamily
@ -52,10 +66,22 @@ public class PatientRequestMapping {
        public static final String bindingMyFamily  = "/bindingMyFamily";
        public static final String createFamilyQrCode  = "/createFamilyQrCode";
        public static final String remindMyFamily  = "/remindMyFamily";
        public static final String scanQRcodeConfirmApply  = "/scanQRcodeConfirmApply";
        public static final String confirmApply  = "/confirmApply";
        public static final String applyMessageList  = "/applyMessageList";
        public static final String cancelApply  = "/cancelApply";
        public static final String myFamilyBindList  = "/myFamilyBindList";
        public static final String scanQRcode  = "/scanQRcode";
        public static final String messageToBinding  = "/messageToBinding";
        public static final String cancelBindFamily  = "/cancelBindFamily";
        public static final String updateAuthorizeById  = "/updateAuthorizeById";
        public static final String nonageByIdcard  = "/nonageByIdcard";
    }
    public static class MyMessage extends Basic {
        public static final String PREFIX  = "/myMessage";
        public static final String messageList  = "/messageList";
        public static final String myDoctorList  = "/myDoctorList";
    }

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java

@ -114,5 +114,19 @@ public class BaseDoctorHospitalVO extends IntegerIdentityVO{
        this.createTime = createTime;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}

+ 13 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java

@ -1,9 +1,11 @@
package com.yihu.jw.restmodel.base.doctor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
/**
 * Created by Trick on 2018/11/29.
@ -163,6 +165,9 @@ public class BaseDoctorSimpleVO {
    @ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    @ApiModelProperty(value = "机构", example = "1")
    private List<BaseDoctorHospitalVO> hospitalVOs;
    public String getId() {
        return id;
@ -371,4 +376,12 @@ public class BaseDoctorSimpleVO {
    public void setDel(String del) {
        this.del = del;
    }
    public List<BaseDoctorHospitalVO> getHospitalVOs() {
        return hospitalVOs;
    }
    public void setHospitalVOs(List<BaseDoctorHospitalVO> hospitalVOs) {
        this.hospitalVOs = hospitalVOs;
    }
}

+ 74 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/label/BasePatientLabelVO.java

@ -0,0 +1,74 @@
package com.yihu.jw.restmodel.base.label;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/12/7.
 */
@ApiModel(value = "居民标签", description = "居民标签")
public class BasePatientLabelVO {
    private String labelCode;//标签标识',
    private String labelName;//标签名称',
    private String labelType;//标签类型(1:卫计委三大分组 2:健康状况 3:疾病类型 4:自定义标签5.周月标签 6.老年人标识 7.专病类型,8.健康情况)',
    private Integer isSystem;//是否系统标签(0:否 1是)',
    private String teamCode;//团队code',
    private Integer sort;//排序',
    private Integer status;//状态(0:无效 1:有效)',
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 16 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/BaseOrgVO.java

@ -144,6 +144,14 @@ public class BaseOrgVO extends UuidIdentityVOWithOperator {
	@ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    /**
     * 11一级甲等 12一级乙等 13一级丙等
     * 21二级甲等 22二级乙等 23二级丙等
     * 31三级特等 32三级甲等 33三级乙等 34三级丙级
     */
    @ApiModelProperty(value = "11一级甲等 12一级乙等 13一级丙等二级甲等 22二级乙等 23二级丙等31三级特等 32三级甲等 33三级乙等 34三级丙级", example = "1")
    private Integer level;
    private List<DictHospitalDeptVO> depts;
    public String getCode() {
@ -291,6 +299,14 @@ public class BaseOrgVO extends UuidIdentityVOWithOperator {
        return depts;
    }
    public Integer getLevel() {
        return level;
    }
    public void setLevel(Integer level) {
        this.level = level;
    }
    public void setDepts(List<DictHospitalDeptVO> depts) {
        this.depts = depts;
    }

+ 0 - 13
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/FeedbackVO.java

@ -33,12 +33,6 @@ public class FeedbackVO extends IntegerIdentityVO{
	@ApiModelProperty(value = "反馈内容,问题和建议", example = "模块1")
    private String feedbackContent;
    /**
	 * 问题回答
	 */
	@ApiModelProperty(value = "问题回答", example = "模块1")
    private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
@ -65,13 +59,6 @@ public class FeedbackVO extends IntegerIdentityVO{
        this.feedbackContent = feedbackContent;
    }
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    public String getImg() {
        return img;
    }

+ 15 - 21
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/PatientMedicareCardVO.java

@ -36,7 +36,7 @@ public class PatientMedicareCardVO extends IntegerIdentityVO{
    /**
	 * 卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,
	 */
	@ApiModelProperty(value = "卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,", example = "模块1")
	@ApiModelProperty(value = "卡的小类:医疗卡包含 A_01 医(社)保卡, A_02 电子就诊卡等等,,,", example = "模块1")
    private String type;
    /**
@ -46,17 +46,10 @@ public class PatientMedicareCardVO extends IntegerIdentityVO{
    private String patientCode;
    /**
	 * 医疗保险号
	 * 医社保卡缴交的城市
	 */
	@ApiModelProperty(value = "医疗保险号", example = "模块1")
    private String medicareNumber;
    /**
	 * 绑定密码
	 */
	@ApiModelProperty(value = "绑定密码", example = "模块1")
    private String password;
	@ApiModelProperty(value = "医社保卡缴交的城市", example = "模块1")
    private String cityCode;
    /**
	 * 微信openid,有些卡会绑定微信
@ -112,18 +105,12 @@ public class PatientMedicareCardVO extends IntegerIdentityVO{
        this.patientCode = patientCode;
    }
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    public String getCityCode() {
        return cityCode;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    public String getWxOpenid() {
@ -148,4 +135,11 @@ public class PatientMedicareCardVO extends IntegerIdentityVO{
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
}

+ 235 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageRecordVO.java

@ -0,0 +1,235 @@
package com.yihu.jw.restmodel.patient.signPackage;
import java.util.Date;
/**
 * Created by Trick on 2018/12/6.
 */
public class ServicePackageRecordVO {
    private String id;
    private String saasId;
    private String servicePackageId;//服务包id
    private String servicePackageName;//服务包名称
    private String patient;//居民code
    private String name;//居民姓名
    private String idcard;//居民身份证
    private String ssc;//社保卡号
    private String signDoctor;//签约医生code
    private String signDoctorName;//签约医生名称
    private String hospital;//医院code
    private String hospitalName;//医院名称
    private Long adminTeamCode;//行政团队id
    private Long price;//服务总价
    private Date startTime;//服务开始时间
    private Date endTime;//服务结束时间
    private Integer status;//状态(0待审核,1已同意,待支付,2.支付成功,已生效,-1未通过,-2已取消,-3已过期)
    private String doctorTeamCode;//医生服务团队code
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
    private Integer sort;//排序:0 待支付,1未通过,2未通过,3待审核,4.生效
    private String cancelReason;//取消原因
    private String reviewReason;//审核原因
    private String introduce;//服务介绍
    private String endIntroduce;//过期时间说明
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getServicePackageName() {
        return servicePackageName;
    }
    public void setServicePackageName(String servicePackageName) {
        this.servicePackageName = servicePackageName;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    public String getSignDoctor() {
        return signDoctor;
    }
    public void setSignDoctor(String signDoctor) {
        this.signDoctor = signDoctor;
    }
    public String getSignDoctorName() {
        return signDoctorName;
    }
    public void setSignDoctorName(String signDoctorName) {
        this.signDoctorName = signDoctorName;
    }
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getDoctorTeamCode() {
        return doctorTeamCode;
    }
    public void setDoctorTeamCode(String doctorTeamCode) {
        this.doctorTeamCode = doctorTeamCode;
    }
    public String getOperator() {
        return operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getEndIntroduce() {
        return endIntroduce;
    }
    public void setEndIntroduce(String endIntroduce) {
        this.endIntroduce = endIntroduce;
    }
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
    public String getReviewReason() {
        return reviewReason;
    }
    public void setReviewReason(String reviewReason) {
        this.reviewReason = reviewReason;
    }
}

+ 19 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageVO.java

@ -28,9 +28,12 @@ public class ServicePackageVO {
    private String endIntroduce;//过期描述
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Integer del;//是否有效(1有效,0失效)
    private Date endTime;
    private List<SerivePackageItemVO> items;//服务项描述
    private Integer signType;//判断当前居民是否签约:1为签约,2为未签约
    public String getId() {
        return id;
    }
@ -182,4 +185,20 @@ public class ServicePackageVO {
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getSignType() {
        return signType;
    }
    public void setSignType(Integer signType) {
        this.signType = signType;
    }
}

+ 62 - 14
common/common-util/src/main/java/com/yihu/jw/util/wechat/WeiXinPayUtils.java

@ -16,6 +16,31 @@ public class WeiXinPayUtils {
    private static final Random RANDOM = new SecureRandom();
    /**
     * 获取 微信支付,统一下单 前的报文
     * @param param
     * @param appKey
     * @return
     * @throws Exception
     */
    public static String getXmlBeforUnifiedorder(Map<String, String> param,String appKey) throws Exception {
        synchronized (WeiXinPayUtils.class) {
            param.put("nonce_str",generateNonceStr());
            WXPayConstants.SignType  wxSignType = WXPayConstants.SignType.MD5;
            String signType = param.get("sign_type");
            if("HMAC-SHA256".equalsIgnoreCase(signType)){
                wxSignType = WXPayConstants.SignType.HMACSHA256;
            }
            //获取微信签名
            String signature = WeiXinPayUtils.generateSignature(param, appKey, wxSignType);
            param.put("sign",signature);
            //参数转化XML
            String params = XMLUtil.map2xmlForWx(param);
            return params;
        }
    }
    /**
     *
@ -25,26 +50,49 @@ public class WeiXinPayUtils {
     *
     * @param param
     * @param appKey
     * @return
     * @return  返回的map为微信返回报文转换成的map,
     *            此外map中 有个属性 wxPayResult.该属性放着微信返回的原始报文数据
     * @throws Exception
     */
    public static Map<String,Object> unifiedorder(Map<String, String> param,String appKey) throws Exception {
        param.put("nonce_str",generateNonceStr());
        WXPayConstants.SignType  wxSignType = WXPayConstants.SignType.MD5;
        String signType = param.get("sign_type");
        if("HMAC-SHA256".equalsIgnoreCase(signType)){
            wxSignType = WXPayConstants.SignType.HMACSHA256;
        synchronized (WeiXinPayUtils.class) {
            String xml = getXmlBeforUnifiedorder(param, appKey);
            String result = HttpUtil.sendPost("https://api.mch.weixin.qq.com/pay/unifiedorder", xml);
            Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
            wxrs.put("wxPayResult",wxrs);
            return wxrs;
        }
    }
        //获取微信签名
        String signature = WeiXinPayUtils.generateSignature(param, appKey, wxSignType);
        param.put("sign",signature);
    /**
     *
     * 微信支付,统一下单
     *
     * param 对应的key值参见文档 https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_1 (sign,nonce_str两个参数,此接口会自动生成)
     *
     * @param param
     * @return  返回的map为微信返回报文转换成的map,
     *            此外map中 有个属性 wxPayResult.该属性放着微信返回的原始报文数据
     * @throws Exception
     */
    public static Map<String,Object> unifiedorder(String param) throws Exception {
        synchronized (WeiXinPayUtils.class) {
            String result = HttpUtil.sendPost("https://api.mch.weixin.qq.com/pay/unifiedorder", param);
            Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
            wxrs.put("wxPayResult",wxrs);
            return wxrs;
        }
    }
        //参数转化XML
        String params = XMLUtil.map2xmlForWx(param);
        String result = HttpUtil.sendPost("https://api.mch.weixin.qq.com/pay/unifiedorder", params);
        Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
        return wxrs;
    public static Map<String,Object> unifiedorder(String param,boolean withResult) throws Exception {
        synchronized (WeiXinPayUtils.class) {
            String result = HttpUtil.sendPost("https://api.mch.weixin.qq.com/pay/unifiedorder", param);
            Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
            if(withResult){
                wxrs.put("wxPayResult",wxrs);
            }
            return wxrs;
        }
    }

+ 2 - 2
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java

@ -63,8 +63,8 @@ public class BasicZuulFilter extends ZuulFilter {
        //内部微服务有不需要认证的地址请在URL上追加/open/来进行过滤,如/api/v1.0/open/**,不要在此继续追加!!!
        if (url.contains("/auth/")//验证服务
                || url.contains("/wechat")//微信
                || url.contains("/open/")
                || url.contains("/patient/")) {//开发接口
                || url.contains("/wxBase")//微信
                || url.contains("/open/")) {//开发接口
            return true;
        }
        return this.authenticate(ctx, request, url);

+ 1 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -26,7 +26,7 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
#  sleuth:
#    sampler:

+ 2 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/SaltUser.java

@ -36,7 +36,8 @@ public class SaltUser implements UserDetails, CredentialsContainer {
    }
    public SaltUser(String username, String password, String salt, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
        if(username != null && !"".equals(username) && password != null) {
        //居民使用验证码注册,密码没有默认值, 可能为空 password != null
        if(username != null && !"".equals(username)) {
            this.username = username;
            this.password = password;
            this.salt = salt;

+ 21 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -5,6 +5,7 @@ import com.yihu.jw.security.model.WlyyUserDetails;
import com.yihu.jw.security.model.WlyyUserSimple;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
@ -19,10 +20,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
@ -37,6 +35,10 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private static final String DEFAULT_PATIENT_DETAILS_STATEMENT = "SELECT * FROM base_patient p WHERE p.mobile = ? OR p.idcard = ?";
    private static final String BespeakRegist = "bespeakRegist:";
    @Autowired
    private StringRedisTemplate redisTemplate;
    public WlyyUserDetailsService(DataSource dataSource) {
        this.setDataSource(dataSource);
@ -102,6 +104,14 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
            users = this.getJdbcTemplate().query(DEFAULT_DOCTOR_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserDetails.class), username, username);
            //3.患者登录
        }else if("3".equals(loginType)){
            //查找是否存在预注册 用户
            String userName = redisTemplate.opsForValue().get(BespeakRegist + username);
            if(StringUtils.isNotBlank(userName)){
                //保存到数据库
                this.getJdbcTemplate().execute("update base_patient set del=1 where mobile='"+username+"'");
                redisTemplate.opsForValue().get(BespeakRegist + username);
                redisTemplate.delete(BespeakRegist+username);
            }
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserDetails.class), username, username);
        }//..
        return users;
@ -254,10 +264,16 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
        }else if("2".equals(loginType)){//2.为医生账号
        }else if("3".equals(loginType)){ //3.患者账号
            String key = "wlyy2:auth:token:"+token.getValue();
            redisTemplate.opsForValue().set(key,"/**");
            redisTemplate.expire(key,token.getExpiresIn(), TimeUnit.SECONDS);
        }else{
            return false;
        }
        return true;
    }
    public void updateOpenId(String openid,String userId){
        this.getJdbcTemplate().update("update base_patient p set p.openid = ? where p.id= ?",openid ,userId);
    }
}

+ 2 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java

@ -314,8 +314,8 @@ public class WlyyTokenGranter implements TokenGranter {
            String client_id = parameters.get("client_id");
            String username = parameters.get("username");
            String captcha = parameters.get("captcha");
            if (!wlyyRedisVerifyCodeService.verification(client_id, username, captcha)){
                //todo cyx  部署应取消注释(自测试,可注释,不验证短信直接登录)
           if (!wlyyRedisVerifyCodeService.verification(client_id, username, captcha)){
                throw new InvalidGrantException("Invalid captcha");
            }

+ 103 - 9
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1,7 +1,5 @@
package com.yihu.jw.security.oauth2.provider.endpoint;
import com.yihu.jw.restmodel.base.wx.WxTemplateConfigVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.security.core.userdetails.jdbc.WlyyUserDetailsService;
import com.yihu.jw.security.model.*;
@ -9,9 +7,6 @@ import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
import com.yihu.jw.security.oauth2.provider.WlyyTokenGranter;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.utils.security.RSAUtils;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -40,14 +35,12 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.PostConstruct;
import javax.crypto.Cipher;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.text.SimpleDateFormat;
@ -166,9 +159,12 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        wlyyUserSimple.setState(parameters.get("state"));
        String loginType = parameters.get("login_type");
        String openid = parameters.get("openid");
        //更新患者openId
        if(!StringUtils.isEmpty(openid) && !"undefined".equalsIgnoreCase(openid) && "3".equalsIgnoreCase(loginType)){
            userDetailsService.updateOpenId(openid,wlyyUserSimple.getId());
        }
        userDetailsService.setRolePhth(loginType,token,wlyyUserSimple.getId(),redisTemplate);
        return getResponse(wlyyUserSimple);
    }
@ -372,6 +368,95 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
    }
    /**
     * 登陆
     * @param parameters
     * 不定入参:
     * login_type 用户类型 1或默认为user,2:医生登录,3:患者登录
     * mobile:手机号
     * captcha:验证码
     * clientId:
     * login_type 用户类型 1或默认为user,2:医生登录,3:患者登录
     * @param httpSession
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/registAndLogin", method = RequestMethod.POST)
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> registAndLogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        //用于标记是否注册成功
        boolean registFlag = false;
        String client_id = parameters.get("client_id");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id is null");
        }
        String type = parameters.get("login_type");
        if (StringUtils.isEmpty(type)) {
            throw new InvalidRequestException("regist type is null");
        }
        //type :1居民  2:医生
        if("3".equals(type)){
            String mobile = parameters.get("mobile");
            String captcha = parameters.get("captcha");
            HttpHeaders reqHeaders = new HttpHeaders();
            MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
            params.add("mobile", mobile);
            params.add("captcha", captcha);
            params.add("openid", parameters.get("openid"));
            HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity<>(params, reqHeaders);
            Map<String, Object> result = restTemplate.postForObject("http://svr-patient:10021/basePatient/regist", httpEntity, HashMap.class);//svr-patient
            Map<String,Object> obj = (Map<String, Object>) result.get("obj");
            if("1".equals(obj.get("code")+"")){
                registFlag = true;
                parameters.put("username",mobile);
                wlyyRedisVerifyCodeService.store(client_id, mobile, captcha, 120);
            }else{
                return getFailedResponse(obj.get("message").toString(),-1,null);
            }
        }else{
            return getFailedResponse("暂不提供其他类型人员注册",-1,null);
        }
        if(registFlag){
            parameters.put("grant_type", "captcha");
            ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
            TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
            if (authenticatedClient != null) {
                oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
            }
            OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
            if (token == null) {
                throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
            }
            /*如果是移动端登陆则移除之前的token,
            在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
            实现同一账号只能在一处登陆*/
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            if (request.getHeader("login-device") != null && request.getHeader("login-device").equals("mobile")) {
                tokenStore.removeAccessToken(token.getValue());
                tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
                token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
            }
            if (token == null) {
                throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
            }
            WlyyUserSimple wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
            wlyyUserSimple.setAccessToken(token.getValue());
            wlyyUserSimple.setTokenType(token.getTokenType());
            wlyyUserSimple.setExpiresIn(token.getExpiresIn());
            wlyyUserSimple.setRefreshToken(token.getRefreshToken().getValue());
            wlyyUserSimple.setUser(parameters.get("username"));
            wlyyUserSimple.setState(parameters.get("state"));
            String loginType = parameters.get("login_type");
            userDetailsService.setRolePhth(loginType,token,wlyyUserSimple.getId(),redisTemplate);
            return getResponse(wlyyUserSimple);
        }
        return null;
    }
    @Override
    protected TokenGranter getTokenGranter() {
        return this.tokenGranter;
@ -392,6 +477,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
    }
    private ResponseEntity<Oauth2Envelop<WlyyUserSimple>> getFailedResponse(String message ,int status,WlyyUserSimple ehrUserSimple) {
        HttpHeaders headers = new HttpHeaders();
        headers.set("Cache-Control", "no-store");
        headers.set("Pragma", "no-cache");
        Oauth2Envelop<WlyyUserSimple> oauth2Envelop = new Oauth2Envelop<>(message, status, ehrUserSimple);
        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
    }
    @Override
    protected WebResponseExceptionTranslator getExceptionTranslator() {
        return wlyyOAuth2ExceptionTranslator;

+ 4 - 7
server/svr-authentication/src/main/resources/application.yml

@ -16,7 +16,7 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
#logging:
#  level:
@ -39,12 +39,9 @@ spring:
spring:
  profiles: jwtest
  datasource:
#    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#    username: ssgg
#    password: ssgg
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    password: ssgg
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.

+ 35 - 35
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java

@ -1,35 +1,35 @@
package com.yihu.jw.base.dao.doctor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * 
 * 医生职业信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
}
//package com.yihu.jw.base.dao.doctor;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
//
//import java.util.List;
//import java.util.Map;
//import java.util.Set;
//
///**
// *
// * 医生职业信息 数据库访问层
// *
// * @version
// * <pre>
// * Author	Version		Date		Changes
// * litaohong 	1.0  		2018年08月31日 	Created
// *
// * </pre>
// * @since 1.
// */
//public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
//
//    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
//
//    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
//    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
//
//    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
//    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
//}

+ 0 - 31
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WechatDao.java

@ -1,31 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//import com.yihu.jw.entity.base.wx.WxWechatDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Created by Administrator on 2017/5/20 0020.
// */
//public interface WechatDao extends PagingAndSortingRepository<WxWechatDO, String>, JpaSpecificationExecutor<WxWechatDO> {
//
//    @Query("from WxWechatDO w where w.appId = ?1 and w.status!=-1")
//    WxWechatDO findByAppId(String appId);
//
//    @Query("from WxWechatDO w where w.appId = ?1 and w.id!= ?2 and w.status!=-1")
//    WxWechatDO findByAppIdExcludeId(String appId, String id);
//
//    @Query("from WxWechatDO w where w.id = ?1 and w.status!=-1")
//    WxWechatDO findById(String id);
//
//    @Query("from WxWechatDO w where w.status!=-1")
//    List<WxWechatDO> findAll();
//
//    @Query("from WxWechatDO w where w.appOriginId = ?1 and w.status!=-1")
//    WxWechatDO findByAppOriginId(String appOriginId);
//
//    List<WxWechatDO> findByName(String name);
//}

+ 0 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxAccessTokenDao.java

@ -1,17 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Created by Administrator on 2017/5/18 0018.
// */
//public interface WxAccessTokenDao extends PagingAndSortingRepository<WxAccessTokenDO, String>, JpaSpecificationExecutor<WxAccessTokenDO> {
//
//    @Query("from WxAccessTokenDO w where w.wechatId =?1 order by w.addTimestamp desc")
//    List<WxAccessTokenDO> getWxAccessTokenById(String wechatId);
//}

+ 0 - 19
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateConfigDao.java

@ -1,19 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//
//import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Created by Trick on 2018/8/21.
// */
//public interface WxTemplateConfigDao extends PagingAndSortingRepository<WxTemplateConfigDO, String>, JpaSpecificationExecutor<WxTemplateConfigDO> {
//
//    WxTemplateConfigDO findByWechatIdAndTemplateNameAndSceneAndStatus(String wechatId, String templateName, String scene,Integer status);
//    WxTemplateConfigDO findByWechatIdAndTemplateNameAndScene(String wechatId, String templateName, String scene);
//    List<WxTemplateConfigDO> findByWechatIdAndScene(String wechatId,String scene);
//
//}

+ 0 - 26
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateDao.java

@ -1,26 +0,0 @@
//package com.yihu.jw.base.dao.wx;//package com.yihu.jw.business.wx.dao;
//
//import com.yihu.jw.entity.base.wx.WxTemplateDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Created by Administrator on 2017/5/20 0020.
// */
//public interface WxTemplateDao extends PagingAndSortingRepository<WxTemplateDO, String>, JpaSpecificationExecutor<WxTemplateDO> {
//
//
//    @Query("from WxTemplateDO w where w.id = ?1 and w.status =1")
//    WxTemplateDO findById(String id);
//
//    @Query("from WxTemplateDO w where w.wechatId = ?1 and w.status =1")
//    List<WxTemplateDO> findByWxId(String wechatId);
//
//    List<WxTemplateDO> findByTemplateIdAndWechatIdAndStatus(String templateId,String wechatId,Integer status);
//
//    List<WxTemplateDO> findByTemplateNameAndWechatIdAndStatus(String templateId,String wechatId,Integer status);
//
//}

+ 3 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java

@ -1,12 +1,13 @@
package com.yihu.jw.base.service.doctor;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import java.util.*;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
@ -17,6 +16,7 @@ import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;

+ 6 - 6
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/LoginService.java

@ -250,12 +250,12 @@ public class LoginService  extends BaseJpaService {
        ObjectMapper objectMapper = new ObjectMapper();
        HashMap<String, Object> result = objectMapper.readValue(resultStr,HashMap.class);
            Long expire = 600L;
            wlyyRedisVerifyCodeService.store(clientId, phone, captcha, expire.intValue());
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(result, headers, HttpStatus.OK);
        Long expire = 600L;
        wlyyRedisVerifyCodeService.store(clientId, phone, captcha, expire.intValue());
        HttpHeaders headers = new HttpHeaders();
        headers.set("Cache-Control", "no-store");
        headers.set("Pragma", "no-cache");
        return new ResponseEntity<>(result, headers, HttpStatus.OK);
    }

+ 1 - 1
svr/svr-manage/src/main/resources/application.yml

@ -36,7 +36,7 @@ spring:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This settings only has an effect if it is positive.
cache: 2

+ 1 - 1
svr/svr-manage/src/main/resources/webapp/common/js/jquery/jquery.form.3.51.0.js

@ -521,7 +521,7 @@
                    form.setAttribute('action', s.url);
                }
                // ie borks in some cases when setting encoding
                // ie borks in some cases when settings encoding
                if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
                    $form.attr({
                        encoding: 'multipart/form-data',

+ 10 - 10
svr/svr-manage/src/main/resources/webapp/common/js/plugins/dataTables/jquery.dataTables.js

@ -1178,7 +1178,7 @@
		if ( $.isPlainObject( mSource ) )
		{
			/* Unlike get, only the underscore (global) option is used for for
			 * setting data since we don't know the type here. This is why an object
			 * settings data since we don't know the type here. This is why an object
			 * option is not documented for `mData` (which is read/write), but it is
			 * for `mRender` which is read only.
			 */
@ -1220,7 +1220,7 @@
						b.splice( 0, i+1 );
						innerSrc = b.join('.');
	
						// Traverse each entry in the array setting the properties requested
						// Traverse each entry in the array settings the properties requested
						for ( var j=0, jLen=val.length ; j<jLen ; j++ )
						{
							o = {};
@ -7227,7 +7227,7 @@
				settings.ajax = url;
			}
			// No need to consider sAjaxSource here since DataTables gives priority
			// to `ajax` over `sAjaxSource`. So setting `ajax` here, renders any
			// to `ajax` over `sAjaxSource`. So settings `ajax` here, renders any
			// value of `sAjaxSource` redundant.
		} );
	} );
@ -7237,7 +7237,7 @@
	 * Load data from the newly set Ajax URL. Note that this method is only
	 * available when `ajax.url()` is used to set a URL. Additionally, this method
	 * has the same effect as calling `ajax.reload()` but is provided for
	 * convenience when setting a new URL. Like `ajax.reload()` it will
	 * convenience when settings a new URL. Like `ajax.reload()` it will
	 * automatically redraw the table once the remote data has been loaded.
	 *
	 * @returns {DataTables.Api} this
@ -9596,7 +9596,7 @@
		 * table has already been initialised, this parameter will cause DataTables
		 * to simply return the object that has already been set up - it will not take
		 * account of any changes you might have made to the initialisation object
		 * passed to DataTables (setting this parameter to true is an acknowledgement
		 * passed to DataTables (settings this parameter to true is an acknowledgement
		 * that you understand this). `destroy` can be used to reinitialise a table if
		 * you need.
		 *  @type boolean
@ -10006,7 +10006,7 @@
		/**
		 * This function allows you to 'post process' each row after it have been
		 * generated for each table draw, but before it is rendered on screen. This
		 * function might be used for setting the row class name etc.
		 * function might be used for settings the row class name etc.
		 *  @type function
		 *  @param {node} row "TR" element for the current row
		 *  @param {array} data Raw data array for this row
@ -10324,7 +10324,7 @@
		/**
		 * Number of rows to display on a single page when using pagination. If
		 * feature enabled (`lengthChange`) then the end user will be able to override
		 * this to a custom setting using a pop-up menu.
		 * this to a custom settings using a pop-up menu.
		 *  @type int
		 *  @default 10
		 *
@ -11403,7 +11403,7 @@
		 *    * Parameters:
		 *      * `{array|object}` The data source for the row
		 *      * `{string}` The type call data requested - this will be 'set' when
		 *        setting data or 'filter', 'display', 'type', 'sort' or undefined
		 *        settings data or 'filter', 'display', 'type', 'sort' or undefined
		 *        when gathering data. Note that when `undefined` is given for the
		 *        type DataTables expects to get the raw data for the object back<
		 *      * `{*}` Data to set when the second parameter is 'set'.
@ -12682,7 +12682,7 @@
		 * Server-side processing - number of records in the result set
		 * (i.e. before filtering), Use fnRecordsTotal rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type int
		 *  @default 0
		 *  @private
@ -12693,7 +12693,7 @@
		 * Server-side processing - number of records in the current display set
		 * (i.e. after filtering). Use fnRecordsDisplay rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type boolean
		 *  @default 0
		 *  @private

+ 2 - 2
svr/svr-manage/src/main/resources/webapp/common/js/plugins/datapicker/bootstrap-datepicker.js

@ -649,11 +649,11 @@
				this.viewDate = new Date(this.o.endDate);
			if (fromArgs){
				// setting date by clicking
				// settings date by clicking
				this.setValue();
			}
			else if (dates.length){
				// setting date by typing
				// settings date by typing
				if (String(oldDates) !== String(this.dates))
					this._trigger('changeDate');
			}

+ 1 - 1
svr/svr-manage/src/main/resources/webapp/common/js/plugins/flot/jquery.flot.js

@ -63,7 +63,7 @@
                    inverseTransform: null, // if transform is set, this should be the inverse function
                    min: null, // min. value to show, null means set automatically
                    max: null, // max. value to show, null means set automatically
                    autoscaleMargin: null, // margin in % to add if auto-setting min/max
                    autoscaleMargin: null, // margin in % to add if auto-settings min/max
                    ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
                    tickFormatter: null, // fn: number -> string
                    labelWidth: null, // size of tick labels in pixels

+ 1 - 1
svr/svr-manage/src/main/resources/webapp/common/js/plugins/treeview/bootstrap-treeview.js

@ -178,7 +178,7 @@
		},
		// On initialization recurses the entire tree structure 
		// setting expanded / collapsed states based on initial levels
		// settings expanded / collapsed states based on initial levels
		_setInitialLevels: function(nodes, level) {
			if (!nodes) { return; }

+ 4 - 4
svr/svr-manage/src/main/resources/webapp/common/js/vue.js

@ -280,7 +280,7 @@ return /******/ (function(modules) { // webpackBootstrap
	/**
	 * Check and convert possible numeric strings to numbers
	 * before setting back to data
	 * before settings back to data
	 *
	 * @param {*} value
	 * @return {*|Number}
@ -3386,7 +3386,7 @@ return /******/ (function(modules) { // webpackBootstrap
	/**
	 * 1. Deal with Safari cloning nested <template> bug by
	 *    manually cloning all template instances.
	 * 2. Deal with IE10/11 textarea placeholder bug by setting
	 * 2. Deal with IE10/11 textarea placeholder bug by settings
	 *    the correct value after cloning.
	 *
	 * @param {Element|DocumentFragment} node
@ -6819,14 +6819,14 @@ return /******/ (function(modules) { // webpackBootstrap
	}
	/**
	 * Warn against setting non-existent root path on a vm.
	 * Warn against settings non-existent root path on a vm.
	 */
	var warnNonExistent
	if (true) {
	  warnNonExistent = function (path) {
	    _.warn(
	      'You are setting a non-existent path "' + path.raw + '" ' +
	      'You are settings a non-existent path "' + path.raw + '" ' +
	      'on a vm instance. Consider pre-initializing the property ' +
	      'with the "data" option for more reliable reactivity ' +
	      'and better performance.'

+ 4 - 4
svr/svr-manage/src/main/resources/webapp/common/js/vue/vue.js

@ -2667,7 +2667,7 @@ function callUpdateHooks (queue) {
 * The queue will be processed after the entire tree has been patched.
 */
function queueActivatedComponent (vm) {
  // setting _inactive to false here so that a render function can
  // settings _inactive to false here so that a render function can
  // rely on checking whether it's in an inactive tree (e.g. router-view)
  vm._inactive = false;
  activatedChildren.push(vm);
@ -5511,7 +5511,7 @@ function updateAttrs (oldVnode, vnode) {
      setAttr(elm, key, cur);
    }
  }
  // #4391: in IE9, setting type can reset value for input[type=radio]
  // #4391: in IE9, settings type can reset value for input[type=radio]
  /* istanbul ignore if */
  if (isIE9 && attrs.value !== oldAttrs.value) {
    setAttr(elm, 'value', attrs.value);
@ -5981,7 +5981,7 @@ function model (
        "v-model does not support dynamic input types. Use v-if branches instead."
      );
    }
    // inputs with type="file" are read only and setting the input's
    // inputs with type="file" are read only and settings the input's
    // value will throw an error.
    if (tag === 'input' && type === 'file') {
      warn$1(
@ -6420,7 +6420,7 @@ function updateStyle (oldVnode, vnode) {
  for (name in newStyle) {
    cur = newStyle[name];
    if (cur !== oldStyle[name]) {
      // ie9 setting to null has no effect, must use empty string
      // ie9 settings to null has no effect, must use empty string
      setProp(el, name, cur == null ? '' : cur);
    }
  }

+ 10 - 10
svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/dataTables/jquery.dataTables.js

@ -1178,7 +1178,7 @@
		if ( $.isPlainObject( mSource ) )
		{
			/* Unlike get, only the underscore (global) option is used for for
			 * setting data since we don't know the type here. This is why an object
			 * settings data since we don't know the type here. This is why an object
			 * option is not documented for `mData` (which is read/write), but it is
			 * for `mRender` which is read only.
			 */
@ -1220,7 +1220,7 @@
						b.splice( 0, i+1 );
						innerSrc = b.join('.');
	
						// Traverse each entry in the array setting the properties requested
						// Traverse each entry in the array settings the properties requested
						for ( var j=0, jLen=val.length ; j<jLen ; j++ )
						{
							o = {};
@ -7220,7 +7220,7 @@
				settings.ajax = url;
			}
			// No need to consider sAjaxSource here since DataTables gives priority
			// to `ajax` over `sAjaxSource`. So setting `ajax` here, renders any
			// to `ajax` over `sAjaxSource`. So settings `ajax` here, renders any
			// value of `sAjaxSource` redundant.
		} );
	} );
@ -7230,7 +7230,7 @@
	 * Load data from the newly set Ajax URL. Note that this method is only
	 * available when `ajax.url()` is used to set a URL. Additionally, this method
	 * has the same effect as calling `ajax.reload()` but is provided for
	 * convenience when setting a new URL. Like `ajax.reload()` it will
	 * convenience when settings a new URL. Like `ajax.reload()` it will
	 * automatically redraw the table once the remote data has been loaded.
	 *
	 * @returns {DataTables.Api} this
@ -9589,7 +9589,7 @@
		 * table has already been initialised, this parameter will cause DataTables
		 * to simply return the object that has already been set up - it will not take
		 * account of any changes you might have made to the initialisation object
		 * passed to DataTables (setting this parameter to true is an acknowledgement
		 * passed to DataTables (settings this parameter to true is an acknowledgement
		 * that you understand this). `destroy` can be used to reinitialise a table if
		 * you need.
		 *  @type boolean
@ -9999,7 +9999,7 @@
		/**
		 * This function allows you to 'post process' each row after it have been
		 * generated for each table draw, but before it is rendered on screen. This
		 * function might be used for setting the row class name etc.
		 * function might be used for settings the row class name etc.
		 *  @type function
		 *  @param {node} row "TR" element for the current row
		 *  @param {array} data Raw data array for this row
@ -10317,7 +10317,7 @@
		/**
		 * Number of rows to display on a single page when using pagination. If
		 * feature enabled (`lengthChange`) then the end user will be able to override
		 * this to a custom setting using a pop-up menu.
		 * this to a custom settings using a pop-up menu.
		 *  @type int
		 *  @default 10
		 *
@ -11396,7 +11396,7 @@
		 *    * Parameters:
		 *      * `{array|object}` The data source for the row
		 *      * `{string}` The type call data requested - this will be 'set' when
		 *        setting data or 'filter', 'display', 'type', 'sort' or undefined
		 *        settings data or 'filter', 'display', 'type', 'sort' or undefined
		 *        when gathering data. Note that when `undefined` is given for the
		 *        type DataTables expects to get the raw data for the object back<
		 *      * `{*}` Data to set when the second parameter is 'set'.
@ -12675,7 +12675,7 @@
		 * Server-side processing - number of records in the result set
		 * (i.e. before filtering), Use fnRecordsTotal rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type int
		 *  @default 0
		 *  @private
@ -12686,7 +12686,7 @@
		 * Server-side processing - number of records in the current display set
		 * (i.e. after filtering). Use fnRecordsDisplay rather than
		 * this property to get the value of the number of records, regardless of
		 * the server-side processing setting.
		 * the server-side processing settings.
		 *  @type boolean
		 *  @default 0
		 *  @private

+ 2 - 2
svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/datapicker/bootstrap-datepicker.js

@ -649,11 +649,11 @@
				this.viewDate = new Date(this.o.endDate);
			if (fromArgs){
				// setting date by clicking
				// settings date by clicking
				this.setValue();
			}
			else if (dates.length){
				// setting date by typing
				// settings date by typing
				if (String(oldDates) !== String(this.dates))
					this._trigger('changeDate');
			}

+ 1 - 1
svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/flot/jquery.flot.js

@ -63,7 +63,7 @@
                    inverseTransform: null, // if transform is set, this should be the inverse function
                    min: null, // min. value to show, null means set automatically
                    max: null, // max. value to show, null means set automatically
                    autoscaleMargin: null, // margin in % to add if auto-setting min/max
                    autoscaleMargin: null, // margin in % to add if auto-settings min/max
                    ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
                    tickFormatter: null, // fn: number -> string
                    labelWidth: null, // size of tick labels in pixels

+ 1 - 1
svr/svr-manage/src/main/resources/webapp/hplus/js/plugins/treeview/bootstrap-treeview.js

@ -178,7 +178,7 @@
		},
		// On initialization recurses the entire tree structure 
		// setting expanded / collapsed states based on initial levels
		// settings expanded / collapsed states based on initial levels
		_setInitialLevels: function(nodes, level) {
			if (!nodes) { return; }

+ 13 - 2
svr/svr-patient/sql/sql

@ -40,7 +40,6 @@ create table `feedback`
  `id` int(11) NOT NULL AUTO_INCREMENT  COMMENT '表id,自增长',
  `type` varchar(1) DEFAULT NULL COMMENT '问题类型(功能异常-无法使用功能,功能优化-不好用、界面难看,新功能建议-你希望有什么功能,其他-其他任何问题)',
  `feedback_content` varchar(100) not null COMMENT '反馈内容,问题和建议',
  `answer` varchar(500) not null COMMENT '问题回答',
  `img` varchar(1000) not null COMMENT '图片,存图片地址,逗号分割',
  `mobile` varchar(11) not null COMMENT '联系手机号码',
  primary key (id)
@ -97,4 +96,16 @@ CREATE TABLE `base_patient_family_member` (
  `create_user_name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fmaily_member_patient` (`patient`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民家庭成员表';
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民家庭成员表';
-- 居民表多余字段删除
alter table base_patient drop column ssc;
alter table base_patient drop column disease;
alter table base_patient drop column disease_condition;
alter table base_patient drop column principal_code;
alter table base_patient drop column sicard_status;
alter table base_patient drop column sicard_time;
alter table base_patient drop column is_wxtag;
alter table base_patient drop column wxtagid;
alter table base_patient drop column medicare_number;

+ 4 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientApplyLogDao.java

@ -1,12 +1,13 @@
package com.yihu.jw.patient.dao.myFamily;
import com.sun.tools.javac.util.List;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
/**
 * @author liuwenbin on 2018/11/30.
 */
@ -22,4 +23,6 @@ public interface PatientApplyLogDao extends PagingAndSortingRepository<PatientAp
    @Query("update PatientApplyLog t set t.status = ?1 where t.id=?2 ")
    int updateStatusById(Integer status,Integer id);
    @Query("select l from PatientApplyLog l where l.createUser=?1 and l.familyMemberCode=?2 and l.del=1 and l.status in(1,2) and l.failureTime>=?3 and l.familyBindRole=?4")
    PatientApplyLog findValidOne(String createUser,String familyMemberCode,Date failureTime,Integer familyBindRole);
}

+ 12 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientFamilyMemberDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.patient.dao.myFamily;
import com.yihu.jw.entity.base.patient.BasePatientFamilyMemberDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -27,6 +28,16 @@ public interface PatientFamilyMemberDao extends PagingAndSortingRepository<BaseP
    @Query("select m from BasePatientFamilyMemberDO m where m.del=1 and m.familyMember=?1 and m.familyRelation in (?2,?3)")
    List<BasePatientFamilyMemberDO> getByFamilyMemberAndFamilyRelation(String familyMember,Integer familyRelation1,Integer familyRelation2);
    @Query("select m from BasePatientFamilyMemberDO m where m.del=1 and (m.familyMember=?1 or m.patient=?1)")
    @Query("select m from BasePatientFamilyMemberDO m where m.del=1 and m.patient=?1")
    List<BasePatientFamilyMemberDO> getByPatientAndFamilyMember(String patient);
    @Modifying
    @Query("update BasePatientFamilyMemberDO m set m.isAuthorize = ?1 where m.id=?2 ")
    int updateAuthorizeById(Integer isAuthorize,String id);
    @Modifying
    @Query("update BasePatientFamilyMemberDO m set m.del = ?1 where m.id=?2 ")
    int updateDelById(Integer del,String id);
    BasePatientFamilyMemberDO findByPatientAndFamilyMemberAndDel(String patient,String familyMember,Integer del);
}

+ 0 - 11
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/PatientDao.java

@ -16,15 +16,4 @@ import java.util.Map;
public interface PatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<BasePatientDO> {
    BasePatientDO findByIdAndDel(String id, String del);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    List<Map<String,Object>> findByIdcard(String idcard, Pageable pageable);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where name like ?1")
    List<Map<String,Object>> findByName(String name, Pageable pageable);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO")
    List<Map<String,Object>> findBaseInfo(Pageable pageable);
}

+ 0 - 14
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/security/RSADao.java

@ -1,14 +0,0 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.jw.patient.dao.security;
import com.yihu.jw.entity.base.security.RSA;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface RSADao extends PagingAndSortingRepository<RSA, String>, JpaSpecificationExecutor<String> {
	
}

+ 7 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/HelpCenterDao.java

@ -4,6 +4,8 @@ import com.yihu.jw.entity.base.patient.HelpCenterDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 
@ -18,4 +20,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @since 1.
 */
public interface HelpCenterDao extends PagingAndSortingRepository<HelpCenterDO, Integer>, JpaSpecificationExecutor<HelpCenterDO>  {
    List<HelpCenterDO> findByParentType(String parentType);
    HelpCenterDO findByParentTypeAndType(String parentType,String type);
}

+ 18 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/config/UrlconfigEndPoint.java

@ -0,0 +1,18 @@
package com.yihu.jw.patient.endpoint.config;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Trick on 2018/12/10.
 */
@RestController
@RequestMapping(PatientRequestMapping.open.openUrl)
@Api(tags = "开发接口", description = "开发接口")
public class UrlconfigEndPoint extends EnvelopRestEndpoint {
}

+ 109 - 17
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java

@ -1,7 +1,5 @@
package com.yihu.jw.patient.endpoint.myFamily;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.service.myFamily.MyFamilyService;
import com.yihu.jw.patient.service.personal_Info.PatientService;
import com.yihu.jw.restmodel.web.Envelop;
@ -13,7 +11,6 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@ -65,14 +62,12 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    public Envelop bindingMyFamily(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole) throws Exception {
        try{
            PatientApplyLog patientApplyLog = myFamilyService.bindingMyFamily(request,wechatId, getUID(patient), familyMobile, 1,familyBindRole);
            Map<String,Object> patientApplyLog = myFamilyService.bindingMyFamily( getUID(patient), familyMobile, 1,familyBindRole,null,null,null);
            return success(patientApplyLog);
        }catch (Exception e){
            e.printStackTrace();
@ -85,16 +80,13 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    public Envelop createFamilyQrCode(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole) throws Exception {
        try{
            BasePatientDO familyPatient = patientService.findByMobileAndDel(familyMobile);
            PatientApplyLog patientApplyLog = myFamilyService.createFamilyQrCode(request,familyPatient,wechatId, getUID(patient),familyBindRole);
            return success(patientApplyLog.getQrCode());
            Map<String,Object> resultMap = myFamilyService.createFamilyQrCode(wechatId, getUID(patient),familyBindRole);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
@ -118,7 +110,7 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.applyMessageList)
    @ApiOperation(value = "有效的申请绑定消息")
    @ApiOperation(value = "家人登录后,弹出绑定邀请窗口")
    public Envelop applyMessageList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient) throws Exception {
@ -139,10 +131,33 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "status", value = "3、通过,4、拒绝", required = true)
            @RequestParam(value = "status",required = true) Integer status,
            @ApiParam(name = "isAuthorize", value = "0:未授权,1:已授权", required = true)
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize) throws Exception {
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize,
            @ApiParam(name = "messageId", value = "messageId", required = true)
            @RequestParam(value = "messageId",required = true) Integer messageId) throws Exception {
        try{
            myFamilyService.confirmApply(patientApplyLogId,status,isAuthorize);
            return success();
            return success(myFamilyService.confirmApply(patientApplyLogId,status,isAuthorize,messageId));
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.scanQRcodeConfirmApply)
    @ApiOperation(value = "扫码绑定确认")
    public Envelop scanQRcodeConfirmApply(
            @ApiParam(name = "applyPatient", value = "申请人code", required = true)
            @RequestParam(value = "applyPatient",required = true) String applyPatient,
            @ApiParam(name = "familyPatient", value = "家人code", required = false)
            @RequestParam(value = "familyPatient",required = false) String familyPatient,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,
            @ApiParam(name = "isAuthorize", value = "0:未授权,1:已授权", required = true)
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize,
            @ApiParam(name = "status", value = "3、通过,4、拒绝", required = true)
            @RequestParam(value = "status",required = true) Integer status) throws Exception {
        try{
            Map<String,Object> resultMap = myFamilyService.scanQRcodeConfirmApply(status,applyPatient,getUID(familyPatient),familyBindRole,isAuthorize);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
@ -162,6 +177,7 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.myFamilyBindList)
    @ApiOperation(value = "我绑定的记录")
    public Envelop myFamilyBindList(
@ -176,4 +192,80 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.scanQRcode)
    @ApiOperation(value = "扫码到确认绑定页面")
    public Envelop scanQRcode(
            @ApiParam(name = "applyPatient", value = "申请人code", required = true)
            @RequestParam(value = "applyPatient",required = true) String applyPatient,
            @ApiParam(name = "familyPatient", value = "家人code", required = false)
            @RequestParam(value = "familyPatient",required = false) String familyPatient,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole) throws Exception {
        try{
            Map<String,Object> resultMap = myFamilyService.scanQRcode(applyPatient,getUID(familyPatient),familyBindRole);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.messageToBinding)
    @ApiOperation(value = "消息到确认绑定页面")
    public Envelop messageToBinding(
            @ApiParam(name = "messageId", value = "消息的id", required = true)
            @RequestParam(value = "messageId",required = true) Integer messageId) throws Exception {
        try{
            Map<String,Object> resultMap = myFamilyService.messageToBinding(messageId);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.cancelBindFamily)
    @ApiOperation(value = "解除绑定家人")
    public Envelop cancelBindFamily(
            @ApiParam(name = "familyMemberId", value = "familyMemberId", required = true)
            @RequestParam(value = "familyMemberId",required = true) String familyMemberId) throws Exception {
        try{
            myFamilyService.cancelBindFamily(familyMemberId);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.updateAuthorizeById)
    @ApiOperation(value = "更新代管授权")
    public Envelop updateAuthorizeById(
            @ApiParam(name = "isAuthorize", value = "0:未授权,1:已授权", required = true)
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize,
            @ApiParam(name = "familyMemberId", value = "familyMemberId", required = true)
            @RequestParam(value = "familyMemberId",required = true) String familyMemberId) throws Exception {
        try{
            myFamilyService.updateAuthorizeById(isAuthorize,familyMemberId);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.nonageByIdcard)
    @ApiOperation(value = "根据身份判断是否未成年 1成年,2未成年")
    public Envelop nonageByIdcard(
            @ApiParam(name = "idcard", value = "身份证", required = true)
            @RequestParam(value = "idcard",required = true) String idcard) throws Exception {
        try{
            Integer resultMap = myFamilyService.nonageByIdcard(idcard);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
}

+ 65 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myMessage/MyMessageEndpoint.java

@ -0,0 +1,65 @@
package com.yihu.jw.patient.endpoint.myMessage;
import com.yihu.jw.patient.service.message.MyDoctorListService;
import com.yihu.jw.patient.service.message.MyMessageService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * @author liuwenbin on 2018/12/10.
 */
@RestController
@RequestMapping(PatientRequestMapping.MyMessage.PREFIX)
@Api(value = "居民的我的消息模块", description = "居民的我的消息模块", tags = {"居民端 - 我的消息"})
public class MyMessageEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private MyMessageService myMessageService;
    @Autowired
    private MyDoctorListService myDoctorListService;
    @GetMapping(value = PatientRequestMapping.MyMessage.messageList)
    @ApiOperation(value = "获取我的消息列表")
    public Envelop messageList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "page", value = "页码,从第一页开始", required = true)
            @RequestParam(value = "page",required = true) Integer page,
            @ApiParam(name = "pageSize", value = "每页总数", required = true)
            @RequestParam(value = "pageSize",required = true) Integer pageSize) throws Exception {
        try{
            List<Map<String,Object>> messageList = myMessageService.messageList(getUID(patient),page,pageSize);
            return success(messageList);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyMessage.myDoctorList)
    @ApiOperation(value = "获取医生通讯录")
    public Envelop myDoctorList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "condition", value = "搜索条件,医生姓名/医院", required = false)
            @RequestParam(value = "condition",required = false) String condition) throws Exception {
        try{
            Map<String,Object> messageMap = myDoctorListService.myDoctorList(getUID(patient),condition);
            return success(messageMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
}

+ 35 - 46
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java

@ -1,14 +1,10 @@
package com.yihu.jw.patient.endpoint.personal_info;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.security.Token;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.personal_Info.PatientService;
import com.yihu.jw.patient.util.CommonUtils;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.patient.util.RSAService;
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
import com.yihu.jw.restmodel.base.sms.SmsVO;
import com.yihu.jw.restmodel.web.Envelop;
@ -17,17 +13,13 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.security.service.TokenService;
import com.yihu.jw.sms.service.BaseSmsGatewayService;
import com.yihu.jw.sms.service.BaseSmsService;
import com.yihu.jw.util.security.MD5;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -57,52 +49,17 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseSmsGatewayService baseSmsGatewayService;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private RSAService rsaService;
    @Autowired
    private TokenService tokenService;
    @Autowired
    private BaseSmsService baseSmsService;
    /**
     * 公钥生成并返回接口
     *
     * @return
     */
    @RequestMapping(value = BaseRequestMapping.BasePatient.GetKey, method = RequestMethod.GET)
    @ApiOperation("获取公钥")
    public Envelop publicKey() {
        String modulus = rsaService.getModulus();
        String exponent = rsaService.getExponent();
        Map<String, String> map = new HashMap<>();
        map.put("modulus", modulus); //加密指数
        map.put("exponent", exponent);//加密系数
        return success(map);
    }
    @ApiOperation("居民注册接口")
    @RequestMapping(value = BaseRequestMapping.BasePatient.Regist, method = RequestMethod.POST)
    @ResponseBody
    public Envelop regist(@ApiParam(value = "手机号", name = "mobile") @RequestParam(required = true) String mobile,
    public ObjEnvelop regist(@ApiParam(value = "手机号", name = "mobile") @RequestParam(required = true) String mobile,
                          @ApiParam(value = "验证码", name = "captcha") @RequestParam(value = "captcha", required = true) String captcha,
                          @ApiParam(value = "微信openId", name = "openid") @RequestParam(value = "openid", required = false) String openid,
                          @ApiParam(value = "密码", name = "password") @RequestParam(value = "password", required = false) String password) {
        Envelop envelop = new Envelop();
        ObjEnvelop envelop = new ObjEnvelop();
        Map<String, Object> result = patientService.regist(mobile, captcha, password, openid);
        if ("-1".equals(result.get("code"))) {
            envelop.setStatus(-1);
            envelop.setMessage(result.get("message") + "");
        } else {
            envelop.setStatus(200);
            envelop.setMessage(result.get("message") + "");
        }
        envelop.setObj(result);
        return envelop;
    }
@ -215,6 +172,19 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        return success(patientService.resetPassword(id, password));
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.ForgetPwd)
    @ApiOperation(value = "通过验证码重置密码")
    public ObjEnvelop forgetPws(@ApiParam(name = "mobile", value = "手机号", required = true) @RequestParam String mobile,
                            @ApiParam(name = "password", value = "密码", required = true) @RequestParam String password,
                            @ApiParam(name = "captcha", value = "验证码", required = true) @RequestParam String captcha) throws Exception {
        ObjEnvelop envelop = new ObjEnvelop();
        Map<String, Object> result = patientService.forget(mobile, password,captcha);
        envelop.setObj(result);
        return envelop;
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.getCompletedInfo)
    @ApiOperation(value = "查询完善后信息详情")
    public ObjEnvelop<BasePatientVO> getCompletedInfo(
@ -234,4 +204,23 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        return success(smsDO, SmsVO.class);
    }
    @GetMapping(value = "bespeakRegist")
    @ApiOperation(value = "预注册测试接口")
    public Envelop bespeakRegist(
            @ApiParam(name = "mobile", value = "手机号")
            @RequestParam(value = "mobile", required = true) String mobile,
            @ApiParam(name = "name", value = "居民名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "idcard", value = "居民身份证")
            @RequestParam(value = "idcard", required = false) String idcard) throws Exception {
        Map<String, Object> map = patientService.bespeakRegist(mobile,name,idcard, 2L);
        Envelop envelop = new Envelop();
        String code = map.get("code").toString();
        String message = map.get("message").toString();
        System.out.println("code====>>"+code);
        System.out.println("message====>>"+message);
        return envelop;
    }
}

+ 35 - 13
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientMedicareCardEndpoint.java

@ -1,5 +1,7 @@
package com.yihu.jw.patient.endpoint.personal_info;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.service.personal_Info.PatientMedicareCardService;
import com.yihu.jw.restmodel.base.patient.PatientMedicareCardVO;
@ -42,8 +44,8 @@ public class PatientMedicareCardEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "id", value = "居民id", required = true) @RequestParam String id,
            @ApiParam(name = "idcard", value = "居民身份证号", required = true) @RequestParam String idcard,
            @ApiParam(name = "cardNumber", value = "医保卡号", required = true) @RequestParam String cardNumber,
     @ApiParam(name = "pssword", value = "密码", required = true) @RequestParam String pssword) throws Exception {
        patientMedicareCardService.bindMedicareCard(id,idcard,cardNumber,pssword);
            @ApiParam(name = "cityCode", value = "城市code", required = true) @RequestParam String cityCode) throws Exception {
        patientMedicareCardService.bindMedicareCard(id,idcard,cardNumber,cityCode);
        return success("success");
    }
@ -68,20 +70,10 @@ public class PatientMedicareCardEndpoint extends EnvelopRestEndpoint {
        return success("success");
    }
    @PostMapping(value = BaseRequestMapping.PatientMedicareCard.bindSocialSecurityCard)
    @ApiOperation(value = "绑定电子社保卡")
    public Envelop bindSocialSecurityCard(
            @ApiParam(name = "id", value = "居民id", required = true) @RequestParam String id,
            @ApiParam(name = "idcard", value = "居民身份证号", required = true) @RequestParam String idcard) throws Exception {
        patientMedicareCardService.bindSocialSecurityCard(id,idcard);
        return success("success");
    }
    @PostMapping(value = BaseRequestMapping.PatientMedicareCard.unBindCard)
    @ApiOperation(value = "解除绑定卡")
    public Envelop unBindCard(
            @ApiParam(name = "cardId", value = "卡片id", required = true) @RequestParam String cardId) throws Exception {
            @ApiParam(name = "cardId", value = "卡片id", required = true) @RequestParam Integer cardId) throws Exception {
        patientMedicareCardService.unBindCard(cardId);
        return success("success");
    }
@ -128,5 +120,35 @@ public class PatientMedicareCardEndpoint extends EnvelopRestEndpoint {
        return success(patientMedicareCards, PatientMedicareCardVO.class);
    }
    @GetMapping(value = BaseRequestMapping.PatientMedicareCard.cardList)
    @ApiOperation(value = "获取卡列表")
    public ListEnvelop cardlist(@ApiParam(name = "id", value = "居民id")
                                @RequestParam(value = "id", required = false) String id) throws Exception {
        List cards = patientMedicareCardService.queryCardList(id);
        return success(cards);
    }
    @GetMapping(value = BaseRequestMapping.PatientMedicareCard.cardOrgList)
    @ApiOperation(value = "获取可绑定卡的医院字母A-Z排序")
    public Envelop cardOrglist(@ApiParam(name = "saasid", value = "租户id")
                                   @RequestParam(value = "saasid", required = false) String saasid) throws Exception {
        JSONObject orgObj = patientMedicareCardService.queryOrgSortedList(saasid);
        return success(orgObj);
    }
    @GetMapping(value = BaseRequestMapping.PatientMedicareCard.sortProList)
    @ApiOperation(value = "获取省份字母A-Z排序")
    public Envelop sortProvincelist() throws Exception {
        JSONObject orgObj = patientMedicareCardService.queryProvinceSortedList();
        return success(orgObj);
    }
    @GetMapping(value = BaseRequestMapping.PatientMedicareCard.sortCityList)
    @ApiOperation(value = "获取(某省份下)城市字母A-Z排序,不传省份取所有城市")
    public Envelop sortCitylist(@ApiParam(name = "provinceCode", value = "省份代码")
                                   @RequestParam(value = "provinceCode", required = false) String provinceCode) throws Exception {
        JSONObject orgObj = patientMedicareCardService.queryCitySortedList(provinceCode);
        return success(orgObj);
    }
}

+ 67 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java

@ -2,15 +2,20 @@ package com.yihu.jw.patient.endpoint.servicepackage;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.label.PatientLabelDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.patient.service.servicepackage.PackageService;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorHospitalVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorSimpleVO;
import com.yihu.jw.restmodel.base.label.BasePatientLabelVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageRecordVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -45,11 +50,13 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "labelCode", required = false)String labelCode,
                                         @ApiParam(name = "labelType", value = "标签类型")
                                         @RequestParam(value = "labelType", required = false)String labelType,
                                         @ApiParam(name = "patient", value = "居民code(判断居民是否签约,非必传)")
                                         @RequestParam(value = "patient", required = false)String patient,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return packageService.findPackageService(city,labelCode,labelType,page,size);
        return packageService.findPackageService(city,labelCode,labelType,patient,page,size);
    }
@ -101,12 +108,42 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return packageService.signPackage(recordDO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.signPackageAndFamily)
    @ApiOperation(value = "绑定家人,签约服务包", notes = "绑定家人,签约服务包")
    public Envelop signPackageAndFamily(@ApiParam(name = "recordJson", value = "签约实体")
                                        @RequestParam(value = "recordJson", required = true)String recordJson,
                                        @ApiParam(name = "patient", value = "申请绑定的居民code")
                                        @RequestParam(value = "patient", required = true)String patient,
                                        @ApiParam(name = "familyName", value = "申请绑定的家人的名称")
                                        @RequestParam(value = "familyName", required = false)String familyName,
                                        @ApiParam(name = "principalNum", value = "医社保号")
                                        @RequestParam(value = "principalNum", required = false)String principalNum,
                                        @ApiParam(name = "idcard", value = "身份证号")
                                        @RequestParam(value = "idcard", required = false)String idcard,
                                        @ApiParam(name = "familyMobile", value = "家人的手机号码")
                                        @RequestParam(value = "familyMobile", required = true)String familyMobile,
                                        @ApiParam(name = "platform", value = "消息平台,1微信端/患者端,2医生APP端")
                                        @RequestParam(value = "platform", required = true)Integer platform,
                                        @ApiParam(name = "familyBindRole", value = "1\"配偶\",2\"父亲\",3\"母亲\",4\"公公\",5\"婆婆\",6\"岳父\",7\"岳母\",8\"女婿\",9\"儿媳\",10\"子女\"")
                                        @RequestParam(value = "familyBindRole", required = true)Integer familyBindRole,
                                        @ApiParam(name = "isAdult", value = "0未成年人 1成年人")
                                        @RequestParam(value = "isAdult", required = true)Integer isAdult) throws Exception {
        ServicePackageSignRecordDO recordDO = toEntity(recordJson, ServicePackageSignRecordDO.class);
        return packageService.signPackageAndFamily(recordDO,patient,familyMobile,platform,familyBindRole,isAdult,familyName,principalNum,idcard);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findDoctorById)
    @ApiOperation(value = "获取医生基础信息", notes = "获取医生基础信息")
    public ObjEnvelop<BaseDoctorSimpleVO> findDoctorById(@ApiParam(name = "doctorCode", value = "医生code")
                                                         @RequestParam(value = "doctorCode", required = true)String doctorCode) {
        BaseDoctorDO baseDoctorDO = packageService.findDoctorById(doctorCode);
        BaseDoctorSimpleVO baseDoctorSimpleVO = convertToModel(baseDoctorDO,BaseDoctorSimpleVO.class);
        List<BaseDoctorHospitalDO> baseDoctorHospitalDOs = packageService.findDoctorHospital(doctorCode);
        List<BaseDoctorHospitalVO> baseDoctorHospitalVOs = new ArrayList<>();
        convertToModels(baseDoctorHospitalDOs,baseDoctorHospitalVOs,BaseDoctorHospitalVO.class);
        baseDoctorSimpleVO.setHospitalVOs(baseDoctorHospitalVOs);
        return success(PatientRequestMapping.SignPackage.api_success,baseDoctorSimpleVO);
    }
@ -132,5 +169,34 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return success(PatientRequestMapping.SignPackage.api_success,packageService.findPatientSignExist(patient,packageId));
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findPatientSignPackage)
    @ApiOperation(value = "签约记录", notes = "签约记录")
    public MixEnvelop findPatientSignPackage(@ApiParam(name = "label", value = "标签code") @RequestParam(value = "label", required = false)String label,
                                             @ApiParam(name = "labelType", value = "标签类型") @RequestParam(value = "labelType", required = false)String labelType,
                                             @ApiParam(name = "patient", value = "签约人") @RequestParam(value = "patient", required = false)String patient,
                                             @ApiParam(name = "operator", value = "创建人") @RequestParam(value = "operator", required = false)String operator,
                                             @ApiParam(name = "familyModel", value = "关系模式,1:查询自己;2:查询家人(未经授权);3:查询家人且授权") @RequestParam(value = "familyModel", required = true)String familyModel,
                                             @ApiParam(name = "status", value = "状态:0待审核,1已同意,待支付,2.支付成功,已生效,-1未通过,-2已取消,-3已过期") @RequestParam(value = "status", required = false)Integer status,
                                             @ApiParam(name = "isHos", value = "是否查询历史记录,1为查询历史,不传为当前记录") @RequestParam(value = "isHos", required = false)String isHos,
                                             @ApiParam(name = "page", value = "第几页") @RequestParam(value = "page", required = true)Integer page,
                                             @ApiParam(name = "size", value = "每页大小") @RequestParam(value = "size", required = true)Integer size) {
        return packageService.findPatientSignPackage( label, labelType, patient, operator, familyModel, status, isHos,  page, size);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findLabelByLabelType)
    @ApiOperation(value = "获取标签", notes = "获取标签")
    public MixEnvelop<BasePatientLabelVO,BasePatientLabelVO> findLabelByLabelType(@ApiParam(name = "labelType", value = "标签类型") @RequestParam(value = "labelType", required = false)String labelType) {
        List<PatientLabelDO> list = packageService.findLabelByLabelType(labelType);
        List<BasePatientLabelVO> basePatientLabelVOs = new ArrayList<>();
        convertToModels(list,basePatientLabelVOs,BasePatientLabelVO.class);
        return MixEnvelop.getSuccess(PatientRequestMapping.SignPackage.api_success,basePatientLabelVOs);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findSingleSignPackageById)
    @ApiOperation(value = "根据签约id获取签约详情", notes = "根据签约id获取签约详情")
    public ObjEnvelop<ServicePackageRecordVO> findSingleSignPackageById(@ApiParam(name = "signId", value = "签约id") @RequestParam(value = "signId", required = false)String signId) {
        return success(PatientRequestMapping.SignPackage.api_success,packageService.findSingleSignPackageById(signId));
    }
//=================================
}

+ 2 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java

@ -42,8 +42,8 @@ public class AccountAppealEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<AccountAppealVO> create(
            @ApiParam(name = "type", value = "申诉类型", required = true)
            @RequestParam AccountAppealDO.Type type,
            @ApiParam(name = "images", value = "申诉证件照", required = true)
            @RequestParam List<MultipartFile> images,
            @ApiParam(name = "images", value = "申诉证件照", required = false)
            @RequestParam(required = false) List<MultipartFile> images,
            @ApiParam(name = "mobile", value = "申诉手机号", required = true)
            @RequestParam String mobile,
            @ApiParam(name = "name", value = "申诉人姓名", required = true)

+ 2 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/FeedbackEndpoint.java

@ -44,8 +44,8 @@ public class FeedbackEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<FeedbackVO> create(
            @ApiParam(name = "type", value = "反馈类型", required = true)
            @RequestParam FeedbackDO.Type type,
            @ApiParam(name = "images", value = "反馈图片", required = true)
            @RequestParam List<MultipartFile> images,
            @ApiParam(name = "images", value = "反馈图片", required = false)
            @RequestParam(required = false) List<MultipartFile> images,
            @ApiParam(name = "mobile", value = "反馈手机号", required = true)
            @RequestParam String mobile,
            @ApiParam(name = "content", value = "反馈内容", required = true)

+ 65 - 46
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/HelpCenterEndpoint.java

@ -14,64 +14,63 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
* 帮助中心控制器
*
* @version
* <pre>
 * 帮助中心控制器
 *
 * @version <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
* @since 1.
*/
 * @since 1.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.HelpCenter.PREFIX)
@Api(value = "帮助中心管理", description = "帮助中心管理服务接口", tags = {"帮助中心管理服务接口"})
public class HelpCenterEndpoint extends EnvelopRestEndpoint {
@Autowired
private HelpCenterService helpCenterService;
    @Autowired
    private HelpCenterService helpCenterService;
@PostMapping(value = BaseRequestMapping.HelpCenter.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<HelpCenterVO> create (
    @ApiParam(name = "jsonData", value = "Json数据", required = true)
    @RequestParam String jsonData) throws Exception {
    HelpCenterDO helpCenter = toEntity(jsonData, HelpCenterDO.class);
    helpCenter = helpCenterService.save(helpCenter);
    return success(helpCenter, HelpCenterVO.class);
    @PostMapping(value = BaseRequestMapping.HelpCenter.CREATE)
    @ApiOperation(value = "创建")
    public ObjEnvelop<HelpCenterVO> create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        HelpCenterDO helpCenter = toEntity(jsonData, HelpCenterDO.class);
        helpCenter = helpCenterService.save(helpCenter);
        return success(helpCenter, HelpCenterVO.class);
    }
    @PostMapping(value = BaseRequestMapping.HelpCenter.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    helpCenterService.delete(ids.split(","));
    return success("删除成功");
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        helpCenterService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.HelpCenter.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<HelpCenterVO> update (
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam String jsonData) throws Exception {
    public ObjEnvelop<HelpCenterVO> update(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        HelpCenterDO helpCenter = toEntity(jsonData, HelpCenterDO.class);
        if (null == helpCenter.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
            return failed("ID不能为空", ObjEnvelop.class);
        }
        helpCenter = helpCenterService.save(helpCenter);
        return success(helpCenter, HelpCenterVO.class);
        }
    }
        @GetMapping(value = BaseRequestMapping.HelpCenter.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<HelpCenterVO> page (
    @GetMapping(value = BaseRequestMapping.HelpCenter.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<HelpCenterVO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
@ -82,22 +81,42 @@ public ObjEnvelop<HelpCenterVO> create (
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts, page, size);
                int count = (int)helpCenterService.getCount(filters);
                return success(helpCenters, count, page, size, HelpCenterVO.class);
         }
        List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts, page, size);
        int count = (int) helpCenterService.getCount(filters);
        return success(helpCenters, count, page, size, HelpCenterVO.class);
    }
    @GetMapping(value = BaseRequestMapping.HelpCenter.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<HelpCenterVO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts);
        return success(helpCenters, HelpCenterVO.class);
    }
    @GetMapping(value = BaseRequestMapping.HelpCenter.getAnswerByType)
    @ApiOperation(value = "获取答案")
    public ListEnvelop getAnswerByType(
            @ApiParam(name = "parentType", value = "问题大类,(大类小类均为空取默认所有大类问题描述列表)")
            @RequestParam(value = "parentType", required = false) String parentType,
            @ApiParam(name = "type", value = "问题小类")
            @RequestParam(value = "type", required = false) String type) throws Exception {
        return success(helpCenterService.getAnswerByType(parentType, type));
    }
         @GetMapping(value = BaseRequestMapping.HelpCenter.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<HelpCenterVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts);
                  return success(helpCenters, HelpCenterVO.class);
         }
    @GetMapping(value = BaseRequestMapping.HelpCenter.commentAnswer)
    @ApiOperation(value = "反馈问题答案")
    public Envelop commentAnswer(
            @ApiParam(name = "questionId", value = "问题id")
            @RequestParam(value = "questionId", required = true) int questionId,
            @ApiParam(name = "usefulOrNot", value = "是否有用,true-有用,false-无用")
            @RequestParam(value = "usefulOrNot", required = true) boolean usefulOrNot) throws Exception {
        return success(helpCenterService.commentAnswer(questionId, usefulOrNot));
    }
 }
}

+ 57 - 20
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatEndPoint.java

@ -1,5 +1,6 @@
package com.yihu.jw.patient.endpoint.wechat;
import com.sun.net.httpserver.Authenticator;
import com.yihu.jw.entity.base.wx.JsApiTicket;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.restmodel.web.Envelop;
@ -7,15 +8,20 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.service.WechatInfoService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.wechat.service.WxUrlConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.security.MessageDigest;
@ -28,42 +34,73 @@ import java.util.UUID;
 */
@Controller
@RequestMapping(value = PatientRequestMapping.Wechat.wxBase)
@Api(value = "微信相关操作", description = "微信相关操作", tags = {"居民端 - 微信相关操作"})
public class WechatEndPoint extends EnvelopRestEndpoint {
@Api(value = "获取微信基础信息等操作", description = "获取微信基础信息等操作", tags = {"居民端 - 获取微信基础信息等操作"})
public class WechatInfoEndPoint extends EnvelopRestEndpoint {
    private static Logger logger = LoggerFactory.getLogger(WechatEndPoint.class);
    private static Logger logger = LoggerFactory.getLogger(WechatInfoEndPoint.class);
    @Autowired
    private WxAccessTokenService wxAccessTokenService;
    @Autowired
    private WechatInfoService wechatInfoService;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private WxUrlConfigService wxUrlConfigService;
    @RequestMapping(value =  PatientRequestMapping.Wechat.getWxWechatConfig, method = RequestMethod.GET)
    @ResponseBody
    public ObjEnvelop<Map<String,Object>> getWxWechatConfig(@ApiParam(name = "url", value = "域名地址")
                                                                @RequestParam(value = "url", required = true)String url){
        return success(PatientRequestMapping.Wechat.api_success,wxUrlConfigService.getWxWechatConfig(url));
    }
    /**
     * 获取签名signature
     *
     * @param pageUrl 需要签名的页面全地址(?后的也需要除了#后的不需要)
     * @return
     */
    @RequestMapping(value = "getSign", method = RequestMethod.POST)
    @RequestMapping(value = PatientRequestMapping.Wechat.getSign, method = RequestMethod.POST)
    @ResponseBody
    public Envelop getSign(String pageUrl,String wxId) {
    public Envelop getSign(@ApiParam(name = "pageUrl", value = "授权页面")
                           @RequestParam(value = "pageUrl", required = true)String pageUrl,
                           @ApiParam(name = "wxId", value = "微信id")
                           @RequestParam(value = "wxId", required = true)String wxId) {
        String ticket = getJsapi_ticketByToken(wxId);
            Map<Object, Object> map = new HashMap<Object, Object>();
            if (ticket != null) {
                String noncestr = UUID.randomUUID().toString();
                long timestamp = System.currentTimeMillis() / 1000;
                String url = pageUrl;
                String str = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
                // sha1加密
                String signature = SHA1(str);
                map.put("noncestr", noncestr);
                map.put("timestamp", timestamp);
                map.put("signature", signature);
                return success(PatientRequestMapping.Wechat.api_success,map);
            }
        Map<Object, Object> map = new HashMap<Object, Object>();
        if (ticket != null) {
            String noncestr = UUID.randomUUID().toString();
            long timestamp = System.currentTimeMillis() / 1000;
            String url = pageUrl;
            String str = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
            // sha1加密
            String signature = SHA1(str);
            map.put("noncestr", noncestr);
            map.put("timestamp", timestamp);
            map.put("signature", signature);
            return success(PatientRequestMapping.Wechat.api_success,map);
        }
        return failed(PatientRequestMapping.Wechat.api_error);
    }
    /**
     * 获取微信openid
     *
     * @param code
     * @return
     */
    @RequestMapping(value = "getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public String getOpenidByCode(String code) throws Exception {
        return wechatInfoService.getOpenidByCode(code,wxId);
    }
    /**
     * 获取微信的jsapi_ticket
     *

+ 68 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatPayController.java

@ -0,0 +1,68 @@
package com.yihu.jw.patient.endpoint.wechat;
import com.yihu.jw.patient.service.wechat.WechatPayService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
@Controller
@RequestMapping(value = PatientRequestMapping.WechatPay.PRE_URL)
@Api(value = "微信支付等相关接口", description = "微信支付等相关接口", tags = {"居民端 - 微信支付等相关接口"})
public class WechatPayController extends EnvelopRestEndpoint {
    @Autowired
    private WechatPayService wechatPayService;
    @Value("${wechat.id}")
    private String wxId;
    @ApiOperation("服务包下单")
    @RequestMapping(value = "createPayOrder", method = RequestMethod.POST)
    @ResponseBody
    public Map<String, Object> unifiedorder(
                             @ApiParam(name = "wechatId", value = "wechatId", required = false)
                             @RequestParam(required = false)String wechatId,
                             @ApiParam(name = "openid", value = "openid", required = true)
                             @RequestParam(required = true)String openid,
                             @ApiParam(name = "ip", value = "终端IP(患者)", required = true)
                             @RequestParam(required = true)String ip,
                             @ApiParam(name = "orderId", value = "订单号[base_service_package_sign_record 的id字段用作与订单id]", required = true)
                             @RequestParam(required = true)String orderId) throws Exception {
        if(StringUtils.isNotBlank(wechatId)){
            wxId = wechatId;
        }
        return wechatPayService.unifiedorder(wxId, openid, ip, orderId);
    }
    @ResponseBody
    @ApiOperation("微信支付结果通知")
    @RequestMapping(value = PatientRequestMapping.WechatPay.Notify, method = {RequestMethod.GET, RequestMethod.POST})
    public Map<String, String> wxPayNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String result = "";
        String inputLine;
        while ((inputLine = request.getReader().readLine()) != null) {
            result += inputLine;
        }
        request.getReader().close();
        Map<String, String> map = wechatPayService.getWxPayResultNotify(result);
        return map;
    }
}

+ 11 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/exception/settings/HelpCenterQesNotFoundException.java

@ -0,0 +1,11 @@
package com.yihu.jw.patient.exception.settings;
/**
 * 帮助中心-《找不到问题》异常
 */
public class HelpCenterQesNotFoundException extends RuntimeException{
    public HelpCenterQesNotFoundException(String msg){
        super(msg);
    }
}

+ 0 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/message/MyDoctorListService.java


Some files were not shown because too many files changed in this diff