Bladeren bron

供应商产能报表

huxy 2 jaren geleden
bovenliggende
commit
36724c1e94

+ 20 - 16
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/controller/SupplierCapacityController.java

@@ -52,46 +52,50 @@ public class SupplierCapacityController extends JeecgController<SupplierCapacity
    @Autowired
    private ISupplierCapacityService SupplierCapacityService;
 
-   @AutoLog(value = "供应链产能报表查询-通过条件查询")
+   /*@AutoLog(value = "供应链产能报表查询-通过条件查询")
    @ApiOperation(value="供应链产能报表查询-通过条件查询", notes="供应链产能报表查询-通过条件查询")
    @RequestMapping(value = "/list2",method = RequestMethod.GET)
    public Result<?> list2(SupplierCapacityDto supplierCapacityDto){
       System.out.println("supplierCapacityDto:"+supplierCapacityDto);
+      //List<SupplierCapacity> list=SupplierCapacityService.selectList(supplierCapacityDto);//获取集合数据
       return Result.ok(SupplierCapacityService.selectList(supplierCapacityDto));
-   }
+   }*/
 
    @AutoLog(value = "供应链产能报表查询-通过条件查询改")
    @ApiOperation(value="供应链产能报表查询-通过条件查询改", notes="供应链产能报表查询-通过条件查询改")
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    public Result<IPage<SupplierCapacity>> list(SupplierCapacityDto supplierCapacityDto, HttpServletRequest req){
-     //System.out.println("supplierCapacityDto:"+supplierCapacityDto);
       Result<IPage<SupplierCapacity>> result = new Result<IPage<SupplierCapacity>>();
       QueryWrapper<SupplierCapacityDto> queryWrapper = new QueryWrapper<>();//初始化
       if(StringUtils.isNotBlank(supplierCapacityDto.getCsrccode())){//订单号
-         queryWrapper.eq("PO_Pomain.cPOID",supplierCapacityDto.getCsrccode());
+         queryWrapper.eq("p.csrccode",supplierCapacityDto.getCsrccode());
       }
-      if(StringUtils.isNotBlank(supplierCapacityDto.getVenCode())){//供应商
-         queryWrapper.eq("Vendor.cVenName",supplierCapacityDto.getVenCode());
+      if(StringUtils.isNotBlank(supplierCapacityDto.getVenName())){//供应商
+         queryWrapper.eq("p.cVenName",supplierCapacityDto.getVenName());
       }
       if(StringUtils.isNotBlank(supplierCapacityDto.getPlanLotNumber())){//计划单号
-         queryWrapper.eq("PO_Podetails.planLotNumber",supplierCapacityDto.getPlanLotNumber());
+         queryWrapper.eq("p.planLotNumber",supplierCapacityDto.getPlanLotNumber());
+      }
+      if(supplierCapacityDto.getStartDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getStartDate().toString())){//起始月份
+         queryWrapper.ge("month(p.dArriveDate)",supplierCapacityDto.getStartDate().toString());
+      }
+      if(supplierCapacityDto.getEndDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getEndDate().toString())){//结束月份
+         queryWrapper.le("month(p.dArriveDate)",supplierCapacityDto.getEndDate().toString());
       }
-      if(supplierCapacityDto.getStartDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getStartDate().toString())){//起始日期
-         queryWrapper.ge("month(PO_Podetails.dArriveDate)",supplierCapacityDto.getStartDate().toString());
+      /*if(supplierCapacityDto.getStartDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getStartDate().toString())){//起始日期
+         queryWrapper.ge("p.dArriveDate",supplierCapacityDto.getStartDate().toString());
       }
-      if(supplierCapacityDto.getEndDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getEndDate().toString())){//起始日期
-         queryWrapper.le("month(PO_Podetails.dArriveDate)",supplierCapacityDto.getEndDate().toString());
+      if(supplierCapacityDto.getEndDate()!=null&&StringUtils.isNotBlank(supplierCapacityDto.getEndDate().toString())){//结束日期
+         queryWrapper.le("p.dArriveDate",supplierCapacityDto.getEndDate().toString());
+      }*/
+      if(StringUtils.isNotBlank(supplierCapacityDto.getOrderType())){//计划单号
+         queryWrapper.eq("p.iOrderType",supplierCapacityDto.getOrderType());
       }
-      //queryWrapper.eq("cPOID",supplierCapacityDto.getCsrccode());
-      //SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
       Page<SupplierCapacity> page = new Page<SupplierCapacity>(supplierCapacityDto.getPageNo(), supplierCapacityDto.getPageSize());
-      //      //System.out.println("QueryWrapper:"+queryWrapper);
       IPage<SupplierCapacity> pageList = SupplierCapacityService.selectPage(page, queryWrapper);
       result.setSuccess(true);
       result.setResult(pageList);
       result.setMessage("查询成功");
-      System.out.println("result.getResult().getTotal():"+result.getResult().getTotal());
-      System.out.println("pageList.getSize():"+pageList.getSize());
       return result;
    }
 

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/dto/SupplierCapacityDto.java

@@ -19,7 +19,7 @@ public class SupplierCapacityDto {
     private String planLotNumber;//计划单号
 
     @ApiModelProperty(value = "供应商")
-    private String venCode;//供应商
+    private String venName;//供应商
 
     @ApiModelProperty(value = "订单类型(委外订单、采购订单)")
     private String orderType;//订单类型

+ 14 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/SupplierCapacity.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.scas.entity;
 
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
@@ -10,17 +11,30 @@ import java.util.Date;
 @Data
 @ApiModel(description="供应链产能报表")
 public class SupplierCapacity {
+    @ApiModelProperty(value = "订单号")
     private String csrccode;//订单号
+    @ApiModelProperty(value = "计划单号")
     private String cPlanLotNumber;//计划单号
+    @ApiModelProperty(value = "部门")
     private String cDepCode;//部门
+    @ApiModelProperty(value = "业务员")
     private String cPersonCode;//业务员
+    @ApiModelProperty(value = "供应商")
     private String cVenCode;//供应商
+    @ApiModelProperty(value = "供应商类型")
     private String cVenCodeType;//供应商类型
+    @ApiModelProperty(value = "订单类型")
     private String iOrderType;//订单类型
+    @ApiModelProperty(value = "数量")
     private BigDecimal iQuantity;//数量
+    @ApiModelProperty(value = "累计入库数量")
     private BigDecimal iReceivedQTY;//累计入库数量
+    @ApiModelProperty(value = "单位")
     private String unit;//单位(委外或者采购)
+    @ApiModelProperty(value = "计划到货月份")
     private Integer arriveMonth;//计划到货月份
+    @ApiModelProperty(value = "计划到货日期")
     private Date dArriveDate;//计划到货日期
+    @ApiModelProperty(value = "系数")
     private BigDecimal coefficient;//系数
 }

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo1.java

@@ -10,11 +10,11 @@ import java.util.Date;
 public class SupplierCapacityVo1 {
     @Excel(name = "部门", width = 15)
     private String cDepCode;//部门
-    @Excel(name = "供应商", width = 15)
+    @Excel(name = "供应商", width = 30)
     private String cVenCode;//供应商
-    @Excel(name = "统计数量", width = 15)
+    @Excel(name = "统计数量", width = 30)
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 15)
+    @Excel(name = "累计入库数量", width = 30)
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private Integer arriveMonth;//计划到货月份

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo2.java

@@ -9,9 +9,9 @@ import java.math.BigDecimal;
 public class SupplierCapacityVo2 {
     @Excel(name = "部门", width = 15)
     private String cDepCode;//部门
-    @Excel(name = "统计数量", width = 15)
+    @Excel(name = "统计数量", width = 30)
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 15)
+    @Excel(name = "累计入库数量", width = 30)
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private Integer arriveMonth;//计划到货月份

+ 3 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/entity/vo/SupplierCapacityVo3.java

@@ -7,11 +7,11 @@ import java.math.BigDecimal;
 
 @Data
 public class SupplierCapacityVo3 {
-    @Excel(name = "供应商", width = 15)
+    @Excel(name = "供应商", width = 30)
     private String cVenCode;//供应商
-    @Excel(name = "统计数量", width = 15)
+    @Excel(name = "统计数量", width = 30)
     private BigDecimal iQuantity;//统计数量
-    @Excel(name = "累计入库数量", width = 15)
+    @Excel(name = "累计入库数量", width = 30)
     private BigDecimal iReceivedQTY;//累计入库数量
     @Excel(name = "计划到货月份", width = 15)
     private Integer arriveMonth;//计划到货月份

+ 53 - 74
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/xml/SupplierCapacityMapper.xml

@@ -27,7 +27,7 @@
         left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
         left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
         left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
-        union
+        union all
         select	--ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
         OM_MOMain.cCode csrccode,
         cPlanLotNumber,
@@ -78,76 +78,55 @@
 
 
     <select id="selectPage" resultType="org.jeecg.modules.scas.entity.SupplierCapacity">
-        /*select  * from
-        (select ROW_NUMBER() OVER(ORDER BY cVenCode) index1,* from
-        (*/select	--ROW_NUMBER() OVER(ORDER BY PO_Pomain.poid) index1,
-        PO_Pomain.cPOID csrccode,
-        PlanLotNumber cPlanLotNumber,
-        cDepname cDepCode,
-        cPersonName cPersonCode,
-        cVenName cVenCode,
-        cVCName cVenCodeType,
-        '采购订单' iOrderType,
-        iQuantity,
-        iReceivedQTY,
-        cComUnitName unit,
-        month(dArriveDate) arriveMonth,
-        dArriveDate,
-        isnull(Inventory.cInvDefine1,0) coefficient
-        from PO_Pomain
-        left join PO_Podetails on PO_Podetails.POID=PO_Pomain.POID
-        left join Department on  Department.cdepcode=PO_Pomain.cDepCode
-        left join Person on	Person.cPersonCode=PO_Pomain.cPersonCode
-        left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
-        left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
-        left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
-        left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
-        ${ew.customSqlSegment}
-        <!--union
-        select	&#45;&#45;ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
-        OM_MOMain.cCode csrccode,
-        cPlanLotNumber,
-        cDepname cDepCode,
-        cPersonName cPersonCode,
-        cVenName cVenCode,
-        cVCName cVenCodeType,
-        '委外订单' iOrderType,
-        iQuantity,
-        iReceivedQTY,
-        cComUnitName unit,
-        month(dArriveDate) arriveMonth,
-        dArriveDate,
-        isnull(Inventory.cInvDefine1,0) coefficient
-        from OM_MOMain
-        left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
-        left join Department on  Department.cdepcode=OM_MOMain.cDepCode
-        left join Person on	Person.cPersonCode=OM_MOMain.cPersonCode
-        left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
-        left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
-        left join ComputationUnit on OM_MODetails.cUnitID=ComputationUnit.cComunitCode
-        left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
-        ) p
-        <where>
-            <if test="qw.csrccode!=null">
-                and csrccode=#{qw.csrccode}&#45;&#45;&#45;&#45;订单号
-            </if>
-            <if test="qw.orderType!=null">
-                AND iOrderType=#{qw.orderType}&#45;&#45;订单类型
-            </if>
-            <if test="qw.venCode!=null">
-                and cVenCode=#{qw.venCode}&#45;&#45;供应商
-            </if>
-            <if test="qw.planLotNumber!=null">
-                and cPlanLotNumber=#{qw.planLotNumber}&#45;&#45;计划单号
-            </if>
-            <if test="qw.startDate!=null">
-                and arriveMonth&gt;=$#{qw.startDate}  &#45;&#45;起始日期
-            </if>
-            <if test="qw.endDate!=null">
-                and arriveMonth&lt;=$#{qw.endDate}   &#45;&#45;结束日期
-            </if>
-        </where>
-        )-->
+        --测试
+    select * from(
+    select
+            PO_Pomain.cPOID csrccode,
+            PlanLotNumber cPlanLotNumber,
+            cDepname cDepCode,
+            cPersonName cPersonCode,
+            cVenName cVenCode,
+            cVCName cVenCodeType,
+            '采购订单' iOrderType,
+            iQuantity,
+            iReceivedQTY,
+            cComUnitName unit,
+            month(dArriveDate) arriveMonth,
+            dArriveDate,
+            isnull(Inventory.cInvDefine1,0) coefficient
+            from PO_Pomain
+            left join PO_Podetails on PO_Podetails.POID=PO_Pomain.POID
+            left join Department on  Department.cdepcode=PO_Pomain.cDepCode
+            left join Person on	Person.cPersonCode=PO_Pomain.cPersonCode
+            left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
+            left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
+            left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
+            left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
+    union ALL
+    select	--ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
+            OM_MOMain.cCode csrccode,
+            cPlanLotNumber,
+            cDepname cDepCode,
+            cPersonName cPersonCode,
+            cVenName cVenCode,
+            cVCName cVenCodeType,
+            '委外订单' iOrderType,
+            iQuantity,
+            iReceivedQTY,
+            cComUnitName unit,
+            month(dArriveDate) arriveMonth,
+            dArriveDate,
+            isnull(Inventory.cInvDefine1,0) coefficient
+            from OM_MOMain
+            left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
+            left join Department on  Department.cdepcode=OM_MOMain.cDepCode
+            left join Person on	Person.cPersonCode=OM_MOMain.cPersonCode
+            left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
+            left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
+            left join ComputationUnit on OM_MODetails.cUnitID=ComputationUnit.cComunitCode
+            left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
+            )p
+            ${ew.customSqlSegment}
     </select>
 
     <select id="excel001" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1">
@@ -174,7 +153,7 @@
 				left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
 				left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
 				--order by cDepCode,cVenCode,arriveMonth
-					UNION
+					union all
             select	cDepname cDepCode,
 				cVenName cVenCode,
 				month(dArriveDate) arriveMonth,
@@ -216,7 +195,7 @@
 					left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
 					left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
 					left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
-            UNION
+           union all
                     select
                       cDepname cDepCode,
 					month(dArriveDate) arriveMonth,
@@ -258,7 +237,7 @@
             left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
             left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
             left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
-        union
+        union all
         select	ROW_NUMBER() OVER(ORDER BY cVenName) index1,
             cVenName cVenCode,
             month(dArriveDate) arriveMonth,

+ 0 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/service/ISupplierCapacityService.java

@@ -18,7 +18,6 @@ public interface ISupplierCapacityService extends IService<SupplierCapacity> {
 
     List<SupplierCapacity> selectList(SupplierCapacityDto supplierCapacityDto);
 
-
     List<SupplierCapacityVo1> excel1();
 
     List<SupplierCapacityVo2> excel2();