泛微OA E9开发:通过代码插入建模表数据

泛微OA E9开发:通过代码插入建模表数据

直接通过操作数据库的方式添加建模表数据,建模表是不会展示出来的。需要通过标准方法新增后,然后获取新增的空数据id,再通过update语句去改字段的值

private static final  BaseBean baseBean = new BaseBean();
// SYN_PERSON_TABLE_NAME 建模表名
private static final String SYN_PERSON_TABLE_NAME = baseBean.getPropValue("kq_qc2802264","SYN_PERSON_TABLE_NAME");
// SYN_PERSON_FLOW_ID 模块id
private static final int SYN_PERSON_FLOW_ID = Integer.parseInt(baseBean.getPropValue("kq_qc2802264","SYN_PERSON_FLOW_ID"));
// 获取现在的时间
LocalDate currentDate = LocalDate.now();
LocalTime currentTime = LocalTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH-mm-ss");
String _currentTime = currentTime.format(formatter);
int id = ModeDataIdUpdate.getInstance().getModeDataNewIdByUUID(SYN_PERSON_TABLE_NAME, SYN_PERSON_FLOW_ID, 1, 1, currentDate.toString(), _currentTime);
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
// 新建的时候添加共享
ModeRightInfo.editModeDataShare(1, SYN_PERSON_FLOW_ID, id);
// 新建的时候添加文档共享
ModeRightInfo.addDocShare(1, SYN_PERSON_FLOW_ID, id);

String updateSql = "update " + SYN_PERSON_TABLE_NAME + " set kqdate=?,resourceid=?,forgotcheckMins=?,workmins=?,attendanceMins=?,belatemins=?,leaveearlymins=?,absenteeismins=? where id=" + id;
recordSet.executeUpdate(updateSql, kqExceptionBean.getKqdate(), kqExceptionBean.getResourceid(), kqExceptionBean.getForgotcheckMins(), kqExceptionBean.getWorkmins(), kqExceptionBean.getAttendanceMins(), kqExceptionBean.getBelatemins(), kqExceptionBean.getLeaveearlymins(), Math.max(kqExceptionBean.getAbsenteeismins(), 0));

新增完数据之后之后其实还是只有创建人有权限查看,如果需要给默认共享的人员查看的话需要权限重构一下。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值