Просмотр исходного кода

增加查看订单列表、生成二维码代码

cgp 1 день назад
Родитель
Сommit
2b21e532e3

+ 16 - 1
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -2,6 +2,7 @@ package com.fs.company.controller.qw;
 
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.poi.ExcelUtil;
@@ -18,6 +19,7 @@ import com.fs.his.service.IFsDoctorPatientService;
 import com.fs.his.service.IFsPrescribeService;
 import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
 import com.fs.hisStore.service.IFsUserInformationCollectionService;
+import com.fs.hisStore.service.impl.FsUserInformationCollectionServiceImpl;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.hisStore.vo.FsUserInformationCollectionOverviewVo;
 import com.fs.qw.domain.FsCompanyCustomer;
@@ -63,6 +65,9 @@ public class FsCompanyCustomerController extends BaseController {
     @Autowired
     private IFsDoctorPatientService fsDoctorPatientService;
 
+    @Autowired
+    private FsUserInformationCollectionServiceImpl informationCollectionService;
+
     /**
      * 查询客户列表
      */
@@ -267,7 +272,7 @@ public class FsCompanyCustomerController extends BaseController {
     }
 
     /**
-     * 销售端-查询客户订单列表信息
+     * 查询客户信息你表订单列表信息
      * */
     @ApiOperation("查询客户订单列表信息")
     @GetMapping("/getOrderList")
@@ -281,4 +286,14 @@ public class FsCompanyCustomerController extends BaseController {
         List<FsStoreOrderVO> list = fsCompanyCustomerService.selectStoreOrderScrmByCompanyCustomerParam(customerOrderParam);
         return getDataTable(list);
     }
+
+    /**
+     * 生成制单二维码
+     * */
+    @GetMapping("/getQRCode/{orderId}")
+    public R getQRCode(@PathVariable("orderId") Long orderId){
+        //TODO 后续从配置获取
+        String appId="wx50bcb040b4963a7e";
+        return informationCollectionService.getCustomerGenerateQRCode(orderId,appId);
+    }
 }

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

@@ -100,6 +100,9 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     //CID版信息采集二维码
     R getWxaCodePackageOrderUnLimitNew(Long collectionId,String appId);
 
+    //客户信息表制单二维码
+    R getCustomerGenerateQRCode(Long orderId,String appId);
+
     R doctorConfirm(FsUserInformationCollection collection);
 
     FsUserInfoCollectionUVO info(Long id,Long userId);

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

@@ -809,6 +809,44 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
     }
 
+    @Override
+    public R getCustomerGenerateQRCode(Long orderId, String appId) {
+        logger.info("生成客户信息表制单二维码,请求参数:{},{}",orderId,appId);
+        final WxMaService wxMaService = WxMaConfiguration.getMaService(appId);
+
+        String scene="orderId="+ orderId ;
+        byte[] file;
+        try {
+            file = wxMaService.getQrcodeService().createWxaCodeUnlimitBytes(
+                    scene,
+                    "pages/shopping/paymentOrder",
+                    true,
+                    "release",
+                    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) {