1 年之前
父節點
當前提交
af2a1b33fb

+ 1 - 0
platform-dao/src/main/java/com/platform/dao/dto/store/InStoreFormDTO.java

@@ -24,6 +24,7 @@ import java.util.List;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
 public class InStoreFormDTO extends BaseDTO implements Serializable {
+    private List<Integer> statusList;
     /**
      * 使用公司
      */

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

@@ -20,6 +20,7 @@ import java.util.List;
  */
 @Component
 public interface InStoreFormMapper extends MyMapper<InStoreForm> {
+    List<InStoreFormVO> getInStoreFormCountByStatus(InStoreFormDTO dto);
     BigDecimal getInStoreFormCount1(InStoreFormDTO dto);
 
     InStoreFormVO getRentleInStoreForm(InStoreFormDTO dto);

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

@@ -23,6 +23,7 @@ import java.util.List;
  */
 @Component
 public interface OutStoreFormMapper extends MyMapper<OutStoreForm> {
+    List<OutStoreFormVO> getOutStoreFormCountByStatus(OutStoreFormDTO dto);
     OutStoreFormVO selectbyRepairForm(String id);
     List<OutStoreFormVO> selectLists(OutStoreFormDTO dto);
 

+ 9 - 9
platform-dao/src/main/java/com/platform/dao/vo/NoticeNumberVO.java

@@ -22,7 +22,7 @@ public class NoticeNumberVO implements Serializable {
     public NoticeNumberVO(){
         this.inTheMaintenanceNum=this.waitForDistributionNum=this.repairCheckNum=this.produceCheckNum
                 =this.finishedNum=this.unexectuedMaintenanceNum=this.allBaoYangTaskNum=this.executedTaskNum
-                =this.timeOutTaskNum=this.inStoreNum=this.outStoreNum=this.pdNum=this.dbNum
+                =this.timeOutTaskNum=this.inStoreSuccessNum=this.inStoreFailNum=this.outStoreSuccessNum=this.outStoreFailNum
                 =this.waitForExamineNum=this.waitForSignInNum=this.unreadNum
                 =this.myRepairNum=this.myCheckRepairNum =this.waitForReceiveNum=this.inTheThirdChecking=this.bigRepairChecking
                 =this.notDealNum
@@ -63,14 +63,14 @@ public class NoticeNumberVO implements Serializable {
     private BigDecimal timeOutTaskNum;
 
     //仓库
-    //入库
-    private BigDecimal inStoreNum;
-    //出库
-    private BigDecimal outStoreNum;
-    //盘点
-    private BigDecimal pdNum;
-    //调拨
-    private BigDecimal dbNum;
+    //退库成功
+    private BigDecimal inStoreSuccessNum;
+    //退库失败
+    private BigDecimal inStoreFailNum;
+    //出库成功
+    private BigDecimal outStoreSuccessNum;
+    //出库失败
+    private BigDecimal outStoreFailNum;
 
 
     //待办

+ 19 - 0
platform-dao/src/main/resources/mapper/store/InStoreFormMapper.xml

@@ -216,5 +216,24 @@ GROUP BY
         </where>
     </select>
 
+    <select id="getInStoreFormCountByStatus" parameterType="com.platform.dao.dto.store.InStoreFormDTO"
+            resultType="com.platform.dao.vo.query.store.InStoreFormVO">
+        select status,count(1) as inStoreNum from t_in_store_form form left join t_store store
+        on store.id=form.store_id
+        <where>
+            <if test="userId!=null and userId!=''">
+                store.user_id=#{userId}
+            </if>
+            <if test="statusList!=null">
+                and form.status in
+                <foreach collection="statusList" separator="," close=")" open="(" item="item">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        group by status
+
+    </select>
+
 
 </mapper>

+ 19 - 0
platform-dao/src/main/resources/mapper/store/OutStoreFormMapper.xml

@@ -311,4 +311,23 @@ outstoreform.process_instance_id,
         form.id=detail.`out_id`
     </select>
 
+    <select id="getOutStoreFormCountByStatus" parameterType="com.platform.dao.dto.store.OutStoreFormDTO"
+            resultType="com.platform.dao.vo.query.store.OutStoreFormVO">
+        select status,count(1) as outStoreNum from t_out_store_form form left join t_store store
+        on store.id=form.store_id
+        <where>
+            <if test="userId!=null and userId!=''">
+                store.user_id=#{userId}
+            </if>
+            <if test="statusList!=null">
+                and form.status in
+                <foreach collection="statusList" separator="," close=")" open="(" item="item">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        group by status
+
+    </select>
+
 </mapper>

+ 39 - 15
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -390,22 +390,46 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
 
     private NoticeNumberVO addStoreNums(NoticeNumberVO noticeNumberVO,InStoreFormDTO inStoreFormDTO,OutStoreFormDTO outStoreFormDTO,StoreCheckJobDTO storeCheckJobDTO){
         if (noticeNumberVO.getRoleFlag()!=5) {
-            BigDecimal inStoreCount = inStoreFormMapper.getInStoreFormCount1(inStoreFormDTO);
-            noticeNumberVO.setInStoreNum(inStoreCount == null ? initNum : inStoreCount);
-        }
-        //出库
-        outStoreFormDTO.setStatus(OutStoreStatusEnum.NOT_EXECUTE.getValue());
-        BigDecimal outStoreCount=outStoreFormMapper.getOutStoreFormCount1(outStoreFormDTO);
-        noticeNumberVO.setOutStoreNum(outStoreCount==null?initNum:outStoreCount);
-        if (noticeNumberVO.getRoleFlag()!=5) {
-            //盘点
-            BigDecimal storeCheckJobCount = storeCheckJobMapper.getNumByDTO(storeCheckJobDTO);
-            noticeNumberVO.setPdNum(storeCheckJobCount == null ? initNum : storeCheckJobCount);
-            //调拨,根据出入库type
-            inStoreFormDTO.setType(InStoreTypeEnum.DIAOBO_RUKU.getValue());
-            BigDecimal dbCount = inStoreFormMapper.getInStoreFormCount1(inStoreFormDTO);
-            noticeNumberVO.setDbNum(dbCount == null ? initNum : dbCount);
+            List<Integer> statusList = new ArrayList<>();
+            statusList.add(3);//推送失败
+            statusList.add(4);//推送成功
+            inStoreFormDTO.setStatusList(statusList);
+            List<InStoreFormVO> inStoreFormVOS = inStoreFormMapper.getInStoreFormCountByStatus(inStoreFormDTO);
+            if (inStoreFormVOS != null) {
+                for (InStoreFormVO vo : inStoreFormVOS) {
+                    if (vo.getStatus() == 3) {
+                        noticeNumberVO.setInStoreFailNum(vo.getInStoreNum());
+                    } else if (vo.getStatus() == 4) {
+                        noticeNumberVO.setInStoreSuccessNum(vo.getInStoreNum());
+                    }
+                }
+            }
+            //出库
+            List<Integer> statusList2 = new ArrayList<>();
+            statusList2.add(3);//推送失败
+            statusList2.add(4);//推送成功
+            outStoreFormDTO.setStatusList(statusList2);
+            List<OutStoreFormVO> outStoreFormVOS = outStoreFormMapper.getOutStoreFormCountByStatus(outStoreFormDTO);
+            if (outStoreFormVOS != null) {
+                for (OutStoreFormVO vo : outStoreFormVOS) {
+                    if (vo.getStatus() == 3) {
+                        noticeNumberVO.setOutStoreFailNum(vo.getOutStoreNum());
+                    } else if (vo.getStatus() == 4) {
+                        noticeNumberVO.setOutStoreSuccessNum(vo.getOutStoreNum());
+                    }
+                }
+            }
         }
+//        noticeNumberVO.setOutStoreNum(outStoreCount==null?initNum:outStoreCount);
+//        if (noticeNumberVO.getRoleFlag()!=5) {
+//            //盘点
+//            BigDecimal storeCheckJobCount = storeCheckJobMapper.getNumByDTO(storeCheckJobDTO);
+//            noticeNumberVO.setPdNum(storeCheckJobCount == null ? initNum : storeCheckJobCount);
+//            //调拨,根据出入库type
+//            inStoreFormDTO.setType(InStoreTypeEnum.DIAOBO_RUKU.getValue());
+//            BigDecimal dbCount = inStoreFormMapper.getInStoreFormCount1(inStoreFormDTO);
+//            noticeNumberVO.setDbNum(dbCount == null ? initNum : dbCount);
+//        }
         return noticeNumberVO;
     }