lyhzzz %!s(int64=2) %!d(string=hai) anos
pai
achega
fbfbc64ee0

+ 45 - 0
src/main/java/com/fdkankan/ucenter/controller/LicenseController.java

@@ -0,0 +1,45 @@
+package com.fdkankan.ucenter.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/ucenter/license")
+public class LicenseController {
+
+    public static Node License() throws IOException, InterruptedException {
+        String authLicenseCommandCmd = "";
+        String licensePath = CmdBuildUtil.fdkkLaserConfig.buildCallPath + File.separator + "license" + File.separator;
+        File caches = new File(licensePath + "caches");
+        FileUtil.del(caches);
+        File results = new File(licensePath + "results");
+        FileUtil.del(results);
+
+        JSONObject licenseDataJson = new JSONObject();
+        licenseDataJson.put("split_type", "SPLIT_V23");
+        licenseDataJson.put("skybox_type", "SKYBOX_V5");
+        FileUtils.writeFile(licensePath + File.separator + "data.json", licenseDataJson.toString());
+        if (CmdBuildUtil.OS.isLinux()) {
+            authLicenseCommandCmd = CmdConstant.AUTH_LICENSE_WIN;
+            CmdUtils.callLineSh(authLicenseCommandCmd);
+        } else {
+            authLicenseCommandCmd = CmdConstant.AUTH_LICENSE_WIN
+                    .replace("@inPath", licensePath);
+            CmdUtils.callLine(authLicenseCommandCmd);
+        }
+        int count = 10;
+        try {
+            for (int i = count; i > 0; i--) {
+                if (FileUtil.exist(licensePath + File.separator + "results" + File.separator + "encryption_info.xml")) {
+                    Document document = XmlUtil.readXML(licensePath + File.separator + "results" + File.separator + "encryption_info.xml");
+                    return XmlUtil.getNodeByXPath("//licenseInfo//snInfo", document);
+                }
+                Thread.sleep(1000);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+        return null;
+    }
+}

+ 2 - 0
src/main/java/com/fdkankan/ucenter/service/impl/IncrementOrderServiceImpl.java

@@ -100,6 +100,7 @@ public class IncrementOrderServiceImpl extends ServiceImpl<IIncrementOrderMapper
         switch (dateType){
             case 5 : incrementType = incrementTypeService.getByType(environment).get(0);
                 goodsSkuVo.setPrice(incrementType.getPrice());
+                goodsSkuVo.setSkuSn(incrementType.getId().toString());
                 break;
             case 6: incrementType = incrementTypeService.getByType(environment).get(0);
                 goodsSkuVo.setPrice(incrementType.getDownloadPrice());
@@ -107,6 +108,7 @@ public class IncrementOrderServiceImpl extends ServiceImpl<IIncrementOrderMapper
                 break;
             case 7 : incrementType = incrementTypeService.getByType(environment).get(1);
                 goodsSkuVo.setPrice(incrementType.getPrice());
+                goodsSkuVo.setSkuSn(incrementType.getId().toString());
                 break;
         }
         goodsSkuVo.setDeadLine(getDateTime(incrementType,userIncrementId).toDate().getTime());