public static void main(String[] args) {
List<CgcEnterpriseBusinessHoursReq> businessHoursReqs=req.getEncEnterpriseBusinessHoursReq();
for (int i = 0; i < businessHoursReqs.size(); i++) {
CgcEnterpriseBusinessHoursReq cgcEnterpriseBusinessHoursReq = businessHoursReqs.get(i);
cgcEnterpriseBusinessHoursReq.setEnterpriseId(enterpriseId);
enterpriseBasicMapper.insertBusinessHours(cgcEnterpriseBusinessHoursReq);
Long timeId=cgcEnterpriseBusinessHoursReq.getId();
List<CgcEnterpriseBusinessTimeReq> cgcEnterpriseBusinessTimeReq=cgcEnterpriseBusinessHoursReq.getCgcEnterpriseBusinessTimeReq();
cgcEnterpriseBusinessTimeReq.stream().filter(Objects::nonNull).forEach(a -> a.setBusinessDayId(timeId));
enterpriseBasicMapper.insertBusinessTime(cgcEnterpriseBusinessTimeReq);
}
}
将插入语句获取的id快速set到另一个数组对象里去
最新推荐文章于 2023-01-03 18:24:44 发布