Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2682 commits
Select commit Hold shift + click to select a range
ddcf8a8
Merge branch 'release/1.7.0' of github.com:vikadata/vikadata into dev…
ChambersChan Dec 25, 2023
d898293
Merge commit 'fd1aeae360804caa0994774498eda28fa2b0cd08' into develop
ChambersChan Dec 25, 2023
2a771ef
fix: sync code conflicts
ChambersChan Dec 25, 2023
af3d5ae
fix: trigger cron (#10064)
Dec 25, 2023
a0d6e15
sync: apitable to vikadata (#10065)
ChambersChan Dec 25, 2023
19c0f67
fix: automation schedule (#10068)
Dec 25, 2023
5d64747
fix: build apitable error (#10066)
ChambersChan Dec 25, 2023
4ab4048
Fix/fix data for style for list (#10053)
Dec 25, 2023
85555b7
fix: fix issue for time format (#10073)
Dec 25, 2023
ea1dd04
Fix/fix style backend (#10077)
Dec 25, 2023
30d1f50
fix: view filter style (#10078)
wangkailang Dec 25, 2023
8c3d289
Fix/fix auto width (#10081)
Dec 25, 2023
630233c
fix: view filter input style (#10084)
wangkailang Dec 25, 2023
f3dac5f
fix: modify queue cofig (#10087)
Dec 25, 2023
0c1d0d8
fix: management with space info (#10090)
wangkailang Dec 25, 2023
7d9dabb
fix: non schedule trigger update error (#10095)
Dec 25, 2023
4848cc7
fix: fix issue for timing minute (#10082)
Dec 25, 2023
430f912
fix: workdoc text selection (#10106)
wangkailang Dec 26, 2023
cf96a9e
fix: make wizard to enterprise (#10109)
wangkailang Dec 26, 2023
7577c29
refactor: copilot in space (#10111)
shawndenggh Dec 26, 2023
1005180
fix: broadcast anonymous user (#10122)
wangkailang Dec 26, 2023
a808be3
feat: register quote templates (#10125)
ChambersChan Dec 26, 2023
d6dce37
fix: gantt group item delete crash (#10126)
wangkailang Dec 26, 2023
9578b72
fix: aitable feedback to email (#10130)
wangkailang Dec 26, 2023
b8f38d2
Feat/ai status key (#10135)
jeremyyin2012 Dec 26, 2023
6ecbf80
feat: copilot (#9955)
luckyyyyy Dec 26, 2023
1185bbd
fix: automation trigger (#10124)
Dec 26, 2023
89fbbb1
Fix/tz fix timezone issue1 (#10141)
Dec 27, 2023
b57b4e6
fix: delete error timezone select (#10132)
wangkailang Dec 27, 2023
606243f
Fix/fix automation fix (#10143)
Dec 27, 2023
40865d5
fix: the novice guide cannot be triggered (#10146)
JaneSu Dec 27, 2023
ade5ca0
fix: fix at text for text at (#10148)
Dec 27, 2023
f043c32
fix: fix issue for widget dropdown (#10151)
Dec 27, 2023
d68c1b3
feat(ai): stream format fix and img fix (#10150)
jeremyyin2012 Dec 27, 2023
92d4a34
fix: timezone dst false (#10163)
wangkailang Dec 27, 2023
02ca2e8
fix: recovery worker env (#10171)
Dec 27, 2023
53189bd
feat: credit used reset every month (#10177)
shawndenggh Dec 27, 2023
fff5f1f
fix: form desc show more (#10178)
wangkailang Dec 27, 2023
ccc0a11
Feature/time zone update (#10179)
Dec 27, 2023
6af380d
feat: server call cancel conversations (#10183)
shawndenggh Dec 27, 2023
f7bd721
fix: copilot styles (#10187)
luckyyyyy Dec 27, 2023
098efb4
fix: fix tips color (#10188)
Dec 27, 2023
3c2e54f
fix: calculate cycle date error (#10189)
shawndenggh Dec 27, 2023
7b663aa
fix: remove chatbot count to seat usage (#10196)
shawndenggh Dec 27, 2023
392d19a
fix desc of copilot agent (#10194)
yanming71107Zhang Dec 28, 2023
baa73ed
chore: version 1.8.0 (#10198)
wangkailang Dec 28, 2023
ee34046
fix: formula substitute exam (#10210)
wangkailang Dec 28, 2023
5f3f519
Hotfix/cola (#10211)
JaneSu Dec 28, 2023
a3fa3aa
Fix/ai copilot empty msg (#10214)
jeremyyin2012 Dec 28, 2023
3b20aa6
fix: send subscription remove field permission check (#10221)
Dec 28, 2023
224489a
Hotfix/cola (#10220)
JaneSu Dec 28, 2023
3b98cc4
fix: revert system config (#10226)
wangkailang Dec 28, 2023
9a6ef8e
fix: fetch favorite expand list (#10225)
wangkailang Dec 28, 2023
2811084
Hotfix/cola (#10231)
JaneSu Dec 28, 2023
018237a
fix: consumer env conflict (#10234)
Dec 28, 2023
17f084b
Fix/fix guide automation tips (#10240)
Dec 28, 2023
c4063c0
Fix/fix select dropdown (#10242)
Dec 28, 2023
40a8c26
fix: fix issue for dropdown select (#10243)
Dec 28, 2023
3d9957e
revert: ai form code (#10235)
shawndenggh Dec 28, 2023
8153fb6
fix: fix issue for build (#10245)
Dec 28, 2023
7c566bf
Fix/multi text focus border (#10244)
wangkailang Dec 28, 2023
8900e33
fix: cannot find ai router (#10254)
Dec 28, 2023
2ecf9d3
feat: workdoc upload video (#9560)
okisdev Dec 28, 2023
866dd0e
fix: workdoc translate (#10257)
okisdev Dec 29, 2023
5b8affe
feat: workdoc download (#9674)
wangkailang Dec 29, 2023
ccdfacb
Hotfix/cola (#10264)
JaneSu Dec 29, 2023
c99dbe6
fix: fix issue for variable edit (#10265)
Dec 29, 2023
3aa485b
Hotfix/cola (#10270)
JaneSu Dec 29, 2023
a0d8712
fix: avatar group refactor (#10258)
okisdev Dec 29, 2023
c45ed33
chore: update open_guide_wizards actions in system_config.source.json…
xukecheng Dec 29, 2023
d180f54
chore: add some log for variable text (#10280)
Dec 29, 2023
434edec
chore: update changelog (#10283)
xukecheng Dec 29, 2023
e2727ec
Fix/crash dingding update slatejs (#10290)
Dec 29, 2023
3ba8139
chore: add 1.8.0 changelog wizard (#10269)
xukecheng Dec 29, 2023
bc95c81
fix: upgrade slate (#10295)
Jan 2, 2024
c018f67
Merge branch 'develop' into release-to-develop
zoe-icu Jan 2, 2024
8c606d8
Merge commit '5e6dee2e903c010cc727cc3c1798f33542bbb523' into develop
zoe-icu Jan 2, 2024
f507ccb
fix: favorite expand load data (#10303)
wangkailang Jan 2, 2024
f1ed598
Fix/ automation flex layout for ui (#10299)
Jan 2, 2024
771a212
fix: fix issue for automation text i18n (#10304)
Jan 2, 2024
a2396e3
chore: update 1.8.0 changelog (#10307)
xukecheng Jan 2, 2024
7e3ce29
feat: node embed (#10251)
Jan 2, 2024
2cb486e
fix: ai env (#10314)
luckyyyyy Jan 3, 2024
44da587
fix: fix i18n for time scheduler (#10316)
Jan 3, 2024
c4b9e38
fix: embed page node unit test (#10317)
ChambersChan Jan 3, 2024
70e7310
refactor: refactor use_network hook (#10319)
JaneSu Jan 3, 2024
008e9bb
feat: space email invitation (#10312)
ChambersChan Jan 3, 2024
6ef47c7
fix: fix white space pre (#10322)
Jan 3, 2024
47a0766
fix: appsumo mobile app cannot be activated (#10324)
JaneSu Jan 3, 2024
bd120b5
feat: replace filter options with current username (#10323)
yo-ooiii Jan 3, 2024
538981a
fix: fix issue for english in time schedule (#10325)
Jan 3, 2024
0205744
fix: add embed page node prefix (#10329)
Jan 3, 2024
f8049e1
feat: workdoc plugin image preview (#10327)
wangkailang Jan 3, 2024
a260077
feat: upgrade vulnerable libs (#10332)
shawndenggh Jan 4, 2024
ae0e41e
fix: fix issue for button field visible (#10334)
Jan 4, 2024
a17951e
feat: workdoc html to markdown (#10338)
wangkailang Jan 4, 2024
921a16a
fix: fix issue for initial color of button field (#10341)
Jan 4, 2024
d943d77
feat: update node support update embed page info (#10336)
Jan 4, 2024
0109bc9
fix: jar build (#10342)
shawndenggh Jan 4, 2024
5488fe9
fix: update node param error (#10343)
Jan 4, 2024
c4c3b72
fix: embed code 201 limit (#10344)
wangkailang Jan 4, 2024
0500c72
feat: unarchive records link (#10348)
wangkailang Jan 5, 2024
bea714e
fix: fix active status for button column (#10352)
Jan 5, 2024
d857c48
fix: appsumo feature (#10349)
Jan 5, 2024
119da05
fix: fix add context menu divider (#10355)
Jan 5, 2024
5d6685a
feat: embed page (#10354)
JaneSu Jan 5, 2024
643033c
fix: hidden field ellipsis tip (#10356)
wangkailang Jan 5, 2024
f9728d5
Feat/embed page (#10357)
JaneSu Jan 5, 2024
8b222e1
Fix/add context menu update color (#10358)
Jan 5, 2024
81aea44
fix: cell copy permission (#10359)
wangkailang Jan 5, 2024
f938125
fix: contact us wizard (#10363)
wangkailang Jan 5, 2024
81e7f5e
fix: check style (#10361)
Jan 5, 2024
8772e05
Feat/embed page (#10364)
JaneSu Jan 5, 2024
29c6b83
fix: comment submit clear content (#10369)
wangkailang Jan 5, 2024
2f56531
fix: node share return extra (#10371)
Jan 5, 2024
90cbc77
fix: subscription control form brand (#10372)
wangkailang Jan 5, 2024
fc67d1b
fix: fix bg for tooltip base (#10374)
Jan 8, 2024
f94c89d
Feat/embed page (#10376)
JaneSu Jan 8, 2024
01628b2
feat/merge apitable
robot518 Jan 8, 2024
2036c17
Feat/unify scrollbar style (#10345)
yo-ooiii Jan 8, 2024
f7c5991
fix: ci err
robot518 Jan 8, 2024
e459cf5
fix: ci err
robot518 Jan 8, 2024
fe6530b
sync: apitable to vikadata (#10377)
robot518 Jan 8, 2024
c202ca7
Feat/embed page (#10378)
JaneSu Jan 8, 2024
19656de
fix: invite bg style (#10384)
wangkailang Jan 8, 2024
691d901
Fix/fix style issue for automtion in view (#10391)
Jan 8, 2024
b237fda
fix: define scroll bar (#10392)
wangkailang Jan 8, 2024
eaa0852
fix: automation delete error with body (#10393)
Jan 9, 2024
d4892d5
fix: workdoc video strings (#10396)
wangkailang Jan 9, 2024
5309487
fix: fix issue for view button column (#10398)
Jan 9, 2024
ea4ef3c
fix: kanban button height adapt (#10402)
wangkailang Jan 9, 2024
b8fe48d
chore: migrate chatbot enable & lab feature ops api (#10403)
ChambersChan Jan 9, 2024
cbd91f8
feat: move add/update trigger to java (#10397)
Jan 9, 2024
138cf0a
chore: revert email invitation change logic (#10409)
ChambersChan Jan 9, 2024
8a81c27
fix: sync color tokens (#10408)
wangkailang Jan 9, 2024
4c83f5f
feature: enable sourcemap (#10428)
Jan 10, 2024
ca34074
fix: template usage crash (#10431)
wangkailang Jan 10, 2024
acbcb84
test: move schedule trigger test to enterprise (#10429)
Jan 10, 2024
b1085a6
fix: fix issue for build error (#10432)
Jan 10, 2024
8137d1f
Feature/fix update env (#10433)
Jan 10, 2024
62022c5
fix: datetime field format (#10435)
wangkailang Jan 10, 2024
c94d17f
fix: form workdoc click crash (#10436)
wangkailang Jan 10, 2024
4fc6524
feat: revert meta archived record id (#10437)
chalme Jan 10, 2024
1081e59
fix: date field hidden time setting (#10452)
wangkailang Jan 11, 2024
dd6171a
Feat/embed page (#10454)
JaneSu Jan 11, 2024
9e25f68
Feat/embed page (#10456)
JaneSu Jan 11, 2024
06bd1e6
Feat/embed page (#10460)
JaneSu Jan 11, 2024
a967708
Merge branch 'release/1.8.0' into refactor/release-to-develop
zoe-icu Jan 11, 2024
e76da5c
feat: archive record status (#10458)
wangkailang Jan 11, 2024
ccbad32
release: release/1.8.0 to develop (#10463)
Jan 11, 2024
0f0a3e2
fix: archive record update meta (#10468)
wangkailang Jan 12, 2024
0f67ead
chore(deps): bump socket.io-client-java to 2.1.0 (#10469)
ChambersChan Jan 12, 2024
c733498
fix: socket messages will be executed in error environments (#10476)
JaneSu Jan 12, 2024
12fb53c
fix: workdoc download html styles (#10477)
wangkailang Jan 12, 2024
a75b6f8
fix: shortcut keys type (#10479)
wangkailang Jan 12, 2024
7a244b5
Fix/fix robot trigger cra (#10481)
Jan 12, 2024
cb2af07
fix: widget aitable default lang en (#10484)
wangkailang Jan 12, 2024
90a016f
feat: appsumo cannot change main admin (#10482)
Jan 12, 2024
9be4df4
fix: widget build fail (#10490)
wangkailang Jan 15, 2024
c4f6cd4
Merge branch 'develop' of github.com:vikadata/vikadata into chore-mer…
chalme Jan 15, 2024
2bd24a5
feat: merge
chalme Jan 15, 2024
802175a
fix: user remind (#10496)
Jan 15, 2024
aad3a3b
fix: update window lang by userinfo (#10498)
wangkailang Jan 15, 2024
8ecbc57
fix: update sentry deps version (#10499)
wangkailang Jan 15, 2024
f242555
fix: close #10488 (#10500)
JaneSu Jan 15, 2024
aad26e9
fix: record history style (#10501)
wangkailang Jan 15, 2024
7f0dd0f
chore: replace feedback url (#10508)
Jan 16, 2024
f64b5c1
fix: max index column error (#10519)
wangkailang Jan 17, 2024
458bba4
fix: support dst timezone (#10518)
wangkailang Jan 17, 2024
0c5ee4a
Hotfix/cola (#10507)
JaneSu Jan 17, 2024
b36f159
fix: archived record link disable (#10523)
wangkailang Jan 17, 2024
f0f63c3
fix: template album recommend (#10535)
ChambersChan Jan 18, 2024
12a9860
fix: workdoc import update (#10541)
wangkailang Jan 18, 2024
12f4fe1
Fix/embed page (#10543)
JaneSu Jan 18, 2024
adfa08c
Hotfix/cola (#10546)
JaneSu Jan 18, 2024
2be06c2
fix: workdoc image action style (#10547)
wangkailang Jan 18, 2024
a1e3294
Merge branch 'release/1.8.0' into develop
zoe-icu Jan 18, 2024
16a0b15
feat: add exclusive limit desc (#10559)
Jan 19, 2024
c6d589d
chore: update archive notice message (#10558)
Jan 19, 2024
d97613f
fix: error var lang (#10560)
Jan 19, 2024
6e0120e
fix: public share style (#10562)
wangkailang Jan 19, 2024
6f0d1a4
fix: un archive record link (#10563)
wangkailang Jan 19, 2024
0bc192c
feat: load link datasheet pack (#10565)
Jan 22, 2024
6f42592
fix: link field valid archive record (#10569)
wangkailang Jan 22, 2024
2945fb1
feat: change node type (#10571)
Jan 22, 2024
a60ed2c
Fix/cola (#10570)
JaneSu Jan 22, 2024
5417dbb
fix: node copy (#10572)
Jan 22, 2024
a6a506b
fix: return extra info (#10574)
Jan 22, 2024
b033a74
fix: cascader recursion lookup field (#10573)
wangkailang Jan 23, 2024
b70bda0
chore: add and update custom page l10n string (#10575)
wmEvie Jan 23, 2024
6010067
Merge branch 'develop' of github.com:vikadata/vikadata into chore-mer…
jeremyyin2012 Jan 23, 2024
86b7f67
fix: datasheet enterprise lint error (#10576)
wangkailang Jan 23, 2024
64020e8
Merge commit '54ae71107446c1235df47ac4337578787e5d0595' into develop
jeremyyin2012 Jan 23, 2024
161613d
sync: apitable to vikadata (#10580)
jeremyyin2012 Jan 23, 2024
1f47be9
fix: template create with extra (#10581)
Jan 23, 2024
c6737cf
Fix/cola (#10583)
JaneSu Jan 23, 2024
3177fa7
Fix/cola (#10584)
JaneSu Jan 23, 2024
9cf6664
fix: widget custom warning style (#10585)
wangkailang Jan 23, 2024
dceba15
Fix/cola (#10586)
JaneSu Jan 23, 2024
4f2f888
fix: link expend hide achive action (#10587)
wangkailang Jan 23, 2024
8685a7f
fix: update lock file (#10588)
wangkailang Jan 23, 2024
c4544da
fix: ci error (#10589)
JaneSu Jan 24, 2024
bf9df72
fix: close #10533 (#10591)
JaneSu Jan 24, 2024
a9e0b6e
fix: inconsistency ignore archive record (#10593)
wangkailang Jan 24, 2024
1f644be
Fix/cola (#10595)
JaneSu Jan 24, 2024
edd6e50
fix: adjust node permission on custom page node type (#10596)
Jan 24, 2024
f319bfd
fix: template modal select z-index (#10597)
wangkailang Jan 24, 2024
09c32c4
Fix/cola (#10599)
JaneSu Jan 24, 2024
633d4cc
chore: version 1.9.0 (#10600)
wangkailang Jan 24, 2024
e2a8fb5
chore: changbe record activity help url (#10556)
Jan 24, 2024
a9d9b6d
chore: update record activity help url (#10605)
Jan 25, 2024
58f9e9c
fix: one way link trigger cell updated (#10608)
wangkailang Jan 25, 2024
8a00a6e
fix: aitable feedback link (#10614)
wangkailang Jan 25, 2024
624480d
Chore/update custom page url string (#10617)
wmEvie Jan 25, 2024
9810aae
fix: data format no year (#10624)
wangkailang Jan 25, 2024
72a7600
fix: error name about advanced feature (#10622)
Jan 25, 2024
9c0290a
fix: view save lottie (#10626)
wangkailang Jan 25, 2024
29b1d45
fix: open workdoc delete cellvalue (#10630)
wangkailang Jan 25, 2024
d1dbcb3
fix: link show archive record (#10632)
wangkailang Jan 25, 2024
f76c012
fix: cycle dependence (#10639)
Jan 26, 2024
cb5c745
fix: adjust ai async (#10641)
luckyyyyy Jan 26, 2024
a16a61a
fix: queue listener register (#10643)
Jan 26, 2024
e5fa1da
fix: delete archive record clear invalid link record (#10644)
wangkailang Jan 26, 2024
769bb1d
Merge branch 'release/1.9.0' of github.com:vikadata/vikadata into cho…
wangkailang Jan 26, 2024
c348540
chore:add 1.9.0 changelog wizard (#10631)
yanming71107Zhang Jan 26, 2024
d388a15
chore: merge 1.9.0 (#10646)
wangkailang Jan 26, 2024
db60641
update custom page en url (#10650)
wmEvie Jan 26, 2024
364d4c4
chroe: wizard 1.9.0 changelog (#10656)
wangkailang Jan 29, 2024
3df8136
sync: release/1.9.0 to develop (#10657)
JoverZhang Jan 29, 2024
376851c
Merge commit 'bc14c3118d30014469d7801c6f1a336afce93d16' into develop
JoverZhang Jan 29, 2024
e61a106
chore: update lock file
JoverZhang Jan 29, 2024
ec81f77
fix: sub admin show
wangkailang Jan 29, 2024
b7bb065
fix: fix
wangkailang Jan 29, 2024
08994ae
fix: enterprise import check
wangkailang Jan 29, 2024
2b81f68
fix: enterprise import check (#10662)
wangkailang Jan 29, 2024
51c3eb2
fix: pnpm lockfile update (#10664)
wangkailang Jan 29, 2024
0ee6ae0
fix: workdoc editor import path (#10666)
wangkailang Jan 29, 2024
2aa4c1b
feat: alipay and wechatpay (#10598)
Jan 31, 2024
4a3dfc6
Fix/cola (#10682)
JaneSu Feb 1, 2024
b4f1ed4
chore: update week abbreviation l10n string (#10684)
wmEvie Feb 1, 2024
99d1ccb
Fix/cola (#10686)
JaneSu Feb 1, 2024
3b97017
Fix/cola (#10689)
JaneSu Feb 1, 2024
66dab1e
fix: email notification member name (#10690)
Feb 1, 2024
ce4c19a
Fix/cola (#10692)
JaneSu Feb 2, 2024
a294f23
fix: apiusage add concurrent lock (#10696)
Feb 2, 2024
630be71
Fix/cola (#10697)
JaneSu Feb 2, 2024
aff505b
fix: ai component build error (#10698)
wangkailang Feb 2, 2024
83668be
fix: icons attrs warning (#10700)
wangkailang Feb 2, 2024
136464b
release: release/1.9.0 to develop (#10708)
Feb 5, 2024
cbc6eb7
Merge commit '657904162cb5987b1c9f456816245265797dc1ec' into develop
zoe-icu Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend-server/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ dependencies {
}
implementation libs.auth0
implementation libs.pingpp
implementation libs.alipay.easy
implementation libs.wechatpay
implementation libs.stripe
implementation(libs.aliyun.core) {
exclude(group: 'commons-logging', module: 'commons-logging')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import com.apitable.core.exception.BusinessException;
import com.apitable.core.support.ResponseData;
import com.apitable.core.util.ExceptionUtil;
import com.apitable.interfaces.billing.facade.EntitlementServiceFacade;
import com.apitable.interfaces.billing.model.SubscriptionInfo;
import com.apitable.interfaces.security.facade.BlackListServiceFacade;
import com.apitable.interfaces.security.facade.HumanVerificationServiceFacade;
import com.apitable.interfaces.security.model.NonRobotMetadata;
Expand Down Expand Up @@ -148,6 +150,9 @@ public class MemberController {
@Resource
private HumanVerificationServiceFacade humanVerificationServiceFacade;

@Resource
private EntitlementServiceFacade entitlementServiceFacade;

/**
* Fuzzy Search Members.
*/
Expand Down Expand Up @@ -508,6 +513,11 @@ public ResponseData<UploadParseResultVO> uploadExcel(UploadMemberTemplateRo data
// check black space
blackListServiceFacade.checkSpace(spaceId);
iSpaceService.checkCanOperateSpaceUpdate(spaceId);
SubscriptionInfo subscriptionInfo =
entitlementServiceFacade.getSpaceSubscription(spaceId);
if (subscriptionInfo.isFree() && iMemberService.shouldPreventInvitation(spaceId)) {
return ResponseData.success(new UploadParseResultVO());
}
UploadParseResultVO resultVo = iMemberService.parseExcelFile(spaceId, data.getFile());
return ResponseData.success(resultVo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,4 +752,12 @@ void sendInviteNotification(Long fromUserId, List<Long> invitedMemberIds, String
* @return space ids
*/
List<String> getUserOwnSpaceIds(Long userId);

/**
* check space invited record.
*
* @param spaceId space id
* @return boolean
*/
boolean shouldPreventInvitation(String spaceId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import jakarta.annotation.Resource;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -506,28 +507,6 @@ public void restoreMember(MemberEntity member) {
baseMapper.restoreMember(member);
}

@Override
@Transactional(rollbackFor = Exception.class)
public List<String> emailInvitation(Long inviteUserId, String spaceId, List<String> emails) {
// remove empty string or null element in collection, then make it distinct
final List<String> distinctEmails =
CollectionUtil.distinctIgnoreCase(CollUtil.removeBlank(emails));
if (distinctEmails.isEmpty()) {
return new ArrayList<>();
}
List<String> emailsInSpace = memberMapper.selectEmailBySpaceIdAndEmails(spaceId, emails);
List<String> emailsNotInSpace = CollUtil.subtractToList(distinctEmails, emailsInSpace);
if (emailsNotInSpace.isEmpty()) {
return new ArrayList<>();
}
// create member
this.createInvitationMember(inviteUserId, spaceId, emailsNotInSpace);
// send email
invitationServiceFacade.sendInvitationEmail(
new MultiInvitationMetadata(inviteUserId, spaceId, emailsNotInSpace));
return emailsNotInSpace;
}

@Override
@Transactional(rollbackFor = Exception.class)
public void createInvitationMember(Long inviteUserId, String spaceId,
Expand Down Expand Up @@ -951,10 +930,14 @@ public void batchDeleteMemberFromSpace(String spaceId, List<Long> memberIds,
}
}
List<MemberEntity> memberEntities = baseMapper.selectBatchIds(memberIds);
List<Long> needSendEmailMemberIds = new ArrayList<>();
// The invitation link is invalid and the public link it created is deleted
if (CollUtil.isNotEmpty(memberEntities)) {
List<String> deleteMails = new ArrayList<>();
for (MemberEntity filter : memberEntities) {
if (filter.getIsActive()) {
needSendEmailMemberIds.add(filter.getId());
}
if (StrUtil.isNotBlank(filter.getEmail())) {
deleteMails.add(filter.getEmail());
}
Expand All @@ -979,8 +962,11 @@ public void batchDeleteMemberFromSpace(String spaceId, List<Long> memberIds,
if (!mailNotify) {
return;
}
if (needSendEmailMemberIds.isEmpty()) {
return;
}
String spaceName = iSpaceService.getNameBySpaceId(spaceId);
final List<String> emails = this.getEmailsByMemberIds(memberIds);
final List<String> emails = this.getEmailsByMemberIds(needSendEmailMemberIds);
Dict dict = Dict.create();
dict.set("SPACE_NAME", spaceName);
Dict mapDict = Dict.create();
Expand Down Expand Up @@ -1028,61 +1014,24 @@ public void preDelBySpaceId(String spaceId, Long userId) {

@Override
@Transactional(rollbackFor = Exception.class)
public UploadParseResultVO parseExcelFile(String spaceId, MultipartFile multipartFile) {
// subscribe to the limit
// iSubscriptionService.checkSeat(spaceId);
// manipulate user information in space
UserSpaceDto userSpaceDto = LoginContext.me().getUserSpaceDto(spaceId);
UploadParseResultVO resultVo = new UploadParseResultVO();
try {
// obtaining statistics
int currentMemberCount =
(int) SqlTool.retCount(staticsMapper.countMemberBySpaceId(spaceId));
SubscriptionInfo subscriptionInfo =
entitlementServiceFacade.getSpaceSubscription(spaceId);
long maxSeatNums = subscriptionInfo.getFeature().getSeat().getValue();
// long defaultMaxMemberCount = iSubscriptionService.getPlanSeats(spaceId);
// Use the object to read data row by row,
// set the number of rows in the table header,
// and start reading data at line 4, asynchronous reading.
UploadDataListener listener =
new UploadDataListener(spaceId, this, maxSeatNums, currentMemberCount)
.resources(userSpaceDto.getResourceCodes());
EasyExcel.read(multipartFile.getInputStream(), listener).sheet().headRowNumber(3)
.doRead();
// gets the parse store record
resultVo.setRowCount(listener.getRowCount());
resultVo.setSuccessCount(listener.getSuccessCount());
resultVo.setErrorCount(listener.getErrorCount());
resultVo.setErrorList(listener.getErrorList());
// save the error message to the database
AuditUploadParseRecordEntity record = new AuditUploadParseRecordEntity();
record.setSpaceId(spaceId);
record.setRowSize(listener.getRowCount());
record.setSuccessCount(listener.getSuccessCount());
record.setErrorCount(listener.getErrorCount());
record.setErrorMsg(JSONUtil.toJsonStr(listener.getErrorList()));
auditUploadParseRecordMapper.insert(record);
// send an invitation email
this.batchSendInviteEmailOnUpload(spaceId, userSpaceDto.getMemberId(),
listener.getSendInviteEmails());
this.batchSendInviteNotifyEmailOnUpload(spaceId, userSpaceDto.getMemberId(),
listener.getSendNotifyEmails());
Long userId = userSpaceDto.getUserId();
TaskManager.me().execute(
() -> this.sendInviteNotification(userId, listener.getMemberIds(), spaceId, false));
} catch (IOException e) {
log.error("file cannot be read", e);
throw new BusinessException(OrganizationException.EXCEL_CAN_READ_ERROR);
} catch (BusinessException e) {
log.error("exceed over limit");
throw new BusinessException(LimitException.SEATS_OVER_LIMIT);
} catch (Exception e) {
log.error("fail to parse file", e);
throw new BusinessException(
"Failed to parse the file. Download the template and import it");
public List<String> emailInvitation(Long inviteUserId, String spaceId, List<String> emails) {
// remove empty string or null element in collection, then make it distinct
final List<String> distinctEmails =
CollectionUtil.distinctIgnoreCase(CollUtil.removeBlank(emails));
if (distinctEmails.isEmpty()) {
return new ArrayList<>();
}
return resultVo;
List<String> emailsInSpace = memberMapper.selectEmailBySpaceIdAndEmails(spaceId, emails);
List<String> emailsNotInSpace = CollUtil.subtractToList(distinctEmails, emailsInSpace);
if (emailsNotInSpace.isEmpty()) {
return new ArrayList<>();
}
// create member
this.createInvitationMember(inviteUserId, spaceId, emailsNotInSpace);
// send email
invitationServiceFacade.sendInvitationEmail(
new MultiInvitationMetadata(inviteUserId, spaceId, emailsNotInSpace));
return emailsNotInSpace;
}

/**
Expand Down Expand Up @@ -1489,4 +1438,79 @@ public Long getMemberIdByUnitId(String spaceId, String unitId) {
public List<String> getUserOwnSpaceIds(Long userId) {
return baseMapper.selectSpaceIdsByUserIdAndIsAdmin(userId, true);
}

@Override
@Transactional(rollbackFor = Exception.class)
public UploadParseResultVO parseExcelFile(String spaceId, MultipartFile multipartFile) {
// subscribe to the limit
// iSubscriptionService.checkSeat(spaceId);
// manipulate user information in space
UserSpaceDto userSpaceDto = LoginContext.me().getUserSpaceDto(spaceId);
UploadParseResultVO resultVo = new UploadParseResultVO();
try {
// obtaining statistics
int currentMemberCount =
(int) SqlTool.retCount(staticsMapper.countMemberBySpaceId(spaceId));
SubscriptionInfo subscriptionInfo =
entitlementServiceFacade.getSpaceSubscription(spaceId);
long maxSeatNums = subscriptionInfo.getFeature().getSeat().getValue();
// long defaultMaxMemberCount = iSubscriptionService.getPlanSeats(spaceId);
// Use the object to read data row by row,
// set the number of rows in the table header,
// and start reading data at line 4, asynchronous reading.
UploadDataListener listener =
new UploadDataListener(spaceId, this, maxSeatNums, currentMemberCount)
.resources(userSpaceDto.getResourceCodes());
EasyExcel.read(multipartFile.getInputStream(), listener).sheet().headRowNumber(3)
.doRead();
// gets the parse store record
resultVo.setRowCount(listener.getRowCount());
resultVo.setSuccessCount(listener.getSuccessCount());
resultVo.setErrorCount(listener.getErrorCount());
resultVo.setErrorList(listener.getErrorList());
// save the error message to the database
AuditUploadParseRecordEntity record = new AuditUploadParseRecordEntity();
record.setSpaceId(spaceId);
record.setRowSize(listener.getRowCount());
record.setSuccessCount(listener.getSuccessCount());
record.setErrorCount(listener.getErrorCount());
record.setErrorMsg(JSONUtil.toJsonStr(listener.getErrorList()));
auditUploadParseRecordMapper.insert(record);
// send an invitation email
this.batchSendInviteEmailOnUpload(spaceId, userSpaceDto.getMemberId(),
listener.getSendInviteEmails());
this.batchSendInviteNotifyEmailOnUpload(spaceId, userSpaceDto.getMemberId(),
listener.getSendNotifyEmails());
Long userId = userSpaceDto.getUserId();
TaskManager.me().execute(
() -> this.sendInviteNotification(userId, listener.getMemberIds(), spaceId, false));
} catch (IOException e) {
log.error("file cannot be read", e);
throw new BusinessException(OrganizationException.EXCEL_CAN_READ_ERROR);
} catch (BusinessException e) {
log.error("exceed over limit");
throw new BusinessException(LimitException.SEATS_OVER_LIMIT);
} catch (Exception e) {
log.error("fail to parse file", e);
throw new BusinessException(
"Failed to parse the file. Download the template and import it");
}
return resultVo;
}

/**
* check space invited record.
*
* @param spaceId space id
* @return boolean
*/
@Override
public boolean shouldPreventInvitation(String spaceId) {
LocalDateTime startAt = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
LocalDateTime endAt =
LocalDateTime.now().plusDays(1).withHour(0).withMinute(0).withSecond(0);
Integer count =
spaceInviteRecordMapper.selectCountBySpaceIdAndBetween(spaceId, startAt, endAt);
return count >= constProperties.getMaxInviteCountForFree();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,12 @@ private Dict formatEmailDetailVo(NotificationCreateRo ro) {
dict.set(EMAIL_SPACE_NAME,
StrUtil.blankToDefault(iSpaceService.getNameBySpaceId(ro.getSpaceId()), ""));
}
long fromUserId = Long.parseLong(ro.getFromUserId());
if (fromUserId > 0) {
String memberName =
StrUtil.blankToDefault(iMemberService.getMemberNameByUserIdAndSpaceId(fromUserId,
ro.getSpaceId()), I18nStringsUtil.t("unnamed"));
dict.set(EMAIL_MEMBER_NAME, memberName);
}
String memberName = null != ro.getFromUserId()
? StrUtil.blankToDefault(
iMemberService.getMemberNameByUserIdAndSpaceId(Long.parseLong(ro.getFromUserId()),
ro.getSpaceId()), I18nStringsUtil.t("unnamed"))
: I18nStringsUtil.t("unnamed");
dict.set(EMAIL_MEMBER_NAME, memberName);
if (ObjectUtil.isNotNull(ro.getBody())) {
JSONObject extras = NotificationHelper.getExtrasFromNotifyBody(ro.getBody());
if (extras != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ public class ConstProperties {

private String emailVerificationUrl = "/user/email_verification";

/**
* max invited record for a single day.
*/
private Integer maxInviteCountForFree = 10;


public OssBucketInfo getOssBucketByAsset() {
return Optional.ofNullable(ossBuckets).orElseGet(HashMap::new)
.getOrDefault(BucketKey.ASSETS, new OssBucketInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import cn.hutool.core.util.StrUtil;
import com.apitable.core.support.ResponseData;
import com.apitable.core.util.ExceptionUtil;
import com.apitable.interfaces.billing.facade.EntitlementServiceFacade;
import com.apitable.interfaces.billing.model.SubscriptionInfo;
import com.apitable.interfaces.security.facade.BlackListServiceFacade;
import com.apitable.interfaces.security.facade.HumanVerificationServiceFacade;
import com.apitable.interfaces.security.model.NonRobotMetadata;
Expand Down Expand Up @@ -93,6 +95,9 @@ public class SpaceInvitationController {
@Resource
private RedisTemplate<String, String> redisTemplate;

@Resource
private EntitlementServiceFacade entitlementServiceFacade;

/**
* Valid email invitation.
*/
Expand Down Expand Up @@ -157,7 +162,6 @@ public ResponseData<EmailInvitationResultVO> sendEmailInvitation(
// whether in black list
blackListServiceFacade.checkSpace(spaceId);
iSpaceService.checkSeatOverLimit(spaceId, data.getInvite().size());
Long userId = SessionContext.getUserId();
// check whether space can invite user
iSpaceService.checkCanOperateSpaceUpdate(spaceId);
List<EmailInvitationMemberRo> inviteMembers = data.getInvite();
Expand All @@ -170,7 +174,13 @@ public ResponseData<EmailInvitationResultVO> sendEmailInvitation(
// without email, response success directly
return ResponseData.success(view);
}
SubscriptionInfo subscriptionInfo =
entitlementServiceFacade.getSpaceSubscription(spaceId);
if (subscriptionInfo.isFree() && iMemberService.shouldPreventInvitation(spaceId)) {
return ResponseData.success(view);
}
// invite new members
Long userId = SessionContext.getUserId();
List<String> emails = iMemberService.emailInvitation(userId, spaceId, inviteEmails);
view.setEmails(emails);
return ResponseData.success(view);
Expand Down
Loading