error_code.go 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. package enums
  2. import "XT_New/utils"
  3. const ( // ErrorCode
  4. // 登录注册错误 6000+
  5. ErrorCodeLoginTimeout = 6001
  6. ErrorCodeNotLogin = 6002
  7. ErrorCodePermissionDenied = 6003
  8. ErrorCodeMobileRegistered = 6004
  9. ErrorCodePasswordEmpty = 6005
  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. // 业务逻辑操作错误 9000+
  35. ErrorCodeRoleNotExist = 9001
  36. ErrorCodeAdminUserNotExist = 9002
  37. ErrorCodeMobileDidUsedInApp = 9003
  38. ErrorCodeMissingUserName = 9004
  39. ErrorCodeOldPasswordWrong = 9005
  40. ErrorCodeCannotRemoveRole = 9006
  41. ErrorCodeRoleMobileIsSuperAdmin = 9007
  42. ErrorCodeGetQiniuUpToken = 1001
  43. ErrorCodeCreatePatient = 1002
  44. ErrorCodeDialysisNoExist = 1003
  45. ErrorCodeIdCardNoExist = 1004
  46. ErrorCodePatientNoExist = 1005
  47. ErrorCodeUpdatePatient = 1006
  48. ErrorCodeDialysisSolutionExist = 1007
  49. ErrorCodeDialysisSolutionCreate = 1008
  50. ErrorCodeDialysisSolutionUpdate = 1009
  51. ErrorCodeDialysisSolutionNotExist = 1010
  52. ErrorCodeParentDialysisSolutionNotExist = 1011
  53. ErrorCodeAlReadyHadChildSolution = 1012
  54. ErrorCodeCanntCreateChildChildSolution = 1013
  55. ErrorCodeDialysisSolutionUsed = 1014
  56. ErrorCodeCreateDryWeightFail = 1015
  57. ErrorCodeCreateDoctorAdviceFail = 1016
  58. ErrorCodeDoctorAdviceNotExist = 1017
  59. ErrorCodeUpdateDoctorAdviceFail = 1018
  60. ErrorCodeLongTimeAdviceNotCanntEdit = 1019
  61. ErrorCodeAdviceStoped = 1020
  62. ErrorCodeParentAdviceNotExist = 1021
  63. ErrorCodeStopAdviceFail = 1022
  64. ErrorCodeDeleteAdviceFail = 1023
  65. ErrorCodeDialysisSolutionDelete = 1024
  66. ErrorCodeDeviceNumberNotTheZone = 1025
  67. ErrorCodeCreateScheduleFail = 1026
  68. ErrorCodeCantSetScheduleAgainOneDay = 1027
  69. ErrorCodeCantSetScheduleBeforeNow = 1028
  70. ErrorCodeScheduleNotExist = 1029
  71. ErrorCodeDeleteScheduleFail = 1030
  72. ErrorCodeChangeScheduleFail = 1031
  73. ErrorCodePatientPhoneUsed = 1032
  74. ErrorCodeAdviceExced = 1033
  75. ErrorCodeAdviceChecked = 1034
  76. ErrorCodePointScheduleExist = 1035
  77. ErrorCodeExceAndCheckNotOneUser = 1036
  78. ErrorCodeCanotEditOtherAdvice = 1037
  79. ErrorCodeEditLapsetoFail = 1038
  80. ErrorCodeAdviceCheckBeforeExce = 1039
  81. ErrorCodeAdviceExceBeforeStart = 1040
  82. ErrorCodeDelScheduleFailByDialysis = 1041
  83. ErrorCodeNotSelectLapsetoType = 1042
  84. ErrorCodeNotSelectLapsetoTime = 1043
  85. ErrorCodeEquitNoExist = 1045
  86. ErrorCodeStockExced = 1046
  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. ErrorCodeCreateOrderException = 20068
  176. ErrorCodeCalOrderException = 20069
  177. ErrorCodeHisRegisterException = 300001
  178. ErrorCodeNoBloodPatientException = 300002
  179. ErrorCodeOrderParamWrong = 300003
  180. ErrorCodeHisPatientParamWrong = 300004
  181. ErrorCodeOutOfStockParamWrong = 300300
  182. ErrorCodeOrderParamWrongTwo = 300500
  183. ErrorModeTemplateCodeParamWrong = 300501
  184. ErrorCodeInHospitalNoExistDataException = 30008
  185. ErrorCodeHospitalNoExistDataException = 30009
  186. ErrorCodeHospitalExistDataException = 300010
  187. ErrorCodeRecordFailedException = 300011
  188. ErrorPsnNoEmpty = 310000
  189. ErrorEmployeeNumber = 320000
  190. ErrorCheckGoodParamSuccess = 3400000
  191. ErrorCheckGoodParamWrong = 3300000
  192. ErrorCodeMedicineWrong = 3800000
  193. ErrorCodeChargeWrong = 3900000
  194. ErrorCodeDeletePMedicineWrong = 3900001
  195. ErrorCodeDeletePChargeWrong = 3900002
  196. ErrorCodeDeleteMedicineWrong = 3900003
  197. ErrorCodeDeletePChargeWrongTwo = 3900004
  198. ErrorCodeHisPatientNoRegException = 4000000
  199. ErrorCodeCantDeleteScheduleBeforeNow = 40000001
  200. ErrorCodeSchedule = 50000000
  201. ErrorCodeParamWrongForSchMode = 40000002
  202. ErrorCodePatientDialysisOrderOne = 60000000
  203. ErrorCodePatientDialysisOrderTwo = 60000001
  204. ErrorCodePatientScheduleRepeat = 60000002
  205. ErrorCodeDelScheduleFailByDialysisTwo = 60000003
  206. ErrorCodeSyncWrong = 60000006
  207. AdviceCodeParamWrong = 600000007
  208. ErrorCodeInformationExist = 600000008
  209. ErrorScheduleCode = 600000009
  210. ErrorAdivceCode = 600000010
  211. ErrorTimeCodeParamWrong = 600000012
  212. ErrorCodeAuthWrong = 600000013
  213. )
  214. var ErrCodeMsgs = map[int]string{
  215. // 登录注册错误
  216. ErrorCodeLoginTimeout: "登录超时",
  217. ErrorCodeNotLogin: "未登录",
  218. ErrorCodePermissionDenied: "权限不足",
  219. ErrorCodeMobileRegistered: "手机号已被注册",
  220. ErrorCodePasswordEmpty: "密码为空",
  221. ErrorCodeVerificationCodeWrong: "验证码错误",
  222. ErrorCodeRegisterFail: "注册失败",
  223. ErrorCodeInvalidToken: "令牌无效",
  224. ErrorCodeAccountOrPasswordWrong: "账号或密码错误",
  225. ErrorCodeMissingOrg: "未创建机构",
  226. ErrorCodeMissingOrgApp: "未创建任何应用",
  227. ErrorCodeAccountOrVerCodeWrong: "账号或验证码错误",
  228. ErrorCodeMobileNotExit: "手机号不存在",
  229. ErrorCodeUserNotExist: "用户不存在",
  230. ErrorCodeUserWasForbidden: "该用户被禁用",
  231. ErrorCodeNeverCreateTypeApp: "未创建此种应用",
  232. ErrorCodeContactSuperAdminCreateTypeApp: "请联系超级管理员开通此种应用",
  233. // 数据验证错误
  234. ErrorCodeMobileFormat: "手机号格式错误",
  235. ErrorCodeTelphoneFormat: "电话格式错误",
  236. ErrorCodeParamWrong: "参数错误",
  237. ErrorCodeParamFormatWrong: "参数格式错误",
  238. // 数据库操作错误
  239. ErrorCodeDBCreate: "数据库创建出错",
  240. ErrorCodeDBUpdate: "数据库更新出错",
  241. ErrorCodeDBDelete: "数据库删除出错",
  242. ErrorCodeDBSelectNoResult: "查询无结果",
  243. ErrorCodeDataException: "数据异常",
  244. // 业务逻辑操作错误
  245. ErrorCodeRoleNotExist: "角色不存在",
  246. ErrorCodeAdminUserNotExist: "管理员不存在",
  247. ErrorCodeMobileDidUsedInApp: "该手机号已在该应用中被注册为管理员",
  248. ErrorCodeMissingUserName: "缺少用户名",
  249. ErrorCodeOldPasswordWrong: "原密码不正确",
  250. ErrorCodeCannotRemoveRole: "该角色下存在用户,不能删除该角色",
  251. ErrorCodeRoleMobileIsSuperAdmin: "该手机号已注册为超级管理员",
  252. ErrorCodeGetQiniuUpToken: "获取七牛uptoken失败",
  253. ErrorCodeCreatePatient: "创建患者失败",
  254. ErrorCodeDialysisNoExist: "患者透析号重复!",
  255. ErrorCodeIdCardNoExist: "身份证号重复!",
  256. ErrorCodePatientNoExist: "患者信息不存在!",
  257. ErrorCodeUpdatePatient: "修改患者信息失败",
  258. ErrorCodeDialysisSolutionExist: "该处方已经存在",
  259. ErrorCodeDialysisSolutionCreate: "创建处方失败",
  260. ErrorCodeDialysisSolutionUpdate: "修改处方失败",
  261. ErrorCodeDialysisSolutionNotExist: "该处方不存在",
  262. ErrorCodeParentDialysisSolutionNotExist: "上级处方不存在",
  263. ErrorCodeAlReadyHadChildSolution: "所选处方已经存在子方案",
  264. ErrorCodeCanntCreateChildChildSolution: "子方案不能添加子方案",
  265. ErrorCodeDialysisSolutionUsed: "处方已被使用,不能删除",
  266. ErrorCodeCreateDryWeightFail: "添加干体重失败",
  267. ErrorCodeCreateDoctorAdviceFail: "添加医嘱失败",
  268. ErrorCodeUpdateDoctorAdviceFail: "修改医嘱信息失败",
  269. ErrorCodeDoctorAdviceNotExist: "医嘱不存在",
  270. ErrorCodeLongTimeAdviceNotCanntEdit: "长期医嘱不能修改!",
  271. ErrorCodeAdviceStoped: "所选医嘱已停止",
  272. ErrorCodeParentAdviceNotExist: "上级医嘱不存在",
  273. ErrorCodeDeleteAdviceFail: "删除医嘱失败",
  274. ErrorCodeStopAdviceFail: "停止医嘱失败",
  275. ErrorCodeDialysisSolutionDelete: "删除方案失败",
  276. ErrorCodeDeviceNumberNotTheZone: "所选机号不在选择分区中",
  277. ErrorCodeCreateScheduleFail: "添加排班失败",
  278. ErrorCodeCantSetScheduleAgainOneDay: "同一天不可有两次排班",
  279. ErrorCodeCantSetScheduleBeforeNow: "不能给今天之前的日期排班",
  280. ErrorCodeCantDeleteScheduleBeforeNow: "不能删除今天之前的日期排班",
  281. ErrorCodeScheduleNotExist: "排班不存在",
  282. ErrorCodePointScheduleExist: "所先位置排班已经存在",
  283. ErrorCodeDeleteScheduleFail: "取消排班失败",
  284. ErrorCodeChangeScheduleFail: "修改排班失败",
  285. ErrorCodePatientPhoneUsed: "手机号已经存在",
  286. ErrorCodeAdviceExced: "医嘱已经执行",
  287. ErrorCodeAdviceCheckBeforeExce: "核对医嘱不能在执行医嘱之前",
  288. ErrorCodeAdviceExceBeforeStart: "执行医嘱不能在开始之前",
  289. ErrorCodeAdviceChecked: "医嘱已经核对",
  290. ErrorCodeExceAndCheckNotOneUser: "核对与执行不能是同一人",
  291. ErrorCodeCanotEditOtherAdvice: "不能修改非本人添加的医嘱",
  292. ErrorCodeEditLapsetoFail: "转归失败",
  293. ErrorCodeDelScheduleFailByDialysis: "已经上机透析,不能取消排班",
  294. ErrorCodeNotSelectLapsetoType: "请选择转归状态",
  295. ErrorCodeNotSelectLapsetoTime: "请选择转归时间",
  296. ErrorCodeInspectionDateExit: "当天已经存在检验检查记录",
  297. ErrorCodeInspectionAddFail: "添加记录失败",
  298. ErrorCodeInspectionDateNotExit: "当天不存在检验检查记录",
  299. ErrorCodeInspectionEditFail: "修改记录失败",
  300. ErrorCodeInspectionDeleteFail: "删除记录失败",
  301. ErrorCodeDeviceZoneNotExist: "设备分区不存在",
  302. ErrorCodeDeviceZoneNameRepeat: "该分区名已存在",
  303. ErrorCodeDeviceGroupNotExist: "设备分组不存在",
  304. ErrorCodeDeviceGroupNameRepeat: "该分组名已存在",
  305. ErrorCodeDeviceNumberNotExist: "机号不存在",
  306. ErrorCodeDeviceNumberRepeat: "该机号已存在",
  307. ErrorCodeDeviceNotExist: "该设备不存在",
  308. ErrorCodeDeviceZoneCannotDisable: "该分区存在床位号,不能删除",
  309. ErrorCodeDeviceNumberCannotDisableCuzDevice: "该床位存在设备,不能删除",
  310. ErrorCodeDeviceNumberCannotDisableCuzSchedule: "该床位尚有排班安排,不能删除",
  311. ErrorCodeDeviceNumberCannotDisableCuzSchTemplate: "排班模板在该床位尚有排班安排,不能删除",
  312. ErrorCodeNotSubscibe: "没有订阅服务或服务已过期,请先购买服务!",
  313. ErrorCodeServeNotExist: "服务订单不存在!",
  314. ErrorCodeInvoiceExist: "已经申请了发票!",
  315. ErrorCodeApplyInvoiceFail: "申请发票失败!",
  316. ErrorCodeHetongHad: "合同已经存在!",
  317. ErrorCodeCreateHetongFail: "合同创建失败",
  318. ErrorCodePatientReachLimit: "患者数已达到当前服务版本病人数,需要升级到更高的版本",
  319. ErrorCodeMonitorCreate: "创建监测失败",
  320. ErrorCodeMonitorNotExist: "监测记录不存在",
  321. ErrorCodeMonitorUpdate: "修改监测失败",
  322. ErrorCodeDialysisPermissionDeniedModify: "您没有权限修改其他医护的数据!",
  323. ErrorDialysisOrderNoStart: "尚未上机,无法执行下机操作",
  324. ErrorDialysisOrderNoEND: "已处于下机状态",
  325. ErrorDialysisOrderRepeatStart: "已上机",
  326. ErrorDialysisOrderRepeatBed: "该床位已有患者上机,请选择其他床位",
  327. //ErrorCodeScheduleTemplateNotExist: "排班模板不存在",
  328. ErrorCodeSystemError: "系统异常",
  329. ErrorCodeProductError: "该服务商品已丢失",
  330. ErrorCodeScheduleTemplateNotExist: "排班模板不存在",
  331. ErrorCodeCreateStockInFail: "入库失败",
  332. //ErrorCodeSystemError: "系统异常",
  333. //ErrorCodeProductError: "该服务商品已丢失",
  334. ErrorCodeFieldExist: "配置字段已存在",
  335. ErrorCodeCreateConfig: "创建配置失败",
  336. ErrorCodeUpdateConfig: "修改配置失败",
  337. ErrorCommitFail: "提交失败",
  338. ErrorCodeDoubleCheckWrong: "核对已完成, 无法再次提交",
  339. ErrorCodeDoubleCheckUserWrong: "你已完成核对,不能重复核对",
  340. ErrorCodeGoodNoStockInError: "该商品尚未入库",
  341. ErrorCodeCancelStockFail: "出库退库失败",
  342. ErrorCodeDeleteGoodTypeFail: "该类型存在商品信息,无法删除",
  343. ErrorCodeDeleteGoodInfoFail: "该商品已经入库或者出库无法删除",
  344. ErrorCodeDeleteFail: "删除失败",
  345. ErrorCodeKeyFail: "关键字不能为空",
  346. ErrorCodeDeleteStockInRecordFail: "该记录已经有出库或退货操作,无法删除",
  347. ErrorCodeNameWrong: "该模版名字已存在",
  348. ErrorCodeParamEmptyWrong: "模版名称不能为空",
  349. ErrorCodeParamAdviceEmptyWrong: "医嘱名称不能为空",
  350. ErrorCodeDeleteDealerWrong: "该经销商所属商品已入库无法删除",
  351. ErrorCodeDeleteManufacturerWrong: "该厂商所属商品已入库无法删除",
  352. ErrorCodeGoodTypeNameExistError: "该商品类型名字已存在",
  353. ErrorCodeGoodInfoNameExistError: "该规格名称名字已存在",
  354. ErrorCodePrescriptionPermissionDeniedModify: "您没有权限修改透析处方数据",
  355. ErrorCodeAdvicePermissionDeniedModify: "您没有权限添加医嘱",
  356. ErrorCodePrescriptionException: "上机失败,请先开处方",
  357. ErrorCodeNotDocking: "该地区尚未对接",
  358. ErrorCodeAdviceTypeWrong: "请选择医嘱模版类型",
  359. ErrorCodeCreateAdvice: "你没有权限开医嘱",
  360. ErrorCodePatientDialysisOrder: "该病人已经上机,无法临时排班",
  361. ErrorSchedualcRepeatBed: "该床位已经有人排班,无法临时排班",
  362. ErrorCodeChangeMode: "该患者今天已上机治疗,请在透析记录中进行调整透析模式",
  363. ErrorCodeChangeDeviceNumber: "该患者今天已上机治疗,请在透析记录中进行调整机号",
  364. ErrorCodeHisIdExist: "该his_id已被占用,请重新输入",
  365. ErrorCodePreExist: "没有该权限",
  366. ErrorCodeRepeatCreateOrg: "该账号已创建过机构了",
  367. ErrorCodeOrgNoExist: "该机构不存在",
  368. ErrorCodeRegisterExist: "该账号已经注册,请登录",
  369. ErrorCodeRepeatCreateStaffException: "该员工已经存在无法继续添加",
  370. ErrorCodeForbidden: "你已经被管理员禁用,无法使用该系统",
  371. ErrorCodeRoleNameIsExist: "该角色已经不存在",
  372. ErrorCodeRole: "尚未配置角色,无访问权限",
  373. ErrorCodeAdminUserIsExit: "用户不存在",
  374. ErrorCodePhone: "请填写正确的联系电话",
  375. ErrorCodeLogOut: "退出",
  376. ErrorCodeExportError: "导入出错,请下载并查看相关日志",
  377. ErrorCodeOrgNoPatient: "暂无病人",
  378. ErrorCodeDoctorAdviceEmpty: "没有更多了",
  379. ErrorCodeOpenStocktWrong: "未开启自动扣减功能,无法出库",
  380. ErrorCodeDrugRepeatDataException: "该药已经存在,无法添加",
  381. ErrorCodeIDCartNo: "身份证不能为空",
  382. ErrorCodeRegisterOneException: "无参保信息",
  383. ErrorCodeRegisterTwoException: "挂号失败",
  384. ErrorCodeCreateOrderException: "创建预结算订单失败",
  385. ErrorCodeCalOrderException: "结算失败",
  386. ErrorCodeHisRegisterException: "一天只能挂一个号",
  387. ErrorCodeNoBloodPatientException: "找不到该患者,请先在系统录入患者信息或检查患者身份证信息",
  388. ErrorCodeOrderParamWrong: "结算记录不存在",
  389. ErrorCodeHisPatientParamWrong: "订单正在结算、请先结算完成",
  390. ErrorCodeOutOfStockParamWrong: "库存不足",
  391. ErrorCodeOrderParamWrongTwo: "该就诊号存在结算记录,需要先退费后再退号",
  392. ErrorModeTemplateCodeParamWrong: "一种透析模式只能存在一个模版,无法添加该模版",
  393. ErrorCodeInHospitalNoExistDataException: "入院记录不存在",
  394. ErrorCodeHospitalNoExistDataException: "请先办理出院才能进行结算",
  395. ErrorCodeHospitalExistDataException: "该患者已经入院,请选办理出院结算后再进行办理入院操作",
  396. ErrorCodeRecordFailedException: "记录不存在",
  397. ErrorCodeStockExced: "请先出库,执行失败",
  398. ErrorPsnNoEmpty: "人员编码不能为空",
  399. ErrorEmployeeNumber: "请输入正确的工号",
  400. ErrorCheckGoodParamSuccess: "反审核成功!",
  401. ErrorCheckGoodParamWrong: "该入库单已出库,反审核失败!",
  402. ErrorCodeMedicineWrong: "处方中包含已发药的药品,无法保存或修改",
  403. ErrorCodeChargeWrong: "处方中包含已收费处方或已经上传的处方,无法保存或修改",
  404. ErrorCodeDeletePMedicineWrong: "处方中包含已发药的药品,无法删除",
  405. ErrorCodeDeletePChargeWrong: "处方中包含收费处方或已经上传的处方,无法删除",
  406. ErrorCodeDeleteMedicineWrong: "该药品已经发药,无法删除",
  407. ErrorCodeDeletePChargeWrongTwo: "该医嘱所属处方已经收费或已经上传的处方,无法删除",
  408. ErrorCodeHisPatientNoRegException: "该患者尚未挂号,请先挂号",
  409. ErrorCodeSchedule: "该班次该床位已有患者",
  410. ErrorCodeParamWrongForSchMode: "透析模式不能为空",
  411. ErrorCodePatientDialysisOrderOne: "替换的患者已经上机,无法替换排班",
  412. ErrorCodePatientDialysisOrderTwo: "被替换的患者已经上机,无法替换排班",
  413. ErrorCodePatientScheduleRepeat: "一天只能存在一次排班",
  414. ErrorCodeDelScheduleFailByDialysisTwo: "已经上机透析,不能操作排班",
  415. AdviceCodeParamWrong: "医嘱核对人和执行人不能为同一人,请更换第二核对人!",
  416. ErrorCodeInformationExist: "已经超过归档天数,不予编辑,请提交申请",
  417. ErrorScheduleCode: "未更改排班,保存失败!",
  418. ErrorAdivceCode: "该患者已开药,请先删除药品或耗材",
  419. ErrorTimeCodeParamWrong: "时间跨度不能超过一个月",
  420. ErrorCodeAuthWrong: "尚未实名认证,请先认证",
  421. }
  422. type SGJError struct {
  423. Code int
  424. }
  425. func (e *SGJError) Error() string {
  426. value, ok := ErrCodeMsgs[e.Code]
  427. if ok {
  428. return value
  429. } else {
  430. return "未知错误"
  431. }
  432. }
  433. func MakeSuccessResponseJSON(data map[string]interface{}) map[string]interface{} {
  434. json := make(map[string]interface{})
  435. if data != nil {
  436. json["data"] = data
  437. } else {
  438. json["data"] = make(map[string]interface{})
  439. }
  440. json["state"] = 1
  441. json["code"] = 0
  442. return json
  443. }
  444. func MakeFailResponseJSON(errMsg string, errCode int) map[string]interface{} {
  445. json := make(map[string]interface{})
  446. json["msg"] = errMsg
  447. json["code"] = errCode
  448. json["state"] = 0
  449. return json
  450. }
  451. func MakeDynamicFailResponseJSON(errMsg string) map[string]interface{} {
  452. json := make(map[string]interface{})
  453. json["msg"] = errMsg
  454. json["state"] = 0
  455. return json
  456. }
  457. func MakeFailResponseJSONWithSGJError(err *SGJError) map[string]interface{} {
  458. if err == nil {
  459. utils.WarningLog("MakeFailResponseJSONWithSGJError 参数err 不能为空")
  460. return nil
  461. }
  462. return MakeFailResponseJSON(err.Error(), err.Code)
  463. }
  464. func MakeFailResponseJSONWithSGJErrorCode(code int) map[string]interface{} {
  465. err := &SGJError{Code: code}
  466. return MakeFailResponseJSON(err.Error(), err.Code)
  467. }