|
|
@@ -348,20 +348,14 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
}
|
|
|
|
|
|
|
|
|
- //创建简化版采集信息(没有用户id)
|
|
|
+ //创建个微版采集信息(起始无绑定用户id)
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public FsUserInformationCollection createSimpleUserInfo(FsUserInformationCollectionParam param) {
|
|
|
+ //校验销售填写条件
|
|
|
checkSalesFillCondition(param);
|
|
|
- if (param.getIsPackage() != null && param.getIsPackage() == 1) {
|
|
|
- FsPackage fsPackage = packageMapper.selectFsPackageByPackageId(param.getPackageId());
|
|
|
- if (fsPackage != null && !(fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2 || fsPackage.getProductType() == 3)) {
|
|
|
- throw new CustomException("该套餐不支持用户信息采集");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//构建用户信息采集对象
|
|
|
- FsUserInformationCollection fsUserInformationCollection = buildUserInfoCollection(param);
|
|
|
+ FsUserInformationCollection fsUserInformationCollection = buildFastInfoCollection(param);
|
|
|
//添加个微标识
|
|
|
fsUserInformationCollection.setQwTag(1);
|
|
|
fsUserInformationCollection.setPersonalCollectStatus(PostPayPrescStatusEnum.INFO_COLLECTION.getCode());//个微采集表初始状态
|
|
|
@@ -373,10 +367,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
fsUserInformationCollection.setCompleteStatus(0);
|
|
|
}
|
|
|
baseMapper.insertFsUserInformationCollection(fsUserInformationCollection);
|
|
|
-
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("极速版-----用户信息采集进度创建失败", e);
|
|
|
- throw new CustomException("信息采集进度创建失败");
|
|
|
+ logger.error("个微版-----用户信息采集进度创建失败", e);
|
|
|
+ throw new CustomException("个微信息采集创建失败");
|
|
|
}
|
|
|
return fsUserInformationCollection;
|
|
|
}
|
|
|
@@ -395,7 +388,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return R.error("用户信息不匹配,无法确认");
|
|
|
}
|
|
|
|
|
|
- collection.setPersonalCollectStatus(PostPayPrescStatusEnum.FULLY_COLLECTED_DATA.getCode());
|
|
|
+ collection.setPersonalCollectStatus(PostPayPrescStatusEnum.PENDING_DOCTOR.getCode());
|
|
|
if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(collection) > 0) {
|
|
|
//新增fs_prescribe处方信息
|
|
|
FsPrescribe fsPrescribe = transformCollectionParamToFsPrescribe(param, collection);
|
|
|
@@ -1557,7 +1550,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
map.setUserId(param.getUserId());
|
|
|
map.setId(param.getCollectionId());
|
|
|
map.setQwTag(1);
|
|
|
- map.setPersonalCollectStatus(PostPayPrescStatusEnum.USER_BIND.getCode());//个微采集表完善采集表状态
|
|
|
+ map.setPersonalCollectStatus(PostPayPrescStatusEnum.GENERATE_OPEN_DATA.getCode());//个微信息采集完善状态
|
|
|
if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
|
|
|
//更新信息采集进度表里面的用户id
|
|
|
FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleRunningByCollectionId(param.getCollectionId());
|
|
|
@@ -1929,6 +1922,54 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
return shedule;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 辅助方法:组装极速版信息采集对象
|
|
|
+ * */
|
|
|
+ private FsUserInformationCollection buildFastInfoCollection(FsUserInformationCollectionParam param) {
|
|
|
+ FsUserInformationCollection fsUserInformationCollection = new FsUserInformationCollection();
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(param.getAnswers())) {
|
|
|
+ param.getAnswers().forEach(answer -> {
|
|
|
+ if (answer.getFlag() == null) {
|
|
|
+ answer.setFlag(false);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fsUserInformationCollection.setFillFlag(param.getFillFlag());
|
|
|
+ fsUserInformationCollection.setJsonInfo(JSON.toJSONString(param.getAnswers()));
|
|
|
+ fsUserInformationCollection.setUserId(param.getUserId());
|
|
|
+ fsUserInformationCollection.setCompanyUserId(param.getCompanyUserId());
|
|
|
+ fsUserInformationCollection.setQuestionId(param.getQuestionId());
|
|
|
+ fsUserInformationCollection.setId(param.getId());
|
|
|
+ fsUserInformationCollection.setUserName(param.getUserName());
|
|
|
+ fsUserInformationCollection.setUserPhoneFour(param.getUserPhoneFour());
|
|
|
+ fsUserInformationCollection.setSex(param.getSex());
|
|
|
+ fsUserInformationCollection.setAllergy(param.getAllergy());
|
|
|
+ fsUserInformationCollection.setRemark(param.getRemark());
|
|
|
+ fsUserInformationCollection.setAge(param.getAge());
|
|
|
+ fsUserInformationCollection.setCompanyId(param.getCompanyId());
|
|
|
+ fsUserInformationCollection.setCreateTime(DateUtils.getNowDate());
|
|
|
+
|
|
|
+ // 根据销售人员获取医生信息
|
|
|
+ CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getCompanyUserId());
|
|
|
+ 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 {
|
|
|
+ doctorId = iFsDoctorService.selectFsDoctorDoctorByPackage();
|
|
|
+ }
|
|
|
+ fsUserInformationCollection.setDoctorId(doctorId);
|
|
|
+
|
|
|
+ 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}]";
|