12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493 |
- package controllers
-
- import (
- "encoding/base64"
- "encoding/json"
- "fmt"
- "io/ioutil"
- "strconv"
- "time"
-
- "XT_New/models"
- "XT_New/service"
- "XT_New/utils"
- "github.com/astaxie/beego"
- )
-
- type SignApiController struct {
- BaseAuthAPIController
- }
-
- func SignApiRegistRouters() {
-
-
- beego.Router("/api/sign/getsign", &SignApiController{}, "Get:GetSign")
-
-
- beego.Router("/api/sign/createrusername", &SignApiController{}, "Get:CreateUserName")
-
-
- beego.Router("/api/sign/createenterpriserealname", &SignApiController{}, "Get:CreateEnterPriseRealName")
-
-
- beego.Router("/api/sign/createuserid", &SignApiController{}, "Get:CreateUserId")
-
-
- beego.Router("/api/sign/createpersionseal", &SignApiController{}, "Get:CreatePersionSeal")
-
-
- beego.Router("/api/sign/createuploadpact", &SignApiController{}, "Get:CreateUploadPact")
-
-
- beego.Router("/api/sign/addcontractsignatory", &SignApiController{}, "Get:AddContractSignatory")
-
-
- beego.Router("/api/sign/getverificationcode", &SignApiController{}, "Get:GetVerificationCode")
-
-
- beego.Router("/api/sign/createbackstagesign", &SignApiController{}, "Get:CreateBackStageSign")
-
-
- beego.Router("/api/sign/totestelment", &SignApiController{}, "Get:CreateEnterprise")
-
-
- beego.Router("/api/sign/totestthrityment", &SignApiController{}, "Get:GetTestThrityMent")
-
-
- beego.Router("/api/sign/saveenerprise", &SignApiController{}, "Post:SaveEnerprise")
-
-
- beego.Router("/api/sign/getenerprisebyid", &SignApiController{}, "Get:GetEnerPriseById")
-
- beego.Router("/api/sign/getmobilecode", &SignApiController{}, "Get:GetMobileCode")
-
- beego.Router("/api/sign/getpersionenterprise", &SignApiController{}, "Post:GetPersionEnterPrise")
-
- beego.Router("/api/sign/getpersenterprisebyid", &SignApiController{}, "Get:GetPerseEnterPriseById")
-
- beego.Router("/api/device/sign/creterpersionseal", &SignApiController{}, "Get:CreateNewPersionSeal")
-
- beego.Router("/api/device/sign/createnewenterprise", &SignApiController{}, "Get:CreateNewEnterPrise")
-
- beego.Router("/api/device/contractid", &SignApiController{}, "Get:GetContractId")
-
- beego.Router("/api/device/endenterprise", &SignApiController{}, "Get:EndEnterPrise")
-
- beego.Router("/api/device/getenterprisedetail", &SignApiController{}, "Get:GetEnterPriseDetail")
-
- beego.Router("/api/device/uploadprintorder", &SignApiController{}, "Post:UploadPrintOrder")
-
-
- beego.Router("/api/device/createqianshuusername", &SignApiController{}, "Post:CreateQianshuUserName")
-
-
- beego.Router("/api/device/createskdsendinformation", &SignApiController{}, "Post:CreateSdkSendInformation")
-
-
- beego.Router("/api/device/tosavepdfinformation", &SignApiController{}, "Get:SavePdfInformation")
-
- beego.Router("/api/device/tocheckinformation", &SignApiController{}, "Get:ToCheckInformation")
-
- beego.Router("/api/device/toautodrug", &SignApiController{}, "Get:ToAutoDrug")
-
- beego.Router("/api/device/toautodiagnose", &SignApiController{}, "Get:ToAutoDiagnose")
-
-
- beego.Router("/api/device/toautojiayou", &SignApiController{}, "Get:ToAutoJiaYou")
-
-
- beego.Router("/api/device/getfieldconfiglist", &SignApiController{}, "Get:GetFieldConfigList")
-
- beego.Router("/api/device/tocheckquery", &SignApiController{}, "Get:ToCheckQuery")
-
- }
-
-
- func (this *SignApiController) GetSign() {
-
- phone := this.GetString("phone")
- fmt.Println("phone", phone)
- var tempphone string
- tempphone = "13318464642"
- sign := service.GetSignNameByPhone(tempphone)
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
-
- }
-
- type Result2121 struct {
- Phone string `json:"phone"`
- DisPlayName string `json:"dis_play_name"`
- Authentication string `json:"authentication"`
- TwAuthReq struct {
- OneLineAuth string `json:"oneLineAuth"`
- ApiAuthReq struct {
- RealName float64 `json:"real_name"`
- IdCardType string `json:"id_card_type"`
- IdCardNum string `json:"id_card_num"`
- BankCard string `json:"bank_card"`
- CodeNumber string `json:"code_number"`
- VerifyCode string `json:"verify_code"`
- } `json:"apiAuthReq"`
- } `json:"twAuthReq"`
- }
-
- type MapData struct {
- dat struct {
- Code float64 `json:"code"`
- data struct {
- userId string `json:"userId"`
- }
- }
- }
-
-
- func (this *SignApiController) CreateUserName() {
-
- phone := this.GetString("phone")
- disPlayName := this.GetString("disPlayName")
-
- sign, userId := service.CreateUserName(phone, disPlayName)
-
- var dat map[string]interface{}
-
- if err := json.Unmarshal([]byte(sign), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- "dat": dat,
- "userId": userId,
- })
- return
- }
-
-
- func (this *SignApiController) CreatePersionSeal() {
-
- user_id := this.GetString("user_id")
- person_seal_type, _ := this.GetInt64("person_seal_type")
- person_seal_name := this.GetString("person_seal_name")
- person_seal_base := this.GetString("person_seal_base")
- color, _ := this.GetInt64("color")
- alpha, _ := this.GetInt64("alpha")
- width, _ := this.GetInt64("width")
- height, _ := this.GetInt64("height")
- border, _ := this.GetInt64("border")
- font_type, _ := this.GetInt64("font_type")
-
- sign, personSealId := service.CreatePersionSeal(user_id, person_seal_type, person_seal_name, person_seal_base, color, alpha, width, height, border, font_type)
- var dat map[string]interface{}
- if err := json.Unmarshal([]byte(sign), &dat); err == nil {
- fmt.Println(dat)
- } else {
- fmt.Println(err)
- }
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- "dat": dat,
- "personSealId": personSealId,
- })
- return
-
- }
-
- func (this *SignApiController) CreateUploadPact() {
-
- contractcode := this.GetString("contractcode")
-
- contractname := this.GetString("contractname")
-
- signcount, _ := this.GetInt64("signcount")
-
- docname := this.GetString("docname")
-
- contractbase := this.GetString("contractbase")
-
- creator := this.GetString("creator")
-
- enterpriseid := this.GetString("enterpriseid")
-
- signvalidays, _ := this.GetInt64("signvalidays")
-
- sysncurl := this.GetString("sysncurl")
-
- asyncurl := this.GetString("asyncurl")
-
- sign := service.CreateUploadPact(contractcode, contractname, signcount, docname, contractbase, creator, enterpriseid, signvalidays, sysncurl, asyncurl)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
-
- func (this *SignApiController) CreateUserId() {
-
- userId := this.GetString("userId")
- displayName := this.GetString("displayName")
-
- sign := service.CreateUserId(userId, displayName)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
-
- }
-
- func (this *SignApiController) CreateEnterPriseRealName() {
-
- enterprisename := this.GetString("enterprisename")
-
- sign := service.CreateEnterPriseRealName(enterprisename)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
-
- func (this *SignApiController) AddContractSignatory() {
-
- contractId := this.GetString("contractId")
-
- signers := this.GetString("signers")
-
- var newContract models.NewContract
-
- newContract.ContractId = "156001444267295949"
-
- sign := service.AddContractSignatory(contractId, signers, newContract)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
-
- }
-
- type Struct2401 struct {
- someTimestampStyle []someTimestampStyle
- }
-
- type someTimestampStyle struct {
- ControlsKey string
- Pattern string
- Color string
- }
-
- func (this *SignApiController) CreateBackStageSign() {
-
- contractId := this.GetString("contractId")
-
- signers := this.GetString("signers")
- sign := service.CreateBackStageSign(contractId, signers)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
- func (this *SignApiController) GetVerificationCode() {
-
- sign := service.GetVerificationCode()
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
- func (this *SignApiController) CreateEnterprise() {
-
- sign := service.CreateEnterprise()
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
- func (this *SignApiController) GetTestThrityMent() {
-
-
-
-
-
-
-
-
-
-
-
- }
-
- func loremList() []string {
- return []string{
- "我爱你中国" +
- "tempor incididunt ut labore et dolore magna aliqua.",
- "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " +
- "aliquip ex ea commodo consequat.",
- "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum " +
- "dolore eu fugiat nulla pariatur.",
- "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui " +
- "officia deserunt mollit anim id est laborum.",
- }
- }
-
- func (this *SignApiController) SaveEnerprise() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
- creater := this.GetAdminUserInfo().AdminUser.Id
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println("err", err)
-
- id := int64(dataBody["id"].(float64))
- org_type := int64(dataBody["org_type"].(float64))
-
- enterprise_name := dataBody["enterprise_name"].(string)
-
- code := dataBody["code"].(string)
-
- org_code := dataBody["org_code"].(string)
-
- legal_person_name := dataBody["legal_person_name"].(string)
-
- legal_id_card_num := dataBody["legal_id_card_num"].(string)
-
- legal_phone := dataBody["legal_phone"].(string)
-
- enterprise := models.XtDeviceEnterprise{
- ID: id,
- UserOrgId: orgId,
- OrgType: org_type,
- EnterpriseName: enterprise_name,
- Code: code,
- OrgCode: org_code,
- LegalPersonName: legal_person_name,
- LegalIdCardNum: legal_id_card_num,
- LegalPhone: legal_phone,
- Creater: creater,
- Ctime: time.Now().Unix(),
- Mtime: 0,
- Enterpriseid: "",
- Status: 1,
- }
- service.SaveEnerPrise(enterprise)
-
-
- lastenterprise, _ := service.GetEnterPriseByUserOrgId(orgId)
-
-
- if lastenterprise.ID > 0 {
- enterPrise, enterpriseid := service.CreateNewEnterPriseRealName(lastenterprise)
- fmt.Println("enterprise2ooo2oo2o2o2o", enterPrise)
- updateEnterprise := models.XtDeviceEnterprise{
- ID: enterprise.ID,
- UserOrgId: orgId,
- OrgType: org_type,
- EnterpriseName: enterprise_name,
- Code: code,
- OrgCode: org_code,
- LegalPersonName: legal_person_name,
- LegalIdCardNum: legal_id_card_num,
- LegalPhone: legal_phone,
- Creater: creater,
- Ctime: time.Now().Unix(),
- Mtime: 0,
- Enterpriseid: enterpriseid,
- Status: 1,
- }
- service.SaveEnerPrise(updateEnterprise)
- this.ServeSuccessJSON(map[string]interface{}{
- "enterPrise": enterPrise,
- })
- return
- }
- }
-
- func (this *SignApiController) GetEnerPriseById() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
- enterPrise, _ := service.GetEnterPriseByUserOrgId(orgId)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "enterPrise": enterPrise,
- })
- return
- }
-
- func (this *SignApiController) GetMobileCode() {
-
- phone := this.GetString("phone")
-
- sign, orderNumber := service.GetNewSignNameByPhone(phone)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- "orderNumber": orderNumber,
- })
- return
- }
-
- func (this *SignApiController) GetPersionEnterPrise() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
- creater := this.GetAdminUserInfo().AdminUser.Id
- dataBody := make(map[string]interface{}, 0)
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
- fmt.Println("err", err)
-
- id := int64(dataBody["id"].(float64))
- admin_user_id := int64(dataBody["admin_user_id"].(float64))
-
- code := dataBody["code"].(string)
-
- display_name := dataBody["display_name"].(string)
-
- id_card_num := dataBody["id_card_num"].(string)
-
- phone := dataBody["phone"].(string)
-
- enterprise := models.XtDevicePersonEnterprise{
- ID: id,
- AdminUserId: admin_user_id,
- DisplayName: display_name,
- Phone: phone,
- IdCardNum: id_card_num,
- UserOrgId: orgId,
- Status: 1,
- Creater: creater,
- Ctime: time.Now().Unix(),
- Mtime: 0,
- UserId: "",
- }
-
- service.SavePersonEnterPrise(enterprise)
-
- lastEnterPrise, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
-
- _, orderNumber := service.GetNewSignNameByPhone(phone)
-
- personEnterPrse, UserId := service.CreateNewUserName(lastEnterPrise.Phone, lastEnterPrise.DisplayName, code, orderNumber, lastEnterPrise.IdCardNum)
-
- firstenterprise := models.XtDevicePersonEnterprise{
- ID: id,
- AdminUserId: admin_user_id,
- DisplayName: display_name,
- Phone: phone,
- IdCardNum: id_card_num,
- UserOrgId: orgId,
- Status: 1,
- Creater: creater,
- Ctime: time.Now().Unix(),
- Mtime: 0,
- UserId: UserId,
- }
-
- service.SavePersonEnterPrise(firstenterprise)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "personEnterPrse": personEnterPrse,
- })
- return
- }
-
- func (this *SignApiController) GetPerseEnterPriseById() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
- admin_user_id, _ := this.GetInt64("admin_user_id")
-
- lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "lastPerson": lastPerson,
- })
- return
- }
-
- func (this *SignApiController) CreateNewPersionSeal() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
- admin_user_id, _ := this.GetInt64("admin_user_id")
-
- creater := this.GetAdminUserInfo().AdminUser.Id
-
- userName := service.GetLastAdminUserName(admin_user_id, orgId)
-
- lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
-
- if lastPerson.ID > 0 {
- this.ServeDynamicFailJsonSend("已完成认证,无需再次认证")
- return
- }
-
- if lastPerson.ID == 0 {
-
- personSeal, sealBase64 := service.CreateSKDPersionSeal(lastPerson.UserId, userName)
-
- fmt.Println("sealBase64", sealBase64)
- enterprise := models.XtDevicePersonEnterprise{
- AdminUserId: admin_user_id,
- DisplayName: "",
- Phone: "",
- IdCardNum: "",
- UserOrgId: orgId,
- Status: 1,
- Creater: creater,
- Ctime: time.Now().Unix(),
- Mtime: 0,
- UserId: "",
- Personsealid: "",
- Sealid: "",
- UserName: userName,
- Sealbase64: sealBase64,
- }
- service.CreateEnterpriseUserName(enterprise)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "personSeal": personSeal,
- })
- return
- }
-
- }
-
- func (this *SignApiController) CreateNewEnterPrise() {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- newEnterPrise, _ := service.CreateSDKEnterPrise()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.ServeSuccessJSON(map[string]interface{}{
- "newEnterPrise": newEnterPrise,
- })
- return
-
- }
-
- func (this *SignApiController) GetContractId() {
-
- sign := service.GetContractId()
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
- func (this *SignApiController) EndEnterPrise() {
-
- sign := service.EndEnterPrise()
-
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- })
- return
- }
-
- func (this *SignApiController) GetEnterPriseDetail() {
-
- sign, url := service.GetEnterPriseDetail()
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- "url": url,
- })
- return
- }
-
- func (this *SignApiController) UploadPrintOrder() {
-
- orderList, _ := service.GetDialysisOrderListOne(21741)
-
- for _, item := range orderList {
- service.UpdateSchedulePatient(item.PatientId, item.DialysisDate, item.ZoneId, item.BedID)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.ServeSuccessJSON(map[string]interface{}{
-
-
-
-
- })
-
- }
-
- func (this *SignApiController) CreateQianshuUserName() {
-
- admin_user_id, _ := this.GetInt64("admin_user_id")
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
- userName := service.GetLastAdminUserName(admin_user_id, orgId)
-
- idCardNumber := service.GetLastAdminUserIdCardNumber(admin_user_id, orgId)
-
- adminRole, _ := service.GetMobile(admin_user_id)
-
-
- lastPerson, _ := service.GetLastPersonEnterPrise(admin_user_id, orgId)
-
- if len(lastPerson.UserId) > 0 {
- this.ServeDynamicFailJsonSend("已完成签署,无需再次签署")
- return
- }
-
- if len(lastPerson.UserId) == 0 {
-
- sign, userId := service.CreateQianshuUserName(userName, adminRole.Mobile, idCardNumber)
-
- err := service.UpdatePersionEnterPrise(lastPerson.ID, userId)
- fmt.Println(err)
- this.ServeSuccessJSON(map[string]interface{}{
- "sign": sign,
- "userId": userId,
- })
-
- }
-
- }
-
- func (this *SignApiController) CreateSdkSendInformation() {
-
- information, orderId := service.CreateSdkSendInformation()
-
- this.ServeSuccessJSON(map[string]interface{}{
- "information": information,
- "orderId": orderId,
- })
- }
-
- func (this *SignApiController) SavePdfInformation() {
-
- var name string
- information, pdfBase64 := service.SavePdfInformation(name)
- informationOne := service.ToCheckInformation(pdfBase64)
-
- maprequest := make(map[string]interface{})
-
- Receiver := make(map[string]interface{})
-
-
- maprequest["orderId"] = "13318464642"
-
- maprequest["signTitle"] = "举报合同"
-
-
- file := "/swspan/gopath/src/XT_New/static/6.pdf"
-
- fileBytes, _ := ioutil.ReadFile(file)
-
- contractBase64 := base64.StdEncoding.EncodeToString(fileBytes)
-
-
- maprequest["fileType"] = 1
-
- maprequest["pdfBase64"] = contractBase64
-
- maprequest["fileContent"] = contractBase64
-
-
- maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
-
-
- maprequest["receiver"] = Receiver
-
-
- Receiver["account"] = "13318464642"
-
- Receiver["signerType"] = 1
-
-
- Receiver["realName "] = "马文强"
-
-
- Receiver["cardType"] = 0
-
-
- Receiver["cardNumber"] = "430526199408156511"
-
- stepStamper := make(map[string]interface{})
-
- keywordSignControls := make([]map[string]interface{}, 0)
-
-
- inputArrOne := make(map[string]interface{})
- inputArrOne["sealName"] = "1"
- inputArrOne["keyword"] = "医生签名"
- inputArrOne["pages"] = "0"
- inputArrOne["offsetX"] = "100"
- inputArrOne["offsetY"] = "100"
-
- keywordSignControls = append(keywordSignControls, inputArrOne)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xySignControls := make([]map[string]interface{}, 0)
-
- inputArrThree := make(map[string]interface{})
- inputArrThree["sealName"] = "1"
- inputArrThree["positionX"] = "100"
- inputArrThree["positionY"] = "0"
- inputArrThree["pages"] = "0"
-
- xySignControls = append(xySignControls, inputArrThree)
-
- stepStamper["xySignControls"] = xySignControls
-
- maprequest["stepStamper"] = stepStamper
-
- seals := make([]map[string]interface{}, 0)
-
-
- sealImagesList := make(map[string]interface{})
- fileOne := "/swspan/gopath/src/XT_New/static/huangzihui.jpg"
- fileBytesOne, _ := ioutil.ReadFile(fileOne)
- contractBase64One := base64.StdEncoding.EncodeToString(fileBytesOne)
- sealImagesList["sealBase64"] = contractBase64One
-
- sealImagesList["width"] = "50"
- sealImagesList["height"] = "50"
- sealImagesList["verticalAlign"] = "middle"
-
- sealTextsList := make(map[string]interface{})
- sealTextsList["text"] = "2023年8月8日"
- sealTextsList["fontSize"] = "100"
- sealTextsList["fontColor"] = "#333333"
- sealTextsList["isTextArea"] = true
- sealTextsList["textAlign"] = 0
- sealTextsList["width"] = 150
- sealTextsList["height"] = 20
-
- sealsObj := make(map[string]interface{})
- sealsObj["sealWidth"] = "150"
- sealsObj["sealHeight"] = "150"
- sealsObj["sealName"] = "1"
- sealsObj["sealImage"] = sealImagesList
- sealsObj["sealText"] = sealTextsList
- seals = append(seals, sealsObj)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- maprequest["seals"] = seals
-
- maprequest["isUserWishes"] = true
- maprequest["phone"] = "13318464642"
- maprequest["verificationCode"] = "18888888888"
-
- this.ServeSuccessJSON(map[string]interface{}{
-
- "information": information,
- "orderId": pdfBase64,
- "informationOne": informationOne,
- "maprequest": maprequest,
- })
-
- }
-
- func (this *SignApiController) ToCheckInformation() {
-
- var name string
- information, pdfBase64 := service.SavePdfInformation(name)
- informationOne := service.ToCheckInformation(pdfBase64)
-
- this.ServeSuccessJSON(map[string]interface{}{
- "information": information,
- "informationOne": informationOne,
- })
- }
-
- func (this *SignApiController) ToAutoDrug() {
-
-
-
-
-
-
-
-
-
-
-
-
-
- list, _ := service.GetScheduleListByOrder(10579)
-
- for _, item := range list {
- soluton, _ := service.GetDialysisSoluton(item.PatientId, item.ModeId)
- var DialysisMachineName string
- if len(soluton.DialysisDialyszers) > 0 {
- DialysisMachineName = soluton.DialysisDialyszers
- }
-
-
-
-
- if len(soluton.DialysisIrrigation) > 0 {
- DialysisMachineName = DialysisMachineName + "," + soluton.DialysisIrrigation
- }
-
- if len(soluton.DialysisStrainer) > 0 {
- DialysisMachineName = DialysisMachineName + "," + soluton.DialysisStrainer
- }
- DialysisMachineName = DialysisMachineName
-
- service.UpdateDialysisSchedule(item.ID, DialysisMachineName)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.ServeSuccessJSON(map[string]interface{}{
- "msg": "ok",
- })
- }
-
- func (this *SignApiController) ToAutoDiagnose() {
-
- orgId := this.GetAdminUserInfo().CurrentOrgId
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list, _ := service.GetAllDialysisOrderTwo(10892)
- fmt.Println("list=============", list)
- for _, item := range list {
- schedule, _ := service.GetLastScheduleByUserOrg(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType)
- service.UpdateScheduleByOrder(item.PatientId, item.DialysisDate, orgId, item.BedId, item.ZoneId, item.SchedualType, schedule.ID)
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.ServeSuccessJSON(map[string]interface{}{
- "msg": "ok",
- })
-
- }
-
- func (this *SignApiController) ToAutoJiaYou() {
-
- list, _ := service.GetPrescriptionListOne(10579)
-
- for _, item := range list {
-
- schedule, _ := service.GetPatientScheduleById(item.PatientId, item.RecordDate)
- var DialysisMachineName string
- if len(item.DialysisDialyszers) > 0 {
- DialysisMachineName = item.DialysisDialyszers
- }
-
- if len(item.DialysisIrrigation) > 0 {
- DialysisMachineName = DialysisMachineName + "," + item.DialysisIrrigation
- }
-
- if len(item.DialysisStrainer) > 0 {
- DialysisMachineName = DialysisMachineName + "," + item.DialysisStrainer
- }
- DialysisMachineName = DialysisMachineName
-
- service.UpdateDialysisScheduleOne(schedule.ID, item.ModeId, DialysisMachineName)
- }
- }
-
- func (this *SignApiController) GetFieldConfigList() {
-
- orderList, _ := service.GetDialysisOrderByUserOrgId()
-
- if len(orderList) > 0 {
- filedConfigList, _ := service.GetFieldConfigList(9442)
-
- for _, item := range orderList {
- for _, it := range filedConfigList {
-
- fiedConfigObj, _ := service.GetFieldConfigByOrgId(item.UserOrgId, it.FiledNameCn, it.Module)
- if fiedConfigObj.ID == 0 {
- config := models.FiledConfig{
- OrgId: item.UserOrgId,
- Module: it.Module,
- FiledName: it.FiledName,
- FiledNameCn: it.FiledNameCn,
- IsShow: 2,
- CreateTime: time.Now().Unix(),
- UpdateTime: time.Now().Unix(),
- SysModule: it.SysModule,
- IsWrite: it.IsWrite,
- IsSecondMenu: it.IsSecondMenu,
- }
- service.CretedConfig(config)
- }
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- this.ServeSuccessJSON(map[string]interface{}{
- "msg": "ok",
- })
- }
-
-
- func (this *SignApiController) ToCheckQuery() {
-
-
-
- queryList, _ := service.GetAllCheckQuery()
-
- var recordDateStr = time.Now().Format("2006-01-02")
- recordDate, _ := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
- if len(queryList) > 0 {
- for _, item := range queryList {
-
- adviceList, _ := service.GetAllDoctorAdviceQueryList(item.UserOrgId, recordDate.Unix())
- if len(adviceList) > 0 {
-
- for _, it := range adviceList {
- var prescription_count int64
- var out_count int64
- advice, _ := service.GetDrugListById(it.DrugId, it.AdviceDate, it.PatientId)
- medical, _ := service.GetBaseDrugMedical(it.DrugId)
- if len(advice) > 0 {
- for _, its := range advice {
- prescribingNumberSix := strconv.FormatFloat(its.PrescribingNumber, 'f', -1, 64)
- prescribingNumberSeven, _ := strconv.ParseInt(prescribingNumberSix, 10, 64)
- if its.PrescribingNumberUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
- prescription_count += prescribingNumberSeven * medical.MinNumber
- }
-
- if its.PrescribingNumberUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
- prescription_count += prescribingNumberSeven
- }
-
- if its.PrescribingNumberUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
- prescription_count += prescribingNumberSeven
- }
- }
- }
-
- outinfo, _ := service.GetDrugWarehouseOutQueryListById(it.DrugId, it.AdviceDate, it.PatientId)
-
- if len(outinfo) > 0 {
- for _, s := range outinfo {
- if s.CountUnit == medical.MaxUnit && medical.MaxUnit != medical.MinUnit {
- out_count += s.Count * medical.MinNumber
- }
-
- if s.CountUnit == medical.MinUnit && medical.MaxUnit != medical.MinUnit {
- out_count += s.Count
- }
-
- if s.CountUnit == medical.MaxUnit && medical.MaxUnit == medical.MinUnit {
- out_count += s.Count
- }
- }
- }
-
- patients, _ := service.GetPatientName(it.PatientId)
-
- var specifaciton_name string
-
- specifaciton_name = medical.Dose + medical.DoseUnit + "*" + strconv.FormatInt(medical.MinNumber, 10) + medical.MinUnit + "/" + medical.MaxUnit
-
-
- if prescription_count != out_count {
-
- checkQuery := models.XtDrugCheckQuery{
- DrugId: it.DrugId,
- RecordDate: it.AdviceDate,
- AdviceCount: prescription_count,
- OutCount: out_count,
- PatientId: it.PatientId,
- UserOrgId: it.UserOrgId,
- ExecutionState: it.ExecutionState,
- IsMedicine: it.IsMedicine,
- DrugName: medical.DrugName,
- SpecificationName: specifaciton_name,
- Name: patients.Name,
- }
-
- service.CreateCheckQuery(checkQuery)
- }
-
- }
-
- }
-
-
- projectList, _ := service.GetAllPrescriptionProjectList(item.UserOrgId, recordDate.Unix())
- if len(projectList) > 0 {
-
- for _, item := range projectList {
- var prescription_count int64
- var out_count int64
- project, _ := service.GetProjectListByPatient(item.PatientId, item.ProjectId, item.RecordDate)
- for _, its := range project {
- count, _ := strconv.ParseInt(its.Count, 10, 64)
- prescription_count += count
- }
-
- outList, _ := service.GetWarehosueOutQueryList(item.PatientId, item.ProjectId, item.RecordDate)
- for _, s := range outList {
- out_count += s.Count
- }
-
- goodIdThirty, _ := service.GetGoodInformationByGoodIdThirty(item.ProjectId)
-
- patients, _ := service.GetPatientName(item.PatientId)
-
-
-
-
- if prescription_count != out_count {
-
- stockCheckQuery := models.XtStockCheckQuery{
- GoodId: item.ProjectId,
- RecordDate: item.RecordDate,
- AdviceCount: prescription_count,
- OutCount: out_count,
- PatientId: item.PatientId,
- UserOrgId: item.UserOrgId,
- GoodName: goodIdThirty.GoodName,
- SpecificationName: goodIdThirty.SpecificationName,
- Name: patients.Name,
- }
-
- service.CreteStockCheckQuery(stockCheckQuery)
- }
- }
-
- }
- }
- }
-
- this.ServeSuccessJSON(map[string]interface{}{
- "msg": "ok",
- })
- }
|