Procházet zdrojové kódy

Merge branch 'master' into 企微聊天

ct před 1 dnem
rodič
revize
df282e8c96
40 změnil soubory, kde provedl 858 přidání a 71 odebrání
  1. 30 7
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java
  2. 8 2
      fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java
  3. 3 3
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  4. 111 0
      fs-admin/src/main/java/com/fs/task/MiniProgramSubTask.java
  5. 68 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  6. 6 3
      fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java
  7. 3 0
      fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollection.java
  8. 3 2
      fs-service/src/main/java/com/fs/his/service/impl/FsIntegralOrderServiceImpl.java
  9. 7 2
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  10. 3 3
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java
  11. 1 1
      fs-service/src/main/java/com/fs/live/mapper/LiveDataMapper.java
  12. 36 5
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  13. 2 1
      fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java
  14. 2 2
      fs-service/src/main/java/com/fs/live/service/ILiveDataService.java
  15. 8 12
      fs-service/src/main/java/com/fs/live/service/impl/LiveAfterSalesServiceImpl.java
  16. 4 4
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  17. 9 3
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  18. 10 2
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  19. 1 2
      fs-service/src/main/java/com/fs/live/service/impl/LiveWatchUserServiceImpl.java
  20. 1 0
      fs-service/src/main/java/com/fs/live/vo/FsMyLiveOrderListQueryVO.java
  21. 2 0
      fs-service/src/main/java/com/fs/live/vo/LiveDataDetailVo.java
  22. 2 0
      fs-service/src/main/java/com/fs/live/vo/LiveUserDetailVo.java
  23. 2 0
      fs-service/src/main/java/com/fs/live/vo/ProductSalesVo.java
  24. 43 0
      fs-service/src/main/java/com/fs/store/dto/ClientCredGrantReqDTO.java
  25. 52 0
      fs-service/src/main/java/com/fs/store/dto/MiniGramSubsMsgResultDTO.java
  26. 68 0
      fs-service/src/main/java/com/fs/store/dto/TemplateMessageSendRequestDTO.java
  27. 36 0
      fs-service/src/main/java/com/fs/store/dto/WeXinAccessTokenDTO.java
  28. 44 0
      fs-service/src/main/java/com/fs/store/enums/MiniAppNotifyTaskStatusEnum.java
  29. 28 0
      fs-service/src/main/java/com/fs/store/service/IWechatMiniProgrService.java
  30. 29 0
      fs-service/src/main/java/com/fs/store/service/impl/IWechatMiniProgrServiceImpl.java
  31. 95 0
      fs-service/src/main/java/com/fs/store/utils/MiniProgramHttp.java
  32. 43 0
      fs-service/src/main/java/com/fs/store/vo/ClientCredGrantReqDTO.java
  33. 36 0
      fs-service/src/main/java/com/fs/store/vo/WeXinAccessTokenDTO.java
  34. 3 3
      fs-service/src/main/resources/application-config-druid-gzzdy.yml
  35. 20 2
      fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml
  36. 6 1
      fs-service/src/main/resources/mapper/his/FsUserInformationCollectionMapper.xml
  37. 23 2
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml
  38. 6 0
      fs-service/src/main/resources/mapper/live/LiveDataMapper.xml
  39. 2 6
      fs-user-app/src/main/java/com/fs/app/controller/UserController.java
  40. 2 3
      fs-user-app/src/main/java/com/fs/app/param/FsUserEditParam.java

+ 30 - 7
fs-admin/src/main/java/com/fs/hisStore/controller/FsStoreOrderScrmController.java

@@ -8,6 +8,8 @@ import com.fs.common.annotation.Log;
 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.domain.entity.SysRole;
+import com.fs.common.core.domain.entity.SysUser;
 import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
@@ -53,6 +55,7 @@ import com.fs.hisStore.service.*;
 import com.fs.hisStore.vo.*;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
+import com.fs.system.service.ISysRoleService;
 import com.github.pagehelper.PageHelper;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
@@ -340,19 +343,19 @@ public class FsStoreOrderScrmController extends BaseController {
         }
         param.setNotHealth(1);
         List<FsStoreOrderErpExportVO> list = fsStoreOrderService.selectFsStoreOrderListVOByExport(param);
+
         //对手机号脱敏
         if (list != null) {
-            //获取当前账号角色权限
-            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            SysRole sysRole = isCheckPermission();
 
             for (FsStoreOrderErpExportVO vo : list) {
-                if (vo.getPhone() != null) {
+                if (vo.getPhone() != null && sysRole.getIsCheckPhone() != 1) {
                     vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
-                if (vo.getUserPhone() != null) {
+                if (vo.getUserPhone() != null && sysRole.getIsCheckPhone() != 1) {
                     vo.setUserPhone(vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
                 }
-                if (vo.getUserAddress()!=null){
+                if (vo.getUserAddress()!=null && sysRole.getIsCheckAddress() != 1){
                     vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
                 }
             }
@@ -377,6 +380,25 @@ public class FsStoreOrderScrmController extends BaseController {
         }
     }
 
+    @Autowired
+    private ISysRoleService sysRoleService;
+    private SysRole isCheckPermission() {
+        SysRole sysRole = new SysRole();
+        SysUser user = getLoginUser().getUser();
+        boolean flag = user.isAdmin();
+        if (flag) {
+            sysRole.setIsCheckPhone(1);
+            sysRole.setIsCheckAddress(1);
+        } else {
+            List<SysRole> roles = user.getRoles();
+            if (roles != null && !roles.isEmpty()) {
+                Long[] roleIds = roles.stream().map(SysRole::getRoleId).toArray(Long[]::new);
+                return sysRoleService.getIsCheckPermission(roleIds);
+            }
+        }
+        return sysRole;
+    }
+
 
     /**
      * 导出订单列表(明文)
@@ -453,14 +475,15 @@ public class FsStoreOrderScrmController extends BaseController {
         List<FsStoreOrderItemExportVO> list = orderItemService.selectFsStoreOrderItemListExportVO(param);
         //对手机号脱敏
         if (list != null) {
+            SysRole sysRole = isCheckPermission();
             LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
 
             for (FsStoreOrderItemExportVO vo : list) {
-                if (vo.getUserPhone() != null) {
+                if (vo.getUserPhone() != null && sysRole.getIsCheckPhone() != 1) {
                     String phone = vo.getUserPhone().replaceAll("(\\d{3})\\d*(\\d{1})", "$1****$2");
                     vo.setUserPhone(phone);
                 }
-                if (vo.getUserAddress()!=null){
+                if (vo.getUserAddress()!=null && sysRole.getIsCheckAddress() != 1){
                     vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
                 }
                 if (!StringUtils.isEmpty(vo.getJsonInfo())) {

+ 8 - 2
fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java

@@ -3,6 +3,7 @@ package com.fs.hisStore.task;
 
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
+import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
 import com.fs.common.utils.DateUtils;
 import com.fs.company.service.ICompanyService;
@@ -174,7 +175,10 @@ public class MallStoreTask
         // 单个异常影响全部,跳过异常单子
         for (Long id : ids) {
             try {
-                fsStoreOrderService.createOmsOrder(id);
+                R omsOrder = fsStoreOrderService.createOmsOrder(id);
+                if ("500".equals(omsOrder.get("code"))) {
+
+                }
             } catch (Exception e) {
                 log.error("创建商城oms订单失败:"+id);
                 log.error("创建商城oms订单失败:"+e.getMessage());
@@ -224,7 +228,9 @@ public class MallStoreTask
         for (FsStoreOrderScrm order : list) {
             order.setUpdateTime(nowDate);
         }
-        fsStoreOrderMapper.batchUpdateTime(list);
+        if (list!= null && !list.isEmpty()){
+            fsStoreOrderMapper.batchUpdateTime(list);
+        }
         for (FsStoreOrderScrm order : list){
             ErpOrderQueryRequert request = new ErpOrderQueryRequert();
             request.setCode(order.getExtendOrderId());

+ 3 - 3
fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java

@@ -133,7 +133,7 @@ public class LiveDataController extends BaseController {
     @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/getLiveUserDetailListBySql")
     public R getLiveUserDetailListBySql(@RequestParam Long liveId) {
-        return liveDataService.getLiveUserDetailListBySql(liveId);
+        return liveDataService.getLiveUserDetailListBySql(liveId,null,null);
     }
 
     /**
@@ -167,11 +167,11 @@ public class LiveDataController extends BaseController {
     @Log(title = "直播间用户详情", businessType = BusinessType.EXPORT)
     @GetMapping("/exportLiveUserDetail")
     public AjaxResult exportLiveUserDetail(@RequestParam Long liveId) {
-        List<LiveUserDetailExportVO> list = liveDataService.exportLiveUserDetail(liveId);
+        List<LiveUserDetailExportVO> list = liveDataService.exportLiveUserDetail(liveId,null,null);
         if (list == null || list.isEmpty()) {
             return AjaxResult.error("未找到用户详情数据");
         }
-        
+
         ExcelUtil<LiveUserDetailExportVO> util = new ExcelUtil<>(LiveUserDetailExportVO.class);
         return util.exportExcel(list, "直播间用户详情数据");
     }

+ 111 - 0
fs-admin/src/main/java/com/fs/task/MiniProgramSubTask.java

@@ -0,0 +1,111 @@
+package com.fs.task;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.fs.live.domain.LiveMiniprogramSubNotifyTask;
+import com.fs.live.mapper.LiveMiniprogramSubNotifyTaskMapper;
+import com.fs.store.enums.MiniAppNotifyTaskStatusEnum;
+import com.fs.store.service.IWechatMiniProgrService;
+import com.fs.store.dto.ClientCredGrantReqDTO;
+import com.fs.store.dto.MiniGramSubsMsgResultDTO;
+import com.fs.store.dto.TemplateMessageSendRequestDTO;
+import com.fs.store.dto.WeXinAccessTokenDTO;
+import com.fs.wx.miniapp.config.WxMaProperties;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小程序订阅通知定时任务
+ */
+@Service("miniProgramSubTask")
+@Slf4j
+@RequiredArgsConstructor
+public class MiniProgramSubTask {
+    private final IWechatMiniProgrService wechatMiniProgrService;
+
+    private final LiveMiniprogramSubNotifyTaskMapper notifyTaskMapper;
+
+    private WxMaProperties.Config config = null;
+
+    @Autowired
+    public void setConfig(WxMaProperties properties) {
+        if(ObjectUtil.isNotNull(properties)){
+            this.config = properties.getConfigs().get(0);
+        }
+    }
+
+
+    /**
+     * 小程序订阅通知
+     */
+    public void notifyMiniLiveAppSub(){
+        log.info("小程序直播订阅通知定时任务");
+        // 先获取所有可用待处理任务
+        List<LiveMiniprogramSubNotifyTask> pendingData = notifyTaskMapper.selectLivePendingData();
+        if(CollectionUtils.isEmpty(pendingData)){
+            log.info("小程序直播阅通知定时任务, 无待处理数据");
+            return;
+        }
+        LocalDateTime now = LocalDateTime.now();
+        for (LiveMiniprogramSubNotifyTask pendingDatum : pendingData) {
+
+            if(pendingDatum.getUpdateTime().isAfter(now)) continue;
+
+            pendingDatum.setUpdateTime(LocalDateTime.now());
+
+            ClientCredGrantReqDTO clientCredGrantReqDTO = new ClientCredGrantReqDTO();
+            clientCredGrantReqDTO.setAppid(config.getAppid());
+            clientCredGrantReqDTO.setSecret(config.getSecret());
+            clientCredGrantReqDTO.setGrant_type("client_credential");
+
+            try{
+                // 获取accessToken
+                WeXinAccessTokenDTO stableToken = wechatMiniProgrService
+                        .getStableToken(clientCredGrantReqDTO);
+
+                String accessToken = stableToken.getAccessToken();
+
+                // 调用微信小程序订阅通知
+                TemplateMessageSendRequestDTO sendRequestDTO = new TemplateMessageSendRequestDTO();
+                sendRequestDTO.setTemplate_id(pendingDatum.getTemplateId());
+                sendRequestDTO.setTouser(pendingDatum.getTouser());
+                sendRequestDTO.setPage(pendingDatum.getPage());
+                TypeReference<Map<String, TemplateMessageSendRequestDTO.TemplateDataValue>> typeReference = new TypeReference<Map<String, TemplateMessageSendRequestDTO.TemplateDataValue>>() {};
+                sendRequestDTO.setData(JSON.parseObject(pendingDatum.getData(),typeReference));
+                MiniGramSubsMsgResultDTO miniGramSubsMsgResultDTO = wechatMiniProgrService.sendSubscribeMsg(accessToken, sendRequestDTO);
+                pendingDatum.setRequestBody(JSON.toJSONString(sendRequestDTO));
+                pendingDatum.setResponseBody(JSON.toJSONString(miniGramSubsMsgResultDTO));
+
+                // 如果推送消息成功
+                if(miniGramSubsMsgResultDTO.getErrcode() == 0){
+                    pendingDatum.setStatus(MiniAppNotifyTaskStatusEnum.SUCCESS.getValue());
+                } else {
+                    // 更新任务状态为执行失败
+                    pendingDatum.setStatus(MiniAppNotifyTaskStatusEnum.FAILED.getValue());
+                    pendingDatum.setErrorMessage(JSON.toJSONString(miniGramSubsMsgResultDTO));
+                    pendingDatum.setRetryCount(pendingDatum.getRetryCount() +1);
+                }
+            }catch (Throwable e){
+                // 更新任务状态为执行失败
+                pendingDatum.setStatus(MiniAppNotifyTaskStatusEnum.FAILED.getValue());
+                pendingDatum.setErrorMessage(ExceptionUtils.getStackTrace(e));
+                pendingDatum.setRetryCount(pendingDatum.getRetryCount() +1);
+                log.error("小程序直播订阅通知定时任务异常: {}", ExceptionUtils.getStackTrace(e));
+            }
+        }
+
+        if(CollectionUtils.isNotEmpty(pendingData)){
+            notifyTaskMapper.updateBatchById(pendingData);
+        }
+
+    }
+}

+ 68 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java

@@ -7,6 +7,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.framework.service.TokenService;
@@ -14,6 +15,7 @@ import com.fs.live.domain.LiveData;
 import com.fs.live.param.LiveDataParam;
 import com.fs.live.service.ILiveDataService;
 import com.fs.live.vo.ColumnsConfigVo;
+import com.fs.live.vo.LiveUserDetailExportVO;
 import com.github.pagehelper.PageHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -38,6 +40,72 @@ public class LiveDataController extends BaseController
     @Autowired
     private TokenService tokenService;
 
+    /**
+     * 查询直播间详情数据(SQL方式)
+     * @param liveId 直播间ID
+     * @return 详情数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/getLiveDataDetailBySql")
+    public R getLiveDataDetailBySql(@RequestParam Long liveId) {
+        return liveDataService.getLiveDataDetailBySql(liveId);
+    }
+
+    /**
+     * 查询直播间用户详情列表(SQL方式)
+     * @param liveId 直播间ID
+     * @return 用户详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/getLiveUserDetailListBySql")
+    public R getLiveUserDetailListBySql(@RequestParam Long liveId, HttpServletRequest request) {
+        CompanyUser user = tokenService.getLoginUser(request).getUser();
+
+        return liveDataService.getLiveUserDetailListBySql(liveId,user.getCompanyId(),user.getUserId());
+    }
+
+    /**
+     * 查询直播间详情数据(查询数据服务器处理方式)
+     * @param liveId 直播间ID
+     * @return 详情数据
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/getLiveDataDetailByServer")
+    public R getLiveDataDetailByServer(@RequestParam Long liveId) {
+        return liveDataService.getLiveDataDetailByServer(liveId);
+    }
+
+    /**
+     * 查询直播间用户详情列表(查询数据服务器处理方式)
+     * @param liveId 直播间ID
+     * @return 用户详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
+    @GetMapping("/getLiveUserDetailListByServer")
+    public R getLiveUserDetailListByServer(@RequestParam Long liveId) {
+        return liveDataService.getLiveUserDetailListByServer(liveId);
+    }
+
+
+    /**
+     * 导出直播间用户详情数据
+     * @param liveId 直播间ID
+     * @return Excel文件
+     */
+    @PreAuthorize("@ss.hasPermi('liveData:liveData:export')")
+    @Log(title = "直播间用户详情", businessType = BusinessType.EXPORT)
+    @GetMapping("/exportLiveUserDetail")
+    public AjaxResult exportLiveUserDetail(@RequestParam Long liveId, HttpServletRequest request) {
+        CompanyUser user = tokenService.getLoginUser(request).getUser();
+        List<LiveUserDetailExportVO> list = liveDataService.exportLiveUserDetail(liveId,user.getCompanyId(),user.getUserId());
+        if (list == null || list.isEmpty()) {
+            return AjaxResult.error("未找到用户详情数据");
+        }
+
+        ExcelUtil<LiveUserDetailExportVO> util = new ExcelUtil<>(LiveUserDetailExportVO.class);
+        return util.exportExcel(list, "直播间用户详情数据");
+    }
+
     /**
      * 直播数据页面卡片数据
      */

+ 6 - 3
fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -146,7 +146,7 @@ public class WebSocketServer {
                 redisCache.incr(UNIQUE_VIEWERS_KEY + liveId, 1);
             }
             liveWatchUserVO.setMsgStatus(liveWatchUserVO.getMsgStatus());
-            if (1 == random.nextInt(4)) {
+            if (1 == random.nextInt(10)) {
                 SendMsgVo sendMsgVo = new SendMsgVo();
                 sendMsgVo.setLiveId(liveId);
                 sendMsgVo.setUserId(userId);
@@ -232,7 +232,7 @@ public class WebSocketServer {
 
 
             // 广播离开消息 添加一个概率问题 摇塞子,1-4 当为1的时候广播消息
-            if (1 == new Random().nextInt(4)) {
+            if (1 == new Random().nextInt(10)) {
                 SendMsgVo sendMsgVo = new SendMsgVo();
                 sendMsgVo.setLiveId(liveId);
                 sendMsgVo.setUserId(userId);
@@ -759,7 +759,7 @@ public class WebSocketServer {
         ConcurrentHashMap<Long, Session> room = getRoom(liveId);
         room.forEach((k, v) -> {
             if (v.isOpen()) {
-                sendWithRetry(v,message,7);
+                sendWithRetry(v,message,1);
             }
         });
     }
@@ -855,6 +855,9 @@ public class WebSocketServer {
                 }
                 LiveCouponIssue liveCouponIssue = liveCouponIssueService.selectLiveCouponIssueByCouponId(liveCoupon.getCouponId());
                 LiveCouponIssueRelation relation = liveCouponMapper.selectCouponRelation(task.getLiveId(), liveCouponIssue.getId());
+                if (liveCoupon != null) {
+                    redisCache.setCacheObject(String.format(LiveKeysConstant.LIVE_COUPON_NUM , liveCouponIssue.getId()), liveCouponIssue.getRemainCount().intValue(), 30, TimeUnit.MINUTES);
+                }
                 HashMap<String, Object> data = new HashMap<>();
                 data.put("liveId", task.getLiveId());
                 data.put("couponIssueId", liveCouponIssue.getId());

+ 3 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollection.java

@@ -108,4 +108,7 @@ public class FsUserInformationCollection extends BaseEntity{
     //药师签名
     private String doctorType2Sign;
 
+    //药品订单id
+    private Long storeOrderId;
+
 }

+ 3 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsIntegralOrderServiceImpl.java

@@ -210,10 +210,11 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
         FsIntegralOrder order = fsIntegralOrderMapper.selectById(fsIntegralOrder.getOrderId());
         //当前状态
         Integer status = order.getStatus();
-        if (status.equals(2)){
+        Integer newStatus = fsIntegralOrder.getStatus();
+        if (!status.equals(newStatus) && status.equals(2)){
             throw new CustomException("积分订单无法修改为待支付状态");
         }
-        if (status.equals(2)&&StrUtil.isBlank(fsIntegralOrder.getDeliverySn())) {
+        if (!status.equals(newStatus) && newStatus.equals(2)&&StrUtil.isBlank(fsIntegralOrder.getDeliverySn())) {
             throw new CustomException("修改为待发货时,请填写物流单号");
         }
         //其他逻辑,目前暂定这个

+ 7 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1055,7 +1055,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         if (fsStoreOrderMapper.insertFsStoreOrder(order) > 0) {
             if(CloudHostUtils.hasCloudHostName("金牛明医")){
                 //信息采集 发送药师im
-                doctorSendIm(packageOrder);
+                doctorSendIm(packageOrder,order.getOrderId());
             }
             if (packageOrder.getCycle() >= followRate) {
                 FsFollow fsFollow = new FsFollow();
@@ -1141,7 +1141,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
         return R.ok();
     }
 
-    private void doctorSendIm(FsPackageOrder packageOrder) {
+    private void doctorSendIm(FsPackageOrder packageOrder,Long storeOrderId) {
         try {
             //信息采集 发送药师im
             FsUserInformationCollection fsUserInformationCollectionParam = new FsUserInformationCollection();
@@ -1152,6 +1152,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             if (!fsUserInformationCollections.isEmpty()) {
                 for (FsUserInformationCollection collection : fsUserInformationCollections) {
                     openIMService.sendUserInformation(collection.getUserId(),collection.getDoctorType2Id(),collection.getId());
+                    //保存id 到信息采集表
+                    FsUserInformationCollection saveParam = new FsUserInformationCollection();
+                    saveParam.setId(collection.getId());
+                    saveParam.setStoreOrderId(storeOrderId);
+                    fsUserInformationCollectionMapper.updateFsUserInformationCollection(saveParam);
                 }
             }
         } catch (Exception e) {

+ 3 - 3
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java

@@ -1283,9 +1283,9 @@ public interface FsStoreOrderScrmMapper
             "        </if>" +
             "<if test=\"maps.status == 6\">" +
             "            AND o.`status` = 1" +
-            "            AND (" +
-            "            o.store_id IN (SELECT store_id FROM fs_store WHERE delivery_type=2 OR delivery_type=1)" +
-            "            )" +
+//            "            AND (" +
+//            "            o.store_id IN (SELECT store_id FROM fs_store WHERE delivery_type=2 OR delivery_type=1)" +
+//            "            )" +
             "            AND (o.extend_order_id IS NULL OR o.extend_order_id = '')" +
             "        </if>" +
             "<if test = 'maps.deliveryStatus != null    '> " +

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveDataMapper.java

@@ -168,5 +168,5 @@ public interface LiveDataMapper {
      * @param liveId 直播间ID
      * @return 用户详情列表
      */
-    List<LiveUserDetailVo> selectLiveUserDetailListBySql(@Param("liveId") Long liveId);
+    List<LiveUserDetailVo> selectLiveUserDetailListBySql(@Param("liveId") Long liveId,@Param("companyId") Long companyId,@Param("companyUserId") Long companyUserId);
 }

+ 36 - 5
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -138,15 +138,46 @@ public interface LiveMapper
             "select * from live where 1=1 " +
             " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1 " +
             " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if> " +
-            " order by create_time desc" +
+            " UNION " +
+            "select l.* from live l " +
+            "LEFT JOIN ( " +
+            "    SELECT live_id, SUM(COALESCE(duration, 0)) AS total_duration " +
+            "    FROM live_video " +
+            "    WHERE video_type IN (1, 2) " +
+            "    GROUP BY live_id " +
+            ") video_duration ON l.live_id = video_duration.live_id " +
+            "where 1=1 " +
+            " <if test='param.companyId!=null' > and l.company_id = #{param.companyId} </if> " +
+            "and l.live_type IN (1,2, 3) AND l.status = 2 AND l.is_del = 0 and l.is_audit=1 " +
+            "and l.start_time IS NOT NULL " +
+            "and TIMESTAMPDIFF(SECOND, l.start_time, NOW()) > COALESCE(video_duration.total_duration, 0) " +
+            "and COALESCE(video_duration.total_duration, 0) > 0 " +
+            " <if test='param.liveName!=null' > and l.live_name like concat('%' ,#{param.liveName},'%') </if> " +
+            "order by create_time desc" +
             " </script>"})
     List<Live> listLiveData(@Param("param") LiveDataParam param);
 
     @Select({"<script>" +
-            "select count(1) from live where 1=1 " +
-            " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1" +
-            " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if>" +
-            "  order by create_time desc " +
+            "select count(1) from ( " +
+            "select * from live where 1=1 " +
+            " <if test='param.companyId!=null' > and company_id = #{param.companyId} </if> and live_type IN (1,2, 3) AND status IN (3, 4) AND is_del = 0 and is_audit=1 " +
+            " <if test='param.liveName!=null' > and live_name like concat('%' ,#{param.liveName},'%') </if> " +
+            " UNION " +
+            "select l.* from live l " +
+            "LEFT JOIN ( " +
+            "    SELECT live_id, SUM(COALESCE(duration, 0)) AS total_duration " +
+            "    FROM live_video " +
+            "    WHERE video_type IN (1, 2) " +
+            "    GROUP BY live_id " +
+            ") video_duration ON l.live_id = video_duration.live_id " +
+            "where 1=1 " +
+            " <if test='param.companyId!=null' > and l.company_id = #{param.companyId} </if> " +
+            "and l.live_type IN (1,2, 3) AND l.status = 2 AND l.is_del = 0 and l.is_audit=1 " +
+            "and l.start_time IS NOT NULL " +
+            "and TIMESTAMPDIFF(SECOND, l.start_time, NOW()) > COALESCE(video_duration.total_duration, 0) " +
+            "and COALESCE(video_duration.total_duration, 0) > 0 " +
+            " <if test='param.liveName!=null' > and l.live_name like concat('%' ,#{param.liveName},'%') </if> " +
+            ") as temp " +
             " </script>"})
     int listLiveDataCount(@Param("param") LiveDataParam param);
 

+ 2 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveOrderMapper.java

@@ -370,7 +370,8 @@ public interface LiveOrderMapper {
     int batchUpdateErpByOrderIds(@Param("maps")ArrayList<Map<String, String>> maps);
 
     @Select({"<script> " +
-            "select o.order_id,o.total_num,o.create_time, o.discount_money ,o.live_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_sn as delivery_id,o.finish_time  from live_order o  " +
+            "select a.id as afterSalesId,o.order_id,o.total_num,o.create_time, o.discount_money ,o.live_id,o.order_code,o.item_json,o.pay_price,o.status,o.delivery_sn as delivery_id,o.finish_time  from live_order o  " +
+            " left join ( SELECT t.*,ROW_NUMBER() OVER (PARTITION BY t.order_id ORDER BY t.create_time DESC) AS rn FROM live_after_sales t ) a ON o.order_id = a.order_id AND a.rn = 1 " +
             "where o.is_del=0 " +
             "<if test = 'maps.status != null and maps.status != \"\"     '> " +
             "and o.status =#{maps.status} " +

+ 2 - 2
fs-service/src/main/java/com/fs/live/service/ILiveDataService.java

@@ -145,7 +145,7 @@ public interface ILiveDataService {
      * @param liveId 直播间ID
      * @return 用户详情列表
      */
-    R getLiveUserDetailListBySql(Long liveId);
+    R getLiveUserDetailListBySql(Long liveId, Long companyId, Long companyUserId);
 
     /**
      * 查询直播间详情数据(查询数据服务器处理方式)
@@ -166,5 +166,5 @@ public interface ILiveDataService {
      * @param liveId 直播间ID
      * @return 导出VO列表
      */
-    List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId);
+    List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId, Long companyId, Long companyUserId);
 }

+ 8 - 12
fs-service/src/main/java/com/fs/live/service/impl/LiveAfterSalesServiceImpl.java

@@ -317,6 +317,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
                     LiveOrder orderMap=new LiveOrder();
                     orderMap.setOrderId(order.getOrderId());
                     orderMap.setOrderCode(orderSn);
+                    orderMap.setStatus(order.getStatus());
                     liveOrderService.updateLiveOrder(orderMap);
                     liveOrderItemMapper.updateFsStoreOrderCode(order.getOrderId(),orderSn);
                     try {
@@ -426,6 +427,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         storeAfterSales.setSalesStatus(0);
         storeAfterSales.setCreateTime(Timestamp.valueOf(LocalDateTime.now()));
         storeAfterSales.setIsDel(0);
+        storeAfterSales.setOrderStatus(orderStatus);
         storeAfterSales.setUserId(Long.valueOf(userId));
         storeAfterSales.setOrderStatus(orderStatus);
         storeAfterSales.setCompanyId(order.getCompanyId());
@@ -459,16 +461,9 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         request.setRefund_state(1);
         request.setStoreAfterSalesId(storeAfterSales.getId());
         if (StringUtils.isNotBlank(order.getExtendOrderId())){
-            ErpOrderQueryRequert queryRequest = new ErpOrderQueryRequert();
-            queryRequest.setCode(order.getExtendOrderId());
-            ErpOrderQueryResponse response = erpOrderService.getLiveOrder(queryRequest);
-            if (response.getOrders() != null && response.getOrders().size() > 0) {
-                if (response.getOrders().get(0).getCancle() != null && !response.getOrders().get(0).getCancle()) {
-                    BaseResponse res = erpOrderService.refundUpdateLive(request);
-                    if(res.getSuccess()){
-                        return R.ok();
-                    }
-                }
+            BaseResponse response=erpOrderService.refundUpdateLive(request);
+            if(response.getSuccess()){
+                return R.ok();
             }
             else{
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -913,7 +908,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
         logs.setStoreAfterSalesId(storeAfterSales.getId());
         logs.setChangeMessage(OrderInfoEnum.REFUND_STATUS_1.getDesc());
         liveAfterSalesLogsMapper.insertLiveAfterSalesLogs(logs);
-        if (storeAfterSales.getOrderStatus().equals(2)) {
+        if (storeAfterSales.getOrderStatus().equals(1)) {
             if (StringUtils.isNotEmpty(order.getExtendOrderId())) {
                 //更新订单code
                 String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
@@ -923,6 +918,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
                 LiveOrder orderMap = new LiveOrder();
                 orderMap.setOrderId(order.getOrderId());
                 orderMap.setOrderCode(orderSn);
+                orderMap.setStatus(order.getStatus());
                 liveOrderService.updateLiveOrder(orderMap);
                 //生成新的订单
                 List<LiveOrderPayment> payments = liveOrderPaymentMapper.selectLiveOrderPaymentByPay(5, order.getOrderId());
@@ -934,7 +930,7 @@ public class LiveAfterSalesServiceImpl implements ILiveAfterSalesService {
                 }
 
                 try {
-                    if (liveOrderPaymentMapper.selectByBuissnessId(Long.valueOf(order.getOrderCode())) != null) {
+                    if (liveOrderPaymentMapper.selectByBuissnessId(order.getOrderId()) != null) {
                         liveOrderService.createOmsOrder(order.getOrderId());
                     }
                 } catch (Exception e) {

+ 4 - 4
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -695,8 +695,8 @@ public class LiveDataServiceImpl implements ILiveDataService {
     }
 
     @Override
-    public R getLiveUserDetailListBySql(Long liveId) {
-        List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId);
+    public R getLiveUserDetailListBySql(Long liveId, Long companyId, Long companyUserId ) {
+        List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId, companyId, companyUserId);
         return R.ok().put("data", userDetailList);
     }
 
@@ -1081,9 +1081,9 @@ public class LiveDataServiceImpl implements ILiveDataService {
      * @return 导出VO列表
      */
     @Override
-    public List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId) {
+    public List<LiveUserDetailExportVO> exportLiveUserDetail(Long liveId, Long companyId, Long companyUserId) {
         // 查询用户详情列表
-        List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId);
+        List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId, companyId, companyUserId);
         if (userDetailList == null || userDetailList.isEmpty()) {
             return new ArrayList<>();
         }

+ 9 - 3
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -2631,6 +2631,12 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
     {
         liveOrder.setUpdateTime(DateUtils.getNowDate());
         liveUserLotteryRecordMapper.updateOrderStatusByOrderId(liveOrder.getOrderId(), liveOrder.getStatus());
+        //推送修改的商城订单地址到聚水潭ERP
+        try {
+            pushOrderAddressToErp(liveOrder);
+        }catch (Exception e){
+            log.error("修改商城订单地址推送到聚水潭ERP失败,orderId: {}", liveOrder.getOrderId(), e);
+        }
         return baseMapper.updateLiveOrder(liveOrder);
     }
 
@@ -3566,9 +3572,9 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                     dto.setBarCode(fsStoreProductAttrValue.getBarCode());
                     dto.setGroupBarCode(fsStoreProductAttrValue.getGroupBarCode());
                 }
-                if (fsStoreProductAttrValue != null) {
-                    dto.setBarCode(fsStoreProductAttrValue.getBarCode());
-                    dto.setGroupBarCode(fsStoreProductAttrValue.getGroupBarCode());
+                if (attrValue != null) {
+                    dto.setBarCode(attrValue.getBarCode());
+                    dto.setGroupBarCode(attrValue.getGroupBarCode());
                 }
                 dto.setPrice(fsStoreProduct.getPrice());
                 dto.setProductName(fsStoreProduct.getProductName());

+ 10 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -290,10 +290,18 @@ public class LiveServiceImpl implements ILiveService
                 .eq(FsUserWx::getFsUserId, userId)
                 .eq(FsUserWx::getAppId, StringUtils.isEmpty(param.getAppId()) ? "wx44beed5640bcb1ba" : param.getAppId()); // 卓美小程序
         FsUserWx fsUserWx = fsUserWxMapper.selectOne(queryWrapper);
-        String maOpenId = fsUserWx.getOpenId();
-        if (StringUtils.isEmpty(maOpenId)) {
+        String maOpenId = "";
+        if (fsUserWx == null) {
             maOpenId = param.getMaOpenId();
+        }else {
+            maOpenId = fsUserWx.getOpenId();
+        }
+
+        if (StringUtils.isEmpty(maOpenId)) {
+            log.error("用户没有绑定微信,无法发送预约提醒:{}", userId);
+            return R.ok();
         }
+
         notifyTask.setTouser(maOpenId);
         notifyTask.setPage(String.valueOf(1));
 

+ 1 - 2
fs-service/src/main/java/com/fs/live/service/impl/LiveWatchUserServiceImpl.java

@@ -201,13 +201,13 @@ public class LiveWatchUserServiceImpl implements ILiveWatchUserService {
 
     @Override
     public LiveWatchUser join(FsUserScrm fsUser,long liveId, long userId, String location) {
-        Date now = DateUtils.getNowDate();
 
         // 查询直播间信息
         Live live = liveMapper.selectLiveByLiveId(liveId);
         if (live == null) {
             throw new RuntimeException("直播间不存在");
         }
+        Date now = DateUtils.getNowDate();
 
         // 获取直播/回放状态(带缓存)
         Map<String, Integer> flagMap = getLiveFlagWithCache(liveId);
@@ -429,7 +429,6 @@ public class LiveWatchUserServiceImpl implements ILiveWatchUserService {
         liveWatchUser.setLiveId(liveId);
         List<LiveWatchUserVO> liveWatchUserVOS = selectOnlineUserList(liveWatchUser);
 
-        log.info("开始同步直播在线人数到缓存,共{}条数据", liveWatchUserVOS.size());
         if (CollUtil.isNotEmpty(liveWatchUserVOS)){
             ThreadUtil.execute(()->{
                 String hashKey  = String.format(LiveKeysConstant.LIVE_WATCH_USERS, liveId);

+ 1 - 0
fs-service/src/main/java/com/fs/live/vo/FsMyLiveOrderListQueryVO.java

@@ -26,6 +26,7 @@ public class FsMyLiveOrderListQueryVO implements Serializable
     private Long id;
     private Long orderId;
     private Long liveId;
+    private Long afterSalesId;
 
     /** 订单号 */
     private String orderCode;

+ 2 - 0
fs-service/src/main/java/com/fs/live/vo/LiveDataDetailVo.java

@@ -98,3 +98,5 @@ public class LiveDataDetailVo {
 
 
 
+
+

+ 2 - 0
fs-service/src/main/java/com/fs/live/vo/LiveUserDetailVo.java

@@ -40,3 +40,5 @@ public class LiveUserDetailVo {
 
 
 
+
+

+ 2 - 0
fs-service/src/main/java/com/fs/live/vo/ProductSalesVo.java

@@ -28,3 +28,5 @@ public class ProductSalesVo {
 
 
 
+
+

+ 43 - 0
fs-service/src/main/java/com/fs/store/dto/ClientCredGrantReqDTO.java

@@ -0,0 +1,43 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 客户端凭证授权请求DTO
+ * <p>
+ * 用于构建客户端凭证授权模式下的请求参数。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class ClientCredGrantReqDTO implements Serializable {
+
+    /**
+     * 授权类型
+     * <p>
+     * 固定值 "client_credential",表示客户端凭证授权模式。
+     * </p>
+     */
+    private String grant_type;
+
+    /**
+     * 应用ID
+     * <p>
+     * 应用程序的唯一标识符。
+     * </p>
+     */
+    private String appid;
+
+    /**
+     * 应用密钥
+     * <p>
+     * 应用程序的密钥,用于验证请求的合法性。  <b>注意:应妥善保管,避免泄露。</b>
+     * </p>
+     */
+    private String secret;
+}

+ 52 - 0
fs-service/src/main/java/com/fs/store/dto/MiniGramSubsMsgResultDTO.java

@@ -0,0 +1,52 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 消息发送结果DTO
+ * <p>
+ * 用于封装消息发送接口的响应结果。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class MiniGramSubsMsgResultDTO implements Serializable {
+
+    /**
+     * 错误码
+     * <p>
+     * 返回码,0表示成功,其他值表示失败。
+     * </p>
+     */
+    private Integer errcode;
+
+    /**
+     * 错误信息
+     * <p>
+     * 返回码的文本描述,成功时为 "ok",失败时包含具体的错误信息。
+     * </p>
+     */
+    private String errmsg;
+
+    /**
+     * 消息ID
+     * <p>
+     * 消息的唯一标识符,成功发送时返回。
+     * </p>
+     *  <p>
+     *     注意:这个字段可能为null,发送失败时,此字段可能为null
+     *  </p>
+     */
+    private Long msgid;
+
+    /**
+     * rid  请求的唯一标识
+     * 仅在发生错误时出现
+     */
+    private String rid;
+}

+ 68 - 0
fs-service/src/main/java/com/fs/store/dto/TemplateMessageSendRequestDTO.java

@@ -0,0 +1,68 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * 模板消息发送请求DTO
+ * <p>
+ * 用于构建发送模板消息的请求体。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class TemplateMessageSendRequestDTO {
+
+    /**
+     * 接收者openid
+     * <p>
+     * 用户的唯一标识符。
+     * </p>
+     */
+    private String touser;
+
+    /**
+     * 模板ID
+     * <p>
+     * 所需下发的模板消息的id。
+     * </p>
+     */
+    private String template_id;
+
+    /**
+     * 跳转页面
+     * <p>
+     * 点击模板消息后跳转的页面,可以为空。
+     * </p>
+     */
+    private String page;
+
+    /**
+     * 模板数据
+     * <p>
+     * 模板内容,键值对形式,键名为模板中的变量名,值为要替换的内容。
+     * </p>
+     */
+    private Map<String, TemplateDataValue> data;
+
+    /**
+     * 模板数据值对象
+     * <p>
+     * 内部类,用于表示模板数据中的单个值。
+     * </p>
+     */
+    @Data
+    public static class TemplateDataValue {
+        /**
+         * 模板变量值
+         * <p>
+         * 要替换模板变量的具体内容。
+         * </p>
+         */
+        private String value;
+    }
+}

+ 36 - 0
fs-service/src/main/java/com/fs/store/dto/WeXinAccessTokenDTO.java

@@ -0,0 +1,36 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+/**
+ * 访问令牌DTO
+ * <p>
+ * 用于存储从认证服务器获取的访问令牌及其相关信息。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class WeXinAccessTokenDTO {
+
+    /**
+     * 访问令牌
+     * <p>
+     * 用于访问受保护资源的令牌。
+     * </p>
+     */
+    private String accessToken;
+
+    /**
+     * 过期时间(秒)
+     * <p>
+     * 访问令牌的有效时间,单位为秒。
+     * </p>
+     */
+    private Integer expiresIn;
+
+    private Long errcode;
+    private String errmsg;
+}

+ 44 - 0
fs-service/src/main/java/com/fs/store/enums/MiniAppNotifyTaskStatusEnum.java

@@ -0,0 +1,44 @@
+package com.fs.store.enums;
+
+
+import lombok.Getter;
+
+@Getter
+public enum MiniAppNotifyTaskStatusEnum {
+    /**
+     * 待执行
+     */
+    WAITING(0),
+    /**
+     * 执行中
+     */
+    RUNNING(1),
+    /**
+     * 执行成功
+     */
+    SUCCESS(2),
+    /**
+     * 执行失败
+     */
+    FAILED(3),
+    /**
+     * 已取消
+     */
+    CANCELED(4);
+
+    private final int value;
+
+    MiniAppNotifyTaskStatusEnum(int value) {
+        this.value = value;
+    }
+
+
+    public static MiniAppNotifyTaskStatusEnum fromValue(int value) {
+        for (MiniAppNotifyTaskStatusEnum status : values()) {
+            if (status.getValue() == value) {
+                return status;
+            }
+        }
+        throw new IllegalArgumentException("Invalid value: " + value);
+    }
+}

+ 28 - 0
fs-service/src/main/java/com/fs/store/service/IWechatMiniProgrService.java

@@ -0,0 +1,28 @@
+package com.fs.store.service;
+
+
+import com.fs.store.dto.ClientCredGrantReqDTO;
+import com.fs.store.dto.MiniGramSubsMsgResultDTO;
+import com.fs.store.dto.TemplateMessageSendRequestDTO;
+import com.fs.store.dto.WeXinAccessTokenDTO;
+
+/**
+ * 小程序调用相关
+ */
+public interface IWechatMiniProgrService {
+    /**
+     * 获取稳定的token
+     *
+     * @param param 请求参数
+     * @return {@link com.fs.store.dto.WeXinAccessTokenDTO}
+     */
+    WeXinAccessTokenDTO getStableToken(ClientCredGrantReqDTO param);
+
+    /**
+     * 微信小程序发送订阅消息
+     *
+     * @param param 请求参数
+     * @return {@link MiniGramSubsMsgResultDTO}
+     */
+    MiniGramSubsMsgResultDTO sendSubscribeMsg(String accessToken, TemplateMessageSendRequestDTO param);
+}

+ 29 - 0
fs-service/src/main/java/com/fs/store/service/impl/IWechatMiniProgrServiceImpl.java

@@ -0,0 +1,29 @@
+package com.fs.store.service.impl;
+
+import com.fs.store.dto.ClientCredGrantReqDTO;
+import com.fs.store.dto.MiniGramSubsMsgResultDTO;
+import com.fs.store.dto.TemplateMessageSendRequestDTO;
+import com.fs.store.dto.WeXinAccessTokenDTO;
+import com.fs.store.service.IWechatMiniProgrService;
+import com.fs.store.utils.MiniProgramHttp;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@RequiredArgsConstructor
+@Service
+@Slf4j
+public class IWechatMiniProgrServiceImpl implements IWechatMiniProgrService {
+
+    private final MiniProgramHttp miniProgramHttp;
+
+    @Override
+    public WeXinAccessTokenDTO getStableToken(ClientCredGrantReqDTO param) {
+        return miniProgramHttp.getStableAccessToken(param);
+    }
+
+    @Override
+    public MiniGramSubsMsgResultDTO sendSubscribeMsg(String accessToken,TemplateMessageSendRequestDTO param) {
+        return miniProgramHttp.sendSubscribeMessage(accessToken,param);
+    }
+}

+ 95 - 0
fs-service/src/main/java/com/fs/store/utils/MiniProgramHttp.java

@@ -0,0 +1,95 @@
+package com.fs.store.utils;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.store.dto.ClientCredGrantReqDTO;
+import com.fs.store.dto.MiniGramSubsMsgResultDTO;
+import com.fs.store.dto.TemplateMessageSendRequestDTO;
+import com.fs.store.dto.WeXinAccessTokenDTO;
+import com.hc.openapi.tool.fastjson.JSON;
+import com.hc.openapi.tool.util.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+@Component
+@Slf4j
+public class MiniProgramHttp {
+
+    /**
+     * 微信小程序-发送订阅消息地址
+     */
+    private static final String BASE_URL = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send";
+
+    /**
+     * 微信小程序-获取accessToken地址
+     */
+    private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/stable_token";
+
+
+    /**
+     * 发送微信订阅消息 (使用 Hutool)
+     * @param accessToken token
+     * @param param 请求数据
+     * @return String
+     */
+    public MiniGramSubsMsgResultDTO sendSubscribeMessage(String accessToken, TemplateMessageSendRequestDTO param) {
+        String url = BASE_URL + "?access_token=" + accessToken;
+
+        log.info("发送小程序订阅消息, 请求 URL: {}", url);
+
+        String requestBody = JSON.toJSONString(param);
+        log.info("发送小程序订阅消息, 请求参数: {}", requestBody);
+
+        try {
+            String response = HttpUtil.post(url, requestBody);
+            log.info("发送小程序订阅消息, HTTP 请求 URL: {}", url);
+            log.info("发送小程序订阅消息, HTTP 请求体: {}", requestBody);
+            log.info("发送小程序订阅消息, HTTP 响应: {}", response);
+
+            MiniGramSubsMsgResultDTO result = JSONObject.parseObject(response, MiniGramSubsMsgResultDTO.class);
+            if(ObjectUtil.notEqual(result.getErrcode(),0)){
+                throw new RuntimeException("发送小程序订阅消息失败, " + result.getErrmsg());
+            }
+            log.info("发送小程序订阅消息, 解析结果: {}", JSON.toJSONString(result));
+            return result;
+
+        } catch (Exception e) {
+            log.error("发送小程序订阅消息失败: {}", e.getMessage());
+            throw e;
+        }
+    }
+
+
+    /**
+     * 获取微信 Stable Access Token
+     * @return WeXinAccessTokenDTO
+     */
+    public WeXinAccessTokenDTO getStableAccessToken(ClientCredGrantReqDTO param) {
+        String requestBody = JSONObject.toJSONString(param);
+        log.info("获取微信 Stable Access Token, 请求参数: {}", requestBody); // 打印请求参数
+
+        try {
+            String responseJson =
+            HttpRequest.post(TOKEN_URL).contentType("application/json").body(requestBody).execute().body();
+            log.info("获取微信 Stable Access Token, HTTP 请求 URL: {}", TOKEN_URL);
+            log.info("获取微信 Stable Access Token, HTTP 请求体: {}", requestBody);
+            log.info("获取微信 Stable Access Token, HTTP 响应: {}", responseJson);
+
+            if(StringUtils.isBlank(responseJson)){
+                throw new RuntimeException("获取微信 Stable Access Token 失败,response为空");
+            }
+            WeXinAccessTokenDTO result = JSONObject.parseObject(responseJson, WeXinAccessTokenDTO.class);
+            log.info("获取微信 Stable Access Token, 解析结果: {}", JSONObject.toJSONString(result)); //记录解析结果
+            if(result == null || StringUtils.isBlank(result.getAccessToken())){
+                throw new RuntimeException("获取微信 Stable Access Token 失败, accessToken为空");
+            }
+            return result;
+
+        } catch (Exception e) {
+            log.error("获取微信 Stable Access Token 失败", e);
+            throw e;
+        }
+    }
+}

+ 43 - 0
fs-service/src/main/java/com/fs/store/vo/ClientCredGrantReqDTO.java

@@ -0,0 +1,43 @@
+package com.fs.store.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 客户端凭证授权请求DTO
+ * <p>
+ * 用于构建客户端凭证授权模式下的请求参数。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class ClientCredGrantReqDTO implements Serializable {
+
+    /**
+     * 授权类型
+     * <p>
+     * 固定值 "client_credential",表示客户端凭证授权模式。
+     * </p>
+     */
+    private String grant_type;
+
+    /**
+     * 应用ID
+     * <p>
+     * 应用程序的唯一标识符。
+     * </p>
+     */
+    private String appid;
+
+    /**
+     * 应用密钥
+     * <p>
+     * 应用程序的密钥,用于验证请求的合法性。  <b>注意:应妥善保管,避免泄露。</b>
+     * </p>
+     */
+    private String secret;
+}

+ 36 - 0
fs-service/src/main/java/com/fs/store/vo/WeXinAccessTokenDTO.java

@@ -0,0 +1,36 @@
+package com.fs.store.vo;
+
+import lombok.Data;
+
+/**
+ * 访问令牌DTO
+ * <p>
+ * 用于存储从认证服务器获取的访问令牌及其相关信息。
+ * </p>
+ *
+ * @author xdd
+ * @version 1.0
+ * @since 2025-02-27
+ */
+@Data
+public class WeXinAccessTokenDTO {
+
+    /**
+     * 访问令牌
+     * <p>
+     * 用于访问受保护资源的令牌。
+     * </p>
+     */
+    private String accessToken;
+
+    /**
+     * 过期时间(秒)
+     * <p>
+     * 访问令牌的有效时间,单位为秒。
+     * </p>
+     */
+    private Integer expiresIn;
+
+    private Long errcode;
+    private String errmsg;
+}

+ 3 - 3
fs-service/src/main/resources/application-config-druid-gzzdy.yml

@@ -76,7 +76,7 @@ nuonuo:
 tencent_cloud_config:
   secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
   secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
-  bucket: gzzdy-1323137866
+  bucket: gzzdy1-1323137866
   app_id: 1323137866
   region: ap-chongqing
   proxy: gzzdy
@@ -87,8 +87,8 @@ cloud_host:
 headerImg:
   imgUrl:
 ipad:
-  ipadUrl: http://ipad.dyzkl.cn
-  aiApi: http://49.232.181.28:3000/api
+  ipadUrl: http://ipad.dingdangtcm.cn
+  aiApi: http://
   voiceApi: http://123.207.48.104:8009
   commonApi: http://123.207.48.104:7771
 wx_miniapp_temp:

+ 20 - 2
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -532,6 +532,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
             LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
         </if>
+        <if test="maps.status != null and (maps.status == 7 or maps.status == 6)">
+            LEFT JOIN fs_user_information_collection fuic ON fuic.store_order_id = so.order_id
+        </if>
 
         where so.is_del=0
         <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
@@ -567,7 +570,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.isFirst != null">
             and so.is_first = #{maps.isFirst}
         </if>
-        <if test="maps.status != null and maps.status != 6">
+        <if test="maps.status != null and maps.status != 6 and maps.status != 7">
             and so.status = #{maps.status}
         </if>
         <if test="maps.status == 6">
@@ -576,6 +579,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
             )
             and  (so.extend_order_id is null or  so.extend_order_id like '')
+            and (fuic.doctor_type2_confirm = 1 or fuic.doctor_type2_confirm = null)
+        </if>
+        <if test="maps.status == 7">
+            and so.`status`= 2
+            and fuic.doctor_type2_confirm = 0
+
         </if>
         <if test="maps.source != null">
             and so.source = #{maps.source}
@@ -741,6 +750,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE sp.business_code IS NOT NULL
         ) sp_latest ON sp_latest.business_code = so.order_code AND sp_latest.rn = 1
         LEFT JOIN fs_course_play_source_config csc ON csc.appid = sp_latest.app_id
+        <if test="maps.status != null and (maps.status == 7 or maps.status == 6)">
+            LEFT JOIN fs_user_information_collection fuic ON fuic.store_order_id = so.order_id
+        </if>
         <where>
             <if test="maps.packageSecondName != null and maps.packageSecondName != ''">
                 and so.package_second_name like concat('%', #{maps.packageSecondName}, '%')
@@ -775,7 +787,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.isFirst != null">
                 and so.is_first = #{maps.isFirst}
             </if>
-            <if test="maps.status != null and maps.status != 6">
+            <if test="maps.status != null and maps.status != 6 and maps.status != 7">
                 and so.status = #{maps.status}
             </if>
             <if test="maps.status == 6">
@@ -784,6 +796,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 so.store_id in (select store_id from fs_store where delivery_type=2 or delivery_type=1)
                 )
                 and  (so.extend_order_id is null or  so.extend_order_id like '')
+                and (fuic.doctor_type2_confirm = 1 or fuic.doctor_type2_confirm = null)
+            </if>
+            <if test="maps.status == 7">
+                and so.`status`= 2
+                and fuic.doctor_type2_confirm = 0
+
             </if>
             <if test="maps.source != null">
                 and so.source = #{maps.source}

+ 6 - 1
fs-service/src/main/resources/mapper/his/FsUserInformationCollectionMapper.xml

@@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="doctorType2Id"    column="doctor_type2_id"    />
         <result property="doctorType2Confirm"    column="doctor_type2_confirm"    />
         <result property="doctorType2Sign"    column="doctor_type2_sign"    />
+        <result property="storeOrderId"    column="store_order_id"    />
     </resultMap>
 
     <sql id="selectFsUserInformationCollectionVo">
@@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              , doctor_confirm, create_time, update_time,doctor_id,company_user_id
              ,package_id,pay_type,amount,is_package,user_confirm2,package_order_code,package_order_id
              ,status,user_advice,doctor_advice,doctor_sign,doctor_confirm_time,sex,user_name,user_phone_four
-             ,allergy,remark,patient_id,doctor_type2_id,doctor_type2_confirm,doctor_type2_sign  from fs_user_information_collection
+             ,allergy,remark,patient_id,doctor_type2_id,doctor_type2_confirm,doctor_type2_sign,store_order_id  from fs_user_information_collection
     </sql>
 
     <select id="selectFsUserInformationCollectionList" parameterType="FsUserInformationCollection" resultMap="FsUserInformationCollectionResult">
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userConfirm != null "> and user_confirm = #{userConfirm}</if>
             <if test="doctorConfirm != null "> and doctor_confirm = #{doctorConfirm}</if>
             <if test="packageOrderId != null "> and package_order_id = #{packageOrderId}</if>
+            <if test="storeOrderId != null "> and store_order_id = #{storeOrderId}</if>
             <if test="packageOrderCode != null and packageOrderCode !=''"> and package_order_code = #{packageOrderCode}</if>
         </where>
         order by id desc
@@ -152,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorType2Id != null">doctor_type2_id,</if>
             <if test="doctorType2Confirm != null">doctor_type2_confirm,</if>
             <if test="doctorType2Sign != null">doctor_type2_sign,</if>
+            <if test="storeOrderId != null">store_order_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="questionId != null">#{questionId},</if>
@@ -184,6 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorType2Id != null">#{doctorType2Id},</if>
             <if test="doctorType2Confirm != null">#{doctorType2Confirm},</if>
             <if test="doctorType2Sign != null">#{doctorType2Sign},</if>
+            <if test="storeOrderId != null">#{storeOrderId},</if>
          </trim>
     </insert>
 
@@ -220,6 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="doctorType2Id != null">doctor_type2_id = #{doctorType2Id},</if>
             <if test="doctorType2Confirm != null">doctor_type2_confirm = #{doctorType2Confirm},</if>
             <if test="doctorType2Sign != null">doctor_type2_sign = #{doctorType2Sign},</if>
+            <if test="storeOrderId != null">store_order_id = #{storeOrderId},</if>
         </trim>
         where id = #{id}
     </update>

+ 23 - 2
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1588,7 +1588,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 <!--    商城订单查询接口-->
     <select id="selectFsStoreOrderListVO" resultType="com.fs.hisStore.vo.FsStoreOrderVO">
-        select o.id,o.order_code,o.extend_order_id,o.pay_order_id,o.bank_order_id,o.user_id,o.real_name,o.user_phone,o.user_address,o.cart_id,o.freight_price,o.total_num,o.total_price,o.total_postage,o.pay_price,o.pay_postage,o.pay_delivery,o.pay_money,o.deduction_price,o.coupon_id,o.coupon_price,o.paid,o.pay_time,o.pay_type,o.create_time,o.update_time,o.status,o.refund_status,o.refund_reason_wap_img,o.refund_reason_wap_explain,o.refund_reason_time,o.refund_reason_wap,o.refund_reason,o.refund_price,o.delivery_sn,o.delivery_name,o.delivery_type,o.delivery_id,o.gain_integral,o.use_integral,o.pay_integral,o.back_integral,o.mark,o.is_del,o.remark,o.verify_code,o.store_id,o.shipping_type,o.is_channel,o.is_remind,o.is_sys_del,o.is_prescribe,o.prescribe_id,o.company_id,o.company_user_id,o.is_package,o.package_json,o.order_type,o.package_id,o.finish_time,o.delivery_status,o.delivery_pay_status,o.delivery_time,o.delivery_pay_time,o.delivery_pay_money,o.tui_money,o.tui_money_status,o.delivery_import_time,o.tui_user_id,o.tui_user_money_status,o.order_create_type,o.store_house_code,o.dept_id,o.is_edit_money,o.customer_id,o.is_pay_remain,o.delivery_send_time,o.certificates,o.upload_time,o.item_json,o.schedule_id,o.delivery_pay_type,o.order_visit,o.service_fee,o.cycle,o.prescribe_price,o.follow_doctor_id,o.follow_time,o.user_coupon_id,o.order_medium,o.erp_phone
+        select DISTINCT o.id,o.order_code,o.extend_order_id,o.pay_order_id,o.bank_order_id,o.user_id,o.real_name,o.user_phone,o.user_address,o.cart_id,o.freight_price,o.total_num,o.total_price,o.total_postage,o.pay_price,o.pay_postage,o.pay_delivery,o.pay_money,o.deduction_price,o.coupon_id,o.coupon_price,o.paid,o.pay_time,o.pay_type,o.create_time,o.update_time,o.status,o.refund_status,o.refund_reason_wap_img,o.refund_reason_wap_explain,o.refund_reason_time,o.refund_reason_wap,o.refund_reason,o.refund_price,o.delivery_sn,o.delivery_name,o.delivery_type,o.delivery_id,o.gain_integral,o.use_integral,o.pay_integral,o.back_integral,o.mark,o.is_del,o.remark,o.verify_code,o.store_id,o.shipping_type,o.is_channel,o.is_remind,o.is_sys_del,o.is_prescribe,o.prescribe_id,o.company_id,o.company_user_id,o.is_package,o.package_json,o.order_type,o.package_id,o.finish_time,o.delivery_status,o.delivery_pay_status,o.delivery_time,o.delivery_pay_time,o.delivery_pay_money,o.tui_money,o.tui_money_status,o.delivery_import_time,o.tui_user_id,o.tui_user_money_status,o.order_create_type,o.store_house_code,o.dept_id,o.is_edit_money,o.customer_id,o.is_pay_remain,o.delivery_send_time,o.certificates,o.upload_time,o.item_json,o.schedule_id,o.delivery_pay_type,o.order_visit,o.service_fee,o.cycle,o.prescribe_price,o.follow_doctor_id,o.follow_time,o.user_coupon_id,o.order_medium,o.erp_phone
         ,u.phone,u.register_code,u.register_date,u.source, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber
         , csc.name miniProgramName,fsp.cost, fspc.cate_name,spavs.bar_code, sp_latest.bank_transaction_id as bankTransactionId
         from fs_store_order_scrm o
@@ -1602,7 +1602,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join fs_store_order_item_scrm oi on o.id = oi.order_id
         left join fs_store_product_scrm fsp on fsp.product_id = oi.product_id
         left join fs_store_product_category_scrm fspc on fspc.cate_id = fsp.cate_id
-        left join fs_store_product_attr_value_scrm spavs on fsp.product_id = spavs.product_id
+        LEFT JOIN fs_store_product_attr_value_scrm spavs
+        ON fsp.product_id = spavs.product_id
+        AND spavs.bar_code = JSON_UNQUOTE(JSON_EXTRACT(oi.json_info, '$.barCode'))
 
         LEFT JOIN (
         SELECT
@@ -1761,6 +1763,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=  ''">
             left join company_user cu on cu.user_id=o.company_user_id
         </if>
+        <if test="maps.erpAccount != null and maps.erpAccount != ''">
+            LEFT JOIN fs_store_order_df df on df.order_id=o.id
+
+        </if>
         <if test = "maps.productName != null and  maps.productName !=  '' ">
             left join fs_store_order_item_scrm oi on o.id = oi.order_id
             left join fs_store_product_scrm fsp on fsp.product_id = oi.product_id
@@ -1780,6 +1786,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.appId != null and map.appId != ''">
                 and csc.appid = #{maps.appId}
             </if>
+            <if test="maps.orderCodes != null  and maps.orderCodes.size > 0">
+                and o.order_code in
+                <foreach collection="maps.orderCodes" item="orderCode" open="(" close=")" separator=",">
+                    #{orderCode}
+                </foreach>
+            </if>
             <if test="maps.orderCode != null and  maps.orderCode !=''">
                 and o.order_code like CONCAT('%',#{maps.orderCode},'%')
             </if>
@@ -1881,6 +1893,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="maps.appId != null and maps.appId != ''">
                 and csc.appid = #{maps.appId}
             </if>
+            <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
+                and o.erp_phone like concat(#{maps.erpPhoneNumber},'%')
+            </if>
+            <if test="maps.erpAccount != null and maps.erpAccount != '未分拣' and maps.erpAccount != ''">
+                and df.login_account like #{maps.erpAccount}
+            </if>
+            <if test="maps.erpAccount == '未分拣'">
+                and ( df.login_account is null or df.login_account like '')
+            </if>
         </where>
         ${maps.params.dataScope}
         <if test="maps.productName != null and  maps.productName !=  ''   ">

+ 6 - 0
fs-service/src/main/resources/mapper/live/LiveDataMapper.xml

@@ -540,6 +540,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN company c ON lufe.company_id = c.company_id
         LEFT JOIN company_user cu ON lufe.company_user_id = cu.user_id
         WHERE lwu.live_id = #{liveId}
+        <if test="companyId != null">
+            and lufe.company_id = #{companyId}
+        </if>
+        <if test="companyUserId != null">
+            and lufe.company_user_id = #{companyUserId}
+        </if>
         GROUP BY u.user_id, u.nick_name, u.nickname, order_info.orderCount, order_info.orderAmount, c.company_name, cu.user_name
         ORDER BY order_info.orderAmount DESC, liveWatchDuration DESC
     </select>

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

@@ -26,8 +26,6 @@ import com.fs.his.utils.PhoneUtil;
 import com.fs.his.vo.FsUserCouponCountUVO;
 import com.fs.his.vo.FsUserCouponListUVO;
 import com.fs.his.vo.UserVo;
-import com.fs.hisStore.domain.FsUserScrm;
-import com.fs.hisStore.service.IFsUserScrmService;
 import com.fs.qw.service.IQwAppContactWayService;
 import com.fs.system.oss.CloudStorageService;
 import com.fs.system.oss.OSSFactory;
@@ -79,8 +77,6 @@ public class UserController extends  AppBaseController {
     private IQwAppContactWayService qwAppContactWayService;
     @Autowired
     private IFsUserCourseVideoService courseVideoService;
-    @Autowired
-    private IFsUserScrmService fsUserScrmService;
 
 
     @Autowired
@@ -120,7 +116,7 @@ public class UserController extends  AppBaseController {
     @GetMapping("/getUserInfo")
     public R getUserInfo(HttpServletRequest request){
         try {
-            FsUserScrm user=fsUserScrmService.selectFsUserByUserId(Long.parseLong(getUserId()));
+            FsUser user=userService.selectFsUserByUserId(Long.parseLong(getUserId()));
             if (user.getPhone()!=null&&user.getPhone().length()>11&&!user.getPhone().matches("\\d+")){
                 user.setPhone(decryptPhoneMk(user.getPhone()));
             }
@@ -205,7 +201,7 @@ public class UserController extends  AppBaseController {
     public R editUser(@RequestBody @Valid FsUserEditParam param, HttpServletRequest request){
         param.setUserId(Long.parseLong(getUserId()));
         log.info("【修改用户头像昵称】:{}",param);
-        if (param.getNickname().length()>50){
+        if (param.getNickname() != null && param.getNickname().length()>50){
             return R.error("请授权正确的昵称!");
         }
         if (StringUtils.isEmpty(param.getAvatar())){

+ 2 - 3
fs-user-app/src/main/java/com/fs/app/param/FsUserEditParam.java

@@ -12,7 +12,6 @@ import java.io.Serializable;
 
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class FsUserEditParam implements Serializable {
-    @NotNull(message = "用户昵称不能为空!")
     @JsonAlias("nickname")
     private String nickname;
 
@@ -25,8 +24,8 @@ public class FsUserEditParam implements Serializable {
     private Long userId;
     private Integer isWeixinAuth;
 
-
-    public @NotNull(message = "用户昵称不能为空!") String getNickname() {
+//    @NotNull(message = "用户昵称不能为空!")
+    public String getNickname() {
         return nickname;
     }