Commit 323d5742 by zhiwj

门店限制

parent a4ab5db7
......@@ -254,10 +254,12 @@ public class StoreApiServiceImpl implements StoreApiService {
ServiceResponse<List<EnterpriseLicenseDTO>> listEnterpriseLicense = this.enterpriseApiService.listEnterpriseLicense(enterpriseId);
if (listEnterpriseLicense.isSuccess() && CollectionUtils.isNotEmpty(listEnterpriseLicense.getResult())) {
if (listEnterpriseLicense.getResult().size() == 4) {
Integer currCount = this.storeService.countByOverflowStatus(enterpriseId, 1);
Integer currCount = this.storeService.countByOverflowStatus(enterpriseId, 0);
Integer upperLimit = listEnterpriseLicense.getResult().get(3).getUpperLimit();
if (currCount + storeIds.split(",").length > upperLimit) {
return EnterpriseServiceResponse.failure(ErrorCode.UNKNOWN_ERROR.getCode(), String.format("本商户剩余门店数量为%s家, 请重新勾选正确的数量!", upperLimit));
// 剩余数量
int remainingCount = upperLimit - currCount;
if (storeIds.split(",").length > remainingCount) {
return EnterpriseServiceResponse.failure(ErrorCode.UNKNOWN_ERROR.getCode(), String.format("本商户剩余门店数量为%s家, 请重新勾选正确的数量!", remainingCount));
}
List<Integer> storeIdList;
if ("all".equals(storeIds)) {
......@@ -268,7 +270,7 @@ public class StoreApiServiceImpl implements StoreApiService {
for (Integer storeId : storeIdList) {
StoreDTO store = this.getStoreById(enterpriseId, storeId).getResult();
if (store != null) {
store.setOverflowStatus(1);
store.setOverflowStatus(0);
saveOrUpdate(store);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment