error_code.go 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. package enums
  2. import "gdyb/utils"
  3. const ( // ErrorCode
  4. // 登录注册错误 6000+
  5. ErrorCodeLoginTimeout = 6001
  6. ErrorCodeNotLogin = 6002
  7. ErrorCodePermissionDenied = 6003
  8. ErrorCodeMobileRegistered = 6004
  9. ErrorCodePasswordEmpty = 60052503
  10. ErrorCodeVerificationCodeWrong = 6006
  11. ErrorCodeRegisterFail = 6007
  12. ErrorCodeInvalidToken = 6008
  13. ErrorCodeAccountOrPasswordWrong = 6009
  14. ErrorCodeMissingOrg = 6010
  15. ErrorCodeMissingOrgApp = 6011
  16. ErrorCodeAccountOrVerCodeWrong = 6012
  17. ErrorCodeMobileNotExit = 6013
  18. ErrorCodeUserNotExist = 6014
  19. ErrorCodeUserWasForbidden = 6015
  20. ErrorCodeNeverCreateTypeApp = 6016
  21. ErrorCodeContactSuperAdminCreateTypeApp = 6017
  22. ErrorCodeRepeatCreateOrg = 901
  23. // 数据验证错误 7000+
  24. ErrorCodeMobileFormat = 7001
  25. ErrorCodeTelphoneFormat = 7002
  26. ErrorCodeParamWrong = 7003
  27. ErrorCodeParamFormatWrong = 7004
  28. // 数据库操作错误 8000+
  29. ErrorCodeDBCreate = 8001
  30. ErrorCodeDBUpdate = 8002
  31. ErrorCodeDBDelete = 8003
  32. ErrorCodeDBSelectNoResult = 8004
  33. ErrorCodeDataException = 8005
  34. ErrorDrugDataException = 8006
  35. // 业务逻辑操作错误 9000+
  36. ErrorCodeRoleNotExist = 9001
  37. ErrorCodeAdminUserNotExist = 9002
  38. ErrorCodeMobileDidUsedInApp = 9003
  39. ErrorCodeMissingUserName = 9004
  40. ErrorCodeOldPasswordWrong = 9005
  41. ErrorCodeCannotRemoveRole = 9006
  42. ErrorCodeRoleMobileIsSuperAdmin = 9007
  43. ErrorCodeGetQiniuUpToken = 1001
  44. ErrorCodeCreatePatient = 1002
  45. ErrorCodeDialysisNoExist = 1003
  46. ErrorCodeIdCardNoExist = 1004
  47. ErrorCodePatientNoExist = 1005
  48. ErrorCodeUpdatePatient = 1006
  49. ErrorCodeDialysisSolutionExist = 1007
  50. ErrorCodeDialysisSolutionCreate = 1008
  51. ErrorCodeDialysisSolutionUpdate = 1009
  52. ErrorCodeDialysisSolutionNotExist = 1010
  53. ErrorCodeParentDialysisSolutionNotExist = 1011
  54. ErrorCodeAlReadyHadChildSolution = 1012
  55. ErrorCodeCanntCreateChildChildSolution = 1013
  56. ErrorCodeDialysisSolutionUsed = 1014
  57. ErrorCodeCreateDryWeightFail = 1015
  58. ErrorCodeCreateDoctorAdviceFail = 1016
  59. ErrorCodeDoctorAdviceNotExist = 1017
  60. ErrorCodeUpdateDoctorAdviceFail = 1018
  61. ErrorCodeLongTimeAdviceNotCanntEdit = 1019
  62. ErrorCodeAdviceStoped = 1020
  63. ErrorCodeParentAdviceNotExist = 1021
  64. ErrorCodeStopAdviceFail = 1022
  65. ErrorCodeDeleteAdviceFail = 1023
  66. ErrorCodeDialysisSolutionDelete = 1024
  67. ErrorCodeDeviceNumberNotTheZone = 1025
  68. ErrorCodeCreateScheduleFail = 1026
  69. ErrorCodeCantSetScheduleAgainOneDay = 1027
  70. ErrorCodeCantSetScheduleBeforeNow = 1028
  71. ErrorCodeScheduleNotExist = 1029
  72. ErrorCodeDeleteScheduleFail = 1030
  73. ErrorCodeChangeScheduleFail = 1031
  74. ErrorCodePatientPhoneUsed = 1032
  75. ErrorCodeAdviceExced = 1033
  76. ErrorCodeAdviceChecked = 1034
  77. ErrorCodePointScheduleExist = 1035
  78. ErrorCodeExceAndCheckNotOneUser = 1036
  79. ErrorCodeCanotEditOtherAdvice = 1037
  80. ErrorCodeEditLapsetoFail = 1038
  81. ErrorCodeAdviceCheckBeforeExce = 1039
  82. ErrorCodeAdviceExceBeforeStart = 1040
  83. ErrorCodeDelScheduleFailByDialysis = 1041
  84. ErrorCodeNotSelectLapsetoType = 1042
  85. ErrorCodeNotSelectLapsetoTime = 1043
  86. ErrorCodeEquitNoExist = 1045
  87. ErrorCodeInspectionDateExit = 1201
  88. ErrorCodeInspectionAddFail = 1202
  89. ErrorCodeInspectionEditFail = 1204
  90. ErrorCodeInspectionDateNotExit = 1203
  91. ErrorCodeInspectionDeleteFail = 1205
  92. ErrorCodeMonitorCreate = 1128
  93. ErrorCodeMonitorNotExist = 1129
  94. ErrorCodeMonitorUpdate = 1130
  95. ErrorDialysisOrderNoStart = 1132
  96. ErrorDialysisOrderNoEND = 1133
  97. ErrorDialysisOrderRepeatStart = 1134
  98. ErrorDialysisOrderRepeatBed = 1136
  99. ErrorCodeDialysisPermissionDeniedModify = 1135
  100. ErrorCodeNotSubscibe = 4003
  101. ErrorCodeServeNotExist = 4004
  102. ErrorCodeInvoiceExist = 4005
  103. ErrorCodeApplyInvoiceFail = 4006
  104. ErrorCodeHetongHad = 4007
  105. ErrorCodeCreateHetongFail = 4008
  106. ErrorCodePatientReachLimit = 4009
  107. ErrorCodeDeviceZoneNotExist = 9021
  108. ErrorCodeDeviceZoneNameRepeat = 9022
  109. ErrorCodeDeviceGroupNotExist = 9023
  110. ErrorCodeDeviceGroupNameRepeat = 9024
  111. ErrorCodeDeviceNumberNotExist = 9025
  112. ErrorCodeDeviceNumberRepeat = 9026
  113. ErrorCodeDeviceNotExist = 9027
  114. ErrorCodeDeviceZoneCannotDisable = 9028
  115. ErrorCodeDeviceNumberCannotDisableCuzDevice = 9029
  116. ErrorCodeDeviceNumberCannotDisableCuzSchedule = 9030
  117. ErrorCodeDeviceNumberCannotDisableCuzSchTemplate = 9031
  118. ErrorCommitFail = 90000
  119. ErrorCodeCreateStockInFail = 20001
  120. ErrorCodeCreateReturnFail = 50001
  121. ErrorCodeCreateStockOutFail = 50002
  122. ErrorCodeCreateCancelStockFail = 50003
  123. ErrorCodeScheduleTemplateNotExist = 10001
  124. ErrorCodeSystemError = 6666
  125. ErrorCodeProductError = 6667
  126. ErrorCodeFieldExist = 100001
  127. ErrorCodeCreateConfig = 100002
  128. ErrorCodeUpdateConfig = 100003
  129. ErrorCodeDoubleCheckWrong = 200003
  130. ErrorCodeDoubleCheckUserWrong = 200004
  131. ErrorCodeGoodNoStockInError = 200005
  132. ErrorCodeCancelStockFail = 200006
  133. ErrorCodeDeleteGoodTypeFail = 200007
  134. ErrorCodeDeleteGoodInfoFail = 200008
  135. ErrorCodeDeleteFail = 200009
  136. ErrorCodeKeyFail = 200010
  137. ErrorCodeDeleteStockInRecordFail = 200011
  138. ErrorCodeNameWrong = 200012
  139. ErrorCodeParamEmptyWrong = 200013
  140. ErrorCodeParamAdviceEmptyWrong = 200014
  141. ErrorCodeParamTemplateNOEXISTWrong = 200015
  142. ErrorCodeDeleteDealerWrong = 200016
  143. ErrorCodeDeleteManufacturerWrong = 200017
  144. ErrorCodeGoodTypeNameExistError = 200018
  145. ErrorCodeGoodInfoNameExistError = 200019
  146. ErrorCodePrescriptionPermissionDeniedModify = 200020
  147. ErrorCodeAdvicePermissionDeniedModify = 200021
  148. ErrorCodePrescriptionException = 200022
  149. ErrorCodeNotDocking = 200023
  150. ErrorCodeAdviceTypeWrong = 200024
  151. ErrorCodeCreateAdvice = 200025
  152. ErrorCodePatientDialysisOrder = 20026
  153. ErrorSchedualcRepeatBed = 20027
  154. ErrorCodeChangeMode = 20028
  155. ErrorCodeChangeDeviceNumber = 20029
  156. ErrorCodeHisIdExist = 20030
  157. ErrorCodePreExist = 20031
  158. ErrorCodeOrgNoExist = 20032
  159. ErrorCodeRegisterExist = 20033
  160. ErrorCodeRepeatCreateStaffException = 20034
  161. ErrorCodeForbidden = 20035
  162. ErrorCodeRoleNameIsExist = 20036
  163. ErrorCodeRole = 20037
  164. ErrorCodeAdminUserIsExit = 20038
  165. ErrorCodePhone = 20039
  166. ErrorCodeLogOut = 20049
  167. ErrorCodeExportError = 20050
  168. ErrorCodeOrgNoPatient = 20051
  169. ErrorCodeDoctorAdviceEmpty = 20052
  170. ErrorCodeOpenStocktWrong = 20053
  171. ErrorCodeDrugRepeatDataException = 20054
  172. ErrorCodeIDCartNo = 20055
  173. ErrorCodeRegisterOneException = 20066
  174. ErrorCodeRegisterTwoException = 20067
  175. ErrorCodeCreatePreOrderException = 20068
  176. ErrorCodeCalOrderException = 20069
  177. ErrorCodeGdybOneException = 20070
  178. ErrorCodeRegisterThreeException = 20071
  179. ErrorCodeRegisterRepeatException = 20072
  180. ErrorCodeAmountAccountException = 20073
  181. ErrorCodeReadCardException = 20074
  182. ErrorCodeNoPateintException = 20075
  183. ErrorCodeHisFailedException = 20076
  184. ErrorCodeHisOrderNoExistParamWrong = 30000
  185. ErrorCodePreSettleFaildParamWrong = 30001
  186. ErrorDrugPreSettleFaildParamWrong = 30002
  187. ErrorDrugReturnFaildParamWrong = 30003
  188. ErrorDoctorLoginFaildParamWrong = 30004
  189. ErrorNoReadCardException = 30005
  190. ErrorCodeParamSickTypeWrong = 30006
  191. ErrorPsnRecordNoExistWrong = 30007
  192. ErrorCodeInHospitalNoExistDataException = 30008
  193. ErrorCodeHospitalNoExistDataException = 30009
  194. ErrorCodeHospitalExistDataException = 300010
  195. ErrorCodeHisPatientParamWrong = 300004
  196. ErrorCodeOrderParamWrong = 300005
  197. )
  198. var ErrCodeMsgs = map[int]string{
  199. // 登录注册错误
  200. ErrorCodeLoginTimeout: "登录超时",
  201. ErrorCodeNotLogin: "未登录",
  202. ErrorCodePermissionDenied: "权限不足",
  203. ErrorCodeMobileRegistered: "手机号已被注册",
  204. ErrorCodePasswordEmpty: "密码为空",
  205. ErrorCodeVerificationCodeWrong: "验证码错误",
  206. ErrorCodeRegisterFail: "注册失败",
  207. ErrorCodeInvalidToken: "令牌无效",
  208. ErrorCodeAccountOrPasswordWrong: "账号或密码错误",
  209. ErrorCodeMissingOrg: "未创建机构",
  210. ErrorCodeMissingOrgApp: "未创建任何应用",
  211. ErrorCodeAccountOrVerCodeWrong: "账号或验证码错误",
  212. ErrorCodeMobileNotExit: "手机号不存在",
  213. ErrorCodeUserNotExist: "用户不存在",
  214. ErrorCodeUserWasForbidden: "该用户被禁用",
  215. ErrorCodeNeverCreateTypeApp: "未创建此种应用",
  216. ErrorCodeContactSuperAdminCreateTypeApp: "请联系超级管理员开通此种应用",
  217. // 数据验证错误
  218. ErrorCodeMobileFormat: "手机号格式错误",
  219. ErrorCodeTelphoneFormat: "电话格式错误",
  220. ErrorCodeParamWrong: "参数错误",
  221. ErrorCodeParamFormatWrong: "参数格式错误",
  222. // 数据库操作错误
  223. ErrorCodeDBCreate: "数据库创建出错",
  224. ErrorCodeDBUpdate: "数据库更新出错",
  225. ErrorCodeDBDelete: "数据库删除出错",
  226. ErrorCodeDBSelectNoResult: "查询无结果",
  227. ErrorCodeDataException: "数据异常",
  228. ErrorDrugDataException: "",
  229. // 业务逻辑操作错误
  230. ErrorCodeRoleNotExist: "角色不存在",
  231. ErrorCodeAdminUserNotExist: "管理员不存在",
  232. ErrorCodeMobileDidUsedInApp: "该手机号已在该应用中被注册为管理员",
  233. ErrorCodeMissingUserName: "缺少用户名",
  234. ErrorCodeOldPasswordWrong: "原密码不正确",
  235. ErrorCodeCannotRemoveRole: "该角色下存在用户,不能删除该角色",
  236. ErrorCodeRoleMobileIsSuperAdmin: "该手机号已注册为超级管理员",
  237. ErrorCodeGetQiniuUpToken: "获取七牛uptoken失败",
  238. ErrorCodeCreatePatient: "创建患者失败",
  239. ErrorCodeDialysisNoExist: "患者透析号重复!",
  240. ErrorCodeIdCardNoExist: "身份证号重复!",
  241. ErrorCodePatientNoExist: "患者信息不存在!",
  242. ErrorCodeUpdatePatient: "修改患者信息失败",
  243. ErrorCodeDialysisSolutionExist: "该处方已经存在",
  244. ErrorCodeDialysisSolutionCreate: "创建处方失败",
  245. ErrorCodeDialysisSolutionUpdate: "修改处方失败",
  246. ErrorCodeDialysisSolutionNotExist: "该处方不存在",
  247. ErrorCodeParentDialysisSolutionNotExist: "上级处方不存在",
  248. ErrorCodeAlReadyHadChildSolution: "所选处方已经存在子方案",
  249. ErrorCodeCanntCreateChildChildSolution: "子方案不能添加子方案",
  250. ErrorCodeDialysisSolutionUsed: "处方已被使用,不能删除",
  251. ErrorCodeCreateDryWeightFail: "添加干体重失败",
  252. ErrorCodeCreateDoctorAdviceFail: "添加医嘱失败",
  253. ErrorCodeUpdateDoctorAdviceFail: "修改医嘱信息失败",
  254. ErrorCodeDoctorAdviceNotExist: "医嘱不存在",
  255. ErrorCodeLongTimeAdviceNotCanntEdit: "长期医嘱不能修改!",
  256. ErrorCodeAdviceStoped: "所选医嘱已停止",
  257. ErrorCodeParentAdviceNotExist: "上级医嘱不存在",
  258. ErrorCodeDeleteAdviceFail: "删除医嘱失败",
  259. ErrorCodeStopAdviceFail: "停止医嘱失败",
  260. ErrorCodeDialysisSolutionDelete: "删除方案失败",
  261. ErrorCodeDeviceNumberNotTheZone: "所选机号不在选择分区中",
  262. ErrorCodeCreateScheduleFail: "添加排班失败",
  263. ErrorCodeCantSetScheduleAgainOneDay: "同一天不可有两次排班",
  264. ErrorCodeCantSetScheduleBeforeNow: "不能给今天之前的日期排班",
  265. ErrorCodeScheduleNotExist: "排班不存在",
  266. ErrorCodePointScheduleExist: "所先位置排班已经存在",
  267. ErrorCodeDeleteScheduleFail: "取消排班失败",
  268. ErrorCodeChangeScheduleFail: "修改排班失败",
  269. ErrorCodePatientPhoneUsed: "手机号已经存在",
  270. ErrorCodeAdviceExced: "医嘱已经执行",
  271. ErrorCodeAdviceCheckBeforeExce: "核对医嘱不能在执行医嘱之前",
  272. ErrorCodeAdviceExceBeforeStart: "执行医嘱不能在开始之前",
  273. ErrorCodeAdviceChecked: "医嘱已经核对",
  274. ErrorCodeExceAndCheckNotOneUser: "核对与执行不能是同一人",
  275. ErrorCodeCanotEditOtherAdvice: "不能修改非本人添加的医嘱",
  276. ErrorCodeEditLapsetoFail: "转归失败",
  277. ErrorCodeDelScheduleFailByDialysis: "已经上机透析,不能取消排班",
  278. ErrorCodeNotSelectLapsetoType: "请选择转归状态",
  279. ErrorCodeNotSelectLapsetoTime: "请选择转归时间",
  280. ErrorCodeInspectionDateExit: "当天已经存在检验检查记录",
  281. ErrorCodeInspectionAddFail: "添加记录失败",
  282. ErrorCodeInspectionDateNotExit: "当天不存在检验检查记录",
  283. ErrorCodeInspectionEditFail: "修改记录失败",
  284. ErrorCodeInspectionDeleteFail: "删除记录失败",
  285. ErrorCodeDeviceZoneNotExist: "设备分区不存在",
  286. ErrorCodeDeviceZoneNameRepeat: "该分区名已存在",
  287. ErrorCodeDeviceGroupNotExist: "设备分组不存在",
  288. ErrorCodeDeviceGroupNameRepeat: "该分组名已存在",
  289. ErrorCodeDeviceNumberNotExist: "机号不存在",
  290. ErrorCodeDeviceNumberRepeat: "该机号已存在",
  291. ErrorCodeDeviceNotExist: "该设备不存在",
  292. ErrorCodeDeviceZoneCannotDisable: "该分区存在床位号,不能删除",
  293. ErrorCodeDeviceNumberCannotDisableCuzDevice: "该床位存在设备,不能删除",
  294. ErrorCodeDeviceNumberCannotDisableCuzSchedule: "该床位尚有排班安排,不能删除",
  295. ErrorCodeDeviceNumberCannotDisableCuzSchTemplate: "排班模板在该床位尚有排班安排,不能删除",
  296. ErrorCodeNotSubscibe: "没有订阅服务或服务已过期,请先购买服务!",
  297. ErrorCodeServeNotExist: "服务订单不存在!",
  298. ErrorCodeInvoiceExist: "已经申请了发票!",
  299. ErrorCodeApplyInvoiceFail: "申请发票失败!",
  300. ErrorCodeHetongHad: "合同已经存在!",
  301. ErrorCodeCreateHetongFail: "合同创建失败",
  302. ErrorCodePatientReachLimit: "患者数已达到当前服务版本病人数,需要升级到更高的版本",
  303. ErrorCodeMonitorCreate: "创建监测失败",
  304. ErrorCodeMonitorNotExist: "监测记录不存在",
  305. ErrorCodeMonitorUpdate: "修改监测失败",
  306. ErrorCodeDialysisPermissionDeniedModify: "您没有权限修改其他医护的数据!",
  307. ErrorDialysisOrderNoStart: "尚未上机,无法执行下机操作",
  308. ErrorDialysisOrderNoEND: "已处于下机状态",
  309. ErrorDialysisOrderRepeatStart: "已上机",
  310. ErrorDialysisOrderRepeatBed: "该床位已有患者上机,请选择其他床位",
  311. //ErrorCodeScheduleTemplateNotExist: "排班模板不存在",
  312. ErrorCodeSystemError: "系统异常",
  313. ErrorCodeProductError: "该服务商品已丢失",
  314. ErrorCodeScheduleTemplateNotExist: "排班模板不存在",
  315. ErrorCodeCreateStockInFail: "入库失败",
  316. //ErrorCodeSystemError: "系统异常",
  317. //ErrorCodeProductError: "该服务商品已丢失",
  318. ErrorCodeFieldExist: "配置字段已存在",
  319. ErrorCodeCreateConfig: "创建配置失败",
  320. ErrorCodeUpdateConfig: "修改配置失败",
  321. ErrorCommitFail: "提交失败",
  322. ErrorCodeDoubleCheckWrong: "核对已完成, 无法再次提交",
  323. ErrorCodeDoubleCheckUserWrong: "你已完成核对,不能重复核对",
  324. ErrorCodeGoodNoStockInError: "该商品尚未入库",
  325. ErrorCodeCancelStockFail: "出库退库失败",
  326. ErrorCodeDeleteGoodTypeFail: "该类型存在商品信息,无法删除",
  327. ErrorCodeDeleteGoodInfoFail: "该商品已经入库或者出库无法删除",
  328. ErrorCodeDeleteFail: "删除失败",
  329. ErrorCodeKeyFail: "关键字不能为空",
  330. ErrorCodeDeleteStockInRecordFail: "该记录已经有出库或退货操作,无法删除",
  331. ErrorCodeNameWrong: "该模版名字已存在",
  332. ErrorCodeParamEmptyWrong: "模版名称不能为空",
  333. ErrorCodeParamAdviceEmptyWrong: "医嘱名称不能为空",
  334. ErrorCodeDeleteDealerWrong: "该经销商所属商品已入库无法删除",
  335. ErrorCodeDeleteManufacturerWrong: "该厂商所属商品已入库无法删除",
  336. ErrorCodeGoodTypeNameExistError: "该商品类型名字已存在",
  337. ErrorCodeGoodInfoNameExistError: "该规格名称名字已存在",
  338. ErrorCodePrescriptionPermissionDeniedModify: "您没有权限修改透析处方数据",
  339. ErrorCodeAdvicePermissionDeniedModify: "您没有权限添加医嘱",
  340. ErrorCodePrescriptionException: "上机失败,请先开处方",
  341. ErrorCodeNotDocking: "该地区尚未对接",
  342. ErrorCodeAdviceTypeWrong: "请选择医嘱模版类型",
  343. ErrorCodeCreateAdvice: "你没有权限开医嘱",
  344. ErrorCodePatientDialysisOrder: "该病人已经上机,无法临时排班",
  345. ErrorSchedualcRepeatBed: "该床位已经有人排班,无法临时排班",
  346. ErrorCodeChangeMode: "该患者今天已上机治疗,请在透析记录中进行调整透析模式",
  347. ErrorCodeChangeDeviceNumber: "该患者今天已上机治疗,请在透析记录中进行调整机号",
  348. ErrorCodeHisIdExist: "该his_id已被占用,请重新输入",
  349. ErrorCodePreExist: "没有该权限",
  350. ErrorCodeRepeatCreateOrg: "该账号已创建过机构了",
  351. ErrorCodeOrgNoExist: "该机构不存在",
  352. ErrorCodeRegisterExist: "该账号已经注册,请登录",
  353. ErrorCodeRepeatCreateStaffException: "该员工已经存在无法继续添加",
  354. ErrorCodeForbidden: "你已经被管理员禁用,无法使用该系统",
  355. ErrorCodeRoleNameIsExist: "该角色已经不存在",
  356. ErrorCodeRole: "尚未配置角色,无访问权限",
  357. ErrorCodeAdminUserIsExit: "用户不存在",
  358. ErrorCodePhone: "请填写正确的联系电话",
  359. ErrorCodeLogOut: "退出",
  360. ErrorCodeExportError: "导入出错,请下载并查看相关日志",
  361. ErrorCodeOrgNoPatient: "暂无病人",
  362. ErrorCodeDoctorAdviceEmpty: "没有更多了",
  363. ErrorCodeOpenStocktWrong: "未开启自动扣减功能,无法出库",
  364. ErrorCodeDrugRepeatDataException: "该药已经存在,无法添加",
  365. ErrorCodeIDCartNo: "身份证不能为空",
  366. ErrorCodeRegisterOneException: "无参保信息",
  367. ErrorCodeRegisterTwoException: "挂号失败",
  368. ErrorCodeCreatePreOrderException: "创建预结算订单失败",
  369. ErrorCodeCalOrderException: "结算失败",
  370. ErrorCodeGdybOneException: "获取人员信息失败",
  371. ErrorCodeRegisterThreeException: "就诊信息上传失败",
  372. ErrorCodeRegisterRepeatException: "患者一天只能挂号一次",
  373. ErrorCodeAmountAccountException: "结算失败",
  374. ErrorCodeReadCardException: "读卡失败",
  375. ErrorCodeNoPateintException: "读卡失败!请先在系统录入患者信息或检查患者身份证信息是否正确,再重新读卡",
  376. ErrorCodeHisFailedException: "获取人员信息失败",
  377. ErrorCodePreSettleFaildParamWrong: "预结算失败",
  378. ErrorCodeHisOrderNoExistParamWrong: "订单不存在",
  379. ErrorDrugPreSettleFaildParamWrong: "备案失败",
  380. ErrorDrugReturnFaildParamWrong: "撤销失败",
  381. ErrorDoctorLoginFaildParamWrong: "登记失败",
  382. ErrorNoReadCardException: "无法读取除社保卡以外的卡",
  383. ErrorCodeParamSickTypeWrong: "医生所开处方的疾病类型不能为空",
  384. ErrorPsnRecordNoExistWrong: "人员备案信息不存在",
  385. ErrorCodeInHospitalNoExistDataException: "入院记录不存在",
  386. ErrorCodeHospitalNoExistDataException: "请先办理出院才能进行结算",
  387. ErrorCodeHospitalExistDataException: "该患者已经入院,请选办理出院结算后再进行办理入院操作",
  388. ErrorCodeHisPatientParamWrong: "订单正在结算、请先结算完成",
  389. ErrorCodeOrderParamWrong: "该就诊号存在已结算记录,请先退费后再进行退号操作",
  390. }
  391. type SGJError struct {
  392. Code int
  393. }
  394. func (e *SGJError) Error() string {
  395. value, ok := ErrCodeMsgs[e.Code]
  396. if ok {
  397. return value
  398. } else {
  399. return "未知错误"
  400. }
  401. }
  402. func MakeSuccessResponseJSON(data map[string]interface{}) map[string]interface{} {
  403. json := make(map[string]interface{})
  404. if data != nil {
  405. json["data"] = data
  406. } else {
  407. json["data"] = make(map[string]interface{})
  408. }
  409. json["state"] = 1
  410. json["code"] = 0
  411. return json
  412. }
  413. func MakeFailResponseJSON(errMsg string, errCode int) map[string]interface{} {
  414. json := make(map[string]interface{})
  415. json["msg"] = errMsg
  416. json["code"] = errCode
  417. json["state"] = 0
  418. return json
  419. }
  420. func MakeFailResponseJSONWithSGJError(err *SGJError) map[string]interface{} {
  421. if err == nil {
  422. utils.WarningLog("MakeFailResponseJSONWithSGJError 参数err 不能为空")
  423. return nil
  424. }
  425. return MakeFailResponseJSON(err.Error(), err.Code)
  426. }
  427. func MakeFailResponseJSONWithSGJErrorCode(code int) map[string]interface{} {
  428. err := &SGJError{Code: code}
  429. return MakeFailResponseJSON(err.Error(), err.Code)
  430. }