智云SRM-WEBAPI(目前客户通用API)
11
王 垚
2023-01-04 ab3ffc8f500e3ad83f7e60cfb6a8fc2eeca8c02f
11
1个文件已修改
23 ■■■■ 已修改文件
WebAPI/Controllers/BarCodeController.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BarCodeController.cs
@@ -1577,6 +1577,25 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //校验批号 和 生产日期
                    sql = $"select top 1 HKFDate from Gy_BarCodeBill where HSupID = '{oItemSub.HSupID}' and HBatchNo = '{oItemSub.HBatchNo.TrimStart().TrimEnd()}' and HMaterID ={oItemSub.HMaterID} and isnull(HKFDate, '') <> ''";
                    LogService.Write($"sql:{sql}");
                    DataTable dt = oCn.RunProcReturn(sql, "tables").Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        LogService.Write($"HKFDate:{dt.Rows[0][0]}");
                        sql = $"select DATEDIFF(D,{dt.Rows[0][0]},{oItemSub.HKFDate})";
                        ds = oCn.RunProcReturn(sql, "tables2");
                        LogService.Write($"DATEDIFF:{Convert.ToInt32(ds.Tables[0].Rows[0][0])}");
                        if (ds.Tables[0].Rows.Count > 0 && Convert.ToInt32(ds.Tables[0].Rows[0][0]) != 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = $"物料编码{oItemSub.HMaterNumber},批号{oItemSub.HBatchNo.TrimStart().TrimEnd()},生产日期为{dt.Rows[0][0]},请核对";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (ClsPub.isLong(oItemSub.HMaterID) != 0)
                    {
@@ -1611,7 +1630,7 @@
                            }
                            //安瑞条码规则:物料编码(系统代入)@物料名称(系统代入)@规格型号(系统代入)@生产日期(手工输入)@数量(手工输入)@失效日期(手工输入)@批次号(手工代入)@供应商名称(系统代入)@采购订单号(系统代入)
                            TM = $"{oItemSub.HMaterNumber}@{oItemSub.HMaterName}@{oItemSub.HMaterModel}@{oItemSub.HKFDate}@{HMinQty}@{oItemSub.HKFDQDate}@{oItemSub.HBatchNo}@{oItemSub.HSupName}@{oItemSub.HSourceBillNo}";
                            TM = $"{oItemSub.HMaterNumber}@{oItemSub.HMaterName}@{oItemSub.HMaterModel}@{oItemSub.HKFDate}@{HMinQty}@{oItemSub.HKFDQDate}@{oItemSub.HBatchNo.TrimStart().TrimEnd()}@{oItemSub.HSupName}@{oItemSub.HSourceBillNo}";
                            Model.ClsGy_BarCodeBill_WMS_Model bar = new Model.ClsGy_BarCodeBill_WMS_Model();
                            bar.HBarCode = TM;
@@ -1782,7 +1801,6 @@
                                        + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                        + "','" + HBatchNo + "','" + SubModel.Count + "','" + count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                        + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
                            LogService.Write(sql);
                            oCn.RunProc(sql);
                            oCn.RunProc("exec setLSH '" + DateTime.Today + "'");
                            count++;
@@ -1827,7 +1845,6 @@
                                      + linterid.ToString() + ",'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID + "," + HUnitID + "," + HQty2 + ",'" + HKFDate + "'," + HKFPeriod + ",'" + HKFDQDate
                                      + "','" + HBatchNo + "','" + SubModel.Count + "','" + _count + "'," + HSupID + "," + HGroupID + ",'" + ClsPub.CurUserName + "','" + DateTime.Today + "'," + HPrintQty + ",'" + HWei + "',1"
                                      + "," + HSourceInterID + "," + HSourceEntryID + ",'" + HSourceBillNo + "','" + HSourceBillType + "','" + HMTONO + "')";
                            LogService.Write(sql);
                            oCn.RunProc(sql);
                            _count++;
                        }