2 Commit-ok f592da14bd ... 369441789d

Szerző SHA1 Üzenet Dátum
  madan 369441789d Merge branch '1.0.0_rzd_prod' of repos.ubtob.net:usoft/uas-system into 1.0.0_rzd_prod 3 éve
  madan e7b4807d65 费用报销单:提交判断 3 éve

+ 4 - 4
src/com/uas/erp/service/oa/impl/FeePleaseServiceImpl.java

@@ -1875,9 +1875,9 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 		if (isRight != 0) {
 			BaseUtil.showError("申请金额为0,不允许提交!");
 		}
-		Object dept = baseDao.getFieldDataByCondition("feeplease", "fp_department", "fp_id=" + fp_id);
-		SqlRowList rs1 = baseDao.queryForRowSet("select fpd_detno,fpd_d1,fpd_id from FeePleaseDetail where fpd_fpid=?", fp_id);
+		SqlRowList rs1 = baseDao.queryForRowSet("select fpd_detno,fpd_d1,fpd_id,nvl(FPD_DEPARTMENT,fp_department) dept from FeePleaseDetail where fpd_fpid=?", fp_id);
 		while (rs1.next()) {
+			Object dept = rs1.getObject("dept");
 			SqlRowList rs = baseDao.queryForRowSet(
 					"select fcs_departmentname from FeeCategorySet where fcs_departmentname=? and fcs_itemname=?", dept,
 					rs1.getObject("fpd_d1"));
@@ -1886,12 +1886,12 @@ public class FeePleaseServiceImpl implements FeePleaseService {
 			} else {
 				sb.append("第" + rs1.getObject("fpd_detno") + "行部门[" + dept + "]费用用途[" + rs1.getObject("fpd_d1") + "]在费用申请科目没有设置,不能提交");
 			}
+			baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
+					+ dept + "' and fcs_itemname=fpd_d1) where fpd_id=" + rs1.getObject("fpd_id"));
 		}
 		if (sb.length() > 0) {
 			BaseUtil.showError(sb.toString());
 		}
-		baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
-				+ dept + "' and fcs_itemname=fpd_d1) where fpd_fpid=" + fp_id);
 	}
 
 	private void comitLogic_feelimit(int fp_id, String caller) {

+ 4 - 4
src/com/uas/erp/service/oa/impl/OAHandler.java

@@ -254,22 +254,22 @@ public class OAHandler {
 			BaseUtil.showError("申请金额为0,不能提交");
 		}
 		StringBuffer sb = new StringBuffer();
-		Object dept = baseDao.getFieldDataByCondition("feeplease", "fp_department", "fp_id=" + fp_id);
 		SqlRowList rs1 = baseDao.queryForRowSet(
-				"select fpd_detno,fpd_d1,fpd_id,fp_department from FeePleaseDetail,feeplease where fp_id=fpd_fpid and fpd_fpid=?", fp_id);
+				"select fpd_detno,fpd_d1,fpd_id,nvl(FPD_DEPARTMENT,fp_department) dept from FeePleaseDetail,feeplease where fp_id=fpd_fpid and fpd_fpid=?", fp_id);
 		while (rs1.next()) {
+			Object dept = rs1.getObject("dept");
 			SqlRowList rs = baseDao.queryForRowSet(
 					"select fcs_departmentname from FeeCategorySet where fcs_departmentname=? and fcs_itemname=?", dept,
 					rs1.getObject("fpd_d1"));
 			if (!rs.hasNext()) {
 				sb.append("第" + rs1.getObject("fpd_detno") + "行部门[" + dept + "]费用用途[" + rs1.getObject("fpd_d1") + "]在费用申请科目没有设置,不能提交");
 			}
+			baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
+					+ dept + "' and fcs_itemname=fpd_d1 and nvl(fcs_nature,' ')=nvl(fpd_nature,' ')) where fpd_id=" + rs1.getObject("fpd_id"));
 		}
 		if (sb.length() > 0) {
 			BaseUtil.showError(sb.toString());
 		}
-		baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
-				+ dept + "' and fcs_itemname=fpd_d1 and nvl(fcs_nature,' ')=nvl(fpd_nature,' ')) where fpd_fpid=" + fp_id);
 	}
 
 	/**

+ 5 - 4
src/com/uas/mobile/service/impl/OAMeetingServiceImpl.java

@@ -949,9 +949,9 @@ public class OAMeetingServiceImpl implements OAMeetingService {
 		if (isRight != 0) {
 			BaseUtil.showError("申请金额为0,不能提交");
 		}
-		Object dept = baseDao.getFieldDataByCondition("feeplease", "fp_department", "fp_id=" + object);
-		SqlRowList rs1 = baseDao.queryForRowSet("select fpd_detno,fpd_d1,fpd_id from FeePleaseDetail where fpd_fpid=?", object);
+		SqlRowList rs1 = baseDao.queryForRowSet("select fpd_detno,fpd_d1,fpd_id,nvl(FPD_DEPARTMENT,fp_department) dept from FeePleaseDetail where fpd_fpid=?", object);
 		while (rs1.next()) {
+			Object dept = rs1.getObject("dept");
 			SqlRowList rs = baseDao.queryForRowSet(
 					"select fcs_departmentname from FeeCategorySet where fcs_departmentname=? and fcs_itemname=?", dept,
 					rs1.getObject("fpd_d1"));
@@ -960,12 +960,13 @@ public class OAMeetingServiceImpl implements OAMeetingService {
 			} else {
 				sb.append("第" + rs1.getObject("fpd_detno") + "行部门[" + dept + "]费用用途[" + rs1.getObject("fpd_d1") + "]在费用申请科目没有设置,不能提交");
 			}
+			baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
+					+ dept + "' and fcs_itemname=fpd_d1) where fpd_id=" + rs1.getObject("fpd_id"));
 		}
 		if (sb.length() > 0) {
 			BaseUtil.showError(sb.toString());
 		}
-		baseDao.execute("update FeePleaseDetail set fpd_catecode=(select max(fcs_catecode) from FeeCategorySet where fcs_departmentname='"
-				+ dept + "' and fcs_itemname=fpd_d1) where fpd_fpid=" + object);
+
 	}
 
 	@Override