#
Junjie
1 天以前 7b87595a7379c7b250233e2bfcbf8b44ab4a539d
src/main/java/com/zy/system/timer/LicenseTimer.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zy.common.utils.HttpHandler;
import com.zy.system.entity.LicenseInfos;
import com.zy.system.entity.license.*;
@@ -86,12 +87,22 @@
                response = requestRemoteLicense(buildLegacyPayload(serverInfos));
            }
            if (isSuccess(response)) {
                String licenseTime = response.getString("licenseTime");
                long count = licenseInfosService.count(new QueryWrapper<LicenseInfos>()
                        .eq("request_code", requestCode)
                        .eq("license_time", licenseTime)
                );
                if (count > 1) {
                    return;
                }
                LicenseInfos licenseInfos = new LicenseInfos();
                licenseInfos.setLicense(response.getString("data"));
                licenseInfos.setCreateTime(new Date());
                licenseInfos.setLicenseTime(response.getString("licenseTime"));
                licenseInfos.setRequestCode(requestCode);
                licenseInfosService.insert(licenseInfos);
                licenseInfosService.save(licenseInfos);
            }
        } catch (Exception e) {
            e.printStackTrace();