Browse Source

计划单统计表 多功能查询

liuchaohui 2 years ago
parent
commit
f35d04f802

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

@@ -1,5 +1,6 @@
 package org.jeecg.modules.documents.costLossReview.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
@@ -17,10 +18,13 @@ import org.jeecg.modules.documents.orderData.service.ISyOrderDataService;
 import org.jeecg.modules.report.entity.FabricLoss;
 import org.jeecg.modules.report.entity.SyFabricLossReport;
 import org.jeecg.modules.report.service.ISyFabricLossReportService;
+import org.jeecg.modules.syPlanStatistics.entity.SyPlanStatistics;
+import org.jeecg.modules.syPlanStatistics.service.ISyPlanStatisticsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.sql.Wrapper;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -32,6 +36,8 @@ import java.util.List;
 public class SyCostLossReviewController extends JeecgController<SyOrderData, ISyOrderDataService> {
    @Autowired
    private ISyCostLossReviewService syCostLossReviewService;
+    @Autowired
+    private ISyPlanStatisticsService syPlanStatisticsService;
    @Autowired
    private ISyFabricLossReportService syFabricLossReportService;
 
@@ -52,7 +58,7 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        Page<SyCostLossReview> page = new Page<SyCostLossReview>(pageNo, pageSize);
-       List<String> sumList = new ArrayList<>();
+       List<String> sumList = null;
        if(syCostLossReview.getPlanNo()=="" || syCostLossReview.getPlanNo()==null){
            if(syCostLossReview.getFstatus()!=null && syCostLossReview.getFstatus()!=""){
                List<String> list= syCostLossReviewService.queryCodeByfstatus(syCostLossReview.getFstatus());
@@ -86,7 +92,7 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
            syCostLossReview.setSumList(sumList);
        }
 
-       IPage<SyCostLossReview> pageList = syCostLossReviewService.querylist(syCostLossReview,page);
+       IPage<SyCostLossReview> pageList = syCostLossReviewService.querylist(syCostLossReview,sumList,page);
        for (SyCostLossReview sy:pageList.getRecords()) {
            //赋值制单人
            List<String> list=syCostLossReviewService.queryMakerByplanNo(sy.getPlanNo());
@@ -121,6 +127,14 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
                sy.setCstatus(c.getCstatus());
            }
 
+           QueryWrapper wrapper = new QueryWrapper();
+           wrapper.eq("plan_num",sy.getPlanNo());
+           List<SyPlanStatistics> planStatistics =syPlanStatisticsService.list(wrapper);
+           if(planStatistics!=null && planStatistics.size()>0){
+               sy.setPlanMan(planStatistics.get(0).getPlanMan());
+               sy.setRemarks(planStatistics.get(0).getRemarks());
+           }
+
        }
        return Result.OK(pageList);
    }

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

@@ -71,6 +71,9 @@ public class SyCostLossReview {
 
 	private String remarks;
 
+	private String dverifyDateB;
+	private String dverifyDateE;
+
 	List<String> sumList;
 
 }

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

@@ -19,7 +19,7 @@ import java.util.List;
  */
 public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
     @DS("multi-one")
-    IPage<SyCostLossReview> querylist(@Param("e")SyCostLossReview syCostLossReview, 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("pageNO")int pageNO,@Param("pageSize")int pageSize
     @DS("multi-one")
     List<String> queryMakerByplanNo(@Param("planNo")String planNo);
 

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

@@ -63,8 +63,8 @@
         <if test="e.planNo !=null and e.planNo !=''">
            and planNo like CONCAT(#{e.planNo},'%')
         </if>
-        <if test="e.dverifyDate !=null and e.dverifyDate !=''">
-            and dverifyDate = #{e.dverifyDate}
+        <if test="e.dverifyDateB !=null and e.dverifyDateB !='' and e.dverifyDateE !=null and e.dverifyDateE !=''">
+            and dverifyDate between #{e.dverifyDateB} and #{e.dverifyDateE}
         </if>
         <if test="e.department !=null and e.department !=''">
             and department like CONCAT(#{e.department},'%')
@@ -72,6 +72,12 @@
         <if test="e.salesman !=null and e.salesman !=''">
             and salesman like CONCAT(#{e.salesman},'%')
         </if>
+        <if test="list != null">
+            and planNo in
+            <foreach open="(" close=")" separator="," collection="list" item="item">
+                #{item}
+            </foreach>
+        </if>
         group by planNo
 
     </select>
@@ -172,12 +178,6 @@
         <if test="sy.makingPeople != null and sy.makingPeople !=''">
             AND JSON_EXTRACT( content, '$.makingPeople' ) LIKE CONCAT('%',#{sy.makingPeople},'%')
         </if>
-        <if test="sy.sumList != null">
-            plan_code in
-            <foreach open="(" close=")" separator="," collection="list" item="item" index="index">
-                #{item}
-            </foreach>
-        </if>
     </select>
 
     <select id="queryCostAllocation" resultType="org.jeecg.modules.documents.costLossReview.entity.CostAllocationReview">

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

@@ -16,7 +16,7 @@ import java.util.List;
  * @Version: V1.0
  */
 public interface ISyCostLossReviewService extends IService<SyCostLossReview> {
-     IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview, Page<SyCostLossReview> page);
+     IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page);
      List<String> queryMakerByplanNo(String planNo);
      IPage<FabricLossReview> querySyFabricLossReport(FabricLossReview sy, Page<FabricLossReview> page);
      IPage<CostAllocationReview> queryCostAllocation(CostAllocationReview sy, Page<CostAllocationReview> page);

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

@@ -27,8 +27,8 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
     private SyCostLossReviewMapper syCostLossReviewMapper;
 
     @Override
-    public IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview, Page<SyCostLossReview> page) {
-        return syCostLossReviewMapper.querylist(syCostLossReview, page);
+    public IPage<SyCostLossReview> querylist(SyCostLossReview syCostLossReview,List<String> list, Page<SyCostLossReview> page) {
+        return syCostLossReviewMapper.querylist(syCostLossReview,list, page);
     }
 
     @Override