瀏覽代碼

Merge remote-tracking branch 'origin/master_feat_ysy_20250929' into master_feat_ysy_20250929

wjj 2 天之前
父節點
當前提交
f3a496bf8e

+ 20 - 0
fs-company/src/main/java/com/fs/company/controller/qw/FsCompanyCustomerController.java

@@ -23,6 +23,8 @@ import com.fs.his.param.PrescribePhoneParam;
 import com.fs.his.service.IFsDoctorPatientService;
 import com.fs.his.service.IFsPrescribeDataScrmService;
 import com.fs.his.service.IFsPrescribeService;
+import com.fs.his.service.IFsShareMaterialService;
+import com.fs.his.vo.QrcRedPackageConfigVO;
 import com.fs.hisStore.dto.CreatePhoneQRCodeDTO;
 import com.fs.hisStore.param.FsCompanyCustomerOrderParam;
 import com.fs.hisStore.service.IFsUserInformationCollectionService;
@@ -87,10 +89,16 @@ public class FsCompanyCustomerController extends BaseController {
     @Autowired
     private ISysConfigService sysConfigService;
 
+    @Autowired
+    private IFsShareMaterialService fsShareMaterialService;
+
     //商城小程序appId配置常量
     private static final String APP_ID_CONFIG_KEY = "appStore.appId.config";
+
     private static final String DEFAULT_APP_ID = "wx50bcb040b4963a7e";
 
+    private static final String QRC_RED_PACKAGE_CONFIG_KEY = "qrcRedPackage.config";
+
     /**
      * 查询客户列表
      */
@@ -493,6 +501,18 @@ public class FsCompanyCustomerController extends BaseController {
         return fsCompanyCustomerService.createPhoneQRCode(qrCodeDTO,companyUserId, appId);
     }
 
+    /**
+     * 获取待选择的素材列表
+     * */
+    @GetMapping("/getShareMaterialList")
+    public AjaxResult getShareMaterialList() {
+        QrcRedPackageConfigVO config = sysConfigService.getConfig(QRC_RED_PACKAGE_CONFIG_KEY, QrcRedPackageConfigVO.class);
+        if (config==null){
+            return AjaxResult.error("未找到分享收集手机号的二维码配置");
+        }
+        return AjaxResult.success(fsShareMaterialService.getShareMaterialListByType(config.getType()));
+    }
+
     /**
      * 获取分享素材小程序码
      * @param shareMaterialId 分享素材ID

+ 7 - 0
fs-service/src/main/java/com/fs/his/mapper/FsShareMaterialMapper.java

@@ -67,4 +67,11 @@ public interface FsShareMaterialMapper extends BaseMapper<FsShareMaterial>{
      */
     @Select("select id as dictValue,material_name as dictLabel,material_url as dictImgUrl, type as dictValue1 from fs_share_material")
     List<OptionsVO> listOptions();
+
+    /**
+     * 根据类型查询分享素材
+     * @param type
+     * @return
+     */
+    List<FsShareMaterial> getShareMaterialListByType(Integer type);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/IFsShareMaterialService.java

@@ -64,4 +64,11 @@ public interface IFsShareMaterialService extends IService<FsShareMaterial>{
      * 查询分享素材选项
      */
     List<OptionsVO> listOptions();
+
+    /**
+     * 根据类型查询分享素材列表
+     * @param type
+     * @return
+     */
+    List<FsShareMaterial> getShareMaterialListByType(Integer type);
 }

+ 9 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsShareMaterialServiceImpl.java

@@ -6,7 +6,6 @@ import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.his.vo.OptionsVO;
 import org.apache.commons.collections4.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsShareMaterialMapper;
 import com.fs.his.domain.FsShareMaterial;
@@ -106,4 +105,13 @@ public class FsShareMaterialServiceImpl extends ServiceImpl<FsShareMaterialMappe
         }
         return optionsVOS;
     }
+
+    @Override
+    public List<FsShareMaterial> getShareMaterialListByType(Integer type) {
+        List<FsShareMaterial> optionsVOS = baseMapper.getShareMaterialListByType(type);
+        if (CollectionUtils.isEmpty(optionsVOS)) {
+            return Collections.emptyList();
+        }
+        return optionsVOS;
+    }
 }

+ 1 - 0
fs-service/src/main/java/com/fs/his/vo/QrcRedPackageConfigVO.java

@@ -9,5 +9,6 @@ import java.math.BigDecimal;
 @Data
 public class QrcRedPackageConfigVO {
     private Integer open;
+    private Integer type;
     private BigDecimal amount;
 }

+ 2 - 2
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyCustomerServiceImpl.java

@@ -466,12 +466,12 @@ public class FsCompanyCustomerServiceImpl implements IFsCompanyCustomerService {
     @Override
     public R createPhoneQRCode(CreatePhoneQRCodeDTO qrCodeDTO, Long companyUserId, String appId) {
         final WxMaService wxMaService = WxMaConfiguration.getMaService(appId);
-        String scene="cuId="+ companyUserId+ "&materialId=" + qrCodeDTO.getMaterialId();
+        String scene="cuId="+ companyUserId+ "&shareMaterialId=" + qrCodeDTO.getMaterialId();
         byte[] file;
         try {
             file = wxMaService.getQrcodeService().createWxaCodeUnlimitBytes(
                     scene,
-                    "pages/shopping/paymentOrder",
+                    "pages_course/getPhoneNumber",
                     true,
                     "release",
                     430,

+ 0 - 1
fs-service/src/main/java/com/fs/qw/service/impl/FsCompanyQrcPhoneServiceImpl.java

@@ -71,7 +71,6 @@ public class FsCompanyQrcPhoneServiceImpl implements IFsCompanyQrcPhoneService {
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public int submitPhone(CollectionUserPhoneDTO userPhoneDTO) {
         // 1. 构建手机号记录
         FsCompanyQrcPhone qrcPhone = new FsCompanyQrcPhone();

+ 5 - 1
fs-service/src/main/resources/mapper/his/FsShareMaterialMapper.xml

@@ -30,7 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFsShareMaterialVo"/>
         where id = #{id}
     </select>
-        
+
+    <select id="getShareMaterialListByType" resultMap="FsShareMaterialResult">
+        select * from fs_share_material where type = #{type}
+    </select>
+
     <insert id="insertFsShareMaterial" parameterType="FsShareMaterial" useGeneratedKeys="true" keyProperty="id">
         insert into fs_share_material
         <trim prefix="(" suffix=")" suffixOverrides=",">