Пример #1
0
  /**
   * 复制计划填报的附件到采购需求
   *
   * @param aggReqVO 需求填报的aggvo
   * @throws LfwBusinessException
   * @author liweiqiang 2009-11-17
   */
  private void setDaAtt(AggReqVO aggReqVO) throws LfwBusinessException {

    // 计划填报主表Id
    String srcBillId = null;
    // 计划填报类型
    String srcBillType = null;
    // 计划填报子表Id
    String srcBillItemId = null;
    // 需求填报主表Id
    String tarBillId = null;
    // 需求填报类型
    String tarBillType = null;
    // 需求填报子表Id
    String tarBillItemId = null;

    // 需求填报主表VO
    ReqMainVO reqMainVO;
    // 需求填报子表VO
    ReqItemProdVO reqItemProdVO;
    // 存放需求填报的子表VO数组
    CircularlyAccessibleValueObject[] reqApplyItemList;

    IEbscgFileUploadService service = NCLocator.getInstance().lookup(IEbscgFileUploadService.class);

    // 取得需求填报主表表VO
    reqMainVO = (ReqMainVO) aggReqVO.getParentVO();

    // 需求填报主表Id
    tarBillId = reqMainVO.getPk_xq_req_main();
    // 需求填报类型
    tarBillType = reqMainVO.getBill_type();
    // 计划填报主表Id
    srcBillId = reqMainVO.getPk_jh_plan();

    // 取得需求填报子表VO数组
    reqApplyItemList = aggReqVO.getChildrenVO();

    if (reqApplyItemList != null) {
      for (int i = 0; i < reqApplyItemList.length; i++) {

        // 需求填报子表
        reqItemProdVO = (ReqItemProdVO) reqApplyItemList[i];

        // 需求填报子表Id
        tarBillItemId = reqItemProdVO.getPk_xq_req_item_prod();
        // 采购填报类型
        srcBillType = reqItemProdVO.getBill_type_src();
        // 采购填表子表ID
        srcBillItemId = reqItemProdVO.getPk_bill_item_src();

        service.copyAtt(
            srcBillId, srcBillType, srcBillItemId, tarBillId, tarBillType, tarBillItemId);
      }
    }
  }
Пример #2
0
  /**
   * 复制计划填报的供应商到采购需求
   *
   * @param aggReqVO 需求填报的aggvo
   * @author liweiqiang 2009-11-16
   * @throws BusinessException
   */
  private void setSupplier(AggReqVO aggReqVO) throws BusinessException {

    // 计划填报主表Id
    String keyPlanMain;
    // 计划填报子表Id
    String keyPlanItemProd;

    // // 需求填报主表VO
    // ReqMainVO reqMainVO;
    // 需求填报子表VO
    ReqItemProdVO reqItemProdVO;
    // 存放需求填报的子表VO数组
    CircularlyAccessibleValueObject[] reqApplyItemList;

    // 供应商管理
    ReqProdSupplierVO reqProdSupplierVO;
    // 插入需求填报的值
    ArrayList<ReqProdSupplierVO> list = new ArrayList<ReqProdSupplierVO>();

    // // 取得需求填报主表VO
    // reqMainVO = (ReqMainVO) aggReqVO.getParentVO();
    // 取得需求填报子表VO
    reqApplyItemList = aggReqVO.getChildrenVO();

    IReqQueryService reqQueryService = NCLocator.getInstance().lookup(IReqQueryService.class);

    if (reqApplyItemList != null && reqApplyItemList.length > 0) {

      for (int i = 0; i < reqApplyItemList.length; i++) {
        reqItemProdVO = (ReqItemProdVO) reqApplyItemList[i];

        // 取得计划填报主表Id
        keyPlanMain = reqItemProdVO.getPk_bill_src();
        // 取得计划填报子表Id
        keyPlanItemProd = reqItemProdVO.getPk_bill_item_src();

        List<PlanProdItemSupVO> reqAcceptSupList =
            reqQueryService.getPlanProdItemSupVO(keyPlanMain, keyPlanItemProd);

        PlanProdItemSupVO[] PlanProdItemSupVO =
            (PlanProdItemSupVO[]) reqAcceptSupList.toArray(new PlanProdItemSupVO[0]);

        for (int j = 0; j < PlanProdItemSupVO.length; j++) {

          reqProdSupplierVO = new ReqProdSupplierVO();
          // 采购需求单主键ID
          reqProdSupplierVO.setPk_xq_req_main(reqItemProdVO.getPk_xq_req_main());
          // 采购需求单明细ID
          reqProdSupplierVO.setPk_xq_req_item_prod(reqItemProdVO.getPk_xq_req_item_prod());
          // 供应商ID
          reqProdSupplierVO.setPk_supplier_id(PlanProdItemSupVO[j].getPk_supplier());
          // 供应商编码
          reqProdSupplierVO.setSupplier_code(PlanProdItemSupVO[j].getSupplier_code());
          // 供应商名称
          reqProdSupplierVO.setSupplier_name(PlanProdItemSupVO[j].getSupplier_name());
          // 供应商类型
          reqProdSupplierVO.setSupplier_type(PlanProdItemSupVO[j].getSupplier_type());
          // 推荐理由
          reqProdSupplierVO.setReason(PlanProdItemSupVO[j].getReason());
          // 备注
          reqProdSupplierVO.setMemo(PlanProdItemSupVO[j].getMemo());
          // 产品ID
          reqProdSupplierVO.setPk_prod(PlanProdItemSupVO[j].getPk_prod());
          // 产品编码
          reqProdSupplierVO.setProd_code(PlanProdItemSupVO[j].getProd_code());
          // 产品名称
          reqProdSupplierVO.setProd_name(PlanProdItemSupVO[j].getProd_name());
          // 来源单据主表ID
          reqProdSupplierVO.setPk_bill_src(reqItemProdVO.getPk_bill_src());
          // 来源单据子表ID
          reqProdSupplierVO.setPk_bill_item_src(reqItemProdVO.getPk_bill_item_src());
          // 来源单据类型
          reqProdSupplierVO.setBill_type_src(reqItemProdVO.getBill_type_src());
          // 单据状态
          reqProdSupplierVO.setStatus(VOStatus.NEW);

          list.add(reqProdSupplierVO);
        }
      }

      if (list != null && list.size() != 0) {
        // 将封装的产品档案VO数组转换为NCObject数组
        NCObject[] objList =
            Ds2NCObjectUtil.wrapVOsToNCObjects(
                (CircularlyAccessibleValueObject[])
                    list.toArray(new CircularlyAccessibleValueObject[0]));

        // 调用super.save方法保存
        super.save(objList, null);
      }
    }
  }