徐昊 преди 9 месеца
родител
ревизия
93ccd28d00

+ 45 - 98
src/main/java/fi/em/EditPlugin/MotivationParameterEditPlugin.java

@@ -7,39 +7,34 @@ import kd.bos.form.ShowType;
 import kd.bos.form.events.AfterDoOperationEventArgs;
 import kd.bos.form.events.ClosedCallBackEvent;
 import kd.bos.list.plugin.AbstractListPlugin;
+import kd.bos.orm.query.QCP;
+import kd.bos.orm.query.QFilter;
 import kd.sdk.plugin.Plugin;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import kd.bos.bill.BillShowParameter;
-import kd.bos.context.RequestContext;
 import kd.bos.dataentity.entity.DynamicObject;
-import kd.bos.dataentity.entity.DynamicObjectCollection;
 import kd.bos.servicehelper.BusinessDataServiceHelper;
 import org.apache.commons.lang3.StringUtils;
-
-import java.util.Date;
+import java.math.BigDecimal;
 import java.util.HashMap;
-import java.util.List;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
+
 
 public class MotivationParameterEditPlugin extends AbstractListPlugin implements Plugin {
-    public static String btn_NOTICE = "donothing";
-    public static String FORMID_NOTICEMODAL = "nckd_agentparameterf7";
-    public static String FORMID = "ztjg_postcertapply";
-    public static String FORMID_NOTICE = "ztjg_postcertifynotice";
-    private static String FORMID_USER = "bos_user";
+    public static String btn_NOTICE = "donothing"; //操作
+    public static String nckd_agentparameterf7 = "nckd_agentparameterf7";//动因参数动态列表
+    private static String bos_org = "bos_org"; //组织金额标识
 
     @Override
     public void afterDoOperation(AfterDoOperationEventArgs e) {
         if (btn_NOTICE.equals(e.getOperateKey())) {
-            Object value = this.getModel().getValue("costcompany");
-            DynamicObject costcompany = (DynamicObject) value;
-            String orgnumber = costcompany.getString("number");
+            Object value = this.getModel().getValue("costcompany");//获取当前单据费用公司
+            DynamicObject costcompany = (DynamicObject) value;//强转
+            String orgnumber = costcompany.getString("number");//公司编码
+            String orgid = costcompany.getString("id");//公司id
             if (orgnumber == null){
                 throw new KDBizException("付费承担公司为空!");
             }
-            showParameter(FORMID_NOTICEMODAL, btn_NOTICE,orgnumber);
+            showParameter(nckd_agentparameterf7, btn_NOTICE,orgnumber,orgid);//调用弹出页面
         }
     }
 
@@ -47,100 +42,52 @@ public class MotivationParameterEditPlugin extends AbstractListPlugin implements
     public void closedCallBack(ClosedCallBackEvent e) {
         super.closedCallBack(e);
         if (StringUtils.equals(btn_NOTICE, e.getActionId()) && null != e.getReturnData()) {
+            //父页面返回参数
             HashMap<String, String> returnData = (HashMap<String, String>) e.getReturnData();
             String reJaStr = returnData.get("reJaStr");
+            //判断空
             if (StringUtils.isNotBlank(reJaStr)) {
-                JSONArray reJa = JSONArray.parseArray(reJaStr);
-                JSONObject reJo = reJa.getJSONObject(0);
-                DynamicObject userInfo = BusinessDataServiceHelper.loadSingle(RequestContext.get().getCurrUserId(), FORMID_USER);
-
-                String noticeId = reJo.getString("ztjg_id");
-                DynamicObject noticeInfo = BusinessDataServiceHelper.loadSingle(Long.valueOf(noticeId), FORMID_NOTICE);
-                DynamicObjectCollection entryCo = noticeInfo.getDynamicObjectCollection("ztjg_entryentity");
-                Predicate<DynamicObject> userFilter = (entryInfo) -> entryInfo.getDynamicObject("ztjg_canposteename").getPkValue().equals(userInfo.getPkValue());
-                List<DynamicObject> list = entryCo.stream().filter(userFilter).collect(Collectors.toList());
-                if (list == null || list.size() <= 0) {
-                    this.getView().showMessage("未匹配到认证通知!");
-                    return;
-                }
-                DynamicObject entryInfo = list.get(0);
-                String status = entryInfo.getString("ztjg_statuscan");
-                if (StringUtils.isNotBlank(status) && !"0".equals(status)) {
-                    this.getView().showMessage("未匹配到可请假认证通知!");
-                    return;
+                //删除分录信息
+                this.getModel().deleteEntryData("expenseentryentity_rule");
+                JSONArray reJa = JSONArray.parseArray(reJaStr);//返回信息数组
+                BigDecimal sum = new BigDecimal(0);//动因参数总和
+                //循环计算sum
+                for(int a =0;a<reJa.size();a++){
+                    JSONObject reJo = reJa.getJSONObject(a);
+                    BigDecimal nckdAgentvalue = reJo.getBigDecimal("nckd_agentvalue");
+                    sum=sum.add(nckdAgentvalue);
                 }
-
-                DynamicObject info = BusinessDataServiceHelper.newDynamicObject(FORMID);
-                info.set("billstatus", "A");
-                info.set("ztjg_aplydate", new Date());
-                info.set("ztjg_applier", userInfo);
-                info.set("ztjg_idno", entryInfo.getString("ztjg_canidno"));
-                info.set("ztjg_postnumber", noticeInfo.getString("billno"));
-                info.set("ztjg_postname", noticeInfo.getString("ztjg_postname"));
-                info.set("ztjg_postdate", noticeInfo.getDate("ztjg_postdate"));
-                info.set("ztjg_address", noticeInfo.getString("ztjg_address"));
-                info.set("ztjg_demand", noticeInfo.getString("ztjg_demand"));
-                info.set("ztjg_mainnotice", noticeInfo.getString("ztjg_mainnotice"));
-                info.set("ztjg_postcontent", noticeInfo.getString("ztjg_postcontent"));
-                info.set("ztjg_integralitem", noticeInfo.getDynamicObject("ztjg_integralitem"));
-                info.set("ztjg_org", noticeInfo.getDynamicObject("ztjg_org"));
-                info.set("ztjg_dept", noticeInfo.getDynamicObject("ztjg_dept"));
-
-                String postnamestr = noticeInfo.getString("ztjg_postnamestr");
-                String datastr = noticeInfo.getString("ztjg_datastr");
-                String address = noticeInfo.getString("ztjg_address");
-                String customize1 = noticeInfo.getString("ztjg_customize1");
-                String customize2 = noticeInfo.getString("ztjg_customize2");
-                String customize3 = noticeInfo.getString("ztjg_customize3");
-
-                info.set("ztjg_postnamestr", postnamestr);
-                info.set("ztjg_datastr", datastr);
-                info.set("ztjg_address", address);
-                info.set("ztjg_customize1", customize1);
-                info.set("ztjg_customize2", customize2);
-                info.set("ztjg_customize3", customize3);
-                info.set("ztjg_postmore", noticeInfo.getBoolean("ztjg_postmore"));
-                info.set("ztjg_datemore", noticeInfo.getBoolean("ztjg_datemore"));
-                info.set("ztjg_addressmore", noticeInfo.getBoolean("ztjg_addressmore"));
-                info.set("ztjg_itemmore1", noticeInfo.getBoolean("ztjg_itemmore1"));
-                info.set("ztjg_itemmore2", noticeInfo.getBoolean("ztjg_itemmore2"));
-                info.set("ztjg_itemmore3", noticeInfo.getBoolean("ztjg_itemmore3"));
-
-                if (StringUtils.isNotBlank(postnamestr) && postnamestr.split(";").length <= 1) {
-                    info.set("ztjg_datastrmy", postnamestr);
+                //循环返回数组插入分录
+                for(int i =0;i<reJa.size();i++){
+                    //当前循环行
+                    JSONObject reJo = reJa.getJSONObject(i);
+                    //获取组织
+                    String nckd_shareorg = reJo.getString("nckd_shareorg");
+                    QFilter nckd_orgamountFilter = new QFilter("number", QCP.equals,nckd_shareorg);
+                        nckd_orgamountFilter.and("enable", QCP.equals,"1");
+                        //组织实体
+                    DynamicObject nckd_orgamountaccount = BusinessDataServiceHelper.loadSingle(bos_org,"id,nckd_orgfield,nckd_combofield",new QFilter[] {nckd_orgamountFilter});
+                    BigDecimal nckdAgentvalue = reJo.getBigDecimal("nckd_agentvalue");
+                    //计算当前动因值比例
+                    nckdAgentvalue = (nckdAgentvalue.divide(sum)).multiply(new BigDecimal(100));
+                    //新增分录行
+                    int rowIndex = this.getModel().createNewEntryRow("expenseentryentity_rule");
+                    //set分录字段
+                    this.getModel().setValue("entrycostcompany_orgrule", nckd_orgamountaccount, rowIndex);
+                    this.getModel().setValue("sharerate_comrule", nckdAgentvalue, rowIndex);
                 }
-                if (StringUtils.isNotBlank(datastr) && datastr.split(";").length <= 1) {
-                    info.set("ztjg_datastrmy", datastr);
-                }
-                if (StringUtils.isNotBlank(address) && address.split(";").length <= 1) {
-                    info.set("ztjg_addressmy", address);
-                }
-                if (StringUtils.isNotBlank(customize1) && customize1.split(";").length <= 1) {
-                    info.set("ztjg_customize1my", customize1);
-                }
-                if (StringUtils.isNotBlank(customize2) && customize2.split(";").length <= 1) {
-                    info.set("ztjg_customize2my", customize2);
-                }
-                if (StringUtils.isNotBlank(customize3) && customize3.split(";").length <= 1) {
-                    info.set("ztjg_customize3my", customize3);
-                }
-
-                //OperationResult saveOperate = OperationServiceHelper.executeOperate("save", FORMID, new DynamicObject[] { info }, CommonUtils.getOprateOption());
-
-                BillShowParameter billShowParameter = new BillShowParameter();
-                billShowParameter.getOpenStyle().setShowType(ShowType.Modal);
-                billShowParameter.setFormId(FORMID);
-                billShowParameter.setPkId(info.getPkValue());
-                getView().showForm(billShowParameter);
+                //刷新分录
+                this.getView().updateView("expenseentryentity_rule");
             }
         }
     }
 
-    public void showParameter(String formId, String actionId,String orgnumber) {
+    public void showParameter(String formId, String actionId,String orgnumber,String orgid) {
         //创建弹出页面对象,FormShowParameter表示弹出页面为动态表单
         FormShowParameter ShowParameter = new FormShowParameter();
         //ListShowParameter ShowParameter = new ListShowParameter();
         ShowParameter.setCustomParam("orgnumber", orgnumber);
+        ShowParameter.setCustomParam("orgid", orgid);
         //设置弹出页面的编码
         ShowParameter.setFormId(formId);
 //        ShowParameter.setCaption();

+ 86 - 130
src/main/java/fi/em/FormPlugin/PostModalFormPlugin.java

@@ -19,19 +19,12 @@ import org.apache.commons.lang3.StringUtils;
 import java.math.BigDecimal;
 import java.util.*;
 public class PostModalFormPlugin extends AbstractFormPlugin implements Plugin {
-    private final static String KEY_OK = "btnok";
-    //页面取消按钮标识
-    private final static String KEY_CANCEL = "btncancel";
-    //页面取消按钮标识
-    private final static String KEY_SEARCH = "search";
+    private final static String KEY_OK = "btnok";//页面取消按钮标识
+    private final static String KEY_CANCEL = "btncancel";//页面取消按钮标识
+    private final static String KEY_SEARCH = "search";//动态表单查询按钮操作
+    private final static String FORMID_ENTRY = "nckd_entryentity";//动态表单单据体标识
+    private static String nckd_agentparameter = "nckd_agentparameter";//动因参数基础资料
 
-    private final static String FORMID_ENTRY = "ztjg_entryentity";
-
-    private final static String FORMID = "ztjg_postcertifynotice";
-
-    private static String FORMID_USER = "bos_user";
-
-    private static String nckd_agentparameter = "nckd_agentparameter";
     /**
      * 页面点击事件
      *
@@ -86,145 +79,108 @@ public class PostModalFormPlugin extends AbstractFormPlugin implements Plugin {
     @Override
     public void afterCreateNewData(EventObject e) {
         super.afterBindData(e);
-        DynamicObject period = (DynamicObject) this.getModel().getValue("nckd_agentparameter");
+        DynamicObject period = (DynamicObject) this.getModel().getValue("nckd_typeagent");
         //获取父页面传入数据
         Map<String, Object> customParams = this.getView().getFormShowParameter().getCustomParams();
         String orgnumber = (String) customParams.get("orgnumber");
+        String orgid = (String) customParams.get("orgid");
         if (orgnumber == null){
             throw new KDBizException("付费承担公司为空!");
         }
+        List<JSONObject> resdate = new ArrayList<>();
+        //历史数据清除
+        this.getModel().deleteEntryData(FORMID_ENTRY);
+        //构建查费用分摊动因参数基础资料参数
         QFilter nckd_orgamountFilter = new QFilter("nckd_unappliedorg.number", QCP.equals,orgnumber);
-        if(period !=null){
-            String nckd_sole = period.getString("nckd_sole");
-            if(nckd_sole!=null && !nckd_sole.isEmpty()){
-                nckd_orgamountFilter.and("nckd_typeagent.nckd_sole", QCP.equals,"A");
-            }
-        }
-        nckd_orgamountFilter.and("enable", QCP.equals,"1");
-        DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.load(nckd_agentparameter,"id",new QFilter[] {nckd_orgamountFilter});
-        for (int c=0;c<nckd_orgamountaccount.length;c++){
+        nckd_orgamountFilter.and("status", QCP.equals,"C");
+        DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.load(nckd_agentparameter,"id,number",new QFilter[] {nckd_orgamountFilter});
+            for (int c=0;c<nckd_orgamountaccount.length;c++){
+                //当前循环动因基础资料单头
             DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(nckd_orgamountaccount[c].getPkValue(), nckd_orgamountaccount[c].getDynamicObjectType().getName());
-            for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("nckd_sharemessage")) {
+                //获取动因类型
+            DynamicObject nckdTypeagent = dynamicObject.getDynamicObject("nckd_typeagent");
+            //循环分录
+            for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("nckd_entryentity")) {
+                //获取分摊组织
                 DynamicObject nckdShareorg = entryentity.getDynamicObject("nckd_shareorg");
+                //获取动因值
                 BigDecimal nckdAgentvalue = entryentity.getBigDecimal("nckd_agentvalue");
+                //新增动态单据分录
+                int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
+                //赋值给新增分录
+                this.getModel().setValue("nckd_shareorg", nckdShareorg, rowIndex);
+                this.getModel().setValue("nckd_agentvalue", nckdAgentvalue, rowIndex);
+                this.getModel().setValue("nckd_agenttype", nckdTypeagent, rowIndex);
+                //将选中的数据放到缓存中
+                JSONObject obj = new JSONObject();
+                obj.put("nckd_shareorg",nckdShareorg.getString("number"));
+                obj.put("nckd_agentvalue",nckdAgentvalue);
+                resdate.add(obj);
             }
         }
-
-        //initTable(isInform,isForce,startDate,endDate,null);
+        String pageId = this.getView().getPageId();
+        String listStr = SerializationUtils.toJsonString(resdate);
+        this.getPageCache().put(pageId, listStr);
+//        initTable(isInform,isForce,startDate,endDate,null);
     }
 
+
     @Override
     public void afterDoOperation(AfterDoOperationEventArgs e) {
         if (KEY_SEARCH.equals(e.getOperateKey())) {
-            Date startDate = (Date) this.getModel().getValue("ztjg_startdate");
-            Date endDate = (Date) this.getModel().getValue("ztjg_enddate");
-            Boolean isForce = (Boolean) this.getModel().getValue("ztjg_isforce");
-            Boolean isInform = (Boolean) this.getModel().getValue("ztjg_isinform");
-            String likeName = (String) this.getModel().getValue("ztjg_likename");
-            if (isForce == null){
-                isForce = false;
+            DynamicObject period = (DynamicObject) this.getModel().getValue("nckd_typeagent");
+            //获取父页面传入数据
+            Map<String, Object> customParams = this.getView().getFormShowParameter().getCustomParams();
+            String orgnumber = (String) customParams.get("orgnumber");
+            String orgid = (String) customParams.get("orgid");
+            if (orgnumber == null){
+                throw new KDBizException("付费承担公司为空!");
             }
-            if (isInform == null){
-                isInform = false;
-            }
-
-            if (startDate == null){
-                this.getView().showMessage("请选择开始日期!");
-                return;
-            }else if (endDate == null){
-                this.getView().showMessage("请选择结束日期!");
-                return;
+            List<JSONObject> resdate = new ArrayList<>();
+            //历史数据清除
+            this.getModel().deleteEntryData(FORMID_ENTRY);
+            //查询动因参数基础资料
+            QFilter nckd_orgamountFilter = new QFilter("nckd_unappliedorg.number", QCP.equals,orgnumber);
+            if(period !=null){
+                period = BusinessDataServiceHelper.loadSingle(period.getPkValue(),period.getDynamicObjectType().getName());
+                String name = period.getString("name");
+                if(name!=null && !name.isEmpty()){
+                    nckd_orgamountFilter.and("nckd_typeagent.name", QCP.equals,name);
+                }
             }
-
-            initTable(isInform,isForce,startDate,endDate,likeName);
-        }
-    }
-
-    public void initTable(Boolean isInform,Boolean isForce,Date startdate,Date etartdate,String likeName){
-        //历史数据清除
-        this.getModel().deleteEntryData(FORMID_ENTRY);
-
-        JSONArray reJa = getInitData(isInform,isForce,startdate,etartdate,likeName);
-        for (int i=0;i<reJa.size();i++){
-            JSONObject processJo = reJa.getJSONObject(i);
-            int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
-            this.getModel().setValue("ztjg_id", processJo.getString("ztjg_id"), rowIndex);
-            this.getModel().setValue("ztjg_noticeno", processJo.getString("ztjg_noticeno"), rowIndex);
-            this.getModel().setValue("ztjg_noticedate", processJo.getDate("ztjg_noticedate"), rowIndex);
-            this.getModel().setValue("ztjg_org", processJo.getObject("ztjg_org", DynamicObject.class), rowIndex);
-            this.getModel().setValue("ztjg_dept", processJo.getObject("ztjg_dept",DynamicObject.class), rowIndex);
-            this.getModel().setValue("ztjg_postname", processJo.getString("ztjg_postname"), rowIndex);
-            this.getModel().setValue("ztjg_postdate", processJo.getDate("ztjg_postdate"), rowIndex);
-            this.getModel().setValue("ztjg_address", processJo.getString("ztjg_address"), rowIndex);
-            this.getModel().setValue("ztjg_postcontent", processJo.getString("ztjg_postcontent"), rowIndex);
-            this.getModel().setValue("ztjg_demand", processJo.getString("ztjg_demand"), rowIndex);
-            this.getModel().setValue("ztjg_mainnotice", processJo.getString("ztjg_mainnotice"), rowIndex);
-            this.getModel().setValue("ztjg_integralitem", processJo.getObject("ztjg_integralitem",DynamicObject.class), rowIndex);
-            this.getModel().setValue("ztjg_retakes", processJo.getBoolean("ztjg_retakes"), rowIndex);
-            this.getModel().setValue("ztjg_datastr", processJo.getString("ztjg_datastr"), rowIndex);
-            this.getModel().setValue("ztjg_customize1", processJo.getString("ztjg_customize1"), rowIndex);
-            this.getModel().setValue("ztjg_customize2", processJo.getString("ztjg_customize2"), rowIndex);
-            this.getModel().setValue("ztjg_customize3", processJo.getString("ztjg_customize3"), rowIndex);
-            this.getModel().setValue("ztjg_postnamestr", processJo.getString("ztjg_postnamestr"), rowIndex);
-        }
-        String pageId = this.getView().getPageId();
-        String listStr = SerializationUtils.toJsonString(reJa);
-        this.getPageCache().put(pageId,listStr);
-    }
-
-    public static JSONArray getInitData(Boolean isInform,Boolean isForce, Date startdate,Date enddate,String likeName){
-        JSONArray reJa = new JSONArray();
-        DynamicObject userInfo =  BusinessDataServiceHelper.loadSingle(RequestContext.get().getCurrUserId(),FORMID_USER);
-        QFilter[] filters = null;
-        QFilter personQFilter = null;
-        QFilter statusQFilter = null;
-        if (isForce){
-            personQFilter = new QFilter("entryentity.ztjg_posteename.id", QCP.equals, userInfo.getPkValue());
-            statusQFilter = new QFilter("entryentity.ztjg_ispushforce", QCP.equals, false);
-        }else {
-            personQFilter = new QFilter("ztjg_entryentity.ztjg_canposteename.id", QCP.equals, userInfo.getPkValue());
-            statusQFilter = new QFilter("ztjg_entryentity.ztjg_ispushcan", QCP.equals, false);
-        }
-        QFilter qFilter1 = new QFilter("billstatus", QCP.equals, "C");
-        QFilter qFilter2 = new QFilter("ztjg_bizdate", QCP.large_equals, startdate);
-        QFilter qFilter3 = new QFilter("ztjg_bizdate", QCP.less_equals, enddate);
-        QFilter qFilter4 = new QFilter("ztjg_postname", QCP.like, "%"+likeName+"%");
-
-        if (!isInform){
-            if (StringUtils.isNotBlank(likeName)){
-                filters = new QFilter[]{personQFilter,statusQFilter,qFilter1,qFilter2,qFilter3,qFilter4};
-            }else {
-                filters = new QFilter[]{personQFilter,statusQFilter,qFilter1,qFilter2,qFilter3};
+            nckd_orgamountFilter.and("status", QCP.equals,"C");
+            DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.load(nckd_agentparameter,"id,number",new QFilter[] {nckd_orgamountFilter});
+            //循环动因参数基础资料
+            for (int c=0;c<nckd_orgamountaccount.length;c++){
+                //当前行
+                DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(nckd_orgamountaccount[c].getPkValue(), nckd_orgamountaccount[c].getDynamicObjectType().getName());
+                //动因类型
+                DynamicObject nckdTypeagent = dynamicObject.getDynamicObject("nckd_typeagent");
+                //循环分录
+                for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("nckd_entryentity")) {
+                    //当前分录行分摊组织
+                    DynamicObject nckdShareorg = entryentity.getDynamicObject("nckd_shareorg");
+                    //当前分录行动因值
+                    BigDecimal nckdAgentvalue = entryentity.getBigDecimal("nckd_agentvalue");
+                    //新增动态单据分录行
+                    int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
+                    //赋值给分录
+                    this.getModel().setValue("nckd_shareorg", nckdShareorg, rowIndex);
+                    this.getModel().setValue("nckd_agentvalue", nckdAgentvalue, rowIndex);
+                    this.getModel().setValue("nckd_agenttype", nckdTypeagent, rowIndex);
+                    //存放缓存
+                    JSONObject obj = new JSONObject();
+                    obj.put("nckd_shareorg",nckdShareorg.getString("number"));
+                    obj.put("nckd_agentvalue",nckdAgentvalue);
+                    resdate.add(obj);
+                }
             }
-        }
+            String pageId = this.getView().getPageId();
+            String listStr = SerializationUtils.toJsonString(resdate);
+            this.getPageCache().put(pageId, listStr);
+//        initTable(isInform,isForce,startDate,endDate,null);
+            
 
-        DynamicObject[] conObjects = BusinessDataServiceHelper.load(FORMID,"id,billno,ztjg_bizdate,ztjg_org,ztjg_dept,ztjg_postname,ztjg_postdate,ztjg_address,ztjg_postcontent,ztjg_demand,ztjg_mainnotice,ztjg_integralitem,ztjg_retakes,ztjg_postnamestr,ztjg_datastr,ztjg_customize1,ztjg_customize2,ztjg_customize3",filters);
-        for (DynamicObject obj:conObjects){
-            JSONObject itemJo = new JSONObject();
-            itemJo.put("ztjg_id",obj.getPkValue().toString());
-            itemJo.put("ztjg_noticeno",obj.getString("billno"));
-            itemJo.put("ztjg_noticedate",obj.getDate("ztjg_bizdate"));
-            itemJo.put("ztjg_org",obj.getDynamicObject("ztjg_org"));
-            itemJo.put("ztjg_dept",obj.getDynamicObject("ztjg_dept"));
-            itemJo.put("ztjg_postname",obj.getString("ztjg_postname"));
-            itemJo.put("ztjg_postdate",obj.getDate("ztjg_postdate"));
-            itemJo.put("ztjg_address",obj.getString("ztjg_address"));
-            itemJo.put("ztjg_postcontent",obj.getString("ztjg_postcontent"));
-            itemJo.put("ztjg_demand",obj.getString("ztjg_demand"));
-            itemJo.put("ztjg_mainnotice",obj.getString("ztjg_mainnotice"));
-            itemJo.put("ztjg_integralitem",obj.getDynamicObject("ztjg_integralitem"));
-            itemJo.put("ztjg_retakes",obj.getBoolean("ztjg_retakes"));
-            itemJo.put("ztjg_postnamestr",obj.getString("ztjg_postnamestr"));
-            itemJo.put("ztjg_datastr",obj.getString("ztjg_datastr"));
-            itemJo.put("ztjg_customize1",obj.getString("ztjg_customize1"));
-            itemJo.put("ztjg_customize2",obj.getString("ztjg_customize2"));
-            itemJo.put("ztjg_customize3",obj.getString("ztjg_customize3"));
-
-            reJa.add(itemJo);
         }
-
-        return reJa;
     }
-
-
 }

+ 1 - 1
src/main/java/fi/em/opplugin/TravelExpensesOpPlugin.java

@@ -34,11 +34,11 @@ public class TravelExpensesOpPlugin extends AbstractOperationServicePlugIn {
             //公司编码
             String number = costcompany.getString("number");
             //公司id
-            long id = costcompany.getLong("id");
             BigDecimal Amount = new BigDecimal(0);
             DynamicObjectCollection tripentry = info.getDynamicObjectCollection("tripentry");
             //循环差旅明细分录获取报信金额
             for (DynamicObject entryentity : tripentry) {
+
                 BigDecimal FOriAmount = entryentity.getBigDecimal("tripapporiamount");
                 Amount=Amount.add(FOriAmount);
             }