科目接口优化
This commit is contained in:
		
							parent
							
								
									9d85ab6f4c
								
							
						
					
					
						commit
						5c78dd468a
					
				|  | @ -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; | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue