|
@@ -18,6 +18,20 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
@Service
|
|
|
public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMapper, PrivateStandard>
|
|
|
implements PrivateStandardService {
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public boolean insert(PrivateStandard uWbsPrivateStandard) {
|
|
|
+ BladeUser user = SecureUtil.getUser();
|
|
|
+ uWbsPrivateStandard.setCreateUser(user.getUserId());
|
|
|
+ if(uWbsPrivateStandard.getType() == 2){
|
|
|
+ //修改之前的规则为过期
|
|
|
+ baseMapper.update(null, Wrappers.<PrivateStandard>lambdaUpdate()
|
|
|
+ .set(PrivateStandard::getStatus, 2)
|
|
|
+ .eq(PrivateStandard::getParentId, uWbsPrivateStandard.getParentId())
|
|
|
+ .eq(PrivateStandard::getStatus, 1));
|
|
|
+ }
|
|
|
+ return baseMapper.insert(uWbsPrivateStandard) > 0;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|