|
|
using System.Collections;
|
|
|
using Estsh.Core.Util;
|
|
|
using Estsh.Core.Repository.IRepositories;
|
|
|
using Estsh.Core.Services.IServices;
|
|
|
using Estsh.Core.Models;
|
|
|
using Estsh.Core.Model.Result;
|
|
|
using Estsh.Core.Dapper;
|
|
|
using Estsh.Core.Model.ExcelModel;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 更新人:sitong.dong
|
|
|
* 描述:
|
|
|
* 修改时间:2022.06.22
|
|
|
* 修改日志:系统迭代升级
|
|
|
*
|
|
|
**************************************************************************************************/
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 菜单业务处理类
|
|
|
/// </summary>
|
|
|
public class AdjustOrderService : BaseService<SysPartCustOrder>, IAdjustOrderService
|
|
|
{
|
|
|
|
|
|
private readonly IAdjustOrderRepository repository;
|
|
|
|
|
|
public AdjustOrderService(IAdjustOrderRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="AdjustOrderName"></param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction"></param>
|
|
|
/// <param name="sort"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable getAdjustOrderListByPage(Pager pager, String direction, String sort, string cbCustPDLine, string SN, string partNo, string enabled)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
String orderBy = " c.seq ";
|
|
|
result = repository.getListByPage(pager.pageSize, pager.pageNo, orderBy, cbCustPDLine, SN, partNo, enabled);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 保存菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int saveAdjustOrder(SysPartCustOrder htParams)
|
|
|
{
|
|
|
return repository.saveAdjustOrder(htParams);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 更新菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int updateAdjustOrder(SysPartCustOrder htParams)
|
|
|
{
|
|
|
return repository.updateAdjustOrder(htParams);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 查看详情
|
|
|
/// </summary>
|
|
|
/// <param name="ruid"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<SysPartCustOrder> getAdjustOrder(String part_id)
|
|
|
{
|
|
|
part_id = "part_id = " + part_id;
|
|
|
return repository.getList(part_id, "");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 删除菜单
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int deleteAdjustOrder(String ids)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.deleteAdjustOrder(id);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 上移
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool upRow(int seq, int ruid, int up_ruid, int up_seq)
|
|
|
{
|
|
|
return this.repository.upRow(seq, ruid, up_ruid, up_seq);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 上移多行
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool upAll(int ruid, int seq, int up_ruid, int up_seq)
|
|
|
{
|
|
|
return this.repository.upAll(ruid, seq, up_ruid, up_seq);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取上一条数据
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public List<GWorkorderDetail> selectAll(string CustPDLine)
|
|
|
{
|
|
|
return this.repository.selectAll(CustPDLine);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取下拉框中的菜单数据
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getSelectAdjustOrder()
|
|
|
{
|
|
|
return repository.getSelectAdjustOrder();
|
|
|
}
|
|
|
|
|
|
public int deleteOrder(String ruid)
|
|
|
{
|
|
|
return repository.deleteOrder(ruid);
|
|
|
}
|
|
|
|
|
|
public int deleteOrderInfo(String ruid, string custPdlineDesc)
|
|
|
{
|
|
|
string partLocation = repository.getPartLocation(ruid);
|
|
|
return repository.deleteOrderInfo(ruid, custPdlineDesc, partLocation);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 启用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int EnableData(String ids)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.EnableData(id);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 禁用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int DisableData(String ids)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.DisableData(id);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取分页菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="menuName">查询条件</param>
|
|
|
/// <param name="pager"></param>
|
|
|
/// <param name="direction">排序方式</param>
|
|
|
/// <param name="sort">排序字段</param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable getTableListByPage(String cbCustPDLine, Pager pager, String direction, String sort, Boolean isPage)
|
|
|
{
|
|
|
string orderBy = "c.seq";
|
|
|
return repository.getListByPage(pager.pageSize, pager.pageNo, orderBy, cbCustPDLine);
|
|
|
}
|
|
|
}
|
|
|
} |