Przeglądaj źródła

CID版信息采集二维码

wjj 5 dni temu
rodzic
commit
46a731502f

+ 9 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsUserInformationCollectionController.java

@@ -170,6 +170,15 @@ public class FsUserInformationCollectionController extends BaseController
 
     }
 
+    @PreAuthorize("@ss.hasPermi('hisStore:collection:WxaCodeCollectionUnLimitNew')")
+    @GetMapping("/getWxaCodeCollectionUnLimitNew/{collectionId}/{appId}")
+    public R getWxaCodeCollectionUnLimitNew(@PathVariable("collectionId") Long collectionId,@PathVariable("appId") String appId)
+    {
+
+        return fsUserInformationCollectionService.getWxaCodePackageOrderUnLimitNew(collectionId,appId);
+
+    }
+
     /**
      * 信息采集取消
      */

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsUserInformationCollectionService.java

@@ -96,6 +96,8 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     FsUserInformationCollectionVO detail(Long id);
 
     R getWxaCodePackageOrderUnLimit(Long collectionId,String appId);
+    //CID版信息采集二维码
+    R getWxaCodePackageOrderUnLimitNew(Long collectionId,String appId);
 
     R doctorConfirm(FsUserInformationCollection collection);
 

+ 41 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -703,6 +703,47 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
     }
 
+    @Override
+    public R getWxaCodePackageOrderUnLimitNew(Long collectionId, String appId) {
+        logger.info("生成用户信息采集二维码,请求参数:{},{}",collectionId,appId);
+        FsSysConfig sysConfig = configUtil.getSysConfig();
+//
+//        final WxMaService wxMaService = WxMaConfiguration.getMaService(sysConfig.getAppid());
+        final WxMaService wxMaService = WxMaConfiguration.getMaService(appId);
+
+        String scene="collectionId="+ collectionId ;
+        byte[] file;
+        try {
+            file = wxMaService.getQrcodeService().createWxaCodeUnlimitBytes(
+                    scene,
+                    "pages_order/confirmUserinfoNew",
+                    true,
+                    "trial",//release trial
+                    430,
+                    true,
+                    null,
+                    false);
+
+            // 上传图片到存储桶
+            String suffix = ".png";
+            CloudStorageService storage = OSSFactory.build();
+            String url;
+            try {
+                url = storage.uploadSuffix(file, suffix);
+            }  catch (Exception e) {
+                // 记录错误日志
+                logger.error("生成图片失败:{}",e.getMessage(),e);
+                return R.error("生成图片失败");
+            }
+            // 返回成功信息
+            return R.ok().put("url",url);
+
+        } catch (WxErrorException e) {
+            logger.error(e.getMessage(), e);
+            return R.error("微信接口调用失败: " + e.getMessage());
+        }
+    }
+
     @Override
     @Transactional
     public R doctorConfirm(FsUserInformationCollection collection) {