You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

263 lines
8.9 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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.IRepositories;
using Estsh.Core.Dapper;
/***************************************************************************************************
*
* 更新人sitong.dong
* 描述:移动单管理
* 修改时间2022.06.22
* 修改日志:系统迭代升级
*
**************************************************************************************************/
namespace Estsh.Core.Services
{
public class MovementManageService : BaseService<WmsMoveHeader>, IMovementManageService
{
private readonly IMovementManageRepository repository;
public MovementManageService(IMovementManageRepository _repository) : base(_repository)
{
repository = _repository;
}
public Hashtable getMoveHeaderListByPage(string orderNo, string orderType, string orderStatus, string startTime, string endTime, string enabled, int factoryId, Pager pager, String direction, String sort,string refOrderNo)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (orderNo != null && !orderNo.Trim().Equals(""))
{
strWhere += "and a.order_no like '%" + orderNo.Trim() + "%' ";
}
if (orderType != null && !orderType.Trim().Equals(""))
{
strWhere += "and a.order_type ='" + orderType.Trim() + "' ";
}
if (refOrderNo != null && !refOrderNo.Trim().Equals(""))
{
strWhere += "and a.ref_Order_No ='" + refOrderNo.Trim() + "' ";
}
if (orderStatus != null && !orderStatus.Trim().Equals(""))
{
strWhere += "and a.order_status ='" + orderStatus.Trim() + "' ";
}
if (!String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time BETWEEN '" + startTime.Trim() + "' AND '" + endTime.Trim() + "'";
}
else if (String.IsNullOrEmpty(startTime) && !String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time < '" + endTime.Trim() + "'";
}
else if (!String.IsNullOrEmpty(startTime) && String.IsNullOrEmpty(endTime))
{
strWhere += " and a.create_time >'" + startTime.Trim() + "'";
}
if (enabled != null && !enabled.Trim().Equals(""))
{
strWhere += "and a.enabled = '" + enabled.Trim() + "' ";
}
strWhere += " and a.factory_id = " + factoryId + " ";
String orderBy = "";
if (sort != null && !"".Equals(sort.Trim()))
{
orderBy += typeof(WmsMoveHeader).GetEntityColumnName(sort.Trim()) + " " + direction;
}
else
{
orderBy += typeof(WmsMoveHeader).GetEntityColumnName("ruid") + " " + direction;
}
return repository.getMoveHeaderListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
}
public Hashtable getMoveDetailListByPage(string orderNo, string enabled, int factoryId)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (orderNo != null && !orderNo.Trim().Equals(""))
{
strWhere += "and a.order_no like '%" + orderNo.Trim() + "%' ";
}
if (enabled != null && !enabled.Trim().Equals(""))
{
strWhere += "and a.enabled = '" + enabled.Trim() + "' ";
}
strWhere += " and a.factory_id = " + factoryId + " ";
return repository.getMoveDetailListByPage(strWhere);
}
public Hashtable getMoveSnListByPage(string orderNo, string partNo, string enabled, int factoryId)
{
Hashtable result = new Hashtable();
String strWhere = " 1=1 ";
if (orderNo != null && !orderNo.Trim().Equals(""))
{
strWhere += "and a.order_no = '" + orderNo.Trim() + "' ";
}
if (partNo != null && !partNo.Trim().Equals(""))
{
strWhere += "and a.part_no = '" + partNo.Trim() + "' ";
}
if (enabled != null && !enabled.Trim().Equals(""))
{
strWhere += "and a.enabled = '" + enabled.Trim() + "' ";
}
strWhere += " and a.factory_id = " + factoryId + " ";
return repository.getMoveSnListByPage(strWhere);
}
public Hashtable onBarcodeGenerator(String ids)
{
ids = ids.Substring(0, ids.Length - 1);
return this.repository.onBarcodeGenerator(ids);
}
public List<KeyValueResult> GetErpwarehouse()
{
return repository.GetErpwarehouse();
}
public List<KeyValueResult> GetMoveOrderType()
{
return repository.GetMoveOrderType();
}
public List<KeyValueResult> getSelectRefOrderNo()
{
return repository.getSelectRefOrderNo();
}
public List<KeyValueResult> GetFedbatchType()
{
return repository.GetFedbatchType();
}
public List<KeyValueResult> GetFedbatchMethods()
{
return repository.GetFedbatchMethods();
}
public List<KeyValueResult> GetMoveOrderStatus()
{
return repository.GetMoveOrderStatus();
}
public List<KeyValueResult> getSelectFactory()
{
return repository.getSelectFactory();
}
public List<KeyValueResult> getSelectWarehouse()
{
return repository.getSelectWarehouse();
}
public List<SysWarehouse> getSelectWarehouse(string warehouseid)
{
return repository.getSelectWarehouse(warehouseid);
}
public List<SysZone> getSelectZone(string zoneid)
{
return repository.getSelectZone(zoneid);
}
public List<KeyValueResult> getSelectZone()
{
return repository.getSelectZone();
}
public List<KeyValueResult> getSelectVendor()
{
return repository.getSelectVendor();
}
public List<SysVendor> getSelectVendor(string vendorId)
{
return repository.getSelectVendor(vendorId);
}
public List<KeyValueResult> GetPart()
{
return repository.GetPart(0);
}
public List<SysPart> GetPart(string PartNo)
{
return repository.GetPart(0, PartNo);
}
/// <summary>
/// 保存菜单数据
/// </summary>
/// <param name="htParams"></param>
/// <returns></returns>
public bool saveMovementManage(WmsMoveHeader htParams, IList<WmsMoveDetail> htDetailParams)
{
return repository.saveMovementManage(htParams, htDetailParams);
}
public List<SysPart> GetPartNoInfo(string part_no)
{
return this.repository.GetPartNoInfo(part_no);
}
public List<SysPart> GetPartNoInfoByPartNo(string part_no)
{
return this.repository.GetPartNoInfoByPartNo(part_no);
}
public List<SysPart> GetPartSpecInfo(string partSpec)
{
return this.repository.GetPartSpecInfo(partSpec);
}
public List<SysPart> GetPartSpecInfoByPartSpec(string partSpec)
{
return this.repository.GetPartSpecInfoByPartSpec(partSpec);
}
public List<MesWorkOrder> GetWorkRefOrderNo(string refOrderNo, string orderType)
{
return this.repository.GetWorkRefOrderNo(refOrderNo,orderType);
}
public List<MesWorkOrder> GetWorkOrderInfo(string refOrderNo)
{
return this.repository.GetWorkOrderInfo(refOrderNo);
}
/// <summary>
/// 关闭
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public bool onClose(String ids, String empId)
{
ids = ids.Substring(0, ids.Length - 1);
return this.repository.onClose(ids, empId);
}
/// <summary>
/// 启用
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public bool EnableData(String ids)
{
ids = ids.Substring(0, ids.Length - 1);
return this.repository.EnableData(ids);
}
/// <summary>
/// 禁用
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
public bool DisableData(String ids)
{
ids = ids.Substring(0, ids.Length - 1);
return this.repository.DisableData(ids);
}
}
}