| | |
| | | /// UnitValue |
| | | /// </summary> |
| | | [Route("Unit/Value")] |
| | | [ApiDescriptionSettings("Unit", Name = "单位值", Order = 8000)] |
| | | [ApiDescriptionSettings("Unit", Name = "单位值", Order = 80000)] |
| | | public class SysUnitValue_Controller : IDynamicApiController |
| | | { |
| | | private readonly Service.SysUnitValue _service = new(); |
| | |
| | | var vm_list = list?.Select(x => new SysUnitValueDto(x)).ToList(); |
| | | return vm_list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | 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 |