19 files added
19 files modified
| | |
| | | @PostMapping(value = "/smsChangLan/send") |
| | | ResultBody sendVerificationCode(@RequestBody Map map); |
| | | |
| | | /** |
| | | * feign rpc访问远程 接口 可爱高小程序短信接口 |
| | | */ |
| | | @PostMapping(value = "/smsChangLan/sendKagMess") |
| | | ResultBody sendKagMess(@RequestBody Map map); |
| | | } |
| | |
| | | public ResultBody sendVerificationCode(Map ma) { |
| | | return ResultBody.failed("短息调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody sendKagMess(Map map) { |
| | | return ResultBody.failed("可爱高短息调用失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | fileFolder += "Customer/Hospital/" + folderByDate + "/"; |
| | | } else if (imgType.toLowerCase().equals("customerhead")) { |
| | | fileFolder += "Customer/HeadImg/" + folderByDate + "/"; |
| | | }else if (imgType.toLowerCase().equals("customeradvisory")) { |
| | | fileFolder += "Customer/Advisory/" + folderByDate + "/"; |
| | | }else { |
| | | fileFolder += "OtherImage/" + folderByDate + "/"; |
| | | } |
| | |
| | | fileFolder += "Customer/Hospital/" + folderByDate + "/"; |
| | | } else if (imgType.toLowerCase().equals("customerhead")) { |
| | | fileFolder += "Customer/HeadImg/" + folderByDate + "/"; |
| | | }else if (imgType.toLowerCase().equals("customeradvisory")) { |
| | | fileFolder += "Customer/Advisory/" + folderByDate + "/"; |
| | | }else { |
| | | fileFolder += "OtherImage/" + folderByDate + "/"; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.sms.util.SmsChuangLanUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | |
| | | @RestController |
| | | @RequestMapping("smsChangLan") |
| | |
| | | return ResultBody.failed("该手机号没有验证码"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 可爱高小程序发送短信 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "可爱高小程序发送短信") |
| | | @PostMapping("/sendKagMess") |
| | | public ResultBody sendKagMess(@RequestBody Map map){ |
| | | try { |
| | | String phone = MapUtils.getString(map, "phone"); |
| | | if (StringUtils.isBlank(phone)) { |
| | | return ResultBody.failed("手机号无效"); |
| | | } |
| | | String sendContent = MapUtils.getString(map, "content"); |
| | | //region 组装发送消息的内容 |
| | | //API账号 |
| | | map.put("account", CHUANGLAN_SMS_ACCOUNT); |
| | | //API密码 |
| | | map.put("password", CHUANGLAN_SMS_PASSWORD); |
| | | map.put("msg", sendContent); |
| | | //endregion |
| | | |
| | | String send = SmsChuangLanUtils.send(map, CHUANGLAN_SMS_SENDURL); |
| | | JSONObject jsonObject = JSON.parseObject(send); |
| | | if ("0".equals(jsonObject.get("code"))) { |
| | | return ResultBody.ok().msg("发送短信成功"); |
| | | } |
| | | }catch (Exception ex){ |
| | | return ResultBody.failed().msg("发送短信错误"); |
| | | } |
| | | return ResultBody.failed().msg("发送短信失败"); |
| | | } |
| | | |
| | | //获取 存放 Redis的时间 秒(到今晚的秒数) |
| | | public Long getSecondsNextEarlyMorning() { |
| | | Date afterDay = DateUtils.getAfterDay(new Date()); |
| | |
| | | try { |
| | | System.out.println("Topic Receiver : " + messages); |
| | | // 通知 MQ 消息已被成功消费,可以ACK了 |
| | | channel.basicAck(deliveryTag, false); |
| | | channel.basicAck(deliveryTag, false); channel.basicAck(deliveryTag, false); |
| | | } |
| | | catch (Exception e) { |
| | | try { |
New file |
| | |
| | | package com.kidgrow.oprationcenter.feign; |
| | | |
| | | import com.kidgrow.common.constant.ServiceNameConstants; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.feign.fallback.AdvisoryDoctorServiceFallbackFactory; |
| | | import com.kidgrow.ribbon.config.FeignHttpInterceptorConfig; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/11/16 15:54 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @FeignClient(value = ServiceNameConstants.OPRATION_SERVER,configuration= FeignHttpInterceptorConfig.class, |
| | | fallbackFactory = AdvisoryDoctorServiceFallbackFactory.class, decode404 = true) |
| | | public interface AdvisoryDoctorService { |
| | | /** |
| | | * 通过ID查询医生信息,C端接口 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping("/advisorydoctor/getDoctorById") |
| | | ResultBody getDoctorById(@RequestBody Map<String, Object> map); |
| | | |
| | | /** |
| | | * 通过ID修改医生信息,C端接口 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping("/advisorydoctor/updateDoctorInfo") |
| | | ResultBody updateDoctorInfo(@RequestBody Map<String, Object> map); |
| | | |
| | | /** |
| | | * 通过ID查询筛查 咨询医生信息,C端接口 |
| | | * @param hospitalId |
| | | * @return |
| | | */ |
| | | @PostMapping("/advisorydoctor/getSreeningAdvisoryDoctor") |
| | | ResultBody getSreeningAdvisoryDoctor(@RequestParam("hospitalId") String hospitalId); |
| | | |
| | | /** |
| | | * 获取咨询医生信息,C端接口 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @PostMapping("/advisorydoctor/getAdvisoryDoctorList") |
| | | ResultBody getAdvisoryDoctorList(@RequestBody Map<String,Object> map); |
| | | |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.feign.fallback; |
| | | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.feign.AdvisoryDoctorService; |
| | | import feign.hystrix.FallbackFactory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class AdvisoryDoctorServiceFallbackFactory implements FallbackFactory<AdvisoryDoctorService> { |
| | | |
| | | @Override |
| | | public AdvisoryDoctorService create(Throwable throwable) { |
| | | return new AdvisoryDoctorService() { |
| | | @Override |
| | | public ResultBody getDoctorById(Map<String, Object> map) { |
| | | return ResultBody.failed().msg("AdvisoryDoctorService-getDoctorById的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody updateDoctorInfo(Map<String, Object> map) { |
| | | return ResultBody.failed().msg("AdvisoryDoctorService-updateDoctorInfo的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody getSreeningAdvisoryDoctor(String hospitalId) { |
| | | return ResultBody.failed().msg("AdvisoryDoctorService-getSreeningAdvisoryDoctor的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody getAdvisoryDoctorList(Map<String, Object> map) { |
| | | return ResultBody.failed().msg("AdvisoryDoctorService-getAdvisoryDoctorList的FeignClient调用失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:13 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("advisory_doctor_info") |
| | | public class AdvisoryDoctorInfo extends SuperModel { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 医生ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long doctorId; |
| | | |
| | | /** |
| | | * 价格 |
| | | */ |
| | | private double price; |
| | | |
| | | /** |
| | | * 最大人数 |
| | | */ |
| | | private int maxPeople; |
| | | |
| | | /** |
| | | * 开通服务,1图文,2电话,3全部 |
| | | */ |
| | | private int service; |
| | | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | private int isDel; |
| | | |
| | | /** |
| | | * 芝麻客服插件场景地址 |
| | | */ |
| | | private String channel; |
| | | |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String latitude; |
| | | |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String longitude; |
| | | |
| | | /** |
| | | * 医生姓名 |
| | | */ |
| | | private String doctorName; |
| | | |
| | | /** |
| | | * 医院名称 |
| | | */ |
| | | private String hospitalName; |
| | | |
| | | /** |
| | | * 医院ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long hospitalId; |
| | | |
| | | /** |
| | | * 预约时间 |
| | | */ |
| | | @TableField(exist = false) |
| | | private String[] appointment; |
| | | |
| | | /** |
| | | * 部门ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | private String deptName; |
| | | |
| | | /** |
| | | * 特长 |
| | | */ |
| | | private String specialty; |
| | | |
| | | /** |
| | | * 职称 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 简介 |
| | | */ |
| | | private String introduction; |
| | | |
| | | /** |
| | | * 头像 |
| | | */ |
| | | private String head; |
| | | |
| | | /** |
| | | * 绑定手机号 |
| | | */ |
| | | private String bindPhone; |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:21 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("appointment_time") |
| | | public class AppointmentTime extends SuperModel { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 咨询ID |
| | | */ |
| | | private Long advisoryId; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * 上午 |
| | | */ |
| | | private int morning; |
| | | |
| | | /** |
| | | * 下午 |
| | | */ |
| | | private int afternoon; |
| | | |
| | | /** |
| | | * 晚上 |
| | | */ |
| | | private int evening; |
| | | |
| | | } |
| | |
| | | <artifactId>alipay-sdk-java</artifactId> |
| | | <version>4.10.124.ALL</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-report-center-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-advisory-center-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-user-center-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | package com.kidgrow.oprationcenter.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:38 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | public interface AdvisoryDoctorInfoMapper extends SuperMapper<AdvisoryDoctorInfo> { |
| | | |
| | | /** |
| | | * 获取咨询医生列表 |
| | | * |
| | | * @return |
| | | */ |
| | | List<AdvisoryDoctorInfo> findList(Page<AdvisoryDoctorInfo> page, @Param("p") Map<String, Object> params); |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int removeById(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 根据条件查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<AdvisoryDoctorInfo> findByObject(@Param("p") Map<String, Object> params); |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.mapper; |
| | | |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.AppointmentTime; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:39 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | public interface AppointmentTimeMapper extends SuperMapper<AppointmentTime> { |
| | | |
| | | /** |
| | | * 通过咨询ID删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int delByAdvisoryId(@Param("id") Long id); |
| | | |
| | | /** |
| | | * 通过咨询ID查询预约时间 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<AppointmentTime> queryByAdvisoryId(@Param("advisoryId") Long id); |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.kidgrow.advisory.model.AdvisoryDoctorSummary; |
| | | import com.kidgrow.advisory.model.AdvisoryManager; |
| | | import com.kidgrow.advisory.model.AdvisorySummary; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo; |
| | | import com.kidgrow.user.model.UserInfo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:32 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | public interface IAdvisoryDoctorInfoService extends IService<AdvisoryDoctorInfo> { |
| | | |
| | | /** |
| | | * 医生列表 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<AdvisoryDoctorInfo> findList(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int removeById(Long id); |
| | | |
| | | /** |
| | | * 根据条件查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<AdvisoryDoctorInfo> findByObject(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 修改咨询医生信息 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | ResultBody updateDoctorInfo(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 查询医生信息 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | ResultBody getDoctorById(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 获取筛查咨询医生列表 |
| | | * |
| | | * @param hospitalId |
| | | * @return |
| | | */ |
| | | ResultBody getSreeningAdvisoryDoctorList(Long hospitalId); |
| | | |
| | | /** |
| | | * 获取咨询医生列表 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | ResultBody getAdvisoryDoctorList(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 咨询列表调用C端接口 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<AdvisoryManager> findAll(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 后台更新咨询状态 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ResultBody updateStatusByService(String id); |
| | | |
| | | /** |
| | | * 通过 绑定手机号查询C段用户 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | UserInfo getUserByPhone(String phone); |
| | | |
| | | /** |
| | | * 微信退款 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | ResultBody refund(@RequestBody Map<String, Object> map); |
| | | |
| | | /** |
| | | * 按照月/年查询咨询统计数据 |
| | | * |
| | | * @param map type:1月,2年 |
| | | * riqi: 时间 |
| | | * @return |
| | | */ |
| | | PageResult<AdvisorySummary> summaryBate(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 咨询医生统计数据 |
| | | * |
| | | * @param map startTime/EndTime |
| | | * @return |
| | | */ |
| | | PageResult<AdvisoryDoctorSummary> summaryDoctorByBate(Map<String, Object> map); |
| | | |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.kidgrow.oprationcenter.model.AppointmentTime; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:33 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | public interface IAppointmentTimeService extends IService<AppointmentTime> { |
| | | |
| | | /** |
| | | * 保存 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | boolean save(Map<String,Object> map); |
| | | |
| | | /** |
| | | * 通过咨询ID查询预约时间 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | String queryByAdvisoryId(Long id); |
| | | |
| | | /** |
| | | * 通过咨询ID查询预约时间 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<AppointmentTime> findByAdvisoryId(Long id); |
| | | |
| | | /** |
| | | * 通过咨询ID删除预约时间 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | int delByAdvisoryId(Long id); |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.advisory.model.AdvisoryDoctorSummary; |
| | | import com.kidgrow.advisory.model.AdvisoryManager; |
| | | import com.kidgrow.advisory.model.AdvisorySummary; |
| | | import com.kidgrow.advisory.model.feign.AdvisoryService; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.mapper.AdvisoryDoctorInfoMapper; |
| | | import com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo; |
| | | import com.kidgrow.oprationcenter.model.AppointmentTime; |
| | | import com.kidgrow.oprationcenter.model.HospitalScreening; |
| | | import com.kidgrow.oprationcenter.service.IAdvisoryDoctorInfoService; |
| | | import com.kidgrow.oprationcenter.service.IAppointmentTimeService; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.user.feign.UserInfoService; |
| | | import com.kidgrow.user.model.UserInfo; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:34 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | |
| | | public class AdvisoryDoctorInfoServiceImpl extends SuperServiceImpl<AdvisoryDoctorInfoMapper, AdvisoryDoctorInfo> implements IAdvisoryDoctorInfoService { |
| | | |
| | | @Autowired |
| | | private SysDoctorService doctorService; |
| | | |
| | | @Autowired |
| | | private IAppointmentTimeService appointmentTimeService; |
| | | |
| | | @Autowired |
| | | private AdvisoryService advisoryService; |
| | | |
| | | @Autowired |
| | | private UserInfoService userInfoService; |
| | | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | /** |
| | | * 医生列表 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<AdvisoryDoctorInfo> findList(Map<String, Object> params) { |
| | | Page<AdvisoryDoctorInfo> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<AdvisoryDoctorInfo> list = baseMapper.findList(page, params); |
| | | return PageResult.<AdvisoryDoctorInfo>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 通过ID删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int removeById(Long id) { |
| | | return baseMapper.removeById(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件查询 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<AdvisoryDoctorInfo> findByObject(Map<String, Object> params) { |
| | | return baseMapper.findByObject(params); |
| | | } |
| | | |
| | | /** |
| | | * 更新医生信息 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResultBody updateDoctorInfo(Map<String, Object> map) { |
| | | //医生ID |
| | | String id = MapUtils.getString(map, "doctorId"); |
| | | //价格 |
| | | double price = MapUtils.getDouble(map, "price") * 100; |
| | | //最大人数 |
| | | int maxPeople = MapUtils.getIntValue(map, "maxPeople"); |
| | | //预约时间 |
| | | String appointmments = JSONArray.toJSONString(map.get("appointments")); |
| | | |
| | | AdvisoryDoctorInfo advisoryDoctorInfo = baseMapper.selectById(Long.parseLong(id)); |
| | | if (advisoryDoctorInfo == null) { |
| | | return ResultBody.failed().msg("查询医生信息失败"); |
| | | } |
| | | |
| | | AdvisoryDoctorInfo adi = new AdvisoryDoctorInfo(); |
| | | adi.setId(Long.parseLong(id)); |
| | | adi.setPrice(price); |
| | | adi.setMaxPeople(maxPeople); |
| | | |
| | | int b = baseMapper.updateById(adi); |
| | | if (b == 0) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return ResultBody.failed().msg("操作失败"); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(appointmments)) { |
| | | appointmentTimeService.delByAdvisoryId(Long.parseLong(id)); |
| | | List<AppointmentTime> times = JSONArray.parseArray(appointmments, AppointmentTime.class); |
| | | for (AppointmentTime time : times) { |
| | | time.setAdvisoryId(Long.parseLong(id)); |
| | | appointmentTimeService.saveOrUpdate(time); |
| | | } |
| | | |
| | | } |
| | | |
| | | return ResultBody.ok().msg("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询咨询医生详情 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody getDoctorById(Map<String, Object> map) { |
| | | //医生ID |
| | | String id = MapUtils.getString(map, "doctorId"); |
| | | //是否需要查询预约时间 |
| | | int apppointmentFlag = MapUtils.getIntValue(map, "apppointmentFlag"); |
| | | |
| | | AdvisoryDoctorInfo byId = baseMapper.selectById(Long.parseLong(id)); |
| | | if (byId == null) { |
| | | return ResultBody.failed().msg("未找到医生信息"); |
| | | } |
| | | |
| | | ResultBody byId1 = doctorService.findById(byId.getDoctorId()); |
| | | if (byId1.getCode() != 0 || byId1.getData() == null) { |
| | | return ResultBody.failed().msg("查询医生信息失败"); |
| | | } |
| | | |
| | | JSONObject doctor = JSONObject.parseObject(JSONObject.toJSONString(byId1.getData())); |
| | | |
| | | JSONObject json = new JSONObject(); |
| | | json.put("doctorName", doctor.getString("doctorName")); |
| | | json.put("departmentName", doctor.getString("departmentName")); |
| | | json.put("hospitalName", doctor.getString("hospitalName")); |
| | | json.put("head", doctor.getString("doctorLogo")); |
| | | json.put("phone", doctor.getString("doctorTel")); |
| | | json.put("otherLink", doctor.getString("doctorOtherLink")); |
| | | json.put("about", doctor.getString("doctorAbout")); |
| | | json.put("price", byId.getPrice() / 100); |
| | | json.put("specialty", byId.getSpecialty()); |
| | | json.put("service", byId.getService()); |
| | | json.put("maxPeople", byId.getMaxPeople()); |
| | | json.put("rank", doctor.getString("doctorRank")); |
| | | |
| | | if (apppointmentFlag == 1) { |
| | | List<AppointmentTime> byAdvisoryId = appointmentTimeService.findByAdvisoryId(Long.parseLong(id)); |
| | | if (byAdvisoryId.size() > 0) { |
| | | JSONArray array = new JSONArray(); |
| | | JSONObject obj = null; |
| | | for (AppointmentTime app : byAdvisoryId) { |
| | | obj = new JSONObject(); |
| | | obj.put("name", app.getName()); |
| | | obj.put("afternoon", app.getAfternoon()); |
| | | obj.put("evening", app.getEvening()); |
| | | obj.put("morning", app.getMorning()); |
| | | |
| | | array.add(obj); |
| | | } |
| | | json.put("appointments", array); |
| | | } |
| | | } |
| | | |
| | | return ResultBody.ok().data(json); |
| | | } |
| | | |
| | | /** |
| | | * 获取筛查咨询医生列表 |
| | | * |
| | | * @param hospitalId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody getSreeningAdvisoryDoctorList(Long hospitalId) { |
| | | Map<String, Object> map = new HashMap<>(16); |
| | | map.put("hospitalId", hospitalId); |
| | | |
| | | JSONArray array = new JSONArray(); |
| | | JSONObject json = null; |
| | | List<AdvisoryDoctorInfo> byObject = baseMapper.findByObject(map); |
| | | if (byObject.size() > 0) { |
| | | for (AdvisoryDoctorInfo doc : byObject) { |
| | | json = new JSONObject(); |
| | | json.put("doctorName", doc.getDoctorName()); |
| | | json.put("departmentName", doc.getDeptName()); |
| | | json.put("hospitalName", doc.getHospitalName()); |
| | | json.put("head", doc.getHead()); |
| | | json.put("about", doc.getIntroduction()); |
| | | json.put("price", doc.getPrice() / 100); |
| | | json.put("specialty", doc.getSpecialty()); |
| | | json.put("service", doc.getService()); |
| | | json.put("id", String.valueOf(doc.getId())); |
| | | |
| | | ResultBody byId1 = doctorService.findById(doc.getDoctorId()); |
| | | if (byId1.getCode() == 0 || byId1.getData() != null) { |
| | | JSONObject doctor = JSONObject.parseObject(JSONObject.toJSONString(byId1.getData())); |
| | | json.put("rank", doctor.getString("doctorRank")); |
| | | } |
| | | |
| | | array.add(json); |
| | | } |
| | | } |
| | | return ResultBody.ok().data(array).msg("操作成功"); |
| | | } |
| | | |
| | | /** |
| | | * 获取咨询医生列表 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody getAdvisoryDoctorList(Map<String, Object> map) { |
| | | double lat = MapUtils.getDouble(map, "lat"); |
| | | double lon = MapUtils.getDouble(map, "lon"); |
| | | String excludeHospitalId = MapUtils.getString(map, "excludeHospitalId"); |
| | | |
| | | List<Map<String, Object>> array = new ArrayList<>(); |
| | | Map<String, Object> json = null; |
| | | |
| | | //根据筛查医院ID换取医院ID |
| | | if (StringUtils.isNotBlank(excludeHospitalId)) { |
| | | HospitalScreening hget = (HospitalScreening) redisUtils.hget("CUSOTMER_HOSPITAL", excludeHospitalId); |
| | | if (hget != null) { |
| | | map.put("excludeHospitalId", hget.getHospitalId()); |
| | | } |
| | | } |
| | | |
| | | List<AdvisoryDoctorInfo> byObject = baseMapper.findByObject(map); |
| | | if (byObject.size() > 0) { |
| | | for (AdvisoryDoctorInfo adi : byObject) { |
| | | json = new HashMap<>(16); |
| | | json.put("doctorName", adi.getDoctorName()); |
| | | json.put("departmentName", adi.getDeptName()); |
| | | json.put("hospitalName", adi.getHospitalName()); |
| | | json.put("head", adi.getHead()); |
| | | json.put("about", adi.getIntroduction()); |
| | | json.put("price", adi.getPrice() / 100); |
| | | json.put("specialty", adi.getSpecialty()); |
| | | json.put("service", adi.getService()); |
| | | json.put("id", String.valueOf(adi.getId())); |
| | | String distance = getDistance(Double.parseDouble(adi.getLatitude()), Double.parseDouble(adi.getLongitude()), lat, lon); |
| | | json.put("distance", distance); |
| | | |
| | | ResultBody byId1 = doctorService.findById(adi.getDoctorId()); |
| | | if (byId1.getCode() == 0 || byId1.getData() != null) { |
| | | JSONObject doctor = JSONObject.parseObject(JSONObject.toJSONString(byId1.getData())); |
| | | json.put("rank", doctor.getString("doctorRank")); |
| | | } |
| | | |
| | | array.add(json); |
| | | } |
| | | |
| | | //按照距离排序(由远到近) |
| | | Collections.sort(array, new Comparator<Map<String, Object>>() { |
| | | @Override |
| | | public int compare(Map<String, Object> o1, Map<String, Object> o2) { |
| | | String distance1 = o1.get("distance").toString(); |
| | | String distance2 = o2.get("distance").toString(); |
| | | return distance2.compareTo(distance1); |
| | | } |
| | | }); |
| | | |
| | | //倒叙list排序 |
| | | Collections.reverse(byObject); |
| | | } |
| | | |
| | | return ResultBody.ok().data(array).msg("操作成功"); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<AdvisoryManager> findAll(Map<String, Object> params) { |
| | | return advisoryService.findAll(params); |
| | | } |
| | | |
| | | /** |
| | | * 后台更新咨询状态 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody updateStatusByService(String id) { |
| | | return advisoryService.updateStatusByService(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询注册用户信息 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | @Override |
| | | public UserInfo getUserByPhone(String phone) { |
| | | UserInfo user = new UserInfo(); |
| | | user.setPhoneNum(phone); |
| | | ResultBody byObject = userInfoService.findByObject(user); |
| | | |
| | | if (byObject.getCode() == 0 || byObject.getData() != null) { |
| | | UserInfo userInfo = JSONObject.parseObject(JSONObject.toJSONString(byObject.getData()), UserInfo.class); |
| | | if (userInfo != null) { |
| | | return userInfo; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 微信退款 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody refund(Map<String, Object> map) { |
| | | return advisoryService.refund(map); |
| | | } |
| | | |
| | | /** |
| | | * 按照月/年查询咨询统计数据 |
| | | * |
| | | * @param map type:1月,2年 |
| | | * riqi: 时间 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<AdvisorySummary> summaryBate(Map<String, Object> map) { |
| | | PageResult<AdvisorySummary> resultBody = null; |
| | | int type = MapUtils.getIntValue(map, "type"); |
| | | if (type == 1) { |
| | | resultBody = advisoryService.summaryByMonth(map); |
| | | } |
| | | if (type == 2) { |
| | | resultBody = advisoryService.summaryByYear(map); |
| | | } |
| | | return resultBody; |
| | | } |
| | | |
| | | /** |
| | | * 咨询医生统计数据查询 |
| | | * |
| | | * @param map startTime/EndTime |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<AdvisoryDoctorSummary> summaryDoctorByBate(Map<String, Object> map) { |
| | | return advisoryService.summaryByDoctor(map); |
| | | } |
| | | |
| | | /** |
| | | * @param lat1 经度1 |
| | | * @param lng1 纬度1 |
| | | * @param lat2 经度2 |
| | | * @param lng2 纬度2 |
| | | * @return 距离 |
| | | */ |
| | | private String getDistance(double lat1, double lng1, double lat2, double lng2) { |
| | | |
| | | double radLat1 = rad(lat1); |
| | | double radLat2 = rad(lat2); |
| | | |
| | | double a = radLat1 - radLat2; |
| | | double b = rad(lng1) - rad(lng2); |
| | | |
| | | double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) |
| | | + Math.cos(radLat1) * Math.cos(radLat2) |
| | | * Math.pow(Math.sin(b / 2), 2))); |
| | | s = s * 6378.137; |
| | | s = Math.round(s * 10000d) / 10000d; |
| | | //s = s * 1000;如果需要返回单位为米 |
| | | |
| | | DecimalFormat df = new DecimalFormat("0.00");//格式化,区小数后两位 |
| | | String distance = df.format(s); |
| | | |
| | | return distance; |
| | | } |
| | | |
| | | private double rad(double d) { |
| | | return d * Math.PI / 180.0; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.oprationcenter.mapper.AppointmentTimeMapper; |
| | | import com.kidgrow.oprationcenter.model.AppointmentTime; |
| | | import com.kidgrow.oprationcenter.service.IAppointmentTimeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:33 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class AppointmentTimeServiceImpl extends SuperServiceImpl<AppointmentTimeMapper, AppointmentTime> implements IAppointmentTimeService { |
| | | |
| | | /** |
| | | * 保存 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean save(Map<String, Object> map) { |
| | | AppointmentTime time = null; |
| | | boolean flag = false; |
| | | |
| | | String[] items = (String[]) MapUtils.getObject(map, "list"); |
| | | String id = MapUtils.getString(map, "id"); |
| | | |
| | | baseMapper.delByAdvisoryId(Long.parseLong(id)); |
| | | |
| | | for (String item : items) { |
| | | String[] tmp = item.split("_"); |
| | | |
| | | time = new AppointmentTime(); |
| | | time.setAdvisoryId(Long.parseLong(id)); |
| | | time.setName(tmp[0]); |
| | | if ("1".equals(tmp[1])) { |
| | | time.setMorning(1); |
| | | } else if ("2".equals(tmp[1])) { |
| | | time.setAfternoon(1); |
| | | } else if ("3".equals(tmp[1])) { |
| | | time.setEvening(1); |
| | | } |
| | | int insert = baseMapper.insert(time); |
| | | if (insert == 0) { |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return flag ? false : true; |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public String queryByAdvisoryId(Long id) { |
| | | StringBuffer result = new StringBuffer(); |
| | | List<AppointmentTime> appointmentTimes = baseMapper.queryByAdvisoryId(id); |
| | | |
| | | if (appointmentTimes.size() > 0) { |
| | | for (AppointmentTime app : appointmentTimes) { |
| | | if (app.getMorning() == 1) { |
| | | result.append(app.getName() + "_1"); |
| | | result.append(","); |
| | | } else if (app.getAfternoon() == 1) { |
| | | result.append(app.getName() + "_2"); |
| | | result.append(","); |
| | | } else if (app.getEvening() == 1) { |
| | | result.append(app.getName() + "_3"); |
| | | result.append(","); |
| | | } |
| | | } |
| | | |
| | | if (result.length() > 0) { |
| | | result.substring(0, result.length() - 1); |
| | | } |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public List<AppointmentTime> findByAdvisoryId(Long id) { |
| | | return baseMapper.queryByAdvisoryId(id); |
| | | } |
| | | |
| | | @Override |
| | | public int delByAdvisoryId(Long id) { |
| | | return baseMapper.delByAdvisoryId(id); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <!----> |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.AdvisoryDoctorInfoMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | | <sql id="where"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | is_del =0 |
| | | <if test="p.id != null and p.id !=''"> |
| | | and id = #{p.id} |
| | | </if> |
| | | <if test="p.doctorId != null and p.doctorId !=''"> |
| | | and doctor_id = #{p.doctorId} |
| | | </if> |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and hospital_id = #{p.hospitalId} |
| | | </if> |
| | | <if test="p.service != null and p.service !=''"> |
| | | and service = #{p.service} |
| | | </if> |
| | | <if test="p.isDel != null and p.isDel !=''"> |
| | | and is_del = #{p.isDel} |
| | | </if> |
| | | <if test="p.excludeHospitalId != null and p.excludeHospitalId !=''"> |
| | | and hospital_id != #{p.excludeHospitalId} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--列表使用--> |
| | | <select id="findList" resultType="com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo"> |
| | | SELECT |
| | | a.* |
| | | FROM |
| | | advisory_doctor_info a |
| | | WHERE |
| | | a.is_del =0 |
| | | <if test="p.service != null and p.service != ''"> |
| | | and a.service = #{p.service} |
| | | </if> |
| | | <if test="p.hospitalName != null and p.hospitalName != ''"> |
| | | and a.hospital_name = #{p.hospitalName} |
| | | </if> |
| | | <if test="p.doctorName != null and p.doctorName != ''"> |
| | | and a.doctor_name like concat('%', #{p.doctorName}, '%') |
| | | </if> |
| | | order by a.create_time |
| | | </select> |
| | | |
| | | <!--删除--> |
| | | <update id="removeById" parameterType="java.lang.Long"> |
| | | update advisory_doctor_info set is_del=1 where id=#{id} |
| | | </update> |
| | | |
| | | <!--定义根据-AdvisoryDoctorInfo当作查询条件返回对象--> |
| | | <select id="findByObject" resultType="com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo"> |
| | | select |
| | | <include refid="Column_List"/> |
| | | from advisory_doctor_info |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <!----> |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.AppointmentTimeMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | | <sql id="where"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | |
| | | </where> |
| | | </sql> |
| | | |
| | | <delete id="delByAdvisoryId" parameterType="java.lang.Long"> |
| | | delete from appointment_time where advisory_id= #{id} |
| | | </delete> |
| | | |
| | | <select id="queryByAdvisoryId" parameterType="java.lang.Long" resultType="com.kidgrow.oprationcenter.model.AppointmentTime"> |
| | | select * from appointment_time where advisory_id=#{advisoryId} |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="findByName" resultType="com.kidgrow.oprationcenter.model.HospitalScreening"> |
| | | select id, |
| | | hospital_name |
| | | hospital_name, |
| | | hospital_id |
| | | from hospital_screening |
| | | where is_del=0 and enabled=1 and hospital_name LIKE concat('%',#{hospitalName},'%') |
| | | order by hospital_name desc,id desc |
New file |
| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.kidgrow.advisory.model.AdvisoryDoctorSummary; |
| | | import com.kidgrow.advisory.model.AdvisorySummary; |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.model.AdvisoryDoctorInfo; |
| | | import com.kidgrow.oprationcenter.service.IAdvisoryDoctorInfoService; |
| | | import com.kidgrow.oprationcenter.service.IAppointmentTimeService; |
| | | import com.kidgrow.user.feign.DoctorAnswerUserRelationService; |
| | | import com.kidgrow.user.model.DoctorAnswerUserRelation; |
| | | import com.kidgrow.user.model.UserInfo; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.feign.SysHospitalService; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:44 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/advisorydoctor") |
| | | @Api(tags = "咨询医生表") |
| | | public class AdvisoryDoctorInfoController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IAdvisoryDoctorInfoService advisoryDoctorInfoService; |
| | | |
| | | @Autowired |
| | | private SysHospitalService sysHospitalService; |
| | | |
| | | @Autowired |
| | | private IAppointmentTimeService appointmentTimeService; |
| | | |
| | | @Autowired |
| | | private SysDoctorService doctorService; |
| | | |
| | | @Autowired |
| | | private DoctorAnswerUserRelationService doctorAnswerUserRelationService; |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping |
| | | public PageResult<AdvisoryDoctorInfo> list(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return advisoryDoctorInfoService.findList(params); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Integer") |
| | | }) |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | int v = advisoryDoctorInfoService.removeById(id); |
| | | |
| | | if (v > 0) { |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResultBody save(@RequestBody AdvisoryDoctorInfo advisoryDoctorInfo, BindingResult bindingResult) { |
| | | List<String> errMsg = new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | if (advisoryDoctorInfo.getId() == null) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("hospitalId", advisoryDoctorInfo.getHospitalId()); |
| | | map.put("doctorId", advisoryDoctorInfo.getDoctorId()); |
| | | List<AdvisoryDoctorInfo> byObject = advisoryDoctorInfoService.findByObject(map); |
| | | if (byObject.size() > 0) { |
| | | return ResultBody.failed().msg("该医生已添加"); |
| | | } |
| | | } |
| | | |
| | | //查询医院坐标 |
| | | Map<String, Object> map = new HashMap<>(16); |
| | | map.put("id", advisoryDoctorInfo.getHospitalId()); |
| | | |
| | | ResultBody allByMap = sysHospitalService.findAllByMap(map); |
| | | if (allByMap.getCode() == 0 && allByMap.getData() != null) { |
| | | List<SysHospital> list = JSONArray.parseArray(JSONObject.toJSONString(allByMap.getData()), SysHospital.class); |
| | | |
| | | if (list.size() > 0) { |
| | | advisoryDoctorInfo.setLatitude(list.get(0).getLatitude()); |
| | | advisoryDoctorInfo.setLongitude(list.get(0).getLongitude()); |
| | | } |
| | | } |
| | | |
| | | //查询医生信息 |
| | | ResultBody byId = doctorService.findById(advisoryDoctorInfo.getDoctorId()); |
| | | if (byId.getCode() != 0 || byId.getData() == null) { |
| | | return ResultBody.failed().msg("未找到医生信息"); |
| | | } |
| | | |
| | | SysDoctor doctor = JSONObject.parseObject(JSONObject.toJSONString(byId.getData()), SysDoctor.class); |
| | | advisoryDoctorInfo.setTitle(doctor.getDoctorRank()); |
| | | advisoryDoctorInfo.setIntroduction(doctor.getDoctorAbout()); |
| | | advisoryDoctorInfo.setHead(doctor.getDoctorLogo()); |
| | | advisoryDoctorInfo.setPrice(advisoryDoctorInfo.getPrice() * 100); |
| | | |
| | | boolean v = advisoryDoctorInfoService.saveOrUpdate(advisoryDoctorInfo); |
| | | |
| | | map.clear(); |
| | | map.put("list", advisoryDoctorInfo.getAppointment()); |
| | | map.put("id", advisoryDoctorInfo.getId()); |
| | | |
| | | boolean save = appointmentTimeService.save(map); |
| | | if (v && save) { |
| | | //绑定C段用户 |
| | | UserInfo userByPhone = advisoryDoctorInfoService.getUserByPhone(advisoryDoctorInfo.getBindPhone()); |
| | | if (userByPhone != null) { |
| | | DoctorAnswerUserRelation dar = new DoctorAnswerUserRelation(); |
| | | dar.setUserId(userByPhone.getUserId()); |
| | | dar.setDoctorId(String.valueOf(advisoryDoctorInfo.getId())); |
| | | ResultBody resultBody = doctorAnswerUserRelationService.updateByDoctorId(dar); |
| | | |
| | | if (resultBody.getCode() == 0) { |
| | | return ResultBody.ok().data(advisoryDoctorInfo).msg("保存成功"); |
| | | } |
| | | } |
| | | |
| | | return ResultBody.ok().data(advisoryDoctorInfo).msg("保存成功,绑定失败"); |
| | | } else { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 通过ID查询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/getDoctorById") |
| | | public ResultBody getDoctorById(@RequestBody Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.getDoctorById(map); |
| | | } |
| | | |
| | | /** |
| | | * 通过ID查询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/updateDoctorInfo") |
| | | public ResultBody updateDoctorInfo(@RequestBody Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.updateDoctorInfo(map); |
| | | } |
| | | |
| | | /** |
| | | * 通过ID查询筛查 咨询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/getSreeningAdvisoryDoctor") |
| | | public ResultBody getSreeningAdvisoryDoctor(@RequestParam("hospitalId") String hospitalId) { |
| | | return advisoryDoctorInfoService.getSreeningAdvisoryDoctorList(Long.parseLong(hospitalId)); |
| | | } |
| | | |
| | | /** |
| | | * 通过咨询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/getAdvisoryDoctorList") |
| | | public ResultBody getAdvisoryDoctorList(@RequestBody Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.getAdvisoryDoctorList(map); |
| | | } |
| | | |
| | | /** |
| | | * 获取咨询列表 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/findAll") |
| | | public PageResult findAll(@RequestParam Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.findAll(map); |
| | | } |
| | | |
| | | /** |
| | | * 通过咨询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @GetMapping("/update/{id}") |
| | | public ResultBody update(@PathVariable String id) { |
| | | return advisoryDoctorInfoService.updateStatusByService(id); |
| | | } |
| | | |
| | | /** |
| | | * 通过咨询医生信息,C端接口 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/querUserByPhone") |
| | | public ResultBody querUserByPhone(@RequestBody Map<String, Object> map) { |
| | | String phone = MapUtils.getString(map, "bindPhone"); |
| | | |
| | | if (StringUtils.isBlank(phone)) { |
| | | return ResultBody.failed().msg("参数错误"); |
| | | } |
| | | return ResultBody.ok().data(advisoryDoctorInfoService.getUserByPhone(phone)); |
| | | } |
| | | |
| | | /** |
| | | * 微信退款 |
| | | */ |
| | | @ApiOperation(value = "微信退款") |
| | | @PostMapping("/refund") |
| | | public ResultBody refund(@RequestBody Map<String, Object> map, @LoginUser SysUser user) { |
| | | String advisoryId = MapUtils.getString(map, "advisoryId"); |
| | | |
| | | if (StringUtils.isBlank(advisoryId)) { |
| | | return ResultBody.failed().msg("参数错误"); |
| | | } |
| | | |
| | | map.put("userId", user.getId()); |
| | | return ResultBody.ok().data(advisoryDoctorInfoService.refund(map)); |
| | | } |
| | | |
| | | /** |
| | | * 咨询统计数据 |
| | | */ |
| | | @ApiOperation(value = "咨询统计数据") |
| | | @PostMapping("/summaryByDate") |
| | | public PageResult<AdvisorySummary> summaryByDate(@RequestParam Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.summaryBate(map); |
| | | } |
| | | |
| | | /** |
| | | * 咨询医生统计数据 |
| | | */ |
| | | @ApiOperation(value = "咨询统计数据") |
| | | @PostMapping("/summaryDoctorByDate") |
| | | public PageResult<AdvisoryDoctorSummary> summaryDoctorByDate(@RequestParam Map<String, Object> map) { |
| | | return advisoryDoctorInfoService.summaryDoctorByBate(map); |
| | | } |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.service.IAppointmentTimeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2021/3/1 14:44 <br> |
| | | * @Author: <a href="78125310@kidgrow.com">dougang</a> |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/appointment") |
| | | @Api(tags = "咨询医生预约表") |
| | | public class AppointMentTimeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IAppointmentTimeService appointmentTimeService; |
| | | |
| | | /** |
| | | * 通过咨询ID查询预约时间 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "通过咨询ID查询预约时间") |
| | | @GetMapping("/queryByAdvisoryId/{id}") |
| | | public ResultBody queryByAdvisoryId(@PathVariable("id") String id) { |
| | | return ResultBody.ok().data(appointmentTimeService.queryByAdvisoryId(Long.parseLong(id))); |
| | | } |
| | | } |
| | |
| | | - screening_organization_info |
| | | - partner_info |
| | | - partner_docking_info |
| | | - advisory_doctor_info |
| | | - appointment_time |
| | | ignoreSqls: |
| | | - com.kidgrow.usercenter.mapper.SysRoleMapper.findAll |
| | | - com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper.findDetailList |
| | |
| | | <artifactId>kidgrow-usercenter-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-report-center-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
| | |
| | | * @return |
| | | */ |
| | | int chartDoctor(@Param("datatype") int datatype); |
| | | |
| | | /** |
| | | * 通过医院部门查询C端医生 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<SysDoctor> queryDoctorByC(@Param("p") Map<String, Object> params); |
| | | } |
| | |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.vo.SysDoctorDto; |
| | | import com.kidgrow.usercenter.vo.SysDoctorVo; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @version 1.0 |
| | | * @Description: <br> |
| | | * @Project: 用户中心<br> |
| | | * @CreateDate: Created in 2020-04-02 14:02:50 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version 1.0 |
| | | */ |
| | | public interface ISysDoctorService extends ISuperService<SysDoctor> { |
| | | /** |
| | | * 列表 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 根据SysDoctor对象当做查询条件进行查询 |
| | | * @param sysDoctor |
| | | * @return SysDoctor对象 |
| | | */ |
| | | * 根据SysDoctor对象当做查询条件进行查询 |
| | | * |
| | | * @param sysDoctor |
| | | * @return SysDoctor对象 |
| | | */ |
| | | SysDoctor findByObject(SysDoctor sysDoctor); |
| | | |
| | | boolean delete(Long id); |
| | | |
| | | ResultBody enable(Map<String, Object> params); |
| | | |
| | | ResultBody saveOrUpdateSer(SysDoctorDto sysDoctor, HttpServletRequest request,SysUser user); |
| | | ResultBody saveOrUpdateSer(SysDoctorDto sysDoctor, HttpServletRequest request, SysUser user); |
| | | |
| | | List<SysDoctor> findByMap(Map<String, Object> map); |
| | | |
| | | /** |
| | | * 设为医院超管 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | ResultBody setAdminDoctor(Map<String, Object> map); |
| | | |
| | | /** |
| | | * H端检查用户名是否管理员 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据userid删除医生数据 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | int deleteByUserId(Long userId); |
| | | |
| | | /** |
| | | * 统计医生的数量 |
| | | * |
| | | * @param datatype 业务类型 |
| | | * 0 自注册医生 |
| | | * 1 签约医生 |
| | |
| | | * @return |
| | | */ |
| | | int chartDoctor(int datatype); |
| | | |
| | | /** |
| | | * 通过医院部门查询C端医生 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | List<SysDoctor> queryDoctorByC(Map<String, Object> map); |
| | | } |
| | | |
| | |
| | | return baseMapper.chartDoctor(datatype); |
| | | } |
| | | |
| | | /** |
| | | * 通过医院部门查询C端医生 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SysDoctor> queryDoctorByC(Map<String, Object> map) { |
| | | return baseMapper.queryDoctorByC(map); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody enable(Map<String, Object> params) { |
| | | Long aLong = MapUtils.getLong(params, "id"); |
| | |
| | | sysUserOrg.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrg.setOrgId(sysDepartment.getOrgId()); |
| | | sysUserOrg.setCreateTime(new Date()); |
| | | List<SysUserOrg> sysUserOrgs=new ArrayList<>(); |
| | | List<SysUserOrg> sysUserOrgs = new ArrayList<>(); |
| | | sysUserOrgs.add(sysUserOrg); |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi = new SysUserOrg(); |
| | |
| | | sysRoleUser.setUserId(sysUser.getId()); |
| | | int insert = sysUserRoleMapper.insert(sysRoleUser); |
| | | }); |
| | | List<SysUserOrg> sysUserOrgs=new ArrayList<>(); |
| | | List<SysUserOrg> sysUserOrgs = new ArrayList<>(); |
| | | //保存将sys_user_org 保存部门 |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getId()); |
| | |
| | | and (doctor_type=1 or doctor_type=0) and doctor_state=0 and enabled=0 |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryDoctorByC" parameterType="java.util.Map" resultType="com.kidgrow.usercenter.model.SysDoctor"> |
| | | SELECT |
| | | <include refid="Column_List"/> |
| | | FROM |
| | | sys_doctor |
| | | WHERE |
| | | is_del = 0 |
| | | AND enabled = 1 |
| | | AND doctor_type != 1 |
| | | AND hospital_id = #{p.hospitalId} |
| | | AND department_id = #{p.departmentId} |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.service.ISysDoctorService; |
| | | import com.kidgrow.usercenter.vo.SysDoctorDto; |
| | | import com.kidgrow.usercenter.vo.SysDoctorVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * @Description: |
| | | * |
| | | * @Description: |
| | | * @Project: 用户中心 |
| | | * @CreateDate: Created in 2020-04-02 18:32:36 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | |
| | | @RestController |
| | | @RequestMapping("/sysdoctor") |
| | | @Api(tags = "医生表") |
| | | public class SysDoctorController extends BaseController{ |
| | | public class SysDoctorController extends BaseController { |
| | | @Autowired |
| | | private ISysDoctorService sysDoctorService; |
| | | |
| | |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping |
| | | public PageResult<SysDoctorDto> list(@RequestParam Map<String, Object> params,@LoginUser SysUser user) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | | public PageResult<SysDoctorDto> list(@RequestParam Map<String, Object> params, @LoginUser SysUser user) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | |
| | | return sysDoctorService.findList(params,user); |
| | | return sysDoctorService.findList(params, user); |
| | | } |
| | | |
| | | /** |
| | |
| | | SysDoctor model = sysDoctorService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 判断用户名是否管理员 |
| | | */ |
| | |
| | | public ResultBody findById(@RequestParam String userName) { |
| | | return sysDoctorService.userIsAdmin(userName); |
| | | } |
| | | |
| | | /** |
| | | * 根据 Map 查询 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @PostMapping("/findByMap") |
| | | public ResultBody findByMap(@RequestBody Map<String,Object> map) { |
| | | public ResultBody findByMap(@RequestBody Map<String, Object> map) { |
| | | List<SysDoctor> models = sysDoctorService.findByMap(map); |
| | | return ResultBody.ok().data(models).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 根据SysDoctor当做查询条件进行查询 |
| | | */ |
| | |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping |
| | | public ResultBody save(@Valid @RequestBody SysDoctorDto sysDoctor, BindingResult bindingResult, HttpServletRequest request,@LoginUser SysUser user) { |
| | | List<String> errMsg= new ArrayList<>(); |
| | | public ResultBody save(@Valid @RequestBody SysDoctorDto sysDoctor, BindingResult bindingResult, HttpServletRequest request, @LoginUser SysUser user) { |
| | | List<String> errMsg = new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | return sysDoctorService.saveOrUpdateSer(sysDoctor,request,user); |
| | | return sysDoctorService.saveOrUpdateSer(sysDoctor, request, user); |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | boolean v= sysDoctorService.delete(id); |
| | | if(v) { |
| | | boolean v = sysDoctorService.delete(id); |
| | | if (v) { |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } |
| | | else { |
| | | } else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | |
| | | @PostMapping("enable") |
| | | public ResultBody enable(@RequestBody Map<String, Object> params) { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | if (id==null) { |
| | | if (id == null) { |
| | | return ResultBody.failed("请选择一条数据"); |
| | | } |
| | | return sysDoctorService.enable(params); |
| | | return sysDoctorService.enable(params); |
| | | } |
| | | |
| | | /** |
| | | * 设为管理 |
| | | */ |
| | |
| | | public ResultBody setAdmin(@RequestBody Map<String, Object> params) { |
| | | return sysDoctorService.setAdminDoctor(params); |
| | | } |
| | | |
| | | /** |
| | | * 统计医生的数量 |
| | | * |
| | | * @param datatype 业务类型 |
| | | * 0 自注册医生 |
| | | * 1 签约医生 |
| | |
| | | @ApiOperation(value = "统计医生的数量") |
| | | @GetMapping("chartDoctor") |
| | | public ResultBody chartDoctor(int datatype) { |
| | | int counts= sysDoctorService.chartDoctor(datatype); |
| | | int counts = sysDoctorService.chartDoctor(datatype); |
| | | return ResultBody.ok().data(counts).msg("数据获取成功"); |
| | | } |
| | | |
| | | /** |
| | | * 根据SysDoctor当做查询条件进行查询 |
| | | */ |
| | | @ApiOperation(value = "根据SysDoctor当做查询条件进行查询") |
| | | @PostMapping("/queryDoctorToC") |
| | | public ResultBody queryDoctorToC(@RequestBody Map<String, Object> sysDoctor) { |
| | | List<SysDoctor> model = sysDoctorService.queryDoctorByC(sysDoctor); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | } |
| | |
| | | */ |
| | | String CUSTOMER_REPORTCENTER_SERVER="customer-reportcenter-server"; |
| | | |
| | | /** |
| | | * C端咨询服务名 |
| | | */ |
| | | String CUSTOMER_ADVISORYCENTER_SERVER="customer-advisorycenter-server"; |
| | | |
| | | } |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | |
| | | |
| | | @Bean |
| | | public ConnectionFactory connectionFactory() { |
| | | CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host,port); |
| | | CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host, port); |
| | | connectionFactory.setUsername(username); |
| | | connectionFactory.setPassword(password); |
| | | connectionFactory.setVirtualHost(virtualHost); |
| | |
| | | Binding bindingExchangeAdvancedEvaluation(TopicExchange exchange) { |
| | | return BindingBuilder.bind(AdvancedEvaluation()).to(exchange).with(routingKeyName); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public CustomExchange delayExchange(){ |
| | | Map<String, Object> args = new HashMap<>(16); |
| | | args.put("x-delayed-type", "direct"); |
| | | //属性参数 交换机名称 交换机类型 是否持久化 是否自动删除 配置参数 |
| | | return new CustomExchange("kagDelayExchange", "x-delayed-message", true, false, args); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列D |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Queue delayQueue(){ |
| | | //属性参数 队列名称 是否持久化 |
| | | return new Queue("kagMessageDelayQueue", true); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询 |
| | | * 延时队列绑定交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Binding cfgDelayBinding(){ |
| | | return BindingBuilder.bind(delayQueue()).to(delayExchange()).with("kagMessageDelayKey").noargs(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 可爱高咨询延时队列--更改待完成状态 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Queue delayUncompletedQueue(){ |
| | | //属性参数 队列名称 是否持久化 |
| | | return new Queue("kagAdvisoryNncompletedDelayQueue", true); |
| | | } |
| | | |
| | | /** |
| | | * 可爱高咨询 |
| | | * 给延时队列绑定交换机 |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Binding delayBinding(){ |
| | | return BindingBuilder.bind(delayQueue()).to(delayExchange()).with("kagAdvisoryUncompletedDelayKey").noargs(); |
| | | } |
| | | } |
| | |
| | | ## C\u7AEF\u4EA7\u54C1\u53EF\u7231\u9AD8\u7B5B\u67E5\u5C0F\u7A0B\u5E8F\u914D\u7F6E\u4FE1\u606F |
| | | wechat.screening.applets.appid=wx0f3a6409155f1bac |
| | | wechat.screening.applets.secret=ce485ae3192bb6a6cd68ce140ac81327 |
| | | health_url_net=http://192.168.2.22/ |
| | | health_url_net=http://192.168.2.22/ |
| | | |
| | | ## C\u7AEF\u4EA7\u54C1\u53EF\u7231\u9AD8\u5C0F\u7A0B\u5E8F\u914D\u7F6E\u4FE1\u606F |
| | | wechat.kag.applets.appid=wx2f0a09608cfc96da |
| | | wechat.kag.applets.secret=773722860fa804e0a45cb7d1a0ac36e5 |
| | | |
| | | ##\u5C0F\u7A0B\u5E8F\u652F\u4ED8 |
| | | wechat.applets.pay.url=https://api.mch.weixin.qq.com |
| | | wechat.applets.pay.appid=wx2f0a09608cfc96da |
| | | wechat.applets.pay.mchid=1607665697 |
| | | wechat.applets.pay.key=15cedcb0cfdc2c4266125708b727614a |
| | | wechat.applets.pay.callback=http://open.kidgrow.cloud.net |
| | | |
| | | ##\u963F\u91CC\u9690\u79C1\u53F7 |
| | | alibaba.private.number.accessKeyId=LTAI5t7YjHV47Hn9fVfXSZ3y |
| | | alibaba.private.number.accessKeySecret=UnkA2Jusrx4fpkH0dzzlwteq3y1rKo |
| | | alibaba.private.number.endpoint=dyplsapi.aliyuncs.com |
| | | alibaba.private.number.poolKey=FC100000127164409 |
| | | alibaba.private.number.messageType=SecretReport |
| | | alibaba.private.number.queueName=Alicom-Queue-20978793-SecretReport |
| | |
| | | padding: 0; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .custome-height { |
| | | line-height: 36px; |
| | | } |
New file |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <h2 class="header-title">咨询医生管理</h2> |
| | | <span class="layui-breadcrumb pull-right"> |
| | | <a href="#!home_console">首页</a> |
| | | <a><cite>咨询医生管理</cite></a> |
| | | </span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <select id="type" lay-filter="role_clients"> |
| | | <option value="">服务类型</option> |
| | | <option value="1">图文</option> |
| | | <option value="2">电话</option> |
| | | <option value="3">图文/电话</option> |
| | | </select> |
| | | </div> |
| | | <div class="layui-inline" style="margin-bottom: -19px"> |
| | | <input name="hospitalName" id="hospitalName-seach" placeholder="按筛查医院名称" type="text" |
| | | class="layui-input search-input" maxlength="50" autocomplete="off"/>  |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <input name="doctorName" id="doctorName-seach" placeholder="按医生名称" type="text" |
| | | class="layui-input search-input" maxlength="50" autocomplete="off"/>  |
| | | </div> |
| | | <button id="app-btn-search" class="layui-btn icon-btn" layt="abc"><i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button id="doctor-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加咨询医生 |
| | | </button> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input id="hospitalId" type="hidden"/> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="doctor-table-bar"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改 |
| | | </button> |
| | | <button class="layui-btn layui-btn-xs" lay-event="delete"> |
| | | 删除 |
| | | </button> |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'autocomplete', 'formSelects','area'], |
| | | function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var admin = layui.admin; |
| | | var $ = layui.jquery; |
| | | var autocomplete = layui.autocomplete; |
| | | |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName-seach')[0], |
| | | keywordsName: 'hospitalName', //查询关键字名称 |
| | | url: config.base_server + 'api-user/syshospital/findByName', |
| | | template_val: '{{d.hospitalName}}', //选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>", //下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#hospitalId").val(resp.id); |
| | | } |
| | | }); |
| | | |
| | | // 渲染表格 |
| | | table.render({ |
| | | elem: '#app-table', |
| | | url: config.base_server + 'api-opration/advisorydoctor', |
| | | method: 'GET', |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: true, |
| | | cols: [ |
| | | [{ |
| | | field: 'id', |
| | | width: "200", |
| | | title: 'ID', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'createTime', |
| | | width: "200", |
| | | title: '创建时间', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'doctorName', |
| | | width: "150", |
| | | title: '医生姓名', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'hospitalName', |
| | | width: "200", |
| | | title: '医院名称', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'deptName', |
| | | width: "200", |
| | | title: '部门名称', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'service', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '服务类型', |
| | | fixed: 'left', |
| | | templet: function (d) { |
| | | if(d.service == 1){ |
| | | return "图文" |
| | | }else if(d.service == 2){ |
| | | return "电话" |
| | | }else{ |
| | | return "图文/电话" |
| | | } |
| | | } |
| | | },{ |
| | | field: 'bindPhone', |
| | | width: "150", |
| | | title: '绑定用户手机号', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | width: "200", |
| | | align: 'center', |
| | | toolbar: '#doctor-table-bar', |
| | | title: '操作', |
| | | fixed: 'right' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var service = $('#type').val(); |
| | | var hospitalName = $("#hospitalName-seach").val(); |
| | | var doctorName = $('#doctorName-seach').val(); |
| | | table.reload('app-table', { |
| | | where: { |
| | | service: service, |
| | | hospitalName: hospitalName, |
| | | doctorName: doctorName |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 添加按钮点击事件 |
| | | $('#doctor-btn-add').click(function () { |
| | | showEditModel_add("添加"); |
| | | }); |
| | | |
| | | var showEditModel_add = function (title, data) { |
| | | admin.putTempData('t_adisoryDoctor', data); |
| | | admin.popupCenter({ |
| | | title: title, |
| | | path: 'pages/keaigao/AdvisoryDoctor_form.html', |
| | | area: '610px', |
| | | offset: '0px', |
| | | finish: function () { |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(app-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'edit') { |
| | | showEditModel_add("编辑", data); |
| | | }else if(layEvent === 'delete'){ |
| | | doDelete(data); |
| | | } |
| | | }); |
| | | |
| | | // 删除 |
| | | var doDelete = function (obj) { |
| | | layer.confirm('确定删除此医生吗?', function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-opration/advisorydoctor/delete/' + obj.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | | }; |
| | | |
| | | }); |
| | | </script> |
New file |
| | |
| | | <form id="app-form-add" lay-filter="app-form-add" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 75px;">医院</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="hospitalName" id="hospitalName" placeholder="请输入医院名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required style="width: 150px;"/> |
| | | <input type="hidden" name="hospitalId" id="hospitalId"/> |
| | | <input type="hidden" name="id" id="id"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">科室</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="departmentName" id="departmentName" placeholder="请选择科室" type="hidden" |
| | | class="layui-input" maxlength="20" /> |
| | | <select id="departmentId" name="departmentId" lay-filter="departmentId" placeholder="请选择科室" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择科室-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">咨询医生</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorName" id="doctorName" placeholder="请选择医生" type="hidden" |
| | | class="layui-input" maxlength="20" /> |
| | | <select id="doctorId" name="doctorId" lay-filter="doctorId" placeholder="请选择医生" |
| | | lay-verify="required" required > |
| | | <option value="">-请选择医生-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">开通服务</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <select id="service" name="service" lay-filter="service" placeholder="请选择服务" |
| | | lay-verify="required" required> |
| | | <option value="1">图文</option> |
| | | <option value="2">电话</option> |
| | | <option value="3">图文/电话</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">电询价格</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="price" id="price" lay-verify="required|number" required placeholder="电话咨询价格" class="layui-input" value="30.00" maxlength="6"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">客服渠道</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="price" id="channel" lay-verify="required" required placeholder="客服渠道地址" class="layui-input" maxlength="50"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">最大接待</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="maxPeople" id="maxPeople" lay-verify="required|number" required placeholder="最大接待" class="layui-input" value="3" maxlength="3"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">绑定手机号</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="bindPhone" id="bindPhone" placeholder="绑定手机号" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">擅长</label> |
| | | <div class="layui-input-block" style="width: 400px;"> |
| | | <textarea name="specialty" id="specialty" required placeholder="请输入擅长" class="layui-textarea" |
| | | style="width:99%;min-height:70px"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">可预约时间</label> |
| | | <div class="layui-input-block" style="width: 450px;"> |
| | | <table border="1" style="width:100%; margin-top: 15px;"> |
| | | <tr> |
| | | <td></td> |
| | | <td style="text-align: center">上午<br/>8:00-12:00</td> |
| | | <td style="text-align: center">下午<br/>12:00-18:00</td> |
| | | <td style="text-align: center">晚间<br/>18:00-22:00</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周一</td> |
| | | <td style="text-align: center"><input type="checkbox" value="1_1" lay-skin="switch" lay-text="开启|停用"/></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox1_2" lay-skin="switch" lay-text="开启|停用" value="1_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox1_3" lay-skin="switch" lay-text="开启|停用" value="1_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周二</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox2_1" lay-skin="switch" lay-text="开启|停用" value="2_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox2_2" lay-skin="switch" lay-text="开启|停用" value="2_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox2_3" lay-skin="switch" lay-text="开启|停用" value="2_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周三</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox3_1" lay-skin="switch" lay-text="开启|停用" value="3_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox3_2" lay-skin="switch" lay-text="开启|停用" value="3_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox3_3" lay-skin="switch" lay-text="开启|停用" value="3_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周四</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox4_1" lay-skin="switch" lay-text="开启|停用" value="4_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox4_2" lay-skin="switch" lay-text="开启|停用" value="4_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox4_3" lay-skin="switch" lay-text="开启|停用" value="4_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周五</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox5_1" lay-skin="switch" lay-text="开启|停用" value="5_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox5_2" lay-skin="switch" lay-text="开启|停用" value="5_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox5_3" lay-skin="switch" lay-text="开启|停用" value="5_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周六</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox6_1" lay-skin="switch" lay-text="开启|停用" value="6_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox6_2" lay-skin="switch" lay-text="开启|停用" value="6_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox6_3" lay-skin="switch" lay-text="开启|停用" value="6_3"></td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center">周日</td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox7_1" lay-skin="switch" lay-text="开启|停用" value="7_1"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox7_2" lay-skin="switch" lay-text="开启|停用" value="7_2"></td> |
| | | <td style="text-align: center"><input type="checkbox" name="checkbox7_3" lay-skin="switch" lay-text="开启|停用" value="7_3"></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">取消</button> |
| | | <button class="layui-btn" id="sure" lay-filter="doctor-form-submit" |
| | | lay-submit>保存 |
| | | </button> |
| | | </div> |
| | | </form> |
| | | |
| | | <script> |
| | | layui.use(['form', 'laydate', 'util', 'config', 'admin', 'autocomplete', 'formSelects'], function () { |
| | | var form = layui.form; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var autocomplete = layui.autocomplete; |
| | | var formSelects = layui.formSelects; |
| | | var $ = layui.jquery; |
| | | |
| | | form.on('select(doctorId)', function () { |
| | | //将部门名称赋值 |
| | | $('#doctorName').val($(this)[0].innerHTML); |
| | | }); |
| | | |
| | | form.render(); |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(doctor-form-submit)', function (data) { |
| | | data.field.hospitalId = $("#hospitalId").val(); |
| | | data.field.hospitalName = $("#hospitalName").val(); |
| | | data.field.doctorName = $("#doctorName").val(); |
| | | data.field.service = $("#service").val(); |
| | | data.field.price = $("#price").val(); |
| | | data.field.doctorId = $("#doctorId").val(); |
| | | data.field.channel = $("#channel").val(); |
| | | data.field.maxPeople = $("#maxPeople").val(); |
| | | data.field.deptId = $("#departmentId").val(); |
| | | data.field.deptName = $("#departmentName").val(); |
| | | data.field.specialty = $("#specialty").val(); |
| | | data.field.bindPhone = $("#bindPhone").val(); |
| | | |
| | | var arr_box = []; |
| | | $('input[type=checkbox]:checked').each(function() { |
| | | arr_box.push($(this).val()); |
| | | }); |
| | | data.field.appointment = arr_box; |
| | | |
| | | layer.load(2); |
| | | |
| | | if($("#bindPhone").val() != "" && $("#bindPhone").val() != null){ |
| | | admin.req('api-opration/advisorydoctor/querUserByPhone', JSON.stringify(data.field), function (data1) { |
| | | layer.closeAll('loading'); |
| | | if (data1.code == 0) { |
| | | layer.confirm('确定要将该医生绑定到昵称:' + data1.data.nickName + "吗?", function (i) { |
| | | admin.req('api-opration/advisorydoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.closeAll(); |
| | | parent.layui.table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | }else{ |
| | | admin.req('api-opration/advisorydoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.closeAll(); |
| | | parent.layui.table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 3000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | } |
| | | |
| | | return false; |
| | | }); |
| | | |
| | | //自动完成-医院名称 |
| | | autocomplete.render({ |
| | | elem: $('#hospitalName')[0], |
| | | keywordsName: 'hospitalName', //查询关键字名称 |
| | | url: config.base_server + 'api-user/syshospital/findByName', |
| | | template_val: '{{d.hospitalName}}', //选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>", //下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#hospitalId").val(resp.id); |
| | | //重新装载科室 |
| | | getdepartment(resp.id,""); |
| | | } |
| | | }); |
| | | |
| | | //新增 和 更新 科室触发的事件 |
| | | form.on('select(departmentId)', function () { |
| | | //将部门名称赋值 |
| | | $('#departmentName').val($(this)[0].innerHTML); |
| | | getDoctor( $("#hospitalId").val(), $("#departmentId").val()); |
| | | }); |
| | | |
| | | //获取科室 |
| | | var getdepartment = function (hospitalId,deptId) { |
| | | admin.req('api-user/sysdepartment/findListByHospitalId', { |
| | | id: hospitalId |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | department = data.data; |
| | | $('#departmentId').empty(); |
| | | if (data.data.length > 0) { |
| | | $('#departmentName').val(data.data[0].departmentName); |
| | | } |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#departmentId').append(new Option(item.departmentName, item.id, |
| | | false, false)); |
| | | form.render('select', 'app-form'); |
| | | }) |
| | | getDoctor($("#hospitalId").val(),deptId === '' ? department[0].id : deptId); |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | }; |
| | | |
| | | //获取医生 |
| | | var getDoctor = function (hospitalId,departmentId) { |
| | | admin.req('api-user/sysdoctor/queryDoctorToC', JSON.stringify({ |
| | | hospitalId: hospitalId, |
| | | departmentId:departmentId |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | $('#doctorId').empty(); |
| | | |
| | | if (data.data.length > 0) { |
| | | $('#doctorName').val(data.data[0].doctorName); |
| | | } |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#doctorId').append(new Option(item.doctorName, item.id, |
| | | false, false)); |
| | | form.render('select', 'app-form'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'post'); |
| | | }; |
| | | |
| | | var adisoryDoctor = admin.getTempData('t_adisoryDoctor'); |
| | | if(adisoryDoctor){ |
| | | $("#id").val(adisoryDoctor.id); |
| | | $("#hospitalId").val(adisoryDoctor.hospitalId); |
| | | $("#hospitalName").val(adisoryDoctor.hospitalName); |
| | | $("#specialty").val(adisoryDoctor.specialty); |
| | | $("#bindPhone").val(adisoryDoctor.bindPhone); |
| | | |
| | | getdepartment(adisoryDoctor.hospitalId,adisoryDoctor.deptId); |
| | | |
| | | form.val('app-form-add', adisoryDoctor); |
| | | $("#price").val(adisoryDoctor.price / 100); |
| | | $("#doctorName").val(adisoryDoctor.doctorName); |
| | | |
| | | admin.req('api-opration/appointment/queryByAdvisoryId/'+$("#id").val(), { |
| | | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | $('input[type=checkbox]').each(function() { |
| | | if(data.data.indexOf($(this).val()) != -1){ |
| | | $(this).attr('checked', 'checked'); |
| | | } |
| | | }); |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | |
| | | |
| | | form.render(); |
| | | } |
| | | }); |
| | | </script> |
New file |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <h2 class="header-title">咨询管理</h2> |
| | | <span class="layui-breadcrumb pull-right"> |
| | | <a href="#!home_console">首页</a> |
| | | <a><cite>咨询管理</cite></a> |
| | | </span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <select id="type" lay-filter="role_clients"> |
| | | <option value="">咨询类型</option> |
| | | <option value="1">图文</option> |
| | | <option value="2">电话</option> |
| | | <option value="3">图文/电话</option> |
| | | </select> |
| | | <select id="status" lay-filter="role_clients"> |
| | | <option value="">咨询状态</option> |
| | | <option value="1">待咨询</option> |
| | | <option value="2">咨询中</option> |
| | | <option value="3">待完成</option> |
| | | <option value="4">已完成</option> |
| | | </select> |
| | | </div> |
| | | <div class="layui-inline" > |
| | | <input name="keyword" id="keyword" placeholder="咨询ID/医生名/用户名称" type="text" |
| | | class="layui-input search-input" maxlength="50" autocomplete="off"/>  |
| | | </div> |
| | | |
| | | <button id="app-btn-search" class="layui-btn icon-btn" layt="abc"><i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input id="hospitalId" type="hidden"/> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="doctor-table-bar"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="show">查看 |
| | | </button> |
| | | {{# if(d.type == 2 && d.payStatus == 1){ }} |
| | | <button class="layui-btn layui-btn-xs" lay-event="refund"> |
| | | 退款 |
| | | </button> |
| | | {{# } }} |
| | | {{# if(d.type == 1){ }} |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="complete"> |
| | | 完成 |
| | | </button> |
| | | {{# } }} |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'formSelects','area'], |
| | | function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var admin = layui.admin; |
| | | var $ = layui.jquery; |
| | | |
| | | // 渲染表格 |
| | | table.render({ |
| | | elem: '#app-table', |
| | | url: config.base_server + 'api-opration/advisorydoctor/findAll', |
| | | method: 'GET', |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: true, |
| | | cols: [ |
| | | [{ |
| | | field: 'advisoryId', |
| | | width: "300", |
| | | title: '咨询ID', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'type', |
| | | width: "90", |
| | | title: '类型', |
| | | fixed: 'left', |
| | | templet: function (d) { |
| | | if (d.type == 1) { |
| | | return "图文" |
| | | } else if (d.type == 2) { |
| | | return "电话" |
| | | } else { |
| | | return "图文/电话" |
| | | } |
| | | } |
| | | },{ |
| | | field: 'createTime', |
| | | width: "160", |
| | | title: '创建时间', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'doctorName', |
| | | width: "150", |
| | | title: '咨询医生', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | },{ |
| | | field: 'userName', |
| | | width: "150", |
| | | align: 'center', |
| | | title: '用户名', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'appointmentTime', |
| | | width: "250", |
| | | align: 'center', |
| | | title: '预约时间', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'consultationStatus', |
| | | width: "90", |
| | | align: 'center', |
| | | title: '咨询状态', |
| | | fixed: 'left', |
| | | templet: function (d) { |
| | | if (d.consultationStatus == 1) { |
| | | return "待咨询" |
| | | } else if (d.consultationStatus == 2) { |
| | | return "咨询中" |
| | | } else if (d.consultationStatus == 3) { |
| | | return "待完成" |
| | | }else if (d.consultationStatus == 4) { |
| | | return "已完成" |
| | | }else{ |
| | | return "已取消" |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: 'evaluationLevel', |
| | | width: "80", |
| | | align: 'center', |
| | | title: '评价', |
| | | fixed: 'left', |
| | | templet: function (d) { |
| | | return (d.evaluationLevel == null || d.evaluationLevel == 0) ? "" : d.evaluationLevel + "星"; |
| | | } |
| | | }, |
| | | { |
| | | width: "200", |
| | | align: 'center', |
| | | title: '操作', |
| | | fixed: 'right', |
| | | templet: '#doctor-table-bar' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var type = $('#type').val(); |
| | | var status = $("#status").val(); |
| | | var keyword = $('#keyword').val(); |
| | | table.reload('app-table', { |
| | | where: { |
| | | type: type, |
| | | status: status, |
| | | keyword: keyword |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | var showEditModel_add = function (title, data) { |
| | | admin.putTempData('t_adisory', data); |
| | | admin.popupCenter({ |
| | | title: title, |
| | | path: 'pages/keaigao/AdvisoryManager_form.html', |
| | | area: '610px', |
| | | offset: '0px', |
| | | finish: function () { |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(app-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'show') { |
| | | showEditModel_add("查看", data); |
| | | }else if(layEvent === 'complete'){ |
| | | doComplete(data); |
| | | }else if(layEvent === 'refund'){ |
| | | doRefund(data); |
| | | } |
| | | }); |
| | | |
| | | //标记完成 |
| | | var doComplete = function (obj) { |
| | | var name = "确定要标记完成吗?"; |
| | | if(obj.payStatus !== 1 && obj.type == 2){ |
| | | name = "该咨询支付异常,确定要标记完成吗?" |
| | | } |
| | | layer.confirm(name , function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-opration/advisorydoctor/update/' + obj.advisoryId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'Get'); |
| | | }); |
| | | }; |
| | | |
| | | //退款 |
| | | var doRefund = function (obj) { |
| | | if(obj.payStatus == -1){ |
| | | layer.msg("已退款,无需重复操作", { icon: 2, time: 2000 }); |
| | | return; |
| | | } |
| | | |
| | | var name = "确定要将"+(obj.payStatus == 1 ? "已支付" : "未支付")+"的订单进行退款吗?"; |
| | | layer.confirm(name , function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-opration/advisorydoctor/refund', JSON.stringify({'advisoryId':obj.advisoryId}), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'POST'); |
| | | }); |
| | | }; |
| | | |
| | | }); |
| | | </script> |
New file |
| | |
| | | <form id="app-form-add" lay-filter="app-form-add" class="layui-form model-form custome-height"> |
| | | <input name="id" type="hidden"/> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 75px;">ID</label> |
| | | <div class="layui-input-block" id="id" /> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">类型</label> |
| | | <div class="layui-input-block" id="leixing"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 75px;">创建时间</label> |
| | | <div class="layui-input-block" id="createTime" style="width: 245px;"/> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">开通服务</label> |
| | | <div class="layui-input-block" id="service"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">咨询医生</label> |
| | | <div class="layui-input-block" id="doctor" style="width: 245px;"/> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">咨询客户</label> |
| | | <div class="layui-input-block" id="customer"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">问题描述</label> |
| | | <div style="width: 500px; padding-left: 40px; overflow: auto; max-height: 100px" id="problem"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 10px;"></label> |
| | | <div style="width: 450px; padding-left: 40px; text-align: left" id="img"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">档案信息</label><br/> |
| | | <div class="layui-input-block" style="width: 500px;margin-left:40px;"> |
| | | <table border="1" style="width:100%; margin-top: 15px;"> |
| | | <tr> |
| | | <td style="text-align: center">年龄/性别</td> |
| | | <td style="text-align: center">靶身高/百分位</td> |
| | | <td style="text-align: center">身高/百分位</td> |
| | | <td style="text-align: center">体重/bmi</td> |
| | | <td style="text-align: center">预测身高</td> |
| | | </tr> |
| | | <tr> |
| | | <td style="text-align: center" id="one"></td> |
| | | <td style="text-align: center" id="two"></td> |
| | | <td style="text-align: center" id="three"></td> |
| | | <td style="text-align: center" id="four"></td> |
| | | <td style="text-align: center" id="five"></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">预约时间</label> |
| | | <div class="layui-input-block" style="width: 200px;" id="appointmentTime"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">支付状态</label> |
| | | <div class="layui-input-block" id="pay"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">用户评价</label> |
| | | <div class="layui-input-block" id="pj"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 80px;">用户电话</label> |
| | | <div class="layui-input-block" id="phone"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | | <button class="layui-btn layui-btn-primary" ew-event="closeDialog" type="button">关闭</button> |
| | | </div> |
| | | </form> |
| | | |
| | | <script> |
| | | layui.use(['form', 'laydate', 'util', 'config', 'admin', 'autocomplete', 'formSelects'], function () { |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var $ = layui.jquery; |
| | | |
| | | form.render(); |
| | | |
| | | var adisory = admin.getTempData('t_adisory'); |
| | | if (adisory) { |
| | | $("#id").html(adisory.advisoryId); |
| | | |
| | | if (adisory.type == 1) { |
| | | $("#leixing").html("图文"); |
| | | } else if (adisory.type == 2) { |
| | | $("#leixing").html("电话"); |
| | | } else { |
| | | $("#leixing").html("图文/电话"); |
| | | } |
| | | |
| | | $("#createTime").html(adisory.createTime); |
| | | |
| | | if (adisory.type == 1) { |
| | | $("#service").html("待咨询"); |
| | | } else if (adisory.type == 2) { |
| | | $("#service").html("咨询中"); |
| | | } else if (adisory.type == 3) { |
| | | $("#service").html("待完成"); |
| | | } else if (adisory.type == 4) { |
| | | $("#service").html("已完成"); |
| | | } |
| | | |
| | | $("#doctor").html(adisory.doctorName); |
| | | $("#customer").html(adisory.userName); |
| | | $("#problem").html(adisory.question); |
| | | |
| | | var content = ''; |
| | | if (adisory.img !== null) { |
| | | var url = adisory.img.split(","); |
| | | for (var i = 0; i < url.length; i++) { |
| | | content += "<img src='" + url[i] + "' style='width: 25%;height: 25%'/> "; |
| | | } |
| | | } |
| | | $("#img").html(content); |
| | | |
| | | $("#one").html(adisory.age + "/" + adisory.childSex == 0 ? "女" : "男"); |
| | | $("#two").html(adisory.targetHeight + "/" + adisory.targetHeightPer); |
| | | $("#three").html(adisory.height + "/" + adisory.heightPer); |
| | | $("#four").html(adisory.weight + "/" + adisory.bmi); |
| | | $("#five").html(adisory.foreastHeight); |
| | | |
| | | if(adisory.type == 2) { |
| | | $("#appointmentTime").html(adisory.appointmentTime); |
| | | var b = ''; |
| | | if (adisory.payStatus == 0) { |
| | | b = "待支付"; |
| | | } else if (adisory.payStatus == 1) { |
| | | b = "已支付"; |
| | | } else { |
| | | b = "已退款"; |
| | | } |
| | | $("#pay").html((adisory.money / 100) + " " + b); |
| | | } |
| | | $("#phone").html(adisory.moblie); |
| | | $("#pj").html(adisory.reason); |
| | | |
| | | form.render(); |
| | | } |
| | | }) |
| | | ; |
| | | </script> |
New file |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <h2 class="header-title">咨询数据统计</h2> |
| | | <span class="layui-breadcrumb pull-right"> |
| | | <a href="#!home_console">首页</a> |
| | | <a><cite>咨询数据统计</cite></a> |
| | | </span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-tab"> |
| | | <ul class="layui-tab-title"> |
| | | <li class="layui-this">日统计</li> |
| | | <li>月统计</li> |
| | | <li>医生汇总</li> |
| | | </ul> |
| | | <div class="layui-tab-content" style="height: 550px;"> |
| | | <!--tab1内容--> |
| | | <div class="layui-tab-item layui-show" style="overflow-y: hidden"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" id="dateMonth" placeholder="yyyy-MM"> |
| | | </div> |
| | | <table class="layui-table" id="month-table" lay-filter="app-table"></table> |
| | | </div> |
| | | |
| | | <!--tab2内容--> |
| | | <div class="layui-tab-item" style="overflow-y: hidden"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" id="dateYear" placeholder="yyyy"> |
| | | </div> |
| | | <table class="layui-table" id="year-table" lay-filter="app-table"></table> |
| | | </div> |
| | | |
| | | <!--tab3内容--> |
| | | <div class="layui-tab-item" style="overflow-y: hidden"> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" id="startDate" placeholder="yyyy-MM-dd"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | - |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" class="layui-input" id="endDate" placeholder="yyyy-MM-dd"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <button id="app-btn-search" class="layui-btn icon-btn" layt="abc"><i |
| | | class="layui-icon"></i>搜索 |
| | | </button> |
| | | </div> |
| | | |
| | | <table class="layui-table" id="doctor-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'formSelects', 'area'], |
| | | function () { |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var $ = layui.jquery; |
| | | var laydate = layui.laydate; |
| | | |
| | | //年月选择器 |
| | | laydate.render({ |
| | | elem: '#dateMonth' |
| | | , type: 'month', |
| | | value: new Date(), |
| | | done: function (value, date, endDate) { |
| | | table.reload('month-table', { |
| | | where: { |
| | | type: 1, |
| | | riqi: value |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //年选择器 |
| | | laydate.render({ |
| | | elem: '#dateYear' |
| | | , type: 'year', |
| | | value: new Date(), |
| | | done: function (value, date, endDate) { |
| | | table.reload('year-table', { |
| | | where: { |
| | | type: 2, |
| | | riqi: value |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //时间选择器 |
| | | laydate.render({ |
| | | elem: '#startDate', |
| | | max: -1, |
| | | min: -183, |
| | | btns: ['confirm', 'clear'], |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date(value).getTime(); |
| | | var endTime = new Date($('#endDate').val()).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#startDate').val($('#endDate').val()); |
| | | } |
| | | |
| | | startDate.config.min = { |
| | | year: date.year, |
| | | month: date.month - 6, |
| | | date: date.date, |
| | | }; |
| | | } |
| | | }); |
| | | //时间选择器 |
| | | laydate.render({ |
| | | elem: '#endDate', |
| | | max: -1, |
| | | btns: ['confirm', 'clear'], |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date($('#startDate').val()).getTime(); |
| | | var endTime = new Date(value).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#endDate').val($('#startDate').val()); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | initMonth(); |
| | | |
| | | $('.layui-tab-title').on('click', function (title) { |
| | | if (title.toElement.textContent == "日统计") { |
| | | initMonth(); |
| | | } else if (title.toElement.textContent == "月统计") { |
| | | initYear(); |
| | | } else if (title.toElement.textContent == "医生汇总") { |
| | | initDoctor(); |
| | | } |
| | | }); |
| | | |
| | | // 月查询渲染表格 |
| | | function initMonth() { |
| | | table.render({ |
| | | elem: '#month-table', |
| | | url: config.base_server + 'api-opration/advisorydoctor/summaryByDate', |
| | | method: 'POST', |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | where: { |
| | | type: 1, |
| | | riqi: $("#dateMonth").val() |
| | | }, |
| | | page: true, |
| | | cols: [ |
| | | [{ |
| | | field: 'dateTime', |
| | | width: "150", |
| | | title: '日期', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'graphicAdvisoryCount', |
| | | width: "150", |
| | | title: '图文咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, { |
| | | field: 'graphicAdvisoryDoneCount', |
| | | width: "100", |
| | | title: '当日完成', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryCount', |
| | | width: "150", |
| | | title: '电话咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryConnectCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日通话', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryDoneCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日完成', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryCanncelCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日取消', |
| | | fixed: 'left' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 年查询渲染表格 |
| | | function initYear() { |
| | | table.render({ |
| | | elem: '#year-table', |
| | | url: config.base_server + 'api-opration/advisorydoctor/summaryByDate', |
| | | method: 'POST', |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | where: { |
| | | type: 2, |
| | | riqi: $("#dateYear").val() |
| | | }, |
| | | page: true, |
| | | cols: [ |
| | | [{ |
| | | field: 'inquiryDate', |
| | | width: "150", |
| | | title: '日期', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'graphicAdvisoryCount', |
| | | width: "150", |
| | | title: '图文咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, { |
| | | field: 'graphicAdvisoryDoneCount', |
| | | width: "100", |
| | | title: '当日完成', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryCount', |
| | | width: "150", |
| | | title: '电话咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryConnectCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日通话', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryDoneCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日完成', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryCanncelCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日取消', |
| | | fixed: 'left' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //医生统计信息 |
| | | function initDoctor() { |
| | | var d = new Date(); |
| | | var start = d.getFullYear() + '-' + lay.digit(d.getMonth()) + '-' + lay.digit(d.getDate() - 1); |
| | | var end = d.getFullYear() + '-' + lay.digit(d.getMonth() + 1) + '-' + lay.digit(d.getDate() - 1); |
| | | |
| | | $("#startDate").val(start); |
| | | $("#endDate").val(end); |
| | | table.render({ |
| | | elem: '#doctor-table', |
| | | url: config.base_server + 'api-opration/advisorydoctor/summaryDoctorByDate', |
| | | method: 'POST', |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | where: { |
| | | startTime: start, |
| | | endTime: end |
| | | }, |
| | | page: true, |
| | | cols: [ |
| | | [{ |
| | | field: 'dateTime', |
| | | width: "150", |
| | | title: '日期', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'hospitalName', |
| | | width: "200", |
| | | title: '医院名称', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'doctorName', |
| | | width: "100", |
| | | title: '医生姓名', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'graphicAdvisoryCount', |
| | | width: "150", |
| | | title: '图文咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left' |
| | | }, { |
| | | field: 'graphicAdvisoryDoneCount', |
| | | width: "100", |
| | | title: '当日完成', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryCount', |
| | | width: "150", |
| | | title: '电话咨询当日创建', |
| | | align: 'center', |
| | | fixed: 'left', |
| | | }, { |
| | | field: 'phoneAdvisoryConnectCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日通话', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryDoneCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日完成', |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | field: 'phoneAdvisoryCanncelCount', |
| | | width: "100", |
| | | align: 'center', |
| | | title: '当日取消', |
| | | fixed: 'left' |
| | | } |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | $("#app-btn-search").click(function () { |
| | | initDoctor(); |
| | | }); |
| | | }); |
| | | |
| | | </script> |