Browse Source

成本分配 查询显示

liuchaohui 2 years ago
parent
commit
6453e3d565

+ 4 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java

@@ -67,7 +67,7 @@ public class SyCostAllocationController {
     /**
      * 分页列表查询
      *
-     * @param syCostAllocation
+     * @param
      * @param pageNo
      * @param pageSize
      * @param req
@@ -80,9 +80,9 @@ public class SyCostAllocationController {
                                    @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                    @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                    HttpServletRequest req) {
-        QueryWrapper<SyCostAllocation> queryWrapper = QueryGenerator.initQueryWrapper(syCostAllocation, req.getParameterMap());
-        Page<SyCostAllocation> page = new Page<SyCostAllocation>(pageNo, pageSize);
-        IPage<SyCostAllocation> pageList = syCostAllocationService.page(page, queryWrapper);
+        Integer pageStart=(pageNo-1)*pageSize;
+        Integer pageEnd=pageNo*pageSize;
+        List<SyCostJson> pageList = syCostAllocationService.queryByCostJson(syCostAllocation.getPlanNum(),pageStart,pageEnd);
         return Result.OK(pageList);
     }
     /**

+ 4 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/SyCostAllocationMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.cost.entity.SyCostAllocation;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.cost.entity.SyCostJson;
 
 /**
  * @Description: 成本分配主表
@@ -18,4 +19,7 @@ public interface SyCostAllocationMapper extends BaseMapper<SyCostAllocation> {
 
     @DS("multi-three")
     List<SyCostAllocation> queryByCostHead(@Param("code") String planCode);
+
+    List<SyCostJson> queryByCostJson(@Param("planNum")String planNum,
+                             @Param("pageStart")Integer pageStart,@Param("pageEnd")Integer pageEnd);
 }

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

@@ -9,6 +9,14 @@
         where plan_code= #{planCode}
     </select>
 
+    <select id="queryByCostJson" resultType="org.jeecg.modules.cost.entity.SyCostJson">
+        select plan_num,cost_info from sy_cost_json
+        <if test=" planNum !=null and planNum !='' ">
+            where plan_num = #{planNum}
+        </if>
+        limit #{pageStart},#{pageEnd}
+    </select>
+
     <select id="queryByCostHead" resultType="org.jeecg.modules.cost.entity.SyCostAllocation">
         SELECT      
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,

+ 4 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/ISyCostAllocationService.java

@@ -3,12 +3,7 @@ package org.jeecg.modules.cost.service;
 import com.alibaba.fastjson.JSONObject;
 import org.apache.poi.ss.formula.functions.T;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.cost.entity.SyCostAllocationAccident;
-import org.jeecg.modules.cost.entity.SyCostAllocationCostpay;
-import org.jeecg.modules.cost.entity.SyCostAllocationFabric;
-import org.jeecg.modules.cost.entity.SyCostAllocationIngredient;
-import org.jeecg.modules.cost.entity.SyCostAllocationShipdetail;
-import org.jeecg.modules.cost.entity.SyCostAllocation;
+import org.jeecg.modules.cost.entity.*;
 import com.baomidou.mybatisplus.extension.service.IService;
 import java.io.Serializable;
 import java.util.Collection;
@@ -52,4 +47,7 @@ public interface ISyCostAllocationService extends IService<SyCostAllocation> {
 
     //查询成本表头数据
     List<SyCostAllocation> queryByCostHead(String planCode);
+
+    List<SyCostJson> queryByCostJson(String planNum,
+                                     Integer pageStart,Integer pageEnd);
 }

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

@@ -395,6 +395,11 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
         return syCostAllocationMapper.queryByCostHead(planCode);
     }
 
+    @Override
+    public List<SyCostJson> queryByCostJson(String planNum, Integer pageStart, Integer pageEnd) {
+        return syCostAllocationMapper.queryByCostJson(planNum, pageStart, pageEnd);
+    }
+
     //用单据号查询对应面损成本单价
      static void queryFabric(String planCode){