浏览代码

Merge remote-tracking branch 'origin/master'

wanghaiwu 2 周之前
父节点
当前提交
cb78aee79a

+ 7 - 2
code/jyyy/nckd-jimin-jyyy-fi/src/main/java/nckd/jimin/jyyy/fi/webapi/ContractbillApiPlugin.java

@@ -136,6 +136,12 @@ public class ContractbillApiPlugin implements Serializable {
             result.setStatus(false);
             return result;
         }
+        DynamicObject bizhong = BusinessDataServiceHelper.loadSingle("bd_currency","id,name",new QFilter[]{new QFilter("number",QCP.equals,contractcurrency)});
+        if (bizhong == null) {
+            result.setMessage("币种编码contractcurrency:" + contractcurrency + ",星瀚未维护");
+            result.setStatus(false);
+            return result;
+        }
         String projectower = (String)billData.get("projectower"); // 合同干系人
         if (StringUtils.isEmpty(projectower)) {
             result.setMessage("合同干系人projectower未传值");
@@ -259,7 +265,6 @@ public class ContractbillApiPlugin implements Serializable {
 
         dynamicObject.set("iscurrency",true); // 默认设置多币种
 
-        DynamicObject bizhong = BusinessDataServiceHelper.loadSingle("bd_currency","id,name",new QFilter[]{new QFilter("number",QCP.equals,contractcurrency)});
         dynamicObject.set("contractcurrency",bizhong); // 币种
 
         BigDecimal huilv = new BigDecimal(0); // 汇率
@@ -274,7 +279,7 @@ public class ContractbillApiPlugin implements Serializable {
             DynamicObject[] huilvAry = BusinessDataServiceHelper.load("bd_exrate_tree","id,orgcur,cur,excval,effectdate",
                     new QFilter[]{new QFilter("orgcur",QCP.equals,bizhong.getLong("id"))
                             .and("cur",QCP.equals,CNY.getLong("id"))
-                            .and("enable",QCP.equals,'1')},"effectdate desc");
+                            .and("enable",QCP.equals,'1')},"effectdate desc"); // 日期倒序排
 
 
             if(huilvAry.length > 0) {