@RequestMapping("AuthDtlDtlSubmit") public String AuthDtlDtlSubmit(Model model, FTZ210205Form form) { FtzInTxnDtl ftzInTxnDtl = new FtzInTxnDtl(); ftzInTxnDtl.setMsgId(form.getFtzInTxnDtl().getMsgId()); ftzInTxnDtl.setSeqNo(form.getFtzInTxnDtl().getSeqNo()); UserInf userInfo = ContextConst.getCurrentUser(); if (userInfo.getUserid().equals(form.getFtzInTxnDtl().getMakUserId())) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210101.0025")); return "forward:/FTZ210205/QryAuthDtlDtl?selected_msgId=" + form.getFtzInTxnDtl().getMsgId() + "&selected_seqNo=" + form.getFtzInTxnDtl().getSeqNo(); } ftzInTxnDtl.setChkUserId(userInfo.getUserid()); ftzInTxnDtl.setChkDatetime(DateUtil.getNowInputDateTime()); ftzInTxnDtl.setChkAddWord(form.getFtzInTxnDtl().getChkAddWord()); if ("1".equals(form.getAuthStat())) { ftzInTxnDtl.setChkStatus(CommonConst.FTZ_MSG_STATUS_AUTH_SUCC); } else if ("0".equals(form.getAuthStat())) { ftzInTxnDtl.setChkStatus(CommonConst.FTZ_MSG_STATUS_AUTH_FAIL); } int i = ftz210205Serv.updateFtzInTxnDtlSelective(ftzInTxnDtl); if (i < 1) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210301.0008")); } else { model.addAttribute(ResultMessages.success().add("i.ftzmis.210301.0005")); form.setAuthFinishFlag("1"); } return "forward:/FTZ210205/QryAuthDtlDtl?selected_msgId=" + form.getFtzInTxnDtl().getMsgId() + "&selected_seqNo=" + form.getFtzInTxnDtl().getSeqNo(); }
/* * (non-Javadoc) * * @see com.synesoft.fisp.domain.service.cm.BusinessCommonService# * commonBusinessValidate(java.lang.String, java.lang.Object) */ @SuppressWarnings({"unchecked", "rawtypes"}) @Override public void commonBusinessValidate(String pageId, Object obj) { ResultMessages messages = ResultMessages.error(); SysControlDept query_SysControlDept = new SysControlDept(); UserInf userInfo = ContextConst.getCurrentUser(); query_SysControlDept.setControlDept(userInfo.getDepartment()); query_SysControlDept.setPageId(pageId); List<SysControlDept> sysControlDepts = sysControlDeptRepos.queryListByPageCheck(query_SysControlDept); Class clazz = obj.getClass(); if (null != sysControlDepts) { for (int i = 0; i < sysControlDepts.size(); i++) { Object objValue = null; String getValue = "get" + sysControlDepts.get(i).getControlId(); Method method; try { method = clazz.getMethod(getValue, new Class[] {}); objValue = method.invoke(obj); if (objValue instanceof String) { if (!StringUtil.isNotTrimEmpty((String) objValue)) { ResultMessage resultMessage = ResultMessage.fromCode( "e.fisp.commonValidate." + sysControlDepts.get(i).getControlId()); messages.add(resultMessage); } } else { if (null == objValue) { ResultMessage resultMessage = ResultMessage.fromCode( "e.fisp.commonValidate." + sysControlDepts.get(i).getControlId()); messages.add(resultMessage); } } } catch (SecurityException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } if (messages.isNotEmpty()) { throw new BusinessException(messages); } } } }
@RequestMapping("AuthDtlSubmit") public String AuthDtlSubmit(Model model, FTZ210205Form form) { FtzInMsgCtl query_FtzInMsgCtl = new FtzInMsgCtl(); query_FtzInMsgCtl.setMsgId(form.getSelected_msgId()); FtzInMsgCtl result_FtzInMsgCtl = ftz210205Serv.queryFtzInMsgCtl(query_FtzInMsgCtl); if (CommonConst.FTZ_MSG_STATUS_INPUTING.equals(result_FtzInMsgCtl.getMsgStatus())) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210101.0032")); return "forward:/FTZ210205/QryAuthDtl"; } UserInf userInfo = ContextConst.getCurrentUser(); if (userInfo.getUserid().equals(result_FtzInMsgCtl.getMakUserId())) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210101.0025")); return "forward:/FTZ210205/QryAuthDtl"; } FtzInTxnDtl query_FtzInTxnDtl = new FtzInTxnDtl(); query_FtzInTxnDtl.setMsgId(form.getSelected_msgId()); List<FtzInTxnDtl> ftzInTxnDtls = ftz210205Serv.queryFtzInTxnDtlList(query_FtzInTxnDtl); if (null == ftzInTxnDtls || ftzInTxnDtls.size() < 1) { FtzInMsgCtl update_FtzInMsgCtl = new FtzInMsgCtl(); update_FtzInMsgCtl.setMsgId(form.getFtzInMsgCtl().getMsgId()); update_FtzInMsgCtl.setMsgNo(CommonConst.MSG_NO_210205); update_FtzInMsgCtl.setMsgStatus(CommonConst.FTZ_MSG_STATUS_AUTH_SUCC); update_FtzInMsgCtl.setChkUserId(userInfo.getUserid()); update_FtzInMsgCtl.setRsv1( DateUtil.getFormatDateTimeRemoveSpritAndColon(form.getFtzInMsgCtl().getMakDatetime())); update_FtzInMsgCtl.setRsv2( DateUtil.getFormatDateTimeRemoveSpritAndColon(form.getFtzInMsgCtl().getChkDatetime())); update_FtzInMsgCtl.setChkDatetime(DateUtil.getNowInputDateTime()); int i = ftz210205Serv.updateFtzInMsgCtl(update_FtzInMsgCtl, null); if (i < 1) { model.addAttribute(ResultMessages.error().add("e.ftzmis.2103.0008")); } else { model.addAttribute(ResultMessages.success().add("i.ftzmis.210301.0005")); form.setAuthFinishFlag("1"); return "forward:/FTZ210205/QryAuthDtl"; } } else { int count_unAuth = 0; int count_authFail = 0; StringBuffer sb_unAuth = new StringBuffer(); StringBuffer sb_authFail = new StringBuffer(); for (FtzInTxnDtl ftzInTxnDtl : ftzInTxnDtls) { String chkStatus = ftzInTxnDtl.getChkStatus(); if (chkStatus.equals(CommonConst.FTZ_MSG_STATUS_INPUT_COMPLETED)) { count_unAuth++; sb_unAuth.append(ftzInTxnDtl.getSeqNo().toString() + ","); } if (chkStatus.equals(CommonConst.FTZ_MSG_STATUS_AUTH_FAIL)) { count_authFail++; sb_authFail.append(ftzInTxnDtl.getSeqNo().toString() + ","); } } if (count_unAuth > 0) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210310.0012")); return "forward:/FTZ210205/QryAuthDtl"; } if (count_authFail > 0) { model.addAttribute( ResultMessages.error() .add("e.ftzmis.210101.0031", sb_unAuth.subSequence(0, sb_authFail.length() - 1))); return "forward:/FTZ210205/QryAuthDtl"; } FtzInMsgCtl update_FtzInMsgCtl = new FtzInMsgCtl(); update_FtzInMsgCtl.setMsgStatus(CommonConst.FTZ_MSG_STATUS_AUTH_SUCC); if (form.getFtzInMsgCtl().getMsgId() != null && !"".equals(form.getFtzInMsgCtl().getMsgId())) { update_FtzInMsgCtl.setMsgId(form.getFtzInMsgCtl().getMsgId()); } else { update_FtzInMsgCtl.setMsgId(form.getSelected_msgId()); } update_FtzInMsgCtl.setMsgNo(CommonConst.MSG_NO_210205); update_FtzInMsgCtl.setChkUserId(userInfo.getUserid()); update_FtzInMsgCtl.setRsv2(update_FtzInMsgCtl.getChkDatetime()); update_FtzInMsgCtl.setChkDatetime(DateUtil.getNowInputDateTime()); update_FtzInMsgCtl.setChkDatetime(DateUtil.getNowInputDateTime()); int i = ftz210205Serv.updateFtzInMsgCtl(update_FtzInMsgCtl, null); if (i < 1) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210301.0008")); } else { model.addAttribute(ResultMessages.success().add("i.ftzmis.210301.0005")); form.setAuthFinishFlag("1"); return "forward:/FTZ210205/QryAuthDtl"; } } return "forward:/FTZ210205/QryAuthDtl"; }
// 点击保存 @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"; }
@RequestMapping("UptDtlDtlSubmit") public String UptDtlDtlSubmit(Model model, FTZ210205Form form, BindingResult result) { FtzInTxnDtl update_FtzInTxnDtl = form.getFtzInTxnDtl(); // 开始校验 ResultMessages resultMessages = ResultMessages.error(); // 出/入账标志 if (null == update_FtzInTxnDtl.getCdFlag() || "".equals(update_FtzInTxnDtl.getCdFlag().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0013"); resultMessages.add(resultMessage); } if ("3".equals(update_FtzInTxnDtl.getCdFlag().trim()) || "4".equals(update_FtzInTxnDtl.getCdFlag().trim())) { if (null == update_FtzInTxnDtl.getOrgTranDate() || "".equals(update_FtzInTxnDtl.getOrgTranDate().trim()) || ((null != update_FtzInTxnDtl.getTranDate()) && DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getTranDate()) .compareToIgnoreCase( DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getOrgTranDate())) < 0)) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0027"); resultMessages.add(resultMessage); } } // 记帐日期 if (null == update_FtzInTxnDtl.getTranDate() || "".equals(update_FtzInTxnDtl.getTranDate().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0014"); resultMessages.add(resultMessage); } // 金额 if (null == update_FtzInTxnDtl.getAmount()) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0015"); resultMessages.add(resultMessage); } else { if (!Validator.CheckAmount(update_FtzInTxnDtl.getAmount())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210303.0013"); resultMessages.add(resultMessage); } } // 国别代码 if (null == update_FtzInTxnDtl.getCountryCode() || "".equals(update_FtzInTxnDtl.getCountryCode().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0016"); resultMessages.add(resultMessage); } // 交易性质 if (null == update_FtzInTxnDtl.getTranType() || "".equals(update_FtzInTxnDtl.getTranType().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0017"); resultMessages.add(resultMessage); } if ("1".equals(update_FtzInTxnDtl.getCdFlag().trim()) || "2".equals(update_FtzInTxnDtl.getCdFlag().trim())) { if (null == update_FtzInTxnDtl.getOppAccount() || "".equals(update_FtzInTxnDtl.getOppAccount().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0001"); resultMessages.add(resultMessage); } } // 正常出账或者入账时用户名必输 if ("1".equals(update_FtzInTxnDtl.getCdFlag().trim()) || "2".equals(update_FtzInTxnDtl.getCdFlag().trim())) { if (null == update_FtzInTxnDtl.getOppName() || "".equals(update_FtzInTxnDtl.getOppName().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0006"); resultMessages.add(resultMessage); } } // 对方客户性质 if (null == update_FtzInTxnDtl.getOppCusType() || "".equals(update_FtzInTxnDtl.getOppCusType().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0001"); resultMessages.add(resultMessage); } if (resultMessages.isNotEmpty()) { model.addAttribute(resultMessages); return "ftzmis/FTZ210205_Input_Dtl_Dtl"; } update_FtzInTxnDtl.setTranDate( DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getTranDate())); update_FtzInTxnDtl.setValueDate( DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getValueDate())); update_FtzInTxnDtl.setOrgTranDate( DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getOrgTranDate())); update_FtzInTxnDtl.setExpireDate( DateUtil.getFormatDateRemoveSprit(update_FtzInTxnDtl.getExpireDate())); UserInf userInfo = ContextConst.getCurrentUser(); update_FtzInTxnDtl.setMakUserId(userInfo.getUserid()); update_FtzInTxnDtl.setRsv1( DateUtil.getFormatDateTimeRemoveSpritAndColon(update_FtzInTxnDtl.getMakDatetime())); update_FtzInTxnDtl.setRsv2( DateUtil.getFormatDateTimeRemoveSpritAndColon(update_FtzInTxnDtl.getChkDatetime())); update_FtzInTxnDtl.setMakDatetime(DateUtil.getNowInputDateTime()); update_FtzInTxnDtl.setChkDatetime( DateUtil.getFormatDateTimeRemoveSpritAndColon(update_FtzInTxnDtl.getChkDatetime())); update_FtzInTxnDtl.setChkStatus(CommonConst.FTZ_MSG_STATUS_INPUT_COMPLETED); int i = ftz210205Serv.updateFtzInTxnDtlSelective(update_FtzInTxnDtl); if (i < 1) { model.addAttribute(ResultMessages.error().add("e.ftzmis.210101.0026")); } else { model.addAttribute(ResultMessages.success().add("i.ftzmis.210210.0004")); model.addAttribute("uptFlag", "1"); } form.getFtzInTxnDtl() .setTranDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getTranDate())); form.getFtzInTxnDtl() .setOrgTranDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getOrgTranDate())); form.getFtzInTxnDtl() .setExpireDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getExpireDate())); form.getFtzInTxnDtl() .setMakDatetime( DateUtil.getFormatDateTimeAddSpritAndColon(form.getFtzInTxnDtl().getMakDatetime())); form.getFtzInTxnDtl() .setChkDatetime( DateUtil.getFormatDateTimeAddSpritAndColon(form.getFtzInTxnDtl().getChkDatetime())); return "ftzmis/FTZ210205_Input_Dtl_Dtl"; }
@RequestMapping("AddDtlDtlSubmit") public String AddDtlDtlSubmit(Model model, FTZ210205Form form, BindingResult result) { FtzInTxnDtl issert_FtzInTxnDtl = form.getFtzInTxnDtl(); // 开始校验 ResultMessages resultMessages = ResultMessages.error(); // 出/入账标志 if (null == issert_FtzInTxnDtl.getCdFlag() || "".equals(issert_FtzInTxnDtl.getCdFlag().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0013"); resultMessages.add(resultMessage); } if ("3".equals(issert_FtzInTxnDtl.getCdFlag().trim()) || "4".equals(issert_FtzInTxnDtl.getCdFlag().trim())) { if (null == issert_FtzInTxnDtl.getOrgTranDate() || "".equals(issert_FtzInTxnDtl.getOrgTranDate().trim()) || ((null != issert_FtzInTxnDtl.getTranDate()) && DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getTranDate()) .compareToIgnoreCase( DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getOrgTranDate())) < 0)) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0027"); resultMessages.add(resultMessage); } } // 记帐日期 if (null == issert_FtzInTxnDtl.getTranDate() || "".equals(issert_FtzInTxnDtl.getTranDate().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0014"); resultMessages.add(resultMessage); } // 金额 if (null == issert_FtzInTxnDtl.getAmount()) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0015"); resultMessages.add(resultMessage); } else { if (!Validator.CheckAmount(issert_FtzInTxnDtl.getAmount())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210303.0013"); resultMessages.add(resultMessage); } } // 国别代码 if (null == issert_FtzInTxnDtl.getCountryCode() || "".equals(issert_FtzInTxnDtl.getCountryCode().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0016"); resultMessages.add(resultMessage); } // 交易性质 if (null == issert_FtzInTxnDtl.getTranType() || "".equals(issert_FtzInTxnDtl.getTranType().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210101.0017"); resultMessages.add(resultMessage); } // 正常出账或入账时必输 if ("1".equals(issert_FtzInTxnDtl.getCdFlag().trim()) || "2".equals(issert_FtzInTxnDtl.getCdFlag().trim())) { if (null == issert_FtzInTxnDtl.getOppAccount() || "".equals(issert_FtzInTxnDtl.getOppAccount().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0001"); resultMessages.add(resultMessage); } } // 正常出账或者入账时用户名必输 if ("1".equals(issert_FtzInTxnDtl.getCdFlag().trim()) || "2".equals(issert_FtzInTxnDtl.getCdFlag().trim())) { if (null == issert_FtzInTxnDtl.getOppName() || "".equals(issert_FtzInTxnDtl.getOppName().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0006"); resultMessages.add(resultMessage); } } // //对方客户性质 if (null == issert_FtzInTxnDtl.getOppCusType() || "".equals(issert_FtzInTxnDtl.getOppCusType().trim())) { ResultMessage resultMessage = ResultMessage.fromCode("e.ftzmis.210205.0002"); resultMessages.add(resultMessage); } if (resultMessages.isNotEmpty()) { model.addAttribute(resultMessages); return "ftzmis/FTZ210205_Input_Dtl_Dtl"; } FtzInTxnDtl query_FtzInTxnDtl = new FtzInTxnDtl(); query_FtzInTxnDtl.setMsgId(issert_FtzInTxnDtl.getMsgId()); List<FtzInTxnDtl> ftzInTxnDtls = ftz210205Serv.queryFtzInTxnDtlList(query_FtzInTxnDtl); if (null == ftzInTxnDtls || ftzInTxnDtls.size() == 0) { issert_FtzInTxnDtl.setSeqNo(StringUtil.addZeroForNum("1", 6)); } else { FtzInTxnDtl ftzInTxnDtl_tmp = ftzInTxnDtls.get(ftzInTxnDtls.size() - 1); String seqNo = Integer.parseInt(ftzInTxnDtl_tmp.getSeqNo()) + 1 + ""; issert_FtzInTxnDtl.setSeqNo(StringUtil.addZeroForNum(seqNo, 6)); } issert_FtzInTxnDtl.setTranDate( DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getTranDate())); issert_FtzInTxnDtl.setValueDate( DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getValueDate())); issert_FtzInTxnDtl.setOrgTranDate( DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getOrgTranDate())); issert_FtzInTxnDtl.setExpireDate( DateUtil.getFormatDateRemoveSprit(issert_FtzInTxnDtl.getExpireDate())); UserInf userInfo = ContextConst.getCurrentUser(); issert_FtzInTxnDtl.setMakUserId(userInfo.getUserid()); issert_FtzInTxnDtl.setMakDatetime(DateUtil.getNowInputDateTime()); issert_FtzInTxnDtl.setChkStatus(CommonConst.FTZ_MSG_STATUS_INPUT_COMPLETED); int i = ftz210205Serv.insertFtzInTxnDtl(issert_FtzInTxnDtl); if (i < 1) { model.addAttribute(ResultMessages.error().add("e.sysrunner.0006")); } else { model.addAttribute(ResultMessages.success().add("i.ftzmis.210210.0003")); model.addAttribute("uptFlag", "1"); } form.getFtzInTxnDtl() .setTranDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getTranDate())); form.getFtzInTxnDtl() .setOrgTranDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getOrgTranDate())); form.getFtzInTxnDtl() .setExpireDate(DateUtil.getFormatDateAddSprit(form.getFtzInTxnDtl().getExpireDate())); form.getFtzInTxnDtl() .setMakDatetime( DateUtil.getFormatDateTimeAddSpritAndColon(form.getFtzInTxnDtl().getMakDatetime())); form.getFtzInTxnDtl() .setChkDatetime( DateUtil.getFormatDateTimeAddSpritAndColon(form.getFtzInTxnDtl().getChkDatetime())); return "ftzmis/FTZ210205_Input_Dtl_Dtl"; }
// 修改之后点击保存 @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"; }