| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Void> addRedPackegeSet(@RequestBody RedPackegeSetDto redPackegeSets){ |
| | | List<RedPackegeSet> redPackegeSetList = redPackegeSets.getRedPackegeSets(); |
| | | for (RedPackegeSet redPackegeSet : redPackegeSetList) { |
| | | RedPackegeSet one = redPackegeSetService.getOne(null); |
| | | if (one==null){ |
| | | redPackegeSet.setId(1); |
| | | redPackegeSetService.save(redPackegeSet); |
| | | }else { |
| | | if (one.getId()==null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | redPackegeSetService.updateById(redPackegeSet); |
| | | } |
| | | } |
| | | redPackegeSetService.saveOrUpdateBatch(redPackegeSetList); |
| | | return R.ok(); |
| | | } |
| | | |