浏览代码

【反馈编号:2021050253】【客户解挂申请】【从表【承诺回款日期】小于【系统当前日期】不允许提交或审核】

wuyx 3 年之前
父节点
当前提交
26dbbc5f37
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      src/com/uas/erp/service/scm/impl/CustomerReliveServiceImpl.java

+ 13 - 0
src/com/uas/erp/service/scm/impl/CustomerReliveServiceImpl.java

@@ -92,6 +92,7 @@ public class CustomerReliveServiceImpl implements CustomerReliveService {
 		StateAssert.auditOnlyCommited(status);
 		// 执行审核前的其它逻辑
 		handlerService.beforeAudit(caller, cr_id);
+		checkBefore(cr_id);
 		// 执行审核操作
 		baseDao.audit("CustomerRelive", "cr_id=" + cr_id, "cr_status", "cr_statuscode", "CR_AUDITDATE", "CR_AUDITORNAME");
 		SqlRowList rs = baseDao.queryForRowSet("select crd_custid,crd_commitdate from customerrelivedetail where crd_crid=?",
@@ -113,6 +114,7 @@ public class CustomerReliveServiceImpl implements CustomerReliveService {
 		StateAssert.submitOnlyEntering(status);
 		// 执行提交前的其它逻辑
 		handlerService.beforeSubmit(caller, cr_id);
+		checkBefore(cr_id);
 		// 执行提交操作
 		baseDao.submit("CustomerRelive", "cr_id=" + cr_id, "cr_status", "cr_statuscode");
 		// 记录操作
@@ -159,4 +161,15 @@ public class CustomerReliveServiceImpl implements CustomerReliveService {
 	public void countCustReturn() {
 		baseDao.procedure("SP_CUSTRETURN", new Object[] {});
 	}
+	private void checkBefore(int cr_id){
+		//从表【承诺回款日期】大于OR等于【系统当前日期】才允许提交及审核 crd_commitdate
+		String dets = baseDao
+				.getJdbcTemplate()
+				.queryForObject(
+						"select wm_concat(crd_detno) from CUSTOMERRELIVEDETAIL where crd_crid=? AND (crd_commitdate IS NULL OR TRUNC(crd_commitdate) < TRUNC(SYSDATE))",
+						String.class, cr_id);
+		if (dets != null) {
+			BaseUtil.showError("从表【承诺回款日期】小于系统当前日期,不允许进行当前操作!" + dets);
+		}
+	}
 }