trick9191 7 lat temu
rodzic
commit
ada4e070fa

+ 3 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -33,7 +33,7 @@ public class CallRecord extends IdEntity {
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    private String  adminTeamCode; //签约医生团队
    private Long  adminTeamCode; //签约医生团队
    public String getCode() {
        return code;
@ -195,11 +195,11 @@ public class CallRecord extends IdEntity {
        this.type = type;
    }
    public String getAdminTeamCode() {
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(String adminTeamCode) {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -29,7 +29,7 @@ public class SwaggerConfig extends WebMvcConfigurerAdapter {
                .forCodeGeneration(true)
                .pathMapping("/")
                .select()
                .paths(PathSelectors.regex("/customer/.*"))
                .paths(PathSelectors.any())
                .build()
                .apiInfo(patientApiInfo());
    }

+ 10 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/WebMvcConfig.java

@ -5,6 +5,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@ -17,6 +18,15 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
        configurer.enable();
    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        super.addResourceHandlers(registry);
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
    @Bean
    public InternalResourceViewResolver viewResolver() {
        InternalResourceViewResolver resolver = new InternalResourceViewResolver();

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

@ -205,11 +205,9 @@ public class CustomerController extends BaseController {
    public String addCallRecord(@ApiParam(name="type",value="1.呼入,2.呼出")@RequestParam(required = true)Integer type,
                                 @ApiParam(name="callerNumber",value="呼入号码")@RequestParam(required = true)String callerNumber,
                                 @ApiParam(name="recipientNumber",value="接收号码")@RequestParam(required = true)String recipientNumber,
                                 @ApiParam(name="status",value="接听状态: 1.接通,2. 队列中放弃,3.接通")@RequestParam(required = true)Integer status,
                                 @ApiParam(name="serviceType",value="服务类型")@RequestParam(required = true)Integer serviceType,
                                 @ApiParam(name="serviceContent",value="服务内容")@RequestParam(required = false)String serviceContent){
                                 @ApiParam(name="status",value="接听状态: 1.接通,2. 队列中放弃,3.接通")@RequestParam(required = true)Integer status){
        try {
            return write(200,"保存成功","data",customerService.addCallRecord( getUID(), type, callerNumber, recipientNumber, status, serviceType, serviceContent));
            return write(200,"保存成功","data",customerService.addCallRecord( getUID(), type, callerNumber, recipientNumber, status));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
@ -228,11 +226,25 @@ public class CustomerController extends BaseController {
        }
    }
    @RequestMapping(value = "/updateCallRecordService", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "更新通话记录的服务记录信息")
    public String  updateCallRecordService(@ApiParam(name="code",value="通话记录code")@RequestParam(required = true)String code,
                                           @ApiParam(name="idCard",value="身份证号")@RequestParam(required = true)String idCard,
                                           @ApiParam(name="serviceType",value="服务类型:1.医生转接 2.代理咨询")@RequestParam(required = true)Integer serviceType,
                                           @ApiParam(name="serviceContent",value="服务内容")@RequestParam(required = false) String serviceContent){
        try {
            return write(200,"保存成功","data",customerService.updateCallRecordService(code,idCard,serviceType,serviceContent));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "/updateCallRecordEndTime", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "更新电话记录(更新结束时间)")
    public String  updateCallRecordEndTime(@ApiParam(name="jsonString",value="保存实体json串")@RequestParam(required = true)String jsonString){
    public String  updateCallRecordEndTime(@ApiParam(name="code",value="电话记录code")@RequestParam(required = true)String code){
        try {
            return write(200,"保存成功","data",customerService.updateCallRecordEndTime(jsonString));
            return write(200,"保存成功","data",customerService.updateCallRecordEndTime(code));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -33,7 +33,7 @@ public class CallRecord extends IdEntity {
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    private String  adminTeamCode;
    private Long  adminTeamCode;
    public String getCode() {
        return code;
@ -195,11 +195,11 @@ public class CallRecord extends IdEntity {
        this.type = type;
    }
    public String getAdminTeamCode() {
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(String adminTeamCode) {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
}

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallService.java

@ -43,7 +43,7 @@ public class CallService extends IdEntity {
    private String orderTime; //预约时间段
    private String user; //创建人
    private String userName; //创建人
    private String adminTeamCode; //团队id
    private Long adminTeamCode; //团队id
    public String getCode() {
        return code;
@ -285,11 +285,11 @@ public class CallService extends IdEntity {
        this.user = user;
    }
    public String getAdminTeamCode() {
    public Long getAdminTeamCode() {
        return adminTeamCode;
    }
    public void setAdminTeamCode(String adminTeamCode) {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
}

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

@ -183,21 +183,11 @@ public class CustomerService extends BaseService{
		return resp;
	}
	public Map<String,Object> addCallRecord(String user,Integer type,String callerNumber,String recipientNumber,Integer status,Integer serviceType,String serviceContent){
	public Map<String,Object> addCallRecord(String user,Integer type,String callerNumber,String recipientNumber,Integer status){
		List<Patient> list =  patientDao.findByMobile(callerNumber);
		Map<String,Object> rs = new HashedMap();
		Patient p ;
		if(list==null||list.size()==0){
			rs.put("state",-1);
			rs.put("mes","未找到患者信息");
			rs.put("callRecord",null);
			return rs;
		}else{
			p = list.get(0);
		}
		SignFamily sf = familyService.findByPatientCode(p.getCode());
		User u = userDao.findByCode(user);
		CallRecord callRecord = new CallRecord();
@ -206,18 +196,10 @@ public class CustomerService extends BaseService{
		callRecord.setCallerNumber(callerNumber);
		callRecord.setRecipientNumber(recipientNumber);
		callRecord.setAnswerStatus(status);
		callRecord.setServiceType(serviceType);
		callRecord.setServiceContent(serviceContent);
		callRecord.setCreateTime(new Date());
		callRecord.setCallTime(new Date());
		callRecord.setUserCode(user);
		callRecord.setUserName(u.getName());
		callRecord.setPatient(p.getCode());
		callRecord.setPatientName(p.getName());
		callRecord.setIdcard(p.getIdcard());
		callRecord.setSsc(p.getSsc());
		callRecord.setDoctor(sf.getDoctor());
		callRecord.setDoctorName(sf.getDoctorName());
		CallRecord temp = callRecordDao.save(callRecord);
		rs.put("state",1);
@ -227,6 +209,8 @@ public class CustomerService extends BaseService{
		return rs;
	}
	public String  updateCallRecord(String jsonString){
		net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonString);
		CallRecord callRecord =(CallRecord)net.sf.json.JSONObject.toBean(json,CallRecord.class);
@ -234,9 +218,47 @@ public class CustomerService extends BaseService{
		return "1";
	}
	public String  updateCallRecordEndTime(String jsonString){
		net.sf.json.JSONObject json = net.sf.json.JSONObject.fromObject(jsonString);
		CallRecord callRecord =(CallRecord)net.sf.json.JSONObject.toBean(json,CallRecord.class);
	public Map<String,Object> updateCallRecordService(String code,String idCard,Integer serviceType,String serviceContent){
		CallRecord callRecord = callRecordDao.findByCode(code);
		Patient p =  patientDao.findByIdcard(idCard);
		Map<String,Object> rs = new HashedMap();
		if(p==null){
			rs.put("state",-1);
			rs.put("mes","未找到患者信息");
			rs.put("callRecord",null);
			return rs;
		}
		SignFamily sf = familyService.findByPatientCode(p.getCode());
		if(p==null){
			rs.put("state",-2);
			rs.put("mes","未找到患者签约信息");
			rs.put("callRecord",null);
			return rs;
		}
		//存储患者信息信息
		callRecord.setPatient(p.getCode());
		callRecord.setPatientName(p.getName());
		callRecord.setIdcard(p.getIdcard());
		callRecord.setSsc(p.getSsc());
		//存储医生信息
		callRecord.setDoctor(sf.getDoctor());
		callRecord.setDoctorName(sf.getDoctorName());
		callRecord.setServiceType(serviceType);
		callRecord.setServiceContent(serviceContent);
		callRecord.setAdminTeamCode(sf.getAdminTeamId());
		CallRecord call = callRecordDao.save(callRecord);
		rs.put("state",1);
		rs.put("mes","保存成功");
		rs.put("callRecord",call);
		return rs;
	}
	public String  updateCallRecordEndTime(String code){
		CallRecord callRecord = callRecordDao.findByCode(code);
		callRecord.setEndTime(new Date());
		callRecord.setTalkTime(DateUtil.getTimeDifference(callRecord.getCreateTime(),callRecord.getEndTime()));
		callRecordDao.save(callRecord);