From 5c78dd468ae1260abd5622dc6ea31d3520209e03 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 30 May 2025 11:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E7=9B=AE=E6=8E=A5=E5=8F=A3=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fi/fi/webapi/AspAccountControler.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/main/java/shjh/jhzj7/fi/fi/webapi/AspAccountControler.java b/main/java/shjh/jhzj7/fi/fi/webapi/AspAccountControler.java index 4eb253c..293d8a8 100644 --- a/main/java/shjh/jhzj7/fi/fi/webapi/AspAccountControler.java +++ b/main/java/shjh/jhzj7/fi/fi/webapi/AspAccountControler.java @@ -12,6 +12,8 @@ import kd.bos.context.RequestContext; import kd.bos.dataentity.OperateOption; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.db.DB; +import kd.bos.db.DBRoute; import kd.bos.entity.operate.OperateOptionConst; import kd.bos.entity.operate.result.OperationResult; import kd.bos.id.ID; @@ -24,6 +26,7 @@ import kd.bos.openapi.common.result.CustomApiResult; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.OperationServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; import shjh.jhzj7.fi.fi.utils.EsbUtils; import shjh.jhzj7.fi.fi.utils.JhzjUtils; import shjh.jhzj7.fi.fi.webapi.model.AccountModel; @@ -48,7 +51,7 @@ public class AspAccountControler { private DynamicObject grouporginfo = EsbUtils.getGroupOrg();//获取默认科目表 DynamicObject tableinfo = EsbUtils.getTable();//获取默认科目表 -// private static final String insertSql = "insert into T_BD_Account_U (fdataid,fuseorgid) values (?,?);"; + private static final String insertSql = "insert into T_BD_Account_U (fdataid,fuseorgid) values (?,?);"; /** * @param bizParam 入参json格式数据 @@ -270,15 +273,15 @@ public class AspAccountControler { checkitementryInfo.set("isrequire", false);//必录 } acctInfo.set("isassist", true);//主表的isassist是否包含核算项目为是 -// SaveServiceHelper.save(new DynamicObject[]{acctInfo}); - operResult = OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{acctInfo}, oop); - if(!operResult.isSuccess()){ - log.error(String.format("科目保存失败:%s", json_body.toJSONString())); - itemInfo = new JSONObject(); - itemInfo.put("code",number); - itemInfo.put("error","科目保存失败"+operResult.getMessage()); - itemsJson.add(itemInfo); - } + SaveServiceHelper.save(new DynamicObject[]{acctInfo}); +// operResult = OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{acctInfo}, oop); +// if(!operResult.isSuccess()){ +// log.error(String.format("科目保存失败:%s", json_body.toJSONString())); +// itemInfo = new JSONObject(); +// itemInfo.put("code",number); +// itemInfo.put("error","科目保存失败"+operResult.getMessage()); +// itemsJson.add(itemInfo); +// } companyAcctMaps.put(number+companynum,acctInfo); } } @@ -430,10 +433,10 @@ public class AspAccountControler { //手动指定科目的金蝶id newAcctInfo.set("id", ID.genLongId()); newAcctInfo.set("masterid", olddo.getLong("id"));//主数据内码,系统不会根据id自动生成,需要手动设置 -// SaveServiceHelper.save(new DynamicObject[]{newAcctInfo}); - OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{newAcctInfo}, OperateOption.create()); + SaveServiceHelper.save(new DynamicObject[]{newAcctInfo}); +// OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{newAcctInfo}, OperateOption.create()); //处理科目使用范围 -// DB.update(DBRoute.of("fi"), insertSql, new Object[]{newAcctInfo.getLong("id"),hsorgInfo.getLong("id")}); + DB.update(DBRoute.of("fi"), insertSql, new Object[]{newAcctInfo.getLong("id"),hsorgInfo.getLong("id")}); return newAcctInfo; }