锐腾搅拌上料功能
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.

563 lines
15 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ICSSoft.Frame.Data.DAL;
  6. using ICSSoft.Frame.Data.Entity;
  7. using System.Data;
  8. namespace ICSSoft.Frame.Data.BLL
  9. {
  10. public class ICSWareHouseLotInfoLogBLL
  11. {
  12. public static void towh(FormICSWareHouseLotInfoUIModel shiftInfo, string dsconn)
  13. {
  14. try
  15. {
  16. if (string.IsNullOrWhiteSpace(dsconn))
  17. {
  18. throw new Exception("请输入......");
  19. }
  20. List<FormICSWareHouseLotInfoUIModel> shiftInfoList = new List<FormICSWareHouseLotInfoUIModel>() { shiftInfo };
  21. ICSWareHouseLotInfoLogDAL.towh(shiftInfoList, dsconn);
  22. }
  23. catch (Exception ex)
  24. {
  25. throw ex;
  26. }
  27. }
  28. #region 送检单子表
  29. public static void iqcdetail(ICSASNIQCDETAIL ItemLot, string Appconstr)
  30. {
  31. try
  32. {
  33. ICSWareHouseLotInfoLogDAL.iqcdetail(ItemLot, Appconstr);
  34. }
  35. catch (Exception ex)
  36. {
  37. throw ex;
  38. }
  39. }
  40. #endregion
  41. #region 物料,产品详细信息
  42. public static void iqcdetail(ICSITEMLotDetail ItemLot, string Appconstr)
  43. {
  44. try
  45. {
  46. ICSWareHouseLotInfoLogDAL.itemlotdetail(ItemLot, Appconstr);
  47. }
  48. catch (Exception ex)
  49. {
  50. throw ex;
  51. }
  52. }
  53. #endregion
  54. #region 库存信息表表
  55. public static void WareHouseInfo(ICSWareHouseInfo ItemLot, string Appconstr)
  56. {
  57. try
  58. {
  59. ICSWareHouseLotInfoLogDAL.WareHouseInfo(ItemLot, Appconstr);
  60. }
  61. catch (Exception ex)
  62. {
  63. throw ex;
  64. }
  65. }
  66. #endregion
  67. #region 物料收发交易记录表
  68. public static void trans(ICSITEMTrans ItemLot, string Appconstr)
  69. {
  70. try
  71. {
  72. ICSWareHouseLotInfoLogDAL.trans(ItemLot, Appconstr);
  73. }
  74. catch (Exception ex)
  75. {
  76. throw ex;
  77. }
  78. }
  79. #endregion
  80. #region 物料收发交易批号记录表
  81. public static void transLOT(ICSITEMTransLot ItemLot, string Appconstr)
  82. {
  83. try
  84. {
  85. ICSWareHouseLotInfoLogDAL.transLOT(ItemLot, Appconstr);
  86. }
  87. catch (Exception ex)
  88. {
  89. throw ex;
  90. }
  91. }
  92. #endregion
  93. #region 物料收发交易详细记录表
  94. public static void transLOTDetail(ICSITEMTransLotDetail ItemLot, string Appconstr)
  95. {
  96. try
  97. {
  98. ICSWareHouseLotInfoLogDAL.transLOTDetail(ItemLot, Appconstr);
  99. }
  100. catch (Exception ex)
  101. {
  102. throw ex;
  103. }
  104. }
  105. #endregion
  106. #region 送检单主表
  107. public static void asniqc(ICSASNIQC ItemLot, string Appconstr)
  108. {
  109. try
  110. {
  111. ICSWareHouseLotInfoLogDAL.asniqc(ItemLot, Appconstr);
  112. }
  113. catch (Exception ex)
  114. {
  115. throw ex;
  116. }
  117. }
  118. #endregion
  119. #region 到货单主表
  120. public static void invreceipt(ICSINVReceipt ItemLot, string Appconstr)
  121. {
  122. try
  123. {
  124. ICSWareHouseLotInfoLogDAL.invreceipt(ItemLot, Appconstr);
  125. }
  126. catch (Exception ex)
  127. {
  128. throw ex;
  129. }
  130. }
  131. #endregion
  132. #region 到货单详细表
  133. public static void Receiptdetail(ICSINVReceiptDetail ItemLot, string Appconstr)
  134. {
  135. try
  136. {
  137. ICSWareHouseLotInfoLogDAL.receiptdetail(ItemLot, Appconstr);
  138. }
  139. catch (Exception ex)
  140. {
  141. throw ex;
  142. }
  143. }
  144. #endregion
  145. #region 查询库位信息
  146. public static DataTable SearchStackInfoList(string storageid, string dsconn)
  147. {
  148. try
  149. {
  150. DataTable returndt = new DataTable();
  151. //returndt.Columns.Add("Serial", typeof(string));
  152. returndt.Columns.Add("库位代码", typeof(string));
  153. returndt.Columns.Add("库位名称", typeof(string));
  154. List<FormICSStackUIModel> returndal = ICSWareHouseLotInfoLogDAL.SearchStackInfoList(storageid,dsconn);
  155. foreach (FormICSStackUIModel returntype in returndal)
  156. {
  157. DataRow dr = returndt.NewRow();
  158. //dr["Serial"] = returntype.Serial;
  159. dr["库位代码"] = returntype.StackCode;
  160. dr["库位名称"] = returntype.StackName;
  161. returndt.Rows.Add(dr);
  162. }
  163. return returndt;
  164. }
  165. catch (Exception ex)
  166. {
  167. throw ex;
  168. }
  169. }
  170. #endregion
  171. #region 根据入库单号、入库单行查询物料批号
  172. public static DataTable SelectLotNO(string no, int line)
  173. {
  174. try
  175. {
  176. return ICSWareHouseLotInfoLogDAL.SelectLotNO(no, line);
  177. }
  178. catch (Exception ex)
  179. {
  180. throw ex;
  181. }
  182. }
  183. #endregion
  184. #region 根据库房代码查询库房id
  185. public static DataTable SelectStorageID(string storagecode)
  186. {
  187. try
  188. {
  189. return ICSWareHouseLotInfoLogDAL.SelectStorageID(storagecode);
  190. }
  191. catch (Exception ex)
  192. {
  193. throw ex;
  194. }
  195. }
  196. #endregion
  197. #region 根据库位代码查询库位id
  198. public static DataTable SelectStsckID(string stackcode)
  199. {
  200. try
  201. {
  202. return ICSWareHouseLotInfoLogDAL.SelectStackID(stackcode);
  203. }
  204. catch (Exception ex)
  205. {
  206. throw ex;
  207. }
  208. }
  209. #endregion
  210. #region 根据物料代码查询物料id
  211. public static DataTable SelectItemID(string itemcode)
  212. {
  213. try
  214. {
  215. return ICSWareHouseLotInfoLogDAL.SelectItemID(itemcode);
  216. }
  217. catch (Exception ex)
  218. {
  219. throw ex;
  220. }
  221. }
  222. #endregion
  223. #region 根据单号、单行号查询物料收发交易记录表id
  224. public static DataTable SelectTransID(string transno, int transline)
  225. {
  226. try
  227. {
  228. return ICSWareHouseLotInfoLogDAL.SelectTransID(transno, transline);
  229. }
  230. catch (Exception ex)
  231. {
  232. throw ex;
  233. }
  234. }
  235. #endregion
  236. #region 根据批号查找交易批号记录表id
  237. public static DataTable SelectTransLotID(string lotNO)
  238. {
  239. try
  240. {
  241. return ICSWareHouseLotInfoLogDAL.SelectTransLotID(lotNO);
  242. }
  243. catch (Exception ex)
  244. {
  245. throw ex;
  246. }
  247. }
  248. #endregion
  249. #region 根据批号查找产品序列号
  250. public static DataTable SelectSeriaNO(string lotNO)
  251. {
  252. try
  253. {
  254. return ICSWareHouseLotInfoLogDAL.SelectSeriaNO(lotNO);
  255. }
  256. catch (Exception ex)
  257. {
  258. throw ex;
  259. }
  260. }
  261. #endregion
  262. #region 根据批号查找原始批次数量
  263. public static DataTable SelectLOTQTY(string lotNO)
  264. {
  265. try
  266. {
  267. return ICSWareHouseLotInfoLogDAL.SelectLOTQTY(lotNO);
  268. }
  269. catch (Exception ex)
  270. {
  271. throw ex;
  272. }
  273. }
  274. #endregion
  275. #region 更新送检单子表行状态
  276. public static void updateSTDSTATUS(string stno, int stline)
  277. {
  278. try
  279. {
  280. ICSWareHouseLotInfoLogDAL.updateSTDSTATUS(stno, stline);
  281. }
  282. catch (Exception ex)
  283. {
  284. throw ex;
  285. }
  286. }
  287. #endregion
  288. #region 更新物料,产品详细信息产品状态
  289. public static void updateSerialStatus(string serialno, string itemcode)
  290. {
  291. try
  292. {
  293. ICSWareHouseLotInfoLogDAL.updateSerialStatus(serialno, itemcode);
  294. }
  295. catch (Exception ex)
  296. {
  297. throw ex;
  298. }
  299. }
  300. #endregion
  301. #region 更新送检单状态
  302. public static void updateSTATUS(string stno,int stline)
  303. {
  304. try
  305. {
  306. ICSWareHouseLotInfoLogDAL.updateSTATUS(stno,stline);
  307. }
  308. catch (Exception ex)
  309. {
  310. throw ex;
  311. }
  312. }
  313. #endregion
  314. #region 更新到货单详细表更新到货单状态
  315. public static void updateRECSTATUS(string stno, int stline)
  316. {
  317. try
  318. {
  319. ICSWareHouseLotInfoLogDAL.updateRECSTATUS(stno, stline);
  320. }
  321. catch (Exception ex)
  322. {
  323. throw ex;
  324. }
  325. }
  326. #endregion
  327. #region 更新到货单主表单据状态
  328. public static void updatereceiptRECSTATUS(string stno)
  329. {
  330. try
  331. {
  332. ICSWareHouseLotInfoLogDAL.updatereceiptRECSTATUS(stno);
  333. }
  334. catch (Exception ex)
  335. {
  336. throw ex;
  337. }
  338. }
  339. #endregion
  340. #region 根据单号单行号查询送检单子表信息
  341. public static ICSASNIQCDETAIL selectIQCDetail(String stno, int stline, String Appconstr)
  342. {
  343. return ICSWareHouseLotInfoLogDAL.selectIQCDetail(stno, stline,Appconstr);
  344. }
  345. #endregion
  346. #region 根据产品序列号、存货编码查询物料产品详细表
  347. public static ICSITEMLotDetail selectitemlotdetail(String serailno, string itemcode, String Appconstr)
  348. {
  349. return ICSWareHouseLotInfoLogDAL.selectitemlotdetail(serailno, itemcode, Appconstr);
  350. }
  351. #endregion
  352. #region 根据单号、单行号查询送检单主表信息
  353. public static ICSASNIQC selectASNIQC(String stno,int stline, String Appconstr)
  354. {
  355. return ICSWareHouseLotInfoLogDAL.selectASNIQC(stno, stline, Appconstr);
  356. }
  357. #endregion
  358. #region 根据单号查询到货单主表信息
  359. public static ICSINVReceipt selectreceipt(String stno, String Appconstr)
  360. {
  361. return ICSWareHouseLotInfoLogDAL.selectreceipt(stno, Appconstr);
  362. }
  363. #endregion
  364. #region 根据单号单行号查询送到货单详细表信息
  365. public static ICSINVReceiptDetail selectReceiptDetail(String stno, int stline, String Appconstr)
  366. {
  367. return ICSWareHouseLotInfoLogDAL.selectReceiptDetail(stno, stline, Appconstr);
  368. }
  369. #endregion
  370. #region 根据单号、单行号查询生成的批次信息
  371. public static ICSITEMLot selectICSITEMLot(String stno, string stline, String Appconstr)
  372. {
  373. return ICSWareHouseLotInfoLogDAL.selectICSITEMLot(stno, stline, Appconstr);
  374. }
  375. #endregion
  376. #region 根据库房库位id、库位id、物料id查询库存信息表中的库存数量
  377. public static DataTable SelectQTY(string storageid, string stackid, string itemid)
  378. {
  379. return ICSWareHouseLotInfoLogDAL.SelectQTY(storageid, stackid, itemid);
  380. }
  381. #endregion
  382. #region 判断某个送检单所有子表的行状态是否关闭
  383. public static bool IsSTDSTATUSclose(string stno, string dsconn)
  384. {
  385. try
  386. {
  387. return ICSWareHouseLotInfoLogDAL.IsSTDSTATUSclose(stno, dsconn);
  388. }
  389. catch (Exception ex)
  390. {
  391. throw ex;
  392. }
  393. }
  394. #endregion
  395. #region 判断某个到货单所有子表的行状态是否关闭
  396. public static bool IsRECSTATUSclose(string stno, string dsconn)
  397. {
  398. try
  399. {
  400. return ICSWareHouseLotInfoLogDAL.IsRECSTATUSclose(stno, dsconn);
  401. }
  402. catch (Exception ex)
  403. {
  404. throw ex;
  405. }
  406. }
  407. #endregion
  408. #region 状态更新
  409. public static void updatestatus(string receiptno, int receiptline)
  410. {
  411. try
  412. {
  413. ICSWareHouseLotInfoLogDAL.updatestatus(receiptno, receiptline);
  414. }
  415. catch (Exception ex)
  416. {
  417. throw ex;
  418. }
  419. }
  420. #endregion
  421. #region 期初导入
  422. public static void Insert(List<ICSITEMLot> tbinfoList, List<FormICSWareHouseLotInfoUIModel> shiftInfoList, List<ICSWareHouseInfo> WareHouseInfoList,List<ICSWareHouseLotInfoLog> ICSWareHouseLogList, string dsconn)
  423. {
  424. try
  425. {
  426. ICSWareHouseLotInfoLogDAL.Insert(tbinfoList, shiftInfoList, WareHouseInfoList, ICSWareHouseLogList, dsconn);
  427. }
  428. catch (Exception ex)
  429. {
  430. throw ex;
  431. }
  432. }
  433. #endregion
  434. #region 审核ERP入库单
  435. public static string updateRd10(List<Rdrecord10> dataContext, List<FormICSWareHouseLotInfoUIModel> shiftInfoList, List<ICSWareHouseInfo> WareHouseInfoList, List<ICSITEMTrans> TransList, List<ICSITEMTransLot> ItemLotList, string dsconn)
  436. {
  437. try
  438. {
  439. return ICSWareHouseLotInfoLogDAL.updateRd10(dataContext, shiftInfoList, WareHouseInfoList, TransList, ItemLotList, dsconn);
  440. }
  441. catch (Exception ex)
  442. {
  443. throw ex;
  444. }
  445. }
  446. #endregion
  447. #region 根据库位代码查询库位id,仓库
  448. public static DataTable SelectStack(string stackcode)
  449. {
  450. try
  451. {
  452. return ICSWareHouseLotInfoLogDAL.SelectStack(stackcode);
  453. }
  454. catch (Exception ex)
  455. {
  456. throw ex;
  457. }
  458. }
  459. #endregion
  460. #region 根据存货编码判断批号是否批次管理
  461. public static DataTable SelectLotNo(string stackcode)
  462. {
  463. try
  464. {
  465. return ICSWareHouseLotInfoLogDAL.SelectLotNo(stackcode);
  466. }
  467. catch (Exception ex)
  468. {
  469. throw ex;
  470. }
  471. }
  472. #endregion
  473. #region 根据物料代码查询物料
  474. public static DataTable SelectItem(string itemcode)
  475. {
  476. try
  477. {
  478. return ICSWareHouseLotInfoLogDAL.SelectItem(itemcode);
  479. }
  480. catch (Exception ex)
  481. {
  482. throw ex;
  483. }
  484. }
  485. #endregion
  486. }
  487. }