Pengxy 10 сар өмнө
parent
commit
09754a5fdb

+ 10 - 0
MicroServices/Business/Business.Application.Contracts/ResourceExamineManagement/Dto/BomChildExamineDto.cs

@@ -177,6 +177,16 @@ namespace Business.ResourceExamineManagement.Dto
         public List<purchase_occupy> purchase_occupy_list { get; set; }
 
         /// <summary>
+        /// 在检数量
+        /// </summary>
+        public decimal fqcqty { get; set; }
+
+        /// <summary>
+        /// 在检占用数量
+        /// </summary>
+        public decimal use_fqc_qty { get; set; }
+
+        /// <summary>
         /// 委外数量
         /// </summary>
         public decimal subcontracting_qty { get; set; }

+ 0 - 4
MicroServices/Business/Business.Application/ResourceExamineManagement/PurchaseOrderAppService.cs

@@ -207,10 +207,6 @@ namespace Business.ResourceExamineManagement
             List<mo_srm_po_occupy> occupyList = new List<mo_srm_po_occupy>();
             List<string> purords = new List<string>();
             var ic_Plan = ic_PlanList.Where(x => x.mysql_id == icitem_id).FirstOrDefault();
-            if (ic_Plan.number == "93BC0171")
-            {
-                var isy = 1;
-            }
             //查询出对应物料采购订单明细  --数据未被停用 && 评审通过后
             List<mo_srm_po_list> poDetailList = new List<mo_srm_po_list>();
             if (supplier_id != null)

+ 13 - 15
MicroServices/Business/Business.Application/ResourceExamineManagement/ResourceExamineAppService.cs

@@ -4471,7 +4471,7 @@ namespace Business.ResourceExamineManagement
         /// <param name="stocklist"></param>
         /// <param name="sklist"></param>
         /// <exception cref="NotImplementedException"></exception>
-        public void DataInitialization(List<mo_ic_bom> boms, long bangid, List<mo_ic_item> icitemlist, List<mo_ic_item_stock> stocklist, List<b_bom_pretreatment> pretreatments, List<mo_ic_item_stockoccupy> sklist)
+        public void DataInitialization(List<mo_ic_bom> boms, long bangid, List<mo_ic_item> icitemlist, List<mo_ic_item_stock> stocklist, List<b_bom_pretreatment> pretreatments, List<mo_ic_item_stockoccupy> sklist, bool writeNum = false)
         {
             List<long> itemIds = pretreatments.Select(p => p.item_id.GetValueOrDefault()).Distinct().ToList();
             icitemlist.AddRange(_ic_item.GetListAsync(p => itemIds.Contains(p.mysql_id) && !p.IsDeleted).Result);
@@ -4516,20 +4516,18 @@ namespace Business.ResourceExamineManagement
             leadTimeList = GetLeadTime(icitemlist, param.company_id, param.factoryId);//提前期列表
             supplierList = GetSupplier(itemIds, param.company_id, param.factoryId);//供应商列表
 
-            //交期回复
-            var sql = $"select b.id as polist_id,b.po_id,a.id,a.wlbm,a.cgdd,a.ddhh,iif(a.jhdsl>c.QtyOrded,c.QtyOrded,a.jhdsl) as jhdsl,TRY_CONVERT(DATE,jqhf, 23) as jqhf,a.flag,a.gysdm,b.pr_purchase_id " +
-                $"from (select wlbm,cgdd,ddhh,flag,gysdm,sum(cast(isnull(jhdsl,0) as decimal(18,8))) as jhdsl,max(TRY_CONVERT(DATE,jqhf, 23)) as jqhf,max(id) as id from scm_jhjh_jq where flag =0 or (flag=2 and DATEDIFF(DAY, isnull(TRY_CONVERT(DATE,jqhf, 23),GETDATE()), GETDATE())>=1 )  group by wlbm,cgdd,ddhh,flag,gysdm) a " +
-                $"inner join srm_po_list b on a.cgdd=b.po_billno and a.ddhh=b.polist_row inner join PurOrdDetail c on b.po_billno=c.PurOrd and b.polist_row=c.Line where c.status!='C' and c.QtyOrded>c.RctQty";
-            _CalcBomViewAppService.scm_Jhjh_Jqs = _businessDbContext.scm_jhjh_jqDto.FromSqlRaw(sql).ToList();
-            //送货单子表所有未完成的数据
-            sql = $"select  b.id,[po_billline],[jhdbh],isnull([shzt],'待收') shzt,[jhdhh] ,b.sh_material_code,b.sh_material_name,b.po_bill,b.sh_delivery_quantity,a.sh_purchase_num,c.id as sh_purchase_id,CONVERT(DATE,a.jhshrq,23) jhshrq,CONVERT(DATE,a.yjdhrq,23) yjdhrq,d.id as polist_id " +
-                $"from scm_shd a INNER join scm_shdzb b on a.id=b.glid INNER join srm_po_list d on b.sh_material_code=d.ItemNum and b.po_bill=d.po_billno and b.po_billline=d.polist_row left join srm_supplier c on a.sh_purchase_num=c.supplier_no where jhdbh!='' and isnull([shzt],'待收')!='完成'";
-            _CalcBomViewAppService.scm_Shdzbs = _businessDbContext.scm_shdzbDto.FromSqlRaw(sql).ToList();
-
-            //在检数据
-            //sql = $"select  b.id,[po_billline],[jhdbh],isnull([shzt],'待收') shzt,[jhdhh] ,b.sh_material_code,b.sh_material_name,b.po_bill,b.sh_delivery_quantity,a.sh_purchase_num,c.id as sh_purchase_id,CONVERT(DATE,a.jhshrq,23) jhshrq,CONVERT(DATE,a.yjdhrq,23) yjdhrq,d.id as polist_id " +
-              //  $"from scm_shd a INNER join scm_shdzb b on a.id=b.glid INNER join srm_po_list d on b.sh_material_code=d.ItemNum and b.po_bill=d.po_billno and b.po_billline=d.polist_row left join srm_supplier c on a.sh_purchase_num=c.supplier_no where jhdbh!='' and isnull([shzt],'待收')!='完成'";
-            //_CalcBomViewAppService.scm_Shdzbs = _businessDbContext.scm_shdzbDto.FromSqlRaw(sql).ToList();
+                //交期回复
+                var sql = $"select b.id as polist_id,b.po_id,a.id,a.wlbm,a.cgdd,a.ddhh,iif(a.jhdsl>c.QtyOrded,c.QtyOrded,a.jhdsl) as jhdsl,TRY_CONVERT(DATE,jqhf, 23) as jqhf,a.flag,a.gysdm,b.pr_purchase_id " +
+                    $"from (select wlbm,cgdd,ddhh,flag,gysdm,sum(cast(isnull(jhdsl,0) as decimal(18,8))) as jhdsl,max(TRY_CONVERT(DATE,jqhf, 23)) as jqhf,max(id) as id from scm_jhjh_jq where flag =0 or (flag=2 and DATEDIFF(DAY, isnull(TRY_CONVERT(DATE,jqhf, 23),GETDATE()), GETDATE())>=1 )  group by wlbm,cgdd,ddhh,flag,gysdm) a " +
+                    $"inner join srm_po_list b on a.cgdd=b.po_billno and a.ddhh=b.polist_row inner join PurOrdDetail c on b.po_billno=c.PurOrd and b.polist_row=c.Line where c.status!='C' and c.QtyOrded>c.RctQty";
+                _CalcBomViewAppService.scm_Jhjh_Jqs = _businessDbContext.scm_jhjh_jqDto.FromSqlRaw(sql).ToList();
+                //送货单子表所有未完成的数据,并且排除检验中数量
+                sql = $"select  b.id,[po_billline],[jhdbh],isnull([shzt],'待收') shzt,[jhdhh] ,b.sh_material_code,b.sh_material_name,b.po_bill,b.sh_delivery_quantity-isnull(m.qty,0) as sh_delivery_quantity,a.sh_purchase_num,c.id as sh_purchase_id,CONVERT(DATE,a.jhshrq,23) jhshrq,CONVERT(DATE,a.yjdhrq,23) yjdhrq,d.id as polist_id " +
+                $"from scm_shd a INNER join scm_shdzb b on a.id=b.glid INNER join srm_po_list d on b.sh_material_code=d.ItemNum and b.po_bill=d.po_billno and b.po_billline=d.polist_row " +
+                $"left join srm_supplier c on a.sh_purchase_num=c.supplier_no left join (select PurOrd,PurLine,ShipperNbr,ShipperLine,sum(qty) as qty from MissedPrint where Status = 'I' GROUP BY PurOrd,PurLine,ShipperNbr,ShipperLine) m on b.po_bill=m.PurOrd AND b.po_billline=m.PurLine and m.ShipperNbr=a.shddh and m.ShipperLine=b.hh " +
+                $"where jhdbh!='' and isnull([shzt],'待收')!='完成' and (isnull(m.qty,0)=0 or isnull(m.qty,0)<b.sh_delivery_quantity) ";
+                _CalcBomViewAppService.scm_Shdzbs = _businessDbContext.scm_shdzbDto.FromSqlRaw(sql).ToList();
+
 
             _CalcBomViewAppService.leadTimeList = leadTimeList;
             _CalcBomViewAppService.supplierList = supplierList;

+ 14 - 0
MicroServices/Business/Business.Domain/StructuredDB/Bang/b_bom_child_examine.cs

@@ -204,6 +204,20 @@ namespace Business.Domain
         public decimal? purchase_occupy_qty { get; set; }
 
         /// <summary>
+        /// 在检数量
+        /// </summary>
+        [Comment("在检数量")]
+        [Precision(23, 10)]
+        public decimal fqcqty { get; set; }
+
+        /// <summary>
+        /// 在检占用数量
+        /// </summary>
+        [Comment("在检占用数量")]
+        [Precision(23, 10)]
+        public decimal use_fqc_qty { get; set; }
+
+        /// <summary>
         /// 委外数量
         /// </summary>
         [Comment("委外数量")]