Quellcode durchsuchen

杰生迭代接口

home vor 2 Jahren
Ursprung
Commit
3a4f0c196d

+ 3 - 7
hx-service/storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java

@@ -82,13 +82,9 @@ public class SupplierController {
      *
      * @return
      */
-    @GetMapping("/statisticsClassify")
-    public R statisticsClassify(@RequestParam(required = false) String Purpose,
-                                @RequestParam(required = false) String search,
-                                @RequestParam(required = false) Integer accountDate,
-                                @RequestParam(required = false) Integer type
-    ) {
-        List<Supplier> list = supplierService.statisticsClassify(Purpose, search, accountDate, type);
+    @PostMapping("/statisticsClassify")
+    public R statisticsClassify(@RequestBody Map<String, Object> condition) {
+        List<Supplier> list = supplierService.statisticsClassify(condition);
         return R.success(list);
     }
 

+ 1 - 4
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java

@@ -78,10 +78,7 @@ public interface SupplierMapper extends BaseMapper<Supplier> {
      * @return
      */
     @TenantIgnore
-    List<Supplier> getGroupByCategory(@Param("Purpose") String Purpose,
-                                      @Param("search") String search,
-                                      @Param("accountDate") Integer accountDate,
-                                      @Param("type") Integer type);
+    List<Supplier> getGroupByCategory(Map<String, Object> condition);
 
     /**
      * 供应商详情

+ 5 - 4
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -22,8 +22,8 @@
 
         FROM
         supplier t1
-        INNER JOIN supplier_price sp ON t1.ID = sp.FactoryId
-        INNER JOIN material t3 ON t3.`Code` = sp.MaterialCode
+        LEFT JOIN supplier_price sp ON t1.ID = sp.FactoryId
+        LEFT JOIN material t3 ON t3.`Code` = sp.MaterialCode
         <include refid="list_condition"/>
         GROUP BY t1.ID
         ORDER BY t1.CreatedTime DESC
@@ -323,10 +323,11 @@
         select m.SafetyWarnDay safetyWarnDay,
                sp.FactoryId    factoryId
         from material m
-                 inner join supplier_price sp on sp.FactoryId is not null and sp.MaterialCode = m.Code
+                 inner join supplier_price sp on sp.MaterialCode = m.Code and sp.IsDelete = 0
+                 inner join supplier s on s.ID = sp.FactoryId and s.IsDelete = 0
         where m.IsDelete = 0
-          and sp.IsDelete = 0
     </select>
+
     <select id="getSafetyWarnDayBySupplier" resultType="java.util.Map">
         select m.Name          materialName,
                m.Code          materialCode,

+ 1 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/service/SupplierService.java

@@ -54,7 +54,7 @@ public interface SupplierService extends BaseService<Supplier> {
      *
      * @return
      */
-    List<Supplier> statisticsClassify(String Purpose, String search, Integer accountDate, Integer type);
+    List<Supplier> statisticsClassify(Map<String, Object> condition);
 
     /**
      * 添加

+ 2 - 8
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -114,14 +114,8 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
      * @return
      */
     @Override
-    public List<Supplier> statisticsClassify(String Purpose, String search, Integer accountDate, Integer type) {
-        if (StringUtil.equals("null", Purpose)) {
-            Purpose = null;
-        }
-        if (StringUtil.equals("null", search)) {
-            search = null;
-        }
-        return baseMapper.getGroupByCategory(Purpose, search, accountDate, type);
+    public List<Supplier> statisticsClassify(Map<String, Object> condition) {
+        return baseMapper.getGroupByCategory(condition);
     }
 
     /**