Przeglądaj źródła

fix: 完善查看更多跳转问题

xucaiqin 4 miesięcy temu
rodzic
commit
183fc910aa

+ 1 - 1
sckw-common/sckw-common-core/src/main/java/com/sckw/core/utils/StringUtils.java

@@ -859,4 +859,4 @@ public class StringUtils {
         m.put("pwd", "zhong");
         System.out.println(replace1(template, m));
     }
-}
+}

+ 1 - 2
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java

@@ -9,7 +9,6 @@ import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.CompletionStage;
 
 /**
  * @author czh
@@ -146,7 +145,7 @@ public interface RemoteContractService {
 
     List<TradeContractGoodsDto> queryContractGoodsByContractIds(Set<Long> contractIds, Set<Long> goodsIds);
     Long queryTradeCount();
-    Long queryLogisticsCount();
+    Long queryLogisticsCount(Long entId,Integer type);
     ContractCountVo contractCount();
 
     List<ContractVo> tradeList();

+ 11 - 5
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java

@@ -497,7 +497,7 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     @Override
     public TradeContractGoodsDto queryContractGoodsByContractId(Long contractId, Long goodsId) {
         KwcContractTradeGoods contractTradeGoods = kwcContractTradeGoodsRepository.queryByContractIdAndGoodsId(contractId, goodsId);
-        if(Objects.isNull(contractTradeGoods)){
+        if (Objects.isNull(contractTradeGoods)) {
             return new TradeContractGoodsDto();
         }
         TradeContractGoodsDto tradeContractGoodsDto = new TradeContractGoodsDto();
@@ -509,10 +509,10 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     @Override
     public List<TradeContractGoodsDto> queryContractGoodsByContractIds(Set<Long> contractIds, Set<Long> goodsIds) {
         List<KwcContractTradeGoods> contractTradeGoods = kwcContractTradeGoodsRepository.queryByContractIdsAndGoodsIds(contractIds, goodsIds);
-        if(Objects.isNull(contractTradeGoods)){
+        if (Objects.isNull(contractTradeGoods)) {
             return List.of();
         }
-       return contractTradeGoods.stream().map(contractTrade -> {
+        return contractTradeGoods.stream().map(contractTrade -> {
             TradeContractGoodsDto tradeContractGoodsDto = new TradeContractGoodsDto();
             tradeContractGoodsDto.setContractId(contractTrade.getContractId());
             tradeContractGoodsDto.setGoodsId(contractTrade.getGoodsId());
@@ -534,8 +534,14 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     }
 
     @Override
-    public Long queryLogisticsCount() {
-        ContractStatusCountResp contractStatusCountResp = kwcContractLogisticsService.queryLogisticContractStatusCount(new QueryLogisticListReq());
+    public Long queryLogisticsCount(Long entId, Integer type) {
+        QueryLogisticListReq queryLogisticListReq = new QueryLogisticListReq();
+        if(Objects.equals(type,3)){
+            queryLogisticListReq.setCarriageCompanyId(String.valueOf(entId));
+        }else {
+            queryLogisticListReq.setConsignCompanyId(String.valueOf(entId));
+        }
+        ContractStatusCountResp contractStatusCountResp = kwcContractLogisticsService.queryLogisticContractStatusCount(queryLogisticListReq);
         List<ContractStatusCountResp.ContractStatusCount> contractStatusInfo = contractStatusCountResp.getContractStatusInfo();
         if (CollUtil.isEmpty(contractStatusInfo)) {
             return 0L;

+ 4 - 8
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/KwmMessageUserService.java

@@ -123,7 +123,7 @@ public class KwmMessageUserService {
      */
     public List<KwmMessageUser> getByMsgIds(List<Long> ids) {
         LambdaQueryWrapper<KwmMessageUser> wrapper = new LambdaQueryWrapper<>();
-        wrapper.in(KwmMessageUser::getId, ids)
+        wrapper.in(KwmMessageUser::getMsgId, ids)
                 .eq(KwmMessageUser::getDelFlag, Global.NO);
         Integer isMain = LoginUserHolder.getIsMain();
         if (Objects.equals(isMain, 1)) {
@@ -145,13 +145,9 @@ public class KwmMessageUserService {
     public void readByMsgIds(List<Long> ids) {
         LambdaUpdateWrapper<KwmMessageUser> wrapper = new LambdaUpdateWrapper<>();
         wrapper.set(KwmMessageUser::getStatus, Global.YES)
-                .in(KwmMessageUser::getId, ids);
-        Integer isMain = LoginUserHolder.getIsMain();
-        if (Objects.equals(isMain, 1)) {
-            wrapper.eq(KwmMessageUser::getEntId, LoginUserHolder.getEntId());
-        } else {
-            wrapper.eq(KwmMessageUser::getUserId, LoginUserHolder.getUserId());
-        }
+                .in(KwmMessageUser::getMsgId, ids);
+        wrapper.eq(KwmMessageUser::getEntId, LoginUserHolder.getEntId());
+        wrapper.eq(KwmMessageUser::getUserId, LoginUserHolder.getUserId());
         kwmMessageUserMapper.update(null, wrapper);
     }
 

+ 0 - 5
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/MessageService.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson2.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
-import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.model.vo.TableBottom;
@@ -69,10 +68,6 @@ public class MessageService {
     @Transactional(rollbackFor = Exception.class)
     public void read(ReadMessagesReqVO reqVO) {
         List<Long> ids = StringUtils.splitStrToList(reqVO.getIds(), Long.class);
-        List<KwmMessageUser> msgList = kwmMessageUserService.getByMsgIds(ids);
-        if (!Objects.equals(ids.size(), msgList.size())) {
-            throw new BusinessException("无权限读取消息!");
-        }
         kwmMessageUserService.readByMsgIds(ids);
     }
 

+ 10 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsMenuService.java

@@ -622,7 +622,16 @@ public class KwsMenuService {
                             continue;
                         }
                         if (StrUtil.equals(child.getName(), "物流合同") && hasPerm(child.getChildren(), "logisticsContract:sign")) {
-                            Long aLong = remoteContractService.queryLogisticsCount();
+                            Long entId = LoginUserHolder.getEntId();
+                            Long aLong = 0L;
+                            List<EntTypeResDto> entTypeResDtoList = remoteBaseService.queryEntTypeById(entId);
+                            if (CollectionUtils.isNotEmpty(entTypeResDtoList)) {
+                                EntTypeResDto entTypeResDto = entTypeResDtoList.get(0);
+                                Integer type = entTypeResDto.getType();
+                                if (Objects.nonNull(type) && !Objects.equals(type, 1)) {
+                                    aLong = remoteContractService.queryLogisticsCount(entId, type);
+                                }
+                            }
                             child.setCount(aLong);
                             sum = sum + aLong;
                             total = total + aLong;