|
|
@@ -325,8 +325,68 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public String createSimpleUserInfo(FsUserInformationCollectionParam fsUserInformationCollection) {
|
|
|
- return "";
|
|
|
+ public Long createSimpleUserInfo(FsUserInformationCollectionParam param) {
|
|
|
+ if (param.getId() == null || param.getId() < 1) {
|
|
|
+ throw new CustomException("参数错误");
|
|
|
+ }
|
|
|
+ FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(param.getId());
|
|
|
+ if (collection == null) {
|
|
|
+ throw new CustomException("没有用户采集信息");
|
|
|
+ }
|
|
|
+ if (collection.getUserConfirm() == 1 && collection.getUserConfirm2() == 0) {
|
|
|
+ throw new CustomException("确认中,暂无法修改");
|
|
|
+ }
|
|
|
+ if (param.getIsPackage() == 1) {
|
|
|
+ FsPackage fsPackage = packageMapper.selectFsPackageByPackageId(param.getPackageId());
|
|
|
+ if (fsPackage != null && !(fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2 || fsPackage.getProductType() ==3)) {
|
|
|
+ throw new CustomException("该疗法不支持用户信息采集");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //编辑用户信息采集信息时,同时新增采集进度数据(先中止再新增)
|
|
|
+ //获取当前用户正在运行的信息采集进度
|
|
|
+ FsUserInformationCollectionSchedule schedule = scheduleMapper.selectCollectionScheduleRunningByCollectionId(collection.getId());
|
|
|
+ if (schedule != null){
|
|
|
+ log.info("用户信息采集进度未终止,进度id:{}",schedule.getId());
|
|
|
+ throw new CustomException("请先终止此用户信息的采集进度");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ FsUserInformationCollection condition = getFsUserInformationCollection(param);
|
|
|
+ if (param.getIsPackage() != null&& param.getIsPackage() == 1){
|
|
|
+ condition.setPackageId(param.getPackageId());
|
|
|
+ }
|
|
|
+
|
|
|
+ FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule = assembleCreateSchedule(condition);
|
|
|
+ fsUserInformationCollectionSchedule.setCompanyUserId(param.getCompanyUserId());
|
|
|
+ scheduleMapper.insertFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
|
|
|
+ log.info("编辑用户信息采集信息重新新增进度数据,信息采集数据id:{}",fsUserInformationCollectionSchedule.getCollectionId());
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("新增用户信息采集进度数据失败",e);
|
|
|
+ throw new CustomException("新增用户信息采集进度数据失败");
|
|
|
+ }
|
|
|
+ //清空订单号
|
|
|
+ fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getId());
|
|
|
+ FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
|
|
|
+ fsUserInformationCollection.setUserConfirm2(0);
|
|
|
+ fsUserInformationCollection.setUserConfirm(0);
|
|
|
+ fsUserInformationCollection.setDoctorConfirm(0);
|
|
|
+ fsUserInformationCollection.setStatus(1);
|
|
|
+ fsUserInformationCollection.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ fsUserInformationCollection.setRemark(param.getRemark());
|
|
|
+ fsUserInformationCollection.setSex(param.getSex());
|
|
|
+ fsUserInformationCollection.setIsPackage(param.getIsPackage());
|
|
|
+ fsUserInformationCollection.setUserName(param.getUserName());
|
|
|
+ if (param.getIsPackage() != null && param.getIsPackage() == 1){
|
|
|
+ fsUserInformationCollection.setPackageId(param.getPackageId());
|
|
|
+ }
|
|
|
+
|
|
|
+ fsUserInformationCollection.setUserPhoneFour(param.getUserPhoneFour());
|
|
|
+ fsUserInformationCollection.setAllergy(param.getAllergy());
|
|
|
+ fsUserInformationCollection.setPayType(param.getPayType());
|
|
|
+ fsUserInformationCollection.setQuestionId(param.getQuestionId());
|
|
|
+ fsUserInformationCollection.setAmount(param.getAmount());
|
|
|
+ fsUserInformationCollection.setAge(param.getAge());
|
|
|
+ baseMapper.updateFsUserInformationCollection(fsUserInformationCollection);
|
|
|
+ return fsUserInformationCollection.getId();
|
|
|
}
|
|
|
|
|
|
/**
|