yumeng 5 maanden geleden
bovenliggende
commit
8c0ecb5daf

+ 14 - 9
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KwaiXiaoDianReportController.java

@@ -858,7 +858,7 @@ public class KwaiXiaoDianReportController {
 
 
     @GetMapping("/getSaleDetail")
-    public TableDataInfo getSaleDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId) {
+    public TableDataInfo getSaleDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId, Long itemId, String itemTitle) {
         TableDataInfo rspData = new TableDataInfo();
         try {
             Map<String, Object> requestMap = new HashMap<>();
@@ -878,7 +878,12 @@ public class KwaiXiaoDianReportController {
             Long end = DateUtils.strDateToInt(endDate);
             requestMap.put("start", start);
             requestMap.put("end", end);
-
+            if (!Check.isNull(itemId)) {
+                requestMap.put("itemId", itemId);
+            }
+            if (!Check.isNull(itemTitle)) {
+                requestMap.put("itemTitle", itemTitle);
+            }
 
             startPage(pageNum, pageSize);
             List<JSONObject> list = kwaiXiaoDianReportService.getSaleDetail(requestMap);
@@ -904,7 +909,6 @@ public class KwaiXiaoDianReportController {
         if (Check.isNull(endDate)) {
             return;
         }
-
         Map<String, Object> requestMap = new HashMap<>();
         if (!Check.isNull(userId)) {
             requestMap.put("userId", userId);
@@ -922,10 +926,7 @@ public class KwaiXiaoDianReportController {
         Long end = DateUtils.strDateToInt(endDate);
         requestMap.put("start", start);
         requestMap.put("end", end);
-
-
         List<JSONObject> list = kwaiXiaoDianReportService.getSaleDetail(requestMap);
-
         List<List<Object>> exportList = new ArrayList<>();
         if (!Check.isNull(list)) {
             for (int i = 0; i < list.size(); i++) {
@@ -1068,7 +1069,7 @@ public class KwaiXiaoDianReportController {
 
 
     @GetMapping("/getPurchaseDetail")
-    public TableDataInfo getPurchaseDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId) {
+    public TableDataInfo getPurchaseDetail(String startDate, String endDate, Long userId, Integer pageNum, Integer pageSize, Long loginUserId, Long itemId, String itemTitle) {
         TableDataInfo rspData = new TableDataInfo();
         try {
 
@@ -1089,8 +1090,12 @@ public class KwaiXiaoDianReportController {
             Long end = DateUtils.strDateToInt(endDate);
             requestMap.put("start", start);
             requestMap.put("end", end);
-
-
+            if (!Check.isNull(itemId)) {
+                requestMap.put("itemId", itemId);
+            }
+            if (!Check.isNull(itemTitle)) {
+                requestMap.put("itemTitle", itemTitle);
+            }
             startPage(pageNum, pageSize);
             List<JSONObject> list = kwaiXiaoDianReportService.getPurchaseDetail(requestMap);
             rspData.setCode(HttpStatus.SUCCESS);

+ 12 - 0
ruixuan-live/src/main/resources/mapper/isc/KwaiXiaoDianReportMapper.xml

@@ -1000,7 +1000,13 @@
         <if test='companyId != null'>
             and t1.company_id = #{companyId}
         </if>
+        <if test='itemId != null and itemId != ""'>
+            and t1.item_id = #{itemId}
+        </if>
 
+        <if test='itemTitle != null and itemTitle != ""'>
+            and t1.item_title like concat('%',#{itemTitle},'%')
+        </if>
         <if test='userId != null '>
             and t2.user_id = #{userId}
         </if>
@@ -1096,6 +1102,12 @@
         <if test='companyId != null'>
             and t1.company_id = #{companyId}
         </if>
+        <if test='itemId != null and itemId != ""'>
+            and t1.item_id = #{itemId}
+        </if>
+        <if test='itemTitle != null and itemTitle != ""'>
+            and t1.item_title like concat('%',#{itemTitle},'%')
+        </if>
         <if test='userId != null '>
             and t2.courtship_purchase_id = #{userId}
         </if>