|
|
@@ -255,10 +255,28 @@ func (this *OilContractReviewController) AddEntity() {
|
|
|
var modeVO contractReview.OilContractReviewVo
|
|
|
var jsonBlob = this.Ctx.Input.RequestBody
|
|
|
json.Unmarshal(jsonBlob, &modeVO)
|
|
|
+ var reviewMode contractReview.OilContractReview
|
|
|
+
|
|
|
+
|
|
|
+ var errinfo ErrorDataInfo
|
|
|
+ defer func() { //finally处理失败的异常
|
|
|
+ if err := recover(); err != nil {
|
|
|
+ errinfo.Message = err.(string)
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ //返回正确结果
|
|
|
+ errinfo.Message = "添加成功!"
|
|
|
+ errinfo.Code = 0
|
|
|
+ errinfo.Item = reviewMode.Id
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
+ }()
|
|
|
|
|
|
svc := contractReview.GetOilContractReviewService(utils.DBE)
|
|
|
itemSvc := contractEvaluationItems.GetOilContractEvaluationItemsService(utils.DBE)
|
|
|
- var reviewMode contractReview.OilContractReview
|
|
|
reviewMode.IsFinal = modeVO.IsFinal
|
|
|
reviewMode.IsBusiness = modeVO.IsBusiness
|
|
|
reviewMode.ContractId = modeVO.ContractId
|
|
|
@@ -270,11 +288,14 @@ func (this *OilContractReviewController) AddEntity() {
|
|
|
reviewMode.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
_, err := svc.InsertEntityBytbl(OilContractReviewName, &reviewMode)
|
|
|
|
|
|
+ if err != nil{
|
|
|
+ panic("err失败")
|
|
|
+ }
|
|
|
+
|
|
|
var items2 []contractEvaluationItems.OilContractEvaluationItems
|
|
|
var items3 []contractEvaluationItems.OilContractEvaluationItems
|
|
|
var items4 []contractEvaluationItems.OilContractEvaluationItems // 业务处室发起评价
|
|
|
|
|
|
- var errinfo ErrorDataInfo
|
|
|
if len(modeVO.Items) == 0 {
|
|
|
errinfo.Message = "操作失败!评价细项信息不完整!"
|
|
|
errinfo.Code = -1
|
|
|
@@ -345,37 +366,26 @@ func (this *OilContractReviewController) AddEntity() {
|
|
|
items4 = append(items4, temp4)
|
|
|
|
|
|
}
|
|
|
- errBool := true
|
|
|
if modeVO.IsBusiness == 0 {
|
|
|
_, err2 := itemSvc.DBE.Insert(items2)
|
|
|
+ if err2 != nil{
|
|
|
+ panic("err2失败")
|
|
|
+ }
|
|
|
|
|
|
// 专业处室评价默认二级
|
|
|
_, err3 := itemSvc.DBE.Insert(items3)
|
|
|
- if err2 == nil && err3 == nil {
|
|
|
- errBool = false
|
|
|
+ if err3 != nil{
|
|
|
+ panic("err3失败")
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if modeVO.IsBusiness == 1 {
|
|
|
_, err4 := itemSvc.DBE.Insert(items4)
|
|
|
- if err4 == nil {
|
|
|
- errBool = false
|
|
|
+ if err4 != nil{
|
|
|
+ panic("err4失败")
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if err == nil && errBool == false {
|
|
|
- //新增
|
|
|
- errinfo.Message = "添加成功!"
|
|
|
- errinfo.Code = 0
|
|
|
- errinfo.Item = reviewMode.Id
|
|
|
- this.Data["json"] = &errinfo
|
|
|
- this.ServeJSON()
|
|
|
- } else {
|
|
|
- errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
|
|
|
- errinfo.Code = -1
|
|
|
- this.Data["json"] = &errinfo
|
|
|
- this.ServeJSON()
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// @Title 从数据录入数据导出到word文档
|
|
|
@@ -447,7 +457,7 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
datamap["Discount"] = score
|
|
|
|
|
|
if contractModel.Id != 0 {
|
|
|
- datamap["Amount"] = contractModel.Amount
|
|
|
+ datamap["Amount"] = contractModel.IsYearMoney
|
|
|
datamap["SupplierName"] = contractModel.SupplierName
|
|
|
datamap["ProjectName"] = contractModel.ContractName
|
|
|
datamap["ContractNo"] = contractModel.ContractNo
|
|
|
@@ -470,7 +480,7 @@ func (this *OilContractReviewController) DocExport() {
|
|
|
} else {
|
|
|
datamap["ConstructionUnit"] = contractModel.ConstructionUnit
|
|
|
}
|
|
|
- datamap["ConstructionOwner"] = contractModel.ConstructionOwner
|
|
|
+ datamap["ConstructionOwner"] = contractModel.ProjectOwner
|
|
|
datamap["ConstructionTelphone"] = contractModel.ConstructionTelphone
|
|
|
}
|
|
|
if supplierEntity.Id != 0 {
|