public async Task <ActionResult <BaseResponse> > UpdateTypeModuleControlAsync(int typeId, [FromBody] TypeModuleControlUpdateDto req) { string Account = User.Claims.FirstOrDefault(a => a.Type == "Account").Value; #region 检测类型 var type = await _ts.CheckTypeAsync(typeId); if (!type.IsExist) { return(new BaseResponse { Success = false, Message = "输入的类型编号不存在" }); } if (type.Status == 0) { return(new BaseResponse { Success = false, Message = "该类型为目录型节点,不允许添加数据" }); } #endregion var control = await _tmcs.IsExistCheck(a => a.Id == req.Id); if (control.IsExist == false) { return(new BaseResponse { Success = false, Message = "输入的控制数据编号不存在" }); } #region 检查模块是否存在 var exist = await _tms.IsExist(a => a.Id == control.ModuleId && a.TypeId == typeId); if (!exist) { return(new BaseResponse { Success = false, Message = "输入的类型模块在该类型下不存在" }); } #endregion #region 检测数据定义标示是否存在 var td = await _td.IsExist(a => a.Id == req.DataDefineId); if (!td) { return(new BaseResponse { Success = false, Message = "输入的类型数据定义不存在" }); } #endregion var rm = await _tmcs.UpdateTypeModuleControlAsync(Account, req); return(rm); }