Bläddra i källkod

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/service/synergy/SynergyManageService.java
humingfen 6 år sedan
förälder
incheckning
550f21ded8

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerQuestionnaireController.java

@ -77,7 +77,7 @@ public class CustomerQuestionnaireController extends BaseController {
        }
    }
    @RequestMapping(value = "isNotException", method = RequestMethod.POST)
   /* @RequestMapping(value = "isNotException", method = RequestMethod.POST)
    @ApiOperation(value = "判断是否异常通话")
    public String isNotException(@ApiParam(value = "协同服务工单code") @RequestParam String workorderCode,
                                 @ApiParam(value = "客服code") @RequestParam String customerCode) {
@ -101,5 +101,5 @@ public class CustomerQuestionnaireController extends BaseController {
            e.printStackTrace();
            return write(-1, "查询失败!");
        }
    }
    }*/
}

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

@ -163,6 +163,7 @@ public class CustomerSynergyManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "/takeWorkorderNum", method = RequestMethod.GET)
    @ApiOperation(value = "获取协同服务取号信息")
    public String takeWorkorderNum(@ApiParam(name="workorderCode",value="协同服务工单code",required = false)
@ -281,5 +282,23 @@ public class CustomerSynergyManageController extends BaseController {
            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,"提交失败");
        }
    }
}

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

@ -1,6 +1,10 @@
package com.yihu.wlyy.controller.synergy.doctor;
import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -12,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -19,12 +24,14 @@ 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 {
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private ObjectMapper objectMapper;
    @RequestMapping(value = "workorderList", method = RequestMethod.GET)
    @ApiOperation("医生端-协同服务列表")
@ -56,7 +63,6 @@ public class DoctorSynergyManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "reminder", method = RequestMethod.POST)
    @ApiOperation("医生端-催单")
    public String reminder(@ApiParam(name = "userCode", value = "医生code", required = false)
@ -74,4 +80,26 @@ public class DoctorSynergyManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "createWorkorder", method = RequestMethod.GET)
    @ApiOperation("医生端-创建协同服务")
    public String workorderList(@ApiParam(name = "workorder", value = "工单对象", required = false)
                                @RequestParam(value = "workorder")String workorder,
                                @ApiParam(name = "servicers", value = "服务对象", required = false)
                                @RequestParam(value = "servicers")String servicers){
        try {
            ManageSynergyWorkorderDO workorderDO = objectMapper.readValue(workorder,ManageSynergyWorkorderDO.class);
            JSONArray jsonArray = JSONArray.parseArray(servicers);
            List<ManageSynergyWorkorderServicerDO> servicerDOS = new ArrayList<>();
            for (int i=0;i<jsonArray.size();i++){
                ManageSynergyWorkorderServicerDO servicerDO = objectMapper.readValue(jsonArray.getJSONObject(i).toJSONString(),ManageSynergyWorkorderServicerDO.class);
                servicerDOS.add(servicerDO);
            }
            synergyManageService.createWorkorder(workorderDO,servicerDOS);
            return write(200, "获取成功");
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 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);
}

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

@ -643,7 +643,7 @@ public class SynergyManageService extends BaseJpaService {
        Integer myFinishedCount = workorderServicerDao.countByWorkorderCodeAndExecutorCodeAndStatus(workorderCode,userCode,3);
        resultMap.put("myFinishedCount",myFinishedCount);
        //待跟进
        Integer followCount = manageSynergyWorkorderServicerLogDao.findByWorkorderCode(workorderCode);
        Integer followCount = manageSynergyWorkorderServicerLogDao.findByWorkorderCodeAndFollowUp(workorderCode);
        resultMap.put("followCount",followCount);
        return resultMap;
    }
@ -747,6 +747,89 @@ public class SynergyManageService extends BaseJpaService {
        return resultList;
    }
    /**
     * 创建工单
     *
     * @param manageSynergyWorkorderDO
     * @param manageSynergyWorkorderServicerDOS
     */
    public void createWorkorder(ManageSynergyWorkorderDO manageSynergyWorkorderDO,List<ManageSynergyWorkorderServicerDO> manageSynergyWorkorderServicerDOS){
        manageSynergyWorkorderDO.setCode(getWorkorderNo());
        ManageSynergyWorkorderDO manageSynergyWorkorderDO1 = workOrderDao.save(manageSynergyWorkorderDO);
        for (ManageSynergyWorkorderServicerDO servicerDO:manageSynergyWorkorderServicerDOS){
            servicerDO.setWorkorderType(manageSynergyWorkorderDO1.getType());
            servicerDO.setWorkorderCode(manageSynergyWorkorderDO1.getCode());
            servicerDO.setRelationCode(manageSynergyWorkorderDO1.getRelationCode());
            servicerDO.setCreateTime(new Date());
            servicerDO.setRelationCodeName(manageSynergyWorkorderDO1.getRelationCodeName());
            workorderServicerDao.save(servicerDO);
        }
    }
    /**
     * 添加随访计划
     *
     * @param doctor
     * @param patient
     * @param date
     * @param followupType
     * @param followupClass
     * @param followupManagerStatus
     * @param plandate
     * @param prescriptioncode
     */
    public String addFollowup(String doctor,String patient, String date, String followupType,String followupClass,String followupManagerStatus,String plandate,String prescriptioncode){
        String response = null;
        String url = wlyyUrl + "followup/addFollowup";
        Map<String, Object> params = new HashMap<>();
        params.put("doctor",doctor);
        params.put("patient",patient);
        params.put("date",date);
        params.put("followupType",followupType);
        params.put("followupClass",followupClass);
        params.put("followupManagerStatus",followupManagerStatus);
        params.put("plandate",plandate);
        params.put("prescriptioncode",prescriptioncode);
        try {
            response = httpClientUtil.post(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
    /**
     * 保存随访数据
     *
     * @param followup
     * @return
     */
    public String saveFollowupProjectData(String followup){
        String response = null;
        String url = wlyyUrl + "followup/saveFollowupProjectData";
        Map<String, Object> params = new HashMap<>();
        params.put("followup",followup);
        try {
            response = httpClientUtil.post(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        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);
    }
    public JSONObject getLabels(String labelType) {
        String url = wlyyUrl + "/wlyygc/doctor/label/labels?labelType=" + labelType;
        String response = httpClientUtil.get(url, "UTF-8");

+ 35 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyWorkorderServicerLogService.java

@ -0,0 +1,35 @@
package com.yihu.wlyy.service.synergy;/**
 * Created by nature of king on 2018/10/9.
 */
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerLogDO;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerLogDao;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * @author wangzhinan
 * @create 2018-10-09 15:58
 * @desc 协同服务处理操作日志
 **/
@Service
@Transactional
public class SynergyWorkorderServicerLogService extends BaseJpaService {
    @Autowired
    private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
    /**
     * 添加协同服务处理操作日志
     *
     * @param synergyWorkorderServicerLogDO
     */
    public void create(ManageSynergyWorkorderServicerLogDO synergyWorkorderServicerLogDO){
        synergyWorkorderServicerLogDO.setCreateTime(new Date());
        manageSynergyWorkorderServicerLogDao.save(synergyWorkorderServicerLogDO);
    }
}

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

@ -1,15 +1,32 @@
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.
@ -19,6 +36,18 @@ import java.util.Map;
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();
@ -30,4 +59,114 @@ public class SynergyManageService extends BaseService {
        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 + "/doctor/synergy/reminder", param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求客服系统服务失败!");
        }
    }
}

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

@ -1,10 +1,15 @@
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.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -12,6 +17,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashSet;
import java.util.Set;
/**
 * Created by humingfen on 2018/10/9.
 */
@ -22,6 +30,8 @@ public class SynergyManageController extends BaseController {
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    @RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务工单信息")
@ -38,4 +48,106 @@ public class SynergyManageController extends BaseController {
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "doctorCreateSynergy", method = RequestMethod.POST)
    @ApiOperation("医生创建系统服务")
    @ObserverRequired
    public BaseResultModel doctorSendArticleToPatients(
            @RequestParam(value = "patient", required = false) String patient,
            @RequestParam(value = "group", required = false, defaultValue = "") String group,
            @RequestParam(value = "labelType", required = false) String labelType,
            @RequestParam(value = "teamCode", required = false) Long teamCode,
            @RequestParam(value = "objectId", required = false) String objectId,
            @RequestParam(value = "type",required = false)Integer type,
            @RequestParam(value = "serviceDate",required = false)String serviceDate,
            @RequestParam(value = "priority",required = false)Integer priority,
            @RequestParam(value = "remark",required = false)String remark,
            @RequestParam(value = "followupClass",required = false)String followupClass,
            @RequestParam(value = "followupType",required = false)String followupType){
        try {
            String[] patients = new String[]{};
            String[] groups = new String[]{};
            if (StringUtils.isEmpty(patient) && StringUtils.isEmpty(group)) {
                return new BaseResultModel("请至少选择一个患者!");
            }else{
                if(StringUtils.isNotBlank(patient)){
                    if(patient.contains(",")){
                        patients = patient.split(",");
                    }else{
                        patients = new String[]{patient};
                    }
                }
                if(StringUtils.isNotBlank(group)){
                    if(group.contains(",")){
                        groups = group.split(",");
                    }else{
                        groups = new String[]{group};
                    }
                }
            }
            if (patients.length == 0 && groups.length == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            jmJkEduArticleService.initPatients(getUID(),groups, group,labelType,teamCode,patients,patientSet);
//            jmJkEduArticleService.initPatient(getUID(),groups,group,labelType,teamCode,patients,patientSet);
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            synergyManageService.createWorkorder(getUID(),patientSet,type,objectId,serviceDate,priority,remark,followupClass,followupType);
            return new BaseResultModel();
        } catch (Exception e) {
            error(e);
            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, "请求失败");
        }
    }
}

+ 87 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/synergy/SynergyManagerController.java

@ -0,0 +1,87 @@
package com.yihu.wlyy.web.third.synergy;/**
 * Created by nature of king on 2018/10/8.
 */
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.followup.FollowUpService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * @author wangzhinan
 * @create 2018-10-08 13:56
 * @desc 协同管理
 **/
@Controller
@RequestMapping(value = "/followup", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "协同管理接口")
public class SynergyManagerController extends BaseController{
    @Autowired
    private FollowUpService followUpService;
    @ApiOperation("新增临时随访记录(返回ID)")
    @RequestMapping(value = "/addFollowup", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String addFollowup(@ApiParam(name = "doctor", value = "医生代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                                  @RequestParam(value = "doctor", required = true) String doctor,
                              @ApiParam(name = "patient", value = "患者代码", defaultValue = "443a196ef8744536a531260eb26c05d7")
                              @RequestParam(value = "patient", required = true) String patient,
                              @ApiParam(name = "date", value = "下次随访时间", defaultValue = "2016-12-15 20:00:00")
                              @RequestParam(value = "date", required = true) String date,
                              @ApiParam(name = "followupType", value = "随访方式【字典FOLLOWUP_WAY_DICT】", defaultValue = "12")
                              @RequestParam(value = "followupType", required = true) String followupType,
                              @ApiParam(name = "followupClass", value = "随访类别【1.高血压 2.糖尿病 3高糖】", defaultValue = "1")
                              @RequestParam(value = "followupClass", required = true) String followupClass,
                              @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                              @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                              @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                              @RequestParam(value = "plandate", required = false) String plandate,
                              @ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "续方CODE")
                              @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
        try {
            String response = followUpService.addFollowup(doctor, patient, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
            return write(200, "新增临时随访记录成功!", "data", response);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "新增临时随访记录失败!" + e.getMessage());
        }
    }
    @ApiOperation("保存随访项目数据")
    @RequestMapping(value = "/saveFollowupProjectData", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
    @ResponseBody
    @ObserverRequired
    public String saveFollowupProjectData(@ApiParam(name = "followup", value = "随访项目对象")
                                          @RequestParam(value = "followup", required = true)String followup ) {
        try {
            JSONArray array = JSONArray.parseArray(followup);
//            followUpService.saveFollowupProjectData(id, followupProject, followupProjectData);
            //修改为通过ES查询---2017.11.01--huangwenjie
            for (int i =0;i<array.size();i++){
                String id = array.getJSONObject(i).getString("id");
                String followupProject = array.getJSONObject(i).getString("followupProject");
                String followupProjectData = array.getJSONObject(i).getString("followupProjectData");
                followUpService.esSaveFollowupProjectData(id, followupProject, followupProjectData);
            }
            return write(200, "保存随访项目数据成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "保存随访项目数据失败!" + e.getMessage());
        }
    }
}