|
|
@@ -2,21 +2,37 @@ package com.fs.company.controller.qw;
|
|
|
|
|
|
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
-import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
+import com.fs.company.mapper.CompanyUserRoleMapper;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
|
+import com.fs.his.domain.FsSopDoctorTask;
|
|
|
+import com.fs.his.domain.FsStoreOrder;
|
|
|
+import com.fs.his.dto.FsDoctorTaskDTO;
|
|
|
+import com.fs.his.dto.SopDoctorTaskDto;
|
|
|
+import com.fs.his.service.IFsSopDoctorTaskService;
|
|
|
+import com.fs.his.service.IFsStoreOrderService;
|
|
|
+import com.fs.his.vo.SopDoctorTaskVo;
|
|
|
+import com.fs.hisStore.service.IFsUserInformationCollectionService;
|
|
|
+import com.fs.hisStore.vo.FsUserInformationCollectionVO;
|
|
|
+import com.fs.qw.param.FsDoctorMemberSalesQueryParam;
|
|
|
import com.fs.qw.param.MemberSalesParam;
|
|
|
import com.fs.qw.service.IFsDoctorMemberSalesService;
|
|
|
+import com.fs.qw.vo.FsDoctorMemberSalesVO;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 医生会员搭销控制层
|
|
|
@@ -29,9 +45,24 @@ public class FsDoctorMemberSalesController extends BaseController {
|
|
|
@Autowired
|
|
|
private IFsDoctorMemberSalesService doctorMemberSalesService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFsSopDoctorTaskService fsSopDoctorTaskService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CompanyUserRoleMapper roleMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService fsStoreOrderService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService orderService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserInformationCollectionService userInfoCollectionService;
|
|
|
+
|
|
|
|
|
|
//@PreAuthorize("@ss.hasPermi('qw:memberSales:push')")
|
|
|
@PostMapping("/push")
|
|
|
@@ -43,4 +74,89 @@ public class FsDoctorMemberSalesController extends BaseController {
|
|
|
|
|
|
return doctorMemberSalesService.push(param);
|
|
|
}
|
|
|
+
|
|
|
+ //@PreAuthorize("@ss.hasPermi('qw:companyUserFollowUpMembers:list')")
|
|
|
+ @GetMapping("/companyUserFollowUpMembers")
|
|
|
+ public R selectCompanyUserMemberSalesVOList(FsDoctorMemberSalesQueryParam param){
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+ //管理员查看所有数据
|
|
|
+ Long isAdmin = roleMapper.companyUserIsAdmin(param.getCompanyUserId());
|
|
|
+ if (isAdmin != null) {
|
|
|
+ param.setCompanyUserId(null);
|
|
|
+ }
|
|
|
+ PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
+ List<FsDoctorMemberSalesVO> voList = doctorMemberSalesService.selectFsDoctorMemberSalesVOList(param);
|
|
|
+ PageInfo<FsDoctorMemberSalesVO> listPageInfo=new PageInfo<>(voList);
|
|
|
+ return R.ok().put("data", listPageInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询跟进会员任务处理记录
|
|
|
+ * @param queryDto 医生处理任务
|
|
|
+ * @return 医生处理sop任务集合
|
|
|
+ * */
|
|
|
+ @GetMapping("/selectCompanyUserTaskVoListHandleRecords")
|
|
|
+ public TableDataInfo selectCompanyUserTaskVoListHandleRecords(SopDoctorTaskDto queryDto)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<SopDoctorTaskVo> list = fsSopDoctorTaskService.selectFsSopDoctorTaskVoListHandleRecords(queryDto);
|
|
|
+ return getDataTable(list);
|
|
|
+
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 查询用户历史订单列表
|
|
|
+ * */
|
|
|
+ @GetMapping("/storeOrder/userHistoryOrderList")
|
|
|
+ public TableDataInfo userHistoryOrderList(FsStoreOrder fsStoreOrder)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ fsStoreOrder.setCompanyUserId(fsStoreOrder.getCompanyUserId());
|
|
|
+ List<FsStoreOrder> list = fsStoreOrderService.selectFsStoreOrderList(fsStoreOrder);
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
+ return getDataTable(Collections.emptyList());
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+
|
|
|
+ }
|
|
|
+ @GetMapping("/taskList")
|
|
|
+ public R selectFsDoctorMemberSalesVOList(FsSopDoctorTask param){
|
|
|
+ startPage();
|
|
|
+ List<FsSopDoctorTask> taskList = fsSopDoctorTaskService.selectFsSopDoctorTaskList(param);
|
|
|
+ PageInfo<FsSopDoctorTask> listPageInfo=new PageInfo<>(taskList);
|
|
|
+ return R.ok().put("data", listPageInfo);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 提交跟进会员任务
|
|
|
+ * */
|
|
|
+ @PutMapping("/submitCompanyTask")
|
|
|
+ public R submitDoctorTask(@RequestBody FsDoctorTaskDTO addTaskDto){
|
|
|
+ //当前登录销售id
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ addTaskDto.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+ addTaskDto.setHandlePersonType(2);//2:销售人员处理
|
|
|
+ int update = fsSopDoctorTaskService.submitDoctorTask(addTaskDto);
|
|
|
+ if (update>0){
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ return R.error("提交失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取用户未签收的订单数据")
|
|
|
+ @GetMapping("/getNoReceiveOrderList/{userId}")
|
|
|
+ public R getNoReceiveOrderList(@PathVariable("userId") Long userId) {
|
|
|
+ if(userId==null||userId==0){
|
|
|
+ return R.error("用户id错误");
|
|
|
+ }
|
|
|
+ List<FsStoreOrder> noReceiveOrderList = orderService.selectNoReceiveOrderList(userId);
|
|
|
+ return R.ok().put("data",noReceiveOrderList);
|
|
|
+ }
|
|
|
+
|
|
|
+ //用户采集信息详情
|
|
|
+ @GetMapping("/getCollectionByUserId/{userId}")
|
|
|
+ public R getCollectionByUserId(@PathVariable("userId") Long userId){
|
|
|
+ FsUserInformationCollectionVO detail = userInfoCollectionService.getCollectionByUserId(userId);
|
|
|
+ return R.ok().put("data", detail);
|
|
|
+ }
|
|
|
}
|