|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Dapper;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Repository.IRepositories;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
using Estsh.Core.Util;
|
|
|
using System.Collections;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:日程单条码手工生成业务类
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 日程单条码手工生成业务处理类
|
|
|
/// </summary>
|
|
|
public class PurchasePrintService : BaseService<SysStock>, IPurchasePrintService
|
|
|
{
|
|
|
private readonly IPurchasePrintRepository repository;
|
|
|
|
|
|
public PurchasePrintService(IPurchasePrintRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="menuName"></param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction"></param>
|
|
|
/// <param name="sort"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<SysStock> GetListByPage(String stage_name, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
|
|
|
String strWhere = " ";
|
|
|
if (stage_name != null && !stage_name.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere = " stage_name like '%" + stage_name.Trim() + "%'";
|
|
|
}
|
|
|
|
|
|
String orderBy = "";
|
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
|
{
|
|
|
orderBy += typeof(SysStage).GetEntityColumnName(sort.Trim()) + " " + direction;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
orderBy += typeof(SysStage).GetEntityColumnName("ruid") + " " + direction;
|
|
|
}
|
|
|
List<SysStock> dt = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
|
|
|
return dt;
|
|
|
}
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取采购单信息,用于下拉列表框填充数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getBuyNo()
|
|
|
{
|
|
|
return repository.getBuyNo();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取订单编号
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public String getOrderNo(string orderType, string orderPrefix)
|
|
|
{
|
|
|
return repository.GetOrderNo(orderType, orderPrefix);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据采购单号获取相应的零件号
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<dynamic> getPartNo(String buyNo)
|
|
|
{
|
|
|
return repository.getPartNo(buyNo);
|
|
|
}
|
|
|
|
|
|
public Hashtable saveBuyOrder(Hashtable ht)
|
|
|
{
|
|
|
Hashtable resultHt = new Hashtable();
|
|
|
bool saveResult = repository.saveBuyOrder(ht);
|
|
|
List<GBuyDayFact> dtOrder = repository.getBuyOrder(ht);
|
|
|
List<dynamic> dtOrderStock = repository.getBuyOrderStock(ht);
|
|
|
resultHt.Add("rows", dtOrder);
|
|
|
resultHt.Add("orderStock", dtOrderStock);
|
|
|
resultHt.Add("saveResult",saveResult);
|
|
|
return resultHt;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 删除采购单信息
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable deleteBuyOrder(Hashtable ht)
|
|
|
{
|
|
|
bool delResult = repository.deleteBuyOrder(ht);
|
|
|
List<GBuyDayFact> dt = repository.getBuyOrder(ht);
|
|
|
List<dynamic> dtOrderStock = repository.getBuyOrderStock(ht);
|
|
|
Hashtable resultHt = new Hashtable();
|
|
|
resultHt.Add("status", delResult);
|
|
|
resultHt.Add("rows", dt);
|
|
|
resultHt.Add("orderStock", dtOrderStock);
|
|
|
return resultHt;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 启用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable EnableData(Hashtable ht)
|
|
|
{
|
|
|
bool delResult = repository.EnableData(ht);
|
|
|
List<GBuyDayFact> dt = repository.getBuyOrder(ht);
|
|
|
List<dynamic> dtOrderStock = repository.getBuyOrderStock(ht);
|
|
|
Hashtable resultHt = new Hashtable();
|
|
|
resultHt.Add("status", delResult);
|
|
|
resultHt.Add("rows", dt);
|
|
|
resultHt.Add("orderStock", dtOrderStock);
|
|
|
return resultHt;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 禁用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable DisableData(Hashtable ht)
|
|
|
{
|
|
|
bool delResult = repository.DisableData(ht);
|
|
|
List<GBuyDayFact> dt = repository.getBuyOrder(ht);
|
|
|
List<dynamic> dtOrderStock = repository.getBuyOrderStock(ht);
|
|
|
Hashtable resultHt = new Hashtable();
|
|
|
resultHt.Add("status", delResult);
|
|
|
resultHt.Add("rows", dt);
|
|
|
resultHt.Add("orderStock", dtOrderStock);
|
|
|
return resultHt;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
} |