Kaynağa Gözat

通话记录详情

zd_123 6 yıl önce
ebeveyn
işleme
c548d145d0

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

@ -91,22 +91,13 @@ public class CustomerSynergyManageController extends BaseController {
    }
    @RequestMapping(value = "/unitLabels", method = RequestMethod.GET)
    @ApiOperation("获取所属社区")
    public String unitLabels(@ApiParam(name = "currentRoleCode", value = "选择的区县", required = false)
                             @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode) {
    @ApiOperation("根据地区查找卫计委下属单位标签")
    public String unitLabels(@ApiParam(name = "currentRoleCode", value = "地点对应的code")
                             @RequestParam(value = "currentRoleCode", required = true) String currentRoleCode,
                             @ApiParam(name = "currentRoleLevel", value = "1省2城市3区县", required = false)
                             @RequestParam(value = "currentRoleLevel", required = true) String currentRoleLevel) {
        try {
            return write(200,"获取成功", "data", synergyManageService.getUnitLabels(currentRoleCode));
        } catch (Exception e) {
            error(e);
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "/towns", method = RequestMethod.GET)
    @ApiOperation("获取所属区县")
    public String towns() {
        try {
            return write(200,"获取成功", "data", synergyManageService.getTowns());
            return write(200,"获取成功", "data", synergyManageService.getUnitLabels(currentRoleCode, currentRoleLevel));
        } catch (Exception e) {
            error(e);
            return error(-1,"获取失败");
@ -287,18 +278,6 @@ public class CustomerSynergyManageController extends BaseController {
        }
    }
    @RequestMapping(value = "getDealList",method = RequestMethod.GET)
    @ApiOperation(value = "通话详情获取待办事项")
    public String getDealList(@ApiParam(name="idcard",value="居民身份证")@RequestParam(value ="idcard")String idcard){
        try{
            return write(200,"获取成功!","data",synergyManageService.getDealList(idcard));
        }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)

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

@ -496,6 +496,8 @@ public class SynergyManageService extends BaseJpaService {
            workorderDO.setReturnedRemark(jsonObject.getString("returnedRemark"));
            this.sendMessage(workorderDO, null, 26);
        }else if(status == 2){
            //设置接收时间
            workorderDO.setReceiverTime(new Date());
            //创建负责人信息
            List<ManageSynergyWorkorderExecutorDO> list = new ArrayList<>();
            String manager = jsonObject.getString("manager");
@ -515,17 +517,19 @@ public class SynergyManageService extends BaseJpaService {
            //保存协作者信息
            String collaborator = jsonObject.getString("collaborator");
            String[] collaborators = manager.split(",");
            for(String c : collaborators){
                ManageSynergyWorkorderExecutorDO executorDO = new ManageSynergyWorkorderExecutorDO();
                User u = userDao.findByCode(c);
                executorDO.setCode(getCode());
                executorDO.setWorkorderCode(code);
                executorDO.setExecutorType(1);
                executorDO.setExecutorCode(c);
                executorDO.setExecutorName(u.getName());
                executorDO.setDel(1);
                list.add(executorDO);
            if(StringUtils.isNotBlank(collaborator)) {
                String[] collaborators = collaborator.split(",");
                for (String c : collaborators) {
                    ManageSynergyWorkorderExecutorDO executorDO = new ManageSynergyWorkorderExecutorDO();
                    User u = userDao.findByCode(c);
                    executorDO.setCode(getCode());
                    executorDO.setWorkorderCode(code);
                    executorDO.setExecutorType(2);
                    executorDO.setExecutorCode(c);
                    executorDO.setExecutorName(u.getName());
                    executorDO.setDel(1);
                    list.add(executorDO);
                }
            }
            workorderExecutorDao.save(list);
        }
@ -1041,37 +1045,4 @@ public class SynergyManageService extends BaseJpaService {
        }
        ws.addCell(label);
    }
    public List<Map<String,Object>> getDealList(String idcard){
        Patient patient = patientDao.findByIdcard(idcard);
        if (patient==null){
            return null;
        }
        String sql ="SELECT" +
                " s.create_time," +
                " s.service_patient_name," +
                " w.priority," +
                " w.relation_code," +
                " w.relation_code_name," +
                " w.create_user_type," +
                " w.create_user_name," +
                " w.create_user," +
                " w.remark," +
                " w.service_time" +
                " FROM" +
                " `manage_synergy_workorder_servicer` s" +
                " LEFT JOIN manage_synergy_workorder w ON s.workorder_code = w.`code`" +
                " WHERE" +
                " s.service_patient_code = '"+patient.getCode()+"'" +
                " AND s.`status` = 1" +
                " ORDER BY" +
                " s.create_time" +
                " LIMIT 2";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String,Object> map : list){
            int isOver = isServiceOverTime(DateUtil.strToDate(String.valueOf(map.get("service_time")),DateUtil.YYYY_MM_DD_HH_MM_SS));
            map.put("isOver",isOver);
        }
        return list;
    }
}

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -60,9 +60,9 @@ spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    device:
      url: jdbc:mysql://172.19.103.77/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root

+ 0 - 172
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -1,172 +0,0 @@
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.
 */
@Service
@Transactional
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();
        param.put("workorderCode", workorderCode);
        param.put("patient", patient);
        param.put("role", role);
        HttpResponse response = null;
        response = HttpUtils.doPost(customerUrl + "synergy/customer/getWorkOrderInfo", param);
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
    }
    public String createWorkorder(String doctor, Set<String> patientSet, Integer type, String objectId, String serviceDate, Integer priority, String remark, String followupClass, String followupType){
        String response = null;
        JSONArray array = new JSONArray();
        String patientCode1 = null;
        Doctor doctor1 = doctorDao.findByCode(doctor);
        for (String patientCode:patientSet){
            if (patientSet.size() == 1){
                patientCode1 = patientCode;
            }
            Patient patient = patientDao.findByCode(patientCode);
            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
            object.put("servicePatientCode",patient.getCode());
            object.put("servicePatientName",patient.getName());
            object.put("ssc",patient.getSsc());
            object.put("idcard",patient.getIdcard());
            object.put("mobile",patient.getMobile());
            object.put("hospital",doctor1.getHospital());
            object.put("hospitalName",doctor1.getHospitalName());
            Hospital hospital = hospitalDao.findByCode(doctor1.getHospital());
            object.put("town", hospital.getTown());
            object.put("townName",hospital.getTownName());
            array.add(object);
        }
        com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
        object.put("type",type);
        object.put("serviceTime",serviceDate);
        object.put("priority",priority);
        object.put("createUser",doctor1.getCode());
        object.put("createUserName",doctor1.getName());
        object.put("hospital",doctor1.getHospital());
        object.put("hospitalName",doctor1.getHospitalName());
        object.put("createUserType",1);
        object.put("remark",remark);
        if (type == 3){
            Followup followup = new Followup();
            followup.setDoctorCode(doctor1.getCode());
            followup.setDoctorName(doctor1.getName());
            if (patientCode1 != null){
                Patient patient1 = patientDao.findByCode(patientCode1);
                followup.setPatientCode(patient1.getCode());
                followup.setPatientName(patient1.getName());
                followup.setIdcard(patient1.getIdcard());
                SignFamily signFamily = signFamilyDao.findByPatient(patientCode1);
                followup.setAdminTeamCode(signFamily.getAdminTeamId());
                followup.setSignType(Integer.parseInt(signFamily.getSignType()));
                followup.setSignCode(signFamily.getCode());
            }
            followup.setFollowupDate(DateUtil.strToDate(serviceDate));
            followup.setFollowupType(followupType);
            followup.setFollowupClass(followupClass);
            followup.setOrgCode(doctor1.getHospital());
            followup.setOrgName(doctor1.getHospitalName());
            followup.setDataFrom("2");
            followup.setStatus("2");
            followup.setCreater(doctor1.getCode());
            followup.setCreateTime(new Date());
            followup = followUpDao.save(followup);
            object.put("relationCode",followup.getId());
            object.put("relationCodeName","随访");
        }else if (type == 1){
            object.put("relationCode",objectId);
            object.put("relationCodeName","健康教育");
        }else if (type == 5){
            object.put("relationCode",objectId);
            object.put("relationCodeName","疾病筛查");
        }
        String url = customerUrl + "followup/saveFollowupProjectData";
        Map<String, String> params = new HashMap<>();
        params.put("servicers",array.toJSONString());
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
    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 + "/synergy/doctor/reminder", param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求客服系统服务失败!");
        }
    }
}

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

@ -2,7 +2,7 @@ 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.service.synergy.ManageSynergyService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import io.swagger.annotations.Api;
@ -29,7 +29,7 @@ import java.util.Set;
public class SynergyManageController extends BaseController {
    @Autowired
    private SynergyManageService synergyManageService;
    private ManageSynergyService manageSynergyService;
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
@ -42,7 +42,7 @@ public class SynergyManageController 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", manageSynergyService.getWorkOrderInfo(workorderCode, patient, role));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
@ -95,7 +95,7 @@ public class SynergyManageController extends BaseController {
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            synergyManageService.createWorkorder(getUID(),patientSet,type,objectId,serviceDate,priority,remark,followupClass,followupType);
            manageSynergyService.createWorkorder(getUID(),patientSet,type,objectId,serviceDate,priority,remark,followupClass,followupType);
            return new BaseResultModel();
        } catch (Exception e) {
            error(e);
@ -125,7 +125,7 @@ public class SynergyManageController extends BaseController {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            JSONObject result = synergyManageService.workorderList(userCode,workorderType,status,serviceStartTime,serviceEndTime,isAcceptTask,page,pageSize);
            JSONObject result = manageSynergyService.workorderList(userCode,workorderType,status,serviceStartTime,serviceEndTime,isAcceptTask,page,pageSize);
            return write(200, "获取成功", "data", result);
        } catch (Exception e) {
            error(e);
@ -143,8 +143,8 @@ public class SynergyManageController extends BaseController {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            synergyManageService.reminder(userCode,workorderCode);
            return write(200, "请求成功");
            Integer reminderStatus = manageSynergyService.reminder(userCode,workorderCode);
            return write(200, "请求成功","data",reminderStatus);
        }catch (Exception e){
            error(e);
            return error(-1, "请求失败");

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -52,7 +52,7 @@ rehabilitation:
  url: http://localhost:10055/svr-wlyy-rehabilitation/
#集美客服配置
customerService:
  url: http://localhost:8180/
  url: http://localhost:8082/
#小程序
applets: