コード例 #1
0
 /*
  * 发布项目 wangchao
  */
 @Override
 @Transactional(rollbackFor = Exception.class, timeout = 30)
 public int publishProject(PublishProjectReq req) {
   // 1.项目主表project
   req.getProject().setCreatename(req.getPublishName());
   // String projectimage =req.getProject().getProjectimage();
   // projectimage=PropertyUtils.getProperty("ImgShowUrl")+projectimage;
   long i = projectDao.insert(req.getProject());
   if (i > 0) {
     // 2.插入策略表 projectstrategy
     req.getProjectStrategyList().forEach(action -> action.setProjectid(req.getProject().getId()));
     int proStrategyResult = projectStrategyDao.insertList(req.getProjectStrategyList());
     // 3.项目图片表 projectimage
     if (proStrategyResult > 0) {
       req.getProjectImageList().forEach(action -> action.setProjectid(req.getProject().getId()));
       int k = projectImageDao.insertList(req.getProjectImageList());
       if (k > 0) {
         return 1;
       }
     }
   }
   return 0;
 }
コード例 #2
0
 @Override
 public long insert(Project record) {
   return projectDao.insert(record);
 }