Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

yuhongqi 5 gün önce
ebeveyn
işleme
e06d9aee56

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

@@ -1127,9 +1127,9 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         }
         clonedContent.getSetting().stream().filter(e -> "1".equals(e.getIsBindUrl())).forEach(e -> {
             e.setIsBindUrl("0");
-            e.setLinkDescribe(null);
+//            e.setLinkDescribe(null);
             e.setLinkUrl(null);
-            e.setLinkImageUrl(null);
+//            e.setLinkImageUrl(null);
         });
         sopLogs.setContentJson(JSON.toJSONString(clonedContent));
         enqueueQwSopLogs(sopLogs);

+ 1 - 1
fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java

@@ -46,7 +46,7 @@ public class uniPush2ServiceImpl implements uniPush2Service {
     public void pushSopAppLinkMsgByExternalIM(String cropId, String linkTile, String linkDescribe,String linkImageUrl, String link, Long companyUserId,Long fsUserId) throws JsonProcessingException {
 
         if (companyUserId!=null&&fsUserId!=null && fsUserId!=0){
-            openIMService.sendCourse(fsUserId,companyUserId,link,linkTile,linkImageUrl,cropId);
+            openIMService.sendCourse(fsUserId,companyUserId,link,linkDescribe,linkImageUrl,cropId);
         }
 
     }

+ 4 - 0
fs-service/src/main/java/com/fs/his/param/FsUserInformationCollectionParam.java

@@ -48,5 +48,9 @@ public class FsUserInformationCollectionParam {
 
     private String doctorSign;
 
+    private Long doctorId;
+
+    private Long doctorType2Id;
+
     private String packageOrderCode;
 }

+ 64 - 30
fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -14,8 +14,11 @@ import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyUser;
+import com.fs.company.domain.CompanyUserUser;
 import com.fs.company.mapper.CompanyUserMapper;
+import com.fs.company.mapper.CompanyUserUserMapper;
 import com.fs.company.service.ICompanyService;
+import com.fs.company.service.ICompanyUserService;
 import com.fs.core.config.WxMaConfiguration;
 import com.fs.core.config.WxPayProperties;
 import com.fs.core.utils.OrderCodeUtils;
@@ -149,6 +152,11 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     private IFsInquiryOrderService fsInquiryOrderService;
     @Autowired
     private OpenIMService openIMService;
+    @Autowired
+    private CompanyUserUserMapper companyUserUserMapper;
+    @Autowired
+    private FsPackageMapper fsPackageMapper;
+
     /**
      * 查询用户信息采集
      *
@@ -219,6 +227,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (collection.getUserConfirm() == 1 && collection.getUserConfirm2() == 0) {
             throw new CustomException("确认中,暂无法修改");
         }
+        param.setDoctorId(collection.getDoctorId());
+        param.setDoctorType2Id(collection.getDoctorType2Id());
+        param.setPackageId(collection.getPackageId());
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
         fsUserInformationCollection.setUpdateTime(DateUtils.getNowDate());
         baseMapper.updateFsUserInformationCollection(fsUserInformationCollection);
@@ -246,6 +257,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
         //清空订单号
         fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getId());
+        param.setDoctorId(collection.getDoctorId());
+        param.setDoctorType2Id(collection.getDoctorType2Id());
+        param.setPackageId(collection.getPackageId());
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
         fsUserInformationCollection.setUserConfirm2(0);
         fsUserInformationCollection.setUserConfirm(0);
@@ -574,7 +588,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             map.setJsonInfo(JSON.toJSONString(answerVOS));
         }
 //
-
+        openIMService.doctorSendMsgToUser(collection.getUserId(),collection.getDoctorType2Id());
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
             FsPackageOrder fsPackageOrder = packageOrderMapper.selectFsPackageOrderByOrderSn(collection.getPackageOrderCode());
             if(fsPackageOrder.getStoreOrderId()==null||fsPackageOrder.getStoreOrderId()==0){
@@ -674,6 +688,20 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (!Objects.equals(collection.getUserId(), param.getUserId())) {
             return R.error("用户信息不匹配,无法确认");
         }
+        //绑定用户
+        CompanyUserUser companyUserUserMap=new CompanyUserUser();
+        companyUserUserMap.setCompanyUserId(collection.getCompanyUserId());
+        companyUserUserMap.setUserId(collection.getUserId());
+        List<CompanyUserUser> list= companyUserUserMapper.selectCompanyUserUserList(companyUserUserMap);
+        if(list==null|| list.isEmpty()){
+            CompanyUser companyUser=companyUserMapper.selectCompanyUserById(collection.getCompanyUserId());
+            if(companyUser!=null&&companyUser.getStatus().equals("0")){
+                companyUserUserMap.setCompanyId(companyUser.getCompanyId());
+                companyUserUserMap.setCreateTime(new Date());
+                companyUserUserMapper.insertCompanyUserUser(companyUserUserMap);
+            }
+        }
+
         FsUserInformationCollection map = new FsUserInformationCollection();
         map.setId(param.getId());
         map.setUserConfirm(1);
@@ -982,37 +1010,43 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (companyUser == null) {
             throw new CustomException("销售不存在");
         }
-        Long doctorId = null;
-        if (companyUser.getDoctorId() != null) {
-            FsDoctor doctor = doctorMapper.selectFsDoctorByDoctorId(companyUser.getDoctorId());
-            if (doctor != null) {
-                doctorId = doctor.getDoctorId();
-            }
-        } else {
-            //随机获取医生id
-            doctorId = iFsDoctorService.selectFsDoctorDoctorByPackage();
-        }
-        fsUserInformationCollection.setDoctorId(doctorId);
-
+        //医生
+        Long doctorId = companyUser.getDoctorId();
+        fsUserInformationCollection.setDoctorId(getDoctorId(doctorId,1,param.getPackageId()));
+        //药师
+        Long doctorType2Id = param.getDoctorType2Id();
+        fsUserInformationCollection.setDoctorType2Id(getDoctorId(doctorType2Id,2,param.getPackageId()));
         return fsUserInformationCollection;
     }
 
-    public static void main(String[] args) {
-//        String str1 = "[{\"options\":[{\"flag\":false,\"name\":\"通天\",\"value\":0},{\"flag\":false,\"name\":\"哈哈\",\"value\":1}],\"title\":\"测试标题1\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"呼呼\",\"value\":0},{\"flag\":false,\"name\":\"嘻嘻\",\"value\":1}],\"title\":\"测试标题2\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胸痛\",\"value\":0},{\"flag\":false,\"name\":\"胸闷\",\"value\":1},{\"flag\":false,\"name\":\"头晕\",\"value\":2},{\"flag\":false,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":false,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1}]";
-//        String str2 = "[{\"options\":[{\"flag\":true,\"name\":\"胸痛\",\"value\":0},{\"flag\":true,\"name\":\"胸闷\",\"value\":1},{\"flag\":true,\"name\":\"头晕\",\"value\":2},{\"flag\":true,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":true,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胃疼\",\"value\":0},{\"flag\":false,\"name\":\"反酸\",\"value\":1},{\"flag\":false,\"name\":\"恶心\",\"value\":2},{\"flag\":false,\"name\":\"呕吐\",\"value\":3},{\"flag\":false,\"name\":\"黑便\",\"value\":4},{\"flag\":false,\"name\":\"无\",\"value\":5}],\"title\":\"您近期是否出现胃部不适症状,如胃痛、反酸、恶心、呕吐或黑便?\",\"value\":1}]";
-//        List<AnswerVO> vo1 = null;
-//        List<AnswerVO> vo2 = JSON.parseArray(str2, AnswerVO.class);
-//        System.out.println(vo1);
-//        System.out.println(vo2);
-//        vo2.addAll(vo1);
-//        Map<String, List<AnswerVO>> collect = vo2.stream()
-//                .collect(Collectors.groupingBy(AnswerVO::getTitle));
-//        List<AnswerVO> collect1 = vo2.stream()
-//                .collect(Collectors.groupingBy(AnswerVO::getTitle))
-//                .values().stream()
-//                .map(group -> group.stream().reduce((a, b) -> a).orElse(null)).collect(Collectors.toList());
-//        System.out.println(JSON.toJSONString(collect));
-//        System.out.println(JSON.toJSONString(collect1));
-        boolean contains = "是否有糖尿病相关疾病?".contains("糖尿病");
+    /**
+     *  如果是药师 需要根据套餐类型查询药师
+     * @param doctorId
+     * @param doctorType 1医生 2药师
+     * @return
+     */
+    private Long getDoctorId(Long doctorId,Integer doctorType,Long packageId) {
+        FsDoctor doctor = null;
+        if (doctorId != null) {
+            doctor = doctorMapper.selectFsDoctorByDoctorId(doctorId);
+        }
+        if (doctorId == null || doctor == null) {
+            if (doctorType == 1){
+                //随机获取医生id
+                doctorId = iFsDoctorService.selectFsDoctorDoctorByPackage();
+            } else if (doctorType == 2){
+                //随机获取药师id
+                FsPackage fsPackage = fsPackageMapper.selectFsPackageByPackageId(packageId);
+                if (fsPackage != null){
+                    doctor =doctorMapper.selectPackageFsDoctorType2Ids(fsPackage.getProductType());
+                }
+                if (doctor != null) {
+                    doctorId = doctor.getDoctorId();
+                }
+            }
+
+        }
+        return doctorId;
     }
+
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/vo/FsUserInformationCollectionAndPatientVO.java

@@ -13,6 +13,8 @@ import java.util.List;
 @Data
 public class FsUserInformationCollectionAndPatientVO extends FsUserInformationCollection {
     private FsPatient patientInfo; //病人信息
+    private Integer isPay;
+    private Long storeOrderId;
 
 
 }

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

@@ -0,0 +1,98 @@
+baidu:
+  token: 12313231232
+  back-domain: https://www.xxxx.com
+#配置
+logging:
+  level:
+    org.springframework.web: INFO
+    com.github.binarywang.demo.wx.cp: DEBUG
+    me.chanjar.weixin: DEBUG
+wx:
+  miniapp:
+    configs:
+      - appid:
+        secret:
+        token:
+        aesKey:
+        msgDataFormat: JSON
+      - appid:
+        secret:
+        token:
+        aesKey: HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E
+        msgDataFormat: JSON
+  cp:
+    corpId:
+    appConfigs:
+      - agentId: 100005
+        secret: ec7okROXJqkNafq66aKNasTzQIG0CYrj3vyBbo
+        token: PPKOdAlMO
+        aesKey: PKvaxtpSvNGpfT7VUHIK8Wok2ESyYX24qpXJAdMP
+  pay:
+    appId:  #微信公众号或者小程序等的appid
+    mchId:  #微信支付商户号
+    mchKey:  #微信支付商户密钥
+    subAppId:  #服务商模式下的子商户公众账号ID
+    subMchId:  #服务商模式下的子商户号
+    keyPath: c:\\cert\\apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
+    notifyUrl: https://userapp.dyzkl.cn/app/wxpay/wxPayNotify
+  mp:
+    useRedis: false
+    redisConfig:
+      host: 127.0.0.1
+      port: 6379
+      timeout: 2000
+    configs:
+      - appId:  wxf468f88fbbb845af # 第一个公众号的appid
+        secret: 812d49175dadf579bdd4ad812867793a  # 公众号的appsecret
+        token: PPKOdAlCoMO # 接口配置里的Token值
+        aesKey: Eswa6VjwtVMCcw03qZy6fWllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值
+aifabu:  #爱链接
+  appKey: 7b471be905ab17ef358c0dd117601d008
+watch:
+  watchUrl: watch.ylrzcloud.com/prod-api
+#  account: tcloud
+#  password: mdf-m2h_6yw2$hq
+  account1: ccif #866655060138751
+  password1: cp-t5or_6xw7$mt
+  account2: tcloud #rt500台
+  password2: mdf-m2h_6yw2$hq
+  account3: whr
+  password3: v9xsKuqn_$d2y
+
+fs :
+  commonApi: http://172.16.16.7:7771
+  h5CommonApi: http://172.16.16.7:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb5
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
+nuonuo:
+  key: 10924508
+  secret: A2EB20764D304D16
+
+# 存储捅配置
+tencent_cloud_config:
+  secret_id: AKIDiMq9lDf2EOM9lIfqqfKo7FNgM5meD0sT
+  secret_key: u5SuS80342xzx8FRBukza9lVNHKNMSaB
+  bucket: gzzdy-1323137866
+  app_id: 1323137866
+  region: ap-chongqing
+  proxy: gzzdy
+cloud_host:
+  company_name: 广州郑多燕
+  projectCode: GZZDY
+#看课授权时显示的头像
+headerImg:
+  imgUrl:
+ipad:
+  ipadUrl: http://ipad.dyzkl.cn
+  aiApi: http://49.232.181.28:3000/api
+  voiceApi: http://123.207.48.104:8009
+  commonApi: http://123.207.48.104:7771
+wx_miniapp_temp:
+  pay_order_temp_id:
+  inquiry_temp_id:
+
+

+ 151 - 0
fs-service/src/main/resources/application-druid-gzzdy.yml

@@ -0,0 +1,151 @@
+# 数据源配置
+spring:
+  profiles:
+    include: common,config-druid-gzzdy
+  # redis 配置
+  redis:
+    # 地址
+    host: 172.16.16.17
+    # 端口,默认为6379
+    port: 6379
+    # 密码
+    password: Ylrz_tM8/oW6$pU9|t#&
+    # 连接超时时间
+    timeout: 30s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 100
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
+    database: 0
+  datasource:
+    mysql:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driverClassName: com.mysql.cj.jdbc.Driver
+      druid:
+        # 主库数据源
+        master:
+          url: jdbc:mysql://172.16.16.12:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+          username: root
+          password: ylrz14752131..!@YX
+        # 从库数据源
+        slave:
+          # 从数据源开关/默认关闭
+          enabled: false
+          url:
+          username:
+          password:
+        # 初始连接数
+        initialSize: 5
+        # 最小连接池数量
+        minIdle: 10
+        # 最大连接池数量
+        maxActive: 200
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        # 配置一个连接在池中最大生存的时间,单位是毫秒
+        maxEvictableIdleTimeMillis: 900000
+        # 配置检测连接是否有效
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        webStatFilter:
+          enabled: true
+        statViewServlet:
+          enabled: false
+          # 设置白名单,不填则允许所有访问
+          allow:
+          url-pattern: /druid/*
+          # 控制台管理用户名和密码
+          login-username: fs
+          login-password: 123456
+        filter:
+          stat:
+            enabled: true
+            # 慢SQL记录
+            log-slow-sql: true
+            slow-sql-millis: 1000
+            merge-sql: true
+          wall:
+            config:
+              multi-statement-allow: true
+    sop:
+      type: com.alibaba.druid.pool.DruidDataSource
+      driverClassName: com.mysql.cj.jdbc.Driver
+      druid:
+        # 主库数据源
+        master:
+#          url: jdbc:mysql://172.17.0.3:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+          url: jdbc:mysql://172.16.16.12:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+          username: root
+          password: ylrz14752131..!@YX
+        # 初始连接数
+        initialSize: 5
+        # 最小连接池数量
+        minIdle: 10
+        # 最大连接池数量
+        maxActive: 200
+        # 配置获取连接等待超时的时间
+        maxWait: 60000
+        # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+        timeBetweenEvictionRunsMillis: 60000
+        # 配置一个连接在池中最小生存的时间,单位是毫秒
+        minEvictableIdleTimeMillis: 300000
+        # 配置一个连接在池中最大生存的时间,单位是毫秒
+        maxEvictableIdleTimeMillis: 900000
+        # 配置检测连接是否有效
+        validationQuery: SELECT 1 FROM DUAL
+        testWhileIdle: true
+        testOnBorrow: false
+        testOnReturn: false
+        webStatFilter:
+          enabled: true
+        statViewServlet:
+          enabled: false
+          # 设置白名单,不填则允许所有访问
+          allow:
+          url-pattern: /druid/*
+          # 控制台管理用户名和密码
+          login-username: fs
+          login-password: 123456
+        filter:
+          stat:
+            enabled: true
+            # 慢SQL记录
+            log-slow-sql: true
+            slow-sql-millis: 1000
+            merge-sql: true
+          wall:
+            config:
+              multi-statement-allow: true
+rocketmq:
+  name-server: rmq-1vjak37re.rocketmq.gz.qcloud.tencenttdmq.com:8080 # RocketMQ NameServer 地址
+  producer:
+    group: course-finish-group
+    access-key: ak1vjak37reb7b19a2b09d1 # 替换为实际的 accessKey
+    secret-key: sk3987beb638e3414f # 替换为实际的 secretKey
+  consumer:
+    group: test-group
+    access-key: ak1vjak37reb7b19a2b09d1 # 替换为实际的 accessKey
+    secret-key: sk3987beb638e3414f # 替换为实际的 secretKey
+openIM:
+  secret: openIM123
+  userID: imAdmin
+  url:
+#是否使用新im
+im:
+  type: NONE
+#是否为新商户,新商户不走mpOpenId
+isNewWxMerchant: true
+
+enableRedPackAccount: 0

+ 27 - 7
fs-user-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

@@ -6,17 +6,22 @@ import com.fs.company.domain.CompanyUser;
 import com.fs.company.domain.CompanyUserUser;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.company.service.ICompanyUserUserService;
-import com.fs.his.domain.FsPatient;
-import com.fs.his.domain.FsUserInformationCollection;
+import com.fs.his.domain.*;
+import com.fs.his.mapper.FsStoreOrderMapper;
 import com.fs.his.param.CollectionInfoConfirmParam;
 import com.fs.his.param.FsUserInformationCollectionParam;
+import com.fs.his.service.IFsPackageOrderService;
 import com.fs.his.service.IFsPatientService;
+import com.fs.his.service.IFsStoreOrderService;
 import com.fs.his.service.IFsUserInformationCollectionService;
+import com.fs.his.service.impl.FsStoreOrderServiceImpl;
 import com.fs.his.vo.FsUserInformationCollectionAndPatientVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 
 /**
  * 用户信息采集Controller
@@ -34,7 +39,8 @@ public class FsUserInformationCollectionController extends AppBaseController
     private IFsPatientService fsPatientService;
     @Autowired
     private ICompanyUserService companyUserService;
-
+    @Autowired
+    private IFsPackageOrderService fsPackageOrderService;
 
 
     /**
@@ -60,16 +66,30 @@ public class FsUserInformationCollectionController extends AppBaseController
         CompanyUser companyUser = companyUserService.selectCompanyUserById(info.getCompanyUserId());
         info.setCompanyId(companyUser.getCompanyId());
         Long patientId = info.getPatientId();
+
+        FsUserInformationCollectionAndPatientVO vo = new FsUserInformationCollectionAndPatientVO();
+        BeanUtils.copyProperties(info, vo);
+
         if(patientId != null){
             FsPatient fsPatient = fsPatientService.selectFsPatientByPatientId(patientId);
             if (fsPatient != null){
-                FsUserInformationCollectionAndPatientVO vo = new FsUserInformationCollectionAndPatientVO();
-                BeanUtils.copyProperties(info, vo);
+
                 vo.setPatientInfo(fsPatient);
-                return R.ok().put("data", vo);
+                //查询是否支付
+                Integer isPay = 0;
+                Long packageOrderId = info.getPackageOrderId();
+                if (packageOrderId != null){
+                    FsPackageOrder order = fsPackageOrderService.selectFsPackageOrderByOrderId(packageOrderId);
+                    if (order != null && order.getStatus() > 1){
+                        isPay = 1;
+                        vo.setStoreOrderId(order.getStoreOrderId());
+                    }
+                }
+                vo.setIsPay(isPay);
             }
         }
-        return R.ok().put("data", info);
+
+        return R.ok().put("data", vo);
     }