| | |
| | | return vm_list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region Insert |
| | |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新编码 |
| | | /// </summary> |
| | | [Route("UpdateCode@V1.0")] |
| | | [HttpPut] |
| | | public bool UpdateCode([Required] UpdateCodeInput input) |
| | | { |
| | | var model = _service.GetByID(input.ID); |
| | | if (model == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | if (_service.IsExistCodeExceptID(model.TypeID, input.Code, input.ID)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} 编码已存在"); |
| | | } |
| | | var bol = _service.UpdateCode(input.ID, input.Code); |
| | | return bol; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Exist |