|
@@ -14,8 +14,11 @@ import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
|
|
+import com.fs.company.domain.CompanyUserUser;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
|
|
+import com.fs.company.mapper.CompanyUserUserMapper;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
import com.fs.company.service.ICompanyService;
|
|
|
|
|
+import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
import com.fs.core.config.WxMaConfiguration;
|
|
|
import com.fs.core.config.WxPayProperties;
|
|
import com.fs.core.config.WxPayProperties;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
@@ -149,6 +152,11 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
private IFsInquiryOrderService fsInquiryOrderService;
|
|
private IFsInquiryOrderService fsInquiryOrderService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private OpenIMService openIMService;
|
|
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) {
|
|
if (collection.getUserConfirm() == 1 && collection.getUserConfirm2() == 0) {
|
|
|
throw new CustomException("确认中,暂无法修改");
|
|
throw new CustomException("确认中,暂无法修改");
|
|
|
}
|
|
}
|
|
|
|
|
+ param.setDoctorId(collection.getDoctorId());
|
|
|
|
|
+ param.setDoctorType2Id(collection.getDoctorType2Id());
|
|
|
|
|
+ param.setPackageId(collection.getPackageId());
|
|
|
FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
|
|
FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
|
|
|
fsUserInformationCollection.setUpdateTime(DateUtils.getNowDate());
|
|
fsUserInformationCollection.setUpdateTime(DateUtils.getNowDate());
|
|
|
baseMapper.updateFsUserInformationCollection(fsUserInformationCollection);
|
|
baseMapper.updateFsUserInformationCollection(fsUserInformationCollection);
|
|
@@ -246,6 +257,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
}
|
|
}
|
|
|
//清空订单号
|
|
//清空订单号
|
|
|
fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getId());
|
|
fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getId());
|
|
|
|
|
+ param.setDoctorId(collection.getDoctorId());
|
|
|
|
|
+ param.setDoctorType2Id(collection.getDoctorType2Id());
|
|
|
|
|
+ param.setPackageId(collection.getPackageId());
|
|
|
FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
|
|
FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
|
|
|
fsUserInformationCollection.setUserConfirm2(0);
|
|
fsUserInformationCollection.setUserConfirm2(0);
|
|
|
fsUserInformationCollection.setUserConfirm(0);
|
|
fsUserInformationCollection.setUserConfirm(0);
|
|
@@ -674,6 +688,20 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
if (!Objects.equals(collection.getUserId(), param.getUserId())) {
|
|
if (!Objects.equals(collection.getUserId(), param.getUserId())) {
|
|
|
return R.error("用户信息不匹配,无法确认");
|
|
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();
|
|
FsUserInformationCollection map = new FsUserInformationCollection();
|
|
|
map.setId(param.getId());
|
|
map.setId(param.getId());
|
|
|
map.setUserConfirm(1);
|
|
map.setUserConfirm(1);
|
|
@@ -982,37 +1010,43 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
if (companyUser == null) {
|
|
if (companyUser == null) {
|
|
|
throw new CustomException("销售不存在");
|
|
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;
|
|
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;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|