Commit 34b77f4d by 宋祥

1.计划绑定二维码

parent 6cbef9ad
package com.baosight.hpjx.hp.sc.tools; package com.baosight.hpjx.hp.sc.tools;
import com.alibaba.fastjson.JSONObject;
import com.baosight.hpjx.core.dao.DaoBase; import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils; import com.baosight.hpjx.core.security.UserSessionUtils;
...@@ -19,6 +18,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC007; ...@@ -19,6 +18,7 @@ import com.baosight.hpjx.hp.sc.domain.HPSC007;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.DateUtils; import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.StringUtils; import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.core.util.NumberUtils; import com.baosight.iplat4j.core.util.NumberUtils;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -429,11 +429,12 @@ public class HPSCTools { ...@@ -429,11 +429,12 @@ public class HPSCTools {
*/ */
public static void createQrCode(Long id) throws Exception { public static void createQrCode(Long id) throws Exception {
AssertUtils.isNull(id, "节点ID不能为空"); AssertUtils.isNull(id, "节点ID不能为空");
// 生成二维码 // 取配置地址
JSONObject jsonObject = new JSONObject(); String url = PlatApplicationContext.getProperty("iplat.planInfo.qrcode.url");
jsonObject.put("id", id); if (StringUtils.isBlank(url)) {
jsonObject.put("remark", "计划ID"); return;
Map<String, Object> resultMap = QrCodeUtils.create(jsonObject.toJSONString()); }
Map<String, Object> resultMap = QrCodeUtils.create(String.format(url, id));
Map map = new HashMap(); Map map = new HashMap();
map.put("id", id); map.put("id", id);
map.put("qrcodeDocId", resultMap.get("docId")); map.put("qrcodeDocId", resultMap.get("docId"));
......
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