| | |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | |
| | | //组托单反序列化 |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | List<GroupOrderBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupOrderBill>>(msg1); |
| | | //获取年月日并拼接成字符串 |
| | | string year = DateTime.Now.Year.ToString(); |
| | | string month = DateTime.Now.Month.ToString(); |
| | | string day = DateTime.Now.Day.ToString(); |
| | | string nowDate = year + month + day; |
| | | //string month = DateTime.Now.Month.ToString(); |
| | | //string day = DateTime.Now.Day.ToString(); |
| | | string nowDate = DateTime.Now.ToString("yyyyMMdd"); |
| | | string HBillType = this.HBillType;//组托单类型 |
| | | long HInterID = list[0].HInterID;//递入type得到的单据ID |
| | | string HBillNo = list[0].HBillNo;//递入type得到的单据No |
| | | string HMaker = list[0].HMaker;//制单人 |
| | | string HBatchNo = list[0].HBatchNo;//入库批次 |
| | | string HBarCode_Cus = list[0].HBarCode_Cus;//客户标签(黑标号) |
| | | //校验黑标号唯一性 |
| | | ds= oCN.RunProcReturn($"select * from Sc_PackUnionBillMain where HBarCode_Cus ='{HBarCode_Cus}'", "Sc_PackUnionBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = $"黑标号{HBarCode_Cus}已存在"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //生成唯一条码 |
| | | ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + nowDate + "'", "h_p_WMS_GetMaxNo"); //获取最大流水号 |
| | | oCN.RunProc("exec h_p_WMS_SetMaxNo '" + nowDate + "'"); |