|
@@ -225,20 +225,20 @@ func (this *OilContractSumScoreController) GetComputeEntityList(){
|
|
|
}
|
|
}
|
|
|
SupplierName := this.GetString("SupplierName")
|
|
SupplierName := this.GetString("SupplierName")
|
|
|
//CreateOn := this.GetString("CreateOn")
|
|
//CreateOn := this.GetString("CreateOn")
|
|
|
- Type := this.GetString("Type","01")
|
|
|
|
|
|
|
+ ContractClass := this.GetString("ContractClass","01")
|
|
|
|
|
|
|
|
if SupplierName != "" {
|
|
if SupplierName != "" {
|
|
|
where = where + " and contract.SupplierName like '%" + SupplierName + "%'"
|
|
where = where + " and contract.SupplierName like '%" + SupplierName + "%'"
|
|
|
}
|
|
}
|
|
|
- if Type != ""{
|
|
|
|
|
- where = where + " and contract.ContractClass = '" + Type + "'"
|
|
|
|
|
|
|
+ if ContractClass != ""{
|
|
|
|
|
+ where = where + " and contract.ContractClass = '" + ContractClass + "'"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 今年的汇总
|
|
// 今年的汇总
|
|
|
year := strconv.Itoa(time.Now().Year())
|
|
year := strconv.Itoa(time.Now().Year())
|
|
|
month := "01"
|
|
month := "01"
|
|
|
day := "01"
|
|
day := "01"
|
|
|
- where = where + " and CreateOn>='" + year + "-" + month + "-" + day + "' "
|
|
|
|
|
|
|
+ where = where + " and review.CreateOn>='" + year + "-" + month + "-" + day + "' "
|
|
|
|
|
|
|
|
//if CreateOn != "" {
|
|
//if CreateOn != "" {
|
|
|
// dates := strings.Split(CreateOn, ",")
|
|
// dates := strings.Split(CreateOn, ",")
|
|
@@ -293,8 +293,41 @@ func (this *OilContractSumScoreController) GetEntity() {
|
|
|
Id := this.Ctx.Input.Param(":id")
|
|
Id := this.Ctx.Input.Param(":id")
|
|
|
var model contractSumScore.OilContractSumScore
|
|
var model contractSumScore.OilContractSumScore
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
- svc.GetEntityByIdBytbl(this.User.AccCode+OilContractSumScoreName, Id, &model)
|
|
|
|
|
- this.Data["json"] = &model
|
|
|
|
|
|
|
+ svc.GetEntityByIdBytbl(OilContractSumScoreName, Id, &model)
|
|
|
|
|
+
|
|
|
|
|
+ var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
|
|
+ itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 0 "
|
|
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
|
|
+
|
|
|
|
|
+ var result contractSumScore.OilContractSumScoreVo
|
|
|
|
|
+ result.Id = model.Id
|
|
|
|
|
+ result.SupplierId = model.SupplierId
|
|
|
|
|
+ result.SupplierName = model.SupplierName
|
|
|
|
|
+ result.ContractClass= model.ContractClass
|
|
|
|
|
+ result.Year = model.Year
|
|
|
|
|
+ result.Status = model.Status
|
|
|
|
|
+ result.Category = item.Category
|
|
|
|
|
+ result.SumScoreId = item.SumScoreId
|
|
|
|
|
+ result.SumScore = item.SumScore
|
|
|
|
|
+ result.Content1 = item.Content1
|
|
|
|
|
+ result.Content2 = item.Content2
|
|
|
|
|
+ result.Content3 = item.Content3
|
|
|
|
|
+ result.Content4 = item.Content4
|
|
|
|
|
+ result.Content5 = item.Content5
|
|
|
|
|
+ result.SumScore1 = item.SumScore1
|
|
|
|
|
+ result.SumScore2 = item.SumScore2
|
|
|
|
|
+ result.SumScore3 = item.SumScore3
|
|
|
|
|
+ result.SumScore4 = item.SumScore4
|
|
|
|
|
+ result.SumScore5 = item.SumScore5
|
|
|
|
|
+ result.NormalSumScore1 = item.NormalSumScore1
|
|
|
|
|
+ result.NormalSumScore2 = item.NormalSumScore2
|
|
|
|
|
+ result.NormalSumScore3 = item.NormalSumScore3
|
|
|
|
|
+ result.NormalSumScore4 = item.NormalSumScore4
|
|
|
|
|
+ result.NormalSumScore5 = item.NormalSumScore5
|
|
|
|
|
+ result.Note = item.Note
|
|
|
|
|
+ result.Conclusion = item.Conclusion
|
|
|
|
|
+ this.Data["json"] = &result
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -312,7 +345,7 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
entity.SupplierId = model.SupplierId
|
|
entity.SupplierId = model.SupplierId
|
|
|
entity.SupplierName = model.SupplierName
|
|
entity.SupplierName = model.SupplierName
|
|
|
entity.ContractClass= model.ContractClass
|
|
entity.ContractClass= model.ContractClass
|
|
|
- entity.Category = 1 // 二级单位创建
|
|
|
|
|
|
|
+ entity.Year = model.Year
|
|
|
entity.Status = "0"
|
|
entity.Status = "0"
|
|
|
entity.CreateOn = time.Now()
|
|
entity.CreateOn = time.Now()
|
|
|
entity.CreateBy = this.User.Realname
|
|
entity.CreateBy = this.User.Realname
|
|
@@ -323,6 +356,7 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
|
|
|
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
item.SumScoreId = entity.Id
|
|
item.SumScoreId = entity.Id
|
|
|
|
|
+ item.Category = 0 // 二级单位创建
|
|
|
item.SumScore = model.SumScore
|
|
item.SumScore = model.SumScore
|
|
|
item.Content1 = model.Content1
|
|
item.Content1 = model.Content1
|
|
|
item.NormalSumScore1 = model.NormalSumScore1
|
|
item.NormalSumScore1 = model.NormalSumScore1
|
|
@@ -339,13 +373,14 @@ func (this *OilContractSumScoreController) AddEntity() {
|
|
|
item.Content5 = model.Content5
|
|
item.Content5 = model.Content5
|
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
item.NormalSumScore5 = model.NormalSumScore5
|
|
|
item.SumScore5 = model.SumScore5
|
|
item.SumScore5 = model.SumScore5
|
|
|
|
|
+ item.Conclusion = model.Conclusion
|
|
|
item.Note = model.Note
|
|
item.Note = model.Note
|
|
|
item.CreateOn = time.Now()
|
|
item.CreateOn = time.Now()
|
|
|
item.CreateBy = this.User.Realname
|
|
item.CreateBy = this.User.Realname
|
|
|
item.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
item.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
- itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &entity)
|
|
|
|
|
|
|
+ itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
|
|
|
var errinfo ErrorDataInfo
|
|
var errinfo ErrorDataInfo
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
//新增
|
|
//新增
|
|
@@ -378,74 +413,83 @@ func (this *OilContractSumScoreController) UpdateEntity() {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- var model contractSumScore.OilContractSumScore
|
|
|
|
|
|
|
+ var model contractSumScore.OilContractSumScoreVo
|
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
|
|
|
-
|
|
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonBlob, &model)
|
|
json.Unmarshal(jsonBlob, &model)
|
|
|
- model.ModifiedOn = time.Now()
|
|
|
|
|
- model.ModifiedBy = this.User.Realname
|
|
|
|
|
- model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
|
|
|
|
|
|
+ var entity contractSumScore.OilContractSumScore
|
|
|
|
|
+ entity.SupplierId = model.SupplierId
|
|
|
|
|
+ entity.SupplierName = model.SupplierName
|
|
|
|
|
+ entity.ContractClass= model.ContractClass
|
|
|
|
|
+ entity.Year = model.Year
|
|
|
|
|
+ entity.Status = "0"
|
|
|
|
|
+ entity.ModifiedOn = time.Now()
|
|
|
|
|
+ entity.ModifiedBy = this.User.Realname
|
|
|
|
|
+ entity.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
cols := []string{
|
|
cols := []string{
|
|
|
-
|
|
|
|
|
- "Id",
|
|
|
|
|
-
|
|
|
|
|
- "ContractId",
|
|
|
|
|
-
|
|
|
|
|
|
|
+ "SupplierId",
|
|
|
|
|
+ "SupplierName",
|
|
|
"ContractClass",
|
|
"ContractClass",
|
|
|
|
|
+ "Year",
|
|
|
|
|
+ "Status",
|
|
|
|
|
+ "CreateOn",
|
|
|
|
|
+ "CreateBy",
|
|
|
|
|
+ "CreateUserId",
|
|
|
|
|
+ }
|
|
|
|
|
+ err := svc.UpdateEntityBytbl(OilContractSumScoreName, id, &model, cols)
|
|
|
|
|
|
|
|
- "SumScore",
|
|
|
|
|
|
|
+ var item contractSumScoreItems.OilContractSumScoreItems
|
|
|
|
|
+ itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
|
|
|
|
|
+ where := " 1=1 AND SumScoreId= '" + utils.ToStr( entity.Id) + "' AND Category = 0 "
|
|
|
|
|
+ itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where,&item)
|
|
|
|
|
+ item.Category = 1 // 二级单位创建
|
|
|
|
|
+ item.SumScore = model.SumScore
|
|
|
|
|
+ item.Content1 = model.Content1
|
|
|
|
|
+ item.NormalSumScore1 = model.NormalSumScore1
|
|
|
|
|
+ item.SumScore1 = model.SumScore1
|
|
|
|
|
+ item.Content2 = model.Content2
|
|
|
|
|
+ item.NormalSumScore2 = model.NormalSumScore2
|
|
|
|
|
+ item.SumScore2 = model.SumScore2
|
|
|
|
|
+ item.Content3 = model.Content3
|
|
|
|
|
+ item.NormalSumScore3 = model.NormalSumScore3
|
|
|
|
|
+ item.SumScore3 = model.SumScore3
|
|
|
|
|
+ item.Content4 = model.Content4
|
|
|
|
|
+ item.NormalSumScore4 = model.NormalSumScore4
|
|
|
|
|
+ item.SumScore4 = model.SumScore4
|
|
|
|
|
+ item.Content5 = model.Content5
|
|
|
|
|
+ item.NormalSumScore5 = model.NormalSumScore5
|
|
|
|
|
+ item.SumScore5 = model.SumScore5
|
|
|
|
|
+ item.Note = model.Note
|
|
|
|
|
+ item.ModifiedOn = time.Now()
|
|
|
|
|
+ item.ModifiedBy = this.User.Realname
|
|
|
|
|
+ item.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
|
|
|
|
|
|
|
+ cols2 := []string{
|
|
|
|
|
+ "Category",
|
|
|
|
|
+ "SumScore",
|
|
|
"Content1",
|
|
"Content1",
|
|
|
-
|
|
|
|
|
- "NormalSumScore1",
|
|
|
|
|
-
|
|
|
|
|
- "SumScore1",
|
|
|
|
|
-
|
|
|
|
|
"Content2",
|
|
"Content2",
|
|
|
-
|
|
|
|
|
- "NormalSumScore2",
|
|
|
|
|
-
|
|
|
|
|
- "SumScore2",
|
|
|
|
|
-
|
|
|
|
|
"Content3",
|
|
"Content3",
|
|
|
-
|
|
|
|
|
- "NormalSumScore3",
|
|
|
|
|
-
|
|
|
|
|
- "SumScore3",
|
|
|
|
|
-
|
|
|
|
|
"Content4",
|
|
"Content4",
|
|
|
-
|
|
|
|
|
- "NormalSumScore4",
|
|
|
|
|
-
|
|
|
|
|
- "SumScore4",
|
|
|
|
|
-
|
|
|
|
|
"Content5",
|
|
"Content5",
|
|
|
-
|
|
|
|
|
|
|
+ "NormalSumScore1",
|
|
|
|
|
+ "NormalSumScore2",
|
|
|
|
|
+ "NormalSumScore3",
|
|
|
|
|
+ "NormalSumScore4",
|
|
|
"NormalSumScore5",
|
|
"NormalSumScore5",
|
|
|
-
|
|
|
|
|
|
|
+ "SumScore1",
|
|
|
|
|
+ "SumScore2",
|
|
|
|
|
+ "SumScore3",
|
|
|
|
|
+ "SumScore4",
|
|
|
"SumScore5",
|
|
"SumScore5",
|
|
|
-
|
|
|
|
|
- "ConclusionReason",
|
|
|
|
|
-
|
|
|
|
|
- "Conclusion",
|
|
|
|
|
-
|
|
|
|
|
- "CreateOn",
|
|
|
|
|
-
|
|
|
|
|
- "CreateUserId",
|
|
|
|
|
-
|
|
|
|
|
- "CreateBy",
|
|
|
|
|
-
|
|
|
|
|
|
|
+ "Note",
|
|
|
"ModifiedOn",
|
|
"ModifiedOn",
|
|
|
-
|
|
|
|
|
- "ModifiedUserId",
|
|
|
|
|
-
|
|
|
|
|
"ModifiedBy",
|
|
"ModifiedBy",
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ "ModifiedUserId",
|
|
|
}
|
|
}
|
|
|
- err := svc.UpdateEntityBytbl(this.User.AccCode+OilContractSumScoreName, id, &model, cols)
|
|
|
|
|
|
|
+ itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
|
|
|
|
|
+
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
errinfo.Message = "修改成功!"
|
|
errinfo.Message = "修改成功!"
|
|
|
errinfo.Code = 0
|
|
errinfo.Code = 0
|