Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java

caoliqin 1 month ago
parent
commit
1ac2dda08b
35 changed files with 739 additions and 76 deletions
  1. 1 0
      fs-admin/src/main/java/com/fs/course/controller/qw/QwFsCourseWatchLogController.java
  2. 24 1
      fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java
  3. 1 0
      fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java
  4. 1 0
      fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java
  5. 8 3
      fs-doctor-app/src/main/java/com/fs/app/controller/DiagnosisController.java
  6. 1 0
      fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java
  7. 1 1
      fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java
  8. 52 16
      fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java
  9. 5 0
      fs-service/src/main/java/com/fs/company/domain/Company.java
  10. 1 0
      fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java
  11. 30 5
      fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java
  12. 2 0
      fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogStatisticsListParam.java
  13. 13 0
      fs-service/src/main/java/com/fs/course/param/FsFirstDiagnosisListUParam.java
  14. 11 0
      fs-service/src/main/java/com/fs/course/param/FsInquiryPatientInfoUParam.java
  15. 11 2
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java
  16. 77 0
      fs-service/src/main/java/com/fs/course/vo/FsFirstDiagnosisListUVO.java
  17. 113 0
      fs-service/src/main/java/com/fs/course/vo/FsInquiryPatientInfoListUVO.java
  18. 22 1
      fs-service/src/main/java/com/fs/his/mapper/FsFirstDiagnosisMapper.java
  19. 25 0
      fs-service/src/main/java/com/fs/his/mapper/FsInquiryPatientInfoMapper.java
  20. 17 0
      fs-service/src/main/java/com/fs/his/param/FsDiagnosisFillDParam.java
  21. 13 0
      fs-service/src/main/java/com/fs/his/service/IFsFirstDiagnosisService.java
  22. 8 0
      fs-service/src/main/java/com/fs/his/service/IFsInquiryPatientInfoService.java
  23. 86 1
      fs-service/src/main/java/com/fs/his/service/impl/FsFirstDiagnosisServiceImpl.java
  24. 17 0
      fs-service/src/main/java/com/fs/his/service/impl/FsInquiryPatientInfoServiceImpl.java
  25. 18 27
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  26. 7 0
      fs-service/src/main/java/com/fs/his/vo/FsDiagnosisListDVO.java
  27. 1 1
      fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting.java
  28. 1 1
      fs-service/src/main/java/com/fs/sop/mapper/QwSopLogsMapper.java
  29. 58 5
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java
  30. 5 5
      fs-service/src/main/resources/application-druid-jzzx.yml
  31. 5 5
      fs-service/src/main/resources/application-druid-kyt.yml
  32. 6 1
      fs-service/src/main/resources/mapper/company/CompanyMapper.xml
  33. 1 1
      fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml
  34. 50 0
      fs-user-app/src/main/java/com/fs/app/controller/DiagnosisController.java
  35. 47 0
      fs-user-app/src/main/java/com/fs/app/controller/InquiryPatientInfoController.java

+ 1 - 0
fs-admin/src/main/java/com/fs/course/controller/qw/QwFsCourseWatchLogController.java

@@ -71,6 +71,7 @@ public class QwFsCourseWatchLogController extends BaseController
         if (param.getSTime()==null||param.getETime()==null){
         if (param.getSTime()==null||param.getETime()==null){
             return getDataTable(new ArrayList<>());
             return getDataTable(new ArrayList<>());
         }
         }
+        param.setSendType(2); //企微
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
         return getDataTable(list);
     }
     }

+ 24 - 1
fs-company/src/main/java/com/fs/company/controller/company/CompanyUserController.java

@@ -8,6 +8,7 @@ import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.core.redis.RedisCache;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.PatternUtils;
 import com.fs.common.utils.PatternUtils;
 import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.ServletUtils;
@@ -70,6 +71,8 @@ public class CompanyUserController extends BaseController
     private ICompanyUserDelayTimeService companyUserDelayTimeService;
     private ICompanyUserDelayTimeService companyUserDelayTimeService;
     @Autowired
     @Autowired
     private ISysConfigService configService;
     private ISysConfigService configService;
+    @Autowired
+    private RedisCache redisCache;
     /**
     /**
      * 获取用户列表
      * 获取用户列表
      */
      */
@@ -259,9 +262,29 @@ public class CompanyUserController extends BaseController
         if (!PatternUtils.checkPassword(user.getPassword())) {
         if (!PatternUtils.checkPassword(user.getPassword())) {
             return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
             return AjaxResult.error("密码格式不正确,需包含字母、数字和特殊字符,长度为 8-20 位");
         }
         }
-        return toAjax(companyUserService.resetUserPwdByUserId(user.getUserId(), SecurityUtils.encryptPassword(user.getPassword())));
+
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+
+        String newPassword = SecurityUtils.encryptPassword(user.getPassword());
+        int i = companyUserService.resetUserPwdByUserId(user.getUserId(), newPassword);
+
+        if (i > 0) {
+            // 更新缓存用户密码
+            loginUser.getUser().setPassword(SecurityUtils.encryptPassword(newPassword));
+            tokenService.setLoginUser(loginUser);
+            cleanFirstLogin(loginUser);
+        }
+
+        return toAjax(i);
     }
     }
 
 
+    /**
+     * 去除首次登录的标志
+     * @param loginUser
+     */
+    private void cleanFirstLogin(LoginUser loginUser) {
+        redisCache.deleteObject("newCompanyUser:" + loginUser.getUser().getCompanyId() + ":" + loginUser.getUser().getUserName());
+    }
     /**
     /**
      * 状态修改
      * 状态修改
      */
      */

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java

@@ -126,6 +126,7 @@ public class FsCourseWatchLogController extends BaseController
         if (param.getSTime()==null||param.getETime()==null){
         if (param.getSTime()==null||param.getETime()==null){
             return getDataTable(new ArrayList<>());
             return getDataTable(new ArrayList<>());
         }
         }
+        param.setSendType(1); //个微
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
         return getDataTable(list);
     }
     }

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/course/qw/FsQwCourseWatchLogController.java

@@ -77,6 +77,7 @@ public class FsQwCourseWatchLogController extends BaseController
         if (param.getSTime()==null||param.getETime()==null){
         if (param.getSTime()==null||param.getETime()==null){
             return getDataTable(new ArrayList<>());
             return getDataTable(new ArrayList<>());
         }
         }
+        param.setSendType(2);
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
         return getDataTable(list);
         return getDataTable(list);
     }
     }

+ 8 - 3
fs-doctor-app/src/main/java/com/fs/app/controller/DiagnosisController.java

@@ -1,15 +1,14 @@
 package com.fs.app.controller;
 package com.fs.app.controller;
 
 
 import com.fs.common.core.domain.R;
 import com.fs.common.core.domain.R;
+import com.fs.his.param.FsDiagnosisFillDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.service.IFsFirstDiagnosisService;
 import com.fs.his.service.IFsFirstDiagnosisService;
 import com.fs.his.vo.FsDiagnosisListDVO;
 import com.fs.his.vo.FsDiagnosisListDVO;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 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;
+import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -28,4 +27,10 @@ public class DiagnosisController extends AppBaseController{
         PageInfo<FsDiagnosisListDVO> pageInfo = new PageInfo<>(diagnosisList);
         PageInfo<FsDiagnosisListDVO> pageInfo = new PageInfo<>(diagnosisList);
         return R.ok().put("data", pageInfo);
         return R.ok().put("data", pageInfo);
     }
     }
+
+    @PutMapping("/fill")
+    public R fill(@RequestBody FsDiagnosisFillDParam param){
+        param.setDoctorId(Long.parseLong(getDoctorId()));
+        return diagnosisService.fill(param);
+    }
 }
 }

+ 1 - 0
fs-ipad-task/src/main/java/com/fs/app/service/IpadSendServer.java

@@ -336,6 +336,7 @@ public class IpadSendServer {
                     sendLink(vo, content);
                     sendLink(vo, content);
                     break;
                     break;
                 case "4":
                 case "4":
+                case "10":
                     sendMiniProgram(vo, content, miniMap);
                     sendMiniProgram(vo, content, miniMap);
                     break;
                     break;
                 case "5":
                 case "5":

+ 1 - 1
fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

@@ -90,7 +90,7 @@ public class SendMsg {
     }
     }
 
 
     private Map<String, FsCoursePlaySourceConfig> getMiniMap() {
     private Map<String, FsCoursePlaySourceConfig> getMiniMap() {
-        List<FsCoursePlaySourceConfig> list = fsCoursePlaySourceConfigService.list(new QueryWrapper<FsCoursePlaySourceConfig>().eq("type", 1).eq("is_del", 0));
+        List<FsCoursePlaySourceConfig> list = fsCoursePlaySourceConfigService.list(new QueryWrapper<FsCoursePlaySourceConfig>().ne("type", 2).eq("is_del", 0));
 //        SysConfig maConfig = sysConfigMapper.selectConfigByConfigKey("courseMa.config");
 //        SysConfig maConfig = sysConfigMapper.selectConfigByConfigKey("courseMa.config");
 //        List<CourseMaConfig> courseMaConfigs = JSON.parseArray(maConfig.getConfigValue(), CourseMaConfig.class);
 //        List<CourseMaConfig> courseMaConfigs = JSON.parseArray(maConfig.getConfigValue(), CourseMaConfig.class);
         return PubFun.listToMapByGroupObject(list, FsCoursePlaySourceConfig::getAppid);
         return PubFun.listToMapByGroupObject(list, FsCoursePlaySourceConfig::getAppid);

+ 52 - 16
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -8,8 +8,10 @@ import com.fs.common.core.domain.R;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.StringUtils;
+import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyMiniapp;
 import com.fs.company.domain.CompanyMiniapp;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.config.cloud.CloudHostProper;
 import com.fs.config.cloud.CloudHostProper;
@@ -168,6 +170,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
     @Autowired
     @Autowired
     private IQwCompanyService iQwCompanyService;
     private IQwCompanyService iQwCompanyService;
 
 
+    @Autowired
+    private CompanyMapper companyMapper;
 
 
     @PostConstruct
     @PostConstruct
     public void init() {
     public void init() {
@@ -315,6 +319,9 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
 
         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap = miniList.stream().collect(Collectors.groupingBy(CompanyMiniapp::getCompanyId, Collectors.groupingBy(CompanyMiniapp::getType)));
         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap = miniList.stream().collect(Collectors.groupingBy(CompanyMiniapp::getCompanyId, Collectors.groupingBy(CompanyMiniapp::getType)));
 
 
+
+        List<Company> companies = companyMapper.selectCompanyAllList();
+
         log.info("共分组 {} 个 SOP ID 进行处理。", sopLogsGroupedById.size());
         log.info("共分组 {} 个 SOP ID 进行处理。", sopLogsGroupedById.size());
 
 
         CountDownLatch sopGroupLatch = new CountDownLatch(sopLogsGroupedById.size());
         CountDownLatch sopGroupLatch = new CountDownLatch(sopLogsGroupedById.size());
@@ -322,7 +329,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         for (Map.Entry<String, List<SopUserLogsVo>> entry : sopLogsGroupedById.entrySet()) {
         for (Map.Entry<String, List<SopUserLogsVo>> entry : sopLogsGroupedById.entrySet()) {
             String sopId = entry.getKey();
             String sopId = entry.getKey();
             List<SopUserLogsVo> userLogsVos = entry.getValue();
             List<SopUserLogsVo> userLogsVos = entry.getValue();
-            processSopGroupAsync(sopId, userLogsVos, sopGroupLatch,currentTime, groupChatMap,config,miniMap);
+            processSopGroupAsync(sopId, userLogsVos, sopGroupLatch,currentTime, groupChatMap,config,miniMap,companies);
         }
         }
 
 
         // 等待所有 SOP 分组处理完成
         // 等待所有 SOP 分组处理完成
@@ -343,9 +350,10 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             backoff = @Backoff(delay = 2000)
             backoff = @Backoff(delay = 2000)
     )
     )
     public void processSopGroupAsync(String sopId, List<SopUserLogsVo> userLogsVos, CountDownLatch latch ,LocalDateTime currentTime,
     public void processSopGroupAsync(String sopId, List<SopUserLogsVo> userLogsVos, CountDownLatch latch ,LocalDateTime currentTime,
-                                     Map<String, QwGroupChat> groupChatMap,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap) {
+                                     Map<String, QwGroupChat> groupChatMap,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                     List<Company> companies) {
         try {
         try {
-            processSopGroup(sopId, userLogsVos,currentTime, groupChatMap, config,miniMap);
+            processSopGroup(sopId, userLogsVos,currentTime, groupChatMap, config,miniMap,companies);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error("处理 SOP ID {} 时发生异常: {}", sopId, e.getMessage(), e);
             log.error("处理 SOP ID {} 时发生异常: {}", sopId, e.getMessage(), e);
         } finally {
         } finally {
@@ -355,7 +363,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
 
 
 
     private void processSopGroup(String sopId, List<SopUserLogsVo> userLogsVos,LocalDateTime currentTime, Map<String,
     private void processSopGroup(String sopId, List<SopUserLogsVo> userLogsVos,LocalDateTime currentTime, Map<String,
-            QwGroupChat> groupChatMap,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap) throws Exception {
+            QwGroupChat> groupChatMap,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                 List<Company> companies) throws Exception {
         QwSopRuleTimeVO ruleTimeVO = sopMapper.selectQwSopByClickHouseId(sopId);
         QwSopRuleTimeVO ruleTimeVO = sopMapper.selectQwSopByClickHouseId(sopId);
 
 
         if (ruleTimeVO == null) {
         if (ruleTimeVO == null) {
@@ -397,7 +406,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
 
         CountDownLatch userLogsLatch = new CountDownLatch(userLogsVos.size());
         CountDownLatch userLogsLatch = new CountDownLatch(userLogsVos.size());
         for (SopUserLogsVo logVo : userLogsVos) {
         for (SopUserLogsVo logVo : userLogsVos) {
-            processUserLogAsync(logVo, ruleTimeVO, rulesList, userLogsLatch, currentTime, groupChatMap,qwCompany.getMiniAppId(), config,miniMap);
+            processUserLogAsync(logVo, ruleTimeVO, rulesList, userLogsLatch, currentTime, groupChatMap,qwCompany.getMiniAppId(),
+                    config,miniMap,companies);
         }
         }
 
 
         // 等待所有用户日志处理完成
         // 等待所有用户日志处理完成
@@ -418,9 +428,10 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
     )
     )
     public void processUserLogAsync(SopUserLogsVo logVo, QwSopRuleTimeVO ruleTimeVO, List<QwSopTempRules> tempSettings,
     public void processUserLogAsync(SopUserLogsVo logVo, QwSopRuleTimeVO ruleTimeVO, List<QwSopTempRules> tempSettings,
                                     CountDownLatch latch, LocalDateTime currentTime, Map<String, QwGroupChat> groupChatMap,
                                     CountDownLatch latch, LocalDateTime currentTime, Map<String, QwGroupChat> groupChatMap,
-                                    String miniAppId,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap) {
+                                    String miniAppId,CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                    List<Company> companies) {
         try {
         try {
-            processUserLog(logVo, ruleTimeVO, tempSettings,currentTime, groupChatMap, miniAppId, config,miniMap);
+            processUserLog(logVo, ruleTimeVO, tempSettings,currentTime, groupChatMap, miniAppId, config,miniMap,companies);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error("处理用户日志 {} 时发生异常: {}", logVo.getId(), e.getMessage(), e);
             log.error("处理用户日志 {} 时发生异常: {}", logVo.getId(), e.getMessage(), e);
         } finally {
         } finally {
@@ -431,7 +442,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
 
     private void processUserLog(SopUserLogsVo logVo, QwSopRuleTimeVO ruleTimeVO, List<QwSopTempRules> tempSettings,
     private void processUserLog(SopUserLogsVo logVo, QwSopRuleTimeVO ruleTimeVO, List<QwSopTempRules> tempSettings,
                                 LocalDateTime currentTime, Map<String, QwGroupChat> groupChatMap,String miniAppId,
                                 LocalDateTime currentTime, Map<String, QwGroupChat> groupChatMap,String miniAppId,
-                                CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap) {
+                                CourseConfig config,Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                List<Company> companies) {
         try {
         try {
 
 
             LocalDate startDate = LocalDate.parse(logVo.getStartTime(), DATE_FORMATTER);
             LocalDate startDate = LocalDate.parse(logVo.getStartTime(), DATE_FORMATTER);
@@ -599,7 +611,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
 
 
                         insertSopUserLogs(sopUserLogsInfos, logVo, sendTime, ruleTimeVO, content, qwUserId,
                         insertSopUserLogs(sopUserLogsInfos, logVo, sendTime, ruleTimeVO, content, qwUserId,
                                 companyUserId, companyId, qwUserByRedis.getWelcomeText(),qwUserByRedis.getQwUserName(),
                                 companyUserId, companyId, qwUserByRedis.getWelcomeText(),qwUserByRedis.getQwUserName(),
-                                groupChatMap, miniAppId,config,miniMap, sendMsgType);
+                                groupChatMap, miniAppId,config,miniMap, sendMsgType,companies);
 
 
                     }
                     }
                 } catch (Exception e) {
                 } catch (Exception e) {
@@ -643,7 +655,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                                    QwSopRuleTimeVO ruleTimeVO, QwSopTempSetting.Content content,
                                    QwSopRuleTimeVO ruleTimeVO, QwSopTempSetting.Content content,
                                    String qwUserId,String companyUserId,String companyId,String welcomeText,String qwUserName,
                                    String qwUserId,String companyUserId,String companyId,String welcomeText,String qwUserName,
                                    Map<String, QwGroupChat> groupChatMap,String miniAppId,CourseConfig config,
                                    Map<String, QwGroupChat> groupChatMap,String miniAppId,CourseConfig config,
-                                   Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap, Integer sendMsgType) {
+                                   Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap, Integer sendMsgType,
+                                   List<Company> companies) {
         String formattedSendTime = sendTime.toInstant()
         String formattedSendTime = sendTime.toInstant()
                 .atZone(ZoneId.systemDefault())
                 .atZone(ZoneId.systemDefault())
                 .format(DATE_TIME_FORMATTER);
                 .format(DATE_TIME_FORMATTER);
@@ -670,7 +683,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                 QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null);
                 QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, groupChat.getChatId(), groupChat.getName(), null, isOfficial, null);
                 handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                 handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                         type, qwUserId, companyUserId, companyId, groupChat.getChatId(), welcomeText, qwUserName,
                         type, qwUserId, companyUserId, companyId, groupChat.getChatId(), welcomeText, qwUserName,
-                        null, true, miniAppId, groupChat,config, miniMap, null, sendMsgType);
+                        null, true, miniAppId, groupChat,config, miniMap, null, sendMsgType,companies);
             } else {
             } else {
                 if(groupChat.getChatUserList() != null && !groupChat.getChatUserList().isEmpty()){
                 if(groupChat.getChatUserList() != null && !groupChat.getChatUserList().isEmpty()){
                     groupChat.getChatUserList().forEach(user -> {
                     groupChat.getChatUserList().forEach(user -> {
@@ -679,7 +692,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                         QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, user.getUserId(), user.getName(), null, isOfficial, null);
                         QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, user.getUserId(), user.getName(), null, isOfficial, null);
                         handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                         handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                                 type, qwUserId, companyUserId, companyId, user.getId().toString(), welcomeText, qwUserName,
                                 type, qwUserId, companyUserId, companyId, user.getId().toString(), welcomeText, qwUserName,
-                                null, false, miniAppId, groupChat,config, miniMap, null, sendMsgType);
+                                null, false, miniAppId, groupChat,config, miniMap, null, sendMsgType,companies);
                     });
                     });
                 }
                 }
             }
             }
@@ -694,7 +707,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, contactId.getExternalContactId(), externalUserName, fsUserId, isOfficial, contactId.getExternalId());
                     QwSopLogs sopLogs = createBaseLog(formattedSendTime, logVo, ruleTimeVO, contactId.getExternalContactId(), externalUserName, fsUserId, isOfficial, contactId.getExternalId());
                     handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                     handleLogBasedOnType(sopLogs, content, logVo, sendTime, courseId, videoId,
                             type, qwUserId, companyUserId, companyId, externalId, welcomeText, qwUserName, fsUserId, false, miniAppId,
                             type, qwUserId, companyUserId, companyId, externalId, welcomeText, qwUserName, fsUserId, false, miniAppId,
-                            null,config, miniMap, grade, sendMsgType);
+                            null,config, miniMap, grade, sendMsgType,companies);
                 } catch (Exception e) {
                 } catch (Exception e) {
                     log.error("处理 externalContactId {} 时发生异常: {}", contactId, e.getMessage(), e);
                     log.error("处理 externalContactId {} 时发生异常: {}", contactId, e.getMessage(), e);
                 }
                 }
@@ -803,7 +816,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                                       String qwUserName, Long fsUserId, boolean isGroupChat, String miniAppId,
                                       String qwUserName, Long fsUserId, boolean isGroupChat, String miniAppId,
                                       QwGroupChat groupChat,CourseConfig config,
                                       QwGroupChat groupChat,CourseConfig config,
                                       Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
                                       Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
-                                      Integer grade, Integer sendMsgType  ) {
+                                      Integer grade, Integer sendMsgType ,List<Company> companies ) {
         switch (type) {
         switch (type) {
             case 1:
             case 1:
                 handleNormalMessage(sopLogs, content,companyUserId);
                 handleNormalMessage(sopLogs, content,companyUserId);
@@ -811,7 +824,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             case 2:
             case 2:
                 handleCourseMessage(sopLogs, content, logVo, sendTime, courseId, videoId,
                 handleCourseMessage(sopLogs, content, logVo, sendTime, courseId, videoId,
                         qwUserId, companyUserId, companyId, externalId, welcomeText,qwUserName, fsUserId,
                         qwUserId, companyUserId, companyId, externalId, welcomeText,qwUserName, fsUserId,
-                        isGroupChat, miniAppId, groupChat,config,miniMap, grade, sendMsgType);
+                        isGroupChat, miniAppId, groupChat,config,miniMap, grade, sendMsgType,companies);
                 break;
                 break;
             case 3:
             case 3:
                 handleOrderMessage(sopLogs, content);
                 handleOrderMessage(sopLogs, content);
@@ -844,7 +857,8 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                                      SopUserLogsVo logVo, Date sendTime, Long courseId, Long videoId, String qwUserId, String companyUserId,
                                      SopUserLogsVo logVo, Date sendTime, Long courseId, Long videoId, String qwUserId, String companyUserId,
                                      String companyId, String externalId, String welcomeText, String qwUserName,
                                      String companyId, String externalId, String welcomeText, String qwUserName,
                                      Long fsUserId, boolean isGroupChat, String miniAppId, QwGroupChat groupChat,CourseConfig config,Map<Long,
                                      Long fsUserId, boolean isGroupChat, String miniAppId, QwGroupChat groupChat,CourseConfig config,Map<Long,
-                                     Map<Integer, List<CompanyMiniapp>>> miniMap,Integer grade, Integer sendMsgType) {
+                                     Map<Integer, List<CompanyMiniapp>>> miniMap,Integer grade, Integer sendMsgType,
+                                     List<Company> companies) {
         // 深拷贝 Content 对象,避免使用 JSON
         // 深拷贝 Content 对象,避免使用 JSON
         QwSopTempSetting.Content clonedContent = deepCopyContent(content);
         QwSopTempSetting.Content clonedContent = deepCopyContent(content);
         if (clonedContent == null) {
         if (clonedContent == null) {
@@ -970,6 +984,28 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     setting.setLinkUrl(linkByApp.getSortLink().replaceAll("^[\\s\\u2005]+", ""));
                     setting.setLinkUrl(linkByApp.getSortLink().replaceAll("^[\\s\\u2005]+", ""));
                     setting.setAppLinkUrl(linkByApp.getAppMsgLink().replaceAll("^[\\s\\u2005]+", ""));
                     setting.setAppLinkUrl(linkByApp.getAppMsgLink().replaceAll("^[\\s\\u2005]+", ""));
 
 
+                    break;
+                //自定义小程序
+                case "10":
+                    addWatchLogIfNeeded(sopLogs, videoId, courseId, sendTime, qwUserId, companyUserId, companyId, externalId,logVo);
+
+                    Optional<Company> matchedCompany = companies.stream()
+                            .filter(company -> String.valueOf(company.getCompanyId()).equals(companyId))
+                            .findFirst();
+                    if (matchedCompany.isPresent()) {
+                        Company company = matchedCompany.get();
+
+                        String customMiniAppId = company.getCustomMiniAppId();
+
+                        if (customMiniAppId != null && !customMiniAppId.trim().isEmpty()) {
+                            setting.setMiniprogramAppid(customMiniAppId);
+                        } else {
+                            setting.setMiniprogramAppid("该公司未配置自定义小程序:"+companyId);
+                        }
+                    } else {
+                        setting.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
+                    }
+
                     break;
                     break;
                 default:
                 default:
                     break;
                     break;

+ 5 - 0
fs-service/src/main/java/com/fs/company/domain/Company.java

@@ -110,6 +110,11 @@ public class Company extends BaseEntity
      * 点播配置-小程序appId
      * 点播配置-小程序appId
      */
      */
     private String courseMiniAppId;
     private String courseMiniAppId;
+    /**
+    * 自定义小程序
+    */
+    private String customMiniAppId;
+
     /** 会员是否默认黑名单,1-是;0-否(用于销售分享成为会员的操作) */
     /** 会员是否默认黑名单,1-是;0-否(用于销售分享成为会员的操作) */
     private Integer fsUserIsDefaultBlack;
     private Integer fsUserIsDefaultBlack;
     private Integer repeat;
     private Integer repeat;

+ 1 - 0
fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java

@@ -189,4 +189,5 @@ public interface CompanyMapper
 
 
     List<Company> selectCompanyByIds2(@Param("companyIds") Set<Long> companyIds);
     List<Company> selectCompanyByIds2(@Param("companyIds") Set<Long> companyIds);
 
 
+
 }
 }

+ 30 - 5
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -219,32 +219,57 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
 
 
     @Select({"<script> " +
     @Select({"<script> " +
             "SELECT \n" +
             "SELECT \n" +
-            "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time,qu.qw_user_name,v.title videoName,uc.course_name,\n" +
+            "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
+            "<if test= 'sendType != 1 '> " +
+            " qu.qw_user_name qw_user_name," +
+            "</if>\n" +
+            "<if test= 'sendType == 1 '> " +
+            " cu.nick_name qw_user_name," +
+            "</if>\n" +
+            "v.title videoName,uc.course_name,\n" +
             "SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) AS type1,\n" +
             "SUM(CASE WHEN o.log_type = '1' THEN 1 ELSE 0 END) AS type1,\n" +
             "SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) AS type2,\n" +
             "SUM(CASE WHEN o.log_type = '2' THEN 1 ELSE 0 END) AS type2,\n" +
             "SUM(CASE WHEN o.log_type = '3' THEN 1 ELSE 0 END) AS type3,\n" +
             "SUM(CASE WHEN o.log_type = '3' THEN 1 ELSE 0 END) AS type3,\n" +
             "SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END) AS type4\n" +
             "SUM(CASE WHEN o.log_type = '4' THEN 1 ELSE 0 END) AS type4\n" +
             "FROM fs_course_watch_log o\n" +
             "FROM fs_course_watch_log o\n" +
-            "LEFT JOIN qw_user qu on qu.id=o.qw_user_id\n" +
+            "<if test= 'sendType != 1 '> " +
+            " LEFT JOIN qw_user qu on qu.id=o.qw_user_id\n" +
+            "</if>\n" +
             "LEFT JOIN fs_user_course_video v on v.video_id=o.video_id \n" +
             "LEFT JOIN fs_user_course_video v on v.video_id=o.video_id \n" +
             "LEFT JOIN fs_user_course uc on uc.course_id=v.course_id\n" +
             "LEFT JOIN fs_user_course uc on uc.course_id=v.course_id\n" +
-            "where o.company_id=#{companyId} AND send_type=2 " +
+            "<if test= 'sendType == 1 '> " +
+            " LEFT JOIN company_user cu on cu.user_id=o.company_user_id\n" +
+            "</if>\n" +
+            "where o.company_id=#{companyId} " +
+            "<if test= 'sendType != null '> " +
+            "       and  send_type= #{sendType} " +
+            "</if>\n" +
             "<if test= 'sTime != null '> " +
             "<if test= 'sTime != null '> " +
             "       and DATE(o.create_time) &gt;= DATE(#{sTime})\n" +
             "       and DATE(o.create_time) &gt;= DATE(#{sTime})\n" +
             "</if>\n" +
             "</if>\n" +
             "<if test='eTime != null '> " +
             "<if test='eTime != null '> " +
             "      and DATE(o.create_time) &lt;= DATE(#{eTime})\n" +
             "      and DATE(o.create_time) &lt;= DATE(#{eTime})\n" +
             "</if>" +
             "</if>" +
-            "<if test ='nickName !=null and nickName!=\"\"'>\n" +
+            "<if test ='sendType != 1 and nickName !=null and nickName!=\"\"'>\n" +
             "   and qu.qw_user_name like concat( #{nickName}, '%')\n" +
             "   and qu.qw_user_name like concat( #{nickName}, '%')\n" +
             "</if>" +
             "</if>" +
+            "<if test ='sendType == 1 and nickName !=null and nickName!=\"\"'>\n" +
+            "   and cu.nick_name like concat( #{nickName}, '%')\n" +
+            "</if>" +
             "<if test ='courseId !=null'> " +
             "<if test ='courseId !=null'> " +
             "     and o.course_id = #{courseId} " +
             "     and o.course_id = #{courseId} " +
             "</if>" +
             "</if>" +
             "<if test ='videoId !=null'> " +
             "<if test ='videoId !=null'> " +
             "     and o.video_id = #{videoId} " +
             "     and o.video_id = #{videoId} " +
             "</if>" +
             "</if>" +
-            "GROUP BY o.video_id,o.qw_user_id,DATE(o.create_time)\n" +
+            "GROUP BY o.video_id," +
+            "<if test= 'sendType != 1 '> " +
+            " o.qw_user_id," +
+            "</if>\n" +
+            "<if test= 'sendType == 1 '> " +
+            " o.company_user_id," +
+            "</if>\n" +
+            "DATE(o.create_time)\n" +
             "ORDER BY o.video_id ,DATE(o.create_time) \n"+
             "ORDER BY o.video_id ,DATE(o.create_time) \n"+
             "</script>"})
             "</script>"})
     List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param);
     List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param);

+ 2 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseWatchLogStatisticsListParam.java

@@ -40,4 +40,6 @@ public class FsCourseWatchLogStatisticsListParam {
 
 
     private Long pageNum;
     private Long pageNum;
     private Long pageSize;
     private Long pageSize;
+
+    private Integer sendType; //归属发送方式:1 个微  2 企微
 }
 }

+ 13 - 0
fs-service/src/main/java/com/fs/course/param/FsFirstDiagnosisListUParam.java

@@ -0,0 +1,13 @@
+package com.fs.course.param;
+
+import com.fs.his.param.BaseParam;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class FsFirstDiagnosisListUParam extends BaseParam {
+    private Long userId;
+
+    private Integer doctorStatus;
+}

+ 11 - 0
fs-service/src/main/java/com/fs/course/param/FsInquiryPatientInfoUParam.java

@@ -0,0 +1,11 @@
+package com.fs.course.param;
+
+import com.fs.his.param.BaseParam;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class FsInquiryPatientInfoUParam extends BaseParam {
+    private Long userId;
+}

+ 11 - 2
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -414,7 +414,7 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
             log.error("key中id为S:{}", videoDuration);
             log.error("key中id为S:{}", videoDuration);
         }
         }
 
 
-        
+
         if (videoDuration==null){
         if (videoDuration==null){
             FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
             FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
             videoDuration=video.getDuration();
             videoDuration=video.getDuration();
@@ -957,7 +957,16 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
     public Long getVideoDuration(Long videoId){
     public Long getVideoDuration(Long videoId){
         //将视频时长也存到redis
         //将视频时长也存到redis
         String videoRedisKey = "h5user:video:duration:" + videoId;
         String videoRedisKey = "h5user:video:duration:" + videoId;
-        Long videoDuration = redisCache.getCacheObject(videoRedisKey);
+        Long videoDuration=0L;
+        try {
+            videoDuration = redisCache.getCacheObject(videoRedisKey);
+        }catch (Exception e){
+            String string = redisCache.getCacheObject(videoRedisKey);
+            videoDuration=Long.parseLong(string);
+            log.error("key中id为S:{}", videoDuration);
+        }
+
+
         if (videoDuration==null){
         if (videoDuration==null){
             FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
             FsUserCourseVideo video = courseVideoMapper.selectFsUserCourseVideoByVideoId(videoId);
             videoDuration=video.getDuration();
             videoDuration=video.getDuration();

+ 77 - 0
fs-service/src/main/java/com/fs/course/vo/FsFirstDiagnosisListUVO.java

@@ -0,0 +1,77 @@
+package com.fs.course.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsFirstDiagnosisListUVO {
+    /** 主键 */
+    private Long id;
+    /** 患者姓名 */
+    @Excel(name = "患者姓名")
+    private String patientName;
+
+    /** 年龄 */
+    @Excel(name = "年龄")
+    private String age;
+
+    /** 0-未知 1-男性 2-女性 */
+    @Excel(name = "0-未知 1-男性 2-女性")
+    private Long gender;
+
+    /** 电话 */
+    @Excel(name = "电话")
+    private String phone;
+
+    /** 身体状况 */
+    @Excel(name = "身体状况")
+    private String physicalCondition;
+
+    /** 日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date dateTime;
+
+    /** 出版诊断 */
+    @Excel(name = "出版诊断")
+    private String firstDiagnosis;
+
+    /** 医生id */
+    @Excel(name = "医生id")
+    private Long doctorId;
+
+    /** 医生名称 */
+    @Excel(name = "医生名称")
+    private String doctorName;
+
+    /** 职称 */
+    @Excel(name = "职称")
+    private String doctorDep;
+
+    /** 用户id */
+    @Excel(name = "用户id")
+    private Long userId;
+
+    /** 医生证号 */
+    @Excel(name = "医生证号")
+    private String doctorCertificate;
+
+    /** 医生是否填写:0-未填写 1-已填写 */
+    private Integer doctorStatus;
+
+    /** 用户是否答复:0-未答复 1-已答复 */
+    private Integer userStatus;
+
+    private Long qwUserId;
+
+    /**
+     * 销售名称
+     */
+    private String qwUserName;
+
+    //医生签名
+    private String signUrl;
+}

+ 113 - 0
fs-service/src/main/java/com/fs/course/vo/FsInquiryPatientInfoListUVO.java

@@ -0,0 +1,113 @@
+package com.fs.course.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsInquiryPatientInfoListUVO {
+
+    private Long id;
+
+    private String patientName;
+
+    /** 出生年月 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date birthday;
+
+    /** 性别 */
+    @Excel(name = "性别")
+    private Integer sex;
+
+
+
+    /** 手机号 */
+    @Excel(name = "手机号")
+    private String mobile;
+
+    private String companyUserName;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 销售id
+     */
+    private Long companyUserId;
+    /**
+     * 患者会员id
+     */
+    private Long userId;
+    /**
+     * 问诊订单id
+     */
+    private Long inquiryOrderId;
+    /**
+     * 课程id
+     */
+    private Long courseId;
+
+    /**
+     * 就诊状态 1-初诊 2-复诊
+     */
+    private Integer diagnosisStatus;
+
+    /**
+     * 客户标签
+     */
+    private String tag;
+
+    /**
+     * 课程/档期
+     */
+    private String courseName;
+
+    /**
+     * 患者病情主诉
+     */
+    private String patientCondition;
+
+    /**
+     * 部门负责人
+     */
+    private String deptManager;
+
+    /**
+     * 医生建议及处置
+     */
+    private String doctorAdviceJson;
+
+    /**
+     * 禁忌
+     */
+    private String taboo;
+    /**
+     * 客户需求
+     */
+    private String customerRequire;
+
+    /**
+     * 职业医生
+     */
+    private String professionalDoctor;
+
+    /**
+     * 助理医生
+     */
+    private String assistantDoctor;
+
+    /**
+     * 预约时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date subTime;
+
+    private Long subDoctorId;
+
+    private String subDoctorName;
+}

+ 22 - 1
fs-service/src/main/java/com/fs/his/mapper/FsFirstDiagnosisMapper.java

@@ -2,6 +2,8 @@ package com.fs.his.mapper;
 
 
 import java.util.List;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.course.param.FsFirstDiagnosisListUParam;
+import com.fs.course.vo.FsFirstDiagnosisListUVO;
 import com.fs.his.domain.FsFirstDiagnosis;
 import com.fs.his.domain.FsFirstDiagnosis;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.vo.FsDiagnosisListDVO;
 import com.fs.his.vo.FsDiagnosisListDVO;
@@ -71,11 +73,30 @@ public interface FsFirstDiagnosisMapper extends BaseMapper<FsFirstDiagnosis>{
     FsFirstDiagnosis getByUserId(Long userId);
     FsFirstDiagnosis getByUserId(Long userId);
 
 
     @Select({"<script> " +
     @Select({"<script> " +
-            "SELECT id,doctor_id,patient_name,gender,age,phone,date_time FROM fs_first_diagnosis " +
+            "SELECT id,doctor_id,patient_name,gender,age,phone,date_time,physical_condition,doctor_status,user_status FROM fs_first_diagnosis " +
             "WHERE 1 = 1" +
             "WHERE 1 = 1" +
             "<if test='maps.type == 0' > and  doctor_status = 0 and doctor_id is null</if>" +
             "<if test='maps.type == 0' > and  doctor_status = 0 and doctor_id is null</if>" +
             "<if test='maps.type == 1' > and  doctor_id = #{maps.doctorId}</if>" +
             "<if test='maps.type == 1' > and  doctor_id = #{maps.doctorId}</if>" +
             "ORDER BY create_time desc" +
             "ORDER BY create_time desc" +
             "</script>"})
             "</script>"})
     List<FsDiagnosisListDVO> selectFsDiagnosisListDVO(@Param("maps") FsDiagnosisListDParam param);
     List<FsDiagnosisListDVO> selectFsDiagnosisListDVO(@Param("maps") FsDiagnosisListDParam param);
+
+    @Select({"<script>" +
+            "SELECT fd.*,u.qw_user_name,d.sign_url FROM fs_first_diagnosis fd " +
+            " LEFT JOIN qw_user u ON u.id = fd.qw_user_id " +
+            " LEFT JOIN fs_doctor d ON d.doctor_id = fd.doctor_id " +
+            " WHERE fd.doctor_status = 1 " +
+            "<if test='param.doctorStatus != null'> AND fd.doctor_status = #{param.doctorStatus} </if>" +
+            "<if test='param.userId != null'> AND fd.user_id = #{param.userId} </if>" +
+            " ORDER BY fd.create_time desc " +
+            "</script>"})
+    List<FsFirstDiagnosisListUVO> selectFsFirstDiagnosisListUVO(@Param("param") FsFirstDiagnosisListUParam param);
+
+    @Select({"<script>" +
+            "SELECT fd.*,u.qw_user_name,d.sign_url FROM fs_first_diagnosis fd " +
+            "LEFT JOIN qw_user u ON u.id = fd.qw_user_id " +
+            " LEFT JOIN fs_doctor d ON d.doctor_id = fd.doctor_id " +
+            "WHERE fd.id = #{id}" +
+            "</script>"})
+    FsFirstDiagnosisListUVO getInfo(Long id);
 }
 }

+ 25 - 0
fs-service/src/main/java/com/fs/his/mapper/FsInquiryPatientInfoMapper.java

@@ -1,9 +1,14 @@
 package com.fs.his.mapper;
 package com.fs.his.mapper;
 
 
+import com.fs.course.param.FsInquiryPatientInfoUParam;
+import com.fs.course.vo.FsInquiryPatientInfoListUVO;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.vo.FsInquiryPatientVO;
 import com.fs.his.vo.FsInquiryPatientVO;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Select;
 
 
+import java.util.List;
+
 public interface FsInquiryPatientInfoMapper {
 public interface FsInquiryPatientInfoMapper {
 
 
     int insertFsInquiryPatientInfo(FsInquiryPatientInfo fsInquiryPatientInfo);
     int insertFsInquiryPatientInfo(FsInquiryPatientInfo fsInquiryPatientInfo);
@@ -13,4 +18,24 @@ public interface FsInquiryPatientInfoMapper {
     FsInquiryPatientInfo selectFsInquiryPatientInfoInquiryOrderId(Long inquiryOrderId);
     FsInquiryPatientInfo selectFsInquiryPatientInfoInquiryOrderId(Long inquiryOrderId);
 
 
     FsInquiryPatientVO selectUserAndCompanyUserByInquiryOrderId(Long inquiryOrderId);
     FsInquiryPatientVO selectUserAndCompanyUserByInquiryOrderId(Long inquiryOrderId);
+
+    @Select({"<script>" +
+            "SELECT pi.*,p.patient_name,p.birthday,p.sex, u.nick_name companyUserName,d.doctor_name FROM fs_inquiry_patient_info pi " +
+            "LEFT JOIN fs_patient p ON p.patient_id  = pi.patient_id " +
+            "LEFT JOIN company_user u ON u.user_id = pi.company_user_id " +
+            " left join fs_doctor d on d.doctor_id = pi.sub_doctor_id  " +
+            " 1=1 " +
+            "<if test='param.userId != null'> AND pi.user_id = #{param.userId} </if> " +
+            "ORDER BY pi.create_time desc " +
+            "</script>"})
+    List<FsInquiryPatientInfoListUVO> selectFsInquiryPatientInfoListUVO(@Param("param") FsInquiryPatientInfoUParam param);
+
+    @Select({"<script>" +
+            "SELECT pi.*,p.patient_name,p.birthday,p.sex, u.nick_name companyUserName,d.doctor_name FROM fs_inquiry_patient_info pi " +
+            "LEFT JOIN fs_patient p ON p.patient_id  = pi.patient_id " +
+            "LEFT JOIN company_user u ON u.user_id = pi.company_user_id " +
+            " left join fs_doctor d on d.doctor_id = pi.sub_doctor_id  " +
+            "WHERE pi.id = #{id} " +
+            "</script>"})
+    FsInquiryPatientInfoListUVO getInfo(Long id);
 }
 }

+ 17 - 0
fs-service/src/main/java/com/fs/his/param/FsDiagnosisFillDParam.java

@@ -0,0 +1,17 @@
+package com.fs.his.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class FsDiagnosisFillDParam {
+    private Long id;
+    private String firstDiagnosis;
+    private String physicalCondition;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date dateTime;
+    private Long doctorId;
+
+}

+ 13 - 0
fs-service/src/main/java/com/fs/his/service/IFsFirstDiagnosisService.java

@@ -2,9 +2,14 @@ package com.fs.his.service;
 
 
 import java.util.List;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
+import com.fs.course.param.FsFirstDiagnosisListUParam;
+import com.fs.course.vo.FsFirstDiagnosisListUVO;
 import com.fs.his.domain.FsFirstDiagnosis;
 import com.fs.his.domain.FsFirstDiagnosis;
+import com.fs.his.param.FsDiagnosisFillDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.vo.FsDiagnosisListDVO;
 import com.fs.his.vo.FsDiagnosisListDVO;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 初诊单Service接口
  * 初诊单Service接口
@@ -70,4 +75,12 @@ public interface IFsFirstDiagnosisService extends IService<FsFirstDiagnosis>{
 
 
 
 
     List<FsDiagnosisListDVO> getDiagnosisList(FsDiagnosisListDParam param);
     List<FsDiagnosisListDVO> getDiagnosisList(FsDiagnosisListDParam param);
+
+    R fill(FsDiagnosisFillDParam param);
+
+    List<FsFirstDiagnosisListUVO> selectFsFirstDiagnosisListUVO(FsFirstDiagnosisListUParam param);
+
+    FsFirstDiagnosisListUVO getInfo(Long id);
+
+    R confirm(Long id);
 }
 }

+ 8 - 0
fs-service/src/main/java/com/fs/his/service/IFsInquiryPatientInfoService.java

@@ -1,8 +1,13 @@
 package com.fs.his.service;
 package com.fs.his.service;
 
 
+import com.fs.course.param.FsInquiryPatientInfoUParam;
+import com.fs.course.vo.FsInquiryPatientInfoListUVO;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.param.FsInquiryPatientParam;
 import com.fs.his.param.FsInquiryPatientParam;
 import com.fs.his.vo.FsInquiryPatientVO;
 import com.fs.his.vo.FsInquiryPatientVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
  * 问诊患者信息Service接口
  * 问诊患者信息Service接口
@@ -16,4 +21,7 @@ public interface IFsInquiryPatientInfoService {
 
 
     FsInquiryPatientVO selectFsInquiryPatientInfo(Long inquiryOrderId);
     FsInquiryPatientVO selectFsInquiryPatientInfo(Long inquiryOrderId);
 
 
+    List<FsInquiryPatientInfoListUVO> selectFsInquiryPatientInfoListUVO(FsInquiryPatientInfoUParam param);
+
+    FsInquiryPatientInfoListUVO getInfo(Long id);
 }
 }

+ 86 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsFirstDiagnosisServiceImpl.java

@@ -1,16 +1,25 @@
 package com.fs.his.service.impl;
 package com.fs.his.service.impl;
 
 
-import java.util.Collections;
 import java.util.List;
 import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.course.param.FsFirstDiagnosisListUParam;
+import com.fs.course.vo.FsFirstDiagnosisListUVO;
+import com.fs.his.domain.FsDoctor;
+import com.fs.his.param.FsDiagnosisFillDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
 import com.fs.his.param.FsDiagnosisListDParam;
+import com.fs.his.service.IFsDoctorService;
 import com.fs.his.vo.FsDiagnosisListDVO;
 import com.fs.his.vo.FsDiagnosisListDVO;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsFirstDiagnosisMapper;
 import com.fs.his.mapper.FsFirstDiagnosisMapper;
 import com.fs.his.domain.FsFirstDiagnosis;
 import com.fs.his.domain.FsFirstDiagnosis;
 import com.fs.his.service.IFsFirstDiagnosisService;
 import com.fs.his.service.IFsFirstDiagnosisService;
+import org.springframework.util.CollectionUtils;
 
 
 /**
 /**
  * 初诊单Service业务层处理
  * 初诊单Service业务层处理
@@ -25,6 +34,9 @@ public class FsFirstDiagnosisServiceImpl extends ServiceImpl<FsFirstDiagnosisMap
     @Autowired
     @Autowired
     private FsFirstDiagnosisMapper diagnosisMapper;
     private FsFirstDiagnosisMapper diagnosisMapper;
 
 
+    @Autowired
+    private IFsDoctorService doctorService;
+
     /**
     /**
      * 查询初诊单
      * 查询初诊单
      * 
      * 
@@ -112,4 +124,77 @@ public class FsFirstDiagnosisServiceImpl extends ServiceImpl<FsFirstDiagnosisMap
     public List<FsDiagnosisListDVO> getDiagnosisList(FsDiagnosisListDParam param) {
     public List<FsDiagnosisListDVO> getDiagnosisList(FsDiagnosisListDParam param) {
         return diagnosisMapper.selectFsDiagnosisListDVO(param);
         return diagnosisMapper.selectFsDiagnosisListDVO(param);
     }
     }
+
+    @Override
+    public List<FsFirstDiagnosisListUVO> selectFsFirstDiagnosisListUVO(FsFirstDiagnosisListUParam param) {
+        List<FsFirstDiagnosisListUVO> listUVOS = diagnosisMapper.selectFsFirstDiagnosisListUVO(param);
+        if (!CollectionUtils.isEmpty(listUVOS)) {
+            listUVOS.forEach(listUVO -> {
+                if(listUVO.getDoctorStatus() != 1) {
+                    listUVO.setSignUrl(null);
+                }
+            });
+        }
+        return listUVOS;
+    }
+
+    @Override
+    public FsFirstDiagnosisListUVO getInfo(Long id) {
+        FsFirstDiagnosisListUVO info = diagnosisMapper.getInfo(id);
+        if (info != null && info.getDoctorStatus() != 1) {
+            info.setSignUrl(null);
+        }
+        return info;
+    }
+
+    @Override
+    public R confirm(Long id) {
+        FsFirstDiagnosis diagnosis = diagnosisMapper.selectById(id);
+        if (diagnosis == null) {
+            return R.error("初诊单不存在");
+        }
+        if (diagnosis.getUserStatus() != 0) {
+            return R.error("初诊单已确认");
+        }
+        if (diagnosis.getDoctorStatus() != 1) {
+            return R.error("医生未签字无法确认");
+        }
+        FsFirstDiagnosis map = new FsFirstDiagnosis();
+        map.setId(diagnosis.getId());
+        map.setUserStatus(1);
+        int i = diagnosisMapper.updateFsFirstDiagnosis(diagnosis);
+        if (i > 0) {
+            return R.ok();
+        }
+        return R.error();
+    }
+
+    @Override
+    public R fill(FsDiagnosisFillDParam param) {
+        if (param.getId() == null) {
+            return R.error("初诊单id不能为空");
+        }
+        FsFirstDiagnosis diagnosis = diagnosisMapper.selectById(param.getId());
+        FsFirstDiagnosis map = new FsFirstDiagnosis();
+        if (diagnosis == null) {
+            return R.error("初诊单不存在");
+        }
+        if (diagnosis.getDoctorId() == null){
+            FsDoctor doctor = doctorService.selectFsDoctorByDoctorId(param.getDoctorId());
+            if (doctor == null) {
+                return R.error("医生不存在");
+            }
+            map.setDoctorName(doctor.getDoctorName());
+            map.setDoctorDep(doctor.getPosition());
+            map.setDoctorCertificate(doctor.getCertificateCode());
+            map.setDoctorId(doctor.getDoctorId());
+        }
+        map.setId(diagnosis.getId());
+        map.setDoctorStatus(1);
+        int i = diagnosisMapper.updateFsFirstDiagnosis(diagnosis);
+        if (i > 0) {
+            return R.ok();
+        }
+        return R.error();
+    }
 }
 }

+ 17 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsInquiryPatientInfoServiceImpl.java

@@ -4,6 +4,8 @@ import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.fs.common.BeanCopyUtils;
 import com.fs.common.BeanCopyUtils;
 import com.fs.common.exception.CustomException;
 import com.fs.common.exception.CustomException;
+import com.fs.course.param.FsInquiryPatientInfoUParam;
+import com.fs.course.vo.FsInquiryPatientInfoListUVO;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.domain.FsInquiryPatientInfo;
 import com.fs.his.mapper.FsInquiryOrderMapper;
 import com.fs.his.mapper.FsInquiryOrderMapper;
 import com.fs.his.mapper.FsInquiryPatientInfoMapper;
 import com.fs.his.mapper.FsInquiryPatientInfoMapper;
@@ -17,6 +19,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.Collections;
+import java.util.List;
+
 /**
 /**
  * 问诊患者信息Service业务层处理
  * 问诊患者信息Service业务层处理
  */
  */
@@ -55,7 +60,19 @@ public class FsInquiryPatientInfoServiceImpl implements IFsInquiryPatientInfoSer
         if (fsInquiryPatientInfo != null) {
         if (fsInquiryPatientInfo != null) {
             BeanCopyUtils.copy(fsInquiryPatientInfo, inquiryPatientVO);
             BeanCopyUtils.copy(fsInquiryPatientInfo, inquiryPatientVO);
             inquiryPatientVO.setDoctorAdviceJson(JSONUtil.toBean(fsInquiryPatientInfo.getDoctorAdviceJson(), DoctorAdviceVO.class));
             inquiryPatientVO.setDoctorAdviceJson(JSONUtil.toBean(fsInquiryPatientInfo.getDoctorAdviceJson(), DoctorAdviceVO.class));
+        } else {
+            inquiryPatientVO = new FsInquiryPatientVO();
         }
         }
         return inquiryPatientVO;
         return inquiryPatientVO;
     }
     }
+
+    @Override
+    public List<FsInquiryPatientInfoListUVO> selectFsInquiryPatientInfoListUVO(FsInquiryPatientInfoUParam param) {
+        return fsInquiryPatientInfoMapper.selectFsInquiryPatientInfoListUVO(param);
+    }
+
+    @Override
+    public FsInquiryPatientInfoListUVO getInfo(Long id) {
+        return fsInquiryPatientInfoMapper.getInfo(id);
+    }
 }
 }

+ 18 - 27
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1405,14 +1405,14 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
     @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Throwable.class, propagation = Propagation.REQUIRED)
     public R payConfirm(String orderCode, String payCode, String tradeNo, String payType, Integer type) {
     public R payConfirm(String orderCode, String payCode, String tradeNo, String payType, Integer type) {
         try {
         try {
-            FsStoreOrderScrm order = null;
+            FsStoreOrder order = null;
             if (type.equals(1)) {
             if (type.equals(1)) {
 
 
-                FsStorePaymentScrm storePayment = fsStorePaymentScrmMapper.selectFsStorePaymentByPaymentCode(payCode);
+                FsStorePayment storePayment = fsStorePaymentMapper.selectFsStorePaymentByPaymentCode(payCode);
                 if (storePayment != null) {
                 if (storePayment != null) {
                     if (storePayment.getStatus().equals(0)) {
                     if (storePayment.getStatus().equals(0)) {
                         log.info(payCode + "待支付");
                         log.info(payCode + "待支付");
-                        FsStorePaymentScrm paymentMap = new FsStorePaymentScrm();
+                        FsStorePayment paymentMap = new FsStorePayment();
                         paymentMap.setPaymentId(storePayment.getPaymentId());
                         paymentMap.setPaymentId(storePayment.getPaymentId());
                         paymentMap.setStatus(1);
                         paymentMap.setStatus(1);
                         paymentMap.setPayTime(new Date());
                         paymentMap.setPayTime(new Date());
@@ -1429,42 +1429,33 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                             paymentMap.setBankSerialNo(orderResult.getBankOrderId());
                             paymentMap.setBankSerialNo(orderResult.getBankOrderId());
                             paymentMap.setBankTransactionId(orderResult.getBankTrxId());
                             paymentMap.setBankTransactionId(orderResult.getBankTrxId());
                         }
                         }
-                        fsStorePaymentScrmMapper.updateFsStorePayment(paymentMap);
+                        fsStorePaymentMapper.updateFsStorePayment(paymentMap);
                         log.info(payCode + "已支付");
                         log.info(payCode + "已支付");
-                        order = fsStoreOrderScrmMapper.selectFsStoreOrderById(Long.parseLong(storePayment.getBusinessOrderId()));
+                        order = fsStoreOrderMapper.selectFsStoreOrderByOrderId(Long.parseLong(storePayment.getBusinessId()));
                     }
                     }
                 } else {
                 } else {
                     log.info(payCode + "支付单号不存在");
                     log.info(payCode + "支付单号不存在");
                     return R.error("支付单号不存在");
                     return R.error("支付单号不存在");
                 }
                 }
             } else if (type.equals(2)) {
             } else if (type.equals(2)) {
-                order = fsStoreOrderScrmMapper.selectFsStoreOrderByOrderCode(orderCode);
+                order = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(orderCode);
             }
             }
-//            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
-//                log.info(payCode + "订单号不为待支付回退");
-//                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-//                return R.error();
-//            }
-
-            //orderScrm迁移的表待支付状态码为:0
-            if (order != null && !order.getStatus().equals(0)) {//判断订单状态是否待支付
+            if (order != null && !order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
                 log.info(payCode + "订单号不为待支付回退");
                 log.info(payCode + "订单号不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return R.error();
                 return R.error();
             }
             }
-
-            if (order != null && !order.getPaid().equals(0)) {
+            if (order != null && !order.getIsPay().equals(0)) {
                 log.info(payCode + "订单号支付不为待支付回退");
                 log.info(payCode + "订单号支付不为待支付回退");
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return R.error();
                 return R.error();
             }
             }
-            fsStoreOrderLogsService.create(order.getId(), FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
+            fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getValue(),
                     FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
                     FsStoreOrderLogEnum.PAY_ORDER_SUCCESS.getDesc());
-            FsStoreOrderScrm storeOrder = new FsStoreOrderScrm();
-            storeOrder.setId(order.getId());
-            storeOrder.setPaid(1);
-//            storeOrder.setStatus(2);
-            storeOrder.setStatus(1);//代发货
+            FsStoreOrder storeOrder = new FsStoreOrder();
+            storeOrder.setOrderId(order.getOrderId());
+            storeOrder.setIsPay(1);
+            storeOrder.setStatus(2);
             storeOrder.setPrescribePrice(order.getTotalPrice());
             storeOrder.setPrescribePrice(order.getTotalPrice());
             SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
             SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.store");
             Map<String, Object> config = (Map<String, Object>) JSON.parse(sysConfig.getConfigValue());
             Map<String, Object> config = (Map<String, Object>) JSON.parse(sysConfig.getConfigValue());
@@ -1477,20 +1468,20 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             } else {
             } else {
                 storeOrder.setFollowDoctorId(iFsDoctorService.selectFollowDoctorDoctorByPackage());
                 storeOrder.setFollowDoctorId(iFsDoctorService.selectFollowDoctorDoctorByPackage());
             }
             }
-            if (order.getCycle() != null && order.getCycle() >= followRate) {
+            if (order.getCycle() >= followRate) {
                 Calendar calendar = Calendar.getInstance();
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTime(new Date());
                 calendar.setTime(new Date());
                 calendar.add(Calendar.DAY_OF_MONTH, followRate);
                 calendar.add(Calendar.DAY_OF_MONTH, followRate);
                 storeOrder.setFollowTime(calendar.getTime());
                 storeOrder.setFollowTime(calendar.getTime());
             }
             }
             storeOrder.setPayTime(new Date());
             storeOrder.setPayTime(new Date());
-            fsStoreOrderScrmMapper.updateFsStoreOrder(storeOrder);
+            fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
             //更新优惠券状态
             //更新优惠券状态
-            if (order.getCouponId() != null && order.getCouponId() > 0) {
-                FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(order.getCouponId());
+            if (order.getUserCouponId() != null && order.getUserCouponId() > 0) {
+                FsUserCoupon userCoupon = userCouponService.selectFsUserCouponById(order.getUserCouponId());
                 if (userCoupon != null && userCoupon.getStatus().equals(0)) {
                 if (userCoupon != null && userCoupon.getStatus().equals(0)) {
                     userCoupon.setUseTime(new Date());
                     userCoupon.setUseTime(new Date());
-                    userCoupon.setBusinessId(order.getId());
+                    userCoupon.setBusinessId(order.getOrderId());
                     userCoupon.setBusinessType(2);
                     userCoupon.setBusinessType(2);
                     userCoupon.setStatus(1);
                     userCoupon.setStatus(1);
                     userCouponService.updateFsUserCoupon(userCoupon);
                     userCouponService.updateFsUserCoupon(userCoupon);

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

@@ -20,7 +20,14 @@ public class FsDiagnosisListDVO {
 
 
     private String firstDiagnosis;
     private String firstDiagnosis;
 
 
+    private String age;
+
+    private String physicalCondition;
+
     /** 日期 */
     /** 日期 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date dateTime;
     private Date dateTime;
+
+    private Integer doctorStatus;
+    private Integer userStatus;
 }
 }

+ 1 - 1
fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting.java

@@ -81,7 +81,7 @@ public class QwSopTempSetting implements Serializable{
              * 客户的id(用于发送)
              * 客户的id(用于发送)
              */
              */
             private String externalUserId;
             private String externalUserId;
-            //文本-图片-链接-小程序-文件-视频-语音-视频号-app
+            //文本-图片-链接-小程序-文件-视频-语音-视频号-app-自定义小程序
             private String contentType;
             private String contentType;
             //文本
             //文本
             private String value;
             private String value;

+ 1 - 1
fs-service/src/main/java/com/fs/sop/mapper/QwSopLogsMapper.java

@@ -321,7 +321,7 @@ public interface QwSopLogsMapper extends BaseMapper<QwSopLogs> {
     @DataSource(DataSourceType.SOP)
     @DataSource(DataSourceType.SOP)
     List<QwSopLogs> selectIpadByCorpId(@Param("corpId") String corpId, @Param("now") LocalDateTime now);
     List<QwSopLogs> selectIpadByCorpId(@Param("corpId") String corpId, @Param("now") LocalDateTime now);
 
 
-    @DataSource(DataSourceType.SopREAD)
+    @DataSource(DataSourceType.SOP)
     List<QwSopLogs> selectByQwUserId(@Param("id") Long id);
     List<QwSopLogs> selectByQwUserId(@Param("id") Long id);
 
 
     @Select("select * from qw_sop_logs where send_type=8 and send_status=3 and  create_time <= DATE_SUB(NOW(), INTERVAL 2 HOUR) ")
     @Select("select * from qw_sop_logs where send_type=8 and send_status=3 and  create_time <= DATE_SUB(NOW(), INTERVAL 2 HOUR) ")

+ 58 - 5
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -9,7 +9,9 @@ import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.date.DateUtil;
 import com.fs.common.utils.date.DateUtil;
+import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyMiniapp;
 import com.fs.company.domain.CompanyMiniapp;
+import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.config.cloud.CloudHostProper;
 import com.fs.config.cloud.CloudHostProper;
@@ -162,6 +164,10 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     @Autowired
     @Autowired
     private CloudHostProper cloudHostProper;
     private CloudHostProper cloudHostProper;
 
 
+    @Autowired
+    private CompanyMapper companyMapper;
+
+
     @Override
     @Override
     public void save(SopUserLogsInfo sopUserLogsInfo) {
     public void save(SopUserLogsInfo sopUserLogsInfo) {
         sopUserLogsInfoMapper.insertSopUserLogsInfo(sopUserLogsInfo);
         sopUserLogsInfoMapper.insertSopUserLogsInfo(sopUserLogsInfo);
@@ -751,10 +757,11 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                 return R.error().put("msg","企业微信用户不存在未绑定销售公司-请绑定后重试:"+qwUser.getQwUserName()+"|"+qwUser.getQwUserId());
                 return R.error().put("msg","企业微信用户不存在未绑定销售公司-请绑定后重试:"+qwUser.getQwUserName()+"|"+qwUser.getQwUserId());
             }
             }
 
 
+            Company company = companyMapper.selectCompanyById(qwUser.getCompanyId());
+
             String companyUserId = String.valueOf(qwUser.getCompanyUserId()).trim();
             String companyUserId = String.valueOf(qwUser.getCompanyUserId()).trim();
             String companyId = String.valueOf(qwUser.getCompanyId()).trim();
             String companyId = String.valueOf(qwUser.getCompanyId()).trim();
 
 
-
             //域名
             //域名
 //            String domainName = companyUserMapper.selectDomainByUserId(Long.parseLong(companyUserId));
 //            String domainName = companyUserMapper.selectDomainByUserId(Long.parseLong(companyUserId));
 //            if (StringUtils.isEmpty(domainName)){
 //            if (StringUtils.isEmpty(domainName)){
@@ -892,6 +899,23 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                             st.setLinkUrl(linkByApp.getSortLink().replaceAll("^[\\s\\u2005]+", ""));
                             st.setLinkUrl(linkByApp.getSortLink().replaceAll("^[\\s\\u2005]+", ""));
                             st.setAppLinkUrl(linkByApp.getAppMsgLink().replaceAll("^[\\s\\u2005]+", ""));
                             st.setAppLinkUrl(linkByApp.getAppMsgLink().replaceAll("^[\\s\\u2005]+", ""));
 
 
+                            break;
+                        //自定义小程序
+                        case "10":
+                            addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), qwUserId, companyUserId, companyId, item.getExternalId(),item.getStartTime(),createTime );
+                            if (company!=null){
+
+                                String customMiniAppId = company.getCustomMiniAppId();
+
+                                if (customMiniAppId != null && !customMiniAppId.trim().isEmpty()) {
+                                    st.setMiniprogramAppid(customMiniAppId);
+                                } else {
+                                    st.setMiniprogramAppid("该公司未配置自定义小程序:"+companyId);
+                                }
+                            }else {
+                                st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
+                            }
+
                             break;
                             break;
                         default:
                         default:
                             break;
                             break;
@@ -997,6 +1021,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         List<CompanyMiniapp> miniList = companyMiniappService.list(new QueryWrapper<CompanyMiniapp>().orderByAsc("sort_num"));
         List<CompanyMiniapp> miniList = companyMiniappService.list(new QueryWrapper<CompanyMiniapp>().orderByAsc("sort_num"));
         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap = miniList.stream().collect(Collectors.groupingBy(CompanyMiniapp::getCompanyId, Collectors.groupingBy(CompanyMiniapp::getType)));
         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap = miniList.stream().collect(Collectors.groupingBy(CompanyMiniapp::getCompanyId, Collectors.groupingBy(CompanyMiniapp::getType)));
 
 
+
+        List<Company> companies = companyMapper.selectCompanyAllList();
+
         //排序
         //排序
         int sort = 0;
         int sort = 0;
         //发送类型
         //发送类型
@@ -1038,7 +1065,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
 
 
                 if (qwUser.getCompanyUserId()!=null && qwUser.getCompanyId()!=null){
                 if (qwUser.getCompanyUserId()!=null && qwUser.getCompanyId()!=null){
                     List<QwSopLogs> sopLogsList = processInsertSopUserLogsInfo(logs, qwUser, param, words, config, qwCompany, finalSort,
                     List<QwSopLogs> sopLogsList = processInsertSopUserLogsInfo(logs, qwUser, param, words, config, qwCompany, finalSort,
-                            finalSendType,miniMap );
+                            finalSendType,miniMap,companies);
 
 
                     //批量插入 发送记录
                     //批量插入 发送记录
                     if (!sopLogsList.isEmpty()) {
                     if (!sopLogsList.isEmpty()) {
@@ -1061,7 +1088,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     private List<QwSopLogs> processInsertSopUserLogsInfo(List<SopUserLogsInfo> sopUserLogsInfos,QwUser qwUser,
     private List<QwSopLogs> processInsertSopUserLogsInfo(List<SopUserLogsInfo> sopUserLogsInfos,QwUser qwUser,
                                                          SendUserLogsInfoMsgParam param,List<FastGptChatReplaceWords> words,
                                                          SendUserLogsInfoMsgParam param,List<FastGptChatReplaceWords> words,
                                                          CourseConfig config,QwCompany qwCompany,int finalSort,int finalSendType,
                                                          CourseConfig config,QwCompany qwCompany,int finalSort,int finalSendType,
-                                                         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap){
+                                                         Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,List<Company> companies ){
 
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
 
@@ -1116,7 +1143,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
             switch (finalSendType){
             switch (finalSendType){
                 case 5:
                 case 5:
                     List<QwSopCourseFinishTempSetting.Setting> list = processSetting(item,qwUser, param, words, config, qwCompany,companyUserId,companyId,
                     List<QwSopCourseFinishTempSetting.Setting> list = processSetting(item,qwUser, param, words, config, qwCompany,companyUserId,companyId,
-                            contact,dataTime, finalDomainName,miniMap);
+                            contact,dataTime, finalDomainName,miniMap,companies);
                     setting.setSetting(list);
                     setting.setSetting(list);
                     break;
                     break;
                 case 9:
                 case 9:
@@ -1179,7 +1206,8 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                                                                       SendUserLogsInfoMsgParam param,List<FastGptChatReplaceWords> words,
                                                                       SendUserLogsInfoMsgParam param,List<FastGptChatReplaceWords> words,
                                                                       CourseConfig config,QwCompany qwCompany,String companyUserId, String companyId,
                                                                       CourseConfig config,QwCompany qwCompany,String companyUserId, String companyId,
                                                                       QwExternalContact contact,Date dataTime,String domainName,
                                                                       QwExternalContact contact,Date dataTime,String domainName,
-                                                                      Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap){
+                                                                      Map<Long, Map<Integer, List<CompanyMiniapp>>> miniMap,
+                                                                      List<Company> companies ){
         List<QwSopCourseFinishTempSetting.Setting> list = JSONArray.parseArray(param.getSetting(),QwSopCourseFinishTempSetting.Setting.class);
         List<QwSopCourseFinishTempSetting.Setting> list = JSONArray.parseArray(param.getSetting(),QwSopCourseFinishTempSetting.Setting.class);
 
 
         for (QwSopCourseFinishTempSetting.Setting st : list) {
         for (QwSopCourseFinishTempSetting.Setting st : list) {
@@ -1273,6 +1301,31 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
 
 
                     st.setMiniprogramPage(linkByMiniApp);
                     st.setMiniprogramPage(linkByMiniApp);
                     break;
                     break;
+
+                //自定义小程序
+                case "10":
+
+                    addWatchLogIfNeeded(item.getSopId(), param.getVideoId(), param.getCourseId(),item.getFsUserId(), String.valueOf(qwUser.getId()), companyUserId, companyId,
+                            item.getExternalId(),item.getStartTime(),dataTime );
+
+                    Optional<Company> matchedCompany = companies.stream()
+                            .filter(company -> String.valueOf(company.getCompanyId()).equals(companyId))
+                            .findFirst();
+                    if (matchedCompany.isPresent()) {
+                        Company company = matchedCompany.get();
+
+                        String customMiniAppId = company.getCustomMiniAppId();
+
+                        if (customMiniAppId != null && !customMiniAppId.trim().isEmpty()) {
+                            st.setMiniprogramAppid(customMiniAppId);
+                        } else {
+                            st.setMiniprogramAppid("该公司未配置自定义小程序:"+companyId);
+                        }
+                    } else {
+                        st.setMiniprogramAppid("未找到匹配的公司的自定义小程序:"+companyId);
+                    }
+
+                    break;
                 default:
                 default:
                     break;
                     break;
 
 

+ 5 - 5
fs-service/src/main/resources/application-druid-jzzx.yml

@@ -21,7 +21,7 @@ spring:
                 # 连接池中的最大空闲连接
                 # 连接池中的最大空闲连接
                 max-idle: 8
                 max-idle: 8
                 # 连接池的最大数据库连接数
                 # 连接池的最大数据库连接数
-                max-active: 8
+                max-active: 100
                 # #连接池最大阻塞等待时间(使用负值表示没有限制)
                 # #连接池最大阻塞等待时间(使用负值表示没有限制)
                 max-wait: -1ms
                 max-wait: -1ms
     datasource:
     datasource:
@@ -56,7 +56,7 @@ spring:
                 # 最小连接池数量
                 # 最小连接池数量
                 minIdle: 10
                 minIdle: 10
                 # 最大连接池数量
                 # 最大连接池数量
-                maxActive: 20
+                maxActive: 200
                 # 配置获取连接等待超时的时间
                 # 配置获取连接等待超时的时间
                 maxWait: 60000
                 maxWait: 60000
                 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
                 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
@@ -73,7 +73,7 @@ spring:
                 webStatFilter:
                 webStatFilter:
                     enabled: true
                     enabled: true
                 statViewServlet:
                 statViewServlet:
-                    enabled: true
+                    enabled: false
                     # 设置白名单,不填则允许所有访问
                     # 设置白名单,不填则允许所有访问
                     allow:
                     allow:
                     url-pattern: /druid/*
                     url-pattern: /druid/*
@@ -108,7 +108,7 @@ spring:
                 # 最小连接池数量
                 # 最小连接池数量
                 minIdle: 10
                 minIdle: 10
                 # 最大连接池数量
                 # 最大连接池数量
-                maxActive: 20
+                maxActive: 200
                 # 配置获取连接等待超时的时间
                 # 配置获取连接等待超时的时间
                 maxWait: 60000
                 maxWait: 60000
                 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
                 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
@@ -125,7 +125,7 @@ spring:
                 webStatFilter:
                 webStatFilter:
                     enabled: true
                     enabled: true
                 statViewServlet:
                 statViewServlet:
-                    enabled: true
+                    enabled: false
                     # 设置白名单,不填则允许所有访问
                     # 设置白名单,不填则允许所有访问
                     allow:
                     allow:
                     url-pattern: /druid/*
                     url-pattern: /druid/*

+ 5 - 5
fs-service/src/main/resources/application-druid-kyt.yml

@@ -22,7 +22,7 @@ spring:
         # 连接池中的最大空闲连接
         # 连接池中的最大空闲连接
         max-idle: 8
         max-idle: 8
         # 连接池的最大数据库连接数
         # 连接池的最大数据库连接数
-        max-active: 8
+        max-active: 100
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         max-wait: -1ms
         max-wait: -1ms
     database: 0
     database: 0
@@ -49,7 +49,7 @@ spring:
         # 最小连接池数量
         # 最小连接池数量
         minIdle: 10
         minIdle: 10
         # 最大连接池数量
         # 最大连接池数量
-        maxActive: 20
+        maxActive: 200
         # 配置获取连接等待超时的时间
         # 配置获取连接等待超时的时间
         maxWait: 60000
         maxWait: 60000
         # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
         # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
@@ -66,7 +66,7 @@ spring:
         webStatFilter:
         webStatFilter:
           enabled: true
           enabled: true
         statViewServlet:
         statViewServlet:
-          enabled: true
+          enabled: false
           # 设置白名单,不填则允许所有访问
           # 设置白名单,不填则允许所有访问
           allow:
           allow:
           url-pattern: /druid/*
           url-pattern: /druid/*
@@ -98,7 +98,7 @@ spring:
         # 最小连接池数量
         # 最小连接池数量
         minIdle: 10
         minIdle: 10
         # 最大连接池数量
         # 最大连接池数量
-        maxActive: 20
+        maxActive: 200
         # 配置获取连接等待超时的时间
         # 配置获取连接等待超时的时间
         maxWait: 60000
         maxWait: 60000
         # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
         # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
@@ -115,7 +115,7 @@ spring:
         webStatFilter:
         webStatFilter:
           enabled: true
           enabled: true
         statViewServlet:
         statViewServlet:
-          enabled: true
+          enabled: false
           # 设置白名单,不填则允许所有访问
           # 设置白名单,不填则允许所有访问
           allow:
           allow:
           url-pattern: /druid/*
           url-pattern: /druid/*

+ 6 - 1
fs-service/src/main/resources/mapper/company/CompanyMapper.xml

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="packageCateIds"    column="package_cate_ids"    />
         <result property="packageCateIds"    column="package_cate_ids"    />
         <result property="courseMaAppId"    column="course_ma_app_id"    />
         <result property="courseMaAppId"    column="course_ma_app_id"    />
         <result property="courseMiniAppId"    column="course_mini_app_id"    />
         <result property="courseMiniAppId"    column="course_mini_app_id"    />
+        <result property="customMiniAppId"    column="custom_mini_app_id"    />
         <result property="repeat"    column="repeat"    />
         <result property="repeat"    column="repeat"    />
         <result property="sendIfType"    column="send_if_type"    />
         <result property="sendIfType"    column="send_if_type"    />
         <result property="ifNum"    column="if_num"    />
         <result property="ifNum"    column="if_num"    />
@@ -59,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="packageCateIds != null "> and package_cate_ids = #{packageCateIds}</if>
             <if test="packageCateIds != null "> and package_cate_ids = #{packageCateIds}</if>
             <if test="courseMaAppId != null "> and course_ma_app_id = #{courseMaAppId}</if>
             <if test="courseMaAppId != null "> and course_ma_app_id = #{courseMaAppId}</if>
             <if test="courseMiniAppId != null "> and course_mini_app_id = #{courseMiniAppId}</if>
             <if test="courseMiniAppId != null "> and course_mini_app_id = #{courseMiniAppId}</if>
+            <if test="customMiniAppId != null "> and custom_mini_app_id = #{customMiniAppId}</if>
         </where>
         </where>
     </select>
     </select>
 
 
@@ -73,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </foreach>
          </foreach>
     </select>
     </select>
     <select id="selectCompanyAllList" resultType="com.fs.company.domain.Company">
     <select id="selectCompanyAllList" resultType="com.fs.company.domain.Company">
-        select company_id,company_name from company where is_del=0
+        select company_id,company_name,custom_mini_app_id from company where is_del=0
     </select>
     </select>
     <select id="selectDoctorIdsByCompanyId" resultType="java.lang.String">
     <select id="selectDoctorIdsByCompanyId" resultType="java.lang.String">
         select doctor_ids from company where company_id = #{companyId}
         select doctor_ids from company where company_id = #{companyId}
@@ -109,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="packageCateIds != null">package_cate_ids,</if>
             <if test="packageCateIds != null">package_cate_ids,</if>
             <if test="courseMaAppId != null">course_ma_app_id,</if>
             <if test="courseMaAppId != null">course_ma_app_id,</if>
             <if test="courseMiniAppId != null">course_mini_app_id,</if>
             <if test="courseMiniAppId != null">course_mini_app_id,</if>
+            <if test="customMiniAppId != null">custom_mini_app_id,</if>
             <if test="repeat != null">`repeat`,</if>
             <if test="repeat != null">`repeat`,</if>
             <if test="sendIfType != null">send_if_type,</if>
             <if test="sendIfType != null">send_if_type,</if>
             <if test="ifNum != null">if_num,</if>
             <if test="ifNum != null">if_num,</if>
@@ -142,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="packageCateIds != null">#{packageCateIds},</if>
             <if test="packageCateIds != null">#{packageCateIds},</if>
             <if test="courseMaAppId != null">#{courseMaAppId},</if>
             <if test="courseMaAppId != null">#{courseMaAppId},</if>
             <if test="courseMiniAppId != null">#{courseMiniAppId},</if>
             <if test="courseMiniAppId != null">#{courseMiniAppId},</if>
+            <if test="customMiniAppId != null">#{customMiniAppId},</if>
             <if test="repeat != null">#{repeat},</if>
             <if test="repeat != null">#{repeat},</if>
             <if test="sendIfType != null">#{sendIfType},</if>
             <if test="sendIfType != null">#{sendIfType},</if>
             <if test="ifNum != null">#{ifNum},</if>
             <if test="ifNum != null">#{ifNum},</if>
@@ -180,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="packageCateIds != null">package_cate_ids = #{packageCateIds},</if>
             <if test="packageCateIds != null">package_cate_ids = #{packageCateIds},</if>
             <if test="courseMaAppId != null">course_ma_app_id = #{courseMaAppId},</if>
             <if test="courseMaAppId != null">course_ma_app_id = #{courseMaAppId},</if>
             <if test="courseMiniAppId != null">course_mini_app_id = #{courseMiniAppId},</if>
             <if test="courseMiniAppId != null">course_mini_app_id = #{courseMiniAppId},</if>
+            <if test="customMiniAppId != null">custom_mini_app_id = #{customMiniAppId},</if>
             <if test="fsUserIsDefaultBlack != null ">fs_user_is_default_black = #{fsUserIsDefaultBlack},</if>
             <if test="fsUserIsDefaultBlack != null ">fs_user_is_default_black = #{fsUserIsDefaultBlack},</if>
             <if test="repeat != null">`repeat` = #{repeat},</if>
             <if test="repeat != null">`repeat` = #{repeat},</if>
             <if test="sendIfType != null">send_if_type = #{sendIfType},</if>
             <if test="sendIfType != null">send_if_type = #{sendIfType},</if>

+ 1 - 1
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -328,7 +328,7 @@
         AND ccut.course_id = fcpd.course_id
         AND ccut.course_id = fcpd.course_id
         AND ccut.video_id = fcpd.video_id
         AND ccut.video_id = fcpd.video_id
         AND ccut.company_user_id = #{params.companyUserId}
         AND ccut.company_user_id = #{params.companyUserId}
-        where course.is_del = 0
+        where course.is_del = 0 and fcp.del_flag = '0' and fcpd.del_flag = '0'
         <if test="params.companyId != null">
         <if test="params.companyId != null">
             and FIND_IN_SET(#{params.companyId}, fcp.company_id)
             and FIND_IN_SET(#{params.companyId}, fcp.company_id)
         </if>
         </if>

+ 50 - 0
fs-user-app/src/main/java/com/fs/app/controller/DiagnosisController.java

@@ -0,0 +1,50 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.course.param.FsFirstDiagnosisListUParam;
+import com.fs.course.vo.FsFirstDiagnosisListUVO;
+import com.fs.his.service.IFsFirstDiagnosisService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Api("初诊单接口")
+@RestController
+@RequestMapping(value="/app/diagnosis")
+public class DiagnosisController extends AppBaseController{
+
+    @Autowired
+    private IFsFirstDiagnosisService diagnosisService;
+
+
+    @Login
+    @ApiOperation("初诊单列表")
+    @GetMapping("/getList")
+    public R getList(FsFirstDiagnosisListUParam param) {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setUserId(Long.parseLong(getUserId()));
+        List<FsFirstDiagnosisListUVO> fsFirstDiagnosisListUVOS = diagnosisService.selectFsFirstDiagnosisListUVO(param);
+        PageInfo<FsFirstDiagnosisListUVO> pageInfo = new PageInfo<>(fsFirstDiagnosisListUVOS);
+        return R.ok().put("data",pageInfo);
+    }
+
+
+    @ApiOperation("初诊单详情")
+    @GetMapping("/getInfo")
+    public R getInfo(@RequestParam("id") Long id) {
+        FsFirstDiagnosisListUVO info = diagnosisService.getInfo(id);
+        return R.ok().put("data",info);
+    }
+
+    @ApiOperation("确认初诊单")
+    @PostMapping("/confirm")
+    public R confirm(@RequestParam("id") Long id) {
+        return diagnosisService.confirm(id);
+    }
+}

+ 47 - 0
fs-user-app/src/main/java/com/fs/app/controller/InquiryPatientInfoController.java

@@ -0,0 +1,47 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.course.param.FsInquiryPatientInfoUParam;
+import com.fs.course.vo.FsInquiryPatientInfoListUVO;
+import com.fs.his.service.IFsInquiryPatientInfoService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api("患者问诊单接口")
+@RestController
+@RequestMapping(value="/app/inquiryPatient")
+public class InquiryPatientInfoController extends AppBaseController{
+
+    @Autowired
+    private IFsInquiryPatientInfoService patientInfoService;
+
+
+    @Login
+    @ApiOperation("患者问诊单列表")
+    @GetMapping("/getList")
+    public R getList(FsInquiryPatientInfoUParam param) {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setUserId(Long.parseLong(getUserId()));
+        List<FsInquiryPatientInfoListUVO> fsInquiryPatientInfoListUVOS = patientInfoService.selectFsInquiryPatientInfoListUVO(param);
+        PageInfo<FsInquiryPatientInfoListUVO> pageInfo = new PageInfo<>(fsInquiryPatientInfoListUVOS);
+        return R.ok().put("data",pageInfo);
+    }
+
+
+    @ApiOperation("问诊单详情")
+    @GetMapping("/getInfo")
+    public R getInfo(@RequestParam("id") Long id) {
+        FsInquiryPatientInfoListUVO info = patientInfoService.getInfo(id);
+        return R.ok().put("data",info);
+    }
+}