65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
using CSRedis;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Linq;
|
|
using System.Collections.Generic;
|
|
using ZR.Admin.WebApi.Extensions;
|
|
using ZR.Model.mes.md;
|
|
using ZR.Service.mes.md;
|
|
using ZR.Service.mes.md.IService;
|
|
|
|
namespace ZR.Admin.WebApi.Controllers.mes.md
|
|
{
|
|
[Route("mes/md/product")]
|
|
public class MdProductDefineController : BaseController
|
|
{
|
|
private readonly IMdProductDefineService mdProduct;
|
|
public MdProductDefineController(IMdProductDefineService mdProduct) {
|
|
this.mdProduct = mdProduct;
|
|
}
|
|
/// <summary>
|
|
/// 分页查寻 unti
|
|
/// </summary>
|
|
/// <param name="pageNum">页码</param>
|
|
/// <param name="pagesize">页尺</param>
|
|
/// <param name="name">单位名称</param>
|
|
/// <param name="code">单位代码</param>
|
|
/// <returns></returns>
|
|
[HttpGet("list")]
|
|
public IActionResult Getlist(int pageNum, int pagesize, string name = "", string code = "")
|
|
{
|
|
var unitPageDto = mdProduct.GetList(name, code, pageNum, pagesize);
|
|
return SUCCESS(unitPageDto);
|
|
}
|
|
|
|
//
|
|
|
|
[HttpGet("getUnit/{name}")]
|
|
public IActionResult GetUnitlist(string name)
|
|
{
|
|
List<MdUnit> units = mdProduct.GetProductDefineList(name);
|
|
return SUCCESS(units);
|
|
}
|
|
[HttpGet("getUnit")]
|
|
public IActionResult GetUnitlist()
|
|
{
|
|
List<MdUnit> units = mdProduct.GetProductDefineList();
|
|
return SUCCESS(units);
|
|
}
|
|
|
|
//addProductDefine
|
|
[HttpPost("addProductDefine")]
|
|
public int addProductDefine([FromBody] MdProductDefine products)
|
|
{
|
|
int result = mdProduct.InsertProductDefine(products);
|
|
return result;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|