secondary_models.go 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. package models
  2. // 仓库配置
  3. type StorehouseConfig struct {
  4. ID int64 `gorm:"column:id" json:"id" form:"id"`
  5. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"` //机构id
  6. StorehouseInfo int64 `gorm:"column:storehouse_info" json:"storehouse_info" form:"storehouse_info"` //耗材 自动入库 的仓库id
  7. StorehouseOutInfo int64 `gorm:"column:storehouse_out_info" json:"storehouse_out_info" form:"storehouse_out_info"` //耗材 自动出库 的仓库id
  8. DrugStorehouseInfo int64 `gorm:"drug_storehouse_info" json:"drug_storehouse_info" form:"drug_storehouse_info"` //药品 自动入库 的仓库id
  9. DrugStorehouseOut int64 `gorm:"drug_storehouse_out" json:"drug_storehouse_out" form:"drug_storehouse_out"` //药品 自动出库 的仓库id
  10. Status int64 `gorm:"status" json:"status" form:"status"`
  11. Ctime int64 `gorm:"ctime" json:"ctime" form:"ctime"`
  12. Mtime int64 `gorm:"mtime" json:"mtime" form:"mtime"`
  13. }
  14. func (StorehouseConfig) TableName() string {
  15. return "xt_storehouse_config"
  16. }
  17. type App_Role_byli struct {
  18. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  19. OrgId int64 `gorm:"column:org_id" json:"org_id"`
  20. AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
  21. UserName string `gorm:"column:user_name" json:"user_name"` // 用户名称
  22. }
  23. func (App_Role_byli) TableName() string {
  24. return "sgj_users.sgj_user_admin_role"
  25. }
  26. type UserOrg struct {
  27. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  28. Creator int64 `gorm:"column:creator" json:"creator"`
  29. }
  30. func (UserOrg) TableName() string {
  31. return "sgj_users.sgj_user_org"
  32. }
  33. // 分页
  34. type Storehouselist struct {
  35. ID int64 `gorm:"column:id" json:"id" form:"id"`
  36. StorehouseCode string `gorm:"column:storehouse_code" json:"storehouse_code" form:"storehouse_code"` //仓库编号
  37. StorehouseName string `gorm:"column:storehouse_name" json:"storehouse_name" form:"storehouse_name"` //仓库名称
  38. StorehouseAddress string `gorm:"column:storehouse_address" json:"storehouse_address" form:"storehouse_address"` //仓库地址
  39. StorehouseStatus int64 `gorm:"column:storehouse_status" json:"storehouse_status" form:"storehouse_status"` //仓库状态
  40. Status int64 `gorm:"column:status" json:"status" form:"status"` //数据状态
  41. StorehouseAdminId int64 `gorm:"column:storehouse_admin_id" json:"storehouse_admin_id" form:"storehouse_admin_id"` //仓库管理员id
  42. StorehouseAdminName string `gorm:"column:storehouse_admin_name" json:"storehouse_admin_name" form:"storehouse_admin_id"` //仓库管理员名字
  43. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  44. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  45. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  46. }
  47. type RolePurviews struct {
  48. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT"`
  49. RoleId int64
  50. OrgId int64
  51. AppId int64
  52. PurviewIds string `gorm:"column:purview_ids"`
  53. Status int8 // 状态 0.无效 1.有效 2.禁用
  54. CreateTime int64 `gorm:"column:ctime"` // 创建时间
  55. ModifyTime int64 `gorm:"column:mtime"` // 修改时间
  56. Role Role `gorm:"ForeignKey:RoleId;AssociationForeignKey:ID" json:"role_info"`
  57. }
  58. func (RolePurviews) TableName() string {
  59. return "sgj_users.sgj_user_role_purview"
  60. }
  61. type XtStorehouse struct {
  62. ID int64 `gorm:"column:id" json:"id" form:"id"`
  63. StorehouseCode string `gorm:"column:storehouse_code" json:"storehouse_code" form:"storehouse_code"`
  64. StorehouseName string `gorm:"column:storehouse_name" json:"storehouse_name" form:"storehouse_name"`
  65. StorehouseAddress string `gorm:"column:storehouse_address" json:"storehouse_address" form:"storehouse_address"`
  66. StorehouseStatus int64 `gorm:"column:storehouse_status" json:"storehouse_status" form:"storehouse_status"`
  67. Status int64 `gorm:"column:status" json:"status" form:"status"`
  68. StorehouseAdminId int64 `gorm:"column:storehouse_admin_id" json:"storehouse_admin_id" form:"storehouse_admin_id"`
  69. StorehouseAdminName string `gorm:"column:storehouse_admin_name" json:"storehouse_admin_name" form:"storehouse_admin_name"`
  70. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  71. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  72. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  73. }
  74. func (XtStorehouse) TableName() string {
  75. return "xt_storehouse"
  76. }
  77. type VmStorehouseName struct {
  78. ID int64 `gorm:"column:id" json:"id" form:"id"`
  79. StorehouseName string `gorm:"column:storehouse_name" json:"storehouse_name" form:"storehouse_name"`
  80. StorehouseId int64 `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
  81. StockMaxNumber int64 `gorm:"column:stock_max_number" json:"stock_max_number" form:"stock_max_number"`
  82. StockMinNumber int64 `gorm:"column:stock_min_number" json:"stock_min_number" form:"stock_min_number"`
  83. WarehousingCount int64 `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
  84. }
  85. type VmStorehouseNameOne struct {
  86. ID int64 `gorm:"column:id" json:"id" form:"id"`
  87. StorehouseName string `gorm:"column:storehouse_name" json:"storehouse_name" form:"storehouse_name"`
  88. StorehouseId int64 `gorm:"column:storehouse_id" json:"storehouse_id" form:"storehouse_id"`
  89. StockCount int64 `gorm:"column:stock_count" json:"stock_count" form:"stock_count"`
  90. WarehousingCount int64 `gorm:"column:warehousing_count" json:"warehousing_count" form:"warehousing_count"`
  91. }
  92. type XtStorehouseConfig struct {
  93. ID int64 `gorm:"column:id" json:"id" form:"id"`
  94. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  95. StorehouseInfo int64 `gorm:"column:storehouse_info" json:"storehouse_info" form:"storehouse_info"`
  96. StorehouseOutInfo int64 `gorm:"column:storehouse_out_info" json:"storehouse_out_info" form:"storehouse_out_info"`
  97. DrugStorehouseInfo int64 `gorm:"column:drug_storehouse_info" json:"drug_storehouse_info" form:"drug_storehouse_info"`
  98. DrugStorehouseOut int64 `gorm:"column:drug_storehouse_out" json:"drug_storehouse_out" form:"drug_storehouse_out"`
  99. Status int64 `gorm:"column:status" json:"status" form:"status"`
  100. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  101. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  102. }
  103. func (XtStorehouseConfig) TableName() string {
  104. return "xt_storehouse_config"
  105. }
  106. // 二级仓库
  107. type Storehouse struct {
  108. ID int64 `gorm:"column:id" json:"id" form:"id"`
  109. StorehouseCode string `gorm:"column:storehouse_code" json:"storehouse_code" form:"storehouse_code"` //仓库编号
  110. StorehouseName string `gorm:"column:storehouse_name" json:"storehouse_name" form:"storehouse_name"` //仓库名称
  111. StorehouseAddress string `gorm:"column:storehouse_address" json:"storehouse_address" form:"storehouse_address"` //仓库地址
  112. StorehouseStatus int64 `gorm:"column:storehouse_status" json:"storehouse_status" form:"storehouse_status"` //仓库状态
  113. Status int64 `gorm:"column:status" json:"status" form:"status"` //数据状态
  114. StorehouseAdminId int64 `gorm:"column:storehouse_admin_id" json:"storehouse_admin_id" form:"storehouse_admin_id"` //仓库管理员id
  115. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  116. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  117. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  118. }
  119. func (Storehouse) TableName() string {
  120. return "xt_storehouse"
  121. }
  122. type XtSecondWarehouse struct {
  123. ID int64 `gorm:"column:id" json:"id" form:"id"`
  124. SecondOrderNumber string `gorm:"column:second_order_number" json:"second_order_number" form:"second_order_number"`
  125. Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
  126. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  127. Checker int64 `gorm:"column:checker" json:"checker" form:"checker"`
  128. IsCheck int64 `gorm:"column:is_check" json:"is_check" form:"is_check"`
  129. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  130. Status int64 `gorm:"column:status" json:"status" form:"status"`
  131. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  132. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  133. CheckTime int64 `gorm:"column:check_time" json:"check_time" form:"check_time"`
  134. StorehouseInId int64 `gorm:"column:storehouse_in_id" json:"storehouse_in_id" form:"storehouse_in_id"`
  135. StorehouseOutId int64 `gorm:"column:storehouse_out_id" json:"storehouse_out_id" form:"storehouse_out_id"`
  136. }
  137. func (XtSecondWarehouse) TableName() string {
  138. return "xt_second_warehouse"
  139. }
  140. type XtSecondWarehouseInfo struct {
  141. ID int64 `gorm:"column:id" json:"id" form:"id"`
  142. ProjectName string `gorm:"column:project_name" json:"project_name" form:"project_name"`
  143. SecondSpecificationName string `gorm:"column:second_specification_name" json:"second_specification_name" form:"second_specification_name"`
  144. ProjectType string `gorm:"column:project_type" json:"project_type" form:"project_type"`
  145. SencondUnit string `gorm:"column:sencond_unit" json:"sencond_unit" form:"sencond_unit"`
  146. Count int64 `gorm:"column:count" json:"count" form:"count"`
  147. SecondTotal string `gorm:"column:second_total" json:"second_total" form:"second_total"`
  148. SecondOrderNumber string `gorm:"column:second_order_number" json:"second_order_number" form:"second_order_number"`
  149. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  150. StorehouseInId int64 `gorm:"column:storehouse_in_id" json:"storehouse_in_id" form:"storehouse_in_id"`
  151. StorehouseOutId int64 `gorm:"column:storehouse_out_id" json:"storehouse_out_id" form:"storehouse_out_id"`
  152. Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
  153. ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
  154. Remake string `gorm:"column:remake" json:"remake" form:"remake"`
  155. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  156. Status int64 `gorm:"column:status" json:"status" form:"status"`
  157. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  158. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  159. MinPrice float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`
  160. IsSource int64 `gorm:"column:is_source" json:"is_source" form:"is_source"`
  161. WarehouseId int64 `gorm:"column:warehouse_id" json:"warehouse_id" form:"warehouse_id"`
  162. MedicalInsuranceNumber string `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
  163. }
  164. func (XtSecondWarehouseInfo) TableName() string {
  165. return "xt_second_warehouse_info"
  166. }
  167. type VmSecondWarehouse struct {
  168. ID int64 `gorm:"column:id" json:"id" form:"id"`
  169. SecondOrderNumber string `gorm:"column:second_order_number" json:"second_order_number" form:"second_order_number"`
  170. Creater int64 `gorm:"column:creater" json:"creater" form:"creater"`
  171. RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
  172. Checker int64 `gorm:"column:checker" json:"checker" form:"checker"`
  173. IsCheck int64 `gorm:"column:is_check" json:"is_check" form:"is_check"`
  174. UserOrgId int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
  175. Status int64 `gorm:"column:status" json:"status" form:"status"`
  176. Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
  177. Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
  178. CheckTime int64 `gorm:"column:check_time" json:"check_time" form:"check_time"`
  179. StorehouseInId int64 `gorm:"column:storehouse_in_id" json:"storehouse_in_id" form:"storehouse_in_id"`
  180. StorehouseOutId int64 `gorm:"column:storehouse_out_id" json:"storehouse_out_id" form:"storehouse_out_id"`
  181. StorehouseAdminName string `gorm:"column:storehouse_admin_name" json:"storehouse_admin_name" form:"storehouse_admin_name"`
  182. }
  183. type PurviewTmp struct {
  184. Id int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
  185. Parentid int64 `json:"pid"` // 父级ID
  186. Module int8 `json:"module"` // 所属应用类型 1.病友经营;2.科普号;3.血透经营;4.慢病管理;
  187. Name string `json:"name"` // 规则名称(也是菜单名)
  188. Urlfor string `json:"urlfor"` // 规则唯一英文标识,(Controller.Method)
  189. MenuIconClass string `gorm:"menu_icon_class" json:"menu_icon_class"` // 菜单图标的 css 样式
  190. SuperAdminExclusive int8 `gorm:"super_admin_exclusive" json:"super_admin_exclusive"` // 是否为超级管理员专属 0否1是
  191. Listorder int `json:"-"` // 排序ID
  192. Status int8 `json:"status"` // 状态 0.无效 1.有效 2.禁用
  193. CreateTime int64 `gorm:"column:ctime" json:"-"` // 创建时间
  194. ModifyTime int64 `gorm:"column:mtime" json:"-"` // 修改时间
  195. Purview []*Purview `gorm:"ForeignKey:Parentid;AssociationForeignKey:ID" json:"sub_purview"`
  196. IconUrl string `gorm:"column:icon_url" json:"icon_url" form:"icon_url"`
  197. Desc string `gorm:"column:desc" json:"desc" form:"desc"`
  198. ParentUrl string `gorm:"column:parent_url" json:"parent_url" form:"parent_url"`
  199. Link string `gorm:"-" json:"link"` // urlfor 解析后的链接
  200. Childs []*Purview `gorm:"-" json:"childs"` // 子节点
  201. }
  202. func (PurviewTmp) TableName() string {
  203. return "sgj_users.sgj_user_purview"
  204. }