浏览代码

成本分配,面损表,计划统计单

zengtx 2 年之前
父节点
当前提交
630f478840

+ 15 - 12
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationMapper.xml

@@ -21,13 +21,13 @@
         SELECT max(ss.iExchRate) as exchangeRate,
         SELECT max(ss.iExchRate) as exchangeRate,
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
-            max(cc.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
+            max(cc.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(sh.dDate) as outdata,
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
         FROM  UFDATA_101_2021.dbo.SO_SODetails s     
         FROM  UFDATA_101_2021.dbo.SO_SODetails s     
         inner JOIN UFDATA_101_2021.dbo.SO_SOMain ss on ss.ID= s.ID
         inner JOIN UFDATA_101_2021.dbo.SO_SOMain ss on ss.ID= s.ID
-        JOIN UFDATA_101_2021.dbo.rdrecords32 rds on rds.isodid =s.isosid
-		JOIN UFDATA_101_2021.dbo.rdrecord32 rd on rd.ID=rds.ID
+      	left JOIN UFDATA_101_2021.dbo.SaleBillVouchs shs ON s.iSOsID = shs.iSOsID
+        left join UFDATA_101_2021.dbo.SaleBillVouch sh ON sh.SBVID = shs.SBVID
         inner JOIN (     
         inner JOIN (     
                      SELECT      
                      SELECT      
                      om.cCode AS omCode,     
                      om.cCode AS omCode,     
@@ -51,7 +51,7 @@
         SELECT max(ss.iExchRate) as exchangeRate,
         SELECT max(ss.iExchRate) as exchangeRate,
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
-            max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
+            max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(sh.dDate) as outdata,
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
         FROM  UFDATA_103_2021.dbo.SO_SODetails a     
         FROM  UFDATA_103_2021.dbo.SO_SODetails a     
@@ -76,8 +76,8 @@
         inner join UFDATA_102_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_102_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_102_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_102_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_102_2021.dbo.so_somain ss on ss.id=s.id
         inner join UFDATA_102_2021.dbo.so_somain ss on ss.id=s.id
-        inner JOIN UFDATA_102_2021.dbo.rdrecords32 rds on rds.isodid =s.isosid
-		inner JOIN UFDATA_102_2021.dbo.rdrecord32 rd on rd.ID=rds.ID
+       	left JOIN UFDATA_102_2021.dbo.SaleBillVouchs shs ON s.iSOsID = shs.iSOsID
+        left join UFDATA_102_2021.dbo.SaleBillVouch sh ON sh.SBVID = shs.SBVID
         inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
         inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
         inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
         inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
         WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
         WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
@@ -88,7 +88,7 @@
         SELECT max(ss.iExchRate) as exchangeRate,
         SELECT max(ss.iExchRate) as exchangeRate,
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department, 
-            max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(rd.dDate) as outdata,
+            max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,min(sh.dDate) as outdata,
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
             sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
         FROM  UFDATA_103_2021.dbo.SO_SODetails a     
         FROM  UFDATA_103_2021.dbo.SO_SODetails a     
@@ -113,8 +113,8 @@
         inner join UFDATA_101_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_101_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_101_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_101_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_101_2021.dbo.so_somain ss on ss.id=s.id
         inner join UFDATA_101_2021.dbo.so_somain ss on ss.id=s.id
-        inner JOIN UFDATA_101_2021.dbo.rdrecords32 rds on rds.isodid =s.isosid
-		inner JOIN UFDATA_101_2021.dbo.rdrecord32 rd on rd.ID=rds.ID
+       	left JOIN UFDATA_101_2021.dbo.SaleBillVouchs shs ON s.iSOsID = shs.iSOsID
+        left join UFDATA_101_2021.dbo.SaleBillVouch sh ON sh.SBVID = shs.SBVID
         inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
         inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
         inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
         inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
         WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
         WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
@@ -130,7 +130,8 @@
 	join UFDATA_101_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_101_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_101_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_101_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
 	join UFDATA_101_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
-	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299' and pb.cVenCode not in('T010001','T020001')
+	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299'
+	 and omi.cInvCCode != '07'and omi.cInvCCode != '06'and omi.cInvCCode != '05' and pb.cVenCode not in('T010001','T020001')
 
 
 	UNION ALL
 	UNION ALL
 
 
@@ -139,7 +140,8 @@ select sum(pbs.iOriSum) as iOriSum,sum(round(pbs.iOriSum/1.13,2)) as iNotOriMone
 	join UFDATA_102_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_102_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_102_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_102_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_102_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
 	join UFDATA_102_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
-	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299' and pb.cVenCode not in('T010001','T020001')
+	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299'
+	 and omi.cInvCCode != '07'and omi.cInvCCode != '06'and omi.cInvCCode != '05' and pb.cVenCode not in('T010001','T020001')
 
 
 		UNION ALL
 		UNION ALL
 
 
@@ -149,7 +151,8 @@ select sum(pbs.iOriSum) as iOriSum,sum(round(pbs.iOriSum/1.13,4)) as iNotOriMone
 	join UFDATA_103_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_103_2021.dbo.PurBillVouchs pbs on pd.ID = pbs.iPOsID
 	join UFDATA_103_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_103_2021.dbo.PurBillVouch pb on pb.PBVID  = pbs.PBVID
 	join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
 	join UFDATA_103_2021.dbo.Inventory omi on omi.cInvCode=pd.cInvCode
-	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299' and pb.cVenCode not in('T010001','T020001')
+	where pm.cPOID like CONCAT(#{code},'%') and (omi.cInvCcode like '03%' or omi.cInvCcode like '04%') and omi.cInvCCode != '0399' and omi.cInvCCode != '0499' and omi.cInvCCode != '0299'
+	and omi.cInvCCode != '07'and omi.cInvCCode != '06'and omi.cInvCCode != '05' and pb.cVenCode not in('T010001','T020001')
 		) t where t.iOriSum is not null
 		) t where t.iOriSum is not null
 
 
 
 

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationShipdetailMapper.xml

@@ -19,7 +19,7 @@
 	<select id="queryByCostShipdetail" resultType="org.jeecg.modules.cost.entity.SyCostAllocationShipdetail">
 	<select id="queryByCostShipdetail" resultType="org.jeecg.modules.cost.entity.SyCostAllocationShipdetail">
 		SELECT
 		SELECT
 			sh.cDefine10 AS invoiceNum,
 			sh.cDefine10 AS invoiceNum,
-			CONVERT(varchar(50), max(sh.dcreatesystime), 23) as outdata ,
+			CONVERT(varchar(50), min(sh.dDate), 23) as outdata ,
 			sum(shs.iQuantity) as shipQuantity,
 			sum(shs.iQuantity) as shipQuantity,
 			sh.iExchRate AS exchangeRate,
 			sh.iExchRate AS exchangeRate,
 			sh.cSOCode AS orderNum,
 			sh.cSOCode AS orderNum,
@@ -60,7 +60,7 @@
 
 
 		 SELECT
 		 SELECT
 			sh.cDefine10 AS invoiceNum,
 			sh.cDefine10 AS invoiceNum,
-			CONVERT(varchar(50), max(sh.dcreatesystime), 23) as outdata ,
+			CONVERT(varchar(50), min(sh.dDate), 23) as outdata ,
 			sum(shs.iQuantity) as shipQuantity,
 			sum(shs.iQuantity) as shipQuantity,
 			sh.iExchRate AS exchangeRate,
 			sh.iExchRate AS exchangeRate,
 			sh.cSOCode AS orderNum,
 			sh.cSOCode AS orderNum,
@@ -114,7 +114,7 @@
 
 
 		SELECT
 		SELECT
 		sh.cDefine10 AS invoiceNum,
 		sh.cDefine10 AS invoiceNum,
-		CONVERT(varchar(50), max(sh.dcreatesystime), 23) as outdata ,
+		CONVERT(varchar(50), min(sh.dDate), 23) as outdata ,
 		sum(shs.iQuantity) as shipQuantity,
 		sum(shs.iQuantity) as shipQuantity,
 		sh.iExchRate AS exchangeRate,
 		sh.iExchRate AS exchangeRate,
 		sh.cSOCode AS orderNum,
 		sh.cSOCode AS orderNum,

+ 8 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -10,6 +10,7 @@ import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.cost.entity.*;
 import org.jeecg.modules.cost.entity.*;
 import org.jeecg.modules.cost.mapper.*;
 import org.jeecg.modules.cost.mapper.*;
 import org.jeecg.modules.cost.service.*;
 import org.jeecg.modules.cost.service.*;
@@ -246,7 +247,10 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
             2.余下:从采购起手,找到所有的采购入库,然后关联材料出库,排除掉自己使用的 就是余下的
             2.余下:从采购起手,找到所有的采购入库,然后关联材料出库,排除掉自己使用的 就是余下的
             * */
             * */
             //若余下数量不为0则给转入数据对象赋值
             //若余下数量不为0则给转入数据对象赋值
-            if(0!=Fabric.getFabricremainingQuantity().compareTo(BigDecimal.ZERO)){
+            if(oConvertUtils.isEmpty(Fabric.getFabricremainingQuantity())){
+                Fabric.setFabricremainingQuantity(BigDecimal.ZERO);
+            }
+            if(Fabric.getFabricremainingQuantity().compareTo(BigDecimal.ZERO) != 0 ){
                 List<SyRemaining> syRemaining  = syCostAllocationFabricMapper.queryRemainingByFabric(plannum,Fabric.getGoodsName());
                 List<SyRemaining> syRemaining  = syCostAllocationFabricMapper.queryRemainingByFabric(plannum,Fabric.getGoodsName());
                 BigDecimal cost = new BigDecimal(BigInteger.ZERO);
                 BigDecimal cost = new BigDecimal(BigInteger.ZERO);
                 for (SyRemaining syRemain:syRemaining) {
                 for (SyRemaining syRemain:syRemaining) {
@@ -276,6 +280,9 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                 Fabric.setSyRemaining(syRemaining);
                 Fabric.setSyRemaining(syRemaining);
             }
             }
             //若转入数量不为0则给转入数据对象赋值
             //若转入数量不为0则给转入数据对象赋值
+            if(oConvertUtils.isEmpty(Fabric.getFabrictransferQuantity())){
+                Fabric.setFabrictransferQuantity(BigDecimal.ZERO);
+            }
             if(0!=Fabric.getFabrictransferQuantity().compareTo(BigDecimal.ZERO)){
             if(0!=Fabric.getFabrictransferQuantity().compareTo(BigDecimal.ZERO)){
                 List<SyTransfer> transferlist  = syCostAllocationFabricMapper.queryTransferByFabric(plannum,Fabric.getGoodsName());
                 List<SyTransfer> transferlist  = syCostAllocationFabricMapper.queryTransferByFabric(plannum,Fabric.getGoodsName());
                 BigDecimal cost = new BigDecimal(BigInteger.ZERO);
                 BigDecimal cost = new BigDecimal(BigInteger.ZERO);

+ 28 - 13
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java

@@ -31,7 +31,9 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import java.sql.Wrapper;
 import java.sql.Wrapper;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 
 
 @Slf4j
 @Slf4j
@@ -107,21 +109,22 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
                    }
                    }
                }
                }
            }
            }
-           if((syCostLossReview.getRemarks()!=null && syCostLossReview.getRemarks()!="") ||
-                   (syCostLossReview.getPlanMan()!=null && syCostLossReview.getPlanMan()!="") || oConvertUtils.isNotEmpty(syCostLossReview.getIsPlanMan())){
-               List<String> list= syCostLossReviewService.queryCodeByPlanTable(syCostLossReview.getRemarks(),syCostLossReview.getPlanMan(),syCostLossReview.getIsPlanMan());
-               if(list.size()<1){
-                   return Result.OK(nullList);
-               }
-               if(sumList.size()<1){
-                   sumList=list;
-               }else {
-                   sumList.retainAll(list);
-                   if(sumList.size()<1){
+               if((syCostLossReview.getRemarks()!=null && syCostLossReview.getRemarks()!="") ||
+                       (syCostLossReview.getPlanMan()!=null && syCostLossReview.getPlanMan()!="")){
+                   List<String> list= syCostLossReviewService.queryCodeByPlanTable(syCostLossReview.getRemarks(),syCostLossReview.getPlanMan());
+                   if(list.size()<1){
                        return Result.OK(nullList);
                        return Result.OK(nullList);
                    }
                    }
+                   if(sumList.size()<1){
+                       sumList=list;
+                   }else {
+                       sumList.retainAll(list);
+                       if(sumList.size()<1){
+                           return Result.OK(nullList);
+                       }
+                   }
                }
                }
-           }
+
            if(sumList.size()<1){
            if(sumList.size()<1){
                sumList=null;
                sumList=null;
            }
            }
@@ -129,8 +132,20 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
            sumList=null;
            sumList=null;
        }
        }
 
 
-       IPage<SyCostLossReview> pageList = syCostLossReviewService.querylist(syCostLossReview,sumList,page);
+      // List<SyCostLossReview> syCostList = new ArrayList<>();
+       IPage<SyCostLossReview> pageList;
+       if(oConvertUtils.isNotEmpty(syCostLossReview.getIsPlanMan()) && syCostLossReview.getIsPlanMan().equals("否") ){
+           List<String> list1= syCostLossReviewService.queryCodeByPlanTable("","");
+
+           pageList = syCostLossReviewMapper.querylist(syCostLossReview,sumList,page,list1);
+
+       }else{
+           pageList = syCostLossReviewService.querylist(syCostLossReview,sumList,page,new ArrayList<>());
+       }
+
        for (SyCostLossReview sy:pageList.getRecords()) {
        for (SyCostLossReview sy:pageList.getRecords()) {
+
+
            //赋值制单人
            //赋值制单人
            List<String> list=syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
            List<String> list=syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
            if(list.size()==0){
            if(list.size()==0){

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/entity/FabricLossReview.java

@@ -52,5 +52,7 @@ public class FabricLossReview {
     private String approvalDateB;
     private String approvalDateB;
     //审批日期
     //审批日期
     private String approvalDateE;
     private String approvalDateE;
+    //驳回日期
+    private String rejectDate;
 
 
 }
 }

+ 5 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/SyCostLossReviewMapper.java

@@ -11,6 +11,7 @@ import org.jeecg.modules.documents.costLossReview.entity.SyCostLossReview;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
 
 import java.util.List;
 import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * @Description: 成本损失列表
  * @Description: 成本损失列表
@@ -20,7 +21,7 @@ import java.util.List;
  */
  */
 public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
 public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
     @DS("multi-one")
     @DS("multi-one")
-    IPage<SyCostLossReview> querylist(@Param("e")SyCostLossReview syCostLossReview,@Param("list")List<String> list, Page<SyCostLossReview> page);//@Param("pageNO")int pageNO,@Param("pageSize")int pageSize
+    IPage<SyCostLossReview> querylist(@Param("e")SyCostLossReview syCostLossReview,@Param("list")List<String> list, Page<SyCostLossReview> page,@Param("planlist") List<String> planlist);//@Param("pageNO")int pageNO,@Param("pageSize")int pageSize
     @DS("multi-one")
     @DS("multi-one")
     List<String> queryMakerByplanNo(@Param("planNo")String planNo);
     List<String> queryMakerByplanNo(@Param("planNo")String planNo);
 
 
@@ -35,7 +36,7 @@ public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
 
 
     List<String> queryCodeByfstatus(@Param("status")String status,@Param("ffirstApproveDateB")String ffirstApproveDateB,@Param("ffirstApproveDateE")String ffirstApproveDateE);
     List<String> queryCodeByfstatus(@Param("status")String status,@Param("ffirstApproveDateB")String ffirstApproveDateB,@Param("ffirstApproveDateE")String ffirstApproveDateE);
     List<String> queryCodeBycstatus(@Param("status")String status);
     List<String> queryCodeBycstatus(@Param("status")String status);
-    List<String> queryCodeByPlanTable(@Param("remarks")String remarks,@Param("planMan")String planMan,@Param("isPlanMan")String isPlanMan);
+    List<String> queryCodeByPlanTable(@Param("remarks")String remarks,@Param("planMan")String planMan);
 
 
 
 
     //面损表列表修改审批状态
     //面损表列表修改审批状态
@@ -85,4 +86,6 @@ public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
      * @return
      * @return
      */
      */
     String querySyApprovalAssignedBy(@Param("code") String code);
     String querySyApprovalAssignedBy(@Param("code") String code);
+
+    public void addhi(@Param("map") Map<String,Object> map);
 }
 }

+ 27 - 25
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml

@@ -63,6 +63,12 @@
                 #{item}
                 #{item}
             </foreach>
             </foreach>
         </if>
         </if>
+        <if test="planlist.size!=0">
+            and planNo not in
+            <foreach open="(" close=")" separator="," collection="planlist" item="item">
+                #{item}
+            </foreach>
+        </if>
         group by planNo
         group by planNo
 
 
     </select>
     </select>
@@ -122,50 +128,52 @@
     </select>
     </select>
 
 
     <select id="querySyFabricLossReport" resultType="org.jeecg.modules.documents.costLossReview.entity.FabricLossReview">
     <select id="querySyFabricLossReport" resultType="org.jeecg.modules.documents.costLossReview.entity.FabricLossReview">
-        select plan_code as cCode,create_time as createTime,first_approve_date as approvalDate,first_approve_by as approvalMan,
-                 content ->> '$.cDefine22'  AS cDefine22, content ->> '$.planner'  as planner,
-                 content ->> '$.number' as number, content ->> '$.contractNo' as contractNo,
-                 content ->> '$.cPersonName' as cPersonName,
-                 content ->> '$.outboundNumber' as outboundNumber,
-                 content ->> '$.makingPeople' as makingPeople, status, attachs
-        from sy_fabric_loss_report
+        select a.plan_code as cCode,a.create_time as createTime,a.first_approve_date as approvalDate,a.first_approve_by as approvalMan,
+                 a.content ->> '$.cDefine22'  AS cDefine22, content ->> '$.planner'  as planner,
+                 a.content ->> '$.number' as number, content ->> '$.contractNo' as contractNo,
+                 a.content ->> '$.cPersonName' as cPersonName,
+                 a.content ->> '$.outboundNumber' as outboundNumber,
+                 a.content ->> '$.makingPeople' as makingPeople, a.status, a.attachs,a.reject_date as rejectDate
+        from sy_fabric_loss_report a
+        left join sy_approval_history b on a.plan_code = b.plan_no
         where 1=1
         where 1=1
         <if test="sy.createTimeB != null and sy.createTimeB !='' and sy.createTimeE != null and sy.createTimeE !=''">
         <if test="sy.createTimeB != null and sy.createTimeB !='' and sy.createTimeE != null and sy.createTimeE !=''">
-            AND date_format( create_time, '%Y-%m-%d' ) between date_format(#{sy.createTimeB},'%Y-%m-%d') and date_format(#{sy.createTimeE},'%Y-%m-%d')
+            AND date_format( a.create_time, '%Y-%m-%d' ) between date_format(#{sy.createTimeB},'%Y-%m-%d') and date_format(#{sy.createTimeE},'%Y-%m-%d')
         </if>
         </if>
         <if test="sy.approvalMan != null and sy.approvalMan !=''">
         <if test="sy.approvalMan != null and sy.approvalMan !=''">
-            AND first_approve_by LIKE CONCAT('%',#{sy.approvalMan},'%')
+            AND b.assigned_by LIKE CONCAT('%',#{sy.approvalMan},'%')
         </if>
         </if>
         <if test="sy.approvalDateB != null and sy.approvalDateB !='' and sy.approvalDateE != null and sy.approvalDateE !=''">
         <if test="sy.approvalDateB != null and sy.approvalDateB !='' and sy.approvalDateE != null and sy.approvalDateE !=''">
-            AND first_approve_date between #{sy.approvalDateB} and #{sy.approvalDateE}
+            AND date_format( a.first_approve_date, '%Y-%m-%d' ) between date_format(#{sy.approvalDateB},'%Y-%m-%d') and date_format(#{sy.approvalDateE},'%Y-%m-%d')
         </if>
         </if>
         <if test="sy.cCode != null and sy.cCode !=''">
         <if test="sy.cCode != null and sy.cCode !=''">
-            AND plan_code LIKE CONCAT('%',#{sy.cCode},'%')
+            AND a.plan_code LIKE CONCAT('%',#{sy.cCode},'%')
         </if>
         </if>
         <if test="sy.cDefine22 != null and sy.cDefine22 !=''">
         <if test="sy.cDefine22 != null and sy.cDefine22 !=''">
-            AND JSON_EXTRACT( content, '$.cDefine22' ) LIKE CONCAT('%',#{sy.cDefine22},'%')
+            AND JSON_EXTRACT( a.content, '$.cDefine22' ) LIKE CONCAT('%',#{sy.cDefine22},'%')
         </if>
         </if>
         <if test="sy.planner != null and sy.planner !=''">
         <if test="sy.planner != null and sy.planner !=''">
-            AND JSON_EXTRACT( content, '$.planner' ) LIKE CONCAT('%',#{sy.planner},'%')
+            AND JSON_EXTRACT( a.content, '$.planner' ) LIKE CONCAT('%',#{sy.planner},'%')
         </if>
         </if>
         <if test="sy.number != null and sy.number !=''">
         <if test="sy.number != null and sy.number !=''">
-            AND JSON_EXTRACT( content, '$.number' ) = #{sy.number}
+            AND JSON_EXTRACT( a.content, '$.number' ) = #{sy.number}
         </if>
         </if>
         <if test="sy.contractNo != null and sy.contractNo !=''">
         <if test="sy.contractNo != null and sy.contractNo !=''">
-            AND JSON_EXTRACT( content, '$.contractNo' ) LIKE CONCAT('%',#{sy.contractNo},'%')
+            AND JSON_EXTRACT( a.content, '$.contractNo' ) LIKE CONCAT('%',#{sy.contractNo},'%')
         </if>
         </if>
         <if test="sy.cPersonName != null and sy.cPersonName !=''">
         <if test="sy.cPersonName != null and sy.cPersonName !=''">
-            AND JSON_EXTRACT( content, '$.cPersonName' ) LIKE CONCAT('%',#{sy.cPersonName},'%')
+            AND JSON_EXTRACT( a.content, '$.cPersonName' ) LIKE CONCAT('%',#{sy.cPersonName},'%')
         </if>
         </if>
         <if test="sy.outboundNumber != null and sy.outboundNumber !=''">
         <if test="sy.outboundNumber != null and sy.outboundNumber !=''">
-            AND JSON_EXTRACT( content, '$.outboundNumber') = #{sy.outboundNumber}
+            AND JSON_EXTRACT( a.content, '$.outboundNumber') = #{sy.outboundNumber}
         </if>
         </if>
         <if test="sy.makingPeople != null and sy.makingPeople !=''">
         <if test="sy.makingPeople != null and sy.makingPeople !=''">
-            AND JSON_EXTRACT( content, '$.makingPeople' ) LIKE CONCAT('%',#{sy.makingPeople},'%')
+            AND JSON_EXTRACT( a.content, '$.makingPeople' ) LIKE CONCAT('%',#{sy.makingPeople},'%')
         </if>
         </if>
         <if test="sy.status != null and sy.status !=''">
         <if test="sy.status != null and sy.status !=''">
-            AND status = #{sy.status}
+            AND a.status = #{sy.status}
         </if>
         </if>
+        group by a.plan_code
     </select>
     </select>
 
 
     <select id="queryCostAllocation" resultType="org.jeecg.modules.documents.costLossReview.entity.CostAllocationReview">
     <select id="queryCostAllocation" resultType="org.jeecg.modules.documents.costLossReview.entity.CostAllocationReview">
@@ -336,12 +344,6 @@
         <if test="planMan!=null and planMan!=''">
         <if test="planMan!=null and planMan!=''">
             and plan_man LIKE CONCAT('%',#{planMan},'%')
             and plan_man LIKE CONCAT('%',#{planMan},'%')
         </if>
         </if>
-        <if test='isPlanMan!=null and isPlanMan!="" and isPlanMan == "是"'>
-            and plan_man is not null
-        </if>
-        <if test='isPlanMan!=null and isPlanMan!="" and isPlanMan == "否"'>
-            and plan_man is null
-        </if>
     </select>
     </select>
 
 
 <!--    面损表列表取消提交-->
 <!--    面损表列表取消提交-->

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/ISyCostLossReviewService.java

@@ -17,7 +17,7 @@ import java.util.List;
  * @Version: V1.0
  * @Version: V1.0
  */
  */
 public interface ISyCostLossReviewService extends IService<SyCostLossReview> {
 public interface ISyCostLossReviewService extends IService<SyCostLossReview> {
-     IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page);
+     IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page,List<String> planlist);
      List<String> queryMakerByplanNo(String planNo);
      List<String> queryMakerByplanNo(String planNo);
      IPage<FabricLossReview> querySyFabricLossReport(FabricLossReview sy, Page<FabricLossReview> page);
      IPage<FabricLossReview> querySyFabricLossReport(FabricLossReview sy, Page<FabricLossReview> page);
      IPage<CostAllocationReview> queryCostAllocation(CostAllocationReview sy, Page<CostAllocationReview> page);
      IPage<CostAllocationReview> queryCostAllocation(CostAllocationReview sy, Page<CostAllocationReview> page);
@@ -26,7 +26,7 @@ public interface ISyCostLossReviewService extends IService<SyCostLossReview> {
      List<String> queryCodeBymaker(String maker);
      List<String> queryCodeBymaker(String maker);
      List<String> queryCodeByfstatus(String status,String ffirstApproveDateB,String ffirstApproveDateE);
      List<String> queryCodeByfstatus(String status,String ffirstApproveDateB,String ffirstApproveDateE);
      List<String> queryCodeBycstatus(String status);
      List<String> queryCodeBycstatus(String status);
-     List<String> queryCodeByPlanTable(String remarks,String planMan,String isPlanMan);
+     List<String> queryCodeByPlanTable(String remarks,String planMan);
 
 
 
 
 
 

+ 5 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/impl/SyCostLossReviewServiceImpl.java

@@ -36,9 +36,10 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
     private SyFabricLossReportServiceImpl syFabricLossReportService;
     private SyFabricLossReportServiceImpl syFabricLossReportService;
 
 
 
 
+
     @Override
     @Override
-    public IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page) {
-        return syCostLossReviewMapper.querylist(syCostLossReview,list, page);
+    public IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page,List<String> planlist) {
+        return syCostLossReviewMapper.querylist(syCostLossReview,list, page,planlist);
     }
     }
 
 
     @Override
     @Override
@@ -82,8 +83,8 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
     }
     }
 
 
     @Override
     @Override
-    public List<String> queryCodeByPlanTable(String remarks, String planMan,String isPlanMan) {
-        return syCostLossReviewMapper.queryCodeByPlanTable(remarks, planMan,isPlanMan);
+    public List<String> queryCodeByPlanTable(String remarks, String planMan) {
+        return syCostLossReviewMapper.queryCodeByPlanTable(remarks, planMan);
     }
     }