Explorar el Código

河山的销售app 根据 账号搜索客户添加-从中康移

三七 hace 1 mes
padre
commit
d88db15bb5

+ 9 - 8
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -1374,12 +1374,12 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
         }
 
         FsPayConfig payConfig=new FsPayConfig();
-        //支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
-       if (PaymentMethodEnum.ALIPAY==payOrderParam.getPaymentMethod() && StringUtils.isBlank(payOrderParam.getAppId())){
-           String json = configService.selectConfigByKey("his.pay");
-           PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
-           payConfig.setType(payConfigDTO.getType());
-       }else {
+//        //支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
+//       if (PaymentMethodEnum.ALIPAY==payOrderParam.getPaymentMethod() && StringUtils.isBlank(payOrderParam.getAppId())){
+//           String json = configService.selectConfigByKey("his.pay");
+//           PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
+//           payConfig.setType(payConfigDTO.getType());
+//       }else {
            if (StringUtils.isBlank(payOrderParam.getAppId())) {
                throw new IllegalArgumentException("appId不能为空");
            }
@@ -1398,7 +1398,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
            payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
 
            logger.debug("支付配置 his.pay: {}", payConfig);
-       }
+//       }
 
 
 
@@ -2046,7 +2046,8 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
                  json = companyConfigService.selectRedPacketConfigByKeyApp(param.getCompanyId());
                 //如果分公司配置为空就走总后台的配置
                 if (StringUtils.isEmpty(json)){
-                    json = configService.selectConfigByKey("his.AppRedPacket");
+//                    json = configService.selectConfigByKey("his.AppRedPacket");
+                    throw new UnsupportedOperationException("销售公司红包配置为空");
                 }
                 break;
             default:

+ 11 - 11
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePaymentScrmServiceImpl.java

@@ -1145,12 +1145,12 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
             type = "wxApp";
         }
         //支付宝可以不需要appid(在没有appid的情况下)【ps:小程序的支付宝没传appid 就G】
-        if ((PaymentMethodEnum.ALIPAY == payOrderParam.getPaymentMethod())
-                && StringUtils.isBlank(payOrderParam.getAppId())) {
-            String json = configService.selectConfigByKey("his.pay");
-            PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
-            payConfig.setType(payConfigDTO.getType());
-        } else {
+//        if ((PaymentMethodEnum.ALIPAY == payOrderParam.getPaymentMethod())
+//                && StringUtils.isBlank(payOrderParam.getAppId())) {
+//            String json = configService.selectConfigByKey("his.pay");
+//            PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
+//            payConfig.setType(payConfigDTO.getType());
+//        } else {
             if (StringUtils.isBlank(payOrderParam.getAppId())) {
                 throw new IllegalArgumentException("appId不能为空");
             }
@@ -1173,7 +1173,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
             payConfig.setAppId(fsCoursePlaySourceConfig.getAppid());
 
             logger.debug("支付配置 his.pay: {}", payConfig);
-        }
+//        }
 
 
 //        FsPayConfig payConfig = JSONUtil.toBean(json, FsPayConfig.class);
@@ -1191,7 +1191,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
             LiveOrderPayment liveOrderPayment = createLiveStorePayment(payConfig, user, payOrderParam);
             BeanUtils.copyProperties(liveOrderPayment, storePayment);
         } else {
-            storePayment = createStorePaymentScrm(payConfig, user, payOrderParam);
+            storePayment = createStorePaymentScrm(payConfig, user, payOrderParam,merchantAppConfig.getMerchantId());
         }
 
         // 根据配置类型创建第三方支付订单
@@ -1305,7 +1305,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
         order.setReqSeqId(payOrderParam.getBusinessType().getPrefix() + "-" + storePayment.getPayCode());
         order.setTransAmt(storePayment.getPayMoney().toString());
         order.setGoodsDesc(payOrderParam.getBusinessType().getDesc());
-
+        order.setAppId(payOrderParam.getAppId());
         // 微信支付需要设置openid
         if (isWechatPayment(payOrderParam.getPaymentMethod())) {
             order.setOpenid(getOpenIdForPaymentMethod(user, payOrderParam.getPaymentMethod(), payConfig));
@@ -1429,7 +1429,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
     /**
      * 创建支付订单
      */
-    private FsStorePaymentScrm createStorePaymentScrm(FsPayConfig payConfig, FsUserScrm user, PayOrderParam payOrderParam) {
+    private FsStorePaymentScrm createStorePaymentScrm(FsPayConfig payConfig, FsUserScrm user, PayOrderParam payOrderParam,String merchantId) {
         String payCode = OrderCodeUtils.getOrderSn();
         if (StringUtils.isEmpty(payCode)) {
             throw new CustomException("订单生成失败,请重试");
@@ -1452,7 +1452,7 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
         storePayment.setStoreId(payOrderParam.getStoreId());
         storePayment.setUserId(user.getUserId());
         storePayment.setBusinessId(payOrderParam.getOrderId().toString());
-
+        storePayment.setMerConfigId(Long.valueOf(merchantId));
         // 设置openId(如果是微信支付)
         if (isWechatPayment(payOrderParam.getPaymentMethod())) {
             storePayment.setOpenId(getOpenIdForPaymentMethod(user, payOrderParam.getPaymentMethod(), payConfig));

+ 3 - 0
fs-service/src/main/resources/mapper/hisStore/FsStorePaymentScrmMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="payMode"    column="pay_mode"    />
         <result property="appId"    column="app_id"    />
         <result property="businessCode"    column="business_code"    />
+        <result property="merConfigId"    column="mer_config_id"    />
     </resultMap>
 
     <sql id="selectFsStorePaymentVo">
@@ -93,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payMode != null">pay_mode,</if>
             <if test="appId != null">app_id,</if>
             <if test="businessCode != null">business_code,</if>
+            <if test="merConfigId != null">mer_config_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="payCode != null">#{payCode},</if>
@@ -119,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="payMode != null">#{payMode},</if>
             <if test="appId != null">#{appId},</if>
             <if test="businessCode != null">#{businessCode},</if>
+            <if test="merConfigId != null">#{merConfigId},</if>
         </trim>
     </insert>
 

+ 34 - 2
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -25,6 +25,7 @@ import com.fs.course.service.IFsUserCourseVideoService;
 import com.fs.his.domain.FsDoctor;
 import com.fs.his.domain.FsUser;
 import com.fs.his.dto.FindUsersByDTO;
+import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.param.FindUserByParam;
 import com.fs.his.param.FsUserCouponUParam;
 import com.fs.his.param.FsUserEditPushParam;
@@ -71,8 +72,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import static com.fs.his.utils.PhoneUtil.decryptPhoneMk;
-import static com.fs.his.utils.PhoneUtil.encryptPhone;
+import static com.fs.his.utils.PhoneUtil.*;
 
 
 @Api("个人中心")
@@ -81,6 +81,8 @@ import static com.fs.his.utils.PhoneUtil.encryptPhone;
 @RequestMapping(value="/app/user")
 public class UserController extends  AppBaseController {
 
+    @Autowired
+    private FsUserMapper userMapper;
 
     @Autowired
     private IFsUserService userService;
@@ -492,4 +494,34 @@ public class UserController extends  AppBaseController {
         map.put("qwUser",qwUserVO);
         return R.ok().put("data",map);
     }
+
+    @GetMapping("/findUser")
+    public R findUser(@Param("keyword") String keyword) {
+        Long userId = Long.parseLong(keyword);
+        FsUser user = null;
+        user = userService.selectFsUserByUserId(userId);
+        if(user == null){
+            user = findUserByPhone(keyword);
+        }
+        if (user != null) {
+            return R.ok().put("data", user);
+        } else {
+            return R.error("用户不存在!");
+        }
+    }
+
+    private FsUser findUserByPhone(String phone) {
+        // 先根据加密手机号查询用户
+        String jiami = (encryptPhone(phone));
+        FsUser user = userMapper.selectFsUserByPhoneLimitOne(jiami);
+        if (user == null) {
+            user = userMapper.selectFsUserByPhoneLimitOne(encryptPhoneOldKey(phone));
+        }
+        // 如果没有找到用户,再根据手机号查询
+        if (user == null) {
+            user = userMapper.selectFsUserByPhoneLimitOne(phone);
+
+        }
+        return user;
+    }
 }

+ 40 - 0
fs-user-app/src/main/java/com/fs/app/controller/app/ImController.java

@@ -0,0 +1,40 @@
+package com.fs.app.controller.app;
+
+import com.fs.common.core.domain.R;
+import com.fs.im.dto.OpenImResponseDTO;
+import com.fs.im.service.OpenIMService;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @description: im 相关接口
+ * @author: Xgb
+ * @createDate: 2026/4/3
+ * @version: 1.0
+ */
+@Api("im 相关接口")
+@RestController
+@RequestMapping(value = "/app/im")
+@Slf4j
+public class ImController {
+
+    @Autowired
+    private OpenIMService openIMService;
+    /**
+     * @Description: 查询用户信息
+     * @Param:
+     * @Return:
+     * @Author xgb
+     * @Date 2026/4/3 15:45
+     */
+    @GetMapping("/getUserInfo")
+    public R getUserInfo(String id) {
+        OpenImResponseDTO responseDTO = openIMService.getUserInfo(id);
+        return R.ok().put("data",responseDTO);
+    }
+
+}