main.go 38KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. package main
  2. import (
  3. //"github.com/qiniu/api.v7/auth/qbox"
  4. //"github.com/qiniu/api.v7/storage"
  5. _ "gdyb/routers"
  6. "gdyb/service"
  7. //"github.com/qiniu/api.v7/auth/qbox"
  8. //"github.com/qiniu/api.v7/storage"
  9. //"github.com/qiniu/roapi.v7/auth/qbox"
  10. //"github.com/qiniu/api.v7/storage"
  11. "github.com/astaxie/beego"
  12. //"strconv"
  13. //"time"
  14. )
  15. func init() {
  16. service.ConnectDB()
  17. org_id, _ := beego.AppConfig.Int64("org_id")
  18. miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  19. //CreateLog(miConfig)
  20. //UploadLog(miConfig)
  21. if org_id == 10191 {
  22. service.GetFjAuthorizationInfo(miConfig.Code)
  23. }
  24. }
  25. func main() {
  26. beego.Run()
  27. }
  28. type CustomFundPay struct {
  29. FundPayType string `json:"fund_pay_type"`
  30. FundPayamt float64 `json:"fund_payamt"`
  31. }
  32. type ResultSeventeen struct {
  33. ErrMsg string `json:"err_msg"`
  34. InfRefmsgid string `json:"inf_refmsgid"`
  35. Infcode int64 `json:"infcode"`
  36. Output struct {
  37. SetlListId string `json:"setl_list_id"`
  38. } `json:"output"`
  39. RefmsgTime string `json:"refmsg_time"`
  40. RespondTime string `json:"respond_time"`
  41. Signtype string `json:"signtype"`
  42. WarnInfo string `json:"warn_info"`
  43. }
  44. //func UploadSettleList(org_id int64) {
  45. // orders, _ := service.GetAllHisOrder(org_id)
  46. // for _, item := range orders {
  47. // order_id := item.ID
  48. // order, _ := service.GetHisOrderByIDTwo(order_id)
  49. // roles, _ := service.GetDoctorListTwo(org_id)
  50. // his, _ := service.GetHisPatientByNumber(order.MdtrtId)
  51. // admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
  52. // curRoles, _ := service.GetAdminUserInfo(org_id)
  53. // depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
  54. // miConfig, _ := service.FindMedicalInsuranceInfo(org_id)
  55. //
  56. // result, _ := service.GetHisFundSettleListResult(order_id)
  57. // //判断是否已经上传过医保,上传过就跳过该条记录
  58. // if result.ID > 0 {
  59. // continue
  60. // }
  61. //
  62. // if his.BalanceAccountsType == 2 {
  63. // continue
  64. // }
  65. //
  66. // struct4101 := service.Struct4101{
  67. // PsnNo: order.PsnNo,
  68. // MdtrtId: order.MdtrtId,
  69. // SetlId: order.SetlId,
  70. // PsnName: order.PsnName,
  71. // Gend: order.Gend,
  72. // Brdy: his.Brdy,
  73. // Age: his.Age,
  74. // Naty: order.Naty,
  75. // PatnCertType: "01",
  76. // Certno: order.Certno,
  77. // Prfs: "90",
  78. // ConerName: roles[0].UserName,
  79. // PatnRlts: "99",
  80. // ConerAddr: miConfig.OrgName,
  81. // ConerTel: admin.Mobile,
  82. // HiType: order.Insutype,
  83. // Insuplc: his.InsuplcAdmdvs,
  84. // MaindiagFlag: "1",
  85. // BillCode: order.FaPiaoCode,
  86. // BillNo: order.FaPiaoNumber,
  87. // BizSn: order.Number,
  88. // PsnSelfPay: order.PsnPartAmt,
  89. // PsnOwnPay: order.PsnPartAmt,
  90. // AcctPay: order.AcctPay,
  91. // PsnCashpay: order.PsnCashPay,
  92. // HiPaymtd: "1",
  93. // Hsorg: his.InsuplcAdmdvs,
  94. // HsorgOpter: his.InsuplcAdmdvs,
  95. // MedinsFillPsn: curRoles.UserName,
  96. // MedinsFillDept: depart.Name,
  97. // IptMedType: "2",
  98. // }
  99. // struct4101.SetlBegnDate = order.SetlTime
  100. // struct4101.SetlEndDate = order.SetlTime
  101. // //if order.SettleType == 1 {
  102. // // t := time.Unix(int64(order.SettleAccountsDate), 0)
  103. // // dateStr := t.Format("2006-01-02")
  104. // // struct4101.SetlBegnDate = dateStr
  105. // // struct4101.SetlEndDate = dateStr
  106. // //} else {
  107. // // t := time.Unix(int64(order.SettleStartTime), 0)
  108. // // t2 := time.Unix(int64(order.SettleEndTime), 0)
  109. // // dateStartStr := t.Format("2006-01-02")
  110. // // dateEndStr := t2.Format("2006-01-02")
  111. // // struct4101.SetlBegnDate = dateStartStr
  112. // // struct4101.SetlEndDate = dateEndStr
  113. // //}
  114. //
  115. // var rf []CustomFundPay
  116. // json.Unmarshal([]byte(order.SetlDetail), &rf)
  117. //
  118. // var tempFunPays []service.CustomStruct
  119. // var tempFunPay610100 service.CustomStruct
  120. //
  121. // for _, item := range rf {
  122. // if item.FundPayType == "610100" {
  123. // tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
  124. // tempFunPay610100.FundPayType = item.FundPayType
  125. // } else {
  126. // var tempFunPay service.CustomStruct
  127. // tempFunPay.FundPayamt = item.FundPayamt
  128. // tempFunPay.FundPayType = item.FundPayType
  129. // tempFunPays = append(tempFunPays, tempFunPay)
  130. // }
  131. // }
  132. // tempFunPays = append(tempFunPays, tempFunPay610100)
  133. // struct4101.CustomStruct = tempFunPays
  134. //
  135. // var tempOpspdiseinfos []service.OpspdiseinfoStruct
  136. // var tempOpspdiseinfo2 service.OpspdiseinfoStruct
  137. // //sickConfig, _ := service.FindDiagnoseById(his.Diagnosis)
  138. //
  139. // diagnosis_ids := strings.Split(his.Diagnosis, ",")
  140. // var config []*models.HisXtDiagnoseConfig
  141. // for _, item := range diagnosis_ids {
  142. // id, _ := strconv.ParseInt(item, 10, 64)
  143. // diagnosisConfig, _ := service.FindDiagnoseById(id)
  144. // config = append(config, &diagnosisConfig)
  145. // }
  146. //
  147. // for _, item := range config {
  148. // var tempOpspdiseinfo service.OpspdiseinfoStruct
  149. // tempOpspdiseinfo.DiagCode = item.CountryCode
  150. // tempOpspdiseinfo.DiagName = item.CountryContentName
  151. // tempOpspdiseinfo.MaindiagFlag = "1"
  152. // tempOpspdiseinfo.OprnOprtCode = ""
  153. // tempOpspdiseinfo.OprnOprtName = ""
  154. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo)
  155. // }
  156. //
  157. // sickConfigTwo, _ := service.FindSickById(his.SickType)
  158. // tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
  159. // tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
  160. // tempOpspdiseinfo2.MaindiagFlag = "2"
  161. // tempOpspdiseinfo2.OprnOprtCode = ""
  162. // tempOpspdiseinfo2.OprnOprtName = ""
  163. // tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
  164. // struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
  165. //
  166. // var iteminfo service.IteminfoStruct
  167. //
  168. // var bedCostTotal float64 = 0 //床位总费
  169. // var bedCostSelfTotal float64 = 0 //床位自费
  170. // var bedCostPartSelfTotal float64 = 0 //床位部分项目自费
  171. //
  172. // var examineCostTotal float64 = 0 //诊查总费
  173. // var examineCostSelfTotal float64 = 0 //诊查自费
  174. // var examineCostPartSelfTotal float64 = 0 //诊查部分项目自费
  175. //
  176. // var nursingCostTotal float64 = 0 //护理总费
  177. // var nursingCostSelfTotal float64 = 0 //护理自费
  178. // var nursingCostPartSelfTotal float64 = 0 //护理部分项目自费
  179. //
  180. // var chineseMedicineCostTotal float64 = 0 //中成药
  181. // var chineseMedicineCostSelfTotal float64 = 0 //中成药
  182. // var chineseMedicineCostPartSelfTotal float64 = 0 //中成药
  183. //
  184. // var commonlyTreatmentCostTotal float64 = 0 //一般诊疗费
  185. // var commonlyTreatmentCostSelfTotal float64 = 0 //一般诊疗费
  186. // var commonlyTreatmentCostPartSelfTotal float64 = 0 //一般诊疗费
  187. //
  188. // var registerCostTotal float64 = 0 //一般诊疗费
  189. // var registerCostSelfTotal float64 = 0 //一般诊疗费
  190. // var registerPartSelfTotal float64 = 0 //一般诊疗费
  191. //
  192. // var operationCostTotal float64 = 0 //手术费
  193. // var operationCostSelfTotal float64 = 0 //手术费
  194. // var operationCostPartSelfTotal float64 = 0 //手术费
  195. //
  196. // var otherCostTotal float64 = 0 //其他费用
  197. // var otherCostSelfTotal float64 = 0 //其他费用
  198. // var otherCostPartSelfTotal float64 = 0 //其他费用
  199. //
  200. // var materialCostTotal float64 = 0 //材料费
  201. // var materialCostSelfTotal float64 = 0 //材料费
  202. // var materialCostPartSelfTotal float64 = 0 //材料费
  203. //
  204. // var westernMedicineCostTotal float64 = 0 //西药费
  205. // var westernMedicineCostSelfTotal float64 = 0 //西药费
  206. // var westernMedicineCostPartSelfTotal float64 = 0 //西药费
  207. //
  208. // var chineseTraditionalMedicineCostTotal float64 = 0 //中成药
  209. // var chineseTraditionalMedicineCostSelfTotal float64 = 0 //中成药
  210. // var chineseTraditionalMedicineCostPartSelfTotal float64 = 0 //中成药
  211. //
  212. // var checkCostTotal float64 = 0 //检查费
  213. // var checkCostSelfTotal float64 = 0 //检查费
  214. // var checkCostPartSelfTotal float64 = 0 //检查费
  215. //
  216. // var laboratoryCostTotal float64 = 0 //化验费
  217. // var laboratoryCostSelfTotal float64 = 0 //化验费
  218. // var laboratoryCostPartSelfTotal float64 = 0 //化验费
  219. //
  220. // var treatCostTotal float64 = 0 //治疗费用
  221. // var treatCostSelfTotal float64 = 0 //治疗费用
  222. // var treatCostPartSelfTotal float64 = 0 //治疗费用
  223. //
  224. // decimal.DivisionPrecision = 2
  225. //
  226. // var bed_fulamt_ownpay_amt float64 = 0
  227. //
  228. // var examine_fulamt_ownpay_amt float64 = 0
  229. //
  230. // var nursing_fulamt_ownpay_amt float64 = 0
  231. //
  232. // var chinese_medicine_fulamt_ownpay_amt float64 = 0
  233. //
  234. // var commonly_treatment_fulamt_ownpay_amt float64 = 0
  235. //
  236. // var register_fulamt_ownpay_amt float64 = 0
  237. //
  238. // var operation_fulamt_ownpay_amt float64 = 0
  239. // var other_fulamt_ownpay_amt float64 = 0
  240. // var westernMedicine_fulamt_ownpay_amt float64 = 0
  241. // var chineseTraditional_fulamt_ownpay_amt float64 = 0
  242. // var check_fulamt_ownpay_amt float64 = 0
  243. // var material_fulamt_ownpay_amt float64 = 0
  244. // var laboratory_fulamt_ownpay_amt float64 = 0
  245. // var treat_fulamt_ownpay_amt float64 = 0
  246. //
  247. // var bed_claa_sunmfee float64 = 0
  248. // var bed_clab_amt float64 = 0
  249. // var bed_other_amt float64 = 0
  250. //
  251. // var examine_claa_sunmfee float64 = 0
  252. // var examine_clab_amt float64 = 0
  253. // var examine_other_amt float64 = 0
  254. //
  255. // var nursing_claa_sunmfee float64 = 0
  256. // var nursing_clab_amt float64 = 0
  257. // var nursing_other_amt float64 = 0
  258. //
  259. // var chinese_medicine_claa_sunmfee float64 = 0
  260. // var chinese_medicine_clab_amt float64 = 0
  261. // var chinese_medicine_other_amt float64 = 0
  262. //
  263. // var commonly_treatment_claa_sunmfee float64 = 0
  264. // var commonly_treatment_clab_amt float64 = 0
  265. // var commonly_treatment_other_amt float64 = 0
  266. //
  267. // var operation_claa_sunmfee float64 = 0
  268. // var operation_clab_amt float64 = 0
  269. // var operation_other_amt float64 = 0
  270. //
  271. // var other_claa_sunmfee float64 = 0
  272. // var other_clab_amt float64 = 0
  273. // var other_other_amt float64 = 0
  274. //
  275. // var westernMedicine_claa_sunmfee float64 = 0
  276. // var westernMedicine_clab_amt float64 = 0
  277. // var westernMedicine_other_amt float64 = 0
  278. //
  279. // var chineseTraditional_claa_sunmfee float64 = 0
  280. // var chineseTraditional_clab_amt float64 = 0
  281. // var chineseTraditional_other_amt float64 = 0
  282. //
  283. // var check_claa_sunmfee float64 = 0
  284. // var check_clab_amt float64 = 0
  285. // var check_other_amt float64 = 0
  286. //
  287. // var material_claa_sunmfee float64 = 0
  288. // var material_clab_amt float64 = 0
  289. // var material_other_amt float64 = 0
  290. //
  291. // var laboratory_claa_sunmfee float64 = 0
  292. // var laboratory_clab_amt float64 = 0
  293. // var laboratory_other_amt float64 = 0
  294. //
  295. // var treat_claa_sunmfee float64 = 0
  296. // var treat_clab_amt float64 = 0
  297. // var treat_other_amt float64 = 0
  298. //
  299. // var register_claa_sunmfee float64 = 0
  300. // var register_clab_amt float64 = 0
  301. // var register_other_amt float64 = 0
  302. //
  303. // for _, item := range order.HisOrderInfo {
  304. // if item.MedChrgitmType == "01" { //床位费
  305. // bedCostTotal, _ = decimal.NewFromFloat(bedCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  306. // bedCostSelfTotal, _ = decimal.NewFromFloat(bedCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  307. // bedCostPartSelfTotal, _ = decimal.NewFromFloat(bedCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  308. // bed_fulamt_ownpay_amt, _ = decimal.NewFromFloat(bed_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  309. // if item.ChrgitmLv == "1" {
  310. // bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  311. // }
  312. // if item.ChrgitmLv == "2" {
  313. // bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  314. //
  315. // }
  316. // if item.ChrgitmLv == "3" {
  317. // bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  318. // }
  319. //
  320. // }
  321. //
  322. // if item.MedChrgitmType == "02" { //诊查
  323. // examineCostTotal, _ = decimal.NewFromFloat(examineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  324. // examineCostSelfTotal, _ = decimal.NewFromFloat(examineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  325. // examineCostPartSelfTotal, _ = decimal.NewFromFloat(examineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  326. // examine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(examine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  327. // if item.ChrgitmLv == "1" {
  328. // examine_claa_sunmfee, _ = decimal.NewFromFloat(examine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  329. // }
  330. // if item.ChrgitmLv == "2" {
  331. // examine_clab_amt, _ = decimal.NewFromFloat(examine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  332. //
  333. // }
  334. // if item.ChrgitmLv == "3" {
  335. // examine_other_amt, _ = decimal.NewFromFloat(examine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  336. // }
  337. //
  338. // }
  339. //
  340. // if item.MedChrgitmType == "03" { //检查费
  341. // checkCostTotal, _ = decimal.NewFromFloat(checkCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  342. // checkCostSelfTotal, _ = decimal.NewFromFloat(checkCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  343. // checkCostPartSelfTotal, _ = decimal.NewFromFloat(checkCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  344. // check_fulamt_ownpay_amt, _ = decimal.NewFromFloat(check_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  345. // if item.ChrgitmLv == "1" {
  346. //
  347. // check_claa_sunmfee, _ = decimal.NewFromFloat(check_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  348. //
  349. // }
  350. // if item.ChrgitmLv == "2" {
  351. // check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  352. //
  353. // }
  354. // if item.ChrgitmLv == "3" {
  355. // check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  356. // }
  357. // }
  358. //
  359. // if item.MedChrgitmType == "04" { //化验费
  360. // laboratoryCostTotal, _ = decimal.NewFromFloat(laboratoryCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  361. // laboratoryCostSelfTotal, _ = decimal.NewFromFloat(laboratoryCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  362. // laboratoryCostPartSelfTotal, _ = decimal.NewFromFloat(laboratoryCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  363. // laboratory_fulamt_ownpay_amt, _ = decimal.NewFromFloat(laboratory_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  364. // if item.ChrgitmLv == "1" {
  365. //
  366. // laboratory_claa_sunmfee, _ = decimal.NewFromFloat(laboratory_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  367. //
  368. // }
  369. // if item.ChrgitmLv == "2" {
  370. // laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  371. //
  372. // }
  373. // if item.ChrgitmLv == "3" {
  374. // laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  375. // }
  376. // }
  377. //
  378. // if item.MedChrgitmType == "05" { //治疗费
  379. // treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  380. // treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  381. // treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  382. // treat_fulamt_ownpay_amt, _ = decimal.NewFromFloat(treat_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  383. // if item.ChrgitmLv == "1" {
  384. //
  385. // treat_claa_sunmfee, _ = decimal.NewFromFloat(treat_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  386. //
  387. // }
  388. // if item.ChrgitmLv == "2" {
  389. // treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  390. //
  391. // }
  392. // if item.ChrgitmLv == "3" {
  393. // treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  394. // }
  395. // }
  396. //
  397. // if item.MedChrgitmType == "06" { //手术费
  398. // operationCostTotal, _ = decimal.NewFromFloat(operationCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  399. // operationCostSelfTotal, _ = decimal.NewFromFloat(operationCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  400. // operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  401. // operation_fulamt_ownpay_amt, _ = decimal.NewFromFloat(operation_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  402. //
  403. // if item.ChrgitmLv == "1" {
  404. //
  405. // operation_claa_sunmfee, _ = decimal.NewFromFloat(operation_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  406. //
  407. // }
  408. // if item.ChrgitmLv == "2" {
  409. // operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  410. //
  411. // }
  412. // if item.ChrgitmLv == "3" {
  413. // operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  414. // }
  415. // }
  416. //
  417. // if item.MedChrgitmType == "07" { //手术费
  418. // nursingCostTotal, _ = decimal.NewFromFloat(nursingCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  419. // nursingCostSelfTotal, _ = decimal.NewFromFloat(nursingCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  420. // nursingCostPartSelfTotal, _ = decimal.NewFromFloat(nursingCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  421. // nursing_fulamt_ownpay_amt, _ = decimal.NewFromFloat(nursing_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  422. //
  423. // if item.ChrgitmLv == "1" {
  424. //
  425. // nursing_claa_sunmfee, _ = decimal.NewFromFloat(nursing_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  426. //
  427. // }
  428. // if item.ChrgitmLv == "2" {
  429. // nursing_clab_amt, _ = decimal.NewFromFloat(nursing_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  430. //
  431. // }
  432. // if item.ChrgitmLv == "3" {
  433. // nursing_other_amt, _ = decimal.NewFromFloat(nursing_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  434. // }
  435. // }
  436. //
  437. // if item.MedChrgitmType == "08" { //材料费
  438. // materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  439. // materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  440. // materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  441. // material_fulamt_ownpay_amt, _ = decimal.NewFromFloat(material_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  442. // if item.ChrgitmLv == "1" {
  443. //
  444. // material_claa_sunmfee, _ = decimal.NewFromFloat(material_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  445. //
  446. // }
  447. // if item.ChrgitmLv == "2" {
  448. // material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  449. //
  450. // }
  451. // if item.ChrgitmLv == "3" {
  452. // material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  453. // }
  454. // }
  455. // if item.MedChrgitmType == "09" { //西药费
  456. // westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  457. // westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  458. // westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  459. // westernMedicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(westernMedicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  460. // if item.ChrgitmLv == "1" {
  461. // westernMedicine_claa_sunmfee, _ = decimal.NewFromFloat(westernMedicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  462. // }
  463. // if item.ChrgitmLv == "2" {
  464. // westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  465. // }
  466. // if item.ChrgitmLv == "3" {
  467. // westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  468. // }
  469. // }
  470. // if item.MedChrgitmType == "10" { //中药饮片
  471. // chineseMedicineCostTotal, _ = decimal.NewFromFloat(chineseMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  472. // chineseMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  473. // chineseMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  474. // chinese_medicine_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chinese_medicine_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  475. // if item.ChrgitmLv == "1" {
  476. // chinese_medicine_claa_sunmfee, _ = decimal.NewFromFloat(chinese_medicine_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  477. // }
  478. // if item.ChrgitmLv == "2" {
  479. // chinese_medicine_clab_amt, _ = decimal.NewFromFloat(chinese_medicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  480. // }
  481. // if item.ChrgitmLv == "3" {
  482. // chinese_medicine_other_amt, _ = decimal.NewFromFloat(chinese_medicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  483. // }
  484. // }
  485. //
  486. // if item.MedChrgitmType == "11" { //中成费
  487. // chineseTraditionalMedicineCostTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  488. // chineseTraditionalMedicineCostSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  489. // chineseTraditionalMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(chineseTraditionalMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  490. // chineseTraditional_fulamt_ownpay_amt, _ = decimal.NewFromFloat(chineseTraditional_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  491. // if item.ChrgitmLv == "1" {
  492. //
  493. // chineseTraditional_claa_sunmfee, _ = decimal.NewFromFloat(chineseTraditional_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  494. //
  495. // }
  496. // if item.ChrgitmLv == "2" {
  497. // chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  498. //
  499. // }
  500. // if item.ChrgitmLv == "3" {
  501. // chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  502. // }
  503. // }
  504. //
  505. // if item.MedChrgitmType == "12" { //中成费
  506. // commonlyTreatmentCostTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  507. // commonlyTreatmentCostSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  508. // commonlyTreatmentCostPartSelfTotal, _ = decimal.NewFromFloat(commonlyTreatmentCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  509. // commonly_treatment_fulamt_ownpay_amt, _ = decimal.NewFromFloat(commonly_treatment_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  510. // if item.ChrgitmLv == "1" {
  511. //
  512. // commonly_treatment_claa_sunmfee, _ = decimal.NewFromFloat(commonly_treatment_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  513. //
  514. // }
  515. // if item.ChrgitmLv == "2" {
  516. // commonly_treatment_clab_amt, _ = decimal.NewFromFloat(commonly_treatment_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  517. //
  518. // }
  519. // if item.ChrgitmLv == "3" {
  520. // commonly_treatment_other_amt, _ = decimal.NewFromFloat(commonly_treatment_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  521. // }
  522. // }
  523. //
  524. // if item.MedChrgitmType == "13" { //中成费
  525. // registerCostTotal, _ = decimal.NewFromFloat(registerCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  526. // registerCostSelfTotal, _ = decimal.NewFromFloat(registerCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  527. // registerPartSelfTotal, _ = decimal.NewFromFloat(registerPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  528. // register_fulamt_ownpay_amt, _ = decimal.NewFromFloat(register_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  529. // if item.ChrgitmLv == "1" {
  530. //
  531. // register_claa_sunmfee, _ = decimal.NewFromFloat(register_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  532. //
  533. // }
  534. // if item.ChrgitmLv == "2" {
  535. // register_clab_amt, _ = decimal.NewFromFloat(register_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  536. //
  537. // }
  538. // if item.ChrgitmLv == "3" {
  539. // register_other_amt, _ = decimal.NewFromFloat(register_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  540. // }
  541. // }
  542. //
  543. // if item.MedChrgitmType == "14" { //其他费
  544. // otherCostTotal, _ = decimal.NewFromFloat(otherCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  545. // otherCostSelfTotal, _ = decimal.NewFromFloat(otherCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  546. // otherCostPartSelfTotal, _ = decimal.NewFromFloat(otherCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  547. // other_fulamt_ownpay_amt, _ = decimal.NewFromFloat(other_fulamt_ownpay_amt).Add(decimal.NewFromFloat(item.FulamtOwnpayAmt)).Float64()
  548. // if item.ChrgitmLv == "1" {
  549. // other_claa_sunmfee, _ = decimal.NewFromFloat(other_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
  550. //
  551. // }
  552. // if item.ChrgitmLv == "2" {
  553. // other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
  554. //
  555. // }
  556. // if item.ChrgitmLv == "3" {
  557. // other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
  558. // }
  559. // }
  560. //
  561. // }
  562. //
  563. // var iteminfoStructs []service.IteminfoStruct
  564. //
  565. // if bedCostTotal != 0 {
  566. // iteminfo.MedChrgitm = "01"
  567. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  568. // iteminfo.Amt = bedCostTotal
  569. // iteminfo.ClaaSumfee = bed_claa_sunmfee
  570. // iteminfo.ClabAmt = bed_clab_amt
  571. // iteminfo.OthAmt = bed_other_amt
  572. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  573. // }
  574. //
  575. // if examineCostTotal != 0 {
  576. // iteminfo.MedChrgitm = "02"
  577. // iteminfo.FulamtOwnpayAmt = examine_fulamt_ownpay_amt
  578. // iteminfo.Amt = examineCostTotal
  579. // iteminfo.ClaaSumfee = examine_claa_sunmfee
  580. // iteminfo.ClabAmt = examine_clab_amt
  581. // iteminfo.OthAmt = examine_other_amt
  582. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  583. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  584. // }
  585. //
  586. // if checkCostTotal != 0 {
  587. // iteminfo.MedChrgitm = "03"
  588. // iteminfo.FulamtOwnpayAmt = check_fulamt_ownpay_amt
  589. // iteminfo.Amt = checkCostTotal
  590. // iteminfo.ClaaSumfee = check_claa_sunmfee
  591. // iteminfo.ClabAmt = check_clab_amt
  592. // iteminfo.OthAmt = check_other_amt
  593. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  594. //
  595. // }
  596. //
  597. // if laboratoryCostTotal != 0 {
  598. // iteminfo.MedChrgitm = "04"
  599. // iteminfo.FulamtOwnpayAmt = laboratory_fulamt_ownpay_amt
  600. // iteminfo.Amt = laboratoryCostTotal
  601. // iteminfo.ClaaSumfee = laboratory_claa_sunmfee
  602. // iteminfo.ClabAmt = laboratory_clab_amt
  603. // iteminfo.OthAmt = laboratory_other_amt
  604. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  605. //
  606. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  607. //
  608. // }
  609. //
  610. // if treatCostTotal != 0 {
  611. // iteminfo.MedChrgitm = "05"
  612. // iteminfo.FulamtOwnpayAmt = treat_fulamt_ownpay_amt
  613. // iteminfo.Amt = treatCostTotal
  614. // iteminfo.ClaaSumfee = treat_claa_sunmfee
  615. // iteminfo.ClabAmt = treat_clab_amt
  616. // iteminfo.OthAmt = treat_other_amt
  617. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  618. // //(struct4101.IteminfoStruct, iteminfo)
  619. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  620. // }
  621. //
  622. // if operationCostTotal != 0 {
  623. // iteminfo.MedChrgitm = "06"
  624. // iteminfo.FulamtOwnpayAmt = bed_fulamt_ownpay_amt
  625. // iteminfo.Amt = operationCostTotal
  626. // iteminfo.ClaaSumfee = operation_claa_sunmfee
  627. // iteminfo.ClabAmt = operation_clab_amt
  628. // iteminfo.OthAmt = operation_other_amt
  629. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  630. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  631. // }
  632. //
  633. // if nursingCostTotal != 0 {
  634. // iteminfo.MedChrgitm = "07"
  635. // iteminfo.FulamtOwnpayAmt = nursing_fulamt_ownpay_amt
  636. // iteminfo.Amt = nursingCostTotal
  637. // iteminfo.ClaaSumfee = nursing_claa_sunmfee
  638. // iteminfo.ClabAmt = nursing_clab_amt
  639. // iteminfo.OthAmt = nursing_other_amt
  640. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  641. // }
  642. //
  643. // if materialCostTotal != 0 {
  644. // iteminfo.MedChrgitm = "08"
  645. // iteminfo.FulamtOwnpayAmt = material_fulamt_ownpay_amt
  646. // iteminfo.Amt = materialCostTotal
  647. // iteminfo.ClaaSumfee = material_claa_sunmfee
  648. // iteminfo.ClabAmt = material_clab_amt
  649. // iteminfo.OthAmt = material_other_amt
  650. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  651. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  652. // }
  653. //
  654. // if westernMedicineCostTotal != 0 {
  655. // iteminfo.MedChrgitm = "09"
  656. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  657. // iteminfo.Amt = westernMedicineCostTotal
  658. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  659. // iteminfo.ClabAmt = westernMedicine_clab_amt
  660. // iteminfo.OthAmt = westernMedicine_other_amt
  661. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  662. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  663. //
  664. // }
  665. //
  666. // if chineseMedicineCostTotal != 0 {
  667. // iteminfo.MedChrgitm = "10"
  668. // iteminfo.FulamtOwnpayAmt = chinese_medicine_fulamt_ownpay_amt
  669. // iteminfo.Amt = chineseMedicineCostTotal
  670. // iteminfo.ClaaSumfee = chinese_medicine_claa_sunmfee
  671. // iteminfo.ClabAmt = chinese_medicine_clab_amt
  672. // iteminfo.OthAmt = chinese_medicine_other_amt
  673. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  674. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  675. //
  676. // }
  677. //
  678. // if chineseTraditionalMedicineCostTotal != 0 {
  679. // iteminfo.MedChrgitm = "11"
  680. // iteminfo.FulamtOwnpayAmt = westernMedicine_fulamt_ownpay_amt
  681. // iteminfo.Amt = westernMedicineCostTotal
  682. // iteminfo.ClaaSumfee = westernMedicine_claa_sunmfee
  683. // iteminfo.ClabAmt = westernMedicine_clab_amt
  684. // iteminfo.OthAmt = westernMedicine_other_amt
  685. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  686. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  687. //
  688. // }
  689. //
  690. // if commonlyTreatmentCostTotal != 0 {
  691. // iteminfo.MedChrgitm = "12"
  692. // iteminfo.FulamtOwnpayAmt = commonly_treatment_fulamt_ownpay_amt
  693. // iteminfo.Amt = commonlyTreatmentCostTotal
  694. // iteminfo.ClaaSumfee = commonly_treatment_claa_sunmfee
  695. // iteminfo.ClabAmt = commonly_treatment_clab_amt
  696. // iteminfo.OthAmt = commonly_treatment_other_amt
  697. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  698. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  699. //
  700. // }
  701. //
  702. // if registerCostTotal != 0 {
  703. // iteminfo.MedChrgitm = "13"
  704. // iteminfo.FulamtOwnpayAmt = register_fulamt_ownpay_amt
  705. // iteminfo.Amt = registerCostTotal
  706. // iteminfo.ClaaSumfee = register_claa_sunmfee
  707. // iteminfo.ClabAmt = register_clab_amt
  708. // iteminfo.OthAmt = register_other_amt
  709. // //struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
  710. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  711. //
  712. // }
  713. //
  714. // if otherCostTotal != 0 {
  715. // iteminfo.MedChrgitm = "14"
  716. // iteminfo.FulamtOwnpayAmt = other_fulamt_ownpay_amt
  717. // iteminfo.Amt = otherCostTotal
  718. // iteminfo.ClaaSumfee = other_claa_sunmfee
  719. // iteminfo.ClabAmt = other_clab_amt
  720. // iteminfo.OthAmt = other_other_amt
  721. // iteminfoStructs = append(iteminfoStructs, iteminfo)
  722. //
  723. // }
  724. // struct4101.IteminfoStruct = iteminfoStructs
  725. // struct4101.Ntly = "中国"
  726. // struct4101.AdmCaty = "A03.06"
  727. // result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
  728. // fmt.Println(result)
  729. //
  730. // var dat map[string]interface{}
  731. // if err := json.Unmarshal([]byte(result), &dat); err == nil {
  732. // fmt.Println(dat)
  733. // } else {
  734. // fmt.Println(err)
  735. // }
  736. // userJSONBytes, _ := json.Marshal(dat)
  737. // var res ResultSeventeen
  738. // if err := json.Unmarshal(userJSONBytes, &res); err != nil {
  739. // utils.ErrorLog("解析失败:%v", err)
  740. // //c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
  741. // errlog := &models.HisOrderError{
  742. // UserOrgId: org_id,
  743. // Ctime: time.Now().Unix(),
  744. // Mtime: time.Now().Unix(),
  745. // ErrMsg: res.ErrMsg + "解析失败",
  746. // Status: 1,
  747. // PatientId: order_id,
  748. // Stage: 120,
  749. // }
  750. // service.CreateErrMsgLog(errlog)
  751. // continue
  752. // }
  753. //
  754. // if res.Infcode != 0 {
  755. // errlog := &models.HisOrderError{
  756. // UserOrgId: org_id,
  757. // Ctime: time.Now().Unix(),
  758. // Mtime: time.Now().Unix(),
  759. // ErrMsg: res.ErrMsg,
  760. // Status: 1,
  761. // PatientId: order_id,
  762. // Stage: 200,
  763. // }
  764. // service.CreateErrMsgLog(errlog)
  765. // continue
  766. // } else {
  767. // hisFundSettleListResult := &models.HisFundSettleListResult{
  768. // Number: res.Output.SetlListId,
  769. // Status: 1,
  770. // Ctime: time.Now().Unix(),
  771. // Mtime: time.Now().Unix(),
  772. // UserOrgId: org_id,
  773. // IsUpload: 1,
  774. // OrderId: order_id,
  775. // }
  776. // service.CreateUploadRecord(hisFundSettleListResult)
  777. // continue
  778. // }
  779. // }
  780. //}
  781. //func CreateLog(miConfig models.MedicalInsuranceOrgConfig) {
  782. // Mkdir(miConfig.OrgName + "日志")
  783. // //org_id,_ := beego.AppConfig.Int("org_id")
  784. // month := time.Unix(1557042972, 0).Format("1")
  785. // year := time.Now().Format("2006")
  786. // month = time.Now().Format("01")
  787. // day := time.Now().Format("02")
  788. // file := strconv.FormatInt(miConfig.UserOrgId, 10) + "_" + year + month + day + "_log"
  789. // file_name := file + ".txt"
  790. // file_path := miConfig.OrgName + "日志" + "/" + file_name
  791. // exist, _ := PathExists(file_path)
  792. // if exist { //存在
  793. // fmt.Println("存在")
  794. // f, err := os.OpenFile(file_path, os.O_WRONLY, 0644)
  795. // if err != nil {
  796. // fmt.Println("read fail")
  797. // }
  798. // content := "\r\r\r"
  799. // n, _ := f.Seek(0, 2)
  800. // _, err = f.WriteAt([]byte(content), n)
  801. //
  802. // } else { //不存在
  803. // fmt.Println("文件不存在,创建文件")
  804. // f, err := os.Create(miConfig.OrgName + "日志" + "/" + file_name)
  805. // defer f.Close()
  806. // if err != nil {
  807. // } else {
  808. // _, err = f.Write([]byte("记录日志"))
  809. // }
  810. // }
  811. //
  812. //}
  813. //func UploadLog(miConfig models.MedicalInsuranceOrgConfig) {
  814. // //获取七牛云上的文件信息,不存在则表示没上传到七牛云,上传昨天日志信息
  815. // nTime := time.Now()
  816. // yesTime := nTime.AddDate(0, 0, -1)
  817. // file_key := strconv.FormatInt(miConfig.UserOrgId, 10) + "_" + yesTime.Format("20060102") + "_log.txt"
  818. // mac := qbox.NewMac(beego.AppConfig.String("qiniu_accesskey"), beego.AppConfig.String("qiniu_secretkey"))
  819. // cfg := storage.Config{
  820. // // 是否使用https域名进行资源管理
  821. // UseHTTPS: true,
  822. // }
  823. // // 指定空间所在的区域,如果不指定将自动探测
  824. // // 如果没有特殊需求,默认不需要指定
  825. // //cfg.Zone=&storage.ZoneHuabei
  826. // bucketManager := storage.NewBucketManager(mac, &cfg)
  827. // bucket := beego.AppConfig.String("qiniu_bucket")
  828. // key := file_key
  829. // file, sErr := bucketManager.Stat(bucket, key)
  830. // fmt.Println(file)
  831. // fmt.Println(sErr)
  832. // fmt.Println(miConfig.OrgName + "日志" + "/" + file_key)
  833. //
  834. // if sErr != nil {
  835. // fmt.Println("七牛云上文件不存在,上传到七牛云")
  836. // //判断本地文件是否存在,存在则执行上传操作
  837. // exist, _ := PathExists(miConfig.OrgName + "日志" + "/" + file_key)
  838. // if exist {
  839. // upload_qiniu(miConfig.OrgName+"日志"+"/"+file_key, file_key)
  840. // } else {
  841. // fmt.Println("本地文件不存在")
  842. //
  843. // }
  844. // } else {
  845. // fmt.Println("七牛云文件存在")
  846. // }
  847. //
  848. //}
  849. //func Mkdir(dir string) {
  850. // // 创建文件夹
  851. // exist, err := PathExists(dir)
  852. // if err != nil {
  853. // fmt.Println(err.Error())
  854. // } else {
  855. // if exist {
  856. // fmt.Println(dir + "文件夹已存在!")
  857. // } else {
  858. // // 文件夹名称,权限
  859. // err := os.Mkdir(dir, os.ModePerm)
  860. // if err != nil {
  861. // fmt.Println(dir+"文件夹创建失败:", err.Error())
  862. // } else {
  863. // fmt.Println(dir + "文件夹创建成功!")
  864. // }
  865. // }
  866. // }
  867. //}
  868. //func PathExists(path string) (bool, error) {
  869. // _, err := os.Stat(path)
  870. // if err == nil {
  871. // return true, nil
  872. // }
  873. // if os.IsNotExist(err) {
  874. // return false, nil
  875. // }
  876. // return false, err
  877. //}
  878. //func upload_qiniu(filePath string, keys string) {
  879. // key := keys
  880. // //上传凭证,关于凭证这块大家可以去看看官方文档
  881. // putPolicy := storage.PutPolicy{
  882. // Scope: beego.AppConfig.String("qiniu_bucket"),
  883. // }
  884. // mac := qbox.NewMac(beego.AppConfig.String("qiniu_accesskey"), beego.AppConfig.String("qiniu_secretkey"))
  885. // upToken := putPolicy.UploadToken(mac)
  886. // cfg := storage.Config{}
  887. // //空间对应机房
  888. // //其中关于Zone对象和机房的关系如下:
  889. // // 机房 Zone对象
  890. // // 华东 storage.ZoneHuadong
  891. // // 华北 storage.ZoneHuabei
  892. // // 华南 storage.ZoneHuanan
  893. // // 北美 storage.ZoneBeimei
  894. // //七牛云存储空间设置首页有存储区域
  895. // cfg.Zone = &storage.ZoneHuadong
  896. // //不启用HTTPS域名
  897. // cfg.UseHTTPS = false
  898. // //不使用CND加速
  899. // cfg.UseCdnDomains = false
  900. // //构建上传表单对象
  901. // formUploader := storage.NewFormUploader(&cfg)
  902. // ret := storage.PutRet{}
  903. // // 可选
  904. // putExtra := storage.PutExtra{
  905. // Params: map[string]string{},
  906. // }
  907. // err := formUploader.PutFile(context.Background(), &ret, upToken, key, filePath, &putExtra)
  908. // if err != nil {
  909. // fmt.Println(err)
  910. // return
  911. // }
  912. // fmt.Println(ret.Key, ret.Hash)
  913. //}