|
@@ -824,7 +824,7 @@ func (this *OilContractController) ImportUpdate() {
|
|
|
_, err = utils.DBE.Query(sql)
|
|
_, err = utils.DBE.Query(sql)
|
|
|
}
|
|
}
|
|
|
if Column == "ContractNo" {
|
|
if Column == "ContractNo" {
|
|
|
- svc.GetEntityByWhere("OilContract", "ContractNo = '" + Value + "' and Id != " + Id, &con)
|
|
|
|
|
|
|
+ svc.GetEntityByWhere("OilContract", "ContractNo = '"+Value+"' and Id != "+Id, &con)
|
|
|
if Value == "" {
|
|
if Value == "" {
|
|
|
errinfo.Message = "修改失败!合同编号不能为空"
|
|
errinfo.Message = "修改失败!合同编号不能为空"
|
|
|
errinfo.Code = -1
|
|
errinfo.Code = -1
|
|
@@ -972,7 +972,7 @@ func (this *OilContractController) AddEntity() {
|
|
|
model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
model.SecondUnit = this.User.UnitId
|
|
model.SecondUnit = this.User.UnitId
|
|
|
var org organize.Base_Organize
|
|
var org organize.Base_Organize
|
|
|
- svc.GetEntityByWhere("Base_Organize", "Id = " + strconv.Itoa(this.User.UnitId), &org)
|
|
|
|
|
|
|
+ svc.GetEntityByWhere("Base_Organize", "Id = "+strconv.Itoa(this.User.UnitId), &org)
|
|
|
if org.Id > 0 {
|
|
if org.Id > 0 {
|
|
|
model.SecondUnitName = org.Fullname
|
|
model.SecondUnitName = org.Fullname
|
|
|
}
|
|
}
|
|
@@ -1196,8 +1196,8 @@ func (this *OilContractController) UpdateEntity() {
|
|
|
}
|
|
}
|
|
|
date := time.Now().Format("2006-01-02")
|
|
date := time.Now().Format("2006-01-02")
|
|
|
date1 := model.EndDate.Format("2006-01-02")
|
|
date1 := model.EndDate.Format("2006-01-02")
|
|
|
- if date >= date1 && model.IsYear == 1{
|
|
|
|
|
- model.YearDate = model.EndDate.AddDate(1,0,0)
|
|
|
|
|
|
|
+ if date >= date1 && model.IsYear == 1 {
|
|
|
|
|
+ model.YearDate = model.EndDate.AddDate(1, 0, 0)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
err := svc.UpdateEntityBytbl(OilContractName, id, &model, cols)
|
|
err := svc.UpdateEntityBytbl(OilContractName, id, &model, cols)
|
|
@@ -1298,7 +1298,7 @@ func (this *OilContractController) CountMoney() {
|
|
|
|
|
|
|
|
var model contract.OilContractMoney
|
|
var model contract.OilContractMoney
|
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
|
- svc.GetSum1(&model, "ContractId = " + Id + " and Year != '"+time.Now().Format("2006")+"'")
|
|
|
|
|
|
|
+ svc.GetSum1(&model, "ContractId = "+Id+" and Year != '"+time.Now().Format("2006")+"'")
|
|
|
this.Data["json"] = &model
|
|
this.Data["json"] = &model
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
@@ -1321,7 +1321,7 @@ func (this *OilContractController) YearList() {
|
|
|
|
|
|
|
|
var model []contract.OilContractMoney1
|
|
var model []contract.OilContractMoney1
|
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
|
- svc.GetList(&model, "ContractId = " + Id)
|
|
|
|
|
|
|
+ svc.GetList(&model, "ContractId = "+Id)
|
|
|
this.Data["json"] = &model
|
|
this.Data["json"] = &model
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
@@ -1332,7 +1332,8 @@ func (this *OilContractController) YearList() {
|
|
|
// @router /need-eva-list [get]
|
|
// @router /need-eva-list [get]
|
|
|
func (this *OilContractController) GetNeedEvaList() {
|
|
func (this *OilContractController) GetNeedEvaList() {
|
|
|
var list []contract.OilContract
|
|
var list []contract.OilContract
|
|
|
- sql := ` select a.* from OilContract a left join OilContractReview b on b.ContractId=a.Id where a.SecondUnit=` + strconv.Itoa(this.User.UnitId) + ` and (b.Status=0 or b.Status=NULL) `
|
|
|
|
|
|
|
+ // TODO 加年度
|
|
|
|
|
+ sql := ` select a.* from OilContract a left join OilContractReview b on b.ContractId=a.Id where a.ImportStatus > 0 and a.SecondUnit=` + strconv.Itoa(this.User.UnitId) + ` and (b.Status < 0 or b.Status=NULL) `
|
|
|
utils.DBE.Sql(sql).Find(&list)
|
|
utils.DBE.Sql(sql).Find(&list)
|
|
|
|
|
|
|
|
var dataInfo DataInfo
|
|
var dataInfo DataInfo
|
|
@@ -1387,7 +1388,7 @@ func (this *OilContractController) UpdateUnitName() {
|
|
|
UnitId := this.GetString("UnitId")
|
|
UnitId := this.GetString("UnitId")
|
|
|
ContractId := this.GetString("ContractId")
|
|
ContractId := this.GetString("ContractId")
|
|
|
var errinfo ErrorInfo
|
|
var errinfo ErrorInfo
|
|
|
- if Id == "" || UnitId == ""{
|
|
|
|
|
|
|
+ if Id == "" || UnitId == "" {
|
|
|
errinfo.Message = "操作失败!请求信息不完整"
|
|
errinfo.Message = "操作失败!请求信息不完整"
|
|
|
errinfo.Code = -2
|
|
errinfo.Code = -2
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
@@ -1398,9 +1399,9 @@ func (this *OilContractController) UpdateUnitName() {
|
|
|
var model contract.OilContract
|
|
var model contract.OilContract
|
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
svc := contract.GetOilContractService(utils.DBE)
|
|
|
var org organize.Base_Organize
|
|
var org organize.Base_Organize
|
|
|
- svc.GetEntityByWhere("Base_Organize", "Id = " + UnitId, &org)
|
|
|
|
|
|
|
+ svc.GetEntityByWhere("Base_Organize", "Id = "+UnitId, &org)
|
|
|
|
|
|
|
|
- model.SecondUnit ,_= strconv.Atoi(UnitId)
|
|
|
|
|
|
|
+ model.SecondUnit, _ = strconv.Atoi(UnitId)
|
|
|
model.SecondUnitName = org.Fullname
|
|
model.SecondUnitName = org.Fullname
|
|
|
where := "SecondUnit = " + Id
|
|
where := "SecondUnit = " + Id
|
|
|
if ContractId != "" {
|
|
if ContractId != "" {
|