Sfoglia il codice sorgente

Merge branch 'demo_' of http://123.60.19.203:8088/hitch/hitch-sb

guarantee-lsq 3 anni fa
parent
commit
abf7162b85

+ 2 - 1
platform-dao/src/main/java/com/platform/dao/mapper/sqarepartmanage/SparePartInfoMapper.java

@@ -3,6 +3,7 @@ package com.platform.dao.mapper.sqarepartmanage;
 import com.platform.dao.config.MyMapper;
 import com.platform.dao.dto.repair.RepairFeeDTO;
 import com.platform.dao.dto.sqarepartmanage.SparePartInfoDTO;
+import com.platform.dao.dto.store.StoreDTO;
 import com.platform.dao.entity.sqarepartmanage.SparePartInfo;
 import com.platform.dao.vo.query.repair.RepairFeeVO;
 import com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO;
@@ -65,5 +66,5 @@ public interface SparePartInfoMapper extends MyMapper<SparePartInfo> {
      * @param model
      * @return
      */
-    List<SparePartInfoVO> listForWorkplace();
+    List<SparePartInfoVO> listForWorkplace(StoreDTO storeDTO);
 }

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/mapper/store/InStoreFormMapper.java

@@ -26,7 +26,7 @@ public interface InStoreFormMapper extends MyMapper<InStoreForm> {
      */
     List<InStoreFormVO> selectList(InStoreFormDTO dto);
 
-    List<InStoreFormVO> getInStoreDetailVOs();
+    List<InStoreFormVO> getInStoreDetailVOs(InStoreFormDTO inStoreFormDTO);
 
     /**
      * 查看入库详情

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/mapper/store/OutStoreFormMapper.java

@@ -28,7 +28,7 @@ public interface OutStoreFormMapper extends MyMapper<OutStoreForm> {
      */
     List<OutStoreFormVO> selectList(OutStoreFormDTO dto);
 
-    List<OutStoreFormVO> selectOutStoreList();
+    List<OutStoreFormVO> selectOutStoreList(OutStoreFormDTO outStoreFormDTO);
 
     /**
      * 查询详情列表

+ 12 - 2
platform-dao/src/main/resources/mapper/sqarepartmanage/SparePartInfoMapper.xml

@@ -340,9 +340,19 @@ warn_status,forecast_status,
         </where>
     </select>
 
-    <select id="listForWorkplace" resultType="com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO">
+    <select id="listForWorkplace" parameterType="com.platform.dao.dto.store.StoreDTO"
+            resultType="com.platform.dao.vo.query.sparepartmanage.SparePartInfoVO">
 select t.currentStock as currentStock,spareType.name from
 (select SUM(spareStore.num) as currentStock,partInfo.type_id from t_spare_part_info partInfo join t_spare_store spareStore
-on partInfo.id = spareStore.spare_id GROUP BY partInfo.type_id) t join t_spare_type spareType on t.type_id = spareType.id
+on partInfo.id = spareStore.spare_id
+JOIN t_store store
+ON store.id=spareStore.store_id
+<where>
+    <if test="userId!=null">
+        user_id=#{userId}
+    </if>
+</where>
+
+GROUP BY partInfo.type_id) t join t_spare_type spareType on t.type_id = spareType.id
     </select>
 </mapper>

+ 6 - 1
platform-dao/src/main/resources/mapper/store/InStoreDetailMapper.xml

@@ -160,8 +160,13 @@
         select * from t_in_store_detail left join
         t_in_store_form
         on t_in_store_form.id = t_in_store_detail.in_id
+        left join
+        t_store
+        on t_in_store_form.store_id=t_store.id
         <where>
-
+            <if test="userId!=null">
+                and user_id=#{userId}
+            </if>
             <if test="searchStartTime != null">
                 and t_in_store_detail.created_time <![CDATA[ > ]]> #{searchStartTime}
             </if>

+ 9 - 2
platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml

@@ -164,8 +164,15 @@
             resultType="com.platform.dao.vo.query.store.InStoreFormVO">
         SELECT detail.type, COUNT(*) instorenum FROM `t_in_store_form` form JOIN `t_in_store_detail` detail
 ON form.id=detail.`in_id`
-WHERE
-STATUS=1
+        join t_store store on store.id=form.store_id
+        <where>
+            <if test="status!=null">
+                and status=1
+            </if>
+            <if test="userId!=null">
+                and user_id=#{userId}
+            </if>
+        </where>
 GROUP BY
 detail.type
 

+ 6 - 0
platform-dao/src/main/resources/mapper/store/OutStoreDetailMapper.xml

@@ -164,7 +164,13 @@
         t_out_store_form
         on
         t_out_store_form.id = t_out_store_detail.out_id
+        left join
+        t_store
+        on t_out_store_form.store_id=t_store.id
         <where>
+            <if test="userId!=null">
+                and user_id=#{userId}
+            </if>
 
             <if test="searchStartTime != null">
                 and t_out_store_detail.created_time <![CDATA[ > ]]> #{searchStartTime}

+ 10 - 2
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -143,8 +143,16 @@
             resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
  SELECT form.type, COUNT(*) outstorenum FROM `t_out_store_form` form JOIN `t_out_store_detail` detail
     ON form.id=detail.`out_id`
-    WHERE
-    STATUS=1
+    join t_store store on store.id=form.store_id
+    <where>
+        <if test="status!=null">
+            and status=1
+        </if>
+        <if test="userId!=null">
+            and user_id=#{userId}
+        </if>
+    </where>
+
     GROUP BY
     form.type
     </select>

+ 4 - 1
platform-service/src/main/java/com/platform/service/sqarepartmanage/impl/SparePartInfoServiceImpl.java

@@ -16,6 +16,7 @@ import com.platform.dao.dto.repair.RepairFeeDTO;
 import com.platform.dao.dto.sb.SbModelSpareBomDTO;
 import com.platform.dao.dto.sqarepartmanage.SparePartInfoDTO;
 import com.platform.dao.dto.sqarepartmanage.SparePartUsedDTO;
+import com.platform.dao.dto.store.StoreDTO;
 import com.platform.dao.entity.check.CheckJob;
 import com.platform.dao.entity.sb.SbModel;
 import com.platform.dao.entity.sb.SbModelSpareBom;
@@ -1239,7 +1240,9 @@ public class SparePartInfoServiceImpl extends BaseServiceImpl<SparePartInfoMappe
 
     @Override
     public List<SparePartInfo1VO> listForWorkplacePie(String userId, String searchTime) {
-        List<SparePartInfoVO> sparePartInfoVOS = mapper.listForWorkplace() == null ? new ArrayList<>() : mapper.listForWorkplace();
+        StoreDTO storeDTO=new StoreDTO();
+        storeDTO.setUserId(userId);
+        List<SparePartInfoVO> sparePartInfoVOS = mapper.listForWorkplace(storeDTO) == null ? new ArrayList<>() : mapper.listForWorkplace(storeDTO);
         List<SparePartInfo1VO> sparePartInfo1VOS=new ArrayList<>();
         for(SparePartInfoVO vo:sparePartInfoVOS){
             SparePartInfo1VO sparePartInfo1VO=new SparePartInfo1VO();

+ 2 - 2
platform-service/src/main/java/com/platform/service/store/impl/InStoreFormServiceImpl.java

@@ -144,8 +144,8 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
         queryDTO.setUserId(userId);
         OutStoreFormDTO queryDTO2=new OutStoreFormDTO();
         queryDTO2.setUserId(userId);
-        List<OutStoreFormVO> outStoreFormVOS=outStoreFormMapper.selectOutStoreList();
-        List<InStoreFormVO> inStoreFormVOS=inStoreFormMapper.getInStoreDetailVOs();
+        List<OutStoreFormVO> outStoreFormVOS=outStoreFormMapper.selectOutStoreList(queryDTO2);
+        List<InStoreFormVO> inStoreFormVOS=inStoreFormMapper.getInStoreDetailVOs(queryDTO);
         StoreWorkBenchVO storeWorkBenchVO=new StoreWorkBenchVO();
         BigDecimal num=new BigDecimal(0);
         BigDecimal purchaseNum=new BigDecimal(0);