|
|
@@ -0,0 +1,214 @@
|
|
|
+package com.fs.company.controller;
|
|
|
+
|
|
|
+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.his.domain.FsUser;
|
|
|
+import com.fs.his.domain.FsUserAddress;
|
|
|
+import com.fs.his.dto.SopDoctorTaskDto;
|
|
|
+import com.fs.his.param.FsStoreOrderParam;
|
|
|
+import com.fs.his.param.FsUserCouponParam;
|
|
|
+import com.fs.his.service.*;
|
|
|
+import com.fs.his.vo.FsPatientVO;
|
|
|
+import com.fs.his.vo.FsStoreOrderListVO;
|
|
|
+import com.fs.his.vo.FsUserCouponListVO;
|
|
|
+import com.fs.his.vo.SopDoctorTaskVo;
|
|
|
+import com.fs.qw.dto.SopCompanyUserTaskDto;
|
|
|
+import com.fs.qw.service.IFsSopCompanyUserTaskService;
|
|
|
+import com.fs.qw.vo.SopCompanyUserTaskVo;
|
|
|
+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.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
|
|
|
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 销售、医生sop总览统计
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2021-03-22
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/sop/statistics")
|
|
|
+public class SopStatsOverviewController extends BaseController {
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsSopDoctorTaskService fsSopDoctorTaskService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsSopCompanyUserTaskService fsSopCompanyUserTaskService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsPatientService fsPatientService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserService fsUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsUserCouponService fsUserCouponService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService fsStoreOrderService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询医生处理sop任务列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sop:statistics:doctorStatsOverviewList')")
|
|
|
+ @GetMapping("/doctorStatsOverviewList")
|
|
|
+ public TableDataInfo doctorStatsOverviewList(SopDoctorTaskDto queryDto)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<SopDoctorTaskVo> list = fsSopDoctorTaskService.statsDoctorOverviewAllList(queryDto);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询销售处理sop任务列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('sop:statistics:companyStatsOverviewList')")
|
|
|
+ @GetMapping("/companyStatsOverviewList")
|
|
|
+ public TableDataInfo companyStatsOverviewList(SopCompanyUserTaskDto queryDto)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<SopCompanyUserTaskVo> list = fsSopCompanyUserTaskService.statsOverviewAllList(queryDto);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 销售端查询解密后的客户联系电话
|
|
|
+ * */
|
|
|
+ @GetMapping("/companyGetUserPhone/{id}")
|
|
|
+ public R companyGetUserPhone(@PathVariable("id") Long id){
|
|
|
+ SopCompanyUserTaskDto queryDto=new SopCompanyUserTaskDto();
|
|
|
+ queryDto.setId(id);
|
|
|
+ List<SopCompanyUserTaskVo> list = fsSopCompanyUserTaskService.statsOverviewAllList(queryDto);
|
|
|
+ if (CollectionUtils.isNotEmpty(list)&&list.size()==1){
|
|
|
+ String userPhone=list.get(0).getPhone();
|
|
|
+ if (userPhone!=null&&userPhone.length()>11){
|
|
|
+ userPhone=decryptPhone(userPhone);
|
|
|
+ }
|
|
|
+ return R.ok().put("userPhone",userPhone);
|
|
|
+ }
|
|
|
+ return R.ok().put("userPhone","");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 医生端查询解密后的客户联系电话
|
|
|
+ * */
|
|
|
+ @GetMapping("/doctorGetUserPhone/{id}")
|
|
|
+ public R doctorGetUserPhone(@PathVariable("id") Long id){
|
|
|
+ SopDoctorTaskDto queryDto=new SopDoctorTaskDto();
|
|
|
+ queryDto.setId(id);
|
|
|
+ List<SopDoctorTaskVo> list = fsSopDoctorTaskService.statsDoctorOverviewAllList(queryDto);
|
|
|
+ if (CollectionUtils.isNotEmpty(list)&&list.size()==1){
|
|
|
+ String userPhone=list.get(0).getPhone();
|
|
|
+ if (userPhone!=null&&userPhone.length()>11){
|
|
|
+ userPhone=decryptPhone(userPhone);
|
|
|
+ }
|
|
|
+ return R.ok().put("userPhone",userPhone);
|
|
|
+ }
|
|
|
+ return R.ok().put("userPhone","");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户信息信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/getPatient/{userId}")
|
|
|
+ public AjaxResult getPatient(@PathVariable("userId") Long userId)
|
|
|
+ {
|
|
|
+ List<FsPatientVO> fsPatientVOS = fsPatientService.selectFsPatientByUserId(userId);
|
|
|
+ for (FsPatientVO fsPatientVO: fsPatientVOS) {
|
|
|
+ if (fsPatientVO.getPhone()!=null){
|
|
|
+ fsPatientVO.setPhone(fsPatientVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return AjaxResult.success(fsPatientVOS);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/userInfo/{userId}")
|
|
|
+ public AjaxResult getUserInfo(@PathVariable("userId") Long userId)
|
|
|
+ {
|
|
|
+ FsUser fsUser = fsUserService.selectFsUserByUserId(userId);
|
|
|
+ fsUser.setPhone(decryptAutoPhoneMk(fsUser.getPhone()));
|
|
|
+ return AjaxResult.success(fsUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户详细信息
|
|
|
+ */
|
|
|
+
|
|
|
+ @GetMapping(value = "/getUserAddr/{userId}")
|
|
|
+ public AjaxResult getUserAddr(@PathVariable("userId") Long userId)
|
|
|
+ {
|
|
|
+ List<FsUserAddress> fsUserAddresses = fsUserService.selectFsUserAddressByUserId(userId);
|
|
|
+ for (FsUserAddress fsUserAddress : fsUserAddresses) {
|
|
|
+ fsUserAddress.setPhone(decryptAutoPhoneMk(fsUserAddress.getPhone()));
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/userCoupon/getList")
|
|
|
+ public TableDataInfo getList(FsUserCouponParam fsUserCoupon)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<FsUserCouponListVO> list = fsUserCouponService.selectFsUserCouponListVO(fsUserCoupon);
|
|
|
+ for (FsUserCouponListVO fsUserCouponListVO : list) {
|
|
|
+ if (fsUserCouponListVO.getPhone()!=null){
|
|
|
+ fsUserCouponListVO.setPhone(fsUserCouponListVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询病人列表
|
|
|
+ */
|
|
|
+ @GetMapping("/patient/list")
|
|
|
+ public TableDataInfo list(FsPatientVO fsPatient)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<FsPatientVO> list = fsPatientService.selectFsPatientListVO(fsPatient);
|
|
|
+ for (FsPatientVO fsPatientVO : list) {
|
|
|
+ if (fsPatientVO.getPhone()!=null){
|
|
|
+ fsPatientVO.setPhone(fsPatientVO.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+ if (fsPatientVO.getIdCard()!=null){
|
|
|
+ fsPatientVO.setIdCard(fsPatientVO.getIdCard().replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1**********$2"));
|
|
|
+ }
|
|
|
+ if (fsPatientVO.getMobile()!=null){
|
|
|
+ fsPatientVO.setMobile(fsPatientVO.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+ @GetMapping("/storeOrder/userOrderList")
|
|
|
+ public TableDataInfo userOrderList(FsStoreOrderParam fsStoreOrder)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ fsStoreOrder.setCompanyUserId(fsStoreOrder.getCompanyUserId());
|
|
|
+ List<FsStoreOrderListVO> list = fsStoreOrderService.selectFsStoreOrderListVO(fsStoreOrder);
|
|
|
+ if (CollectionUtils.isEmpty(list)){
|
|
|
+ return getDataTable(Collections.emptyList());
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|