Browse Source

Merge pull request 'feature_statistics' (#15) from feature_statistics into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_MY_BACKEND/pulls/15
develop
娄文智 3 years ago
parent
commit
68872f1904
7 changed files with 368 additions and 327 deletions
  1. +4
    -8
      conf/db.go
  2. +4
    -2
      utils/value.go
  3. +4
    -0
      web/controllers/chargetab_controller.go
  4. +6
    -6
      web/controllers/user_controller.go
  5. +2
    -1
      web/models/carporttab.go
  6. +343
    -310
      web/models/chargetab.go
  7. +5
    -0
      web/models/propertytab.go

+ 4
- 8
conf/db.go View File

@ -13,15 +13,14 @@ type DbConf struct {
//线上服务器配置
var MasterDbConfig DbConf = DbConf{
Host: "127.0.0.1",
Port: 3306,
User: "root",
Pwd: "Leit2020",
Host: "127.0.0.1",
Port: 3306,
User: "root",
Pwd: "123456",
DbName: "lappserver",
BackUp: "C:\\lapp_-wy\\dblog",
}
//var MasterDbConfig DbConf = DbConf{
// Host: "127.0.0.1",
// Port: 3306,
@ -40,6 +39,3 @@ var MasterDbConfig DbConf = DbConf{
// DbName: "wyserver8094",
// BackUp: "C:\\ruifeng_wy\\dblog",
//}

+ 4
- 2
utils/value.go View File

@ -156,7 +156,9 @@ func ValueToFloat(in interface{}, def float64) float64 {
func ValueToString(in interface{}, def string) string {
return ValueToStringIn(in, def, 0)
}
func ValueToStringTwo(in interface{}, def string) string {
return ValueToStringIn(in, def, 2)
}
func ValueToStringIn(in interface{}, def string, fixed int) string {
if in == nil {
return def
@ -352,4 +354,4 @@ func IDsToString(ids []int) string {
str = str + "')"
}
return str
}
}

+ 4
- 0
web/controllers/chargetab_controller.go View File

@ -893,6 +893,10 @@ func GetChargetabListPage(ctx iris.Context) {
}
data.Cid = user.Pid
chargetype, _ := ctx.URLParamInt("chargetype")
cid, _ := ctx.URLParamInt("cid")
if cid > 0 {
data.Cid = cid
}
data.Chargetype = chargetype
switch chargetype {
case 1:


+ 6
- 6
web/controllers/user_controller.go View File

@ -1,6 +1,8 @@
package controllers
import (
"github.com/kataras/iris"
"io"
"lapp_-wy/conf"
"lapp_-wy/utils"
"lapp_-wy/web/middleware/glog"
@ -8,8 +10,6 @@ import (
"lapp_-wy/web/models"
"lapp_-wy/web/supports"
"lapp_-wy/web/supports/vo"
"github.com/kataras/iris"
"io"
"log"
"net/http"
"strings"
@ -28,11 +28,11 @@ func Login(ctx iris.Context) {
log.Operator = user.Userid
log.TimeStamp = utils.TimeFormat(time.Now(), "yyyyMMddHHmmss")
log.InsertRecord()
supports.Error(ctx, iris.StatusPaymentRequired, supports.LoginFailur, nil)
supports.Error(ctx, iris.StatusPaymentRequired, supports.LoginFailur, err.Error())
return
}
//日志
glog.InfoExt("日志测试","开始1")
glog.InfoExt("日志测试", "开始1")
mUser := new(models.Usertab)
mUser.Pid = user.Pid
mUser.Userid = user.Userid
@ -47,7 +47,7 @@ func Login(ctx iris.Context) {
log.Operator = user.Userid
log.TimeStamp = utils.TimeFormat(time.Now(), "yyyyMMddHHmmss")
log.InsertRecord()
supports.Error(ctx, iris.StatusPaymentRequired, supports.LoginFailur, nil)
supports.Error(ctx, iris.StatusPaymentRequired, supports.LoginFailur, err.Error())
return
}
@ -426,7 +426,7 @@ func InsetSysUserAvatar(ctx iris.Context) {
for _, file := range files {
// 上传文件至指定目录
savePath,_ := utils.GetCurrentPath(savePath)
savePath, _ := utils.GetCurrentPath(savePath)
err := utils.SaveUploadedFile(file, savePath)
if err != nil {
log.Printf("上传图片错误:%v", err)


+ 2
- 1
web/models/carporttab.go View File

@ -17,6 +17,7 @@ type Carporttab struct {
Status int `json:"status" xorm:"INT(4)"`
Propertyid string `json:"propertyid" xorm:"VARCHAR(100)"`
Propertytypeid string `json:"propertytypeid" xorm:"VARCHAR(100)"`
Rentouttypeid string `json:"rentouttypeid" xorm:"VARCHAR(255)"`
Createtime string `json:"createtime" xorm:"VARCHAR(14)"`
Lastmodifytime string `json:"lastmodifytime" xorm:"VARCHAR(20)"`
Lastmodifyby string `json:"lastmodifyby" xorm:"VARCHAR(20)"`
@ -167,7 +168,7 @@ func (t *Carporttab) Search() (data ContractInfo, err error) {
data.Propertyid = carport.Propertyid
data.Cid = carport.Cid
data.Contractid = carport.Contractid
data.Descr =carport.Descr
data.Descr = carport.Descr
data.Contact = carport.Contact
data.Phone1 = carport.Phone
data.Unitprice = propertytype.Unitprice


+ 343
- 310
web/models/chargetab.go
File diff suppressed because it is too large
View File


+ 5
- 0
web/models/propertytab.go View File

@ -7,6 +7,11 @@ import (
"xorm.io/core"
)
type PropertytabTemporary struct {
Buildingid string `json:"buildingid" xorm:"VARCHAR(100)"`
Count int `json:"-" xorm:"count"`
Constructionarea float64 `json:"constructionarea" xorm:"DECIMAL(10,2)"`
}
type Propertytab struct {
Cid int `json:"cid" xorm:"not null pk INT(4)"`
Propertyid string `json:"propertyid" xorm:"not null pk VARCHAR(100)"`


Loading…
Cancel
Save