Quellcode durchsuchen

销售订单列表 改返回值

liuchaohui vor 2 Jahren
Ursprung
Commit
6fba9a19e4

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

@@ -174,19 +174,21 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 @AutoLog(value = "订单统计报表查询")
 	 @ApiOperation(value="订单统计报表查询", notes="订单统计报表查询")
 	 @GetMapping(value = "/getSO_SOMainReport")
-	 public Result<List<JSONObject>> getSO_SOMainReport(String vendorType,String startYearMonth,String endYearMonth,
-	 														String department,String customer){
+	 public Result<IPage<SoSoDetails>> getSO_SOMainReport(String vendorType,String startYearMonth,String endYearMonth,
+	 														String department,String customer,
+														  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize){
 		 Map<String, Object> map = new HashMap<>();
 		 map.put("startYearMonth",startYearMonth);
 		 map.put("endYearMonth",endYearMonth);
 		 map.put("vendorType",vendorType);
 		 map.put("department",department);
 		 map.put("customer",customer);
-		 Result<List<JSONObject>> result =new Result<>();
+		 Result<IPage<SoSoDetails>> result =new Result<>();
+		 Page<SoSoDetails> page = new Page<SoSoDetails>(pageNo, pageSize);
 		 try {
-			 List<Map<String,Object>> list=soSoDetailsService.getSO_SOMainReport(map);
-			 List<JSONObject> resultList = JsonChangeUtils.toJSONObject(list);
-			 result.setResult(resultList);
+			 IPage<SoSoDetails> list=soSoDetailsService.getSO_SOMainReport(page,map);
+			 result.setResult(list);
 			 result.success("查询成功");
 		 } catch (Exception e) {
 			 result.error500("查询失败:"+e.getMessage());
@@ -201,7 +203,7 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 @AutoLog(value = "订单报表统计图-部门")
 	 @ApiOperation(value="订单报表统计图-部门", notes="订单报表统计图-部门")
 	 @GetMapping(value = "/QuerySO_SOMainReportBydepartment")
-	 public Result<List<JSONObject>> QuerySO_SOMainReportBydepartment(String vendorType,String startYearMonth,String endYearMonth,
+	 public Result<List<SoSoDetails>> QuerySO_SOMainReportBydepartment(String vendorType,String startYearMonth,String endYearMonth,
 														String department){
 
 		 return null;
@@ -213,7 +215,7 @@ public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDet
 	 @AutoLog(value = "订单报表统计图-客户")
 	 @ApiOperation(value="订单报表统计图-客户", notes="订单报表统计图-客户")
 	 @GetMapping(value = "/QuerySO_SOMainReportBycustomer")
-	 public Result<List<JSONObject>> QuerySO_SOMainReportBycustomer(String vendorType,String startYearMonth,String endYearMonth,
+	 public Result<List<SoSoDetails>> QuerySO_SOMainReportBycustomer(String vendorType,String startYearMonth,String endYearMonth,
 																	 String customer){
 
 		 return null;

+ 17 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/SoSoDetails.java

@@ -27,6 +27,23 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 @Accessors(chain = true)
 @ApiModel(value="demo对象", description="订单统计报表")
 public class SoSoDetails {
+	@TableField(exist = false)
+	private String  cDepName;
+	@TableField(exist = false)
+	private String	cCusCode;
+	@TableField(exist = false)
+	private String	cVenAbbName;
+	@TableField(exist = false)
+	private String	yearMonth;
+	@TableField(exist = false)
+	private String	iNatUnitPrice;
+	@TableField(exist = false)
+	private String	iQuantity;
+	@TableField(exist = false)
+	private String	iNatMoney;
+
+
+	/*以下非订单统计报表字段,因为不知道有没有用没删除*/
     
 	/**主键ID*/
 	@TableId(type = IdType.ASSIGN_ID)

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

@@ -3,6 +3,7 @@ package org.jeecg.modules.report.mapper;
 import java.util.List;
 import java.util.Map;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.report.entity.SoSoDetails;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;

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

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.report.mapper.SoSoDetailsMapper">
-    <select id="getSO_SOMainReport" parameterType="java.util.HashMap" resultType="java.util.HashMap">
+    <select id="getSO_SOMainReport" parameterType="java.util.HashMap" resultType="org.jeecg.modules.report.entity.SoSoDetails">
         SELECT
         de.cDepName,
         v.cVCName as cCusCode,
@@ -41,11 +41,11 @@
             and cc.cCusName = #{map.customer}
         </if>
         GROUP BY de.cDepName,ss.cCusCode,v.cVenAbbName,convert(char(7),ss.dPreDateBT,120),ssd.iNatUnitPrice,v.cVCName
-        ORDER BY
-        de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ),ssd.iNatUnitPrice
+        --ORDER BY
+        --de.cDepName,ss.cCusCode,CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ),ssd.iNatUnitPrice
     </select>
 
-    <select id="QuerySO_SOMainReportBydepartment" resultType="java.util.HashMap">
+    <select id="QuerySO_SOMainReportBydepartment" resultType="org.jeecg.modules.report.entity.SoSoDetails">
         SELECT
         de.cDepName,
         case when max(ssd.cSCloser) is null then sum(ssd.iQuantity)
@@ -72,7 +72,7 @@
     </select>
 
 
-    <select id="QuerySO_SOMainReportBycustomer" resultType="java.util.HashMap">
+    <select id="QuerySO_SOMainReportBycustomer" resultType="org.jeecg.modules.report.entity.SoSoDetails">
         SELECT
         cc.cCusName,
         case when max(ssd.cSCloser) is null then sum(ssd.iQuantity)

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/ISoSoDetailsService.java

@@ -1,5 +1,6 @@
 package org.jeecg.modules.report.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.report.entity.SoSoDetails;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -19,5 +20,5 @@ public interface ISoSoDetailsService extends IService<SoSoDetails> {
      * @param map startYearMonth endYearMonth vendorType
      * @return
      */
-    List<Map<String,Object>> getSO_SOMainReport(Map<String,Object> map);
+    IPage<SoSoDetails> getSO_SOMainReport(IPage<SoSoDetails> page,Map<String, Object> map);
 }

+ 3 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/SoSoDetailsServiceImpl.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.report.service.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.jeecg.modules.report.entity.SoSoDetails;
 import org.jeecg.modules.report.mapper.SoSoDetailsMapper;
 import org.jeecg.modules.report.service.ISoSoDetailsService;
@@ -22,7 +23,7 @@ public class SoSoDetailsServiceImpl extends ServiceImpl<SoSoDetailsMapper, SoSoD
 
     @Override
     @DS("multi-one")
-    public List<Map<String, Object>> getSO_SOMainReport(Map<String, Object> map) {
-        return this.baseMapper.getSO_SOMainReport(map);
+    public IPage<SoSoDetails> getSO_SOMainReport(IPage<SoSoDetails> page,Map<String, Object> map) {
+        return this.baseMapper.getSO_SOMainReport(page,map);
     }
 }