|
@@ -1549,7 +1549,6 @@ func (this *NewDialysisApiController) GetMyInformation() {
|
1549
|
1549
|
adminUserInfo := this.GetMobileAdminUserInfo()
|
1550
|
1550
|
|
1551
|
1551
|
roleInfo := adminUserInfo.AppRole
|
1552
|
|
- fmt.Print("aa")
|
1553
|
1552
|
es, _ := service.GetAdminUserElectronicSignature(adminUserInfo.Org.Id, adminUserInfo.App.Id, adminUserInfo.AdminUser.Id)
|
1554
|
1553
|
|
1555
|
1554
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -1660,3 +1659,102 @@ func (this *NewDialysisApiController) DeleteChildInspection() {
|
1660
|
1659
|
this.ServeSuccessJSON(returnData)
|
1661
|
1660
|
return
|
1662
|
1661
|
}
|
|
1662
|
+
|
|
1663
|
+func (this *NewDialysisApiController) SaveMessage() {
|
|
1664
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1665
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1666
|
+ id, _ := this.GetInt64("id")
|
|
1667
|
+ fmt.Println("id", id)
|
|
1668
|
+ message := this.GetString("message")
|
|
1669
|
+ fmt.Println("message", message)
|
|
1670
|
+ role := models.App_Role{
|
|
1671
|
+ Message: message,
|
|
1672
|
+ }
|
|
1673
|
+ err := service.SaveMessage(orgid, appid, id, &role)
|
|
1674
|
+ if err != nil {
|
|
1675
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1676
|
+ return
|
|
1677
|
+ }
|
|
1678
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1679
|
+ "role": role,
|
|
1680
|
+ })
|
|
1681
|
+}
|
|
1682
|
+
|
|
1683
|
+func (this *NewDialysisApiController) SaveSex() {
|
|
1684
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1685
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1686
|
+ sex, _ := this.GetInt64("sex")
|
|
1687
|
+ fmt.Println("sex", sex)
|
|
1688
|
+ id, _ := this.GetInt64("id")
|
|
1689
|
+ fmt.Println("id", id)
|
|
1690
|
+ role := models.App_Role{
|
|
1691
|
+ Sex: sex,
|
|
1692
|
+ }
|
|
1693
|
+ err := service.SaveSex(id, orgid, appid, &role)
|
|
1694
|
+ if err != nil {
|
|
1695
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1696
|
+ return
|
|
1697
|
+ }
|
|
1698
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1699
|
+ "role": role,
|
|
1700
|
+ })
|
|
1701
|
+}
|
|
1702
|
+
|
|
1703
|
+func (this *NewDialysisApiController) SaveBirthday() {
|
|
1704
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1705
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1706
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1707
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
1708
|
+ fmt.Println(err)
|
|
1709
|
+ id := dataBody["id"].(string)
|
|
1710
|
+ ids, err := strconv.ParseInt(id, 10, 64)
|
|
1711
|
+ fmt.Print("id", id)
|
|
1712
|
+ birthday := dataBody["birth"].(string)
|
|
1713
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
1714
|
+ theTime, err := utils.ParseTimeStringToTime(timeLayout, birthday+" 00:00:00")
|
|
1715
|
+ birth := theTime.Unix()
|
|
1716
|
+ fmt.Print("-----======", birth)
|
|
1717
|
+ role := models.App_Role{
|
|
1718
|
+ Birthday: birth,
|
|
1719
|
+ }
|
|
1720
|
+ err = service.SaveBirthday(ids, orgid, appid, &role)
|
|
1721
|
+ if err != nil {
|
|
1722
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1723
|
+ return
|
|
1724
|
+ }
|
|
1725
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1726
|
+ "role": role,
|
|
1727
|
+ })
|
|
1728
|
+}
|
|
1729
|
+
|
|
1730
|
+func (this *NewDialysisApiController) GetOrgName() {
|
|
1731
|
+
|
|
1732
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1733
|
+ name, err := service.GetOrgName(orgid)
|
|
1734
|
+ if err != nil {
|
|
1735
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1736
|
+ return
|
|
1737
|
+ }
|
|
1738
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1739
|
+ "name": name,
|
|
1740
|
+ })
|
|
1741
|
+}
|
|
1742
|
+
|
|
1743
|
+func (this *NewDialysisApiController) GetRoleName() {
|
|
1744
|
+ id, _ := this.GetInt64("id")
|
|
1745
|
+ fmt.Println("id", id)
|
|
1746
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1747
|
+ fmt.Println("orgid", orgid)
|
|
1748
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1749
|
+ fmt.Println("appid", appid)
|
|
1750
|
+ name, err := service.GetRoleName(id, orgid, appid)
|
|
1751
|
+ positionName, err := service.GetPositionName(id, orgid, appid)
|
|
1752
|
+ if err != nil {
|
|
1753
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1754
|
+ return
|
|
1755
|
+ }
|
|
1756
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1757
|
+ "name": name,
|
|
1758
|
+ "positionName": positionName,
|
|
1759
|
+ })
|
|
1760
|
+}
|