Browse Source

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

humingfen 6 years ago
parent
commit
76674ef870
100 changed files with 4251 additions and 539 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. 83 0
      business/base-service/pom.xml
  14. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseCityDao.java
  15. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseCommitteeDao.java
  16. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseProvinceDao.java
  17. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseStreetDao.java
  18. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseTownDao.java
  19. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseCityService.java
  20. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseCommitteeService.java
  21. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseProvinceService.java
  22. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseStreetService.java
  23. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseTownService.java
  24. 42 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/DictHospitalDeptDao.java
  25. 22 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java
  26. 23 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java
  27. 9 0
      business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadCallback.java
  28. 100 0
      business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadRunnable.java
  29. 192 0
      business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadService.java
  30. 15 0
      business/base-service/src/main/java/com/yihu/jw/label/PatientLabelDao.java
  31. 36 0
      business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java
  32. 216 0
      business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java
  33. 45 0
      business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java
  34. 21 9
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/BasePatientDao.java
  35. 44 0
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java
  36. 85 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientMedicardCardService.java
  37. 64 29
      svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/BasePatientService.java
  38. 16 0
      business/base-service/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java
  39. 12 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/JsapiTicketDao.java
  40. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WechatDao.java
  41. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxAccessTokenDao.java
  42. 15 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxPayLogDao.java
  43. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateConfigDao.java
  44. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateDao.java
  45. 13 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxUrlConfigDao.java
  46. 137 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WeChatQrcodeService.java
  47. 46 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java
  48. 189 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java
  49. 41 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxPayLogService.java
  50. 65 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxUrlConfigService.java
  51. 41 0
      business/sms-service/pom.xml
  52. 23 0
      business/sms-service/src/main/java/com/yihu/jw/sms/dao/BaseSmsDao.java
  53. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/sms/SmsGatewayDao.java
  54. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/sms/SmsTemplateDao.java
  55. 118 0
      business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsGatewayService.java
  56. 70 0
      business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsService.java
  57. 15 0
      business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsTemplateService.java
  58. 16 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ConstantUtils.java
  59. 5 0
      common/common-entity/pom.xml
  60. 78 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/label/PatientLabelDO.java
  61. 23 79
      common/common-entity/src/main/java/com/yihu/jw/entity/base/login/BaseLoginLogDO.java
  62. 22 36
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java
  63. 14 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/org/BaseOrgDO.java
  64. 124 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java
  65. 158 190
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  66. 11 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientFamilyMemberDO.java
  67. 94 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java
  68. 100 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java
  69. 142 37
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java
  70. 78 56
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  71. 56 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java
  72. 39 31
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  73. 18 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsTemplateDO.java
  74. 71 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/JsApiTicket.java
  75. 107 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxPayLogDO.java
  76. 33 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java
  77. 30 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxWechatDO.java
  78. 141 0
      common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java
  79. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FailedUploadFileException.java
  80. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FastfdsFileURLEmptyException.java
  81. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileInputStreamEmptyException.java
  82. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileNameEmptyException.java
  83. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileTooLargeSizeException.java
  84. 9 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileWrongFormatException.java
  85. 11 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/CapthcaInvalidException.java
  86. 11 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardAlreadyExistException.java
  87. 11 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardFormatInvalidException.java
  88. 11 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardNotFoundException.java
  89. 11 0
      common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientNotFoundException.java
  90. 56 2
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  91. 90 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
  92. 27 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/ResultStatus.java
  93. 14 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java
  94. 83 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorOrgVO.java
  95. 387 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java
  96. 74 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/label/BasePatientLabelVO.java
  97. 26 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/BaseOrgVO.java
  98. 56 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/OrgDistanceVO.java
  99. 104 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/AccountAppealVO.java
  100. 0 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/BasePatientVO.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);
    }
  }

+ 83 - 0
business/base-service/pom.xml

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>wlyy-lib-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>base-service</artifactId>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-util</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>
</project>

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseCityDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.area;
package com.yihu.jw.area.dao;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseCommitteeDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.area;
package com.yihu.jw.area.dao;
import com.yihu.jw.entity.base.area.BaseCommitteeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseProvinceDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.area;
package com.yihu.jw.area.dao;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseStreetDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.area;
package com.yihu.jw.area.dao;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/area/BaseTownDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.area;
package com.yihu.jw.area.dao;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseCityService.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.service.area;
package com.yihu.jw.area.service;
import com.yihu.jw.base.dao.area.BaseCityDao;
import com.yihu.jw.area.dao.BaseCityDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseCommitteeService.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.service.area;
package com.yihu.jw.area.service;
import com.yihu.jw.base.dao.area.BaseCommitteeDao;
import com.yihu.jw.area.dao.BaseCommitteeDao;
import com.yihu.jw.entity.base.area.BaseCommitteeDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseProvinceService.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.service.area;
package com.yihu.jw.area.service;
import com.yihu.jw.base.dao.area.BaseProvinceDao;
import com.yihu.jw.area.dao.BaseProvinceDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseStreetService.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.service.area;
package com.yihu.jw.area.service;
import com.yihu.jw.base.dao.area.BaseStreetDao;
import com.yihu.jw.area.dao.BaseStreetDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.area.BaseStreetDO;

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/area/BaseTownService.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.service.area;
package com.yihu.jw.area.service;
import com.yihu.jw.base.dao.area.BaseTownDao;
import com.yihu.jw.area.dao.BaseTownDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

+ 42 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/DictHospitalDeptDao.java

@ -0,0 +1,42 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import org.springframework.data.domain.Pageable;
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;
/**
 * 
 * 医院科室字典 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface DictHospitalDeptDao extends PagingAndSortingRepository<DictHospitalDeptDO, Integer>, JpaSpecificationExecutor<DictHospitalDeptDO>  {
    @Query("select code as code,name as name from DictHospitalDeptDO where orgCode in ?1")
    List<Map<String,Object>> findByOrgCodeIn(String orgCode, Pageable pageable);
    @Query("select code as code,name as name from DictHospitalDeptDO")
    List<Map<String,Object>> findCodeAndName(Pageable pageable);
    List<DictHospitalDeptDO> findByOrgCode(String orgCode);
    List<DictHospitalDeptDO> findByOrgCodeIn(String orgCode);
    Long countByCodeIn(String orgCode);
    boolean existsByCodeAndOrgCode(String code, String orgCode);
    DictHospitalDeptDO findByCode(String code);
}

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

@ -0,0 +1,22 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 *
 * 医生基础信息 数据库访问层
 *
 * @version
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
}

+ 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);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadCallback.java

@ -0,0 +1,9 @@
package com.yihu.jw.file_upload;
/**
 * 文件上传后的回调
 */
public interface FileUploadCallback {
    void callback(String photoUrl);
}

+ 100 - 0
business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadRunnable.java

@ -0,0 +1,100 @@
package com.yihu.jw.file_upload;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.util.date.DateUtil;
import org.csource.common.MyException;
import org.springframework.util.Assert;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.Random;
import java.util.Set;
/**
 * 多线程处理文件上传,有返回值的多线程
 */
public class FileUploadRunnable implements Runnable {
    /**
     * 上传文件模板类
     */
    private UploadVO uploadVO;
    /**
     * 微信文件流id,从微信把文件下载下来
     */
    private Set<String> wxMediaIdSet;
    private FileUploadService fileUploadService;
    private String  fastdfsUrl;
    private FileUploadCallback callback;
    /**
     * 微信文件流id,从微信把文件下载下来
     */
    private String accessToken;
    public FileUploadRunnable(Set<String> wxMediaIdSet, String accessToken, FileUploadService fileUploadService, String fastdfsUrl, FileUploadCallback callback){
        this.wxMediaIdSet = wxMediaIdSet;
        this.accessToken = accessToken;
        this.fileUploadService = fileUploadService;
        this.fastdfsUrl = fastdfsUrl;
        this.callback = callback;
    }
    @Override
    public void run() {
        Assert.notNull(wxMediaIdSet,"微信文件流id不可为空!");
        StringBuilder photoUrl = new StringBuilder();
        wxMediaIdSet.forEach( one -> {
            InputStream inputStream = getInputStream(one);
            // 重命名文件
            String newFileName = DateUtil.dateToStr(new Date(), DateUtil.YYYYMMDDHHMMSS) + "_" + new Random().nextInt(1000) + ".png";
            try {
                UploadVO uploadVO = fileUploadService.uploadImg(inputStream,newFileName,0,fastdfsUrl);
                photoUrl.append(uploadVO.getFullUrl()).append(",");
            } catch (NoSuchAlgorithmException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (MyException e) {
                e.printStackTrace();
            }
        });
        callback.callback(photoUrl.toString());
    }
    /**
     * 下载多媒体文件(请注意,视频文件不支持下载,调用该接口需http协议)
     *
     * @return
     */
    public InputStream getInputStream(String mediaId) {
        InputStream is = null;
        String url = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + accessToken + "&media_id=" + mediaId;
        try {
            URL urlGet = new URL(url);
            HttpURLConnection http = (HttpURLConnection) urlGet.openConnection();
            http.setRequestMethod("GET"); // 必须是get方式请求
            http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            http.setDoOutput(true);
            http.setDoInput(true);
            System.setProperty("sun.net.client.defaultConnectTimeout", "30000");// 连接超时30秒
            System.setProperty("sun.net.client.defaultReadTimeout", "30000"); // 读取超时30秒
            http.connect();
            // 获取文件转化为byte流
            is = http.getInputStream();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return is;
    }
}

+ 192 - 0
business/base-service/src/main/java/com/yihu/jw/file_upload/FileUploadService.java

@ -0,0 +1,192 @@
package com.yihu.jw.file_upload;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.jw.exception.business.file_upload.*;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import org.apache.commons.lang3.StringUtils;
import org.csource.common.MyException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLDecoder;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
/**
 * 文件上传服务
 */
@Service
public class FileUploadService {
    @Autowired
    private FastDFSUtil fastDFSHelper;
    /**
     * 文件流上传图片
     * @param inputStream
     * @param originalFileName
     * @return
     * @throws Exception
     */
    public UploadVO uploadImg(InputStream inputStream, String originalFileName,long fileSize,String fastdfs_file_url) throws NoSuchAlgorithmException, IOException, MyException {
        // 得到文件的完整名称  xxx.txt
        if( null == inputStream){
            throw new FileInputStreamEmptyException("图片文件流不可为空!");
        }
        if(StringUtils.isBlank(originalFileName)){
            throw new FileNameEmptyException("图片文件名不可为空!");
        }
        if(StringUtils.isBlank(fastdfs_file_url)){
            throw new FastfdsFileURLEmptyException("fastdfs url不可为空!");
        }
        //得到文件类型
        String fileType = originalFileName.substring(originalFileName.lastIndexOf(".") + 1).toLowerCase();
        if(StringUtils.isBlank(fileType)||!"jpg,jpeg,png".contains(fileType)){
            throw new FileWrongFormatException("图片文件格式不正确,请上传jpg,jpeg,png等任一格式!");
        }
        long max = 5*1024*1024;
        if(fileSize > max){
            throw new FileTooLargeSizeException("图片文件过大,请不要超过5M!");
        }
        String fileName = originalFileName.substring(0, originalFileName.lastIndexOf("."));
        //上传到fastdfs
        ObjectNode objectNode = fastDFSHelper.upload(inputStream, fileType, "");
        //解析返回的objectNode
        UploadVO uploadVO = new UploadVO();
        uploadVO.setFileName(fileName);
        uploadVO.setFileType(fileType);
        uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
        uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
        return uploadVO;
    }
     /*
     * 文件流上传附件
     * @param file
     * @return
     * @throws Exception
     */
    public UploadVO uploadAttachment(InputStream inputStream, String originalFileName,long fileSize,String fastdfs_file_url) throws Exception{
        // 得到文件的完整名称  xxx.txt
        if( null == inputStream){
            throw new FileInputStreamEmptyException("附件文件流不可为空!");
        }
        if(StringUtils.isBlank(originalFileName)){
            throw new FileNameEmptyException("图片文件名不可为空!");
        }
        if(StringUtils.isBlank(fastdfs_file_url)){
            throw new FastfdsFileURLEmptyException("fastdfs url不可为空!");
        }
        //得到文件类型
        String fileType = originalFileName.substring(originalFileName.lastIndexOf(".") + 1).toLowerCase();
        if(StringUtils.isBlank(fileType)||!"doc、docx、pdf、xls、xlsx、jpg、jpeg、png".contains(fileType)){
            throw new FileWrongFormatException("附件文件格式不正确,请上传doc、docx、pdf、xls、xlsx、jpg、jpeg、png等任一格式!");
        }
        long max = 5*1024*1024;
        if(fileSize > max){
            throw new FileTooLargeSizeException("附件文件过大,请不要超过5M!");
        }
        String fileName = originalFileName.substring(0, originalFileName.lastIndexOf("."));
        //上传到fastdfs
        ObjectNode objectNode = fastDFSHelper.upload(inputStream, fileType, "");
        //解析返回的objectNode
        UploadVO uploadVO = new UploadVO();
        uploadVO.setFileName(fileName);
        uploadVO.setFileType(fileType);
        uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
        uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
        return uploadVO;
    }
    /*
     * 文件流上传文件
     * @param file
     * @return
     * @throws Exception
     */
    public UploadVO uploadStream(InputStream inputStream, String originalFileName,String fastdfs_file_url) throws Exception{
        if( null == inputStream){
            throw new FileInputStreamEmptyException("文件内容不可为空!");
        }
        if(StringUtils.isBlank(originalFileName)){
            throw new FileNameEmptyException("文件名不可为空!");
        }
        if(StringUtils.isBlank(fastdfs_file_url)){
            throw new FastfdsFileURLEmptyException("fastdfs url不可为空!");
        }
        //得到文件类型
        String fileType = originalFileName.substring(originalFileName.lastIndexOf(".") + 1).toLowerCase();
        String fileName = originalFileName.substring(0, originalFileName.lastIndexOf("."));
        //上传到fastdfs
        ObjectNode objectNode = fastDFSHelper.upload(inputStream, fileType, "");
        //解析返回的objectNode
        UploadVO uploadVO = new UploadVO();
        uploadVO.setFileName(fileName);
        uploadVO.setFileType(fileType);
        uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
        uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
        return uploadVO;
    }
    /*
     * base64上传图片
     * @param jsonData,头像转化后的输入流
     * @return
     * @throws Exception
     */
    public UploadVO uploadImages(String jsonData,String fastdfs_file_url) throws Exception {
        if(StringUtils.isBlank(jsonData)){
            throw new FileInputStreamEmptyException("图片的base64文件文件流不可为空!");
        }
        if(StringUtils.isBlank(fastdfs_file_url)){
            throw new FastfdsFileURLEmptyException("fastdfs url不可为空!");
        }
        String date = URLDecoder.decode(jsonData,"UTF-8");
        String[] fileStreams = date.split(",");
        String is = URLDecoder.decode(fileStreams[1],"UTF-8").replace(" ","+");
        byte[] in = Base64.getDecoder().decode(is);
        String pictureName = fileStreams[0].substring(0,fileStreams[0].length()-1);
        String fileExtension = pictureName.substring(pictureName.lastIndexOf(".") + 1).toLowerCase();
        String description = null;
        if ((pictureName != null) && (pictureName.length() > 0)) {
            int dot = pictureName.lastIndexOf('.');
            if ((dot > -1) && (dot < (pictureName.length()))) {
                description = pictureName.substring(0, dot);
            }
        }
        InputStream inputStream = new ByteArrayInputStream(in);
        ObjectNode objectNode = fastDFSHelper.upload(inputStream, "png", "");
        String groupName = objectNode.get("groupName").toString();
        String remoteFileName = objectNode.get("remoteFileName").toString();
        //解析返回的objectNode
        UploadVO uploadVO = new UploadVO();
        uploadVO.setFileName(remoteFileName);
        uploadVO.setFileType(groupName);
        uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
        uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
        //返回文件路径
        return uploadVO;
    }
}

+ 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);
}

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

@ -0,0 +1,36 @@
package com.yihu.jw.message.dao;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import org.springframework.data.domain.Pageable;
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;
import java.util.List;
/**
 * @author liuwenbin on 2018/11/28.
 */
public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, String>, JpaSpecificationExecutor<BaseMessageDO> {
    @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=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);
    @Query("select m from BaseMessageDO m where m.receiver=?1 and m.sender=?2 and m.msgTypeCode like ?3 and m.platform=?4 and m.del='1'")
    List<BaseMessageDO> getAllByPatient(String receiver,String sender,String msgTypeCode,Integer platform,Pageable pageRequest);
    @Query("select m from BaseMessageDO m where m.receiver=?1  and m.msgTypeCode like ?2 and m.platform=?3 and m.del='1'")
    List<BaseMessageDO> getAllByPatient(String receiver,String msgTypeCode,Integer platform,Pageable pageRequest);
}

+ 216 - 0
business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java

@ -0,0 +1,216 @@
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;
import org.springframework.data.domain.Pageable;
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;
/**
 * @author liuwenbin on 2018/11/28.
 */
@Service
public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 消息列表
     * @param platform
     * @param code
     * @param page
     * @param pageSize
     * @return
     */
    public List<Map<String,Object>> messageList(Integer platform,String code,Integer page,Integer pageSize){
        if(page==null){
            page = 0;
        }else if(page > 0)
        {
            page = page -1;
        }
        if (pageSize <= 0) {
            pageSize = 10;
        }
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        // 分页信息
        List<BaseMessageDO> applyList = messageDao.messageList(platform,code,"00%");
        Integer applyReadCount = messageDao.countMessage(platform,code,"00%");
        List<BaseMessageDO> systemList = messageDao.messageList(platform,code,"01%");
        Integer systemReadCount = messageDao.countMessage(platform,code,"01%");
        List<Map<String,Object>> resultList = new LinkedList<>();
        Map<String,Object> applyMap = new HashedMap();
        applyMap.put("name","应用消息");
        applyMap.put("count",applyReadCount);
        applyMap.put("message",applyList.size()>0?applyList.get(0).getMsgContent():null);
        applyMap.put("createTime", applyList.size()>0?DateUtil.dateToStr(applyList.get(0).getCreateTime(),"yyyy-MM-dd HH:mm:ss"):null);
        applyMap.put("type","01");
        resultList.add(applyMap);
        Map<String,Object> systemMap = new HashedMap();
        systemMap.put("name","系统消息");
        systemMap.put("count",systemReadCount);
        systemMap.put("message",systemList.size()>0?systemList.get(0).getMsgContent():null);
        systemMap.put("createTime", systemList.size()>0?DateUtil.dateToStr(systemList.get(0).getCreateTime(),"yyyy-MM-dd HH:mm:ss"):null);
        applyMap.put("type","02");
        resultList.add(systemMap);
        Integer unReadPageSize = pageSize;
        if(page==0){
            unReadPageSize=unReadPageSize-2;
        }
        //1、未读消息(置顶)
        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"));//create_time
            unReadMap.put("createTime", DateUtil.dateToStr((Date)one.get("create_time"),"yyyy-MM-dd HH:mm:ss"));
            unReadMap.put("senderPhoto", one.get("sender_photo"));
            unReadMap.put("senderSex", one.get("sex"));
            applyMap.put("type","03");
            resultList.add(unReadMap);
        }
        if(unReadResult.size()<unReadPageSize){
            page = messageCountSql(platform,code,1,page,pageSize);
            //2、已读消息
            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"));
                readMap.put("createTime", DateUtil.dateToStr((Date)one.get("create_time"),"yyyy-MM-dd HH:mm:ss"));
                readMap.put("senderPhoto", one.get("sender_photo"));
                readMap.put("senderSex", one.get("sex"));
                applyMap.put("type","03");
                resultList.add(readMap);
            }
        }
        return resultList;
    }
    public BaseMessageDO create(BaseMessageDO messageDO){
        return messageDao.save(messageDO);
    }
    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.read_state=0 and m.msg_type_code='"+msgTypeCode+"' and m.receiver='"+patient+"'";
        return jdbcTemplate.queryForList(sql);
//        return messageDao.applyMessageList(patient,failureTime,msgTypeCode);
    }
    private List<Map<String, Object>> messageListSql(Integer platform,String code,Integer readState,Integer page,Integer pageSize){
        String sql =" SELECT " +
                " a.*, b.msg_content ,b.sender_photo ,p.sex " +
                " FROM " +
                " ( " +
                "  SELECT " +
                "   m.sender, " +
                "   m.sender_name, " +
                "   count(*) as num, " +
                "   max(m.create_time) AS create_time " +
                "  FROM " +
                "   base_message m " +
                "  WHERE " +
                "   m.platform = '"+platform+"' " +
                "  AND m.receiver = '"+code+"' " +
                "  AND m.del = 1 " +
                "  AND m.read_state = "+readState+" " +
                "  AND m.msg_type_code like '03%'"+
                "  GROUP BY " +
                "   m.sender, " +
                "   m.sender_name " +
                "  LIMIT "+page+", " +
                "  "+pageSize+" " +
                " ) a " +
                " LEFT JOIN base_message b ON a.sender = b.sender " +
                " AND a.create_time = b.create_time " +
                " AND b.platform = '"+platform+"' " +
                " AND b.receiver = '"+code+"' " +
                " AND b.del = 1 " +
                " AND b.read_state = "+readState+
                " AND b.msg_type_code like '03%'"+
                " LEFT JOIN base_patient p ON a.sender = p.id ";
        return jdbcTemplate.queryForList(sql);
    }
    private Integer messageCountSql(Integer platform,String code,Integer readState,Integer page,Integer originalPageSize){
        String sql ="  SELECT count(*) as num " +
                "  FROM " +
                "   base_message m " +
                "  WHERE " +
                "   m.platform = '"+platform+"' " +
                "  AND m.receiver = '"+code+"' " +
                "  AND m.del = 1 " +
                "  AND m.read_state = "+readState+" " +
                "  AND m.msg_type_code like '03%'"+
                "  GROUP BY " +
                "   m.sender, " +
                "   m.sender_name " ;
        List<Map<String, Object>> list  = jdbcTemplate.queryForList(sql);
        Integer count = list.size();
        if(count<=(originalPageSize-2)){
            return page;
        }else{
            Integer s = (count-(originalPageSize-2))/originalPageSize;
            Integer y = (count-(originalPageSize-2))%originalPageSize;
            if(y>0){
                return page-(s+2);
            }else{
                return page-(s+1);
            }
        }
    }
    public BaseMessageDO findById(Integer id){
        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 !");
        }
    }
    public List<BaseMessageDO> getAllByPatient(String receiver,String sender,String msgTypeCode,Integer platform,Pageable pageRequest){
        return messageDao.getAllByPatient(receiver,sender,msgTypeCode,platform,pageRequest);
    }
    public List<BaseMessageDO> getAllByPatient(String receiver,String msgTypeCode,Integer platform,Pageable pageRequest){
        return messageDao.getAllByPatient(receiver,msgTypeCode,platform,pageRequest);
    }
}

+ 45 - 0
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -0,0 +1,45 @@
package com.yihu.jw.org.dao;
import com.yihu.jw.entity.base.org.BaseOrgDO;
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.List;
import java.util.Map;
/**
 * 
 * 机构信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1
 */
public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String>, JpaSpecificationExecutor<BaseOrgDO>  {
    @Query(value="select b.* from base_org b where b.code= ?1 and b.saasid= ?2 limit 1",nativeQuery = true)
    BaseOrgDO findByCodeAndSaasId(String code, String saasId);
    boolean existsByCode(String code);
    BaseOrgDO findByCode(String code);
    @Modifying
    @Query("delete from BaseOrgDO p where p.saasid=?1 ")
    void deleteBySaasId(String saasId);
    @Query("select id from BaseOrgDO where del = 1 and saasid = ?1")
    List findOrgCodeBySaasId(String saasId);
   /* @Query("select code as code,name as name from BaseOrgDO where del = 1 and saasid = ?1 ")
    List<Map<String,Object>> findOrgListBySaasId(String saasId);*/
    @Query("select code as code,name as name from BaseOrgDO where del = 1")
    List<Map<String,Object>> findOrgListBySaasId();
}

+ 21 - 9
svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/BasePatientDao.java

@ -1,14 +1,12 @@
package com.yihu.jw.base.dao.patient;
package com.yihu.jw.patient.dao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import org.springframework.data.domain.Pageable;
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 org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@ -17,16 +15,30 @@ 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 existsByIdcardAndIdNotAndDel(String idcard,String id,String del);
    boolean existsByIdcardAndDel(String idcard,String del);
    @Query("from BasePatientDO where mobile = ?1")
    List<BasePatientDO> findByMobile(String mobile);
    @Query("from BasePatientDO p where p.mobile = ?1 and p.del=?2")
    List<BasePatientDO> findByMobileAndDel(String mobile,String del);
    @Modifying
    @Query(" update BasePatientDO a set a.openid=?2 where a.id=?1 ")
    int updateOpenId(String id, String openId);
    BasePatientDO findByIdAndDel(String id,String del);
}

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

@ -0,0 +1,44 @@
package com.yihu.jw.patient.dao;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
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.Set;
/**
 * Created by Trick on 2018/8/31.
 */
public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, Integer>, JpaSpecificationExecutor<PatientMedicareCardDO> {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);
    PatientMedicareCardDO findByCode(String code);
    PatientMedicareCardDO findByTypeAndPatientCodeAndDel(String Type,String patientCode,String del);
    boolean existsByCodeAndDel(String code,String del);
    /**
     * 校验就诊卡号是否存在,就诊卡号有机构code,每个机构的就诊卡相互独立
     * @param code
     * @param orgCode
     * @param del
     * @return
     */
    boolean existsByCodeAndOrgCodeAndDel(String code,String orgCode,String del);
    /**
     * 一个居民在一家医院(机构)只能有一张就诊卡
     * @param patientCode
     * @param orgCode
     * @param del
     * @return
     */
    boolean existsByPatientCodeAndOrgCodeAndDel(String patientCode,String orgCode,String del);
}

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

@ -0,0 +1,85 @@
package com.yihu.jw.patient.service;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
 * 
 * 居民卡包基础信息服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年08月31日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BasePatientMedicardCardService<T, R extends CrudRepository> extends BaseJpaService<PatientMedicareCardDO, BasePatientMedicareCardDao> {
    @Autowired
    private BasePatientMedicareCardDao basePatientMedicareCardDao;
    /**
     * 根据居民标识获取居民医疗相关卡列表
     * @param patientCode
     * @return
     */
    public List<PatientMedicareCardDO> findPatientCardByCode(String patientCode){
        List<PatientMedicareCardDO> result = new ArrayList<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return basePatientMedicareCardDao.findByPatientCode(patientCode);
    }
    /**
     * 根据居民标识获取关联卡id列表
     * @param patientCode
     * @return
     */
    public Set<Object> findIdListByPatientCode(String patientCode){
        Set<Object> result = new HashSet<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return basePatientMedicareCardDao.findIdListByPatientCode(patientCode);
    }
    /**
     * 根据居民标识获取关联卡id列表
     * @param patientCode
     * @return
     */
    public PatientMedicareCardDO findByCode(String patientCode) throws Exception{
        PatientMedicareCardDO patientMedicareCard = basePatientMedicareCardDao.findByCode(patientCode);
        if(patientMedicareCard==null){
            throw new Exception("no PatientMedicareCard entity");
        }
        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");
    }
}

+ 64 - 29
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/BasePatientService.java

@ -1,28 +1,30 @@
package com.yihu.jw.base.service.patient;
package com.yihu.jw.patient.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.patient.BasePatientDao;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.*;
import java.util.regex.Pattern;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * 
 * 居民信息服务service
 * 居民基础信息服务service
 * 
 * @version 
 * <pre>
@ -33,16 +35,19 @@ import java.util.regex.Pattern;
 * @since 1.
 */
@Service
public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatientDao> {
public class BasePatientService<T, R extends CrudRepository> extends BaseJpaService<BasePatientDO, BasePatientDao> {
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private PatientMedicardCardService patientMedicardCardService;
    private BasePatientMedicardCardService basePatientMedicardCardService;
    @Autowired
    private ObjectMapper objectMapper;
    
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
@ -62,7 +67,7 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
            return result.toString();
        }
        result.put("patient",patientDOList.get(0));
        List<PatientMedicareCardDO> cards = patientMedicardCardService.findPatientCardByCode(patientId);
        List<PatientMedicareCardDO> cards = basePatientMedicardCardService.findPatientCardByCode(patientId);
        result.put("medicareCard",cards);
        return result.toJSONString();
    }
@ -75,20 +80,23 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * @return
     */
    public List<Map<String,Object>> queryPatientBaseInfo(String nameOrIdcard,int page,int size,String sorts)throws Exception{
        List<Map<String,Object>> result = new ArrayList<>();
        if(StringUtils.isEmpty(nameOrIdcard)){
            result = basePatientDao.findBaseInfo(createPage(page,size,sorts));
        }else{
            String pattern = "^\\d+";
            boolean isMatch = Pattern.matches(pattern, nameOrIdcard);
            if(isMatch){
                result = basePatientDao.findByIdcard("%"+nameOrIdcard+"%",createPage(page,size,sorts));
                return result;
            }else{
                result = basePatientDao.findByName("%"+nameOrIdcard+"%",createPage(page,size,sorts));
                return result;
            }
        List<Map<String, Object>> result = new ArrayList<>();
        String param = null == nameOrIdcard ? "": nameOrIdcard;
        String sql = "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, " +
                "       committee_name                                         as committeeName, " +
                "       concat(province_name, city_name, town_name, street_name)   as address " +
                " from base_patient " +
                " where name like '%" + param + "%' or idcard like '%" + param + "%' order by create_time desc";
        String countSql = "select count(id) from base_patient where name like '%" + param + "%' or idcard like '%" + param + "%'";
        Long count  = jdbcTemplate.queryForObject(countSql,Long.class);
        if(count <= 0){
            return result;
        }
        result = jdbcTemplate.queryForList(sql);
        return result;
    }
@ -115,7 +123,7 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
            }
        });
        this.save(basePatientDO);
        patientMedicardCardService.batchInsert(list);
        basePatientMedicardCardService.batchInsert(list);
        return ConstantUtils.SUCCESS;
    }
@ -138,7 +146,7 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
        }
        // 保存修改的居民信息
        this.save(basePatientDO);
        Set<Object> cardIdList = patientMedicardCardService.findIdListByPatientCode(basePatientDO.getId());
        Set<Object> cardIdList = basePatientMedicardCardService.findIdListByPatientCode(basePatientDO.getId());
        // 有些卡可能是新增或修改的,一条一条修改居民相关的卡的信息
        for (Object obj : patientMedicareCards) {
            PatientMedicareCardDO card = objectMapper.readValue(obj.toString(), PatientMedicareCardDO.class);
@ -146,12 +154,39 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
            if(cardIdList.contains(card.getId())){
                cardIdList.remove(card.getId());
            }
            patientMedicardCardService.save(card);
            basePatientMedicardCardService.save(card);
        }
        // 有些卡可能是删除的
        if(cardIdList.size() > 0){
            patientMedicardCardService.delete(cardIdList.toArray());
            basePatientMedicardCardService.delete(cardIdList.toArray());
        }
        return ConstantUtils.SUCCESS;
    }
    /**
     * 根据patient的id获取居民信息
     * @param patient
     * @return
     */
    public BasePatientDO findByIdAndDel(String patient) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        if(basePatientDO==null){
            throw new Exception("用户不存在");
        }
        return basePatientDO;
    }
    /**
     * 根据patient的id获取居民信息
     * @param mobile
     * @return
     */
    public BasePatientDO findByMobileAndDel(String mobile) throws Exception{
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list.size()<=0){
            return null;
        }
        return list.get(0);
    }
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java

@ -0,0 +1,16 @@
package com.yihu.jw.patient.util;
/**
 * @author litaohong on 2018/10/11
 * @project jw2.0
 */
public class ConstantUtils {
    public static final String SUCCESS = "success";
    public static final String FAIL = "fail";
    // 状态失效
    public static final String STATUS_0 = "0";
    // 状态有效
    public static final String STATUS_1 = "1";
}

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

@ -0,0 +1,12 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.JsApiTicket;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface JsapiTicketDao extends PagingAndSortingRepository<JsApiTicket, Long> {
    @Query("select p from JsApiTicket p where p.acc_id = ?1 order by p.add_timestamp desc")
    Iterable<JsApiTicket> findJsapiTicket(String accId);
}

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

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.wx;
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

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

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.wx;
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

+ 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);
}

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

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.wx;
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
@ -12,8 +12,8 @@ import java.util.List;
 */
public interface WxTemplateConfigDao extends PagingAndSortingRepository<WxTemplateConfigDO, String>, JpaSpecificationExecutor<WxTemplateConfigDO> {
    WxTemplateConfigDO findByWechatIdAndTemplateNameAndSceneAndStatus(String wechatId, String templateName, String scene,Integer status);
    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);
    List<WxTemplateConfigDO> findByWechatIdAndScene(String wechatId, String scene);
}

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

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.wx;//package com.yihu.jw.business.wx.dao;
package com.yihu.jw.wechat.dao;//package com.yihu.jw.business.wx.dao;
import com.yihu.jw.entity.base.wx.WxTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -19,8 +19,8 @@ public interface WxTemplateDao extends PagingAndSortingRepository<WxTemplateDO,
    @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> findByTemplateIdAndWechatIdAndStatus(String templateId, String wechatId, Integer status);
    List<WxTemplateDO> findByTemplateNameAndWechatIdAndStatus(String templateId,String wechatId,Integer status);
    List<WxTemplateDO> findByTemplateNameAndWechatIdAndStatus(String templateId, String wechatId, Integer status);
}

+ 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);
}

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

@ -0,0 +1,137 @@
package com.yihu.jw.wechat.service;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
/**
 * 微信二维码
 * Created by Trick on 2018/9/7.
 */
@Service
public class WeChatQrcodeService {
    @Autowired
    private FastDFSUtil fastDFSHelper;
    @Autowired
    private WxAccessTokenService wxAccessTokenService;
    public String getQrcode(HttpServletRequest request, 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;
                // 下载二维码图片
                URL urlGet = new URL("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
                        + URLEncoder.encode(json.get("ticket").toString(), "UTF-8"));
                HttpURLConnection connection = (HttpURLConnection) urlGet.openConnection();
                connection.connect();
                //下载图片到内存
                inputStream = connection.getInputStream();
                //======start===
                //fastDFS方法问题,直接将inputStream文件流上传文件服务器存数据缺失,
                // 故将文件输出本地,在上传文件服务器,之后删除本地文件
                String path = WeChatQrcodeService.class.getResource("/").getPath().replace("/WEB-INF/classes/", "")
                        + File.separator + "qrcode" ;
                //判断目录是否存在,创建目录
                File dir = new File(path);
                if(!dir.exists()){
                    dir.mkdir();
                }
                path+= File.separator + wechatId+"_"+scene+".png";
                File file = new File(path);
                // 保存文件
                FileOutputStream outputStream = new FileOutputStream(file);
                byte[] data = new byte[1024];
                int len = 0;
                while ((len = inputStream.read(data)) != -1) {
                    outputStream.write(data, 0, len);
                }
                InputStream input = new FileInputStream(file);
                //=======end=========
                ObjectNode objectNode = fastDFSHelper.upload(input,"png","");
                if (outputStream != null) {
                    outputStream.close();
                }
                if (inputStream != null) {
                    inputStream.close();
                }
                //流关闭,删除文件
                if(file.exists()&&file.isFile()){
                    file.delete();
                }
                return objectNode.get("fileId").toString().replaceAll("\"", "");
            }
        }
        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";
//        // 保存文件
//        FileOutputStream outputStream = new FileOutputStream(file);
//
//        byte[] data = new byte[1024];
//        int len = 0;
//
//        while ((len = inputStream.read(data)) != -1) {
//            outputStream.write(data, 0, len);
//        }
//
//        if (outputStream != null) {
//            outputStream.close();
//        }
//
//    }
}

+ 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());
    }
}

+ 189 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java

@ -0,0 +1,189 @@
package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.wx.JsApiTicket;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.rm.base.WechatRequestMapping;
import com.yihu.jw.wechat.dao.JsapiTicketDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.*;
/**
 * Created by Administrator on 2017/5/18
 */
@Service
public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAccessTokenDao> {
    private Logger logger= LoggerFactory.getLogger(WxAccessTokenService.class);
    @Autowired
    private WxAccessTokenDao wxAccessTokenDao;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private JsapiTicketDao jsapiTicketDao;
    public WxWechatDO getWxInfo(String wxId){
        return wechatDao.findOne(wxId);
    }
    /**
     * 根据原始id查找
     * @param appOriginId
     * @return
     */
    public WxAccessTokenDO getWxAccessTokenByOriginId(String appOriginId) {
        try {
            //根据wechatCode查找出appid和appSecret
            WxWechatDO wxWechat = wechatDao.findByAppOriginId(appOriginId);
            if(wxWechat==null){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_wxWechat_is_no_exist, ExceptionCode.common_error_params_code);
            }
            List<WxAccessTokenDO> wxAccessTokens =  wxAccessTokenDao.getWxAccessTokenById(wxWechat.getId());
            if(wxAccessTokens!=null&&wxAccessTokens.size()>0){
                for (WxAccessTokenDO accessToken : wxAccessTokens) {
                    if ((System.currentTimeMillis() - accessToken.getAddTimestamp()) < (accessToken.getExpiresIn() * 500)) {
                        return accessToken;
                    } else {
                        wxAccessTokenDao.delete(accessToken);
                        break;
                    }
                }
            }
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String appId="";
            String appSecret="";
            appId = wxWechat.getAppId();
            appSecret = wxWechat.getAppSecret();
            if (StringUtils.isEmpty(appId)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appId_is_null, ExceptionCode.common_error_params_code);
            }
            if (StringUtils.isEmpty(appSecret)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appSecret_is_null, ExceptionCode.common_error_params_code);
            }
            /*String params = "grant_type=client_credential&appid=" + appId + "&secret=" + appSecret;
            String result = HttpUtil.sendGet(token_url, params);*/
            Map<String, Object> params = new HashMap<>();
            params.put("grant_type", "client_credential");
            params.put("appid", appId);
            params.put("secret", appSecret);
            String result = HttpUtils.doGet(token_url, params).getContent();
            logger.info("--------------wechat token return :"+result+"---------------");
            JSONObject json = new JSONObject(result);
            if (json.has("access_token")) {
                String token = json.get("access_token").toString();
                String expires_in = json.get("expires_in").toString();
                WxAccessTokenDO newaccessToken = new WxAccessTokenDO();
                newaccessToken.setAccessToken(token);
                newaccessToken.setExpiresIn(Long.parseLong(expires_in));
                newaccessToken.setAddTimestamp(System.currentTimeMillis());
                newaccessToken.setCzrq(new Date());
                newaccessToken.setCode(UUID.randomUUID().toString().replace("-",""));
                newaccessToken.setWechatId(wxWechat.getId());
                wxAccessTokenDao.save(newaccessToken);
                return newaccessToken;
            } else {
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    public WxAccessTokenDO getWxAccessTokenById(String wechatId) {
        try {
            //根据wechatCode查找出appid和appSecret
            WxWechatDO wxWechat = wechatDao.findById(wechatId);
            List<WxAccessTokenDO> wxAccessTokens =  wxAccessTokenDao.getWxAccessTokenById(wechatId);
            if(wxWechat==null){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_wxWechat_is_no_exist, ExceptionCode.common_error_params_code);
            }
            if(wxAccessTokens!=null&&wxAccessTokens.size()>0){
                for (WxAccessTokenDO accessToken : wxAccessTokens) {
                    if ((System.currentTimeMillis() - accessToken.getAddTimestamp()) < (accessToken.getExpiresIn() * 500)) {
                        return accessToken;
                    } else {
                        wxAccessTokenDao.delete(accessToken);
                        break;
                    }
                }
            }
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String appId="";
            String appSecret="";
            appId = wxWechat.getAppId();
            appSecret = wxWechat.getAppSecret();
            if (StringUtils.isEmpty(appId)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appId_is_null, ExceptionCode.common_error_params_code);
            }
            if (StringUtils.isEmpty(appSecret)){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_appSecret_is_null, ExceptionCode.common_error_params_code);
            }
            Map<String, Object> params = new HashMap<>();
            params.put("grant_type", "client_credential");
            params.put("appid", appId);
            params.put("secret", appSecret);
            String result = HttpUtils.doGet(token_url, params).getContent();
            logger.info("--------------wechat token return:"+result+"---------------");
            JSONObject json = new JSONObject(result);
            if (json.has("access_token")) {
                String token = json.get("access_token").toString();
                String expires_in = json.get("expires_in").toString();
                WxAccessTokenDO newaccessToken = new WxAccessTokenDO();
                newaccessToken.setAccessToken(token);
                newaccessToken.setExpiresIn(Long.parseLong(expires_in));
                newaccessToken.setAddTimestamp(System.currentTimeMillis());
                newaccessToken.setCzrq(new Date());
                newaccessToken.setCode(UUID.randomUUID().toString().replace("-",""));
                newaccessToken.setWechatId(wechatId);
                wxAccessTokenDao.save(newaccessToken);
                return newaccessToken;
            } else {
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 获取凭证
     * @param accId 微信原始id
     * @return
     */
    public Iterable<JsApiTicket> findJsapiTicket(String accId) {
        return jsapiTicketDao.findJsapiTicket(accId);
    }
    public void delJsapiTicket(JsApiTicket jsApiTicket) {
        jsapiTicketDao.delete(jsApiTicket);
    }
    /**
     * 添加JsapiTicket
     */
    public void addJsapiTicket(JsApiTicket jsApiTicket) {
        jsApiTicket.setAdd_timestamp(System.currentTimeMillis());
        jsApiTicket.setCzrq(new Date());
        jsapiTicketDao.save(jsApiTicket);
    }
}

+ 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;
    }
}

+ 41 - 0
business/sms-service/pom.xml

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>wlyy-lib-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>sms-service</artifactId>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-exception</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-web</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>
</project>

+ 23 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/dao/BaseSmsDao.java

@ -0,0 +1,23 @@
package com.yihu.jw.sms.dao;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
/**
 * Dao - 短信记录
 * Created by progr1mmer on 2018/8/23.
 */
public interface BaseSmsDao extends PagingAndSortingRepository<SmsDO, String>, JpaSpecificationExecutor<SmsDO> {
    boolean existsByCaptchaAndDeadlineAfter(String captcha, Date now);
    @Query("select a from SmsDO a where a.mobile = ?1  and a.type = ?2")
    Page<SmsDO> findByCaptcha(String mobile, SmsTemplateDO.Type type, Pageable pageRequest);
}

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/sms/SmsGatewayDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.sms;
package com.yihu.jw.sms.dao;
import com.yihu.jw.entity.base.sms.SmsGatewayDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -10,7 +10,7 @@ import java.util.List;
 * Dao - 短信网关
 * Created by progr1mmer on 2018/8/23.
 */
public interface SmsGatewayDao extends PagingAndSortingRepository<SmsGatewayDO, String>, JpaSpecificationExecutor<SmsGatewayDO> {
public interface BaseSmsGatewayDao extends PagingAndSortingRepository<SmsGatewayDO, String>, JpaSpecificationExecutor<SmsGatewayDO> {
    List<SmsGatewayDO> findByClientIdAndStatus(String clientId, SmsGatewayDO.Status status);

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/sms/SmsTemplateDao.java

@ -1,4 +1,4 @@
package com.yihu.jw.base.dao.sms;
package com.yihu.jw.sms.dao;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -10,7 +10,7 @@ import java.util.List;
 * Dao - 短信模板
 * Created by progr1mmer on 2018/8/23.
 */
public interface SmsTemplateDao extends PagingAndSortingRepository<SmsTemplateDO, String>, JpaSpecificationExecutor<SmsTemplateDO> {
public interface BaseSmsTemplateDao extends PagingAndSortingRepository<SmsTemplateDO, String>, JpaSpecificationExecutor<SmsTemplateDO> {
    List<SmsTemplateDO> findByClientIdAndType(String clientId, SmsTemplateDO.Type type);

+ 118 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsGatewayService.java

@ -0,0 +1,118 @@
package com.yihu.jw.sms.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsGatewayDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.sms.dao.BaseSmsDao;
import com.yihu.jw.sms.dao.BaseSmsGatewayDao;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.network.IPInfoUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * Service - 短信网关,发送短信
 * Created by progr1mmer on 2018/8/23.
 */
@Service
public class BaseSmsGatewayService extends BaseJpaService<SmsGatewayDO, BaseSmsGatewayDao> {
    private static final Pattern PATTERN  = Pattern.compile("\\$\\{[A-Za-z0-9]+\\}");
    @Autowired
    private BaseSmsTemplateDao baseSmsTemplateDao;
    @Autowired
    private BaseSmsGatewayDao baseSmsGatewayDao;
    @Autowired
    private BaseSmsDao baseSmsDao;
    @Autowired
    private ObjectMapper objectMapper;
    public SmsDO send(String clientId, SmsTemplateDO.Type type, String to) throws Exception {
        List<SmsGatewayDO> smsGatewayDOS = baseSmsGatewayDao.findByClientIdAndStatus(clientId, SmsGatewayDO.Status.available);
        if (smsGatewayDOS.size() == 0) {
            throw new ApiException("no gateway available");
        }
        List<SmsTemplateDO> smsTemplateDOS = baseSmsTemplateDao.findByClientIdAndType(clientId, type);
        if (smsTemplateDOS.size() == 0) {
            throw new ApiException("no template available");
        }
        Random random = new Random();
        SmsGatewayDO smsGatewayDO = smsGatewayDOS.get(random.nextInt(smsGatewayDOS.size()));
        SmsTemplateDO smsTemplateDO = smsTemplateDOS.get(random.nextInt(smsTemplateDOS.size()));
        //生成内容
        String rawContent = smsTemplateDO.getContent();
        /*
         * 0 - 验证码
         * 1 - 过期时间(分钟)
         */
        String [] contentDatas = new String[] {
                randomInt(6),
                smsGatewayDO.getExpireMin().toString()
        };
        Matcher contentMatcher = PATTERN.matcher(rawContent);
        int index = 0;
        while (contentMatcher.find()) {
            String matchWord = contentMatcher.group(0);
            rawContent = rawContent.replace(matchWord, contentDatas[index]);
            index ++;
        }
        String sendContent = smsTemplateDO.getHeader() + rawContent;
        //第三方API服务请求参数
        String rawCertificate = smsGatewayDO.getRequestCertificate();
        /*
         * 0 - 接收手机号码
         * 1 - 短信内容
         */
        String [] certificateDatas = new String[] {
                to,
                sendContent
        };
        Matcher certificateMatcher = PATTERN.matcher(rawCertificate);
        index = 0;
        while (certificateMatcher.find()) {
            String matchWord = certificateMatcher.group(0);
            rawCertificate = rawCertificate.replace(matchWord, certificateDatas[index]);
            index ++;
        }
        HttpResponse httpResponse = HttpUtils.doPost(smsGatewayDO.getRequestUrl(), objectMapper.readValue(rawCertificate, Map.class));
        if (httpResponse.isSuccessFlg()) {
            Map<String, Object> response = objectMapper.readValue(httpResponse.getContent(), Map.class);
            String responseCode = String.valueOf(response.get(smsGatewayDO.getResponseCode()));
            if (responseCode.equals(smsGatewayDO.getSuccessValue())) {
                HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
                SmsDO smsDO = new SmsDO();
                smsDO.setClientId(clientId);
                smsDO.setSmsGatewayId(smsGatewayDO.getId());
                smsDO.setRequestIp(IPInfoUtils.getIPAddress(request));
                smsDO.setMobile(to);
                smsDO.setContent(sendContent);
                smsDO.setDeadline(DateUtils.addMinutes(new Date(), smsGatewayDO.getExpireMin()));
                smsDO.setCaptcha(contentDatas[0]);
                smsDO.setType(type);
                return baseSmsDao.save(smsDO);
            } else {
                throw new ApiException(httpResponse.getContent());
            }
        } else {
            throw new ApiException(httpResponse.getContent());
        }
    }
}

+ 70 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsService.java

@ -0,0 +1,70 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.entity.base.sms.SmsDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.sms.dao.BaseSmsDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
 * Service - 短信记录
 * Created by progr1mmer on 2018/9/6.
 */
@Service
public class BaseSmsService extends BaseJpaService<SmsDO, BaseSmsDao>{
    @Autowired
    private BaseSmsDao baseSmsDao;
    /**
     * 判断验证码是否正确
     * @param captcha
     * @return
     */
    public Boolean verifyCaptcha(String captcha){
        return baseSmsDao.existsByCaptchaAndDeadlineAfter(captcha,new Date());
    }
    /**
     * 验证码校验
     *
     * @param mobile  手机号
     * @param type    type 消息类型:1微信端注册,2微信端找回密码,3医生端找回密码,4患者登录,5医生登录 7用户变更手机号 8用户新手机号验证 9用户绑定手机号
     * @param captcha 验证码
     * @return -1验证码过期,-1验证码错误,0验证码无效,1验证通过
     */
    public int check(String mobile, int type, String captcha) {
        // 根据手机号和验证码查询对应的短信信息
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, 1, sort);
        SmsTemplateDO.Type value = SmsTemplateDO.valueOf(type);
        Page<SmsDO> page = baseSmsDao.findByCaptcha(mobile, value, pageRequest);
        SmsDO sms = null;
        for (SmsDO temp : page) {
            if (temp != null) {
                sms = temp;
                break;
            }
        }
        // 验证码校验
        if (sms == null) {
            // 验证码错误
            return -1;
        } else if (!sms.getCaptcha().equalsIgnoreCase(captcha)){
            // 验证码错误
            return -1;
        } else if (sms.getDeadline().before(new Date())) {
            // 验证码过期
            return -2;
        }
        return 1;
    }
}

+ 15 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsTemplateService.java

@ -0,0 +1,15 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * Service - 短信模板
 * Created by progr1mmer on 2018/8/23.
 */
@Service
public class BaseSmsTemplateService extends BaseJpaService<SmsTemplateDO, BaseSmsTemplateDao>{
}

+ 16 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ConstantUtils.java

@ -0,0 +1,16 @@
package com.yihu.jw.patient.util;
/**
 * @author litaohong on 2018/10/11
 * @project jw2.0
 */
public class ConstantUtils {
    public static final String SUCCESS = "success";
    public static final String FAIL = "fail";
    // 状态失效
    public static final String STATUS_0 = "0";
    // 状态有效
    public static final String STATUS_1 = "1";
}

+ 5 - 0
common/common-entity/pom.xml

@ -23,5 +23,10 @@
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>6.0.13.Final</version>
        </dependency>
    </dependencies>
</project>

+ 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;
    }
}

+ 23 - 79
common/common-entity/src/main/java/com/yihu/jw/entity/base/login/BaseLoginLogDO.java

@ -1,6 +1,7 @@
package com.yihu.jw.entity.base.login;// default package
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.*;
@ -13,40 +14,13 @@ import java.util.Date;
@Table(name = "base_login_log")
public class BaseLoginLogDO extends UuidIdentityEntity implements java.io.Serializable {
	private String loginType;//'1 短信登录  2 密码登录'
	private String userId;//'登录用户主键 患者code或者医生code'
	private String saasId;//'saas配置id'
	private String userType;//'1 患者 2医生 '
	private Date createTime;
	private Integer tokenId;//'tokenid'
	private String type;//'1 成功 2失败'
	private String errorMessage;//'错误信息'
	private String phone;//'电话号码'
	private String userAgent;//wlyyusersimple json串
	private String openid;//微信openid
	private String loginType;
	// Constructors
	/** default constructor */
	public BaseLoginLogDO() {
	}
	/** minimal constructor */
	public BaseLoginLogDO(Integer id, Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "login_type", length = 2)
	public String getLoginType() {
		return this.loginType;
	}
	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}
	@Column(name = "user_id", length = 100)
	@Column(name="user_id")
	public String getUserId() {
		return userId;
	}
@ -55,70 +29,40 @@ public class BaseLoginLogDO extends UuidIdentityEntity implements java.io.Serial
		this.userId = userId;
	}
	@Column(name = "saas_id", length = 100)
	public String getSaasId() {
		return this.saasId;
	}
	public void setSaasId(String saasId) {
		this.saasId = saasId;
	}
	@Column(name = "user_type", length = 2)
	public String getUserType() {
		return this.userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 0)
	@Column(name="create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return this.createTime;
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "token_id")
	public Integer getTokenId() {
		return this.tokenId;
	@Column(name="user_agent")
	public String getUserAgent() {
		return userAgent;
	}
	public void setTokenId(Integer tokenId) {
		this.tokenId = tokenId;
	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}
	@Column(name = "type", length = 1)
	public String getType() {
		return this.type;
	@Column(name="openid")
	public String getOpenid() {
		return openid;
	}
	public void setType(String type) {
		this.type = type;
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	@Column(name = "error_message", length = 1000)
	public String getErrorMessage() {
		return this.errorMessage;
	}
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
	@Column(name = "phone", length = 20)
	public String getPhone() {
		return this.phone;
	@Column(name="login_type")
	public String getLoginType() {
		return loginType;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}
}

File diff suppressed because it is too large
+ 22 - 36
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java


+ 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;
    }
}

+ 124 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java

@ -0,0 +1,124 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 账号申诉实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "account_appeal")
public class AccountAppealDO extends IntegerIdentityEntity {
    /**
     * 反馈问题类型,功能异常,功能优化,新功能建议,其他
     */
    public enum Type{
        mobileCannotUse(0),
        passwordCannotFound(1),
        idcardOccupied(2),
        other(3);
        private int value;
        private Type(int value){
            this.value = value;
        }
        public int getValue() {
            return value;
        }
        public void setValue(int value) {
            this.value = value;
        }
    }
    /**
	 * 申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)
	 */
	private int type;
    /**
	 * 申诉内容,问题描述
	 */
	private String content;
    /**
	 * 申诉人姓名
	 */
	private String name;
    /**
	 * 申诉人身份证号码
	 */
	private String idcard;
    /**
	 * 申诉人手机号码
	 */
	private String mobile;
    /**
	 * 身份证正反面照片,存地址,逗号分割
	 */
	private String img;
	@Column(name = "type")
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
	@Column(name = "content")
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
	@Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
	@Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}

+ 158 - 190
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.base.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -9,70 +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
	 */
	private String saasId;
    /**
	 * 身份证号
	 */
	private String idcard;
     * saas配置id
     */
//    @NotNull(message = "saasid不可为空")
    private String saasId;
    /**
	 * 登录密码
	 */
	private String password;
     * 身份证号
     */
//    @NotNull(message = "身份证号不可为空")
    private String idcard;
    /**
	 *
	 */
	private String salt;
     * 登录密码
     */
    private String password;
    /**
	 * 姓名
	 */
	private String name;
     *
     */
    private String salt;
    /**
	 * 生日
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date birthday;
     * 姓名
     */
    private String name;
    /**
	 * 性别,1男,2女
	 */
	private Integer sex;
     * 生日
     */
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date birthday;
    /**
	 * 手机号
	 */
	private String mobile;
     * 性别,1男,2女
     */
//    @Range(min = 1, max = 2, message = "1-男,2-女")
    private Integer sex;
    /**
	 * 联系电话
	 */
	private String phone;
     * 手机号
     */
//    @Length(min = 11,max = 11,message = "手机号长度为11位")
    private String mobile;
    /**
	 * 社保卡号
	 */
	private String ssc;
    /**
	 * 头像http地址
	 */
	private String photo;
     * 头像http地址
     */
    private String photo;
    /**
     * 省代码
@ -114,6 +110,11 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
     */
    private String streetName;
    /**
     * 地址
     */
    private String address;
    /**
     * 居住省代码
     */
@ -165,101 +166,89 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
     */
    private String committeeName;
    /**
	 * 疾病类型,0健康,1高血压,2糖尿病,3高血压+糖尿病
	 */
	private String disease;
    /**
	 * 病情:0绿标,1黄标,2红标,3重点关注,
	 */
	private String diseaseCondition;
     * 总积分
     */
    private String points;
    /**
	 * 总积分
	 */
	private String points;
     * 病历总数
     */
    private String recordAmount;
    /**
	 * 病历总数
	 */
	private String recordAmount;
     * 微信编号
     */
    private String openid;
    /**
	 * 微信编号
	 */
	private String openid;
     * 用户状态:1正常,0禁用,-1恶意注册,2审核中
     */
    private String patientStatus;
    /**
	 * 用户状态:1正常,0禁用,-1恶意注册,2审核中
	 */
	private String patientStatus;
     * 联系方式备注【基卫】
     */
    private String mobileRemarks;
    /**
	 * 联系方式备注【基卫】
	 */
	private String mobileRemarks;
     * 第一次添加open的时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date openidTime;
    /**
	 * 第一次添加open的时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date openidTime;
     * 绑定电子社保卡主体(共济为操作人code,医社保关联patient_medicare_card)
     */
    private String principalCode;
    /**
	 * 绑定电子社保卡主体(共济为操作人code)
	 */
	private String principalCode;
     * 居民预警状态:0为标准,1为预警状态
     */
    private Integer standardStatus;
    /**
	 * 是否绑定电子社保卡 (0否 1是)
	 */
	private String sicardStatus;
     * unionId 开发平台唯一标识
     */
    private String unionid;
    /**
	 * 电子社保卡绑定时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date sicardTime;
     * 作废标识,1正常,0作废
     */
    private String del;
    /**
	 * 是否分配过微信标签
	 */
	private Integer isWxtag;
     * 备注
     */
    private String remark;
    /**
	 * 微信tagId
	 */
	private String wxtagid;
     * 账号是否被锁定
     */
    private Integer locked;
    /**
	 * 居民预警状态:0为标准,1为预警状态
	 */
	private Integer standardStatus;
     * 是否可以登录
     */
    private Integer enabled;
    /**
	 * 医疗保险号
	 */
	private String medicareNumber;
     * 登录失败次数
     */
    private Integer loginFailureCount;
    /**
	 * unionId 开发平台唯一标识
	 */
	private String unionid;
     * 锁定日期
     */
    private Date lockedDate;
    /**
	 * 作废标识,1正常,0作废
	 */
	private String del;
	/**
	 * 备注
	 */
	private String remark;
     * 登录日期
     */
    private Date loginDate;
	@Column(name = "saas_id")
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
@ -267,7 +256,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.saasId = saasId;
    }
	@Column(name = "idcard")
    @Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
@ -275,7 +264,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.idcard = idcard;
    }
	@Column(name = "password")
    @Column(name = "password")
    public String getPassword() {
        return password;
    }
@ -283,7 +272,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.password = password;
    }
	@Column(name = "salt")
    @Column(name = "salt")
    public String getSalt() {
        return salt;
    }
@ -291,7 +280,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.salt = salt;
    }
	@Column(name = "name")
    @Column(name = "name")
    public String getName() {
        return name;
    }
@ -299,7 +288,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.name = name;
    }
	@Column(name = "birthday")
    @Column(name = "birthday")
    public Date getBirthday() {
        return birthday;
    }
@ -307,7 +296,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.birthday = birthday;
    }
	@Column(name = "sex")
    @Column(name = "sex")
    public Integer getSex() {
        return sex;
    }
@ -315,7 +304,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.sex = sex;
    }
	@Column(name = "mobile")
    @Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
@ -323,23 +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 = "ssc")
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
	@Column(name = "photo")
    @Column(name = "photo")
    public String getPhoto() {
        return photo;
    }
@ -411,6 +384,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.streetName = streetName;
    }
    @Column(name = "committee_code")
    public String getCommitteeCode() {
        return committeeCode;
    }
@ -419,6 +393,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.committeeCode = committeeCode;
    }
    @Column(name = "committee_name")
    public String getCommitteeName() {
        return committeeName;
    }
@ -427,23 +402,16 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.committeeName = committeeName;
    }
    @Column(name = "disease")
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    @Column(name = "address")
    public String getAddress() {
        return address;
    }
	@Column(name = "disease_condition")
    public String getDiseaseCondition() {
        return diseaseCondition;
    }
    public void setDiseaseCondition(String diseaseCondition) {
        this.diseaseCondition = diseaseCondition;
    public void setAddress(String address) {
        this.address = address;
    }
	@Column(name = "points")
    @Column(name = "points")
    public String getPoints() {
        return points;
    }
@ -451,7 +419,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.points = points;
    }
	@Column(name = "record_amount")
    @Column(name = "record_amount")
    public String getRecordAmount() {
        return recordAmount;
    }
@ -459,7 +427,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.recordAmount = recordAmount;
    }
	@Column(name = "openid")
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }
@ -467,7 +435,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.openid = openid;
    }
	@Column(name = "patient_status")
    @Column(name = "patient_status")
    public String getPatientStatus() {
        return patientStatus;
    }
@ -475,7 +443,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.patientStatus = patientStatus;
    }
	@Column(name = "mobile_remarks")
    @Column(name = "mobile_remarks")
    public String getMobileRemarks() {
        return mobileRemarks;
    }
@ -483,7 +451,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.mobileRemarks = mobileRemarks;
    }
	@Column(name = "openid_time")
    @Column(name = "openid_time")
    public Date getOpenidTime() {
        return openidTime;
    }
@ -491,7 +459,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.openidTime = openidTime;
    }
	@Column(name = "principal_code")
    @Column(name = "principal_code")
    public String getPrincipalCode() {
        return principalCode;
    }
@ -499,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;
    }
@ -539,15 +475,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.standardStatus = standardStatus;
    }
	@Column(name = "medicare_number")
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }
	@Column(name = "unionid")
    @Column(name = "unionid")
    public String getUnionid() {
        return unionid;
    }
@ -555,7 +483,7 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.unionid = unionid;
    }
	@Column(name = "del")
    @Column(name = "del")
    public String getDel() {
        return del;
    }
@ -635,4 +563,44 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    public void setLiveStreetName(String liveStreetName) {
        this.liveStreetName = liveStreetName;
    }
    public Integer getLocked() {
        return locked;
    }
    public void setLocked(Integer locked) {
        this.locked = locked;
    }
    public Integer getEnabled() {
        return enabled;
    }
    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }
    public Integer getLoginFailureCount() {
        return loginFailureCount;
    }
    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;
    }
}

+ 11 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientFamilyMemberDO.java

@ -15,8 +15,9 @@ public class BasePatientFamilyMemberDO extends UuidIdentityEntityWithOperator {
    private String patient;//居民code',
    private String familyMember;//家庭成员code',
    private Integer familyRelation;//家庭关系',
    private Integer familyRelation;//家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女',
    private Integer isAuthorize;//是否授权0:未授权,1:已授权,默认为1',
    private Integer del;//删除标志(1正常,0删除)
    @Column(name = "patient")
    public String getPatient() {
@ -53,4 +54,13 @@ public class BasePatientFamilyMemberDO extends UuidIdentityEntityWithOperator {
    public void setIsAuthorize(Integer isAuthorize) {
        this.isAuthorize = isAuthorize;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

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

@ -0,0 +1,94 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 意见反馈实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "feedback")
public class FeedbackDO extends IntegerIdentityEntity {
    /**
     * 反馈问题类型,功能异常,功能优化,新功能建议,其他
     */
    public enum Type{
        functionalAbnomal(0),
        functionalOptimal(1),
        newFunction(2),
        other(3);
        private int value;
        private Type(int value){
            this.value = value;
        }
        public int getValue() {
            return value;
        }
        public void setValue(int value) {
            this.value = value;
        }
    }
    /**
	 * 问题类型(功能异常-无法使用功能,功能优化-不好用、界面难看,新功能建议-你希望有什么功能,其他-其他任何问题)
	 */
	private int type;
    /**
	 * 反馈内容,问题和建议
	 */
	private String feedbackContent;
    /**
	 * 图片,存图片地址,逗号分割
	 */
	private String img;
    /**
	 * 联系手机号码
	 */
	private String mobile;
	@Column(name = "type")
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
	@Column(name = "feedback_content")
    public String getFeedbackContent() {
        return feedbackContent;
    }
    public void setFeedbackContent(String feedbackContent) {
        this.feedbackContent = feedbackContent;
    }
	@Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
	@Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
}

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

@ -0,0 +1,100 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 帮助中心实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "help_center")
public class HelpCenterDO extends IntegerIdentityEntity {
    /**
	 * 问题大类(账号问题,续方问题,操作问题)
	 */
	private String parentType;
    /**
	 * 问题小类(账号被锁问题,身份证占用问题等等)
	 */
	private String type;
    /**
	 * 问题描述
	 */
	private String question;
    /**
	 * 问题回答
	 */
	private String answer;
    /**
	 * 有用次数
	 */
	private Integer usefulCount;
    /**
	 * 无用次数
	 */
	private Integer unusefulCount;
	@Column(name = "parent_type")
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
	@Column(name = "question")
    public String getQuestion() {
        return question;
    }
    public void setQuestion(String question) {
        this.question = question;
    }
	@Column(name = "answer")
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
	@Column(name = "useful_count")
    public Integer getUsefulCount() {
        return usefulCount;
    }
    public void setUsefulCount(Integer usefulCount) {
        this.usefulCount = usefulCount;
    }
	@Column(name = "unuseful_count")
    public Integer getUnusefulCount() {
        return unusefulCount;
    }
    public void setUnusefulCount(Integer unusefulCount) {
        this.unusefulCount = unusefulCount;
    }
}

+ 142 - 37
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java

@ -1,39 +1,81 @@
package com.yihu.jw.entity.base.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 居民信息(居民就是患者)实体
*
* @author Administrator on  2018年09月05日
*
*/
 * 居民卡包实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "patient_medicare_card")
public class PatientMedicareCardDO extends IntegerIdentityEntity {
    public enum Type{
        medicareCard(0),
        healthCard(1);
   public enum ParentType {
        CareCard("A", "医疗卡"),
        Coupons("B", "优惠券"),
        BankCard("C", "银行卡");
        private int value;
        private String type;
        private String desc;
        Type(int value){
            this.value = value;
         ParentType(String type, String desc) {
            this.type = type;
            this.desc = desc;
        }
        public int getValue() {
            return value;
       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", "医(社)保卡"),
        PatientIDCard("A_02", "电子就诊卡");
        private String type;
        private String desc;
         Type(String type, String desc) {
            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;
       }
   }
    /**
	 * 卡标识
@ -41,53 +83,116 @@ public class PatientMedicareCardDO extends IntegerIdentityEntity {
	private String code;
    /**
	 * 卡类型,1-医保卡,2-电子健康卡
	 * 卡的大类(A-医疗卡,B-优惠券,C-银行卡,unknow-其他)
	 */
	private String type;
	private String parentType;
    /**
     * 医疗保险号
     */
	private String medicareNumber;
	 * 卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,
	 */
	private String type;
    /**
	 * 居民标识
	 */
	private String patientCode;
    @Column(name = "code")
    /**
	 * 医社保卡缴交的城市
	 */
	private String cityCode;
    /**
	 * 微信openid,有些卡会绑定微信
	 */
	private String wxOpenid;
	/**
	 * 机构code,就诊卡跟医院关联
	 */
	private String orgCode;
    /**
	 * 备注
	 */
	private String remark;
    /**
	 * 状态,0-解除绑定,1-绑定中
	 */
	private String del;
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "type")
	@Column(name = "parent_type")
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Column(name = "medicare_number")
    public String getMedicareNumber() {
        return medicareNumber;
	@Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    @Column(name = "city_code")
    public String getCityCode() {
        return cityCode;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    @Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
    @Column(name = "wx_openid")
    public String getWxOpenid() {
        return wxOpenid;
    }
    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
	@Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
}

+ 78 - 56
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -20,10 +20,8 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    public enum Level {
        system("系统", "0"),
        doctor("医生", "1"),
        team("团队", "2"),
        hospital("社区", "3"),
        town("区", "4");
        hospital("社区", "1"),
        saas("租户", "2");
        private String name;
        private String value;
@ -78,47 +76,57 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
        }
    }
    public enum Type {
        rehabilitation("康复计划", "1");
        private String name;
        private String value;
        Type(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    private String provinceCode;
    private String provinceName;
    private String cityCode;
    private String cityName;
    private String saasId;
    private String name;//服务包名称
    private String type;//服务包类型
    private Integer num;//服务项数量
    private Long price;//预售价//单位分
    private String organization;//发布机构
    private String organizationName;//发布机构名称
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    private String levelCode;//关联code
    private String creater;//创建者
    private Date createTime;//创建时间
    private String introduce;//服务介绍
    private String endIntroduce;//过期时间说明
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Date endTime;//结束时间
    private Integer del;//是否有效(1有效,0失效)
    private Integer sort;//排序
    private List<ServicePackageDetailsDO> detailsDOList;//服务项
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getCityCode() {
        return cityCode;
    }
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    @Column(name = "saas_id")
    public String getSaasId() {
@ -137,14 +145,6 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
        this.name = name;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public Integer getNum() {
        return num;
    }
@ -169,15 +169,6 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
        this.level = level;
    }
    @Column(name = "level_code")
    public String getLevelCode() {
        return levelCode;
    }
    public void setLevelCode(String levelCode) {
        this.levelCode = levelCode;
    }
    public String getCreater() {
        return creater;
    }
@ -219,12 +210,43 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
        this.del = del;
    }
    @Transient
    public List<ServicePackageDetailsDO> getDetailsDOList() {
        return detailsDOList;
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getEndIntroduce() {
        return endIntroduce;
    }
    public void setEndIntroduce(String endIntroduce) {
        this.endIntroduce = endIntroduce;
    }
    public String getOrganization() {
        return organization;
    }
    public void setOrganization(String organization) {
        this.organization = organization;
    }
    public String getOrganizationName() {
        return organizationName;
    }
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setDetailsDOList(List<ServicePackageDetailsDO> detailsDOList) {
        this.detailsDOList = detailsDOList;
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}

+ 56 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageItemDO.java

@ -0,0 +1,56 @@
package com.yihu.jw.entity.base.servicePackage;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2018/11/26.
 */
@Entity
@Table(name = "base_service_package_item")
public class ServicePackageItemDO extends UuidIdentityEntityWithOperator implements java.io.Serializable {
    private String servicePackageId;//服务包ID
    private String itemName;//服务包名称
    private Double price;//价格
    private String times;//次数/频次
    @Column(name = "service_package_id")
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    @Column(name = "item_name")
    public String getItemName() {
        return itemName;
    }
    public void setItemName(String itemName) {
        this.itemName = itemName;
    }
    @Column(name = "price")
    public Double getPrice() {
        return price;
    }
    public void setPrice(Double price) {
        this.price = price;
    }
    @Column(name = "times")
    public String getTimes() {
        return times;
    }
    public void setTimes(String times) {
        this.times = times;
    }
}

+ 39 - 31
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java

@ -16,34 +16,6 @@ import java.util.Date;
@Table(name = "base_service_package_sign_record")
public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Serializable {
    public enum Status {
        create("新建", "1"),
        complete("已完成", "2");
        private String name;
        private String value;
        Status(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    private String saasId;
    private String servicePackageId;//服务包id
    private String servicePackageName;//服务包名称
@ -59,9 +31,13 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    private Long price;//服务总价
    private Date startTime;//服务开始时间
    private Date endTime;//服务结束时间
    private String status;//状态(1新建,2已完成)
    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;//审核原因
    @Column(name = "saas_id")
    public String getSaasId() {
@ -192,11 +168,11 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
        this.endTime = endTime;
    }
    public String getStatus() {
    public Integer getStatus() {
        return status;
    }
    public void setStatus(String status) {
    public void setStatus(Integer status) {
        this.status = status;
    }
@ -217,4 +193,36 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getOperator() {
        return operator;
    }
    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;
    }
}

+ 18 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/sms/SmsTemplateDO.java

@ -19,11 +19,28 @@ public class SmsTemplateDO extends UuidIdentityEntityWithOperator {
     * 0 - 注册
     * 1 - 登陆
     * 2 - 重置密码
     * 3 - 修改手机号
     */
    public enum Type {
        register,
        login,
        resetPassword
        resetPassword,
        updateMobile
    }
    public static Type valueOf(int value) {
        switch (value) {
            case 0:
                return Type.register;
            case 1:
                return Type.register;
            case 2:
                return Type.resetPassword;
            case 3:
                return Type.updateMobile;
            default:
                return null;
        }
    }
    //应用ID

+ 71 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/JsApiTicket.java

@ -0,0 +1,71 @@
package com.yihu.jw.entity.base.wx;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * JavaScript API访问所需要的凭据
 */
@Entity
@Table(name = "wx_jsapi_ticket")
public class JsApiTicket extends IntegerIdentityEntity {
    private static final long serialVersionUID = -3297644428262254694L;
    private String jsapi_ticket;
    private String acc_id;;
    private Long add_timestamp;
    private Long expires_in;
    private Date czrq;
    public String getAcc_id() {
        return acc_id;
    }
    public void setAcc_id(String acc_id) {
        this.acc_id = acc_id;
    }
    public String getJsapi_ticket() {
        return jsapi_ticket;
    }
    public void setJsapi_ticket(String jsapi_ticket) {
        this.jsapi_ticket = jsapi_ticket;
    }
    public Long getAdd_timestamp() {
        return add_timestamp;
    }
    public void setAdd_timestamp(Long add_timestamp) {
        this.add_timestamp = add_timestamp;
    }
    public Long getExpires_in() {
        return expires_in;
    }
    public void setExpires_in(Long expires_in) {
        this.expires_in = expires_in;
    }
    @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;
    }
}

+ 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;
    }
}

+ 141 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java

@ -0,0 +1,141 @@
package com.yihu.jw.entity.myFamily;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * @author liuwenbin on 2018/11/30.
 */
@Entity
@Table(name = "patient_apply_for_log")
public class PatientApplyLog extends IntegerIdentityEntity {
    private String familyMemberName;//家庭成员名称
    private String familyMemberCode;//家庭成员code
    private String qrCode;//二维码地址
    private Date failureTime;//失效时间
    private Integer status;//1、添加家人(默认),2、邀请登录,3、通过,4、拒绝,5、申请人主动终止申请
    private Integer del;//删除标志(1正常,0删除)申请人主动终止申请
    private Date createTime;//创建时间
    private String createUser;//申请人
    private String createUserName;//申请人姓名
    private Integer remindType;//提醒方式(1、打电话,2、发短信,3、微信)
    private Date confirmTime;//确认时间
    private Integer familyBindRole;//1配偶,2父亲,3母亲,4公公,5婆婆,6岳父,7岳母,8女婿,9儿媳,10子女
    @Column(name = "family_member_name")
    public String getFamilyMemberName() {
        return familyMemberName;
    }
    public void setFamilyMemberName(String familyMemberName) {
        this.familyMemberName = familyMemberName;
    }
    @Column(name = "family_member_code")
    public String getFamilyMemberCode() {
        return familyMemberCode;
    }
    public void setFamilyMemberCode(String familyMemberCode) {
        this.familyMemberCode = familyMemberCode;
    }
    @Column(name = "qr_code")
    public String getQrCode() {
        return qrCode;
    }
    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }
    @Column(name = "failure_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getFailureTime() {
        return failureTime;
    }
    public void setFailureTime(Date failureTime) {
        this.failureTime = failureTime;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "create_user")
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    @Column(name = "create_user_name")
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    @Column(name = "remind_type")
    public Integer getRemindType() {
        return remindType;
    }
    public void setRemindType(Integer remindType) {
        this.remindType = remindType;
    }
    @Column(name = "confirm_time")
    public Date getConfirmTime() {
        return confirmTime;
    }
    public void setConfirmTime(Date confirmTime) {
        this.confirmTime = confirmTime;
    }
    @Column(name = "family_bind_role")
    public Integer getFamilyBindRole() {
        return familyBindRole;
    }
    public void setFamilyBindRole(Integer familyBindRole) {
        this.familyBindRole = familyBindRole;
    }
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FailedUploadFileException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FailedUploadFileException extends RuntimeException {
    public FailedUploadFileException(String msg){
        super(msg);
    }
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FastfdsFileURLEmptyException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FastfdsFileURLEmptyException extends RuntimeException {
    public FastfdsFileURLEmptyException(String msg){
        super(msg);
    }
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileInputStreamEmptyException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FileInputStreamEmptyException extends RuntimeException {
    public FileInputStreamEmptyException(String msg){
        super(msg);
    }
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileNameEmptyException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FileNameEmptyException extends RuntimeException {
    public FileNameEmptyException(String msg){
        super(msg);
    }
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileTooLargeSizeException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FileTooLargeSizeException extends RuntimeException {
    public FileTooLargeSizeException(String msg){
        super(msg);
    }
    
}

+ 9 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/file_upload/FileWrongFormatException.java

@ -0,0 +1,9 @@
package com.yihu.jw.exception.business.file_upload;
public class FileWrongFormatException extends RuntimeException {
    public FileWrongFormatException(String msg){
        super(msg);
    }
    
}

+ 11 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/CapthcaInvalidException.java

@ -0,0 +1,11 @@
package com.yihu.jw.exception.business.patient;
/**
 * 验证码无效(错误或过期)
 */
public class CapthcaInvalidException extends RuntimeException{
    public CapthcaInvalidException(String msg){
        super(msg);
    }
}

+ 11 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardAlreadyExistException.java

@ -0,0 +1,11 @@
package com.yihu.jw.exception.business.patient;
/**
 * 居民卡包卡号已存在
 */
public class PatientCardAlreadyExistException extends RuntimeException{
    public PatientCardAlreadyExistException(String msg){
        super(msg);
    }
}

+ 11 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardFormatInvalidException.java

@ -0,0 +1,11 @@
package com.yihu.jw.exception.business.patient;
/**
 * 居民卡包卡号格式不正确
 */
public class PatientCardFormatInvalidException extends RuntimeException{
    public PatientCardFormatInvalidException(String msg){
        super(msg);
    }
}

+ 11 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientCardNotFoundException.java

@ -0,0 +1,11 @@
package com.yihu.jw.exception.business.patient;
/**
 * 居民卡包卡不存在
 */
public class PatientCardNotFoundException extends RuntimeException{
    public PatientCardNotFoundException(String msg){
        super(msg);
    }
}

+ 11 - 0
common/common-exception/src/main/java/com/yihu/jw/exception/business/patient/PatientNotFoundException.java

@ -0,0 +1,11 @@
package com.yihu.jw.exception.business.patient;
/**
 * 居民不存在
 */
public class PatientNotFoundException extends RuntimeException{
    public PatientNotFoundException(String msg){
        super(msg);
    }
}

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

@ -319,7 +319,7 @@ public class BaseRequestMapping {
     * 服务包
     */
    public static class ServicePackage extends Basic{
        public static final String PREFIX  = "/service_package";
        public static final String PREFIX  = "/servicepackage";
    }
    /**
@ -459,14 +459,68 @@ public class BaseRequestMapping {
    /**
     * 患者信息
     * 居民信息
     */
    public static class BasePatient extends Basic {
        public static final String PREFIX  = "/basePatient";
        public static final String getPatientById  = "/getPatientById";
        public static final String getBaseInfo  = "/getBaseInfo";
        public static final String sendCaptcha  = "/sendCaptcha";
        public static final String iscompleted  = "/iscompleted";
        public static final String completeInfo  = "/completeInfo";
        public static final String getCompletedInfo  = "/getCompletedInfo";
        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";
    }
   /**
     * 居民卡包信息
     */
    public static class PatientMedicareCard extends Basic {
        public static final String PREFIX  = "/patientMedicareCard";
        public static final String queryCardById  = "/queryCardById";
        public static final String bindMedicareCard  = "/bindMedicareCard";
        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";
        public static final String isCardExist  = "/isCardExist";
    }
    /**
     * 居民账号申诉
     */
    public static class AccountAppeal extends Basic {
        public static final String PREFIX  = "/accountAppeal";
    }
    /**
     * 居民问题反馈
     */
    public static class Feedback extends Basic {
        public static final String PREFIX  = "/feedback";
    }
    /**
     * 居民帮助中心
     */
    public static class HelpCenter extends Basic {
        public static final String PREFIX  = "/helpCenter";
        public static final String getAnswerByType  = "/getAnswerByType";
        public static final String commentAnswer  = "/commentAnswer";
    }
    /**
     * 基础人口基数
     */

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

@ -0,0 +1,90 @@
package com.yihu.jw.rm.patient;
/**
 * Created by Trick on 2018/11/27.
 * 居民端的静态变量
 */
public class PatientRequestMapping {
    /**
     * 基础请求地址
     */
    private abstract static class Basic {
        public static final String CREATE =  "/create";
        public static final String DELETE = "/delete";
        public static final String UPDATE = "/update";
        public static final String PAGE = "/page";
        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
     */
    public static class SignPackage extends Basic {
        public static final String PREFIX  = "/signPackage";
        public static final String api_success ="success";
        public static final String findPackageService  = "/findPackageService";
        public static final String findServicePackageByPackageId  = "/findServicePackageByPackageId";
        public static final String findOrgByPackageId  = "/findOrgByPackageId";
        public static final String findDoctorByOrg  = "/findDoctorByOrg";
        public static final String signPackage  = "/signPackage";
        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
     */
    public static class MyFamily extends Basic {
        public static final String PREFIX  = "/myFamily";
        public static final String getMyFamilyBindingRole  = "/getMyFamilyBindingRole";
        public static final String getBindingList  = "/getBindingList";
        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";
        public static final String messageDetailList  = "/messageDetailList";
    }
}

+ 27 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/ResultStatus.java

@ -0,0 +1,27 @@
package com.yihu.jw.restmodel;
public class ResultStatus {
    /**
     *   1000多错误码 用户,应用相关的
     */
    public static final Integer USER_NO_EXIST = 1000;//用户不存在
    public static final Integer APP_NO_EXIST = 1001;//应用不存在
    /**
     * 1100多错误码 与授权相关的
     */
    public static final Integer EXPIRE = 1100; //过期的token
    public static final Integer NULL_TOKEN = 1101;// token为空
    public static final Integer INVALID_GRANT = 1102; //授权失败,看具体报错信息,如验证码错误,密码错误等,  [登陆时候,用户不存在/应用不存在,归位此类,方便前端判断]
    public static final Integer NO_PERMI = 1103; //无权限访问
    public static final Integer INVALID_TOKEN = 1104;//被踢了 ,账号在别处登陆
    /**
     *  1200多错误码
     */
    public static final Integer ERROR_PARA = 1200;//错误参数等
    public static final Integer FAILED_RESP = 1201;//返回出错
}

+ 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;
    }
}

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

@ -0,0 +1,83 @@
package com.yihu.jw.restmodel.base.doctor;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/11/28.
 */
@ApiModel(value = "BaseDoctorOrgVO", description = "获取签约医生")
public class BaseDoctorOrgVO {
    private String id;
    private String name;
    private String jobTitleCode;
    private String jobTitleName;
    private String deptName;
    private String deptCode;
    private String introduce;
    private String photo;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getJobTitleCode() {
        return jobTitleCode;
    }
    public void setJobTitleCode(String jobTitleCode) {
        this.jobTitleCode = jobTitleCode;
    }
    public String getJobTitleName() {
        return jobTitleName;
    }
    public void setJobTitleName(String jobTitleName) {
        this.jobTitleName = jobTitleName;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
}

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

@ -0,0 +1,387 @@
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.
 */
public class BaseDoctorSimpleVO {
    private String id;
    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名", example = "张三")
    private String name;
    /**
     * 性别(1男,2女) 用国家标准字典
     */
    @ApiModelProperty(value = "性别(1男,2女,整型 用国家标准字典", example = "1")
    private Integer sex;
    /**
     * 医生专长
     */
    @ApiModelProperty(value = "医生专长", example = "擅长....")
    private String expertise;
    /**
     * 医生介绍
     */
    @ApiModelProperty(value = "医生介绍", example = "....")
    private String introduce;
    /**
     *  身份证
     */
    @ApiModelProperty(value = " 身份证", example = "350.....")
    private String idcard;
    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @ApiModelProperty(value = "生日", example = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;
    /**
     * 头像http地址
     */
    @ApiModelProperty(value = "头像http地址", example = "")
    private String photo;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", example = "")
    private String mobile;
    /**
     * 医生二维码
     */
    @ApiModelProperty(value = "医生二维码", example = "")
    private String qrcode;
    /**
     * 省代码
     */
    @ApiModelProperty(value = "省代码", example = "参考省代码")
    private String provinceCode;
    /**
     * 省名称
     */
    @ApiModelProperty(value = "省名称", example = "某某省")
    private String provinceName;
    /**
     * 市代码
     */
    @ApiModelProperty(value = "市代码", example = "参考市代码")
    private String cityCode;
    /**
     * 市名称
     */
    @ApiModelProperty(value = "市名称", example = "某某市")
    private String cityName;
    /**
     * 区县代码
     */
    @ApiModelProperty(value = "区县代码", example = "参考区县代码")
    private String townCode;
    /**
     * 区县名称
     */
    @ApiModelProperty(value = "区县名称", example = "某某区县")
    private String townName;
    /**
     * 街道代码
     */
    @ApiModelProperty(value = "街道代码", example = "参考街道代码")
    private String streetCode;
    /**
     * 街道名称
     */
    @ApiModelProperty(value = "街道名称", example = "某某街道")
    private String streetName;
    /**
     * 资格是否认证通过,1是,0否
     */
    @ApiModelProperty(value = "资格是否认证通过,1是,0否", example = "1")
    private String iscertified;
    /**
     * 是否是名医,1是,0否
     */
    @ApiModelProperty(value = "是否是名医,1是,0否,整型", example = "0")
    private Integer isFamous;
    /**
     * 是否提示设置密码  1 提示过 0未提示
     */
    @ApiModelProperty(value = "是否提示设置密码  1 提示过 0未提示", example = "0")
    private String isPasswordPrompt;
    /**
     * 名称拼音首字母
     */
    @ApiModelProperty(value = "名称拼音首字母", example = "")
    private String spell;
    /**
     * CA证书过期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @ApiModelProperty(value = "CA证书过期时间", example = "yyyy-MM-dd HH:mm:ss")
    private Date certifiedOvertime;
    /**
     * CA证书编号
     */
    @ApiModelProperty(value = "CA证书编号", example = "实际证书编号")
    private String certificateNum;
    /**
     * 用户微信openid
     */
    @ApiModelProperty(value = "用户微信openid", example = "填上微信那边分配给用户的")
    private String openid;
    /**
     * 作废标识,1正常,0作废
     */
    @ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    @ApiModelProperty(value = "机构", example = "1")
    private List<BaseDoctorHospitalVO> hospitalVOs;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getExpertise() {
        return expertise;
    }
    public void setExpertise(String expertise) {
        this.expertise = expertise;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getQrcode() {
        return qrcode;
    }
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getCityCode() {
        return cityCode;
    }
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getTownCode() {
        return townCode;
    }
    public void setTownCode(String townCode) {
        this.townCode = townCode;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getStreetCode() {
        return streetCode;
    }
    public void setStreetCode(String streetCode) {
        this.streetCode = streetCode;
    }
    public String getStreetName() {
        return streetName;
    }
    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }
    public String getIscertified() {
        return iscertified;
    }
    public void setIscertified(String iscertified) {
        this.iscertified = iscertified;
    }
    public Integer getIsFamous() {
        return isFamous;
    }
    public void setIsFamous(Integer isFamous) {
        this.isFamous = isFamous;
    }
    public String getIsPasswordPrompt() {
        return isPasswordPrompt;
    }
    public void setIsPasswordPrompt(String isPasswordPrompt) {
        this.isPasswordPrompt = isPasswordPrompt;
    }
    public String getSpell() {
        return spell;
    }
    public void setSpell(String spell) {
        this.spell = spell;
    }
    public Date getCertifiedOvertime() {
        return certifiedOvertime;
    }
    public void setCertifiedOvertime(Date certifiedOvertime) {
        this.certifiedOvertime = certifiedOvertime;
    }
    public String getCertificateNum() {
        return certificateNum;
    }
    public void setCertificateNum(String certificateNum) {
        this.certificateNum = certificateNum;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getDel() {
        return del;
    }
    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;
    }
}

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

@ -1,9 +1,11 @@
package com.yihu.jw.restmodel.base.org;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
/**
@ -142,6 +144,16 @@ 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() {
        return code;
    }
@ -283,5 +295,19 @@ public class BaseOrgVO extends UuidIdentityVOWithOperator {
        this.del = del;
    }
    public List<DictHospitalDeptVO> getDepts() {
        return depts;
    }
    public Integer getLevel() {
        return level;
    }
    public void setLevel(Integer level) {
        this.level = level;
    }
    public void setDepts(List<DictHospitalDeptVO> depts) {
        this.depts = depts;
    }
}

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

@ -0,0 +1,56 @@
package com.yihu.jw.restmodel.base.org;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/11/28.
 */
@ApiModel(value = "OrgDistanceVO", description = "机构信息(医院)带距离")
public class OrgDistanceVO {
    private String code;
    private String name;
    private String address;
    private String distance;
    private String photo;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getDistance() {
        return distance;
    }
    public void setDistance(String distance) {
        this.distance = distance;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
}

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

@ -0,0 +1,104 @@
package com.yihu.jw.restmodel.base.patient;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 
 * 账号申诉vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "AccountAppealVO", description = "账号申诉")
public class AccountAppealVO extends IntegerIdentityVO{
    /**
	 * 申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)
	 */
	@ApiModelProperty(value = "申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)", example = "模块1")
    private String type;
    /**
	 * 申诉内容,问题描述
	 */
	@ApiModelProperty(value = "申诉内容,问题描述", example = "模块1")
    private String content;
    /**
	 * 申诉人姓名
	 */
	@ApiModelProperty(value = "申诉人姓名", example = "模块1")
    private String name;
    /**
	 * 申诉人身份证号码
	 */
	@ApiModelProperty(value = "申诉人身份证号码", example = "模块1")
    private String idcard;
    /**
	 * 申诉人手机号码
	 */
	@ApiModelProperty(value = "申诉人手机号码", example = "模块1")
    private String mobile;
    /**
	 * 身份证正反面照片,存地址,逗号分割
	 */
	@ApiModelProperty(value = "身份证正反面照片,存地址,逗号分割", example = "模块1")
    private String img;
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    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 getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}

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


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