Browse Source

添加新的角色控制 修复bug

pull/2/head
zhangxin 3 years ago
parent
commit
922d738eea
6 changed files with 44 additions and 23 deletions
  1. +4
    -0
      conf/app.go
  2. +19
    -16
      conf/db.go
  3. +6
    -2
      main.go
  4. +1
    -0
      web/controllers/contracttab_controller.go
  5. +11
    -4
      web/models/chargetab.go
  6. +3
    -1
      web/models/wf_approvalrequest_steplst.go

+ 4
- 0
conf/app.go View File

@ -8,6 +8,10 @@ var ExampleFile = "http://localhost:8092/public/uploadxlsx/example.xlsx"
var Baseurl = "http://localhost:8092"
//var ExampleFile = "http://localhost:8094/public/uploadxlsx/example.xlsx"
//
//var Baseurl = "http://localhost:8094"
type AppConf struct {
DisablePathCorrection bool
EnablePathEscape bool


+ 19
- 16
conf/db.go View File

@ -12,14 +12,14 @@ type DbConf struct {
}
//线上服务器配置
//var MasterDbConfig DbConf = DbConf{
// Host: "127.0.0.1",
// Port: 3306,
// User: "root",
// Pwd: "Leit2020",
// DbName: "lappserver",
// BackUp: "C:\\lappServer\\dblog",
//}
var MasterDbConfig DbConf = DbConf{
Host: "127.0.0.1",
Port: 3306,
User: "root",
Pwd: "Leit2020",
DbName: "lappserver",
BackUp: "C:\\lapp_-wy\\dblog",
}
//var MasterDbConfig DbConf = DbConf{
@ -32,11 +32,14 @@ type DbConf struct {
//}
//测试服务器配置
var MasterDbConfig DbConf = DbConf{
Host: "localhost",
Port: 3306,
User: "root",
Pwd: "Leit2020",
DbName: "wyserver8094",
BackUp: "C:\\wyserver8094\\dblog",
}
//var MasterDbConfig DbConf = DbConf{
// Host: "localhost",
// Port: 3306,
// User: "root",
// Pwd: "Leit2020",
// DbName: "wyserver8094",
// BackUp: "C:\\ruifeng_wy\\dblog",
//}

+ 6
- 2
main.go View File

@ -34,6 +34,8 @@ func (p *program) Stop(s service.Service) error {
func main() {
svcConfig := &service.Config{
//Name: "wy8094-Server",
//DisplayName: "wy8094-Server",
Name: "LappServer",
DisplayName: "LappServer",
Description: "this is LappServer",
@ -106,7 +108,9 @@ func imain() {
//数据备份
go db.CornTime()
//启动监听端口
app.Run(iris.Addr(":22000"), iris.WithConfiguration(parse.C))
//app.Run(iris.Addr(":8092"), iris.WithConfiguration(parse.C))
//app.Run(iris.Addr(":22000"), iris.WithConfiguration(parse.C))
app.Run(iris.Addr(":8092"), iris.WithConfiguration(parse.C))
//app.Run(iris.Addr(":8094"), iris.WithConfiguration(parse.C))
}

+ 1
- 0
web/controllers/contracttab_controller.go View File

@ -273,6 +273,7 @@ func ExcelContracttab(ctx iris.Context) {
glog.InfoExtln("导入合同", "Constructionarea", infodata.Constructionarea)
glog.InfoExtln("导入合同", "lengthdays", lengthdays)
glog.InfoExtln("导入合同", "Lengthdate", me.Lengthdate)
data.Chargetime = me.Chargetime
if utils.ValueIsEmpty(infodata.Contractid) {
err = me.Add(data, lengthdays)
} else {


+ 11
- 4
web/models/chargetab.go View File

@ -2129,7 +2129,7 @@ func (t *Chargetab) ChargeTotalStatisticData(year int, selectType string) ([]Sum
}
fmt.Println("tempChargeLi:", tempChargeLi)
var arrearageYears int
if len(tempChargeLi) < 0 || tempChargeLi[0].Chargestartdate == "" {
if len(tempChargeLi) <= 0 || tempChargeLi[0].Chargestartdate == "" {
arrearageYears = 0
} else {
date := tempChargeLi[0].Chargestartdate
@ -2195,9 +2195,16 @@ func (t *Chargetab) ChargeTotalStatisticData(year int, selectType string) ([]Sum
one.ReceivableArea = utils.ValueToFloat(ReceivableArea, 0.0)
money := fmt.Sprintf("%0.0f", buildInfo.Constructionarea*buildInfo.Unitprice*12)
one.ReceivableMoney = utils.ValueToFloat(money, 0.0)
one.CurrentPercent = fmt.Sprintf("%.2f", ((totalMoney-arrearageMoney)/one.ReceivableMoney)*100) + "%"
one.ArrearagePercent = fmt.Sprintf("%.2f", (arrearageMoney/(one.ReceivableMoney*float64(arrearageYears)))*100) + "%"
if one.ReceivableMoney == 0 {
one.CurrentPercent = "0.00%"
} else {
one.CurrentPercent = fmt.Sprintf("%.2f", ((totalMoney-arrearageMoney)/one.ReceivableMoney)*100) + "%"
}
if arrearageYears == 0 {
one.ArrearagePercent = "0.00%"
} else {
one.ArrearagePercent = fmt.Sprintf("%.2f", (arrearageMoney/(one.ReceivableMoney*float64(arrearageYears)))*100) + "%"
}
glog.InfoExtln("年缴费测试", "one := ", one)
datalist = append(datalist, one)


+ 3
- 1
web/models/wf_approvalrequest_steplst.go View File

@ -2,6 +2,7 @@ package models
import (
"errors"
"fmt"
"lapp_-wy/db"
"lapp_-wy/utils"
"time"
@ -239,7 +240,8 @@ func (t *WfApprovalrequestSteplst) ListPage(pageSize int, pageIndex int, request
query = query.And("'" + t.Lastuser + "'" + " in (SELECT approver FROM `wf_approver` WHERE (wf_approver.approvalmodelid = a.approvalmodelid and wf_approver.approvallevel = a.approvallevel))")
table = table.And("'" + t.Lastuser + "'" + " in (SELECT approver FROM `wf_approver` WHERE (wf_approver.approvalmodelid = a.approvalmodelid and wf_approver.approvallevel = a.approvallevel))")
}
if t.Cid > 0 && role != "topm" && role != "finance" && role != "CFO"{
fmt.Println("test:", role)
if t.Cid > 0 && role != "topm" && role != "finance" && role != "CFO" && role != "buyer" && role != "accounting" && role != "FM" {
query = query.And("wf_approvalrequest.cid = ?", t.Cid)
table = table.And("wf_approvalrequest.cid = ?", t.Cid)
}


Loading…
Cancel
Save