Prechádzať zdrojové kódy

aps-交期延期预警

sucheng 2 mesiacov pred
rodič
commit
61104d87bd

+ 1 - 2
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/dao/ApsProcessOperationProcessEquDao.java

@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.rongwei.bsentity.domain.ApsDeliveryOffsetDo;
 import com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo;
-import com.rongwei.bsentity.domain.ApsProductDetailDo;
 import com.rongwei.bsentity.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -153,7 +152,7 @@ public interface ApsProcessOperationProcessEquDao extends BaseMapper<ApsProcessO
 
     List<ApsProcessOperationProcessEquDo> selectDeliveryOffestList(@Param("cardIdList") List<String> cardIdList);
 
-    List<ProductCardVo> selectProductionCards();
+    List<ProductCardVo> selectProductionCards(@Param("tenantId") String tenantId);
 
     List<ProductCardAndLatestScheduleEndDateVo> selectAllLatestEndDateByCarIds(@Param("cardIdList") List<String> cardIdList);
 

+ 11 - 7
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationProcessEquServiceImpl.java

@@ -3023,8 +3023,17 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
 
     @Override
     public R workDeliveryOffset(WorkDeliveryOffsetReq req) {
+        SysUserVo currentUser = CXCommonUtils.getCurrentUser();
+        String tenantId = "";
+        if (currentUser == null) {
+            currentUser = new SysUserVo();
+            currentUser.setId("0");
+            currentUser.setName("定时任务操作");
+        }else {
+            tenantId = CXCommonUtils.getCurrentUserFactoryId(currentUser);
+        }
         //查询所有没有交期偏差的生产卡片
-        List<ProductCardVo> list = this.baseMapper.selectProductionCards();
+        List<ProductCardVo> list = this.baseMapper.selectProductionCards(tenantId);
         if (list.isEmpty()) {
             log.info("没有查询到需要计算的卡片信息");
             return R.ok();
@@ -3054,12 +3063,7 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
                                         Integer::max
                                 )));
 
-        SysUserVo currentUser = CXCommonUtils.getCurrentUser();
-        if (currentUser == null) {
-            currentUser = new SysUserVo();
-            currentUser.setId("0");
-            currentUser.setName("定时任务操作");
-        }
+
         DateTime now = DateUtil.date();
         //需要修改或新增的集合
         List<ApsDeliveryOffsetDo> needUpdateOrInsertList = new LinkedList<>();

+ 3 - 0
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml

@@ -850,6 +850,9 @@
             aps_process_operation_process_equ
             WHERE
             DELETED = 0
+              <if test="tenantId != ''">
+                  AND TENANTID = #{tenantId}
+              </if>
         GROUP BY ROOTTASKID
         ) apope
         JOIN aps_blank_order abo ON apope.BLANKID = abo.ID