You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.8 KiB
84 lines
2.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.BLL;
|
|
using QMAPP.FJC.Entity.Basic;
|
|
using QMAPP.FJC.DAL.WipService;
|
|
using QMAPP.FJC.Entity.ProduceManage;
|
|
using QMAPP.FJC.Entity;
|
|
using QMAPP.FJC.Entity.WIPManage;
|
|
|
|
|
|
namespace QMAPP.FJC.BLL.WipService
|
|
{
|
|
/// <summary>
|
|
/// 模块编号:M19
|
|
/// 作 用:定时查询在制品库存
|
|
/// 作 者:王济
|
|
/// 编写日期:2015年07月13日
|
|
///</summary>
|
|
public class CheckWipBLL : BaseBLL
|
|
{
|
|
/// <summary>
|
|
/// 定时查询在制品库存
|
|
/// </summary>
|
|
public void WipProecessCheck()
|
|
{
|
|
List<ProcessSet> pst = new CheckWipDAL().WipProecessCheck();
|
|
List<StorageAlarm> sa = new List<StorageAlarm>();
|
|
//StorageAlarm
|
|
List<ProducePlan> pdp = new List<ProducePlan>();
|
|
int multiple;
|
|
foreach (ProcessSet pt in pst)
|
|
{
|
|
multiple = 0;
|
|
if (pt.MINVALUE > pt.TEMP && pt.PRODUCEMINVALUE != 0)
|
|
{
|
|
multiple = (pt.MINVALUE + pt.PRODUCEMINVALUE - pt.TEMP) / pt.PRODUCEMINVALUE;
|
|
pdp.Add(new ProducePlan {
|
|
PID = Guid.NewGuid().ToString(),
|
|
PROCESSTYPE = pt.PROCESSTYPE,
|
|
PRODUCTTYPE = pt.PRODUCTTYPE,
|
|
MINPRODUCECOUNT = pt.PRODUCEMINVALUE,
|
|
PRODUCECOUNT = pt.PRODUCEMINVALUE * multiple,
|
|
PLANSTATUS = "0",
|
|
CREATETYPE = "0",
|
|
CREATEDATE = DateTime.Now,
|
|
UPDATEDATE = DateTime.Now,
|
|
PRODUCELINE = EnumGeter.PRODUCELINE.B9.ToString(),
|
|
PLANCODE = DateTime.Now.ToString("yyyyMMddHHmmss"),
|
|
PASTFLAG="0",
|
|
PRODUCESHIFTTCODE = pt.PRODUCESHIFTTCODE
|
|
});
|
|
|
|
sa.Add(new StorageAlarm {
|
|
PID = Guid.NewGuid().ToString(),
|
|
PROCESSTYPE = pt.PROCESSTYPE,
|
|
MINVALUE = pt.MINVALUE,
|
|
PRODUCEMINVALUE = pt.PRODUCEMINVALUE,
|
|
CURRENTSTORAGE = pt.TEMP,
|
|
ALARMSTATUS = "0",
|
|
PRODUCESHIFTNAME = pt.PRODUCESHIFTNAME,
|
|
PRODUCESHIFTTCODE = pt.PRODUCESHIFTTCODE,
|
|
CREATEDATE = DateTime.Now
|
|
});
|
|
}
|
|
}
|
|
|
|
new CheckWipDAL().Update();
|
|
try
|
|
{
|
|
new CheckWipDAL().Insert(pdp);
|
|
new CheckWipDAL().Insert(sa);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw ex;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|