zhangyuewww vor 3 Jahren
Ursprung
Commit
e864e54f9e

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -247,6 +247,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
         String beforeDay=now.format(c.getTime());
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("beforeDay", beforeDay);
+        pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
         //成本
         List<WarehousingOrder> costList = baseMapper.getGoodCostListByCondition(pageView);
         //收购

+ 6 - 10
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -760,17 +760,13 @@
         LEFT JOIN expense_info ei ON ei.warehouse_id = w.id and ei.delete_flag = '0'
         AND ei.expenses_type = '2'
         AND ei.expenses_purpose = '3'
+        AND (DATE_FORMAT(ei.create_date,"%Y%m%d") &gt;=
+        DATE_FORMAT(#{startDate},"%Y%m%d"))
+        AND (DATE_FORMAT(ei.create_date,"%Y%m%d") &lt;=
+        DATE_FORMAT(#{endDate},"%Y%m%d"))
         WHERE
         w.comp_id = #{compId}
         AND w.warehouse_type = '1'
-        <if test="startDate != null">
-            AND (DATE_FORMAT(ei.create_date,"%Y%m%d") &gt;=
-            DATE_FORMAT(#{startDate},"%Y%m%d"))
-        </if>
-        <if test="endDate != null">
-            AND (DATE_FORMAT(ei.create_date,"%Y%m%d") &lt;=
-            DATE_FORMAT(#{endDate},"%Y%m%d"))
-        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(w.warehouse_name) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
@@ -817,7 +813,7 @@
             AND (DATE_FORMAT(pm.create_date,"%Y%m%d") &lt;=
             DATE_FORMAT(#{endDate},"%Y%m%d"))
         GROUP BY
-        wioi.goods_name;
+        pm.goods_name;
     </select>
     <!-- 库点利润表 -->
     <select id="getWarehouseFormByCondition" parameterType="Map"
@@ -845,7 +841,7 @@
             warehouse_in_out_info wioi
                 LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
                 AND wbi.delete_flag = 0
-                LEFT JOIN warehousing_order war ON war.base_id = w.id  AND war.in_type = '收购入库'
+                LEFT JOIN warehousing_order war ON war.base_id = wbi.id  AND war.in_type = '收购入库'
                 AND war.comp_id = wbi.comp_id
                 AND war.delete_flag = '0'
                 LEFT JOIN source_relation_info sri ON sri.source_id = war.id