Kaynağa Gözat

小程序---1.获取信息采集信息新增是否填写,用户信息数据 2.信息采集绑定用户信息

wjj 1 hafta önce
ebeveyn
işleme
af77c7d231

+ 19 - 0
fs-service/src/main/java/com/fs/course/param/CollectionBindUserParam.java

@@ -0,0 +1,19 @@
+package com.fs.course.param;
+
+import lombok.Data;
+
+@Data
+public class CollectionBindUserParam {
+    /**
+     * 销售id
+     */
+    private Long companyUserId;
+    /**
+     * 用户id
+     */
+    private Long userId;
+    /**
+     * 信息采集id
+     */
+    private Long collectionId;
+}

+ 4 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserInfoCollectionUVO.java

@@ -77,4 +77,8 @@ public class FsUserInfoCollectionUVO {
     private String userName;
     //用户电话后四位
     private String userPhoneFour;
+    //是否绑定用户
+    private Long userId;
+    //是否填写
+    private Integer fillTag;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/domain/FsQuestionAndAnswer.java

@@ -25,5 +25,8 @@ public class FsQuestionAndAnswer extends BaseEntity{
     @Excel(name = "问答数据")
     private String jsonInfo;
 
+    /** 问答类型 1-信息采集 2-套餐包问答数据 */
+    private Integer type;
+
 
 }

+ 9 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsUserInformationCollectionService.java

@@ -3,6 +3,7 @@ package com.fs.hisStore.service;
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.common.core.domain.R;
+import com.fs.course.param.CollectionBindUserParam;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
@@ -136,4 +137,12 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
      * @return 用户信息采集集合
      */
     List<FsUserInformationCollectionOverviewVo> selectExportUserInfoCollectionList(FsUserInformationCollectionOverviewDTO queryDto);
+
+    /**
+     * 信息采集绑定用户信息
+     *
+     * @param param 绑定参数
+     * @return 是否绑定成功
+     */
+    R bindUser(CollectionBindUserParam param);
 }

+ 42 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -25,6 +25,7 @@ import com.fs.company.service.ICompanyService;
 import com.fs.core.config.WxMaConfiguration;
 import com.fs.core.config.WxPayProperties;
 import com.fs.core.utils.OrderCodeUtils;
+import com.fs.course.param.CollectionBindUserParam;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
 import com.fs.doctor.domain.DoctorMsg;
@@ -181,6 +182,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     @Autowired
     private IFsStoreOrderLogsService fsStoreOrderLogsService;
 
+    @Autowired
+    private IFsUserService userService;
+
 
 
     /**
@@ -620,6 +624,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
 
     @Override
     public FsUserInfoCollectionUVO info(Long id,Long userId) {
+        FsUserInformationCollection selectByUserId = fsUserInformationCollectionMapper.selectByUserId(userId);
+        if (selectByUserId != null) {
+            if (!selectByUserId.getId().equals(id)) {
+                throw new CustomException("已有信息采集信息!");
+            }
+        }
         FsUserInfoCollectionUVO vo = new FsUserInfoCollectionUVO();
         FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(id);
 
@@ -681,6 +691,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             vo.setSex(collection.getSex());
             vo.setUserPhoneFour(collection.getUserPhoneFour());
             vo.setUserName(collection.getUserName());
+            vo.setFillTag(collection.getFillFlag());
+            vo.setUserId(collection.getUserId());
         }
         return vo;
     }
@@ -1268,6 +1280,36 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
     }
 
+    @Override
+    public R bindUser(CollectionBindUserParam param) {
+        //TODO 是否判断销售后续再做
+//        if (param.getCompanyUserId() != null) {
+//            return R.error("");
+//        }
+        if (param.getUserId() == null) {
+            return R.error("用户参数错误");
+        }
+        FsUser fsUser = userService.selectFsUserByUserId(param.getUserId());
+        if (fsUser == null) {
+            return R.error("用户信息错误");
+        }
+        FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
+        if (collection == null) {
+            return R.error("未找到信息采集信息");
+        }
+        if (collection.getUserId() != null) {
+            return R.error("信息采集已绑定用户");
+        }
+
+        FsUserInformationCollection map = new FsUserInformationCollection();
+        map.setUserId(param.getUserId());
+        map.setId(param.getCollectionId());
+        if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
+            return R.ok();
+        }
+        return R.error("绑定失败");
+    }
+
     private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
         target.addAll(source);
         return target.stream()

+ 6 - 0
fs-user-app/src/main/java/com/fs/app/controller/UserInfoCollectionController.java

@@ -7,6 +7,7 @@ import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.company.mapper.CompanyUserRoleMapper;
+import com.fs.course.param.CollectionBindUserParam;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
 import com.fs.his.domain.FsUser;
@@ -66,6 +67,11 @@ public class UserInfoCollectionController extends AppBaseController {
         return userInformationCollectionService.userConfirm(param);
     }
 
+    @ApiOperation("绑定用户信息")
+    @PostMapping("/bindUser")
+    public R bindUser(@RequestBody CollectionBindUserParam param) {
+        return userInformationCollectionService.bindUser(param);
+    }
 
     /**
      * 获取用户信息采集详细信息