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

246 lines
8.1 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using ICSSoft.Frame.Data.DAL;
  7. using ICSSoft.Frame.Data.Entity;
  8. namespace ICSSoft.Frame.Data.BLL
  9. {
  10. public class ICSITEMLOTBLL
  11. {
  12. #region AddandEdit
  13. public static void AddandEdit(ICSITEMLot itemlot, string Appconstr)
  14. {
  15. try
  16. {
  17. ICSITEMLOTDAL.Add(itemlot, Appconstr);
  18. }
  19. catch (Exception ex)
  20. {
  21. throw ex;
  22. }
  23. }
  24. #endregion
  25. #region delete
  26. public static void delete(List<String> guidList, string dsconn)
  27. {
  28. ICSITEMLOTDAL.deleteInfo(guidList, dsconn);
  29. }
  30. #endregion
  31. #region Detaildelete
  32. public static void Detaildelete(List<String> guidList, string dsconn)
  33. {
  34. ICSITEMLOTDAL.DetaildeleteInfo(guidList, dsconn);
  35. }
  36. #endregion
  37. #region DetailAddandEdit
  38. public static void DetailAddandEdit(ICSITEMLotDetail itemlot, string Appconstr)
  39. {
  40. try
  41. {
  42. ICSITEMLOTDAL.DetailADD(itemlot, Appconstr);
  43. }
  44. catch (Exception ex)
  45. {
  46. throw ex;
  47. }
  48. }
  49. #endregion
  50. public static void InsertINV(string NO, string code, int count)
  51. {
  52. ICSITEMLOTDAL.insert(NO, code, count);
  53. }
  54. public static void DeleteINV(string NO, string code, int count)
  55. {
  56. ICSITEMLOTDAL.delete(NO, code, count);
  57. }
  58. /// <summary>
  59. /// 获取条码状态
  60. /// </summary>
  61. /// <param name="lotNo"></param>
  62. /// <param name="workpointCode"></param>
  63. /// <returns></returns>
  64. public static string CheckLotNo(string lotNo, string workpointCode, string dsconn)
  65. {
  66. string errormessage = "";
  67. DataTable dt = ICSITEMLOTDAL.CheckLotNO(lotNo, workpointCode, dsconn);
  68. if (dt.Rows.Count == 0)
  69. {
  70. errormessage = "条码不存在!";
  71. }
  72. else
  73. {
  74. if (dt.Rows[0]["TYPE"].ToString() != "采购原料" && dt.Rows[0]["TYPE"].ToString() != "原材料")
  75. {
  76. errormessage = "条码不是采购条码,不能进行到货扫描!";
  77. }
  78. else if (dt.Rows[0]["BarCode"].ToString() != "" && dt.Rows[0]["BarCode"].ToString() != null)
  79. {
  80. errormessage = "条码已经上架!";
  81. }
  82. else
  83. {
  84. errormessage = "1";
  85. }
  86. }
  87. string result = "";
  88. if (errormessage == "1")
  89. {
  90. result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
  91. }
  92. else
  93. {
  94. result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
  95. }
  96. return result;
  97. }
  98. /// <summary>
  99. /// 验证ASN单信息
  100. /// </summary>
  101. /// <param name="lotNo"></param>
  102. /// <param name="workpointCode"></param>
  103. /// <param name="dsconn"></param>
  104. /// <returns></returns>
  105. public static string CheckASNNo(string lotNo, string workpointCode, string dsconn)
  106. {
  107. string errormessage = "";
  108. DataTable dt = ICSITEMLOTDAL.CheckASNNO(lotNo, workpointCode, dsconn);
  109. if (dt.Rows.Count == 0)
  110. {
  111. errormessage = "ASN单不存在!";
  112. }
  113. else
  114. {
  115. errormessage = "1";
  116. }
  117. string result = "";
  118. if (errormessage == "1")
  119. {
  120. result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
  121. }
  122. else
  123. {
  124. result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
  125. }
  126. return result;
  127. }
  128. /// <summary>
  129. /// 验证编码信息
  130. /// </summary>
  131. /// <param name="lotNo"></param>
  132. /// <param name="workpointCode"></param>
  133. /// <param name="dsconn"></param>
  134. /// <returns></returns>
  135. public static string CheckLOTNum(string INVCode, string workpointCode, string dsconn)
  136. {
  137. string errormessage = "";
  138. DataTable dt = ICSITEMLOTDAL.CheckLOTNum(INVCode, workpointCode, dsconn);
  139. if (dt.Rows.Count == 0)
  140. {
  141. errormessage = "此编码对应物料不存在!";
  142. }
  143. else
  144. {
  145. errormessage = "1";
  146. }
  147. string result = "";
  148. if (errormessage == "1")
  149. {
  150. result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
  151. }
  152. else
  153. {
  154. result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
  155. }
  156. return result;
  157. }
  158. /// <summary>
  159. /// 获取条码信息
  160. /// </summary>
  161. /// <param name="barCode"></param>
  162. /// <param name="workpointCode"></param>
  163. /// <returns></returns>
  164. public static DataTable GetLotData(string barCode, string workpointCode, string dsconn)
  165. {
  166. DataTable dt = ICSITEMLOTDAL.GetLotData(barCode, workpointCode, dsconn);
  167. return dt;
  168. }
  169. /// <summary>
  170. /// 获取条码信息
  171. /// </summary>
  172. /// <param name="barCode"></param>
  173. /// <param name="workpointCode"></param>
  174. /// <returns></returns>
  175. public static DataTable GetLotDataForPO(string barCode, string workpointCode, string dsconn)
  176. {
  177. DataTable dt = ICSITEMLOTDAL.GetLotDataForPO(barCode, workpointCode, dsconn);
  178. return dt;
  179. }
  180. /// <summary>
  181. /// 获取条码信息(半成品入库)
  182. /// </summary>
  183. /// <param name="barCode"></param>
  184. /// <param name="workpointCode"></param>
  185. /// <param name="dsconn"></param>
  186. /// <returns></returns>
  187. public static DataTable GetLotDataForMo(string barCode, string workpointCode, string dsconn)
  188. {
  189. DataTable dt = ICSITEMLOTDAL.GetLotDataForMO(barCode, workpointCode, dsconn);
  190. return dt;
  191. }
  192. /// <summary>
  193. /// 获取条码信息
  194. /// </summary>
  195. /// <param name="barCode"></param>
  196. /// <param name="workpintCode"></param>
  197. /// <param name="dsconn"></param>
  198. /// <returns></returns>
  199. public static DataTable GetLotNumData(string INVCode, string workpointCode, string dsconn)
  200. {
  201. DataTable dt = ICSITEMLOTDAL.GetLotNumData(INVCode, workpointCode, dsconn);
  202. return dt;
  203. }
  204. /// <summary>
  205. /// 获取ASN单信息(半成品入库)
  206. /// </summary>
  207. /// <param name="barCode"></param>
  208. /// <param name="workpointCode"></param>
  209. /// <param name="dsconn"></param>
  210. /// <returns></returns>
  211. public static DataTable GetASNDataForMO(string barCode, string workpointCode, string dsconn)
  212. {
  213. DataTable dt = ICSITEMLOTDAL.GetASNDataForMO(barCode, workpointCode, dsconn);
  214. return dt;
  215. }
  216. #region 生成到货单
  217. public static string CreateRCV(List<FormICSRSVDataModel.RCVData> rcv, string connection, out string docno, out string user, out string time)
  218. {
  219. try
  220. {
  221. string result = "";
  222. string errormessage = ICSITEMLOTDAL.CreateRCV(rcv, connection, out docno, out user, out time);
  223. if (errormessage == "OK")
  224. {
  225. result = string.Format("{{\"code\":\"0\",\"msg\":\" \"}}");
  226. }
  227. else
  228. {
  229. result = string.Format("{{\"code\":\"1\",\"msg\":\"{0}\"}}", errormessage);
  230. }
  231. return result;
  232. }
  233. catch (Exception ex)
  234. {
  235. throw ex;
  236. }
  237. }
  238. #endregion
  239. }
  240. }