|
|
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;
|
|
|
|
|
|
namespace Estsh.Core.Services
|
|
|
{
|
|
|
public class KanBanService : BaseService<WmsCarArrive>, IKanBanService
|
|
|
{
|
|
|
private readonly IKanBanRepository repository;
|
|
|
public KanBanService(IKanBanRepository _repository) : base(_repository)
|
|
|
{
|
|
|
repository = _repository;
|
|
|
}
|
|
|
|
|
|
public Hashtable getCarManagerListByPage(string supplierName, string txtStartTime, string txtEndTime, string enabled, int factoryId, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
|
|
|
String strWhere = " 1=1 ";
|
|
|
if (supplierName != null && !supplierName.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere += "and supplier_name like '%" + supplierName.Trim() + "%'";
|
|
|
}
|
|
|
//if (warehouseDesc != null && !warehouseDesc.Trim().Equals(""))
|
|
|
//{
|
|
|
// strWhere += "and warehouse_desc like '%" + warehouseDesc.Trim() + "%'";
|
|
|
//}
|
|
|
if (!String.IsNullOrEmpty(txtStartTime) && !String.IsNullOrEmpty(txtEndTime))
|
|
|
{
|
|
|
strWhere += " and create_time BETWEEN '" + txtStartTime.Trim() + "' AND '" + txtEndTime.Trim() + "'";
|
|
|
}
|
|
|
if (!String.IsNullOrEmpty(txtStartTime) && String.IsNullOrEmpty(txtEndTime))
|
|
|
{
|
|
|
strWhere += " and create_time > '" + txtStartTime.Trim() + "'";
|
|
|
}
|
|
|
if (String.IsNullOrEmpty(txtStartTime) && !String.IsNullOrEmpty(txtEndTime))
|
|
|
{
|
|
|
strWhere += " and create_time < '" + txtEndTime.Trim() + "'";
|
|
|
}
|
|
|
if (enabled != null && !enabled.Trim().Equals(""))
|
|
|
{
|
|
|
strWhere += " and enabled like '%" + enabled.Trim() + "%'";
|
|
|
}
|
|
|
//strWhere += " and a.factory_id = " + factoryId + " ";
|
|
|
String orderBy = "";
|
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
|
{
|
|
|
orderBy += typeof(WmsCarArrive).GetEntityColumnName(sort.Trim()) + " " + direction;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
orderBy += typeof(WmsCarArrive).GetEntityColumnName("planArriveTime") + " " + direction;
|
|
|
}
|
|
|
|
|
|
result = repository.getListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 启用
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <r
|
|
|
|
|
|
public Hashtable getCarManagerDetail(String orderNo)
|
|
|
{
|
|
|
orderNo = " order_no = '" + orderNo + "'";
|
|
|
List<WmsCarArrive> dt = repository.getList(orderNo, "");
|
|
|
Hashtable result = new Hashtable();
|
|
|
result.Add("orderNo", dt[0].OrderNo);
|
|
|
result.Add("carNo", dt[0].CarNo);
|
|
|
result.Add("carDesc", dt[0].CarDesc);
|
|
|
result.Add("supplierCode", dt[0].SupplierCode);
|
|
|
result.Add("supplierName", dt[0].SupplierName);
|
|
|
result.Add("planArriveTime", dt[0].PlanArriveTime);
|
|
|
result.Add("carDriver", dt[0].CarDriver);
|
|
|
result.Add("passageway", dt[0].Passageway);
|
|
|
result.Add("enabled", dt[0].Enabled);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 保存菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int saveCarArrive(WmsCarArrive htParams)
|
|
|
{
|
|
|
return repository.saveCarArrive(htParams);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 更新菜单数据
|
|
|
/// </summary>
|
|
|
/// <param name="htParams"></param>
|
|
|
/// <returns></returns>
|
|
|
public int updateCarArrive(WmsCarArrive htParams)
|
|
|
{
|
|
|
return repository.updateCarArrive(htParams);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取供应商
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public List<KeyValueResult> getSelectSupplier()
|
|
|
{
|
|
|
return repository.getSelectSupplier();
|
|
|
}
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// 准入状态 , 时间添加
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <param name="loginId"></param>
|
|
|
/// <returns></returns>
|
|
|
public int ChangeInPlantStatus(String ids, int loginId)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.ChangeInPlantStatus(id, loginId);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 离厂状态,时间添加
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <param name="loginId"></param>
|
|
|
/// <returns></returns>
|
|
|
public int ChangeOutPlantStatus(String ids, int loginId)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.ChangeOutPlantStatus(id, loginId);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 装卸工作中
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <param name="loginId"></param>
|
|
|
/// <returns></returns>
|
|
|
public int ChangeWorkingStatus(String ids, int loginId)
|
|
|
{
|
|
|
String[] idArray = ids.Split(',');
|
|
|
int count = 0;
|
|
|
foreach (String id in idArray)
|
|
|
{
|
|
|
if (!"".Equals(id))
|
|
|
{
|
|
|
count += this.repository.ChangeWorkingStatus(id, loginId);
|
|
|
}
|
|
|
}
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
public List<KeyValueResult> GetSupplier()
|
|
|
{
|
|
|
return repository.getSelectSupplier();
|
|
|
}
|
|
|
|
|
|
public List<WmsCarArrive> GetCarArriveList(string enabled, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
String strWhere = "";
|
|
|
String orderBy = "";
|
|
|
return repository.GetCarArriveList(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
}
|
|
|
|
|
|
public List<WmsCarArrive> GetCarArriveList(string docks, string enabled, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
String strWhere = "";
|
|
|
String orderBy = "";
|
|
|
return repository.GetCarArriveList(docks, pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
}
|
|
|
|
|
|
public List<WmsCarArrive> GetCarArriveTotal(string docks)
|
|
|
{
|
|
|
return repository.GetCarArriveTotal(docks);
|
|
|
}
|
|
|
|
|
|
public List<WmsCarArrive> GetCarInDoor(string s_date)
|
|
|
{
|
|
|
return repository.GetCarInDoor(s_date);
|
|
|
}
|
|
|
|
|
|
public List<SysVendor> Getdock()
|
|
|
{
|
|
|
return repository.Getdock();
|
|
|
}
|
|
|
|
|
|
public List<WmsMoveHeader> GetPreparation()
|
|
|
{
|
|
|
return repository.GetPreparation();
|
|
|
}
|
|
|
|
|
|
public Hashtable MaterialgetListByPage(string enabled, Pager pager, String direction, String sort)
|
|
|
{
|
|
|
Hashtable result = new Hashtable();
|
|
|
String strWhere = " a.order_status NOT IN('40', '50', '60') and a.enabled = 'Y' and a.ref_order_no = '成品下线大件拉动' ";
|
|
|
|
|
|
String orderBy = " a.create_time ";
|
|
|
|
|
|
result = repository.MaterialgetListByPage(pager.pageSize, pager.pageNo, strWhere, orderBy);
|
|
|
return result;
|
|
|
}
|
|
|
public string Getarea(int area)
|
|
|
{
|
|
|
string[] strings = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
|
|
|
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
|
|
|
"U", "V", "W", "X", "Y", "Z" };
|
|
|
string result = "";
|
|
|
|
|
|
if (area > 26)
|
|
|
{
|
|
|
int num = area / 26;
|
|
|
int yu = area % 26;
|
|
|
|
|
|
for (int i = 0; i < num; i++)
|
|
|
{
|
|
|
result += "A";
|
|
|
}
|
|
|
result += strings[yu - 1];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result = strings[area - 1];
|
|
|
}
|
|
|
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
public int UpdateReceipt40(String dockName)
|
|
|
{
|
|
|
return repository.UpdateReceipt40(dockName);
|
|
|
}
|
|
|
}
|
|
|
}
|