Преглед на файлове

修改协同服务详情接口

humingfen преди 7 години
родител
ревизия
4588f7cc25

+ 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 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java

@ -14,4 +14,8 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    @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);
}

+ 21 - 5
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,11 +258,21 @@ 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());
        //获取服务对象
        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()));
        //根据角色显示对应工单状态
@ -283,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());