mirror of
https://github.com/chatopera/cosin.git
synced 2025-06-16 18:30:03 +08:00
https://github.com/cskefu/cskefu/issues/937 scan notfound and fill in data for license
Signed-off-by: Hai Liang Wang <hai@chatopera.com>
This commit is contained in:
parent
8c0448f7fc
commit
dbd0a3d77c
@ -260,6 +260,27 @@ public class LicenseProxy {
|
||||
|
||||
for (int i = 0; i < data.length(); i++) {
|
||||
JSONObject lic = (JSONObject) data.get(i);
|
||||
if(StringUtils.equals(lic.getJSONObject(Constants.LICENSE).getString(Constants.STATUS), "notfound")){
|
||||
// fill in placeholders for notfound license
|
||||
final JSONObject licenseJsonTmp = lic.getJSONObject(Constants.LICENSE);
|
||||
licenseJsonTmp.put("effectivedateend", "N/A");
|
||||
licenseJsonTmp.put("quotaeffectiveremaining", "N/A");
|
||||
|
||||
JSONObject productJsonTmp = new JSONObject();
|
||||
productJsonTmp.put("shortId", "N/A");
|
||||
productJsonTmp.put("name", "N/A");
|
||||
lic.put("product", productJsonTmp);
|
||||
|
||||
JSONObject userJsonTmp = new JSONObject();
|
||||
userJsonTmp.put("nickname", "N/A");
|
||||
lic.put("user", userJsonTmp);
|
||||
|
||||
// lic.put(Constants.ADDDATE, null);
|
||||
|
||||
result.add(lic);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
Date addDate = DateConverter.parseCSTAsChinaTimezone(addDates.get(lic.getJSONObject(Constants.LICENSE).getString(Constants.SHORTID)));
|
||||
lic.put(Constants.ADDDATE, addDate);
|
||||
|
@ -20,13 +20,26 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class PugHelper {
|
||||
public final static String NA = "N/A";
|
||||
|
||||
|
||||
public String formatDate(String pattern, Date value) {
|
||||
try {
|
||||
if (value == null) {
|
||||
return "";
|
||||
return NA;
|
||||
}
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat(pattern);
|
||||
return format.format(value);
|
||||
String result = format.format(value);
|
||||
|
||||
if (StringUtils.isBlank(result)) {
|
||||
return NA;
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return NA;
|
||||
}
|
||||
|
||||
public String padRight(Object src, String ch) {
|
||||
@ -140,6 +153,7 @@ public class PugHelper {
|
||||
|
||||
/**
|
||||
* 截取字符串,首先根据分隔符分隔,然后选取前 N 个,使用连接符连接返回
|
||||
*
|
||||
* @param orignal
|
||||
* @param splitBy
|
||||
* @param firstN
|
||||
|
@ -25,7 +25,7 @@ block content
|
||||
.row(style='padding:5px;')
|
||||
blockquote.layui-elem-quote.layui-quote-nm
|
||||
i.layui-icon(style="color:gray") 
|
||||
font(color="#999").layui-word-aux balala ...
|
||||
font(color="#999").layui-word-aux 春松客服使用授权证书是通过 Chatopera 证书商店(https://store.chatopera.com)分发的对【春松客服计费资源】进行管理的凭证,在使用春松客服的过程中,春松客服与 Chatopera 证书商店集成,完成证书购买、证书绑定、配额扣除、配额同步和开具发票等。
|
||||
|
||||
.col-lg-12
|
||||
table.layui-table(lay-skin='line')
|
||||
@ -83,11 +83,6 @@ block content
|
||||
else if (msg == 'notfound_id')
|
||||
top.layer.alert('不存在该证书信息', {icon: 2});
|
||||
|
||||
layui.use(['laypage', 'layer'], function () {
|
||||
var laypage = layui.laypage
|
||||
, layer = layui.layer;
|
||||
});
|
||||
|
||||
function copyLicenseId2ClipboardOnOS(val){
|
||||
copyValue2ClipboardOnOS(val, (err) => {
|
||||
top.layer.msg('复制完成', {icon: 1, time: 2000, offset: 't'});
|
||||
@ -95,6 +90,11 @@ block content
|
||||
}
|
||||
|
||||
function openLicenseStorePage() {
|
||||
var licenseStoreProvider = "#{licenseStoreProvider}";
|
||||
var licenseStoreProvider = "#{licenseStoreProvider}/product/cskefu001";
|
||||
window.open(licenseStoreProvider, "_blank");
|
||||
}
|
||||
|
||||
layui.use(['laypage', 'layer'], function () {
|
||||
var laypage = layui.laypage
|
||||
, layer = layui.layer;
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user