ソースを参照

通话记录详情

zd_123 6 年 前
コミット
b7370b4fb7

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -277,10 +277,10 @@ public class CustomerController extends BaseController {
    @ApiOperation(value = "获取通讯记录详情")
    public String getCallRecordInfo(@ApiParam(name="code",value="通话记录code")@RequestParam(required = true)String code){
        try {
            return write(200,"查询成功","data",customerService.getCallRecordInfo(code));
            return write(200,"查询成功!","data",customerService.getCallRecordInfo(code));
        }catch (Exception e){
            error(e);
            return error(-1,"查询失败");
            return error(-1,"查询失败!");
        }
    }

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

@ -307,5 +307,17 @@ public class CustomerSynergyManageController extends BaseController {
            return write(-1,"获取失败!");
        }
    }
    @RequestMapping(value = "customerHomePage",method = RequestMethod.GET)
    @ApiOperation(value = "客服首页")
    public String customerHomePage(@ApiParam(name="userCode",value="客服code")@RequestParam(value ="userCode")String userCode){
        try{
            return write(200,"获取成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"获取失败!");
        }
    }
}

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

@ -4,6 +4,8 @@ import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderCustomerLogDO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/9/30.
 */
@ -14,4 +16,6 @@ public interface ManageSynergyWorkorderCustomerLogDao extends PagingAndSortingRe
    @Query("select count(1) from ManageSynergyWorkorderCustomerLogDO cl where cl.workorderCode = ?1 and cl.createUserCode = ?2 and cl.status = 0")
    Integer findExceptionCount(String workorderCode, String customerCode);
    List<ManageSynergyWorkorderCustomerLogDO> findByCallCode(String callCode);
}

+ 14 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderReserveConsultDao.java

@ -0,0 +1,14 @@
package com.yihu.wlyy.repository.synergy;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderReserveConsultDO;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by zhangdan on 2018/10/11.
 */
public interface ManageSynergyWorkorderReserveConsultDao extends PagingAndSortingRepository<ManageSynergyWorkorderReserveConsultDO, Long> {
    List<ManageSynergyWorkorderReserveConsultDO> findByCallCode(String callCode);
}

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

@ -3,10 +3,14 @@ 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.ManageSynergyWorkorderCustomerLogDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderReserveConsultDO;
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.ManageSynergyWorkorderCustomerLogDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderReserveConsultDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.manager.family.FamilyMemberService;
@ -60,6 +64,8 @@ public class CustomerService extends BaseService{
	private DoctorDao doctorDao;
	@Autowired
	private PatientReservationDao patientReservationDao;
	@Autowired
	private SignFamilyDao signFamilyDao;
	@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
	private String messageApi;
@ -94,7 +100,23 @@ public class CustomerService extends BaseService{
				doctors.add(doctor);
			}
		}
		String labelSql="SELECT  DISTINCT CASE call_label WHEN '1' THEN '有待跟踪' WHEN '2' THEN '电话骚扰' WHEN '3' THEN '态度恶劣' END FROM manage_call_record mcr WHERE (caller_number='"+patient.getPhone()+"' OR caller_number='"+patient.getMobile()+"') AND type=1 AND call_label IS NOT NULL";
		String labelSql="SELECT DISTINCT" +
				" CASE call_label" +
				" WHEN '1' THEN" +
				" '有待跟踪'" +
				" WHEN '2' THEN" +
				" '电话骚扰'" +
				" WHEN '3' THEN" +
				" '态度恶劣'" +
				" END call_label" +
				" FROM" +
				" manage_call_record" +
				" WHERE" +
				" caller_number = '"+patient.getMobile()+"'" +
				" AND type = 1" +
				" AND call_label IS NOT NULL" +
				" AND call_label != ''" +
				" AND call_label != 'null'";
		List<Map<String,Object>> labelInfo = jdbcTemplate.queryForList(labelSql);
		resp.put("signInfo",signInfo);
		resp.put("doctors",doctors);
@ -391,84 +413,97 @@ public class CustomerService extends BaseService{
	public Map<String,Object> getCallRecordInfo(String code){
		CallRecord callRecord = callRecordDao.findByCode(code);
		/*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 " +
		String sql ="SELECT " +
				" w.`code`, " +
				" w.`status` AS wordStatus, " +
				" s.service_patient_code, " +
				" s.service_patient_name, " +
				" w.content, " +
				" l.remark, " +
				" s.relation_code, " +
				" s.relation_code_name, " +
				" w.type, " +
				" s.`status` AS serviceStatus " +
				" 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 " +
				" manage_synergy_workorder_servicer_log l " +
				" LEFT JOIN manage_synergy_workorder w ON l.workorder_code = w.`code` " +
				" LEFT JOIN manage_synergy_workorder_servicer s ON l.workorder_service_code = s.`code` " +
				" 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)){
				" l.call_code = '"+code+"'";
		}
		//问卷调查
		if ("4".equals(type)){
		List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
		List<Map<String,Object>> consultList = new ArrayList<>();
		List<Map<String,Object>> followList = new ArrayList<>();
		List<PatientReservation> patientReservation = new ArrayList<>();
		List<Map<String,Object>> surveyList = new ArrayList<>();
		List<Map<String,Object>> screenList = new ArrayList<>();
		for (Map<String,Object> map : list){
			String type = String.valueOf(map.get("type"));
			String relationCode = String.valueOf(map.get("relation_code"));
			//获取家庭医生姓名
			SignFamily signFamily = signFamilyDao.findByPatient(String.valueOf(map.get("service_patient_code")));
			if (signFamily!=null){
				map.put("familyDoctorName",signFamily.getDoctorName());
			}
			map.put("mobile",callRecord.getCallerNumber());
			//咨询
			if ("0".equals(type)){
				String consultSql ="SELECT deal_type,deal_content FROM `manage_synergy_workorder_reserve_consult` WHERE call_code='"+code+"'";
				List<Map<String,Object>> clist = jdbcTemplate.queryForList(consultSql);
				for (Map<String,Object> cmap : clist){
					map.putAll(cmap);
				}
				consultList.add(map);
			}
			//健康教育
			if ("1".equals(type)){
		}
		//疾病筛查
		if ("5".equals(type)){
			sql="SELECT * FROM `wlyy_survey_screen_result` WHERE `code`='"+relationCode+"'";
			resultList = jdbcTemplate.queryForList(sql);
			}
			//预约
		    if ("2".equals(type)){
				patientReservation = patientReservationDao.findByCallCode(code);
			}
			//随访
			if ("3".equals(type)){
				String followSql ="SELECT followup_class FROM wlyy_followup where id="+relationCode;
				List<Map<String,Object>> flist = jdbcTemplate.queryForList(followSql);
				for (Map<String,Object> fmap : flist){
					map.putAll(fmap);
				}
				followList.add(map);
			}
			//问卷调查
			if ("4".equals(type)){
				String qsql="SELECT template_title FROM `wlyy_survey_question_result` WHERE `code`='"+relationCode+"'";
				List<Map<String,Object>> flist = jdbcTemplate.queryForList(qsql);
				for (Map<String,Object> fmap : flist){
					map.putAll(fmap);
				}
				surveyList.add(map);
			}
			//疾病筛查
			if ("5".equals(type)){
				String ssql="SELECT template_title,screen_result_score FROM `wlyy_survey_screen_result` WHERE `code`='"+relationCode+"'";
				List<Map<String,Object>> flist = jdbcTemplate.queryForList(ssql);
				for (Map<String,Object> fmap : flist){
					map.putAll(fmap);
				}
				screenList.add(map);
			}
		}
		List<PatientReservation> patientReservation = patientReservationDao.findByCallCode(code);
		;
		Map<String,Object> rs = new HashedMap();
		rs.put("callRecord",callRecord);
		/*rs.put("consultService",consultService);
		rs.put("orderService",orderService);*/
		rs.put("patientReservation",patientReservation);
		rs.put("consult",consultList);
		rs.put("follow",followList);
		rs.put("survey",surveyList);
		rs.put("screen",screenList);
		return rs;
	}

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

@ -1078,4 +1078,8 @@ public class SynergyManageService extends BaseJpaService {
        }
        return list;
    }
    public void customerHomePage(String userCode){
    }
}