Parcourir la source

Merge branch 'dev' of humingfen/patient-co-management into dev

liuwenbin il y a 7 ans
Parent
commit
c953bbfb82

+ 12 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerScreenResultController.java

@ -24,7 +24,7 @@ public class CustomerScreenResultController extends BaseController {
    private ScreenResultManageService screenResultService;
    @RequestMapping(value = "getScreenResultDetail", method = RequestMethod.GET)
    @ApiOperation(value = "查看筛查结果记录详情")
    @ApiOperation(value = "获取筛查结果记录详情")
    public String getScreenResultDetail(@ApiParam(value = "筛查结果唯一code")@RequestParam(value = "code") String code) {
        try {
            return write(200, "获取成功!", "data", screenResultService.getScreenResultDetail(code));
@ -33,4 +33,15 @@ public class CustomerScreenResultController extends BaseController {
            return write(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "getQuestions", method = RequestMethod.GET)
    @ApiOperation(value = "获取筛查问卷详情")
    public String getScreenDetail(@ApiParam(value = "筛查问卷code")@RequestParam(value = "code") String templateCode) {
        try {
            return write(200, "获取成功!", "data", screenResultService.getScreenDetail(templateCode));
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "获取失败!");
        }
    }
}

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

@ -5,7 +5,6 @@ import com.yihu.wlyy.service.synergy.SynergyManageService;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -26,11 +25,13 @@ public class CustomerSynergyManageController extends BaseController {
    @ApiOperation(value = "获取协同服务工单信息")
    public String addCallRecord(@ApiParam(name="workorderCode",value="协同服务工单code")
                                @RequestParam(required = true)String workorderCode,
                                @ApiParam(name="patient",value="居民code")
                                @RequestParam(required = false)String patient,
                                @ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
                                @RequestParam(required = true)Integer role){
        try {
            return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, role));
            return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");

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

@ -11,8 +11,11 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    @Query(" select count(1) from ManageSynergyWorkorderServicerDO s where s.workorderCode=?1 and s.status=?2 ")
    Integer findByWorkorderCodeCount(String workorderCode,Integer status);
    @Transactional
    @Modifying
    @Query("update ManageSynergyWorkorderServicerDO s set s.relationCode = ?2 where s.code = ?1")
    void updateRelationCodeByCode(String serviceCode, String questionResultCode);
    //根据工单code和居民code获取处理完成的服务对象信息
    @Query("select s from ManageSynergyWorkorderServicerDO s where s.workorderCode = ?1 and s.servicePatientCode = ?2 and s.status = 3")
    ManageSynergyWorkorderServicerDO findByWorkOrderCodeAndPatientCode(String workorderCode, String patient);
}

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

@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
@ -26,6 +27,7 @@ import java.util.Map;
 * Created by humingfen on 2018/09/27.
 */
@Service
@Transactional
public class QuestionnaireManageService extends BaseJpaService {
    @Value("${wlyy.url}")

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

@ -5,6 +5,7 @@ import com.yihu.wlyy.util.HttpClientUtil;
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.HashMap;
import java.util.Map;
@ -13,6 +14,7 @@ import java.util.Map;
 * Created by humingfen on 2018/09/29.
 */
@Service
@Transactional
public class ScreenResultManageService {
    @Value("${wlyy.url}")
@ -20,6 +22,11 @@ public class ScreenResultManageService {
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 获取筛查结果详情
     * @param code
     * @return
     */
    public JSONObject getScreenResultDetail(String code) {
        String url = wlyyUrl + "doctor/screen/getScreenResultDetail";
        String response = "";
@ -32,4 +39,22 @@ public class ScreenResultManageService {
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 获取筛查问卷详情
     * @param templateCode
     * @return
     */
    public JSONObject getScreenDetail(String templateCode) {
        String url = wlyyUrl + "/doctor/questionnaire/getAllQuestions";
        String response = "";
        Map<String, String> params = new HashMap<>();
        params.put("surveyTemplateCode", templateCode);
        try {
            response = httpClientUtil.httpPost(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

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

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.synergy;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkOrderDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderExecutorDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
@ -239,8 +240,14 @@ public class SynergyManageService {
        return serviceStatus;
    }
    //获取系统服务详情
    public Map<String, Object> getWorkOrderInfo(String workorderCode, Integer role) {
    /**
     * 获取系统服务详情
     * @param workorderCode
     * @param patient
     * @param role
     * @return
     */
    public Map<String, Object> getWorkOrderInfo(String workorderCode, String patient, Integer role) {
        Map<String, Object> map = new HashMap<>();
        ManageSynergyWorkorderDO workorderDO = workOrderDao.findByCode(workorderCode);
        //存入协同服务工单信息
@ -251,18 +258,23 @@ public class SynergyManageService {
        map.put("status", workorderDO.getStatus());
        map.put("title", workorderDO.getRelationCodeName());
        map.put("remark", workorderDO.getRemark());
        map.put("servicerKey", workorderDO.getServicerKey());
        map.put("servicerCount", workorderDO.getServicerCount());
        map.put("createTime", workorderDO.getCreateTime());
        map.put("createUserName", workorderDO.getCreateUserName());
        //判断是否超时
        Date now = new Date();
        long hour = (now.getTime() - workorderDO.getServiceTime().getTime())/60*60*1000;
        if(hour <= 4){
            map.put("delay", "red");
        }else if(hour <= 24){
            map.put("delay", "yellow");
        //获取服务对象
        if(StringUtils.isNotBlank(patient)){
            //获取单个居民处理完成的工单信息
            ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderCode, patient);
            map.put("servicerKey", workorderServicerDO.getServicePatientName());
            map.put("idcard", workorderServicerDO.getIdcard());
            map.put("ssc", workorderServicerDO.getSsc());
        }else {
            map.put("servicerKey", workorderDO.getServicerKey());
            map.put("servicerCount", workorderDO.getServicerCount());
        }
        //超时标签
        map.put("delayStatus", this.isServiceOverTime(workorderDO.getServiceTime()));
        //根据角色显示对应工单状态
        if(workorderDO.getCreateUserType() == 1 && role == 2){
            map.put("status", "待接收");
@ -288,7 +300,6 @@ public class SynergyManageService {
            map.put("remark", workorderDO.getDealResultRemark());
            map.put("accessory", workorderDO.getDealResultAccessory());
        }
        return map;
    }

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

@ -1123,6 +1123,14 @@ public class SurveyScreenResultService extends BaseService {
     */
    public String createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
        JSONObject object = new JSONObject(jsonData);
        //获取关联业务名称
        if(object.getInt("type") == 4){
            Survey survey = surveyDao.findById(object.getString("relationCode"));
            object.put("relationCodeName", survey.getTitle());
        }else if(object.getInt("type") == 5){
            SurveyTemplates templates = surveyTemplatesDao.findById(object.getString("relationCode"));
            object.put("relationCodeName", templates.getTitle());
        }
        Doctor d = doctorService.findDoctorByCode(doctor);
        object.put("createUser", d.getCode());
        object.put("createUserName", d.getName());

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

@ -612,7 +612,7 @@ public class ManagerQuestionnaireController extends WeixinBaseController {
    @RequestMapping(value = "/createWorkOrder",method = RequestMethod.POST)
    @ApiOperation(value = "创建协同服务")
    public String getAllQuestions(@ApiParam(name = "jsonData",value = "协同服务json字符串")
    public String createWorkOrder(@ApiParam(name = "jsonData",value = "协同服务json字符串")
                                      @RequestParam(value = "jsonData",required = true)String jsonData,
                                  @ApiParam(name = "labelUnitType", value = "标签类型  1:下属单位,多个用逗号分隔", required = false)
                                      @RequestParam(value = "labelUnitType", required = false, defaultValue = "") String labelUnitType,