diff --git a/api/version1/departmentseting/departmentpc/dingliang.go b/api/version1/departmentseting/departmentpc/dingliang.go index 406ee2c..65c68d6 100644 --- a/api/version1/departmentseting/departmentpc/dingliang.go +++ b/api/version1/departmentseting/departmentpc/dingliang.go @@ -414,3 +414,86 @@ func GetTargetDetailsInfoList(targetid, tableid, bylaws, orgid, post int64, type err = gormDb.Find(&bylawsId).Error return } + +/* +* +@ 作者: 秦东 +@ 时间: 2023-04-12 16:03:31 +@ 功能: 提交定量考核 +@ 参数 + + # + +@ 返回值 + + # + +@ 方法原型 + + # +*/ +func (a *ApiMethod) SubmitQuantifyTarget(c *gin.Context) { + var receivedValue SubmitQuantTargetCont + c.ShouldBindJSON(&receivedValue) + if receivedValue.FlowworkId == "" { + publicmethod.Result(1, receivedValue, c, "未知工作流!不可进行提交") + return + } + if receivedValue.DepartmentId == "" { + publicmethod.Result(1, receivedValue, c, "未知行政组织!不可进行提交") + return + } + if receivedValue.PlanVersionNumber == "" { + publicmethod.Result(1, receivedValue, c, "未知方案!不可进行提交") + return + } + if receivedValue.Time == "" { + publicmethod.Result(1, receivedValue, c, "未知考核时间!不可进行提交") + return + } + if len(receivedValue.List) < 1 { + publicmethod.Result(1, receivedValue, c, "未知考核项目!不可进行提交") + return + } + + var errMsg []string + for _, v := range receivedValue.List { + if v.Id == "" { + errMsg = append(errMsg, "未知考核项目") + } + if v.Actual == "" { + errMsg = append(errMsg, fmt.Sprintf("%v未输入实际值", v.Targetname)) + } + if v.Addtime == "" { + errMsg = append(errMsg, fmt.Sprintf("%v未输入检查时间", v.Targetname)) + } + + var waiBuTime publicmethod.DateTimeTotimes + waiBuTime.BaisStrToTime(v.Addtime) + where := publicmethod.MapOut[string]() + where["fld_year"] = waiBuTime.Years + where["fld_quarter"] = waiBuTime.Quarter + where["fld_month"] = waiBuTime.Months + where["fld_evaluation_id"] = v.Id + where["fl_duty_department"] = receivedValue.DepartmentId + + fmt.Printf("where--->%v\n", where) + + var dutyData modelskpi.DutyFlowData + err := dutyData.GetCont(where, "fld_id") + if err == nil { + errMsg = append(errMsg, fmt.Sprintf("%v已经提交过!请不要重复提交!", v.Targetname)) + } + } + if len(errMsg) > 0 { + errMsgStr := strings.Join(errMsg, ";") + publicmethod.Result(1, receivedValue, c, errMsgStr) + return + } + + publicmethod.Result(0, receivedValue, c) + // uuid := publicmethod.GetUUid(6) //上报数据唯一识别码 + // //获取登录人信息 + // myLoginCont, _ := publicmethod.LoginMyCont(c) + +}