huxy 2 éve
szülő
commit
061912408b

+ 17 - 14
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/controller/DyeLossController.java

@@ -52,29 +52,31 @@ public class DyeLossController extends JeecgController<DyeLoss, IDyeLossService>
     @AutoLog(value = "染损报表查询")
     @ApiOperation(value="染损报表查询", notes="染损报表查询")
     @RequestMapping(value = "/list",method = RequestMethod.GET)
-    public Result<IPage<DyeLoss>> list2(DyeLossDto dyeLossDto, HttpServletRequest req){
-        if(dyeLossDto.getPageSize()>10){//页面长度不能大于10
-            dyeLossDto.setPageSize(10);
+    public Result<IPage<DyeLoss>> list2( @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+                                         @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+                                         DyeLossDto dyeLossDto,
+                                         HttpServletRequest req){
+        if(pageSize>10){//页面长度不能大于10
+            pageSize=10;
         }
         Result<IPage<DyeLoss>> result = new Result<IPage<DyeLoss>>();
         QueryWrapper<DyeLossDto> queryWrapper = new QueryWrapper<>();//初始化
-        System.out.println("pageno"+dyeLossDto.getPageNo()+"pagesize"+dyeLossDto.getPageSize());
-        if(StringUtils.isNotBlank(dyeLossDto.getCode())){ //code;//订单号
+        if(dyeLossDto.getCode()!=null&& !dyeLossDto.getCode().trim().equals("") &&StringUtils.isNotBlank(dyeLossDto.getCode())){ //code;//订单号
             queryWrapper.eq("a.cCode",dyeLossDto.getCode());
         }
-        if(StringUtils.isNotBlank(dyeLossDto.getVenName())){//供应商名称
+        if(dyeLossDto.getVenName()!=null && !dyeLossDto.getVenName().trim().equals("") &&StringUtils.isNotBlank(dyeLossDto.getVenName())){//供应商名称
             queryWrapper.eq("c.cVenName",dyeLossDto.getVenName());
         }
-        if(StringUtils.isNotBlank(dyeLossDto.getOrderType())){//订单类型
+        if(dyeLossDto.getOrderType()!=null && !dyeLossDto.getOrderType().trim().equals("") &&StringUtils.isNotBlank(dyeLossDto.getOrderType())){//订单类型
             queryWrapper.eq("a.iOrderType",dyeLossDto.getOrderType());
         }
-        if(StringUtils.isNotBlank(dyeLossDto.getPlanLotNumber())){//计划单号
+        if(dyeLossDto.getPlanLotNumber()!=null && !dyeLossDto.getPlanLotNumber().trim().equals("") &&StringUtils.isNotBlank(dyeLossDto.getPlanLotNumber())){//计划单号
             queryWrapper.eq("b.cPlanLotNumber",dyeLossDto.getPlanLotNumber());
         }
-        if(StringUtils.isNotBlank(dyeLossDto.getCsocode())){//销售订单号
+        if(dyeLossDto.getCsocode()!=null && !dyeLossDto.getCsocode().trim().equals("") &&StringUtils.isNotBlank(dyeLossDto.getCsocode())){//销售订单号
             queryWrapper.eq("e.csocode",dyeLossDto.getCsocode());
         }
-        Page<DyeLoss> page = new Page<DyeLoss>(dyeLossDto.getPageNo(), dyeLossDto.getPageSize());
+        Page<DyeLoss> page = new Page<DyeLoss>(pageNo, pageSize);
         IPage<DyeLoss> pageList = dyeLossService.selectPage(page, queryWrapper);
         result.setSuccess(true);
         result.setResult(pageList);
@@ -82,18 +84,19 @@ public class DyeLossController extends JeecgController<DyeLoss, IDyeLossService>
         return result;
     }
 
-    @AutoLog(value = "染损报表数据合计")
+    /*@AutoLog(value = "染损报表数据合计")
     @ApiOperation(value="染损报表数据合计", notes="染损报表数据合计")
     @RequestMapping(value = "/selectSum",method = RequestMethod.GET)
     public Result<?> selectSum(){
-        return Result.ok(dyeLossService.selectSum());
-    }
+        Result.ok(dyeLossService.selectSum());
+        return Result.ok("查询成功!");
+    }*/
 
     @AutoLog(value = "按供应商名称按物料分组展现每个物料的染损")
     @ApiOperation(value="按供应商名称按物料分组展现每个物料的染损", notes="按供应商名称按物料分组展现每个物料的染损")
     @RequestMapping(value = "/vendor",method = RequestMethod.GET)
     public Result<?> vendor(@RequestParam(name="venName") String venName){
-        return Result.ok(dyeLossService.selectVendor(venName));
+       return Result.ok(dyeLossService.selectVendor(venName));
     }
 
     @AutoLog(value = "按供应商分组展现每个供应商的染损")

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/dto/DyeLossDto.java

@@ -21,10 +21,10 @@ public class DyeLossDto {
     @ApiModelProperty(value = "销售订单号")
     private String csocode;//销售订单号
 
-    @ApiModelProperty(value = "当前页面")
+    /*@ApiModelProperty(value = "当前页面")
     private Integer pageNo=1;//当前页面
 
     @ApiModelProperty(value = "页面大小")
-    private Integer pageSize=10;//页面大小
+    private Integer pageSize=10;//页面大小*/
 
 }

+ 4 - 30
jeecg-boot-module-system/src/main/java/org/jeecg/modules/scas/mapper/xml/DyeLossMapper.xml

@@ -87,8 +87,8 @@
     <select  id="selectSum" resultType="org.jeecg.modules.scas.entity.DyeLoss">
         --染损报表合计
         select  sum(OM_MODetails.iQuantity) iQuantity2,
-				sum(iReceivedQTY) iQuantity3,--入库数
-				sum(iMaterialSendQty) iMSQuantity,
+				sum(iReceivedQTY) iQuantity3,--采购入库数
+				sum(iMaterialSendQty) iMSQuantity,--材料出库数
 				sum(iMSQuantity) dyeLossRate--核销数量
         from OM_MOMain
         left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
@@ -100,25 +100,11 @@
     </select>
     
     <select id="selectVendor"  resultType="org.jeecg.modules.scas.entity.DyeLoss" parameterType="java.lang.String">--选择供应商按物料分组展现每个物料的染损
-       /*select 	Inventory.cInvName,--物料名称
-				sum(1-(iReceivedQTY/iMSQuantity)) dyeLossRate--核销数量
-				sum(iMSQuantity) iMSQuantity,--核销数量
-				sum(1-(iReceivedQTY/iMSQuantity)) dyeLossRate--染损
-        from OM_MOMain
-        left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
-        left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
-        left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
-	    left join OM_MatSettleVouch on  OM_MOMain.cCode=OM_MatSettleVouch.cMOCode
-        left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
-        where Vendor.cVCCode='0105'
-				AND cVenName=#{value}
-				GROUP BY Inventory.cInvName*/
-
         select
             cInvName,--物料名称
             iQuantity2,--入库数量
             iMSQuantity,--核销数量
-            (1-(iQuantity2/iMSQuantity)) dyeLossRate
+            (1-(iQuantity2/iMSQuantity)) dyeLossRate--染损数量
          from
         (select Inventory.cInvName,--物料名称
             sum(iReceivedQTY) iQuantity2,--入库数量
@@ -140,18 +126,6 @@
 
 
     <select id="selectCInvName"  resultType="org.jeecg.modules.scas.entity.DyeLoss">--按供应商分组展现每个供应商的染损
-       /*select 	cVenName,--供应商名称
-				sum(iReceivedQTY) iQuantity2,--入库数量
-				sum(iMSQuantity) iMSQuantity,--核销数量
-				sum(1-(iReceivedQTY/iMSQuantity)) dyeLossRate--染损
-        from OM_MOMain
-        left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
-        left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
-        left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
-				left join OM_MatSettleVouch on  OM_MOMain.cCode=OM_MatSettleVouch.cMOCode
-        left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
-        where Vendor.cVCCode='0105'
-				GROUP BY cVenName*/
 		select 	cVenName,--供应商名称
 				iQuantity2,--入库数量
 				iMSQuantity,--核销数量
@@ -166,7 +140,7 @@
             left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
             left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
             left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
-                    left join OM_MatSettleVouch on  OM_MOMain.cCode=OM_MatSettleVouch.cMOCode
+            left join OM_MatSettleVouch on  OM_MOMain.cCode=OM_MatSettleVouch.cMOCode
             left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
         where Vendor.cVCCode='0105'
         GROUP BY cVenName) p