Ejemplo n.º 1
0
  // 点击保存
  @RequestMapping("AddDtlSubmit")
  public String AddDtlSubmit(Model model, FTZ210205Form form, BindingResult result) {
    logger.info("买入返售资产录入批量录入开始...");

    // 获取录入信息
    FtzInMsgCtl insert_FtzInMsgCtl = form.getFtzInMsgCtl();

    // 开始校验
    ResultMessages resultMessages = ResultMessages.error();
    // 申请日期
    if (null == insert_FtzInMsgCtl.getSubmitDate()
        || "".equals(insert_FtzInMsgCtl.getSubmitDate().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0012");
      resultMessages.add(resultMessage);
    }
    // 主账号
    if (null == insert_FtzInMsgCtl.getAccountNo()
        || "".equals(insert_FtzInMsgCtl.getAccountNo().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0033");
      resultMessages.add(resultMessage);
    }
    // 资产负债指标代码
    if (null == insert_FtzInMsgCtl.getBalanceCode()
        || "".equals(insert_FtzInMsgCtl.getBalanceCode().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0007");
      resultMessages.add(resultMessage);
    }
    // 货币
    if (null == insert_FtzInMsgCtl.getCurrency()
        || "".equals(insert_FtzInMsgCtl.getCurrency().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0009");
      resultMessages.add(resultMessage);
    }
    // 日终余额
    if (null == insert_FtzInMsgCtl.getBalance()) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0010");
      resultMessages.add(resultMessage);
    } else {
      if (!Validator.CheckAmount(insert_FtzInMsgCtl.getBalance())) {
        ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210303.0013");
        resultMessages.add(resultMessage);
      }
    }

    // 开户机构代码
    if (null == insert_FtzInMsgCtl.getAccOrgCode()
        || "".equals(insert_FtzInMsgCtl.getAccOrgCode().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210303.0002");
      resultMessages.add(resultMessage);
    }
    if (resultMessages.isNotEmpty()) {
      model.addAttribute(resultMessages);
      return "ftzmis/FTZ210205_Input_Dtl";
    }

    insert_FtzInMsgCtl.setMsgId(numberService.getSysIDSequence("", 8));
    insert_FtzInMsgCtl.setSubmitDate(
        DateUtil.getFormatDateRemoveSprit(insert_FtzInMsgCtl.getSubmitDate()));
    insert_FtzInMsgCtl.setWorkDate(procCommonService.queryWorkDate());

    UserInf userInfo = ContextConst.getCurrentUser();
    insert_FtzInMsgCtl.setMakUserId(userInfo.getUserid());
    insert_FtzInMsgCtl.setMakDatetime(DateUtil.getNowInputDateTime());
    insert_FtzInMsgCtl.setTotalCount(0);
    insert_FtzInMsgCtl.setMsgStatus(CommonConst.FTZ_MSG_STATUS_INPUTING);
    insert_FtzInMsgCtl.setMsgNo(CommonConst.MSG_NO_210205);
    // 插入信息
    insert_FtzInMsgCtl.setBalanceCode(insert_FtzInMsgCtl.getBalanceCode().trim());
    int i = ftz210205Serv.insertFtzInMsgCtl(insert_FtzInMsgCtl);
    if (i < 1) {
      model.addAttribute(ResultMessages.error().add("e.sysrunner.0006"));
    } else {
      model.addAttribute(ResultMessages.success().add("i.ftzmis.2101.0001"));
    }
    form.getFtzInMsgCtl()
        .setSubmitDate(DateUtil.getFormatDateAddSprit(form.getFtzInMsgCtl().getSubmitDate()));
    logger.info("买入返售资产录入批量录入结束...");
    form.setInput_flag("upt");
    model.addAttribute("pageUrl", "/FTZ210205/UptDtlInit");
    return "ftzmis/FTZ210205_Input_Dtl";
  }
Ejemplo n.º 2
0
  // 修改之后点击保存
  @RequestMapping("UptDtlSubmit")
  public String UptDtlSubmit(
      Model model, FTZ210205Form form, BindingResult result, @PageableDefaults Pageable pageable) {
    FtzInMsgCtl update_FtzInMsgCtl = form.getFtzInMsgCtl();

    // 开始校验
    ResultMessages resultMessages = ResultMessages.error();
    // 申请日期
    if (null == update_FtzInMsgCtl.getSubmitDate()
        || "".equals(update_FtzInMsgCtl.getSubmitDate().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0012");
      resultMessages.add(resultMessage);
    }
    // 主账号
    if (null == update_FtzInMsgCtl.getAccountNo()
        || "".equals(update_FtzInMsgCtl.getAccountNo().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0033");
      resultMessages.add(resultMessage);
    }

    // 资产负债指标代码
    if (null == update_FtzInMsgCtl.getBalanceCode()
        || "".equals(update_FtzInMsgCtl.getBalanceCode().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0007");
      resultMessages.add(resultMessage);
    }

    // 货币
    if (null == update_FtzInMsgCtl.getCurrency()
        || "".equals(update_FtzInMsgCtl.getCurrency().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0009");
      resultMessages.add(resultMessage);
    }

    // 日终余额
    if (null == update_FtzInMsgCtl.getBalance()) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0010");
      resultMessages.add(resultMessage);
    } else {
      if (!Validator.CheckAmount(update_FtzInMsgCtl.getBalance())) {
        ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210303.0013");
        resultMessages.add(resultMessage);
      }
    }

    // 开户机构代码
    if (null == update_FtzInMsgCtl.getAccOrgCode()
        || "".equals(update_FtzInMsgCtl.getAccOrgCode().trim())) {
      ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210106.0003");
      resultMessages.add(resultMessage);
    }
    if (resultMessages.isNotEmpty()) {
      model.addAttribute(resultMessages);
      // 清空页面列表选择Key
      form.setSelected_msgId("");
      form.setSelected_seqNo(null);
      model.addAttribute("pageUrl", "/FTZ210205/UptDtlInit");
      return "ftzmis/FTZ210205_Input_Dtl";
    }
    UserInf userInfo = ContextConst.getCurrentUser();
    update_FtzInMsgCtl.setMsgStatus(CommonConst.FTZ_MSG_STATUS_INPUTING);
    update_FtzInMsgCtl.setMakUserId(userInfo.getUserid());
    update_FtzInMsgCtl.setRsv1(
        DateUtil.getFormatDateTimeRemoveSpritAndColon(update_FtzInMsgCtl.getMakDatetime()));
    update_FtzInMsgCtl.setRsv2(
        DateUtil.getFormatDateTimeRemoveSpritAndColon(update_FtzInMsgCtl.getChkDatetime()));
    update_FtzInMsgCtl.setMakDatetime(DateUtil.getNowInputDateTime());
    update_FtzInMsgCtl.setSubmitDate(
        DateUtil.getFormatDateRemoveSprit(update_FtzInMsgCtl.getSubmitDate()));
    int i = ftz210205Serv.updateFtzInMsgCtl(update_FtzInMsgCtl, null);
    if (i < 1) {
      model.addAttribute(ResultMessages.error().add("e.sysrunner.0003"));
      form.setFtzInMsgCtl(ftz210205Serv.queryFtzInMsgCtl(update_FtzInMsgCtl));
      form.getFtzInMsgCtl()
          .setSubmitDate(DateUtil.getFormatDateAddSprit(form.getFtzInMsgCtl().getSubmitDate()));
      FtzInTxnDtl query_FtzInTxnDtl = new FtzInTxnDtl();
      query_FtzInTxnDtl.setMsgId(update_FtzInMsgCtl.getMsgId());
      // 查询明细数据列表
      Page<FtzInTxnDtl> page = ftz210205Serv.queryFtzInTxnDtlPage(pageable, query_FtzInTxnDtl);
      if (page.getContent().size() > 0) {
        List<FtzInTxnDtl> ftzInTxnDtls = page.getContent();
        for (FtzInTxnDtl ftzInTxnDtl : ftzInTxnDtls) {
          ftzInTxnDtl.setTranDate(DateUtil.getFormatDateAddSprit(ftzInTxnDtl.getTranDate()));
        }
        model.addAttribute("page", page);
      }
      // 清空页面列表选择Key
      form.setSelected_msgId("");
      form.setSelected_seqNo(null);
      model.addAttribute("pageUrl", "/FTZ210205/UptDtlInit");
      return "ftzmis/FTZ210205_Input_Dtl";
    } else {
      model.addAttribute(ResultMessages.success().add("ftzmis.Update.Msg.Ctl.Success"));
    }
    form.getFtzInMsgCtl()
        .setSubmitDate(DateUtil.getFormatDateAddSprit(form.getFtzInMsgCtl().getSubmitDate()));
    form.setSelected_msgId("");
    FtzInTxnDtl query_FtzInTxnDtl = new FtzInTxnDtl();
    query_FtzInTxnDtl.setMsgId(form.getFtzInMsgCtl().getMsgId());
    // 查询明细数据列表
    Page<FtzInTxnDtl> page = ftz210205Serv.queryFtzInTxnDtlPage(pageable, query_FtzInTxnDtl);
    if (page.getContent().size() > 0) {
      List<FtzInTxnDtl> ftzInTxnDtls = page.getContent();
      for (FtzInTxnDtl ftzInTxnDtl : ftzInTxnDtls) {
        ftzInTxnDtl.setTranDate(DateUtil.getFormatDateAddSprit(ftzInTxnDtl.getTranDate()));
      }
      model.addAttribute("page", page);
    }

    // 清空页面列表选择Key
    form.setSelected_msgId("");
    form.setSelected_seqNo(null);
    model.addAttribute("pageUrl", "/FTZ210205/UptDtlInit");
    return "ftzmis/FTZ210205_Input_Dtl";
  }