Sfoglia il codice sorgente

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

# Conflicts:
#	patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java
#	patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
#	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
#	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/synergy/SynergyManageController.java
wangzhinan 6 anni fa
parent
commit
a525f4ee7a

+ 92 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java

@ -2,6 +2,8 @@ package com.yihu.wlyy.controller.synergy.customer;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.call.CallRecord;
import com.yihu.wlyy.repository.call.CallRecordDao;
import com.yihu.wlyy.service.manager.user.UserService;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import io.swagger.annotations.Api;
@ -10,6 +12,10 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -22,14 +28,21 @@ import java.util.Map;
 * Created by 刘文彬 on 2018/9/27.
 */
@RestController
@RequestMapping(value = "/customer/synergy",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/synergy/customer", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "集美客服系统")
public class CustomerSynergyManageController extends BaseController {
    public static final String CALL_LABEL="CALL_LABEL";
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private UserService userService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private CallRecordDao callRecordDao;
    @RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务工单信息")
    public String getWorkOrderInfo(@ApiParam(name="workorderCode",value="协同服务工单code")
@ -39,11 +52,10 @@ public class CustomerSynergyManageController extends BaseController {
                                @ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
                                @RequestParam(required = true)Integer role){
        try {
            return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
            return write(200,"请求成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
            return error(-1,"请求失败");
        }
    }
@ -103,15 +115,15 @@ public class CustomerSynergyManageController extends BaseController {
                                @ApiParam(name = "isAcceptTask", value = "1、我接收到的任务,2、我派发的任务,3、待接收(客服管理员),4、已接收(客服管理员)", required = true)
                                @RequestParam(value = "isAcceptTask", required = true)Integer isAcceptTask,
                                @ApiParam(name = "page", value = "第几页,从1开始", required = true)
                                @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                                @ApiParam(name = "pageSize", value = "每页分页大小", required = true)
                                @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
                                @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            List<Map<String,Object>> result = synergyManageService.workorderList(userCode,keywords,workorderType,isMyTask,status,priority,timeout,workorderCode,
                    principal,serviceStartTime,serviceEndTime,patientName,ssc,idcard,userType,isAcceptTask);
            Map<String,Object> result = synergyManageService.workorderList(userCode,keywords,workorderType,isMyTask,status,priority,timeout,workorderCode,
                    principal,serviceStartTime,serviceEndTime,patientName,ssc,idcard,userType,isAcceptTask,page,pageSize);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -183,4 +195,76 @@ public class CustomerSynergyManageController extends BaseController {
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "getCallLabelList",method = RequestMethod.GET)
    @ApiOperation(value = "显示所有通话标签")
    public String getCallLabelList(){
        try{
            String sql ="SELECT `code`,`value`,sort FROM system_dict WHERE dict_name='"+CALL_LABEL+"'";
            return write(200,"查询成功!","data",jdbcTemplate.queryForList(sql));
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "saveCallLabel",method = RequestMethod.POST)
    @ApiOperation(value = "保存所有通话标签")
    public String saveCallLabel(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode,
                                @ApiParam(name="callLabels",value="通话标签,多个用逗号隔开")@RequestParam(required = false)String callLabels){
        try{
            String sql ="UPDATE manage_call_record SET call_label='"+callLabels+"' WHERE `code`='"+callCode+"'";
            jdbcTemplate.update(sql);
            return write(200,"保存成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"保存失败!");
        }
    }
    @RequestMapping(value = "getCallInfo",method = RequestMethod.GET)
    @ApiOperation(value = "获取通话的详情")
    public String getCallTypeAndContent(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode){
        try{
            CallRecord callRecord = callRecordDao.findByCode(callCode);
            return write(200,"查询成功!","data",callCode);
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "saveCallInfo",method = RequestMethod.POST)
    @ApiOperation(value = "显示所有通话标签")
    public String saveCallInfo(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode,
                                @ApiParam(name="serviceType",value="服务类型,多个用逗号隔开")@RequestParam(required = false)String serviceType,
                               @ApiParam(name="serviceContent",value="服务记录")@RequestParam(required = false)String serviceContent){
        try{
            String sql ="UPDATE manage_call_record SET service_type='"+serviceType+"',service_content='"+serviceContent+"' WHERE `code`='"+callCode+"'";
            jdbcTemplate.update(sql);
            return write(200,"保存成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"保存失败!");
        }
    }
    @RequestMapping(value = "/taskSubmit", method = RequestMethod.POST)
    @ApiOperation(value = "协同任务提交")
    public String taskSubmit(@ApiParam(name="workorderCode",value="协同服务工单code",required = true)
                             @RequestParam(required = true)String workorderCode,
                             @ApiParam(name="dealResultRemark",value="说明",required = true)
                             @RequestParam(required = true)String dealResultRemark,
                             @ApiParam(name="dealResultAccessory",value="附件路径(多个用逗号隔开)",required = true)
                             @RequestParam(required = true)String dealResultAccessory){
        try{
            synergyManageService.taskSubmit(workorderCode,dealResultRemark,dealResultAccessory);
            return write(200,"提交成功");
        }catch (Exception e){
            error(e);
            return error(-1,"提交失败");
        }
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorSynergyManageController.java

@ -24,7 +24,7 @@ import java.util.Map;
 * Created by 刘文彬 on 2018/9/27.
 */
@Controller
@RequestMapping(value = "/doctor/synergy")
@RequestMapping(value = "/synergy/doctor")
@Api(description = "医生端-协同服务")
public class DoctorSynergyManageController extends BaseController {

+ 3 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/filter/SessionOutTimeFilter.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.filter;
import io.vavr.match.annotation.Patterns;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
@ -9,6 +10,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.regex.Pattern;
/**
 * @author lincl
@ -30,7 +32,7 @@ public class SessionOutTimeFilter extends OncePerRequestFilter {
                || path.indexOf(httpServletRequest.getContextPath() + "/static") != -1
                || path.indexOf("swagger") != -1
                || path.indexOf(httpServletRequest.getContextPath() + "/v2/api-docs") != -1
                || path.indexOf("/synergy") != -1) {
                || path.indexOf("/synergy/doctor") != -1) {
            filterChain.doFilter(httpServletRequest, httpServletResponse);
            return;
        }

+ 4 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerLogDao.java

@ -10,5 +10,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
public interface ManageSynergyWorkorderServicerLogDao extends PagingAndSortingRepository<ManageSynergyWorkorderServicerLogDO, Long> {
    @Query("select count(distinct l.servicePatientCode) from ManageSynergyWorkorderServicerLogDO l where l.workorderCode=?1 and l.followUp=2 ")
    Integer findByWorkorderCode(String workorderCode);
    Integer findByWorkorderCodeAndFollowUp(String workorderCode);
    @Query("select count(distinct l.servicePatientCode) from ManageSynergyWorkorderServicerLogDO l where l.workorderCode=?1 and l.returnVisit=2 ")
    Integer findByWorkorderCodeAndReturnVisit(String workorderCode);
}

+ 30 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -88,17 +88,18 @@ public class SynergyManageService extends BaseJpaService {
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> workorderList(String code,String keywords,Integer workorderType,
    public Map<String,Object> workorderList(String code,String keywords,Integer workorderType,
                               Integer isMyTask,Integer status,Integer priority,Integer timeout,String workorderCode,
                               String principal,String serviceStartTime,String serviceEndTime,
                               String patientName,String ssc,String idcard,Integer userType,Integer isAcceptTask) throws Exception{
                               String patientName,String ssc,String idcard,Integer userType,Integer isAcceptTask,Integer page, Integer pageSize) throws Exception{
        String servicerTable = "";
        String servicerTable = " left join wlyy.manage_synergy_workorder_executor e on e.workorder_code=w.code AND e.del = 1  " ;
        String whereSql = "";
        if(userType==3){//客服管理员
            whereSql +=" and w.create_user_type=1 ";//创建人为医生
            if(isAcceptTask==3){//待接收
                whereSql +=" and w.status =1 ";
                servicerTable ="";
            }else if(isAcceptTask==4){//已接收
                whereSql +=" and w.status in (2,3) ";
            }
@ -175,10 +176,16 @@ public class SynergyManageService extends BaseJpaService {
            whereSql+=" s.idcard like '%"+keywords+"%' ";
        }
        String sql =" select DISTINCT w.* from wlyy.manage_synergy_workorder w  " +servicerTable+
                " left join wlyy.vmanage_synergy_workorder_executor e on e.workorder_code=w.code " +
                " where w.status in (2,3) and w.del=1  " +
                " and e.del=1 "+whereSql+ " order by w.priority desc,w.service_time desc";
        List<Map<String,Object>> resultWorkorderList = jdbcTemplate.queryForList(sql);
                " where w.del=1  " +
                " and 1=1 "+whereSql+ " order by w.priority desc,w.service_time desc";
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        int count = 0;
        if(rstotal!=null&&rstotal.size()>0&&rstotal.get(0).get("id")!=null){
            count = rstotal.size();
        }
        String finalSql = sql+" LIMIT "+(page-1)*pageSize+","+pageSize;
        List<Map<String,Object>> resultWorkorderList = jdbcTemplate.queryForList(finalSql);
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(Map<String,Object> one : resultWorkorderList){
            Map<String,Object> map = new HashMap<>();
@ -221,7 +228,12 @@ public class SynergyManageService extends BaseJpaService {
            map.put("finishedServicerCount",finishedServicerCount);//服务完成人数
            resultList.add(map);
        }
        return resultList;
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("currPage",page);
        resultMap.put("pageSize",pageSize);
        resultMap.put("totalCount",count);
        resultMap.put("detailModelList",resultList);
        return resultMap;
    }
    /**
@ -805,4 +817,14 @@ public class SynergyManageService extends BaseJpaService {
        return response;
    }
    @Transactional
    public void taskSubmit(String workorderCode,String dealResultRemark,String dealResultAccessory) throws Exception{
        ManageSynergyWorkorderDO manageSynergyWorkorderDO = workOrderDao.findByCode(workorderCode);
        manageSynergyWorkorderDO.setDealResultRemark(dealResultRemark);
        manageSynergyWorkorderDO.setDealResultAccessory(dealResultAccessory);
        manageSynergyWorkorderDO.setStatus(3);
        workOrderDao.save(manageSynergyWorkorderDO);
    }
}

+ 30 - 29
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -1,32 +1,15 @@
package com.yihu.wlyy.service.synergy;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.followup.Followup;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.followup.FollowUpDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
 * Created by humingfen on 2018/10/9.
@ -36,18 +19,6 @@ import java.util.Set;
public class SynergyManageService extends BaseService {
    @Value("${customerService.url}")
    private String customerUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private FollowUpDao followUpDao;
    @Autowired
    private HospitalDao hospitalDao;
    public JSONObject getWorkOrderInfo(String workorderCode, String patient, Integer role) throws Exception {
        Map<String, Object> param = new HashedMap();
@ -139,4 +110,34 @@ public class SynergyManageService extends BaseService {
    }
    public JSONObject workorderList(String userCode,Integer workorderType,Integer status,String serviceStartTime,String serviceEndTime,Integer isAcceptTask,Integer page,Integer pageSize) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("userCode",userCode);
        param.put("workorderType",workorderType);
        param.put("status",status);
        param.put("serviceStartTime",serviceStartTime);
        param.put("serviceEndTime",serviceEndTime);
        param.put("isAcceptTask",isAcceptTask);
        param.put("page",page);
        param.put("pageSize",pageSize);
        HttpResponse response = HttpUtils.doGet(customerUrl + "/doctor/synergy/workorderList", param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            JSONObject json = result.getJSONObject("data");
            return json;
        }
        throw new Exception("请求客服系统服务失败!");
    }
    public void reminder(String userCode,String workorderCode) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("userCode",userCode);
        param.put("workorderCode",workorderCode);
        HttpResponse response = HttpUtils.doPost(customerUrl + "/doctor/synergy/reminder", param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求客服系统服务失败!");
        }
    }
}

+ 52 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/synergy/SynergyManageController.java

@ -1,14 +1,13 @@
package com.yihu.wlyy.web.doctor.synergy;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -19,6 +18,8 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.HashSet;
import java.util.Set;
import java.util.Map;
/**
 * Created by humingfen on 2018/10/9.
 */
@ -29,8 +30,6 @@ public class SynergyManageController extends BaseController {
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    @RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务工单信息")
@ -101,4 +100,52 @@ public class SynergyManageController extends BaseController {
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(), BaseResultModel.statusEm.opera_error.getMessage() + ":" + e.getMessage());
        }
    }
    @RequestMapping(value = "workorderList", method = RequestMethod.GET)
    @ApiOperation("医生端-协同服务列表")
    public String workorderList(@ApiParam(name = "userCode", value = "医生code", required = false)
                                @RequestParam(value = "userCode", required = false)String userCode,
                                @ApiParam(name = "workorderType", value = "服务类型(0、咨询,1、健康教育,2、预约,3、随访,4、问卷调查,5、疾病筛查)", required = false)
                                @RequestParam(value = "workorderType", required = false)Integer workorderType,
                                @ApiParam(name = "status", value = "工单状态(0、草稿,1、未接受,2、处理中,3、处理完成,4、退回)", required = false)
                                @RequestParam(value = "status", required = false)Integer status,
                                @ApiParam(name = "serviceStartTime", value = "服务开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                @RequestParam(value = "serviceStartTime", required = false)String serviceStartTime,
                                @ApiParam(name = "serviceEndTime", value = "服务结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = false)
                                @RequestParam(value = "serviceEndTime", required = false)String serviceEndTime,
                                @ApiParam(name = "isAcceptTask", value = "1、我接收到的任务,2、我派发的任务", required = true)
                                @RequestParam(value = "isAcceptTask", required = true)Integer isAcceptTask,
                                @ApiParam(name = "page", value = "第几页,从1开始", required = false)
                                @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                                @ApiParam(name = "pageSize", value = "每页分页大小", required = false)
                                @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
        try {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            JSONObject result = synergyManageService.workorderList(userCode,workorderType,status,serviceStartTime,serviceEndTime,isAcceptTask,page,pageSize);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "reminder", method = RequestMethod.POST)
    @ApiOperation("医生端-催单")
    public String reminder(@ApiParam(name = "userCode", value = "医生code", required = false)
                           @RequestParam(value = "userCode", required = false)String userCode,
                           @ApiParam(name = "workorderCode", value = "协同服务工单code", required = true)
                           @RequestParam(value = "workorderCode", required = true)String workorderCode){
        try {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            synergyManageService.reminder(userCode,workorderCode);
            return write(200, "请求成功");
        }catch (Exception e){
            error(e);
            return error(-1, "请求失败");
        }
    }
}