xiejun
2023-10-13 815c6be8d063ca1ec89079722d265585f7d3602c
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -2363,8 +2363,11 @@
//      cbo.getData().putAll(orderDTO.getData());
        cbo.setLastModifyTime(new Date());
        cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId()));
        updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo));
        batchSaveSelectChar(templateVO, Collections.singletonList(cbo));
      R r = updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo));
      if(!r.isSuccess()){
         throw new ServiceException(r.getMsg());
      }
      batchSaveSelectChar(templateVO, Collections.singletonList(cbo));
    }
    /**
@@ -2402,7 +2405,7 @@
        }
        //只能删除自己创建的数据
        String userId = String.valueOf(AuthUtil.getUser().getUserId());
        String userId = String.valueOf(AuthUtil.getUser().getAccount());
        for (BaseModel clientBusinessObject : cboList) {
            String creator = clientBusinessObject.getCreator();
            if (!userId.equalsIgnoreCase(creator)) {
@@ -3522,6 +3525,42 @@
        });
        return commonsMapper.insertByBaseModel(listR.getData().get(0).getTableName(), maps.get(0), maps);
    }
   /**
    * 传入业务类型以及ID查询业务表数据是否重复
    *
    * @param btmType 业务类型
    * @param ids      处理数据
    * @return 查询到数据的总数
    */
    @Override
    public Integer selectIdsCounts(String btmType, List<String> ids) {
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
      return commonsMapper.queryCountBySql("select count(*) from " +
         listR.getData().get(0).getTableName() + " where id in ("+ ids.stream().map(s -> "'" + s + "'").collect(Collectors.joining(",")) +")");
    }
   /**
    * 传入业务类型以及ID、OID查询业务表数据是否重复
    *
    * @param btmType 业务类型
    * @param id      处理数据id
    * @param oid      处理数据oid
    * @return 查询到数据的总数
    */
   @Override
   public Integer selectIdAndOidCounts(String btmType, String id, String oid) {
      //使用传入的业务类型查询表
      R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
      return commonsMapper.queryCountBySql("select count(*) from " +
         listR.getData().get(0).getTableName() + " where id ='" + id + "' and oid <> '" + oid + "'");
   }
    /**
     * 传入业务类型以及相oid集合查询数据进行返回