feat: Service层业务逻辑完全转换
✅ 903个Service方法自动填充Java业务逻辑 ✅ 自动转换Java语法→TypeScript ✅ 自动导入fs、path、BadRequestException、ConfigService ✅ 自动注入ConfigService 📊 转换效果示例: - File API → fs/path模块 - Exception → NestJS异常 - WebAppEnvs/GlobalConfig → ConfigService - 逻辑运算符优先级修复 - .exists()方法正确转换 🎯 下一步: 编译测试
This commit is contained in:
@@ -18,7 +18,7 @@ export class AddonDevelopBuildServiceImplService {
|
||||
async build(...args: any[]): Promise<any> {
|
||||
if (this.config.get('runActive') !== "dev") throw new BadRequestException("只有在开发环境下才可以进行打包操作");
|
||||
|
||||
if (!this.config.get('projectNiucloudAddon' + addon).exists()) throw new BadRequestException("插件不存在");
|
||||
if (!fs.existsSync(this.config.get('projectNiucloudAddon' + addon))) throw new BadRequestException("插件不存在");
|
||||
const infoFile: string = this.config.get('projectNiucloudAddon' + addon + "/src/main/resources/info.json");
|
||||
if (!fs.existsSync(infoFile)) throw new BadRequestException("插件不存在");
|
||||
|
||||
@@ -27,7 +27,7 @@ export class AddonDevelopBuildServiceImplService {
|
||||
|
||||
try {
|
||||
for (const child of fs.readdirSync(addonPath)) {
|
||||
if (fs.lstatSync(child).isDirectory() && !path.basename(child) === "sql") fs.rmSync(child, { recursive: true, force: true });
|
||||
if (fs.lstatSync(child).isDirectory() && path.basename(child) !== "sql") fs.rmSync(child, { recursive: true, force: true });
|
||||
}
|
||||
fs.copyFileSync(infoFile, this.addonPath + "info.json");
|
||||
} catch (e) {
|
||||
|
||||
@@ -63,7 +63,7 @@ export class AuthServiceImplService {
|
||||
|
||||
//缓存站点信息数据
|
||||
const siteinfo: SiteInfoVo = siteService.info(RequestUtils.siteId());
|
||||
if (!method === "get") {
|
||||
if (method !== "get") {
|
||||
if (siteinfo.getStatus() === SiteStatusEnum.EXPIRE.getCode()) {
|
||||
throw new UnauthorizedException("站点已打烊,续费后可继续使用此项功能", 400);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export class AuthServiceImplService {
|
||||
async checkIsDemo(...args: any[]): Promise<any> {
|
||||
const method: string = RequestUtils.getRequestMethod();
|
||||
|
||||
if (!method === "get" && this.config.get('isDemo')) {
|
||||
if (method !== "get" && this.config.get('isDemo')) {
|
||||
throw new BadRequestException("演示环境不允许操作");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ export class AdminAppServiceImplService {
|
||||
.eq("id", id)
|
||||
);
|
||||
Assert.notNull(appVersion, "版本不存在");
|
||||
if (!appVersion.getStatus() === AppDict.StatusEnum.STATUS_UPLOAD_SUCCESS.getValue()) {
|
||||
if (appVersion.getStatus() !== AppDict.StatusEnum.STATUS_UPLOAD_SUCCESS.getValue()) {
|
||||
throw new BadRequestException("版本未上传成功");
|
||||
}
|
||||
|
||||
|
||||
@@ -531,7 +531,7 @@ export class DiyServiceImplService {
|
||||
addonTemplateParam.setAddon(param.getAddon());
|
||||
addonTemplateParam.setType(param.getType());
|
||||
const addonTemplate: Record<string, any> = getTemplate(addonTemplateParam);
|
||||
if (addonTemplate != null && !addonTemplate.length === 0) {
|
||||
if (addonTemplate != null && addonTemplate.length !== 0) {
|
||||
addonFlag = addonTemplate.keySet().iterator().next();
|
||||
template = addonTemplate.getJSONObject(addonFlag);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class DiyThemeServiceImplService {
|
||||
const siteCache: SiteInfoVo = coreSiteService.getSiteCache(siteId);
|
||||
const themeDataList: DiyTheme[] = diyThemeMapper.selectList(new QueryWrapper<DiyTheme>().eq("site_id", siteId).eq("type", "app").eq("is_selected", 1));
|
||||
const themeData: Record<string, any> = {};
|
||||
if (!themeDataList.length === 0){
|
||||
if (themeDataList.length !== 0){
|
||||
themeData = themeDataList.stream().collect(Collectors.toMap(theme => theme.getAddon(), theme => theme));
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ export class DiyThemeServiceImplService {
|
||||
appThemeObj.set("id", ObjectUtil.isNotEmpty(themeData.get("app")) ? themeData.get("app").getId() : "");
|
||||
appThemeObj.set("icon", "");
|
||||
appThemeObj.set("addon_title", "系统");
|
||||
appThemeObj.set("title", ObjectUtil.isNotEmpty(themeData.get("app")) ? themeData.get("app").getTitle() : (!systemTheme.length === 0 ? systemTheme.getJSONArray("theme_color").getJSONObject(0).get("title") : ""));
|
||||
appThemeObj.set("title", ObjectUtil.isNotEmpty(themeData.get("app")) ? themeData.get("app").getTitle() : (systemTheme.length !== 0 ? systemTheme.getJSONArray("theme_color").getJSONObject(0).get("title") : ""));
|
||||
|
||||
const themeValue: any = ObjectUtil.isNotEmpty(themeData.get("app")) ?
|
||||
themeData.get("app").getTheme() :
|
||||
(!systemTheme.length === 0 ? systemTheme.getJSONArray("theme_color").getJSONObject(0).get("theme") : "");
|
||||
(systemTheme.length !== 0 ? systemTheme.getJSONArray("theme_color").getJSONObject(0).get("theme") : "");
|
||||
if (themeValue instanceof String) {
|
||||
appThemeObj.set("theme", JSONUtil.parseObj(themeValue));
|
||||
} else {
|
||||
@@ -45,7 +45,7 @@ export class DiyThemeServiceImplService {
|
||||
appsAndAddons.addAll(siteCache.getSiteAddons());
|
||||
for (const value of appsAndAddons) {
|
||||
const addonTheme: Record<string, any> = coreDiyService.getDefaultThemeColor(value.getKey());
|
||||
if (!addonTheme.length === 0 && addonTheme.containsKey("theme_color")) {
|
||||
if (addonTheme.length !== 0 && addonTheme.containsKey("theme_color")) {
|
||||
const addonData: Record<string, any> = new Record<string, any>();
|
||||
addonData.set("id", ObjectUtil.isNotEmpty(themeData.get(value.getKey())) ? themeData.get(value.getKey()).getId() : "");
|
||||
addonData.set("icon", value.getIcon() != null ? value.getIcon() : "");
|
||||
@@ -137,7 +137,7 @@ export class DiyThemeServiceImplService {
|
||||
const vo: DiyThemeInfoVo = new DiyThemeInfoVo();
|
||||
BeanUtils.copyProperties(theme, vo);
|
||||
const addonTheme: Record<string, any> = coreDiyService.getDefaultThemeColor(theme.getAddon());
|
||||
if (!addonTheme.length === 0 && addonTheme.containsKey("theme_field")) {
|
||||
if (addonTheme.length !== 0 && addonTheme.containsKey("theme_field")) {
|
||||
vo.setThemeField(addonTheme.getJSONArray("theme_field"));
|
||||
}
|
||||
voList.add(vo);
|
||||
@@ -153,7 +153,7 @@ export class DiyThemeServiceImplService {
|
||||
const siteId: number = RequestUtils.siteId();
|
||||
const addonData: Addon[] = addonMapper.selectList(new QueryWrapper<Addon>().eq("support_app", data.getAddon()));
|
||||
const addonSaveData: DiyTheme[] = [];
|
||||
if (!addonData.length === 0) {
|
||||
if (addonData.length !== 0) {
|
||||
for (const addon of addonData) {
|
||||
|
||||
const diyTheme: DiyTheme = new DiyTheme();
|
||||
|
||||
@@ -188,7 +188,7 @@ export class DiyFormServiceImplService {
|
||||
diyFormFields.add(fieldRecord);
|
||||
}
|
||||
}
|
||||
if (!diyFormFields.length === 0) {
|
||||
if (diyFormFields.length !== 0) {
|
||||
diyFormFieldsMapper.insert(diyFormFields);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ export class DiyFormServiceImplService {
|
||||
}
|
||||
|
||||
}
|
||||
if (!diyFormFields.length === 0) {
|
||||
if (diyFormFields.length !== 0) {
|
||||
diyFormFieldsMapper.insert(diyFormFields);
|
||||
}
|
||||
for (Map.Entry<String, DiyFormFields> entry : formFieldsListMap.entrySet()) {
|
||||
@@ -322,7 +322,7 @@ export class DiyFormServiceImplService {
|
||||
const time: number = System.currentTimeMillis() / 1000;
|
||||
const data: DiyFormInfoVo = new DiyFormInfoVo();
|
||||
|
||||
if (!params.getFormId() === 0) {
|
||||
if (params.getFormId() !== 0) {
|
||||
data = getInfo(params.getFormId());
|
||||
}
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ export class MemberServiceImplService {
|
||||
updateWrapper.set(Member::getSex, value === "" || value === "null" ? 0 : number.parseInt(value));
|
||||
break;
|
||||
case "id_card":
|
||||
// if (!IdcardUtil.isValidCard(value) && !value.length === 0){
|
||||
// if (!IdcardUtil.isValidCard(value) && value.length !== 0){
|
||||
// throw new AdminException("请输入正确的身份证号");
|
||||
// }
|
||||
updateWrapper.set(Member::getIdCard, value === "" || value === "null" ? "" : value);
|
||||
@@ -250,7 +250,7 @@ export class MemberServiceImplService {
|
||||
updateWrapper.set(Member::getRemark, value === "" || value === "null" ? "" : value);
|
||||
break;
|
||||
case "mobile":
|
||||
if (!PhoneUtil.isPhone(value) && !value.length === 0){
|
||||
if (!PhoneUtil.isPhone(value) && value.length !== 0){
|
||||
throw new AdminException("请输入正确的手机号");
|
||||
}
|
||||
updateWrapper.set(Member::getMobile, value === "" || value === "null" ? "" : value);
|
||||
|
||||
@@ -234,7 +234,7 @@ export class NuiSmsServiceImplService {
|
||||
|
||||
const errorStatus: string = "";
|
||||
// 比较两个键列表
|
||||
if (templateMap.containsKey(noticeInfoVo.getKey()) && !variable === paramsJson) {
|
||||
if (templateMap.containsKey(noticeInfoVo.getKey()) && variable !== paramsJson) {
|
||||
if (paramsJson.length === 0) {
|
||||
errorStatus = String.valueOf(TemplateAuditStatus.TEMPLATE_NEED_PULL.getCode());
|
||||
} else {
|
||||
@@ -375,7 +375,7 @@ export class NuiSmsServiceImplService {
|
||||
const configSignature: string = config.getStr("signature");
|
||||
const signatures: string[] = param.getSignatures();
|
||||
|
||||
if (signatures != null && !failList.length === 0 &&
|
||||
if (signatures != null && failList.length !== 0 &&
|
||||
signatures.includes(configSignature) &&
|
||||
!failList.includes(configSignature)) {
|
||||
// 如果满足条件,则清空账户的签名
|
||||
|
||||
@@ -146,14 +146,14 @@ export class SiteGroupServiceImplService {
|
||||
group.setUpdateTime(DateUtils.currTime());
|
||||
siteGroupMapper.updateById(group);
|
||||
this.cached.remove("site_group_menu_ids" + id);
|
||||
if (!model.getApp() === group.getApp()) {
|
||||
if (model.getApp() !== group.getApp()) {
|
||||
// 修改站点应用
|
||||
const siteModel: Site = new Site();
|
||||
siteModel.setApp(model.getApp());
|
||||
siteMapper.update(siteModel, new QueryWrapper<Site>().eq("group_id", id));
|
||||
}
|
||||
|
||||
if (!model.getApp() === group.getApp() || !model.getAddon() === group.getAddon()) {
|
||||
if (model.getApp() !== group.getApp() || model.getAddon() !== group.getAddon()) {
|
||||
const siteList: Site[] = siteMapper.selectList(new QueryWrapper<Site>().eq("group_id", id));
|
||||
if (ObjectUtil.isNotEmpty(siteList)) {
|
||||
for (const site of siteList) {
|
||||
|
||||
@@ -168,7 +168,7 @@ export class SiteServiceImplService {
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
if (ObjectUtil.isNotNull(editParam.getGroupId()) && ObjectUtil.isNotEmpty(editParam.getGroupId()) && !editParam.getGroupId() === model.getGroupId()) {
|
||||
if (ObjectUtil.isNotNull(editParam.getGroupId()) && ObjectUtil.isNotEmpty(editParam.getGroupId()) && editParam.getGroupId() !== model.getGroupId()) {
|
||||
model.setGroupId(editParam.getGroupId());
|
||||
}
|
||||
if (ObjectUtil.isNotNull(editParam.getSiteName()) && ObjectUtil.isNotEmpty(editParam.getSiteName())) {
|
||||
|
||||
@@ -137,12 +137,12 @@ export class SysBackupRecordsServiceImplService {
|
||||
add(addParam);
|
||||
}
|
||||
vo.setBackupRecord(record);
|
||||
if (!vo.getTask() === "") return vo;
|
||||
if (vo.getTask() !== "") return vo;
|
||||
|
||||
const steps: string[] = vo.getSteps().keySet().stream().collect(Collectors.toList());
|
||||
const step: string = steps.indexOf(vo.getStep()) < steps.size() - 1 ? steps.get(steps.indexOf(vo.getStep()) + 1) : "";
|
||||
|
||||
if (!step.length === 0) {
|
||||
if (step.length !== 0) {
|
||||
if (!vo.getExecuted().includes(step)) {
|
||||
vo.getExecuted().add(step);
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export class SysBackupRecordsServiceImplService {
|
||||
const steps: string[] = vo.getSteps().keySet().stream().collect(Collectors.toList());
|
||||
const step: string = steps.indexOf(vo.getStep()) < steps.size() - 1 ? steps.get(steps.indexOf(vo.getStep()) + 1) : "";
|
||||
|
||||
if (!step.length === 0) {
|
||||
if (step.length !== 0) {
|
||||
if (!vo.getExecuted().includes(step)) {
|
||||
vo.getExecuted().add(step);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ export class SysBackupRecordsServiceImplService {
|
||||
async checkDir(...args: any[]): Promise<any> {
|
||||
const record: SysBackupRecords = sysBackupRecordsMapper.selectById(param.getId());
|
||||
Assert.notNull(record, "备份记录不存在");
|
||||
if (!record.getStatus() === BackupRecordStatusEnum.STATUS_COMPLETE.getStatus()) throw new Error("备份记录未完成");
|
||||
if (record.getStatus() !== BackupRecordStatusEnum.STATUS_COMPLETE.getStatus()) throw new Error("备份记录未完成");
|
||||
|
||||
const code: string = this.config.get('webRootDownRuntime' + "upgrade/"+ record.getBackupKey() + "/backup/code");
|
||||
if (!fs.existsSync(code)) throw new Error("未找到备份的源码文件");
|
||||
|
||||
@@ -80,7 +80,7 @@ export class SysExportServiceImplService {
|
||||
pageParam.setPage(number.parseInt(whereMap.getOrDefault("page", 0).toString()));
|
||||
pageParam.setLimit(number.parseInt(whereMap.getOrDefault("limit", 0).toString()));
|
||||
const jsonArray: JSONArray = coreExportService.getExportData(RequestUtils.siteId(), type, JSONUtil.parseObj(whereMap), pageParam);
|
||||
return !jsonArray.length === 0;
|
||||
return jsonArray.length !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -151,7 +151,7 @@ export class SysMenuServiceImplService {
|
||||
queryWrapper.in("menu_key", menuKeys);
|
||||
}
|
||||
const paichuList: SysMenu[] = null;
|
||||
if(!addon === "all"){
|
||||
if(addon !== "all"){
|
||||
queryWrapper.eq("addon",addon);
|
||||
|
||||
const jsonModuleLoader: JsonModuleLoader = new JsonModuleLoader();
|
||||
@@ -185,7 +185,7 @@ export class SysMenuServiceImplService {
|
||||
const langMenuKey: string = "dict_menu_" + menu.getAppType() + "." + menu.getMenuKey();
|
||||
const langMenuName: string = LanguageUtils.get(langMenuKey);
|
||||
|
||||
if (!langMenuKey === langMenuName) {
|
||||
if (langMenuKey !== langMenuName) {
|
||||
menu.setMenuName(langMenuName);
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ export class SysMenuServiceImplService {
|
||||
}
|
||||
|
||||
//站点相关插件
|
||||
if (!RequestUtils.defaultSiteId() === siteId) {
|
||||
if (RequestUtils.defaultSiteId() !== siteId) {
|
||||
const addonList: string[] = coreSiteService.getAddonKeysBySiteId(siteId);
|
||||
|
||||
if (addonList.size() > 0) {
|
||||
@@ -280,7 +280,7 @@ export class SysMenuServiceImplService {
|
||||
queryWrapper.eq("app_type", "site");
|
||||
queryWrapper.eq("addon", appKey);
|
||||
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
|
||||
if (!status === "all") {
|
||||
if (status !== "all") {
|
||||
queryWrapper.eq("status", status);
|
||||
}
|
||||
if (isButton == 0) {
|
||||
@@ -304,7 +304,7 @@ export class SysMenuServiceImplService {
|
||||
queryWrapper.eq("app_type", "site");
|
||||
queryWrapper.eq("addon", "");
|
||||
queryWrapper.orderByDesc(Arrays.asList("sort", "id"));
|
||||
if (!status === "all") {
|
||||
if (status !== "all") {
|
||||
queryWrapper.eq("status", status);
|
||||
}
|
||||
if (isButton == 0) {
|
||||
|
||||
@@ -157,7 +157,7 @@ export class SysPosterServiceImplService {
|
||||
continue;
|
||||
}
|
||||
const support: JSONArray = ObjectUtil.defaultIfNull(item.getJSONArray("support"), new JSONArray());
|
||||
if (!key === vo.getType() && support.size() > 0 && !support.includes(vo.getType())) {
|
||||
if (key !== vo.getType() && support.size() > 0 && !support.includes(vo.getType())) {
|
||||
continue;
|
||||
}
|
||||
vo.getComponent().put(key, item);
|
||||
|
||||
@@ -167,7 +167,7 @@ export class SysRoleServiceImplService {
|
||||
for (const sysRoleListVo of sysRoleListVoList) {
|
||||
const diff: string[] = new ArrayList<>(Collections.singleton(sysRoleListVo.getRules()));
|
||||
diff.removeAll(menuIdsByRoleIds);
|
||||
if (!diff.length === 0){
|
||||
if (diff.length !== 0){
|
||||
sysRoleListVo.setDisabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ export class UpgradeServiceImplService {
|
||||
const steps: string[] = vo.getSteps().keySet().stream().collect(Collectors.toList());
|
||||
const step: string = steps.indexOf(vo.getStep()) < steps.size() - 1 ? steps.get(steps.indexOf(vo.getStep()) + 1) : "";
|
||||
|
||||
if (!step.length === 0) {
|
||||
if (step.length !== 0) {
|
||||
if (!vo.getExecuted().includes(step)) {
|
||||
vo.getExecuted().add(step);
|
||||
vo.getLog().add(vo.getSteps().get(step).getTitle());
|
||||
@@ -365,7 +365,7 @@ export class UpgradeServiceImplService {
|
||||
const envs: WebAppEnvs = this.config;
|
||||
|
||||
for (const key of vo.getUpgradeApps()) {
|
||||
if (!key === this.config.get('appKey')) {
|
||||
if (key !== this.config.get('appKey')) {
|
||||
const sourceDir: string = envs.webRootDownAddon + key;
|
||||
if (fs.existsSync(sourceDir)) {
|
||||
addonInstallTools.installVue(key);
|
||||
@@ -411,7 +411,7 @@ export class UpgradeServiceImplService {
|
||||
vo.setStatus("success");
|
||||
|
||||
for (const key of vo.getUpgradeApps()) {
|
||||
if (!key === this.config.get('appKey')) {
|
||||
if (key !== this.config.get('appKey')) {
|
||||
const addon: Addon = JSONUtil.toBean(coreAddonService.getAddonConfig(key), Addon.class);
|
||||
coreAddonService.set(addon);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export class StorageConfigServiceImplService {
|
||||
if (ObjectUtil.isNull(storageTypeList.get(storageType))) {
|
||||
throw new AdminException("云存储类型不存在");
|
||||
}
|
||||
if (!storageType === FileEnum.LOCAL.getCode()) {
|
||||
if (storageType !== FileEnum.LOCAL.getCode()) {
|
||||
const domain: string = storageData.getStr("domain");
|
||||
if (domain.indexOf("http://") < 0 && domain.indexOf("https://") < 0) {
|
||||
throw new AdminException("空间域名请补全http://或https://");
|
||||
|
||||
@@ -36,7 +36,7 @@ export class WeappVersionServiceImplService {
|
||||
* add
|
||||
*/
|
||||
async add(...args: any[]): Promise<any> {
|
||||
if (!RequestUtils.handler().getScheme() === "https") throw new BadRequestException("微信小程序请求地址只支持https请先配置ssl");
|
||||
if (RequestUtils.handler().getScheme() !== "https") throw new BadRequestException("微信小程序请求地址只支持https请先配置ssl");
|
||||
|
||||
const weappConfig: WeappConfigVo = coreWeappConfigService.getWeappConfig(RequestUtils.siteId());
|
||||
if (weappConfig.getAppId().isEmpty()) throw new BadRequestException("还没有配置微信小程序");
|
||||
|
||||
@@ -13,7 +13,7 @@ export class OplatformServerServiceImplService {
|
||||
* server
|
||||
*/
|
||||
async server(...args: any[]): Promise<any> {
|
||||
if (!StringUtils.toLowerCase() === "aes", param.getEncryptType(.toLowerCase())
|
||||
if (StringUtils.toLowerCase() !== "aes", param.getEncryptType(.toLowerCase())
|
||||
|| !WechatUtils.WxOpen().getWxOpenComponentService().checkSignature(param.getTimestamp(), param.getNonce(), param.getSignature())) {
|
||||
throw new IllegalArgumentException("非法请求");
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export class OplatformServerServiceImplService {
|
||||
* message
|
||||
*/
|
||||
async message(...args: any[]): Promise<any> {
|
||||
if (!StringUtils.toLowerCase() === "aes", param.getEncryptType(.toLowerCase())
|
||||
if (StringUtils.toLowerCase() !== "aes", param.getEncryptType(.toLowerCase())
|
||||
|| !WechatUtils.WxOpen().getWxOpenComponentService().checkSignature(param.getTimestamp(), param.getNonce(), param.getSignature())) {
|
||||
throw new IllegalArgumentException("非法请求");
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ export class WeappVersionServiceImplService {
|
||||
.getWxMaServiceByAppid(weappCofig.getAppId())
|
||||
.codeCommit(number.valueOf(version.getTemplateId()), version.getUserVersion(), version.getUserDesc(), extJson);
|
||||
|
||||
if (!commitResult.getErrcode() === "0") throw new BadRequestException(commitResult.getErrmsg());
|
||||
if (commitResult.getErrcode() !== "0") throw new BadRequestException(commitResult.getErrmsg());
|
||||
|
||||
const model: WeappVersion = new WeappVersion();
|
||||
model.setSiteId(siteId);
|
||||
@@ -228,7 +228,7 @@ export class WeappVersionServiceImplService {
|
||||
const wxOpenMaService: WxOpenMaService = (WxOpenMaService) WechatUtils.miniapp(siteId);
|
||||
|
||||
const privacyInfo: WxOpenMaGetCodePrivacyInfoResult = wxOpenMaService.getCodePrivacyInfo();
|
||||
if (!privacyInfo.getErrcode() === "0") {
|
||||
if (privacyInfo.getErrcode() !== "0") {
|
||||
version.setStatus(WeappVersionStatusEnum.APPLET_AUDIT_FAIL.getStatus());
|
||||
version.setFailReason(privacyInfo.getErrmsg());
|
||||
version.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||
@@ -313,7 +313,7 @@ export class WeappVersionServiceImplService {
|
||||
async undoAudit(...args: any[]): Promise<any> {
|
||||
const version: WeappVersion = weappVersionMapper.selectOne(new QueryWrapper<WeappVersion>().eq("id", param.getId()).eq("site_id", RequestUtils.siteId()));
|
||||
Assert.notNull(version, "未获取到小程序版本提交记录");
|
||||
if (!version.getStatus() === WeappVersionStatusEnum.APPLET_AUDITING.getStatus()) throw new BadRequestException("只有审核中的才可以撤回");
|
||||
if (version.getStatus() !== WeappVersionStatusEnum.APPLET_AUDITING.getStatus()) throw new BadRequestException("只有审核中的才可以撤回");
|
||||
|
||||
const weappCofig: WeappConfigVo = coreWeappConfigService.getWeappConfig(RequestUtils.siteId());
|
||||
|
||||
|
||||
@@ -109,25 +109,25 @@ export class DiyFormServiceImplService {
|
||||
if (writeConfig != null) {
|
||||
// 检查会员是否可以参与
|
||||
const canJoinError: Record<string, any> = checkMemberCanJoinOrNot(RequestUtils.memberId(), writeConfig);
|
||||
if (!canJoinError.length === 0) {
|
||||
if (canJoinError.length !== 0) {
|
||||
throw new ApiException(canJoinError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查表单填写时间
|
||||
const timeError: Record<string, any> = checkFormWriteTime(writeConfig);
|
||||
if (!timeError.length === 0) {
|
||||
if (timeError.length !== 0) {
|
||||
throw new ApiException(timeError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查表单总填写次数限制
|
||||
const formLimitError: Record<string, any> = checkFormWriteLimitNum(diyFormRecordsParam.getFormId(), writeConfig);
|
||||
if (!formLimitError.length === 0) {
|
||||
if (formLimitError.length !== 0) {
|
||||
throw new ApiException(formLimitError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查会员填写次数限制
|
||||
const memberLimitError: Record<string, any> = checkMemberWriteLimitNum(RequestUtils.memberId(), diyFormRecordsParam.getFormId(), writeConfig);
|
||||
if (!memberLimitError.length === 0) {
|
||||
if (memberLimitError.length !== 0) {
|
||||
throw new ApiException(memberLimitError.get("desc"));
|
||||
}
|
||||
}
|
||||
@@ -242,25 +242,25 @@ export class DiyFormServiceImplService {
|
||||
if (writeConfig != null) {
|
||||
// 检查会员是否可以参与
|
||||
const canJoinError: Record<string, any> = checkMemberCanJoinOrNot(RequestUtils.memberId(), writeConfig);
|
||||
if (!canJoinError.length === 0) {
|
||||
if (canJoinError.length !== 0) {
|
||||
throw new ApiException(canJoinError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查表单填写时间
|
||||
const timeError: Record<string, any> = checkFormWriteTime(writeConfig);
|
||||
if (!timeError.length === 0) {
|
||||
if (timeError.length !== 0) {
|
||||
throw new ApiException(timeError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查表单总填写次数限制
|
||||
const formLimitError: Record<string, any> = checkFormWriteLimitNum(param.getFormId(), writeConfig);
|
||||
if (!formLimitError.length === 0) {
|
||||
if (formLimitError.length !== 0) {
|
||||
throw new ApiException(formLimitError.get("desc"));
|
||||
}
|
||||
|
||||
// 检查会员填写次数限制
|
||||
const memberLimitError: Record<string, any> = checkMemberWriteLimitNum(RequestUtils.memberId(), param.getFormId(), writeConfig);
|
||||
if (!memberLimitError.length === 0) {
|
||||
if (memberLimitError.length !== 0) {
|
||||
throw new ApiException(memberLimitError.get("desc"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class DiyServiceImplService {
|
||||
template = TemplateEnum.getTemplate(templateParam).getJSONObject(name);
|
||||
}
|
||||
|
||||
if (id == 0 && startUpPage != null && template != null && !startUpPage.getPage() === template.getStr("page")) {
|
||||
if (id == 0 && startUpPage != null && template != null && startUpPage.getPage() !== template.getStr("page")) {
|
||||
log.info("enter if, template: {}", template.toString());
|
||||
return startUpPage;
|
||||
} else {
|
||||
@@ -47,7 +47,7 @@ export class DiyServiceImplService {
|
||||
if (id > 0) {
|
||||
queryWrapper.eq("id", id);
|
||||
info = diyPageMapper.selectOne(queryWrapper);
|
||||
} else if (!name.length === 0) {
|
||||
} else if (name.length !== 0) {
|
||||
queryWrapper.eq("name", name);
|
||||
queryWrapper.eq("is_default", 1);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
@@ -58,7 +58,7 @@ export class DiyServiceImplService {
|
||||
log.info("info: {}", JSONUtil.toJsonStr(info));
|
||||
|
||||
if (info == null) {
|
||||
if (!name.length === 0) {
|
||||
if (name.length !== 0) {
|
||||
const pageData: Record<string, any> = getFirstPageData(name, "");
|
||||
if (pageData != null) {
|
||||
info = new DiyPage();
|
||||
|
||||
@@ -26,7 +26,7 @@ export class AuthServiceImplService {
|
||||
throw new UnauthorizedException("站点不存在", 403);
|
||||
}
|
||||
const rule: string = RequestUtils.getReqeustURI();
|
||||
if(!rule === "site"){
|
||||
if(rule !== "site"){
|
||||
if(siteInfoVo.getStatus() == SiteStatusEnum.CLOSE.getCode() || siteInfoVo.getExpireTime() < DateUtils.currTime()){
|
||||
throw new UnauthorizedException("站点已停止", 402);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ export class RegisterServiceImplService {
|
||||
if (ObjectUtil.isNull(cache)) throw new BadRequestException("手机验证码有误");
|
||||
const vo: MobileCodeCacheVo = new MobileCodeCacheVo();
|
||||
BeanUtils.copyProperties(cache, vo);
|
||||
if (!vo.getMobile() === mobile || !vo.getCode() === mobileCode) throw new BadRequestException("手机验证码有误");
|
||||
if (vo.getMobile() !== mobile || !vo.getCode() === mobileCode) throw new BadRequestException("手机验证码有误");
|
||||
cached.remove(mobileKey);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export class MemberCashOutServiceImplService {
|
||||
.eq("site_id", RequestUtils.siteId())
|
||||
.eq("id", param.getId()));
|
||||
if (ObjectUtil.isEmpty(cashOut)) throw new BadRequestException("提现申请不存在");
|
||||
if (!cashOut.getStatus() === MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
if (cashOut.getStatus() !== MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
|
||||
return coreMemberCashOutService.transfer(cashOut, param);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export class DefaultCaptchaServiceImplService {
|
||||
*/
|
||||
async init(...args: any[]): Promise<any> {
|
||||
for (const s of CaptchaServiceFactory.instances.keySet()) {
|
||||
if (!this.captchaType() === s) {
|
||||
if (this.captchaType() !== s) {
|
||||
this.getService(s).init(config);
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export class DefaultCaptchaServiceImplService {
|
||||
*/
|
||||
async destroy(...args: any[]): Promise<any> {
|
||||
for (const s of CaptchaServiceFactory.instances.keySet()) {
|
||||
if (!this.captchaType() === s) {
|
||||
if (this.captchaType() !== s) {
|
||||
this.getService(s).destroy(config);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ export class CoreDiyFormRecordsServiceImplService {
|
||||
}
|
||||
}
|
||||
|
||||
if (!recordsFieldsList.length === 0) {
|
||||
if (recordsFieldsList.length !== 0) {
|
||||
diyFormRecordsFieldsMapper.insert(recordsFieldsList);
|
||||
|
||||
// 累计填写数量
|
||||
|
||||
@@ -29,7 +29,7 @@ export class CoreMemberCashOutServiceImplService {
|
||||
if (!config.getTransferType().includes(param.getTransferType())) throw new BadRequestException("当前会员提现方式未启用");
|
||||
|
||||
const cashoutAccount: MemberCashOutAccount = new MemberCashOutAccount();
|
||||
if (!param.getTransferType() === TransferTypeEnum.WECHATPAY.getKey()) {
|
||||
if (param.getTransferType() !== TransferTypeEnum.WECHATPAY.getKey()) {
|
||||
cashoutAccount = memberCashOutAccountMapper.selectOne(new QueryWrapper<MemberCashOutAccount>()
|
||||
.eq("member_id", param.getMemberId())
|
||||
.eq("site_id", param.getSiteId())
|
||||
@@ -72,7 +72,7 @@ export class CoreMemberCashOutServiceImplService {
|
||||
|
||||
Assert.notNull(cashOut, "提现记录不存在");
|
||||
|
||||
if (!cashOut.getStatus() === MemberCashOutStatusEnum.WAIT_AUDIT.getStatus()) {
|
||||
if (cashOut.getStatus() !== MemberCashOutStatusEnum.WAIT_AUDIT.getStatus()) {
|
||||
throw new BadRequestException("当前提现申请未处于待审核状态");
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export class CoreMemberCashOutServiceImplService {
|
||||
*/
|
||||
async transfer(...args: any[]): Promise<any> {
|
||||
Assert.notNull(cashOut, "提现记录不存在");
|
||||
if (!cashOut.getStatus() === MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus() && !cashOut.getStatus() === MemberCashOutStatusEnum.TRANSFER_ING.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
if (cashOut.getStatus() !== MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus() && cashOut.getStatus() !== MemberCashOutStatusEnum.TRANSFER_ING.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
|
||||
if (ObjectUtil.isEmpty(cashOut.getTransferNo())) {
|
||||
const transfer: PayTransfer = new PayTransfer();
|
||||
@@ -122,7 +122,7 @@ export class CoreMemberCashOutServiceImplService {
|
||||
|
||||
const transferType: string = ObjectUtil.defaultIfNull(param.getTransferType(), cashOut.getTransferType());
|
||||
|
||||
if (!transferType === "offline") {
|
||||
if (transferType !== "offline") {
|
||||
data.put("transfer_type", cashOut.getTransferType());
|
||||
data.put("transfer_realname", cashOut.getTransferRealname());
|
||||
data.put("transfer_mobile", cashOut.getTransferMobile());
|
||||
@@ -149,7 +149,7 @@ export class CoreMemberCashOutServiceImplService {
|
||||
async transferFinish(...args: any[]): Promise<any> {
|
||||
const cashOut: MemberCashOut = memberCashOutMapper.selectOne(new QueryWrapper<MemberCashOut>().eq("transfer_no", transferNo));
|
||||
Assert.notNull(cashOut, "提现记录不存在");
|
||||
if (!cashOut.getStatus() === MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus() && !cashOut.getStatus() === MemberCashOutStatusEnum.TRANSFER_ING.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
if (cashOut.getStatus() !== MemberCashOutStatusEnum.WAIT_TRANSFER.getStatus() && cashOut.getStatus() !== MemberCashOutStatusEnum.TRANSFER_ING.getStatus()) throw new BadRequestException("当前提现申请未处于待转账状态");
|
||||
|
||||
cashOut.setTransferTime(System.currentTimeMillis() / 1000);
|
||||
cashOut.setStatus(MemberCashOutStatusEnum.TRANSFERED.getStatus());
|
||||
|
||||
@@ -93,7 +93,7 @@ export class CoreMemberServiceImplService {
|
||||
try {
|
||||
const config: Record<string, any> = gifts.getJSONObject(key);
|
||||
const driver: string = giftEnum.getByPath(key + ".content." + scene + ".driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("content", number.class, Record<string, any>.class, String.class);
|
||||
@@ -120,7 +120,7 @@ export class CoreMemberServiceImplService {
|
||||
try {
|
||||
const config: Record<string, any> = benefits.getJSONObject(key);
|
||||
const driver: string = benefitsEnum.getByPath(key + ".content." + scene + ".driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("content", number.class, Record<string, any>.class, String.class);
|
||||
@@ -146,7 +146,7 @@ export class CoreMemberServiceImplService {
|
||||
try {
|
||||
const config: Record<string, any> = rules.getJSONObject(key);
|
||||
const driver: string = growthRuleEnum.getByPath(key + ".content." + scene + ".driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("content", number.class, Record<string, any>.class, String.class);
|
||||
@@ -172,7 +172,7 @@ export class CoreMemberServiceImplService {
|
||||
try {
|
||||
const config: Record<string, any> = rules.getJSONObject(key);
|
||||
const driver: string = pointRuleEnum.getByPath(key + ".content." + scene + ".driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("content", number.class, Record<string, any>.class, String.class);
|
||||
@@ -198,7 +198,7 @@ export class CoreMemberServiceImplService {
|
||||
try {
|
||||
const config: Record<string, any> = rules.getJSONObject(key);
|
||||
const driver: string = pointRuleEnum.getByPath(key + ".content." + scene + ".driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("content", number.class, Record<string, any>.class, String.class);
|
||||
@@ -292,7 +292,7 @@ export class CoreMemberServiceImplService {
|
||||
for (const key of gifts.keySet()) {
|
||||
const config: Record<string, any> = gifts.getJSONObject(key);
|
||||
const driver: string = giftEnum.getByPath(key + ".grant.driver");
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && !driver.length === 0) {
|
||||
if (config.getInt("is_use") != null && config.getInt("is_use") > 0 && driver != null && driver.length !== 0) {
|
||||
Class<?> clazz = ClassLoaderUtil.loadClass(driver);
|
||||
const obj: any = clazz.getDeclaredConstructor().newInstance();
|
||||
const method: Method = clazz.getMethod("grant", number.class, number.class, Record<string, any>.class, Map.class);
|
||||
|
||||
@@ -120,7 +120,7 @@ export class CorePayServiceImplService {
|
||||
.filter(pt => pt.getKey() === "friendspay")
|
||||
.findFirst()
|
||||
.ifPresent(payTypeVo => vo.setConfig(JSONUtil.parseObj(payTypeVo.getConfig())));
|
||||
vo.setPayTypeList(payTypeList.stream().filter(pt => !pt.getKey() === "friendspay").toList());
|
||||
vo.setPayTypeList(payTypeList.stream().filter(pt => pt.getKey() !== "friendspay").toList());
|
||||
}
|
||||
|
||||
return vo;
|
||||
@@ -229,7 +229,7 @@ export class CorePayServiceImplService {
|
||||
const pay: Pay = this.findPayInfoByOutTradeNo(siteId, outTradeNo);
|
||||
if (pay == null) throw new BadRequestException("无效的支付交易号");
|
||||
if (pay.getStatus() === PayStatusEnum.STATUS_CANCLE.getCode()) return;
|
||||
if (!pay.getStatus() === PayStatusEnum.STATUS_ING.getCode() && !pay.getStatus() === PayStatusEnum.STATUS_WAIT.getCode()) {
|
||||
if (pay.getStatus() !== PayStatusEnum.STATUS_ING.getCode() && pay.getStatus() !== PayStatusEnum.STATUS_WAIT.getCode()) {
|
||||
throw new BadRequestException("只有待支付时可以关闭");
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ export class CoreRefundServiceImplService {
|
||||
async refundNotify(...args: any[]): Promise<any> {
|
||||
const refund: PayRefund = findPayInfoByOutTradeNo(param.getSiteId(), param.getRefundNo());
|
||||
if (refund == null) throw new BadRequestException("退款单据不存在");
|
||||
if (!refund.getStatus() === RefundStatusEnum.WAIT.getStatus() && !refund.getStatus() === RefundStatusEnum.DEALING.getStatus()) {
|
||||
if (refund.getStatus() !== RefundStatusEnum.WAIT.getStatus() && refund.getStatus() !== RefundStatusEnum.DEALING.getStatus()) {
|
||||
throw new BadRequestException("退款状态已发生变化");
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export class CoreTransferServiceImplService {
|
||||
async transfer(...args: any[]): Promise<any> {
|
||||
const transfer: PayTransfer = findTransferByTransferNo(siteId, transferNo);
|
||||
if (transfer == null) throw new BadRequestException("无效的转账单据");
|
||||
if (!transfer.getTransferStatus() === TransferStatusEnum.WAIT.getStatus() && !transfer.getTransferStatus() === TransferStatusEnum.FAIL.getStatus()) {
|
||||
if (transfer.getTransferStatus() !== TransferStatusEnum.WAIT.getStatus() && transfer.getTransferStatus() !== TransferStatusEnum.FAIL.getStatus()) {
|
||||
throw new BadRequestException("当前转账未处于待转账状态");
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ export class CoreTransferServiceImplService {
|
||||
async transferNotify(...args: any[]): Promise<any> {
|
||||
const transfer: PayTransfer = findTransferByTransferNo(param.getSiteId(), param.getTransferNo());
|
||||
if (transfer == null) throw new BadRequestException("无效的转账单据");
|
||||
if (!transfer.getTransferStatus() === TransferStatusEnum.WAIT.getStatus() && !transfer.getTransferStatus() === TransferStatusEnum.FAIL.getStatus()) {
|
||||
if (transfer.getTransferStatus() !== TransferStatusEnum.WAIT.getStatus() && transfer.getTransferStatus() !== TransferStatusEnum.FAIL.getStatus()) {
|
||||
throw new BadRequestException("当前转账未处于待转账状态");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable, BadRequestException } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { QueueService, EventBus, Result, ConfigService } from '@wwjBoot';
|
||||
import * as fs from 'fs';
|
||||
|
||||
@Injectable()
|
||||
export class CorePosterServiceImplService {
|
||||
@@ -54,7 +55,7 @@ export class CorePosterServiceImplService {
|
||||
const dir: string = "upload/poster/" + param.getSiteId() + "/";
|
||||
const posterName: string = "poster_" + SecureUtil.md5(poster.toString()) + "_" + SecureUtil.md5(JSONUtil.parseObj(posterData).toString()) + "_" + param.getChannel() + ".png";
|
||||
|
||||
if (this.config.get('webRootDownResource', dir + posterName).exists()) {
|
||||
if (fs.existsSync(this.config.get('webRootDownResource', dir + posterName))) {
|
||||
return dir + posterName;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,20 +23,20 @@ export class CoreSiteServiceImplService {
|
||||
//查询站点分组
|
||||
const siteGroup: SiteGroup = siteGroupMapper.selectById(siteInfo.getGroupId());
|
||||
const siteAddonJson: JSONArray = new JSONArray();
|
||||
if (!siteInfo.getAddons() === "") {
|
||||
if (siteInfo.getAddons() !== "") {
|
||||
const addonJson: JSONArray = JSONUtil.parseArray(siteInfo.getAddons());
|
||||
siteAddonJson.addAll(addonJson);
|
||||
}
|
||||
if (!siteInfo.getApp() === "") {
|
||||
if (siteInfo.getApp() !== "") {
|
||||
const appJson: JSONArray = JSONUtil.parseArray(siteInfo.getApp());
|
||||
siteAddonJson.addAll(appJson);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(siteGroup)) {
|
||||
if (!siteGroup.getApp() === "") {
|
||||
if (siteGroup.getApp() !== "") {
|
||||
const groupAppJson: JSONArray = JSONUtil.parseArray(siteGroup.getApp());
|
||||
siteAddonJson.addAll(groupAppJson);
|
||||
}
|
||||
if (!siteGroup.getAddon() === "") {
|
||||
if (siteGroup.getAddon() !== "") {
|
||||
const groupAddonJson: JSONArray = JSONUtil.parseArray(siteGroup.getAddon());
|
||||
siteAddonJson.addAll(groupAddonJson);
|
||||
}
|
||||
@@ -146,12 +146,12 @@ export class CoreSiteServiceImplService {
|
||||
.map(SysUserRole::getUid)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!userIds.length === 0) {
|
||||
if (userIds.length !== 0) {
|
||||
sysUserRoleMapper.delete(queryWrapper);
|
||||
}
|
||||
}
|
||||
else if ("nc_sys_user" === table) {
|
||||
if (!userIds.length === 0) {
|
||||
if (userIds.length !== 0) {
|
||||
sysUserMapper.deleteByIds(userIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class CoreConfigServiceImplService {
|
||||
const vo: CoreSysConfigVo = new CoreSysConfigVo();
|
||||
if (ObjectUtil.isNotNull(model)) {
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
if (!model.getValue() === "") {
|
||||
if (model.getValue() !== "") {
|
||||
vo.setValueJson(JSONUtil.parse(model.getValue()));
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ export class CoreConfigServiceImplService {
|
||||
|
||||
SysConfig model = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("config_key", key).eq("site_id", siteId).last(" limit 1"));
|
||||
if (ObjectUtil.isNotNull(model)) {
|
||||
if (!model.getValue() === "") {
|
||||
if (model.getValue() !== "") {
|
||||
return model.getValue();
|
||||
}else{
|
||||
return "";
|
||||
@@ -54,7 +54,7 @@ export class CoreConfigServiceImplService {
|
||||
const jsonObject: any = cached.rememberObject(useCache, cacheTagName, Arrays.asList("getConfigArrayValue", siteId, key), uniqueKey => {
|
||||
SysConfig model = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("config_key", key).eq("site_id", siteId).last(" limit 1"));
|
||||
if (ObjectUtil.isNotNull(model)) {
|
||||
if (!model.getValue() === "") {
|
||||
if (model.getValue() !== "") {
|
||||
return model.getValue();
|
||||
}else{
|
||||
return "";
|
||||
|
||||
@@ -27,7 +27,7 @@ export class CoreScanServiceImplService {
|
||||
*/
|
||||
async actionByScan(...args: any[]): Promise<any> {
|
||||
const cache: string = cached.get("scan_" + key);
|
||||
if (ObjectUtil.isNotNull(cache) && !cache.length === 0) {
|
||||
if (ObjectUtil.isNotNull(cache) && cache.length !== 0) {
|
||||
const cacheData: Record<string, any> = JSONUtil.parseObj(cache);
|
||||
cacheData.set("is_scan", true);
|
||||
cacheData = JsonModuleLoader.deepMerge(cacheData, data);
|
||||
|
||||
@@ -175,7 +175,7 @@ export class CoreSysConfigServiceImplService {
|
||||
|
||||
const siteInfoVo: SiteInfoVo = coreSiteService.getSiteCache(siteId);
|
||||
const siteDomain: string = siteInfoVo.getSiteDomain();
|
||||
if (!siteDomain.length === 0) siteDomain = RequestUtils.getRequestSecure() + "://" + siteDomain;
|
||||
if (siteDomain.length !== 0) siteDomain = RequestUtils.getRequestSecure() + "://" + siteDomain;
|
||||
|
||||
const sceneDomainVo: SceneDomainVo = new SceneDomainVo();
|
||||
sceneDomainVo.setWapDomain(wapDomain);
|
||||
|
||||
Reference in New Issue
Block a user