Commit 76805421 by 陶光胜

门店批量导入修改

parent b72b2316
......@@ -238,6 +238,22 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public ServiceResponse<Integer> saveStoreForOrder(Integer enterpriseId, String storeCode, String storeName, Integer regionId, String orderNum) {
ServiceResponse<List<EnterpriseLicenseDTO>> listEnterpriseLicense = this.enterpriseApiService.listEnterpriseLicense(enterpriseId);
Integer storeLicenseNum = 0;
if(listEnterpriseLicense.isSuccess() && CollectionUtils.isNotEmpty(listEnterpriseLicense.getResult())){
boolean hasStoreLicense = listEnterpriseLicense.getResult()
.stream()
.anyMatch(e -> LicenseUtils.STORE_LICENSE_CODE.equals(e.getLicenseCode()));
if(hasStoreLicense){
storeLicenseNum = listEnterpriseLicense.getResult().stream()
.filter(e -> LicenseUtils.STORE_LICENSE_CODE.equals(e.getLicenseCode()))
.collect(Collectors.toList()).get(0).getUpperLimit();
}
}
Integer count = this.storeService.countByStoreName(enterpriseId, null, null);
if(count >= storeLicenseNum){
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "门店license超出限制");
}
StoreDTO storeDTO = new StoreDTO();
storeDTO.setEnterpriseId(enterpriseId);
storeDTO.setStoreCode(storeCode);
......@@ -253,6 +269,22 @@ public class StoreApiServiceImpl implements StoreApiService {
@Override
public ServiceResponse<Integer> saveStoreForPosMember(Integer enterpriseId, String storeCode, String storeName, Integer regionId, String cardNO) {
ServiceResponse<List<EnterpriseLicenseDTO>> listEnterpriseLicense = this.enterpriseApiService.listEnterpriseLicense(enterpriseId);
Integer storeLicenseNum = 0;
if(listEnterpriseLicense.isSuccess() && CollectionUtils.isNotEmpty(listEnterpriseLicense.getResult())){
boolean hasStoreLicense = listEnterpriseLicense.getResult()
.stream()
.anyMatch(e -> LicenseUtils.STORE_LICENSE_CODE.equals(e.getLicenseCode()));
if(hasStoreLicense){
storeLicenseNum = listEnterpriseLicense.getResult().stream()
.filter(e -> LicenseUtils.STORE_LICENSE_CODE.equals(e.getLicenseCode()))
.collect(Collectors.toList()).get(0).getUpperLimit();
}
}
Integer count = this.storeService.countByStoreName(enterpriseId, null, null);
if(count >= storeLicenseNum){
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "门店license超出限制");
}
StoreDTO storeDTO = new StoreDTO();
storeDTO.setEnterpriseId(enterpriseId);
storeDTO.setStoreCode(storeCode);
......
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