Browse Source

销售订单报表查询 部门 客户

liuchaohui 3 years ago
parent
commit
2e7fa3b670

+ 4 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/controller/SoSoDetailsController.java

@@ -174,11 +174,14 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 @AutoLog(value = "订单统计报表查询")
 	 @AutoLog(value = "订单统计报表查询")
 	 @ApiOperation(value="订单统计报表查询", notes="订单统计报表查询")
 	 @ApiOperation(value="订单统计报表查询", notes="订单统计报表查询")
 	 @GetMapping(value = "/getSO_SOMainReport")
 	 @GetMapping(value = "/getSO_SOMainReport")
-	 public Result<List<JSONObject>> getSO_SOMainReport(String vendorType,String startYearMonth,String endYearMonth){
+	 public Result<List<JSONObject>> getSO_SOMainReport(String vendorType,String startYearMonth,String endYearMonth,
+	 														String department,String customer){
 		 Map<String, Object> map = new HashMap<>();
 		 Map<String, Object> map = new HashMap<>();
 		 map.put("startYearMonth",startYearMonth);
 		 map.put("startYearMonth",startYearMonth);
 		 map.put("endYearMonth",endYearMonth);
 		 map.put("endYearMonth",endYearMonth);
 		 map.put("vendorType",vendorType);
 		 map.put("vendorType",vendorType);
+		 map.put("department",department);
+		 map.put("customer",customer);
 		 Result<List<JSONObject>> result =new Result<>();
 		 Result<List<JSONObject>> result =new Result<>();
 		 try {
 		 try {
 			 List<Map<String,Object>> list=soSoDetailsService.getSO_SOMainReport(map);
 			 List<Map<String,Object>> list=soSoDetailsService.getSO_SOMainReport(map);

+ 7 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/SoSoDetailsMapper.xml

@@ -16,6 +16,7 @@
         LEFT JOIN SO_SODetails ssd ON ss.ID= ssd.ID
         LEFT JOIN SO_SODetails ssd ON ss.ID= ssd.ID
         left join Vendor v on ss.cCusCode=v.cVenCode
         left join Vendor v on ss.cCusCode=v.cVenCode
         left join Department de on ss.cDepCode=de.cDepCode
         left join Department de on ss.cDepCode=de.cDepCode
+        left join Customer cc on ss.cCusCode = cc.cCusCode
         WHERE
         WHERE
         CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{map.startYearMonth}
         CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{map.startYearMonth}
         AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{map.endYearMonth}
         AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{map.endYearMonth}
@@ -25,6 +26,12 @@
         <if test="map.vendorType!=null and map.vendorType!='' and map.vendorType=='外部'">
         <if test="map.vendorType!=null and map.vendorType!='' and map.vendorType=='外部'">
             and (v.cVenAbbName  <![CDATA[ <> ]]> '宁波森语' and  v.cVenAbbName <![CDATA[ <> ]]> '马菲羊' and  v.cVenAbbName <![CDATA[ <> ]]> '森语集团')
             and (v.cVenAbbName  <![CDATA[ <> ]]> '宁波森语' and  v.cVenAbbName <![CDATA[ <> ]]> '马菲羊' and  v.cVenAbbName <![CDATA[ <> ]]> '森语集团')
         </if>
         </if>
+        <if test="map.department!=null and map.department!='' ">
+            and de.cDepName = #{map.department}
+        </if>
+        <if test="map.customer!=null and map.customer!='' ">
+            and cc.cCusName = #{map.customer}
+        </if>
         GROUP BY de.cDepName,ss.cCusCode,v.cVenAbbName,convert(char(7),ss.dPreDateBT,120),ssd.iNatUnitPrice
         GROUP BY de.cDepName,ss.cCusCode,v.cVenAbbName,convert(char(7),ss.dPreDateBT,120),ssd.iNatUnitPrice
         ORDER BY
         ORDER BY
         de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ),ssd.iNatUnitPrice
         de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ),ssd.iNatUnitPrice