Explorar o código

通话记录详情

zd_123 %!s(int64=6) %!d(string=hai) anos
pai
achega
5429b97d0e
Modificáronse 19 ficheiros con 760 adicións e 43 borrados
  1. 3 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java
  2. 55 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java
  3. 33 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorSynergyManageController.java
  4. 3 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/filter/SessionOutTimeFilter.java
  5. 1 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/TownDao.java
  6. 4 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerLogDao.java
  7. 69 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java
  8. 3 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java
  9. 203 6
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  10. 35 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyWorkorderServicerLogService.java
  11. 2 2
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/service_project_management.jsp
  12. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index.jsp
  13. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java
  14. 4 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java
  15. 139 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  16. 2 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/DoctorSurveyScreenResultController.java
  17. 2 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java
  18. 112 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/synergy/SynergyManageController.java
  19. 87 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/synergy/SynergyManagerController.java

+ 3 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java

@ -60,7 +60,8 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/admin/surveyTemplateAdvice/**",
                "/admin/paylog/**",
                "/admin/static/consult/**",
                "/admin/specialist/hospitalServiceItem/importData"
                "/admin/specialist/hospitalServiceItem/importData",
                "/synergy/**"
        );
    }
@ -73,7 +74,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                .expressionHandler(webSecurityExpressionHandler())
                .antMatchers("/yueren/**").permitAll()
                .antMatchers("/svr-iot/device/**").permitAll()//物联网平台没有做登录(这里添加免登录验证)
                .antMatchers("/synergy/**").permitAll() //i健康平台没有做登录(这里添加免登录验证)
//                .antMatchers("/synergy/**").permitAll() //i健康平台没有做登录(这里添加免登录验证)
//                .antMatchers("/login/**").permitAll()
//                .antMatchers("/admin/**").authenticated()
                .antMatchers("/admin/**").hasRole("USER")

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

@ -13,9 +13,6 @@ 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;
@ -80,6 +77,42 @@ public class CustomerSynergyManageController extends BaseController {
    }
    @RequestMapping(value = "/labels", method = RequestMethod.GET)
    @ApiOperation("根据分组类型查找标签")
    public String labels(
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true)
            @RequestParam(value = "labelType", required = true) String labelType) {
        try {
            return write(200,"保存成功", "data", synergyManageService.getLabels(labelType));
        } catch (Exception e) {
            error(e);
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "/unitLabels", method = RequestMethod.GET)
    @ApiOperation("获取所属社区")
    public String unitLabels(@ApiParam(name = "currentRoleCode", value = "选择的区县", required = false)
                             @RequestParam(value = "currentRoleCode", required = false) String currentRoleCode) {
        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());
        } catch (Exception e) {
            error(e);
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "workorderList", method = RequestMethod.GET)
    @ApiOperation("客服系统-协同服务列表")
    public String workorderList(@ApiParam(name = "userCode", value = "客服code", required = false)
@ -130,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)
@ -260,5 +294,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,"提交失败");
        }
    }
}

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

@ -1,30 +1,39 @@
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;
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.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.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by 刘文彬 on 2018/9/27.
 */
@Controller
@RequestMapping(value = "/doctor/synergy")
@RestController
@RequestMapping(value = "/synergy/doctor",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-协同服务")
public class DoctorSynergyManageController extends BaseController {
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private ObjectMapper objectMapper;
    @RequestMapping(value = "workorderList", method = RequestMethod.GET)
    @ApiOperation("医生端-协同服务列表")
@ -56,7 +65,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 +82,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;
        }

+ 1 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/TownDao.java

@ -5,11 +5,10 @@
 *******************************************************************************/
package com.yihu.wlyy.repository;
import com.yihu.wlyy.entity.Town;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.Town;
public interface TownDao extends PagingAndSortingRepository<Town, Long> {
	// 根據CODE查詢區縣名稱
	@Query("select p from Town p where p.code = ?1")

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

+ 69 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -3,9 +3,11 @@ package com.yihu.wlyy.service.manager.account;
import com.yihu.wlyy.entity.*;
import com.yihu.wlyy.entity.call.CallRecord;
import com.yihu.wlyy.entity.call.CallService;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
import com.yihu.wlyy.repository.*;
import com.yihu.wlyy.repository.call.CallRecordDao;
import com.yihu.wlyy.repository.call.CallServiceDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
import com.yihu.wlyy.service.manager.hos.HosDoctorService;
@ -169,7 +171,7 @@ public class CustomerService extends BaseService{
		//发送短信消息啦
		String mobile = doctor.getMobile();
		if(!StringUtils.isBlank(mobile)&&!"2".equals(type)){
			msg+="\n您可通过微信关注\"i健康智能助手\"公众号更快更便捷的获取服务信息。";
			msg+=" 您可通过微信关注\"i健康智能助手\"公众号更快更便捷的获取服务信息。";
			List<NameValuePair> par = new ArrayList<NameValuePair>();
			par.add(new BasicNameValuePair("mobiles", mobile));
			par.add(new BasicNameValuePair("content", msg));
@ -392,9 +394,72 @@ public class CustomerService extends BaseService{
		/*List<CallService> consultService = callServiceDao.findByCallCodeAndType(code,0);
		List<CallService> orderService = callServiceDao.findByCallCodeAndType(code,1);*/
		String type="";
		String relationCode="";
		String sql="";
		List<Map<String,Object>> resultList = new ArrayList<>();
		//咨询
		if ("0".equals(type)){
			sql="SELECT " +
				" a.code as workCode," +
				" a.content, " +
				" a.`status`, " +
				" a.service_patient_name, " +
				" c.deal_type, " +
				" c.deal_content, " +
				" a.remark " +
				" FROM " +
				" manage_synergy_workorder_reserve_consult c " +
				" INNER JOIN ( " +
				" SELECT " +
				"  w.*, s.service_patient_name " +
				"  FROM " +
				"  manage_synergy_workorder w " +
				"  LEFT JOIN manage_synergy_workorder_servicer s ON w.`code` = s.workorder_code " +
				" ) a " +
				" WHERE " +
				" call_code = '"+code+"'";
			resultList = jdbcTemplate.queryForList(sql);
		}
		//健康教育
		if ("1".equals(type)){
		}
		//预约
		if ("2".equals(type)){
			sql="SELECT" +
					" a. CODE AS workCode," +
					" a.`status`," +
					" a.service_patient_name," +
					" c.order_hospital_name," +
					" c.order_dept_name," +
					" c.order_time" +
					"FROM" +
					" manage_synergy_workorder_reserve_consult c" +
					"INNER JOIN (" +
					" SELECT" +
					"  w.*, s.service_patient_name" +
					" FROM" +
					"  manage_synergy_workorder w" +
					" LEFT JOIN manage_synergy_workorder_servicer s ON w.`code` = s.workorder_code" +
					") a" +
					"WHERE" +
					" call_code = '"+code+"'";
			resultList = jdbcTemplate.queryForList(sql);
		}
		//随访
		if ("3".equals(type)){
		}
		//问卷调查
		if ("4".equals(type)){
		}
		//疾病筛查
		if ("5".equals(type)){
			sql="SELECT * FROM `wlyy_survey_screen_result` WHERE `code`='"+relationCode+"'";
			resultList = jdbcTemplate.queryForList(sql);
		}

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

@ -41,6 +41,8 @@ public class QuestionnaireManageService extends BaseJpaService {
    private SurveyTemplateQuestionsDao templateQuestionDao;
    @Autowired
    private SurveyQuestionResultDao questionResultDao;
    @Autowired
    private SynergyManageService synergyManageService;
    /**
@ -64,7 +66,7 @@ public class QuestionnaireManageService extends BaseJpaService {
        }
        servicer = servicer.substring(0, servicer.length()-1);
        //保存协同服务工单
        workorderDO.setCode(getCode());
        workorderDO.setCode(synergyManageService.getWorkorderNo());
        workorderDO.setStatus(1);
        workorderDO.setCreateTime(new Date());
        workorderDO.setDel(1);

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

@ -57,6 +57,8 @@ public class SynergyManageService extends BaseJpaService {
    private ManageSynergyWorkorderReminderDao manageSynergyWorkorderReminderDao;
    @Autowired
    private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
    @Autowired
    private TownDao townDao;
    /**
     * 根据服务编码获取工单
@ -106,18 +108,18 @@ public class SynergyManageService extends BaseJpaService {
        }else if(userType==2){//客服
            if(isAcceptTask==1){//我接收
                whereSql +=" and w.create_user_type=1 ";//创建人为医生
                whereSql += " and e.executor_code ="+code+" ";
                whereSql += " and e.executor_code ='"+code+"' ";
            }else if(isAcceptTask==2){//我派发
                whereSql +=" and w.create_user_type=2 ";//创建人为客服
                whereSql += " and e.create_user ="+code+" ";
                whereSql += " and e.create_user ='"+code+"' ";
            }
        }else if(userType==3){//医生
            if(isAcceptTask==1){//我接收
                whereSql +=" and w.create_user_type=2 ";//创建人为客服
                whereSql += " and e.executor_code ="+code+" ";
                whereSql += " and e.executor_code ='"+code+"' ";
            }else if(isAcceptTask==2){//我派发
                whereSql +=" and w.create_user_type=2 ";//创建人为医生
                whereSql += " and e.create_user ="+code+" ";
                whereSql += " and e.create_user ='"+code+"' ";
            }
        }
@ -134,7 +136,7 @@ public class SynergyManageService extends BaseJpaService {
        }
        //是否是我负责的
        if(isMyTask!=null){
            whereSql += " and e.executor_code ="+code+" and e.executor_type=1 ";
            whereSql += " and e.executor_code ='"+code+"' and e.executor_type=1 ";
        }
        //工单状态
        if(status!=null){
@ -641,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;
    }
@ -777,4 +779,199 @@ public class SynergyManageService extends BaseJpaService {
        }
        return list;
    }
    /**
     * 创建工单
     *
     * @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");
        JSONObject jsonObject = new JSONObject(response);
        return  jsonObject;
    }
    public JSONObject getUnitLabels(String currentRoleCode) {
        String url = wlyyUrl + "/wlyygc/doctor/label/unitLabels?currentRoleCode=" + currentRoleCode + "&currentRoleLevel=3";
        String response = httpClientUtil.get(url, "UTF-8");
        JSONObject jsonObject = new JSONObject(response);
        return  jsonObject;
    }
    public List<Town> getTowns() {
        return (List<Town>) townDao.findAll();
    }
    public void exportWorkorder(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){
        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) ";
            }
        }else if(userType==2){//客服
            if(isAcceptTask==1){//我接收
                whereSql +=" and w.create_user_type=1 ";//创建人为医生
                whereSql += " and e.executor_code ='"+code+"' ";
            }else if(isAcceptTask==2){//我派发
                whereSql +=" and w.create_user_type=2 ";//创建人为客服
                whereSql += " and e.create_user ='"+code+"' ";
            }
        }else if(userType==3){//医生
            if(isAcceptTask==1){//我接收
                whereSql +=" and w.create_user_type=2 ";//创建人为客服
                whereSql += " and e.executor_code ='"+code+"' ";
            }else if(isAcceptTask==2){//我派发
                whereSql +=" and w.create_user_type=2 ";//创建人为医生
                whereSql += " and e.create_user ='"+code+"' ";
            }
        }
        //关键字查询
        if(StringUtils.isNotEmpty(keywords)){
            servicerTable +=" left join wlyy.manage_synergy_workorder_servicer s on s.workorder_code=w.code ";
            whereSql += " and w.servicer_count<=10  ";
            whereSql += " and (w.create_user_name like '%"+keywords+"%' or s.service_patient_name like '%"+keywords+"%' " +
                    " or s.ssc like '%"+keywords+"%' or s.idcard like '%"+keywords+"%' ) ";
        }
        //服务类型
        if(workorderType!=null){
            whereSql += " and w.type ="+workorderType+" ";
        }
        //是否是我负责的
        if(isMyTask!=null){
            whereSql += " and e.executor_code ='"+code+"' and e.executor_type=1 ";
        }
        //工单状态
        if(status!=null){
            whereSql +=" and w.status ="+status+" ";
        }
        //优先级
        if(priority!=null){
            whereSql+= " and w.priority="+priority+" ";
        }
        //是否超时
        if(timeout!=null){
            whereSql +=" and w.service_time >'"+DateUtil.dateToStrLong(new Date())+"' ";
        }
        //服务编码
        if(StringUtils.isNotEmpty(workorderCode)){
            whereSql+=" and w.code like '%"+workorderCode+"%' ";
        }
        //负责人
        if(StringUtils.isNotEmpty(principal)){
            whereSql+=" and e.code like '%"+principal+"%' and e.executor_type=1 ";
        }
        //服务时间
        if(StringUtils.isNotEmpty(serviceStartTime)){
            whereSql+=" and w.service_time>='"+serviceStartTime+"' ";
        }
        if(StringUtils.isNotEmpty(serviceEndTime)){
            whereSql+=" and w.service_time<='"+serviceEndTime+"' ";
        }
        //服务对象
        if(StringUtils.isNotEmpty(patientName)){
            whereSql+=" s.service_patient_name like '%"+keywords+"%' ";
        }
        //社保卡号
        if(StringUtils.isNotEmpty(ssc)){
            whereSql+=" s.ssc like '%"+keywords+"%' ";
        }
        //身份证号
        if(StringUtils.isNotEmpty(idcard)){
            whereSql+=" s.idcard like '%"+keywords+"%' ";
        }
        String sql =" select DISTINCT w.* from wlyy.manage_synergy_workorder w  " +servicerTable+
                " where w.del=1  " +
                " and 1=1 "+whereSql+ " order by w.priority desc,w.service_time desc";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
    }
}

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

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/desizenMan/service_project_management.jsp

@ -498,7 +498,7 @@
					console.log(t);
                    var grade = '',price = '',itemType='',hospitalGrade='';
					$('.item-title').text(t.hospitalServiceItem.serviceItemName);
                    t.hospitalServiceItem.specialistServiceItemDO.itemType == 0 ? itemType = '康健服务':itemType = '健康管理';
                    t.hospitalServiceItem.specialistServiceItemDO.itemType == 0 ? itemType = '诊疗服务':itemType = '健康服务';
					$('.item-type').text(itemType);
					$('.item-content').text(t.hospitalServiceItem.specialistServiceItemDO.content);
					$('.item-chuwai').text(t.hospitalServiceItem.specialistServiceItemDO.excludeContent);
@ -863,7 +863,7 @@
                            xiangmuContent = res.data.detailModelList[0];
                            res.data.detailModelList[0].forEach(function (item) {
                                var t = {};
                                t.text = item.hospitalServiceItem.specialistServiceItemDO.diseaseItem;
                                t.text = item.hospitalServiceItem.serviceItemName;
                                t.code = item.hospitalServiceItem.id
                                serverData[0].nodes.push(t)
                            });

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/specialty/index.jsp

@ -387,7 +387,7 @@
                    success:function (res) {
                        console.log(res)
                        layer.msg('删除成功', {icon: 1});
                        grid.deleteRow(rowindex)
                        init();
                    }
                })
            }, function(){

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java

@ -1124,7 +1124,7 @@ public class SurveyScreenResultService extends BaseService {
     * @return
     * @throws Exception
     */
    public String createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
    public JSONObject createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
        JSONObject object = new JSONObject(jsonData);
        JSONArray patientInfos = new JSONArray(patientInfo);
        //获取关联业务名称
@ -1147,6 +1147,6 @@ public class SurveyScreenResultService extends BaseService {
        HttpResponse response = null;
        response = HttpUtils.doPost(customerUrl + "synergy/questionnaire/createWorkOrder", param);
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("data");
        return rs;
    }
}

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java

@ -1918,19 +1918,20 @@ public class ManagerQuestionnaireService extends BaseService {
     * @return
     * @throws Exception
     */
    public String createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception{
    public JSONObject createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception{
        JSONObject object = new JSONObject(jsonData);
        JSONArray patientInfos = new JSONArray(patientInfo);
        Doctor d = doctorService.findDoctorByCode(doctor);
        object.put("createUser", d.getCode());
        object.put("createUserName", d.getName());
        object.put("createUserType", 1);
        Map<String, Object> param = new HashedMap();
        param.put("patientInfo", patientInfo.toString());
        param.put("patientInfo", patientInfos.toString());
        param.put("jsonData", object.toString());
        HttpResponse response = null;
        response = HttpUtils.doPost(customerUrl + "synergy/questionnaire/createWorkOrder", param);
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("data");
        return rs;
    }
    /**

+ 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 + "/synergy/doctor/reminder", param);
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")!=200){
            throw new Exception("请求客服系统服务失败!");
        }
    }
}

+ 2 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/DoctorSurveyScreenResultController.java

@ -16,11 +16,7 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -29,7 +25,7 @@ import java.util.Map;
 * 医生端-疾病筛查
 * Created by zhangdan on 2018/7/2.
 */
@Controller
@RestController
@RequestMapping(value = "/doctor/screen")
@Api(description = "医生端-疾病筛查")
public class DoctorSurveyScreenResultController extends WeixinBaseController {

+ 2 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java

@ -21,11 +21,7 @@ import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -37,7 +33,7 @@ import java.util.Map;
 * 管理端问卷调查 manager路径需要验证
 * Created by Reece on 2017/3/7.
 */
@Controller
@RestController
@RequestMapping(value = "/doctor/questionnaire")
@Api(description = "管理端问卷调查")
public class ManagerQuestionnaireController extends WeixinBaseController {

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