Просмотр исходного кода

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 6 лет назад
Родитель
Сommit
0b32939293

+ 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,"查询失败!");
        }
    }

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

@ -83,8 +83,8 @@ public class CustomerQuestionnaireController extends BaseController {
                                 @ApiParam(value = "客服code") @RequestParam String customerCode) {
        try {
            //判断是否有异常中断
            Integer count = synergyManageService.findExceptionCount(workorderCode, customerCode);
            return write(200, "查询成功!", "data", count > 0 ? true : false);
            String workorderServiceCode = synergyManageService.isNotException(workorderCode, customerCode);
            return write(200, "查询成功!", "data", workorderServiceCode);
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "查询失败!");
@ -93,10 +93,9 @@ public class CustomerQuestionnaireController extends BaseController {
    @RequestMapping(value = "loadingInfo", method = RequestMethod.GET)
    @ApiOperation(value = "载入异常工单信息")
    public String loadingInfo(@ApiParam(value = "协同服务工单code") @RequestParam String workorderCode,
                                 @ApiParam(value = "客服code") @RequestParam String customerCode) {
    public String loadingInfo(@ApiParam(value = "协同服务对象code") @RequestParam String workorderServiceCode) {
        try {
            return write(200, "查询成功!", "data", synergyManageService.loadingInfo(workorderCode, customerCode));
            return write(200, "查询成功!", "data", synergyManageService.loadingInfo(workorderServiceCode));
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "查询失败!");

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

@ -47,7 +47,7 @@ public class CustomerSynergyManageController extends BaseController {
                                @RequestParam(required = true)String workorderCode,
                                @ApiParam(name="patient",value="居民code")
                                @RequestParam(required = false)String patient,
                                @ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
                                @ApiParam(name="role",value="1医生,2普通客服,3客服管理员")
                                @RequestParam(required = true)Integer role){
        try {
            return write(200,"请求成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
@ -243,9 +243,12 @@ public class CustomerSynergyManageController extends BaseController {
    public String saveCallLabel(@ApiParam(name="callCode",value="通话记录code")@RequestParam(value = "callCode")String callCode,
                                @ApiParam(name="callLabels",value="通话标签,多个用逗号隔开")@RequestParam(value = "callLabels",required = false)String callLabels){
        try{
            String sql ="UPDATE manage_call_record SET call_label='"+callLabels+"' WHERE `code`='"+callCode+"'";
            jdbcTemplate.update(sql);
            return write(200,"保存成功!");
            int result = synergyManageService.saveCallLabel(callLabels,callCode);
            if (result>0){
                return write(200,"保存成功!");
            }else {
                return write(-1,"保存失败!");
            }
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"保存失败!");
@ -254,7 +257,7 @@ public class CustomerSynergyManageController extends BaseController {
    @RequestMapping(value = "getCallInfo",method = RequestMethod.GET)
    @ApiOperation(value = "获取通话的详情")
    public String getCallTypeAndContent(@ApiParam(name="callCode",value="通话记录code")@RequestParam(required = false)String callCode){
    public String getCallTypeAndContent(@ApiParam(name="callCode",value="通话记录code")@RequestParam(value ="callCode")String callCode){
        try{
            CallRecord callRecord = callRecordDao.findByCode(callCode);
            return write(200,"查询成功!","data",callCode);
@ -270,9 +273,12 @@ public class CustomerSynergyManageController extends BaseController {
                                @ApiParam(name="serviceType",value="服务类型,多个用逗号隔开")@RequestParam(value = "serviceType",required = false)String serviceType,
                               @ApiParam(name="serviceContent",value="服务记录")@RequestParam(value = "serviceContent",required = false)String serviceContent){
        try{
            String sql ="UPDATE manage_call_record SET service_type='"+serviceType+"',service_content='"+serviceContent+"' WHERE `code`='"+callCode+"'";
            jdbcTemplate.update(sql);
            return write(200,"保存成功!");
            int result = synergyManageService.saveCallInfo(serviceType,serviceContent,callCode);
            if (result>0){
                return write(200,"保存成功!");
            }else {
                return write(-1,"保存失败!");
            }
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"保存失败!");
@ -309,6 +315,18 @@ public class CustomerSynergyManageController extends BaseController {
        }
    }
    @RequestMapping(value = "customerIndex",method = RequestMethod.GET)
    @ApiOperation(value = "客服首页")
    public String customerIndex(@ApiParam(name="userCode",value="客服code")@RequestParam(value ="userCode")String userCode){
        try{
            return write(200,"获取成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"获取失败!");
        }
    }
    @RequestMapping(value = "exportWorkorder", method = RequestMethod.GET)
    @ApiOperation("客服系统-协同服务列表")
    public String exportWorkorder(@ApiParam(name = "userCode", value = "客服code", required = false)

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

@ -16,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 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyDeviceService.java

@ -192,9 +192,11 @@ public class WlyyDeviceService {
            device.setIsBinding(0);
            //判断设备是否导入
            Integer count = deviceDao.existDeviceCode(device.getDeviceCode());
            if(count == 0) {
                deviceList.add(device);
            if(count != 0) {
                WlyyDevice wlyyDevice = deviceDao.findByDeviceCode(device.getDeviceCode());
                device.setId(wlyyDevice.getId());
            }
            deviceList.add(device);
        }
        deviceDao.save(deviceList);
        return true;

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

@ -1,6 +1,11 @@
package com.yihu.wlyy.service.synergy;
import com.yihu.wlyy.entity.*;
import com.yihu.wlyy.entity.call.CallRecord;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
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.entity.synergy.*;
import com.yihu.wlyy.repository.*;
import com.yihu.wlyy.repository.synergy.*;
@ -10,10 +15,12 @@ import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.util.query.BaseJpaService;
import jxl.Workbook;
import jxl.write.*;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -303,17 +310,19 @@ public class SynergyManageService extends BaseJpaService {
     */
    public Map<String, Object> getWorkOrderInfo(String workorderCode, String patient, Integer role) {
        Map<String, Object> map = new HashMap<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        ManageSynergyWorkorderDO workorderDO = workOrderDao.findByCode(workorderCode);
        Integer status = workorderDO.getStatus();
        //存入协同服务工单信息
        map.put("code", workorderCode);
        map.put("type", workorderDO.getType());
        map.put("priority", workorderDO.getPriority());
        map.put("serviceTime", workorderDO.getServiceTime());
        map.put("serviceTime", s.format(workorderDO.getServiceTime()));
        map.put("status", status);
        map.put("title", workorderDO.getRelationCodeName());
        map.put("remark", workorderDO.getRemark());
        map.put("createTime", workorderDO.getCreateTime());
        map.put("createTime", sdf.format(workorderDO.getCreateTime()));
        map.put("createUserName", workorderDO.getCreateUserName());
        map.put("hospitalName", workorderDO.getHospitalName());
@ -321,10 +330,10 @@ public class SynergyManageService extends BaseJpaService {
        if(StringUtils.isNotBlank(patient)){
            //获取单个居民处理完成的工单信息
            ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderCode, patient);
            map.put("servicerKey", workorderServicerDO.getServicePatientName());
            map.put("patientName", workorderServicerDO.getServicePatientName());
            map.put("idcard", workorderServicerDO.getIdcard());
            map.put("ssc", workorderServicerDO.getSsc());
            map.put("completeTime", workorderServicerDO.getCompleteTime());
            map.put("completeTime", sdf.format(workorderServicerDO.getCompleteTime()));
        }else {
            if(status == 2 || status == 3){
                //获取工单完成人数
@ -338,7 +347,7 @@ public class SynergyManageService extends BaseJpaService {
        //超时标签
        map.put("delayStatus", this.isServiceOverTime(workorderDO.getServiceTime()));
        //根据角色显示对应工单状态
        if(workorderDO.getCreateUserType() == 1 && role == 2){
        if(workorderDO.getCreateUserType() == 1 && role == 3){
            map.put("status", "待接收");
        }else if(workorderDO.getCreateUserType() == 2 && role == 1){
            map.put("status", "未接收");
@ -347,7 +356,7 @@ public class SynergyManageService extends BaseJpaService {
        if(status == 2){
            //接收者
            map.put("receiverName", workorderDO.getReceiverName());
            map.put("receiverTime", workorderDO.getReceiverTime());
            map.put("receiverTime", sdf.format(workorderDO.getReceiverTime()));
            //获取负责人信息
            List<ManageSynergyWorkorderExecutorDO> managerList = workorderExecutorDao.findByWorkorderCode(workorderCode,1);
            List<ManageSynergyWorkorderExecutorDO> collaboratorList = workorderExecutorDao.findByWorkorderCode(workorderCode,2);
@ -600,13 +609,20 @@ public class SynergyManageService extends BaseJpaService {
     * @param customerCode
     * @return
     */
    public Integer findExceptionCount(String workorderCode, String customerCode) {
        return customerLogDao.findExceptionCount(workorderCode, customerCode);
    public String isNotException(String workorderCode, String customerCode) {
        String sql = "SELECT cl.workorder_service_code  from manage_synergy_workorder_customer_log cl " +
                "where cl.workorder_service_code not in (SELECT l.workorder_service_code from manage_synergy_workorder_customer_log l where l.`status` = 2) " +
                "and cl.workorder_code = '" + workorderCode + "' and cl.create_user_code= '" + customerCode + "' " +
                "GROUP BY cl.workorder_code, cl.create_user_code " +
                "ORDER BY cl.create_time LIMIT 0, 1";
        String  workorderServiceCode = jdbcTemplate.queryForObject(sql, String.class);
        return workorderServiceCode;
    }
    public Map<String, Object> loadingInfo(String workorderCode, String customerCode) {
    public Map<String, Object> loadingInfo(String workorderServiceCode) {
        Map<String,Object> resultMap = new HashMap<>();
        String sql = "SELECT s.service_patient_name, s.service_patient_code, s.`code`, s.hospital_name,s.town_name " +
        ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByCode(workorderServiceCode);
        /*String sql = "SELECT s.service_patient_name, s.service_patient_code, s.`code`, s.s.hospital_name,s.town_name " +
                "from (SELECT DISTINCT r.patient,cl.workorder_code from manage_synergy_workorder_customer_log cl " +
                "LEFT JOIN manage_call_record r on cl.call_code = r.`code` " +
                "where cl.workorder_code = '" + workorderCode + "' and cl.create_user_code = '" + customerCode + "' and cl.`status` = 0 ORDER BY cl.create_time LIMIT 0,1) p " +
@ -614,10 +630,12 @@ public class SynergyManageService extends BaseJpaService {
        Map<String, Object> result = (Map<String, Object>) jdbcTemplate.queryForList(sql);
        String patientCode = (String) result.get("service_patient_name");
        */
        String patientCode = workorderServicerDO.getServicePatientName();
        resultMap.put("patientName", patientCode);
        resultMap.put("townName", result.get("town_name"));//所属区县
        resultMap.put("hospitalName", result.get("hospital_name"));//所属社区
        Integer callNum = customerLogDao.callNumByWorkorder((String) result.get("code"));
        resultMap.put("townName", workorderServicerDO.getTownName());//所属区县
        resultMap.put("hospitalName", workorderServicerDO.getHospitalName());//所属社区
        Integer callNum = customerLogDao.callNumByWorkorder(workorderServiceCode);
        resultMap.put("callNum",callNum);//已呼叫次数
        resultMap.putAll(this.getPatientInfo(patientCode));
        return resultMap;
@ -1163,6 +1181,66 @@ public class SynergyManageService extends BaseJpaService {
        return list;
    }
    public int saveCallLabel(String callLabels,String callCode){
        String sql ="UPDATE manage_call_record SET call_label='"+callLabels+"' WHERE `code`='"+callCode+"'";
        return  jdbcTemplate.update(sql);
    }
    public int saveCallInfo(String serviceType,String serviceContent,String callCode){
        String sql ="UPDATE manage_call_record SET service_type='"+serviceType+"',service_content='"+serviceContent+"' WHERE `code`='"+callCode+"'";
        return  jdbcTemplate.update(sql);
    }
    public void customerIndex(String userCode){
        Map<String,Object> map = new HashMap<>();
        String today = DateUtil.dateToStrShort(new Date());
        String callSql ="SELECT * FROM manage_call_record WHERE user_code='"+userCode+"' and create_time>='"+today+" 00:00:00' and create_time<='"+today+" 23:59:59'";
        //今日外呼量
        List<CallRecord> waihudList = jdbcTemplate.query(callSql+" and type=2",new BeanPropertyRowMapper<>(CallRecord.class));
        int customerNoCount = 0;
        int hours = 0;
        int minutes = 0;
        int seconds = 0;
        for(CallRecord callRecord : waihudList){
            //求总时长
            if (callRecord.getAnswerStatus()==1){
                String talkTime = callRecord.getTalkTime();
                String[] talkTimeStr = talkTime.split(":");
                for (int i=0;i<talkTimeStr.length;i++){
                    if (i==0){
                        hours += Integer.valueOf(talkTimeStr[i]);
                    }
                    if (i==1){
                        minutes += Integer.valueOf(talkTimeStr[i]);
                    }
                    if (i==2){
                        seconds += Integer.valueOf(talkTimeStr[i]);
                    }
                }
            }
            //获取客户未接通数量
            if(callRecord.getAnswerStatus()==3){
                customerNoCount++;
            }
        }
        String avgTalkTime = "";
        seconds = hours*3600+minutes*60+seconds;
        avgTalkTime =seconds/3600+"时";
        if (seconds%3600==0){
           avgTalkTime +="0分0秒";
        }else {
           if (seconds%3600%60==0){
               avgTalkTime +=seconds%3600/60+"分0秒";
           }else {
               avgTalkTime +=seconds%3600/60+"分"+seconds%3600%60+"秒";
           }
        }
        map.put("waihuCount",waihudList.size());
        map.put("waihuCustomerNoCount",customerNoCount);
        map.put("waihuAvgTalkTime",avgTalkTime);
    }
    /**
     *
     * @param workorderCode

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -60,9 +60,9 @@ spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    device:
      url: jdbc:mysql://172.19.103.77/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root

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

@ -1944,14 +1944,14 @@ public class ManagerQuestionnaireService extends BaseService {
     */
    public String saveQuestionResultAndAnswer(JSONObject jsonData, String patientCode, String customerCode) throws Exception {
        String surveyCode = jsonData.get("surveyCode").toString();
        SurveyTemplates templates = surveyTemplatesDao.findById(surveyCode);
        Survey survey = surveyDao.findById(surveyCode);
        Patient patient = patientDao.findByCode(patientCode);
        User user = userDao.findByCode(customerCode);
        SurveyQuestionResult questionResult =  new SurveyQuestionResult();
        String code = getCode();
        questionResult.setCode(code);
        questionResult.setTemplateCode(templates.getCode());
        questionResult.setTemplateTitle(templates.getTitle());
        questionResult.setTemplateCode(survey.getCode());
        questionResult.setTemplateTitle(survey.getTitle());
        questionResult.setPatientCode(patient.getCode());
        questionResult.setPatientName(patient.getName());
        questionResult.setType(1);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -52,7 +52,7 @@ rehabilitation:
  url: http://localhost:10055/svr-wlyy-rehabilitation/
#集美客服配置
customerService:
  url: http://localhost:8082/
  url: http://localhost:8180/
#小程序
applets: