Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
Conflicts:
kidgrow-config/src/main/resources/application-dev.properties
127 files modified
7 files added
| | |
| | | package com.kidgrow.filecenter.feign; |
| | | |
| | | import com.kidgrow.common.constant.ServiceNameConstants; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.filecenter.config.FeignMultipartConfig; |
| | | import com.kidgrow.filecenter.feign.fallback.FileServiceFallbackFactory; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | @PostMapping(value = "/baseUplaod",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | FileInfo baseUplaod(@RequestParam("file") String file,@RequestParam("imgType") String imgType); |
| | | |
| | | /** |
| | | * base64 下载图片 |
| | | * @param map |
| | | */ |
| | | @PostMapping(value = "/baseDownLoad",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | ResultBody baseDownLoad(@RequestBody Map<String,Object> map) throws Exception; |
| | | |
| | | } |
| | |
| | | package com.kidgrow.filecenter.feign.fallback; |
| | | |
| | | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.filecenter.feign.FileService; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import feign.hystrix.FallbackFactory; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | public FileInfo baseUplaod(String file, String imgType) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody baseDownLoad(Map<String, Object> map) throws Exception { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import net.coobird.thumbnailator.Thumbnails; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import sun.misc.BASE64Decoder; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private static final String FILE_SPLIT = "."; |
| | | private static Logger logger = LoggerFactory.getLogger(AbstractIFileService.class); |
| | | |
| | | @Value("${kidgrow.file-server.oss.domain}") |
| | | private String DOMAIN; |
| | | @Override |
| | | public FileInfo upload(MultipartFile file) throws Exception { |
| | | FileInfo fileInfo = FileUtil.getFileInfo(file); |
| | |
| | | |
| | | @Override |
| | | public ResultBody baseDownLoad(Map<String, Object> map) throws Exception { |
| | | String urlDiZhi=MapUtils.getString(map,"url"); |
| | | if(!urlDiZhi.contains(DOMAIN)){ |
| | | ByteArrayOutputStream outPut = new ByteArrayOutputStream(); |
| | | byte[] data = new byte[1024]; |
| | | try { |
| | | // 创建URL |
| | | URL url = new URL(urlDiZhi); |
| | | // 创建链接 |
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
| | | conn.setRequestMethod("GET"); |
| | | conn.setConnectTimeout(10 * 1000); |
| | | InputStream inStream = conn.getInputStream(); |
| | | int len = -1; |
| | | while ((len = inStream.read(data)) != -1) { |
| | | outPut.write(data, 0, len); |
| | | } |
| | | inStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String substring = urlDiZhi.substring(urlDiZhi.lastIndexOf(".") + 1, urlDiZhi.length()); |
| | | String str="data:image/" + substring + ";base64,"; |
| | | // 对字节数组Base64编码 |
| | | BASE64Encoder encoder = new BASE64Encoder(); |
| | | System.out.println(encoder.encode(outPut.toByteArray())); |
| | | return ResultBody.ok().data(str+encoder.encode(outPut.toByteArray()).replaceAll("\n", "").replaceAll("\r", "")); |
| | | }else { |
| | | List<FileInfo> fileInfos = baseMapper.selectByMap(map); |
| | | if(fileInfos.size()>0){ |
| | | FileInfo fileInfo = fileInfos.get(0); |
| | | OSSObject down1 = this.down(fileInfo.getUrl().replace("https://kidgrow.oss-accelerate.aliyuncs.com/","")); |
| | | InputStream objectContent = down1.getObjectContent(); |
| | | OSSObject down = this.down(fileInfo.getUrl().replace(DOMAIN, "")); |
| | | InputStream objectContent = down.getObjectContent(); |
| | | //返回Base64编码过的字节数组字符串 |
| | | byte[] data = null; |
| | | // 读取图片字节数组 |
| | |
| | | if (objectContent != null) { |
| | | try { |
| | | objectContent.close(); |
| | | down1.close(); |
| | | down.close(); |
| | | } catch (IOException e) { |
| | | throw new Exception("输入流关闭异常"); |
| | | } |
| | |
| | | return ResultBody.failed("获取数据失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | ByteArrayOutputStream outPut = new ByteArrayOutputStream(); |
| | | byte[] data = new byte[1024]; |
| | | try { |
| | | // 创建URL |
| | | URL url = new URL("http://192.168.2.25:8008/123/J-1.jpg"); |
| | | // 创建链接 |
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); |
| | | conn.setRequestMethod("GET"); |
| | | conn.setConnectTimeout(10 * 1000); |
| | | InputStream inStream = conn.getInputStream(); |
| | | int len = -1; |
| | | while ((len = inStream.read(data)) != -1) { |
| | | outPut.write(data, 0, len); |
| | | } |
| | | inStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 对字节数组Base64编码 |
| | | BASE64Encoder encoder = new BASE64Encoder(); |
| | | System.out.println(encoder.encode(outPut.toByteArray())); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.filecenter.model.FileInfo; |
| | | import com.kidgrow.filecenter.service.IFileService; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | */ |
| | | @PostMapping(value="baseDownLoad") |
| | | public ResultBody baseDownLoad(@RequestBody Map<String,Object> map) throws Exception{ |
| | | String url = MapUtils.getString(map, "url"); |
| | | if (StringUtils.isBlank(url)) { |
| | | return ResultBody.failed("请输入地址"); |
| | | } |
| | | return fileService.baseDownLoad(map); |
| | | } |
| | | |
| | |
| | | # endpoint: http://q68nl7reu.bkt.clouddn.com |
| | | # bucketName: kidgrow |
| | | # domain: kidgrow.s3-cn-east-1.qiniucs.com |
| | | |
| | | # access-key: LTAI4GG27Q85eTB5YvVKZAyg |
| | | # accessKeySecret: thEEFtCxYTPQGrHl0KmUUBXr7gWKdh |
| | | ## endpoint: kidgrow.oss-cn-beijing-internal.aliyuncs.com |
| | | # endpoint: 123.kidgrow.cloud |
| | | ## endpoint: oss-accelerate.aliyuncs.com |
| | | # bucketName: kidgrow |
| | | # #注意加上/ |
| | | # domain: http://123.kidgrow.cloud/ |
| | | ## domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | # folder: kidgrow/ |
| | | access-key: LTAI4FennfcwZupz3B6hkK3N |
| | | accessKeySecret: NzBBGe8SS41qJlp0nA3tlJ3t74lBZM |
| | | endpoint: oss-accelerate.aliyuncs.com |
| | | # endpoint: kidgrow.oss-cn-beijing-internal.aliyuncs.com |
| | | endpoint: 123.kidgrow.cloud |
| | | # endpoint: oss-accelerate.aliyuncs.com |
| | | bucketName: kidgrow |
| | | #注意加上/ |
| | | domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | domain: http://123.kidgrow.cloud/ |
| | | # domain: https://kidgrow.oss-accelerate.aliyuncs.com/ |
| | | folder: kidgrow/ |
| | | |
| | | swagger: |
| | |
| | | import com.kidgrow.common.constant.ServiceNameConstants; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.feign.fallback.ConsumptionServiceFallbackFactory; |
| | | import com.kidgrow.oprationcenter.model.HospitalInfo; |
| | | import com.kidgrow.oprationcenter.vo.ConsumptionRequest; |
| | | import com.kidgrow.oprationcenter.vo.UserProductData; |
| | | import com.kidgrow.ribbon.config.FeignHttpInterceptorConfig; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | */ |
| | | @PostMapping(value = "consumption/Artificial") |
| | | ResultBody consumptionArtificial (@RequestBody ConsumptionRequest consumptionRequest); |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | | * endtime上套餐的到期时间 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | */ |
| | | @GetMapping(value = "productorderdetail/UserProductDetailData") |
| | | ResultBody<UserProductData> UserProductDetailData (@RequestParam("hospitalId") Long hospitalId, @RequestParam("departmentId") Long departmentId); |
| | | |
| | | @PostMapping("/productorderdetail/serviceperiod") |
| | | ResultBody<UserProductData> ServicePeriod(@RequestBody HospitalInfo hospitalInfo); |
| | | } |
| | |
| | | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.feign.ConsumptionService; |
| | | import com.kidgrow.oprationcenter.model.HospitalInfo; |
| | | import com.kidgrow.oprationcenter.vo.ConsumptionRequest; |
| | | import feign.hystrix.FallbackFactory; |
| | | |
| | |
| | | return new ConsumptionService() { |
| | | @Override |
| | | public ResultBody consumptionAIStart(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIStart的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIStart的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionAIReturn(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIReturn的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIReturn的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionAIFail(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionAIFail的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionAIFail的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody consumptionArtificial(ConsumptionRequest consumptionRequest) { |
| | | return ResultBody.failed().msg("consumptionArtificial的FeignClient调用参数传递测试失败"); |
| | | return ResultBody.failed().msg("consumptionArtificial的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody UserProductDetailData(Long hospitalId, Long departmentId) { |
| | | return ResultBody.failed().msg("UserProductDetailData的FeignClient调用失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody ServicePeriod(HospitalInfo hospitalInfo) { |
| | | return ResultBody.failed().msg("getForecastHeight的FeignClient调用失败"); |
| | | } |
| | | }; |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class HospitalInfo { |
| | | private Long hospitalId; |
| | | private Long departmentId; |
| | | } |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | /** |
| | | * 状态,1启用,0停用 |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | /** |
| | | * 产品结束时间-供前端使用 |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date beginTime; |
| | | /** |
| | | * 共享,1是,0不 |
| | | */ |
| | | private Boolean isShare; |
| | | // /** |
| | | // * 产品结束时间-供前端使用 |
| | | // */ |
| | | // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // private Date endTime; |
| | | // /** |
| | | // * 产品结束时间-供前端使用 |
| | | // */ |
| | | // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // @TableField(exist = false) |
| | | // private Date beginTime; |
| | | // /** |
| | | // * 共享,1是,0不 |
| | | // */ |
| | | // private Boolean isShare; |
| | | /** |
| | | * 创建者的部门 |
| | | */ |
New file |
| | |
| | | package com.kidgrow.oprationcenter.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/06/24 11:01 <br> |
| | | * @Author: <a href="411269194@kidgrow.com">houruijun</a> |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class OrderChartVo extends Model<OrderChartVo> { |
| | | //实体序列化 必要 |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 统计的数量 |
| | | */ |
| | | private Integer ccount; |
| | | /** |
| | | * 统计的单位 具体就是 年 月 日 周 之类的 |
| | | * 2020/4 |
| | | * 4 |
| | | * 25 |
| | | * 2 |
| | | */ |
| | | private String units; |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.vo; |
| | | |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ProductOrderDetailVo extends ProductOrderDetail { |
| | | private String hospitalName; |
| | | private Long hospitalId; |
| | | private String departmentName; |
| | | private Long departmentId; |
| | | } |
| | |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.OrderChartVo; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | List<GroupProductDetail> groupProductDetail(Page<GroupProductDetail> page, @Param("p") Map<String, Object> params); |
| | | |
| | | List<ProductOrderJoinDetail> getTypeByUser(Long id); |
| | | |
| | | /** |
| | | * 获取一个科室的试用套餐数量 |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | int getEnabledCount(Long departmentId); |
| | | |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | | * @return |
| | | */ |
| | | int oprationChart(@Param("datatype") int datatype); |
| | | |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | | * beginTime 查询时间段的开始时间 |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<OrderChartVo> productOrderChart(@Param("p") Map<String, Object> params); |
| | | |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | List<OrderChartVo> proCountChart(); |
| | | } |
| | |
| | | * @return ProductOrder对象 |
| | | */ |
| | | ProductOrder findByObject(@Param("p") ProductOrder productOrder); |
| | | |
| | | /** |
| | | * 删除指定orderid下的套餐数据 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | int delProductDetail(@Param("orderId") Long orderId); |
| | | } |
| | |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.vo.DiagnosisRecord; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import com.kidgrow.oprationcenter.vo.UserProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | UserProductDetail getUserProductDetail(Long hospitalId, Long departmentId); |
| | | |
| | | ResultBody biUserNowProduct(Long hospitalId,Long departmentId); |
| | | ResultBody UserProductDetailData(Long hospitalId,Long departmentId); |
| | | ResultBody<UserProductData> UserProductDetailData(Long hospitalId, Long departmentId); |
| | | |
| | | /** |
| | | * 试用审核的列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult all(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取一个科室使用过多少个试用套餐 |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | int getEnabledCount(Long departmentId); |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | | * @return |
| | | */ |
| | | int oprationChart(int datatype); |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | | * beginTime 查询时间段的开始时间 |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<OrderChartVo> productOrderChart(@Param("p") Map<String, Object> params); |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | List<OrderChartVo> proCountChart(); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | ResultBody updateEnabled(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 删除指定orderid下的套餐数据 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | int delProductDetail(Long orderId); |
| | | } |
| | | |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.oprationcenter.model.SysFeedback; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.SysFeedback; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | BusinessRecords businessRecords=new BusinessRecords(); |
| | | businessRecords.setAppName(httpServletRequest.getHeader(SecurityConstants.TENANT_HEADER)); |
| | | businessRecords.setUserId(Long.valueOf(httpServletRequest.getHeader(SecurityConstants.USER_ID_HEADER))); |
| | | businessRecords.setUserName(httpServletRequest.getHeader(SecurityConstants.USER_REAL_NAME)); |
| | | businessRecords.setUserName(httpServletRequest.getHeader(SecurityConstants.USER_HEADER)); |
| | | businessRecords.setRecordTitle(recordTitle); |
| | | businessRecords.setRecordIp(httpServletRequest.getHeader(CommonConstant.USER_AGENT_IP)); |
| | | businessRecords.setRecordDetail(recordNote); |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | |
| | | |
| | | @Override |
| | | public List<DataNeedExcel> findListExportByParam(Map<String, Object> params) { |
| | | List<DataNeed> dataNeeds = baseMapper.selectByMap(params); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | String doctor_name = MapUtils.getString(params, "doctor_name"); |
| | | if(doctor_name!=null){ |
| | | queryWrapper.like("doctor_name","%"+doctor_name+"%"); |
| | | } |
| | | String need_begintime = MapUtils.getString(params, "need_begintime"); |
| | | if(need_begintime!=null){ |
| | | queryWrapper.gt("need_begintime",need_begintime); |
| | | } |
| | | String need_endtime = MapUtils.getString(params, "need_endtime"); |
| | | if(need_endtime!=null){ |
| | | queryWrapper.gt("need_endtime",need_endtime); |
| | | } |
| | | queryWrapper.eq("is_del",0); |
| | | List<DataNeed> dataNeeds = baseMapper.selectList(queryWrapper); |
| | | List<DataNeedExcel> voList=new ArrayList<>(); |
| | | dataNeeds.forEach(e ->{ |
| | | DataNeedExcel vo=new DataNeedExcel(); |
| | |
| | | import com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper; |
| | | import com.kidgrow.oprationcenter.mapper.ProductOrderDetailMapper; |
| | | import com.kidgrow.oprationcenter.model.ConsumptionRecord; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.feign.SysHospitalService; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | private SysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ConsumptionRecordMapper consumptionRecordMapper; |
| | | @Autowired |
| | | private IProductOrderService iProductOrderService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | public ResultBody UserProductDetailData(Long hospitalId,Long departmentId) |
| | | public ResultBody<UserProductData> UserProductDetailData(Long hospitalId,Long departmentId) |
| | | { |
| | | UserProductData userProductData=new UserProductData(); |
| | | userProductData.setEnd(true); |
| | |
| | | } |
| | | return ResultBody.ok().data(userProductData); |
| | | } |
| | | |
| | | /** |
| | | * 获取需要审核的套餐 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult all(Map<String, Object> params) { |
| | | Page<ProductOrderDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductOrderDetail> list = baseMapper.findList(page, params); |
| | | List<ProductOrderDetailVo> volist=new ArrayList<>(); |
| | | for (ProductOrderDetail productOrderDetail : list) { |
| | | ProductOrderDetailVo productOrderDetailVo=new ProductOrderDetailVo(); |
| | | BeanCopier beanCopier = BeanCopier.create(ProductOrderDetail.class, ProductOrderDetailVo.class, false); |
| | | beanCopier.copy(productOrderDetail,productOrderDetailVo,null); |
| | | //查询医院 |
| | | if(productOrderDetail.getOrderId()!=null){ |
| | | ProductOrder productOrder = iProductOrderService.getById(productOrderDetail.getOrderId()); |
| | | if(productOrder!=null){ |
| | | productOrderDetailVo.setDepartmentId(productOrder.getDepartmentId()); |
| | | productOrderDetailVo.setDepartmentName(productOrder.getDepartmentName()); |
| | | productOrderDetailVo.setHospitalId(productOrder.getHospitalId()); |
| | | productOrderDetailVo.setHospitalName(productOrder.getHospitalName()); |
| | | } |
| | | volist.add(productOrderDetailVo); |
| | | } |
| | | } |
| | | return PageResult.<ProductOrderDetailVo>builder().data(volist).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取科室试用次数 |
| | | * @param departmentId 科室ID |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int getEnabledCount(Long departmentId) { |
| | | int counts=baseMapper.getEnabledCount(departmentId); |
| | | return counts; |
| | | } |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int oprationChart(int datatype) { |
| | | return baseMapper.oprationChart(datatype); |
| | | } |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | | * beginTime 查询时间段的开始时间 |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OrderChartVo> productOrderChart(Map<String, Object> params) { |
| | | return baseMapper.productOrderChart(params); |
| | | } |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | @Override |
| | | public List<OrderChartVo> proCountChart() { |
| | | return baseMapper.proCountChart(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | |
| | | int i = baseMapper.updateById(productOrder); |
| | | return i > 0 ? ResultBody.ok().data(productOrder).msg("更新成功") : ResultBody.failed("更新失败"); |
| | | } |
| | | |
| | | @Override |
| | | public int delProductDetail(Long orderId) { |
| | | return baseMapper.delProductDetail(orderId); |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.oprationcenter.mapper.SysFeedbackMapper; |
| | | import com.kidgrow.oprationcenter.model.SysFeedback; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.ProductOrderDetailMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | |
| | | <sql id="whereforall"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | DE.is_del=0 and DE.ailight_count>0 and DE.pro_begintime <=now() and DE.pro_endtime >=now() and DE.enabled=1 |
| | | DE.is_del=0 and DE.ailight_count>0 and DE.pro_begintime <=now() and DE.pro_endtime >=now() and |
| | | DE.enabled=1 |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and PRO.hospital_id = #{p.hospitalId} |
| | | </if> |
| | |
| | | <include refid="whereforall"/> |
| | | order by DE.pro_endtime asc,DE.id asc |
| | | </select> |
| | | |
| | | <select id="getEnabledCount" resultType="int" parameterType="long"> |
| | | SELECT |
| | | COUNT(*) |
| | | FROM |
| | | product_order_record |
| | | WHERE |
| | | pro_type=0 AND is_del=0 AND enabled=1 AND |
| | | order_id IN ( |
| | | SELECT |
| | | id |
| | | FROM |
| | | product_order |
| | | WHERE |
| | | department_id = #{departmentId}) |
| | | </select> |
| | | <select id="oprationChart" resultType="int" parameterType="int"> |
| | | <if test="datatype==0"> |
| | | -- 试用审核 |
| | | SELECT count(*) FROM product_order_detail WHERE enabled=0 AND is_del=0 and pro_type=0 |
| | | </if> |
| | | <if test="datatype==1"> |
| | | -- 套餐总量 |
| | | SELECT count(*) FROM sys_product WHERE is_del=0 and enabled=1 |
| | | </if> |
| | | <if test="datatype==2"> |
| | | -- 未处理用户反馈 |
| | | SELECT count(*) FROM sys_feedback WHERE is_del=0 and enabled=0 |
| | | </if> |
| | | <if test="datatype==3"> |
| | | -- 未处理数据需求 |
| | | SELECT count(*) FROM data_need WHERE is_del=0 and enabled=0 |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="productOrderChart" resultType="com.kidgrow.oprationcenter.vo.OrderChartVo"> |
| | | <if test="p.datatype==1"> |
| | | -- 按年统计 |
| | | SELECT COUNT(t.id) ccount,t.units FROM |
| | | (select id,DATE_FORMAT(contract_time,'%Y/%m') units,contract_time from product_order |
| | | <include refid="whereorderchart"/> |
| | | ) AS t |
| | | GROUP BY t.units |
| | | </if> |
| | | <if test="p.datatype==2"> |
| | | -- 按月统计 |
| | | SELECT COUNT(t.id) ccount,t.units FROM |
| | | (select id,DATE_FORMAT(contract_time,'%Y') units,contract_time from product_order |
| | | <include refid="whereorderchart"/> |
| | | ) AS t |
| | | GROUP BY t.units |
| | | </if> |
| | | </select> |
| | | <sql id="whereorderchart"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | is_del=0 and enabled=1 |
| | | <if test="p.startTime != null and p.endTime !=''"> |
| | | and contract_time between #{p.startTime} and #{p.endTime} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | <select id="proCountChart" resultType="com.kidgrow.oprationcenter.vo.OrderChartVo"> |
| | | SELECT |
| | | count( pro_id ) ccount, |
| | | pro_name units |
| | | FROM |
| | | product_order_record |
| | | WHERE |
| | | is_del = 0 |
| | | AND enabled = 1 |
| | | AND pro_id IN ( SELECT id FROM sys_product WHERE is_del = 0 AND enabled = 1 ) |
| | | GROUP BY |
| | | pro_id, |
| | | pro_name |
| | | ORDER BY |
| | | ccount DESC |
| | | LIMIT 10 |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.ProductOrderMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | <update id="delProductDetail"> |
| | | UPDATE product_order_record SET is_del=1,update_time=now() WHERE order_id= #{orderId}; |
| | | UPDATE product_order_detail SET is_del=1,update_time=now() WHERE order_id= #{orderId}; |
| | | </update> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.ProductOrderRecordMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | |
| | | <mapper namespace="com.kidgrow.oprationcenter.mapper.SysProductMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | <!--定义数据权限的查询--> |
| | | <sql id="Role_Organization"> |
| | |
| | | package com.kidgrow.oprationcenter.config; |
| | | |
| | | import com.alibaba.druid.wall.WallConfig; |
| | | import com.alibaba.druid.wall.WallFilter; |
| | | import com.kidgrow.db.config.DefaultMybatisPlusConfig; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | @Configuration |
| | | @MapperScan({"com.kidgrow.oprationcenter.mapper*"}) |
| | | public class MybatisPlusConfig extends DefaultMybatisPlusConfig { |
| | | @Bean(name = "wallFilter") |
| | | @DependsOn("wallConfig") |
| | | public WallFilter wallFilter(WallConfig wallConfig) { |
| | | WallFilter wallFilter = new WallFilter(); |
| | | wallFilter.setConfig(wallConfig); |
| | | return wallFilter; |
| | | } |
| | | @Bean(name = "wallConfig") |
| | | public WallConfig wallConfig() { |
| | | WallConfig wallConfig = new WallConfig(); |
| | | wallConfig.setMultiStatementAllow(true);//允许一次执行多条语句 |
| | | wallConfig.setNoneBaseStatementAllow(true);//允许一次执行多条语句 |
| | | return wallConfig; |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | if(organizations.size()>0){ |
| | | productOrder.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | } |
| | | //默认添加的合同视为无效合同,在充值完成后,会将对应合同启用 |
| | | productOrder.setIsDel(true); |
| | | boolean v = productOrderService.saveOrUpdate(productOrder); |
| | | if (v) { |
| | | return ResultBody.ok().data(productOrder).msg("保存成功"); |
| | |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public ResultBody delete(@PathVariable Long id,HttpServletRequest request) { |
| | | //先删除合同下的充值 |
| | | int delRows= productOrderService.delProductDetail(id); |
| | | if (delRows==0) { |
| | | log.info(String.format("该订单下无套餐数据{0}!",id)); |
| | | } |
| | | //再删除合同 |
| | | boolean v = productOrderService.removeById(id); |
| | | if (v) { |
| | | if (!businessRecordsService.recordBusinessData("删除合同:"+id,id.toString())) { |
| | | //log.error(String.format("删除合同编号为:{0}的数据后,写入业务日志失败!",id)); |
| | | log.error(String.format("删除合同编号为:{0}的数据后,写入业务日志失败!",id)); |
| | | |
| | | } |
| | | return ResultBody.ok().msg("删除成功"); |
| | |
| | | if (resultBody.getCode()==0) { |
| | | String enablad=(MapUtils.getBoolean(params, "enabled"))?"启用":"禁用"; |
| | | if (!businessRecordsService.recordBusinessData("修改合同状态为:"+enablad,enablad)) { |
| | | //log.error(String.format("修改合同状态为:{0},写入业务日志失败!合同管理id为:{1}",enablad,MapUtils.getString(params,"id"))); |
| | | log.error(String.format("修改合同状态为:{0},写入业务日志失败!合同管理id为:{1}",enablad,MapUtils.getString(params,"id"))); |
| | | } |
| | | } |
| | | return resultBody; |
| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.oprationcenter.model.HospitalInfo; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderRecordService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.OrderChartVo; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import com.kidgrow.oprationcenter.vo.UserProductData; |
| | | import com.kidgrow.usercenter.feign.SysUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | private IBusinessRecordsService businessRecordsService; |
| | | @Autowired |
| | | private IProductOrderService productOrderService; |
| | | |
| | | @Autowired |
| | | private SysUserService sysUserServiceFeign; |
| | | /** |
| | | * 列表 |
| | | */ |
| | |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.findList(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("all") |
| | | public PageResult all(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.all(params); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | | * endtime上套餐的到期时间 |
| | | * |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @return |
| | |
| | | |
| | | @ApiOperation(value = "获取医院套餐是否到期和到期时间") |
| | | @GetMapping("/UserProductDetailData") |
| | | public ResultBody UserProductDetailData(@RequestParam Long hospitalId,Long departmentId) { |
| | | public ResultBody UserProductDetailData(@RequestParam Long hospitalId, @RequestParam Long departmentId) { |
| | | return productOrderDetailService.UserProductDetailData(hospitalId,departmentId); |
| | | } |
| | | |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | | * endtime上套餐的到期时间 |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | @ApiOperation(value = "获取医院套餐是否到期和到期时间") |
| | | @PostMapping("/serviceperiod") |
| | | public ResultBody<UserProductData> ServicePeriod(@RequestBody HospitalInfo hospitalInfo) { |
| | | return productOrderDetailService.UserProductDetailData(hospitalInfo.getHospitalId(), hospitalInfo.getDepartmentId()); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | * 新增or更新 套餐充值 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping("/saveall") |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //先检查科室试用数量是否已经超 |
| | | ProductOrder productOrder = productOrderService.getById(list.get(0).getOrderId()); |
| | | if (productOrder != null) { |
| | | //是否管理人员 |
| | | boolean ismanager=false, |
| | | //是否有待审核套餐 |
| | | isenabled=false; |
| | | //如果是超管,高管,销售部门管理 则不受次数限制 |
| | | ResultBody<LoginAppUser> loginAppUserTemp=sysUserServiceFeign.getLoginAppUser(); |
| | | LoginAppUser loginAppUser=loginAppUserTemp.getData(); |
| | | if (loginAppUser != null) { |
| | | |
| | | List<SysRole> sysRoleList = loginAppUser.getRoles(); |
| | | if (sysRoleList != null && sysRoleList.size() > 0) { |
| | | for (int i = 0; i < sysRoleList.size(); i++) { |
| | | String roleName = sysRoleList.get(i).getCode(); |
| | | if (roleName.equals(CommonConstant.SYSTEM_ADMIN_ROLE_CODE) || |
| | | roleName.equals(CommonConstant.SALE_MANAGER_ROLE_CODE) || |
| | | roleName.equals(CommonConstant.PC_ADMIN_ROLE_CODE) || |
| | | roleName.equals(CommonConstant.OPRATIONMANAGER_ROLE_CODE)) { |
| | | ismanager=true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (!ismanager) { |
| | | int counts = productOrderDetailService.getEnabledCount(productOrder.getDepartmentId()); |
| | | if (counts >= CommonConstant.MAX_FREE_COUNT) { |
| | | //超过了限定次数 将试用套餐改为禁用 待审核 |
| | | for (int i = 0; i <list.size() ; i++) { |
| | | if (list.get(i).getProType()==0) { |
| | | //试用套餐 |
| | | list.get(i).setEnabled(false); |
| | | isenabled=true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //写充值套餐给用户 |
| | | Boolean v = productOrderDetailService.saveBatch(list); |
| | | //写充值记录 |
| | | //对象转换 |
| | | List<ProductOrderRecord> productOrderRecordList= new ArrayList<ProductOrderRecord>();; |
| | | List<ProductOrderRecord> productOrderRecordList = new ArrayList<ProductOrderRecord>(); |
| | | ; |
| | | list.forEach(item->{ |
| | | ProductOrderRecord productOrderRecord=new ProductOrderRecord(); |
| | | productOrderRecord.setAilightCount(item.getAilightCount()); |
| | |
| | | productOrderRecordList.add(productOrderRecord); |
| | | }); |
| | | Boolean r = productOrderRecordService.saveBatch(productOrderRecordList); |
| | | if (v&&r) { |
| | | return ResultBody.ok().data(list.size()).msg("产品充值成功"); |
| | | //更新合同 |
| | | Boolean p = false; |
| | | if (productOrder != null) { |
| | | productOrder.setIsDel(false); |
| | | p = productOrderService.saveOrUpdate(productOrder); |
| | | } |
| | | if (v && r && p) { |
| | | if (isenabled) { |
| | | return ResultBody.ok().data(list.size()).msg("充值成功,但是试用套餐需要管理审核才可使用!"); |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.ok().data(list.size()).msg("产品充值成功..."); |
| | | } |
| | | } else { |
| | | //写入订单明细失败,则删除订单记录数据 |
| | | Boolean e = productOrderService.removeById(list.get(0).getOrderId()); |
| | |
| | | return ResultBody.failed().msg("充值数据保存失败,订单已撤回!"); |
| | | else |
| | | return ResultBody.failed().msg("充值数据保存失败,订单撤回失败!"); |
| | | } |
| | | } else { |
| | | return ResultBody.failed().msg("充值数据关联订单不存在!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | boolean v = productOrderDetailService.removeById(id); |
| | | if (v) { |
| | | if (!businessRecordsService.recordBusinessData("删除订单明细:" + id, id.toString())) { |
| | | //log.error(String.format("删除订单明细id为:{1}",id)); |
| | | log.error(String.format("删除订单明细id为:{1}", id)); |
| | | } |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } else { |
| | |
| | | if (resultBody.getCode() == 0) { |
| | | String enablad = (MapUtils.getBoolean(params, "enabled")) ? "启用" : "禁用"; |
| | | if (!businessRecordsService.recordBusinessData("修改订单明细状态为:" + enablad, enablad)) { |
| | | //log.error(String.format("修改合同状态为:{0},写入业务日志失败!合同管理id为:{1}",enablad,MapUtils.getString(params,"id"))); |
| | | log.error(String.format("修改合同状态为:{0},写入业务日志失败!合同管理id为:{1}", enablad, MapUtils.getString(params, "id"))); |
| | | } |
| | | } |
| | | return resultBody; |
| | |
| | | public ResultBody getTypeByUser(@LoginUser SysUser sysUser) { |
| | | return productOrderDetailService.getTypeByUser(sysUser); |
| | | } |
| | | |
| | | /** |
| | | * 统计获取数据量 |
| | | * @param datatype |
| | | * 0 试用审核量 |
| | | * 1 套餐总量 |
| | | * 2 未处理用户反馈 |
| | | * 3 未处理数据需求 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "统计获取数据量") |
| | | @GetMapping("/oprationChart") |
| | | public ResultBody oprationChart(int datatype) { |
| | | int counts=productOrderDetailService.oprationChart(datatype); |
| | | return ResultBody.ok().data(counts).msg("数据获取成功!") ; |
| | | } |
| | | |
| | | /** |
| | | * 按指定类型统计合同数量 |
| | | * @param params |
| | | * datatype 1 按年 |
| | | * 2 按月 |
| | | * 3 按天 |
| | | * 4 按周 |
| | | * beginTime 查询时间段的开始时间 |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "按指定类型统计合同数量") |
| | | @GetMapping("/productOrderChart") |
| | | public ResultBody productOrderChart(@RequestParam Map<String, Object> params) { |
| | | List<OrderChartVo> orderChartVo=productOrderDetailService.productOrderChart(params); |
| | | return ResultBody.ok().data(orderChartVo).msg("数据获取成功!") ; |
| | | } |
| | | |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | @ApiOperation(value = "统计产品的使用数量") |
| | | @GetMapping("/proCountChart") |
| | | public ResultBody proCountChart() { |
| | | List<OrderChartVo> orderChartVo=productOrderDetailService.proCountChart(); |
| | | return ResultBody.ok().data(orderChartVo).msg("数据获取成功!") ; |
| | | } |
| | | } |
| | |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-ribbon-spring-boot-starter</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-usercenter-api</artifactId> |
| | | <version>1.0</version> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
New file |
| | |
| | | package com.kidgrow.usercenter.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysRoleOrganizationMybatisDto { |
| | | private boolean flag; |
| | | private Object object; |
| | | } |
New file |
| | |
| | | package com.kidgrow.usercenter.feign; |
| | | |
| | | import com.kidgrow.common.constant.ServiceNameConstants; |
| | | import com.kidgrow.common.model.LoginAppUser; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.feign.fallback.SysUserServiceFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/8/4 14:33 <br> |
| | | * @Author: <a href="411269194@kidgrow.com">houruijun</a> |
| | | * */ |
| | | @FeignClient(name = ServiceNameConstants.USER_SERVICE, fallbackFactory = SysUserServiceFallbackFactory.class, decode404 = true) |
| | | public interface SysUserService { |
| | | /** |
| | | * 获取用户登录后的相关信息 |
| | | */ |
| | | @GetMapping("/users/current") |
| | | ResultBody<LoginAppUser> getLoginAppUser(); |
| | | } |
New file |
| | |
| | | package com.kidgrow.usercenter.feign.fallback; |
| | | |
| | | import com.kidgrow.common.model.LoginAppUser; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.usercenter.feign.SysUserService; |
| | | import feign.hystrix.FallbackFactory; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: <br> |
| | | * @Project: <br> |
| | | * @CreateDate: Created in 2020/8/4 14:33 <br> |
| | | * @Author: <a href="411269194@kidgrow.com">houruijun</a> |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SysUserServiceFallbackFactory implements FallbackFactory<SysUserService> { |
| | | @Override |
| | | public SysUserService create(Throwable throwable) { |
| | | return new SysUserService() { |
| | | @Override |
| | | public ResultBody<LoginAppUser> getLoginAppUser() { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.usercenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long orgId; |
| | | /** |
| | | * 医院Id |
| | | */ |
| | | @NotNull(message = "医院Id不能为空") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long hospitalId; |
| | | /** |
| | | * 负责的销售代表 |
| | | */ |
| | | @NotNull(message = "服务代表不能为空") |
| | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | |
| | | /** |
| | | * 负责的销售代表 |
| | | */ |
| | |
| | | package com.kidgrow.usercenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | 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; |
| | |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | private Boolean isDel; |
| | | /** |
| | | * 是否管理员 0否 1是 |
| | |
| | | /** |
| | | * 医生状态 1正常 0试用 |
| | | */ |
| | | @NotNull(message = "医生状态 1正常 0试用不能为空") |
| | | @NotNull(message = "医生状态不能为空") |
| | | private Boolean doctorState; |
| | | /** |
| | | * 医生类型 0H+C端都可用 1H端 2C端 默认2 |
| | | */ |
| | | @NotNull(message = "医生类型不能为空") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Integer doctorType; |
| | | /** |
| | | * 启用禁用状态,1启用,0停用 |
| | | */ |
| | |
| | | * 创建者的部门 |
| | | */ |
| | | private String createUserOrgCode; |
| | | /** |
| | | * 医生资质证书 |
| | | */ |
| | | private String doctorCcie; |
| | | } |
| | |
| | | * 创建者的部门 |
| | | */ |
| | | private String createUserOrgCode; |
| | | |
| | | /** |
| | | * 帐号数量,默认6 |
| | | */ |
| | | private Integer accountsCount; |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class SysDoctorDto extends SysDoctorVo { |
| | | private String username; |
| | | //private String username; |
| | | private String password; |
| | | private List<Long> roles; |
| | | } |
| | |
| | | * @return SysDepartment对象 |
| | | */ |
| | | SysDepartment findByObject(@Param("p") SysDepartment sysDepartment); |
| | | |
| | | /** |
| | | *检查指定医院下是否已经存在该名称的科室 |
| | | * @param hosId |
| | | * @param departmentName |
| | | * @return 如果返回空则视为不存在 |
| | | */ |
| | | String checkDepartmentName(@Param("hosId") Long hosId,@Param("departmentName") String departmentName); |
| | | } |
| | |
| | | * @return SysDoctor |
| | | */ |
| | | SysDoctor userIsAdmin(@Param("userName") String userName); |
| | | |
| | | /** |
| | | * 统计医生数量 |
| | | * @param datatype |
| | | * @return |
| | | */ |
| | | int chartDoctor(@Param("datatype") int datatype); |
| | | } |
| | |
| | | */ |
| | | SysHospital findByObject(@Param("p") SysHospital sysHospital); |
| | | |
| | | /** |
| | | * 统计医院数量 |
| | | * @param datatype 医院类型 |
| | | * 0 试用医院 |
| | | * 1 正式医院 |
| | | * 11 筛查医院 |
| | | * @return |
| | | */ |
| | | int chartHospital(@Param("datatype") int datatype); |
| | | |
| | | } |
| | |
| | | ResultBody findAll(Map<String, Object> params); |
| | | |
| | | ResultBody findListByHospitalId(Map<String, Object> params); |
| | | /** |
| | | *检查指定医院下是否已经存在该名称的科室 |
| | | * @param hosId |
| | | * @param departmentName |
| | | * @return 如果返回空则视为不存在 |
| | | */ |
| | | String checkDepartmentName(Long hosId,String departmentName); |
| | | } |
| | | |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<SysDoctorVo> findList(Map<String, Object> params, SysUser user); |
| | | PageResult<SysDoctorDto> findList(Map<String, Object> params, SysUser user); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | int deleteByUserId(Long userId); |
| | | /** |
| | | * 统计医生的数量 |
| | | * @param datatype 业务类型 |
| | | * 0 自注册医生 |
| | | * 1 签约医生 |
| | | * 2 医答医生 |
| | | * 3 C端医生 |
| | | * 4 H端医生 |
| | | * @return |
| | | */ |
| | | int chartDoctor(int datatype); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | ResultBody updateLogo(@RequestBody Map<String, Object> params); |
| | | |
| | | /** |
| | | * 统计医院数量 |
| | | * @param datatype 医院类型 |
| | | * 0 试用医院 |
| | | * 1 正式医院 |
| | | * 11 筛查医院 |
| | | * @return |
| | | */ |
| | | ResultBody chartHospital(int datatype); |
| | | } |
| | |
| | | package com.kidgrow.usercenter.service; |
| | | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUserOrg; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | |
| | |
| | | * @return SysUserOrg对象 |
| | | */ |
| | | SysUserOrg findByObject(SysUserOrg sysUserOrg); |
| | | |
| | | List<SysUserOrg> getListByMap(Map<String, Object> params); |
| | | |
| | | List<SysOrganization> getListUser(Long userId); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | ResultBody isRegUser(String userTel); |
| | | |
| | | /** |
| | | * 检查手机号是否已经注册 true存在 false不存在 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | boolean phoneIsUsed(String phone); |
| | | |
| | | ResultBody jiaMipython(String password); |
| | | |
| | | /** |
| | | * 根据科室id反查医院id |
| | | * @param departmentId 科室id |
| | | * @return |
| | | */ |
| | | Long HospitalIdByDepartmentId(Long departmentId); |
| | | } |
| | |
| | | } |
| | | return ResultBody.ok().data(sysDepartments); |
| | | } |
| | | |
| | | @Override |
| | | public String checkDepartmentName(Long hosId, String departmentName) { |
| | | String departName=baseMapper.checkDepartmentName(hosId,departmentName); |
| | | return departName; |
| | | } |
| | | } |
| | |
| | | package com.kidgrow.usercenter.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.AbstractWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.usercenter.mapper.SysDictionariesMapper; |
| | | import com.kidgrow.usercenter.model.SysDictionaries; |
| | | import com.kidgrow.usercenter.service.ISysDictionariesService; |
| | | import com.kidgrow.usercenter.vo.SysDictionariesVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.usercenter.model.SysDictionaries; |
| | | import com.kidgrow.usercenter.mapper.SysDictionariesMapper; |
| | | import com.kidgrow.usercenter.service.ISysDictionariesService; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | BeanCopier beanCopier = BeanCopier.create(SysDictionaries.class, SysDictionariesVo.class, false); |
| | | beanCopier.copy(dictionaries,sysDictionariesVo,null); |
| | | if(StringUtils.isNotBlank(dictionaries.getDictionariesClassId())){ |
| | | SysDictionaries dic = baseMapper.selectById(dictionaries.getDictionariesClassId()); |
| | | if(dic!=null){ |
| | | sysDictionariesVo.setDictionariesClassName(dic.getDictionariesName()); |
| | | Map<String, Object> paramsTemp=new HashMap<>(); |
| | | paramsTemp.put("dictionaries_key",dictionaries.getDictionariesClassId()); |
| | | List<SysDictionaries> dicList = baseMapper.selectByMap(paramsTemp); |
| | | if(dicList!=null&&dicList.size()>0){ |
| | | sysDictionariesVo.setDictionariesClassName(dicList.get(0).getDictionariesName()); |
| | | } |
| | | } |
| | | listvo.add(sysDictionariesVo); |
| | |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.redis.util.RedisConstant; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.usercenter.mapper.SysDoctorMapper; |
| | | import com.kidgrow.usercenter.mapper.SysRoleMapper; |
| | | import com.kidgrow.usercenter.mapper.SysUserRoleMapper; |
| | | import com.kidgrow.usercenter.mapper.*; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.model.SysRoleUser; |
| | | import com.kidgrow.usercenter.service.ISysDoctorService; |
| | | import com.kidgrow.usercenter.service.ISysUserOrgService; |
| | |
| | | @Autowired |
| | | private SysRoleMapper sysRoleMapper; |
| | | @Autowired |
| | | private SysHospitalMapper sysHospitalMapper; |
| | | @Autowired |
| | | private SysDepartmentMapper sysDepartmentMapper; |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @Autowired |
| | | private SysUserServiceImpl sysUserServiceImpl; |
| | |
| | | // private final String HOSPITAL_ADMIN="hospital_admin"; |
| | | |
| | | @Override |
| | | public PageResult<SysDoctorVo> findList(Map<String, Object> params, SysUser user) { |
| | | public PageResult<SysDoctorDto> findList(Map<String, Object> params, SysUser user) { |
| | | Page<SysDoctor> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | //添加权限 |
| | | SysRoleOrganizationServiceImpl.getRoleOrg(params, user); |
| | | List<SysDoctor> list = baseMapper.findList(page, params); |
| | | List<SysDoctorVo> listvo = new ArrayList<>(); |
| | | List<SysDoctorDto> listvo = new ArrayList<>(); |
| | | list.forEach(e -> { |
| | | SysDoctorVo vo = new SysDoctorVo(); |
| | | SysDoctorDto vo = new SysDoctorDto(); |
| | | BeanCopier beanCopier = BeanCopier.create(SysDoctor.class, SysDoctorVo.class, false); |
| | | beanCopier.copy(e, vo, null); |
| | | //查询用户的登录账号; |
| | |
| | | if (sysUser != null) { |
| | | vo.setUsername(sysUser.getUsername()); |
| | | } |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("user_id",e.getUserId()); |
| | | List<SysRoleUser> roleUserList = sysUserRoleMapper.selectList(queryWrapper); |
| | | List<Long> collect = roleUserList.stream().map(roleUser -> roleUser.getRoleId()).collect(Collectors.toList()); |
| | | vo.setRoles(collect); |
| | | } |
| | | listvo.add(vo); |
| | | }); |
| | | return PageResult.<SysDoctorVo>builder().data(listvo).code(0).count(page.getTotal()).build(); |
| | | return PageResult.<SysDoctorDto>builder().data(listvo).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据userid删除医生数据 |
| | | * |
| | | * @param userId |
| | | * @return |
| | | */ |
| | |
| | | params.put("userId", userId); |
| | | return baseMapper.deleteByMap(params); |
| | | } |
| | | |
| | | /** |
| | | * 统计医生的数量 |
| | | * |
| | | * @param datatype 业务类型 |
| | | * 0 自注册医生 |
| | | * 1 签约医生 |
| | | * 2 医答医生 |
| | | * 3 C端医生 |
| | | * 4 H端医生 |
| | | * 5 待审核医生 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int chartDoctor(int datatype) { |
| | | return baseMapper.chartDoctor(datatype); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody enable(Map<String, Object> params) { |
| | | Long aLong = MapUtils.getLong(params,"id"); |
| | |
| | | if(null==sysDoctor){ |
| | | return ResultBody.failed("请填写信息"); |
| | | }else { |
| | | Boolean flag = false; |
| | | if (sysDoctor.getDoctorType() != 2) { |
| | | if(sysDoctor.getRoles()==null||sysDoctor.getRoles().size()<=0){ |
| | | return ResultBody.failed("选择一个角色"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 限制只有创建医生的个数 |
| | | * |
| | | */ |
| | | if (sysUserServiceImpl.departmetAccountsCount(sysDoctor.getDepartmentId()) <= 0) { |
| | | return ResultBody.failed("该部门创建人数已经达到上限"); |
| | | } |
| | | SysHospital sysHospital = sysHospitalMapper.selectById(sysDoctor.getHospitalId()); |
| | | SysDepartment sysDepartment = sysDepartmentMapper.selectById(sysDoctor.getDepartmentId()); |
| | | if (sysDoctor.getId() == null) { |
| | | Long sysUserId = null; |
| | | //保存部门信息 |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment); |
| | | if(resultBody.getCode()==0){ |
| | | sysUserId=(Long)resultBody.getData(); |
| | | }else { |
| | | return resultBody; |
| | | } |
| | | //保存doctor的数据 |
| | | SysDoctor sysDoc = new SysDoctor(); |
| | | BeanCopier beanCopier = BeanCopier.create(SysDoctorDto.class, SysDoctor.class, false); |
| | | beanCopier.copy(sysDoctor, sysDoc, null); |
| | | sysDoc.setUserId(sysUserId); |
| | | if (user.getOrganizations() != null) { |
| | | List<SysOrganization> organizations = user.getOrganizations(); |
| | | sysDoc.setCreateUserOrgCode(organizations.get(organizations.size() - 1).getOrgCode()); |
| | | } |
| | | baseMapper.insert(sysDoc); |
| | | } else { |
| | | //更新 |
| | | SysDoctor getOne = baseMapper.selectById(sysDoctor.getId()); |
| | | if (getOne.getDoctorType() != 2 && sysDoctor.getDoctorType() != 2) { |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("user_id", sysDoctor.getUserId()); |
| | | boolean b = sysUserOrgService.removeByMap(columnMap); |
| | | //保存将sys_user_org |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(getOne.getUserId()); |
| | | sysUserOrg.setEnabled(false); |
| | | sysUserOrg.setFromId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrg.setOrgId(sysDepartment.getOrgId()); |
| | | sysUserOrg.setCreateTime(new Date()); |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi = new SysUserOrg(); |
| | | sysGongsi.setUserId(getOne.getId()); |
| | | sysGongsi.setOrgId(sysHospital.getOrgId()); |
| | | sysGongsi.setFromId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgService.saveOrUpdate(sysGongsi); |
| | | baseMapper.updateById(sysDoctor); |
| | | if (redisUtils.hHasKey(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString())) { |
| | | redisUtils.hdel(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString()); |
| | | } |
| | | redisUtils.hset(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString(), sysUserOrg); |
| | | } else if (getOne.getDoctorType() == 2 && sysDoctor.getDoctorType() != 2) { |
| | | /** |
| | | * 管理员只有一个 |
| | | */ |
| | | if (isSupperRole(sysDoctor)) { |
| | | return ResultBody.failed("该部门已经有管理员"); |
| | | } |
| | | ResultBody resultBody = this.saveFenjiekou(sysDoctor, id, sysHospital, sysDepartment); |
| | | Long sysUserId = null; |
| | | if(resultBody.getCode()==0){ |
| | | sysUserId=(Long)resultBody.getData(); |
| | | }else { |
| | | return resultBody; |
| | | } |
| | | sysDoctor.setUserId(sysUserId); |
| | | baseMapper.updateById(sysDoctor); |
| | | } else if (getOne.getDoctorType() != 2 && sysDoctor.getDoctorType() == 2) { |
| | | //将组织删除 |
| | | Map<String, Object> columnMap = new HashMap<>(); |
| | | columnMap.put("user_id", getOne.getUserId()); |
| | | boolean b = sysUserOrgService.removeByMap(columnMap); |
| | | SysUser byId = iSysUserService.getById(getOne.getUserId()); |
| | | //将角色删除 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("user_id",getOne.getUserId()); |
| | | int delete = sysUserRoleMapper.delete(queryWrapper); |
| | | if(byId!=null){ |
| | | byId.setDel(true); |
| | | boolean b1 = iSysUserService.updateById(byId); |
| | | } |
| | | redisUtils.hdel(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString()); |
| | | sysDoctor.setUserId(null); |
| | | baseMapper.updateById(sysDoctor); |
| | | } else if (getOne.getDoctorType() == 2 && sysDoctor.getDoctorType() == 2) { |
| | | baseMapper.updateById(sysDoctor); |
| | | } |
| | | } |
| | | } |
| | | return ResultBody.ok(); |
| | | } |
| | | //是否可以使是超管角色 |
| | | public Boolean isSupperRole(SysDoctorDto sysDoctor){ |
| | | Boolean flag = false; |
| | | /** |
| | | * 限制管理员只有一个 |
| | | */ |
| | | |
| | | Boolean flag=false; |
| | | if(sysDoctor.getRoles().contains(CommonConstant.HOSPITAL_ADMIN_ID)){ |
| | | //查询一个部门下的所有医生 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | |
| | | wrapper=new QueryWrapper(); |
| | | wrapper.in("user_id",collect); |
| | | List<SysRoleUser> list= this.sysUserRoleMapper.selectList(wrapper); |
| | | |
| | | for (SysRoleUser sysRoleUser : list) { |
| | | if(sysRoleUser.getRoleId()==CommonConstant.HOSPITAL_ADMIN_ID){ |
| | | flag=true; |
| | |
| | | } |
| | | } |
| | | } |
| | | if(flag){ |
| | | return flag; |
| | | } |
| | | |
| | | //保存的分接口 |
| | | public ResultBody saveFenjiekou(SysDoctorDto sysDoctor, String id, SysHospital sysHospital, SysDepartment sysDepartment) { |
| | | Long sysUserId = null; |
| | | /** |
| | | * 管理员只有一个 |
| | | */ |
| | | if (isSupperRole(sysDoctor)) { |
| | | return ResultBody.failed("该部门已经有管理员"); |
| | | } |
| | | /** |
| | | * 限制只有创建医生的个数 |
| | | * |
| | | */ |
| | | if(sysUserServiceImpl.departmetAccountsCount(sysDoctor.getDepartmentId())<=0){ |
| | | return ResultBody.failed("该部门创建人数已经达到上限"); |
| | | } |
| | | Long departmentId = sysDoctor.getDepartmentId(); |
| | | if (sysDoctor.getId()==null) { |
| | | if (sysDoctor.getDoctorType() != 2) { |
| | | //保存 |
| | | SysUser sysUser=new SysUser(); |
| | | sysUser.setUsername(sysDoctor.getUsername()); |
| | |
| | | sysUser.setNickname(sysDoctor.getHospitalName()); |
| | | sysUser.setHeadImgUrl(sysDoctor.getDoctorLogo()); |
| | | sysUser.setMobile(sysDoctor.getDoctorTel()); |
| | | sysUser.setType(CommonConstant.H_DOCTOR); |
| | | sysUser.setType(UserType.DOCTOR.name()); |
| | | sysUser.setTenantId(CommonConstant.H_TENANT); |
| | | sysUser.setCreateTime(new Date()); |
| | | SysUser byId = iSysUserService.getById(id); |
| | |
| | | sysUser.setCreateUserName(byId.getUsername()); |
| | | } |
| | | iSysUserService.save(sysUser); |
| | | //保存 角色信息 |
| | | // Map<String,Object> map= new HashMap<>(); |
| | | // map.put("code",HOSPITAL_ADMIN); |
| | | // map.put("enabled",1); |
| | | // map.put("is_del",0); |
| | | // List<SysRole> sysRoles = sysRoleMapper.selectByMap(map); |
| | | // if(sysRoles.size()>0){ |
| | | sysUserId = sysUser.getId(); |
| | | //保存一个角色 |
| | | sysDoctor.getRoles().forEach(e->{ |
| | | SysRoleUser sysRoleUser=new SysRoleUser(); |
| | |
| | | sysRoleUser.setUserId(sysUser.getId()); |
| | | int insert = sysUserRoleMapper.insert(sysRoleUser); |
| | | }); |
| | | //保存doctor的数据 |
| | | SysDoctor sysDoc=new SysDoctor(); |
| | | BeanCopier beanCopier = BeanCopier.create(SysDoctorDto.class, SysDoctor.class, false); |
| | | beanCopier.copy(sysDoctor,sysDoc,null); |
| | | sysDoc.setUserId(sysUser.getId()); |
| | | if(user.getOrganizations()!=null){ |
| | | List<SysOrganization> organizations = user.getOrganizations(); |
| | | sysDoc.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | } |
| | | |
| | | baseMapper.insert(sysDoc); |
| | | //保存将sys_user_org 保存部门 |
| | | SysUserOrg sysUserOrg=new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getId()); |
| | | sysUserOrg.setOrgId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrg.setOrgId(sysDepartment.getOrgId()); |
| | | //保存公司 |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi=new SysUserOrg(); |
| | | sysGongsi.setUserId(sysUser.getId()); |
| | | sysGongsi.setOrgId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setOrgId(sysHospital.getOrgId()); |
| | | sysGongsi.setFromId(sysDoctor.getHospitalId()); |
| | | sysGongsi.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgService.saveOrUpdate(sysGongsi); |
| | | //保存到Redis |
| | | boolean hset = redisUtils.hset(RedisConstant.USER_ORGANIZATION, sysUserOrg.getUserId().toString(), sysUserOrg); |
| | | }else { |
| | | //更新 |
| | | SysDoctor getOne = baseMapper.selectById(sysDoctor.getId()); |
| | | Map<String, Object> columnMap=new HashMap<>(); |
| | | columnMap.put("user_id",sysDoctor.getUserId()); |
| | | boolean b = sysUserOrgService.removeByMap(columnMap); |
| | | //保存将sys_user_org |
| | | SysUserOrg sysUserOrg=new SysUserOrg(); |
| | | sysUserOrg.setUserId(getOne.getUserId()); |
| | | sysUserOrg.setEnabled(false); |
| | | sysUserOrg.setOrgId(sysDoctor.getDepartmentId()); |
| | | sysUserOrg.setCreateTime(new Date()); |
| | | sysUserOrgService.saveOrUpdate(sysUserOrg); |
| | | SysUserOrg sysGongsi=new SysUserOrg(); |
| | | sysGongsi.setUserId(getOne.getId()); |
| | | sysGongsi.setOrgId(sysDoctor.getHospitalId()); |
| | | sysUserOrgService.saveOrUpdate(sysGongsi); |
| | | baseMapper.updateById(sysDoctor); |
| | | if(redisUtils.hHasKey(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString())){ |
| | | redisUtils.hdel(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString()); |
| | | } |
| | | redisUtils.hset(RedisConstant.USER_ORGANIZATION, getOne.getUserId().toString(), sysUserOrg); |
| | | } |
| | | } |
| | | return ResultBody.ok(); |
| | | return ResultBody.ok().data(sysUserId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | int update = sysUserRoleMapper.update(sysRoleUser, queryWrapper); |
| | | //现将操作人员设为非管理角色 |
| | | sysDoctor.setIsAdminUser(false); |
| | | if(baseMapper.updateById(sysDoctor)>0) |
| | | { |
| | | if (baseMapper.updateById(sysDoctor) > 0) { |
| | | //再将新用户设为管理 |
| | | sysDoctor=baseMapper.selectById(id); |
| | | if (sysDoctor != null) { |
| | |
| | | sysDoctor.setIsAdminUser(true); |
| | | if (baseMapper.updateById(sysDoctor)>0) { |
| | | return ResultBody.ok().data(true).msg("管理员设置成功!"); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("设为管理失败!").data(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("设为管理失败,改用户就是管理员!").data(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("用户信息有误!").data(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("设为管理失败!").data(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("当前操作用户不是管理员!").data(false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("用户信息有误!").data(false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("业务参数有误!").data(false); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断用户名是否管理员 |
| | | * |
| | | * @param userName |
| | | * @return |
| | | */ |
| | |
| | | SysDoctor sysDoctor= baseMapper.userIsAdmin(userName); |
| | | if (sysDoctor != null) { |
| | | return ResultBody.ok().data(sysDoctor.getIsAdminUser()); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed().data(false); |
| | | } |
| | | }else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("用户名不能为空!").data(false); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.usercenter.mapper.SysDepartmentMapper; |
| | | import com.kidgrow.usercenter.mapper.SysHospitalMapper; |
| | | import com.kidgrow.usercenter.mapper.SysOrganizationMapper; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.service.ISysHospitalService; |
| | |
| | | private SysDepartmentMapper departmentMapper; |
| | | @Autowired |
| | | private SysRoleOrganizationServiceImpl SysRoleOrganizationServiceImpl; |
| | | @Autowired |
| | | private SysOrganizationMapper sysOrganizationMapper; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | public PageResult<HospitalListVo> findHospitalList(Map<String, Object> params, SysUser user) { |
| | | Page<HospitalListVo> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | SysRoleOrganizationServiceImpl.getRoleOrg(params, user); |
| | | if(params.get("roleOrg")==null){ |
| | | return PageResult.<HospitalListVo>builder().data(null).code(0).count(page.getTotal()).build(); |
| | | } |
| | | List<HospitalListVo> list = baseMapper.findHospitalList(page, params); |
| | | return PageResult.<HospitalListVo>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | |
| | | SysHospital sysHospital = baseMapper.selectById(id); |
| | | //医院下的所有数据 |
| | | Map<String,Object> columnMap=new HashMap<String,Object>(); |
| | | columnMap.put("hospital_id",id); |
| | | columnMap.put("is_del",(boolean)false); |
| | | columnMap.put("enabled",!enabled); |
| | | List<SysDepartment> sysDepartmentList=departmentMapper.selectByMap(columnMap); |
| | | columnMap.put("is_del",0); |
| | | columnMap.put("enabled",(enabled)?0:1); |
| | | columnMap.put("org_parent_id",sysHospital.getOrgId()); |
| | | List<SysOrganization> sysOrganizationList=sysOrganizationMapper.selectByMap(columnMap); |
| | | if (sysHospital == null) { |
| | | return ResultBody.failed("医院数据不存在!"); |
| | | } |
| | |
| | | return ResultBody.failed("科室数据不存在!"); |
| | | } |
| | | //如果这个医院下有多个科室,禁用只对当前科室有效,否则也要禁用医院 |
| | | if(sysDepartmentList.size()==1) |
| | | if(sysOrganizationList.size()==1) |
| | | { |
| | | sysHospital.setEnabled(enabled); |
| | | int i =baseMapper.updateById(sysHospital); |
| | | //Log.info("修改医院状态为:{}",enabled+" "+i); |
| | | baseMapper.updateById(sysHospital); |
| | | SysOrganization sysOrganizationH=sysOrganizationMapper.selectById(sysHospital.getOrgId()); |
| | | if (sysOrganizationH != null) { |
| | | sysOrganizationH.setEnabled(enabled); |
| | | sysOrganizationMapper.updateById(sysOrganizationH); |
| | | } |
| | | } |
| | | sysDepartment.setEnabled(enabled); |
| | | int j=departmentMapper.updateById(sysDepartment); |
| | | //更新组织数据 |
| | | SysOrganization sysOrganizationD=sysOrganizationMapper.selectById(sysDepartment.getOrgId()); |
| | | if (sysOrganizationD != null) { |
| | | sysOrganizationD.setEnabled(enabled); |
| | | sysOrganizationMapper.updateById(sysOrganizationD); |
| | | } |
| | | return (j > 0) ? ResultBody.ok().data(sysHospital).msg("更新成功") : ResultBody.failed("更新失败"); |
| | | } |
| | | |
| | |
| | | SysDepartment sysDepartment=departmentMapper.selectById(departmentId); |
| | | //医院数据 |
| | | SysHospital sysHospital = baseMapper.selectById(id); |
| | | //医院下的所有数据 |
| | | Map<String,Object> columnMap=new HashMap<String,Object>(); |
| | | columnMap.put("hospital_id",id); |
| | | List<SysDepartment> sysDepartmentList=departmentMapper.selectByMap(columnMap); |
| | | if (sysHospital == null) { |
| | | return ResultBody.failed("医院数据不存在!"); |
| | | } |
| | | if (sysDepartment == null) { |
| | | return ResultBody.failed("科室数据不存在!"); |
| | | } |
| | | //医院下的所有科室数据 |
| | | Map<String,Object> columnMap=new HashMap<String,Object>(); |
| | | columnMap.put("org_parent_id",sysHospital.getOrgId()); |
| | | columnMap.put("is_del",0); |
| | | columnMap.put("enabled",1); |
| | | List<SysOrganization> sysOrganizationList=sysOrganizationMapper.selectByMap(columnMap); |
| | | //如果这个医院下有多个科室,禁用只对当前科室有效,否则也要禁用医院 |
| | | if(sysDepartmentList.size()==1) |
| | | if(sysOrganizationList.size()==1) |
| | | { |
| | | sysHospital.setIsDel(true); |
| | | int i =baseMapper.updateById(sysHospital); |
| | | //Log.info("修改医院状态为:{}",enabled+" "+i); |
| | | baseMapper.updateById(sysHospital); |
| | | SysOrganization sysOrganizationH=sysOrganizationMapper.selectById(sysHospital.getOrgId()); |
| | | if (sysOrganizationH != null) { |
| | | sysOrganizationH.setIsDel(true); |
| | | sysOrganizationMapper.updateById(sysOrganizationH); |
| | | } |
| | | } |
| | | sysDepartment.setIsDel(true); |
| | | int j=departmentMapper.updateById(sysDepartment); |
| | | //删除组织数据 |
| | | SysOrganization sysOrganizationD=sysOrganizationMapper.selectById(sysDepartment.getOrgId()); |
| | | if (sysOrganizationD != null) { |
| | | sysOrganizationD.setIsDel(true); |
| | | sysOrganizationMapper.updateById(sysOrganizationD); |
| | | } |
| | | return (j > 0) ? ResultBody.ok().data(sysHospital).msg("删除成功") : ResultBody.failed("删除失败"); |
| | | } |
| | | |
| | |
| | | return ResultBody.failed("修改数据有误!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计医院数量 |
| | | * @param datatype 医院类型 |
| | | * 0 试用医院 |
| | | * 1 正式医院 |
| | | * 11 筛查医院 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody chartHospital(int datatype) { |
| | | int hospitalCount=baseMapper.chartHospital(datatype); |
| | | return ResultBody.ok().data(hospitalCount).msg("获取数据成功"); |
| | | } |
| | | } |
| | |
| | | RedisUtils redisUtils; |
| | | @Autowired |
| | | SysUserOrgMapper sysUserOrgMapper; |
| | | |
| | | /** |
| | | * 列表 |
| | | * |
| | |
| | | @Override |
| | | public ResultBody getTree(Map<String, Object> params) { |
| | | List<SysOrganization> sysOrganizations = baseMapper.selectByMap(params); |
| | | //查询 ,父类为-1的;即顶级父类 |
| | | // params.put("org_parent_id",Long.valueOf("-1")); |
| | | // List<SysOrganization> sysOrgs=baseMapper.selectByMap(params); |
| | | // if (sysOrgs.isEmpty()) { |
| | | // return ResultBody.ok().data(null); |
| | | // } |
| | | List<Map<String, Object>> treeData = getTreeData(Long.valueOf("-1"), sysOrganizations); |
| | | return ResultBody.ok().data(treeData); |
| | | } |
| | |
| | | @Override |
| | | public int deleteByUserId(Long userId) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("userId", userId); |
| | | params.put("user_id", userId); |
| | | return sysUserOrgMapper.deleteByMap(params); |
| | | } |
| | | |
| | |
| | | public List<Map<String, Object>> getTreeData(Long MyId, List<SysOrganization> sysOrganizations) { |
| | | List<Map<String, Object>> listMap = new ArrayList<>(); |
| | | Map<Long, SysOrganization> collect = sysOrganizations.stream().collect(Collectors.toMap(SysOrganization::getId, SysOrganization -> SysOrganization)); |
| | | List<Long> idList = sysOrganizations.stream().filter(e -> e.getOrgParentId() == MyId).map(e -> e.getId()).collect(Collectors.toList()); |
| | | List<Long> idList = sysOrganizations.stream().filter(e -> MyId.equals(e.getOrgParentId())).map(e -> e.getId()).collect(Collectors.toList()); |
| | | for (Long id : idList |
| | | ) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | map.put("name", collect.get(id).getOrgName()); |
| | | map.put("level", collect.get(id).getOrgLevel()); |
| | | map.put("parentId", collect.get(id).getOrgParentId()); |
| | | List<Long> childs = sysOrganizations.stream().filter(e -> e.getOrgParentId() == id).map(e -> e.getId()).collect(Collectors.toList()); |
| | | List<Long> childs = sysOrganizations.stream().filter(e -> |
| | | id.equals(e.getOrgParentId()) |
| | | ).map(e -> e.getId()).collect(Collectors.toList()); |
| | | if (childs.size() > 0) { |
| | | List<Map<String, Object>> treeData = getTreeData(id, sysOrganizations); |
| | | map.put("children", treeData); |
| | |
| | | //查询 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_parent_id", sysOrg.getId()); |
| | | queryWrapper.orderByAsc("id"); |
| | | queryWrapper.orderByDesc("org_code"); |
| | | queryWrapper.last("limit 1"); |
| | | List<SysOrganization> list = baseMapper.selectList(queryWrapper); |
| | | if (list.size() > 0) { |
| | | SysOrganization sysOrganizationLast = list.get(list.size() - 1); |
| | | if (sysOrganizationLast.getOrgLevel() >= 2) { |
| | | String orgCodeLast = sysOrganizationLast.getOrgCode(); |
| | | String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 4); |
| | | Integer codenum = Integer.valueOf(orgCodeLast.substring(orgCodeLast.length() - 4)); |
| | | String str = "0000"; |
| | | //取前部分 |
| | | String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 3); |
| | | //取后部分 |
| | | Integer codenum = Integer.valueOf(orgCodeLast.substring(orgCodeLast.length() - 3)); |
| | | String str = "00"; |
| | | str += (codenum + 1); |
| | | String substring = str.substring(str.length() - 4); |
| | | String substring = str.substring(str.length() - 3); |
| | | return orgCodeLastQianZhui + substring; |
| | | } else { |
| | | String orgCodeLast = sysOrganizationLast.getOrgCode(); |
| | | //取前部分 |
| | | String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 7); |
| | | //取后部分 |
| | | Integer codenum = Integer.valueOf(orgCodeLast.substring(orgCodeLast.length() - 7)); |
| | | String str = "0000000"; |
| | | str += (codenum + 1); |
| | | String substring = str.substring(str.length() - 7); |
| | | return orgCodeLastQianZhui + substring; |
| | | } |
| | | } else { |
| | | String fucode = sysOrg.getOrgCode(); |
| | | String str = "0001"; |
| | | String str = "01"; |
| | | return fucode + str; |
| | | } |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.usercenter.dto.SysRoleOrganizationDto; |
| | | import com.kidgrow.usercenter.dto.SysRoleOrganizationMybatisDto; |
| | | import com.kidgrow.usercenter.mapper.SysRoleMapper; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.service.ISysRoleService; |
| | | import com.kidgrow.usercenter.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | |
| | | import com.kidgrow.usercenter.model.SysRoleOrganization; |
| | | import com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper; |
| | | import com.kidgrow.usercenter.service.ISysRoleOrganizationService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | |
| | | public class SysRoleOrganizationServiceImpl extends SuperServiceImpl<SysRoleOrganizationMapper, SysRoleOrganization> implements ISysRoleOrganizationService { |
| | | |
| | | |
| | | private final Integer TYPE_QUAN_BU = 1;//全部数据权限 |
| | | private final Integer TYPE_ZI_DING_YI = 2;//自定义数据权限 |
| | | private final Integer TYPE_BEN_BU_MEN = 3;//本部门数据权限 |
| | | private final Integer TYPE_BEN_BU_MEN_YI_XIA = 4;//本部门及以下数据权限 |
| | | private final Integer TYPE_BEN_REN = 5;//仅本人数据权限不能为空 |
| | | @Autowired |
| | | private ISysOrganizationService iSysOrganizationService; |
| | | @Autowired |
| | | private ISysRoleService iSysRoleService; |
| | | @Autowired |
| | | private ISysRoleUserService iSysRoleUserService; |
| | | @Autowired |
| | | private ISysUserOrgService iSysUserOrgService; |
| | | @Autowired |
| | | private SysOrganizationServiceImpl sysOrganizationService; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdateSer(SysRoleOrganizationDto sysRoleOrganizationDto, SysUser user) { |
| | | if (sysRoleOrganizationDto.getRoleId() != null) { |
| | | SysRole sysRole = iSysRoleService.getById(sysRoleOrganizationDto.getRoleId()); |
| | |
| | | } |
| | | SysRoleOrganization sysRoleOrganization = new SysRoleOrganization(); |
| | | sysRoleOrganization.setRoleId(sysRoleOrganizationDto.getRoleId()); |
| | | List<SysOrganization> organizations = user.getOrganizations(); |
| | | // 1代表全部数据权限,2自定义数据权限,3本部门数据权限,4本部门及以下数据权限,5仅本人数据权限不能为空") |
| | | //先清除数据 |
| | | if(sysRoleOrganizationDto.getRoleId()!=null){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | |
| | | int i = baseMapper.deleteBatchIds(collect); |
| | | } |
| | | } |
| | | |
| | | //全部数据 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_QUAN_BU) { |
| | | // sysRoleOrganization.setOrgCode("10"); |
| | | // if (organizations != null && organizations.size() > 0) { |
| | | // sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | // } |
| | | // baseMapper.insert(sysRoleOrganization); |
| | | } |
| | | //2自定义数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_ZI_DING_YI) { |
| | | |
| | | List<Long> orgIds = sysRoleOrganizationDto.getOrgIds(); |
| | | orgIds.forEach(e -> { |
| | | sysRoleOrganization.setId(null); |
| | |
| | | } |
| | | baseMapper.insert(sysRoleOrganization); |
| | | }); |
| | | }else { |
| | | |
| | | } |
| | | //3本部门数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_BU_MEN) { |
| | | if (organizations != null && organizations.size() > 0) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | //4本部门及以下数据权限 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_BU_MEN_YI_XIA) { |
| | | if (organizations != null && organizations.size() > 0) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | //5仅本人数据权限不能为空 |
| | | if (sysRoleOrganizationDto.getType() == TYPE_BEN_REN) { |
| | | sysRoleOrganization.setOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | sysRoleOrganization.setOrgId(organizations.get(organizations.size()-1).getId()); |
| | | baseMapper.insert(sysRoleOrganization); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 将权限 分装到map对像 |
| | | * |
| | | * @param params |
| | | * @param user |
| | | */ |
| | | |
| | | public void getRoleOrg(Map<String, Object> params, SysUser user){ |
| | | List<SysRole> roles = user.getRoles(); |
| | | List<Map<Integer,List<SysRoleOrganization>>> listroleOrg=new ArrayList<>(); |
| | | //获取角色接口 |
| | | List<SysRole> roles = iSysRoleUserService.findRolesByUserId(user.getId()); |
| | | List<SysOrganization> listUser = iSysUserOrgService.getListUser(user.getId()); |
| | | List<Map<Integer, Object>> listroleOrg = new ArrayList<>(); |
| | | if(listUser!=null){ |
| | | if (!roles.isEmpty()) { |
| | | roles.forEach(e->{ |
| | | Map<Integer,List<SysRoleOrganization>> rolemap=new HashMap<>(); |
| | | int index=0; |
| | | for (SysRole e : roles) { |
| | | Map<Integer, Object> rolemap = new HashMap<>(); |
| | | SysRoleOrganizationMybatisDto dto=new SysRoleOrganizationMybatisDto(); |
| | | if(e.getType() == 1){ |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getId()); |
| | | rolemap.put(e.getType(), dto); |
| | | }else if (e.getType() == 2) { |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("role_id",e.getId()); |
| | | List<SysRoleOrganization> sysRoleOrganizations = baseMapper.selectByMap(map); |
| | | if(sysRoleOrganizations.size()>0){ |
| | | SysRole sysRole = sysRoleMapper.selectById(e.getId()); |
| | | rolemap.put(sysRole.getType(),sysRoleOrganizations); |
| | | listroleOrg.add(rolemap); |
| | | dto.setFlag(index==0); |
| | | dto.setObject(sysRoleOrganizations); |
| | | rolemap.put(e.getType(), dto); |
| | | } |
| | | }); |
| | | } else if (e.getType() == 3) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getOrganizations().get(user.getOrganizations().size() - 1).getOrgCode()); |
| | | rolemap.put(e.getType(), dto); |
| | | } else if (e.getType() == 4) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getOrganizations().get(user.getOrganizations().size() - 1).getOrgCode()); |
| | | rolemap.put(e.getType(), dto); |
| | | } else if (e.getType() == 5) { |
| | | dto.setFlag(index==0); |
| | | dto.setObject(user.getId()); |
| | | rolemap.put(e.getType(), dto); |
| | | } |
| | | index+=1; |
| | | listroleOrg.add(rolemap); |
| | | }; |
| | | } |
| | | } |
| | | //添加权限控制 |
| | | params.put("roleOrg",listroleOrg); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUserOrg; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.usercenter.mapper.SysUserOrgMapper; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.service.ISysUserOrgService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class SysUserOrgServiceImpl extends SuperServiceImpl<SysUserOrgMapper, SysUserOrg> implements ISysUserOrgService { |
| | | @Autowired |
| | | private ISysOrganizationService iSysOrganizationService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | |
| | | List<SysUserOrg> sysUserOrg = baseMapper.selectByMap(params); |
| | | return sysUserOrg; |
| | | } |
| | | /** |
| | | 根据用户id ,查询组织 |
| | | */ |
| | | @Override |
| | | public List<SysOrganization> getListUser(Long userId) { |
| | | List<SysOrganization> list=new ArrayList<>(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("user_id",userId); |
| | | map.put("is_del",0); |
| | | map.put("enabled",1); |
| | | List<SysUserOrg> sysUserOrgs = baseMapper.selectByMap(map); |
| | | if (!sysUserOrgs.isEmpty()) { |
| | | //查询组织 |
| | | sysUserOrgs.forEach(e ->{ |
| | | SysOrganization byId = iSysOrganizationService.getById(e.getOrgId()); |
| | | if (byId!=null) { |
| | | list.add(byId); |
| | | } |
| | | }); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | private SysRoleMapper sysRoleMapper; |
| | | @Autowired |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @Autowired |
| | | private SysOrganizationMapper sysOrganizationMapper; |
| | | |
| | | @Override |
| | | public LoginAppUser findByUsername(String username) { |
| | | SysUser sysUser = this.selectByUsername(username); |
| | |
| | | return ResultBody.failed("用户信息验证失败,请提供正确的手机号和密码!"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("无效的验证码"); |
| | | } |
| | | } else { |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public ResultBody saveOrUpdateUser(SysUser sysUser) { |
| | | String defaultPassWord = com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | if (sysUser.getId() == null) { |
| | | if (StringUtils.isBlank(sysUser.getType())) { |
| | | sysUser.setType(UserType.BACKEND.name()); |
| | | } |
| | | String defaultPassWord = com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | sysUser.setPassword(passwordEncoder.encode(defaultPassWord)); |
| | | sysUser.setEnabled(Boolean.TRUE); |
| | | } |
| | |
| | | roleUserService.saveBatch(roleUsers); |
| | | } |
| | | } |
| | | sysUser.setPassword(defaultPassWord); |
| | | return result ? ResultBody.ok().data(sysUser).msg("操作成功") : ResultBody.failed("操作失败"); |
| | | } |
| | | |
| | |
| | | SysHospital sysHospital = new SysHospital(); |
| | | sysHospital.setHospitalName(userRegVo.getHospitalName()); |
| | | sysHospital.setOrgId(organizationHos); |
| | | //注册的用户所在医院默认是试用状态 |
| | | sysHospital.setHospitalState(0); |
| | | sysHospital.setCreateUserId(createUserId); |
| | | sysHospital.setCreateUserName(createUserName); |
| | |
| | | userRegVo.setHospitalId(sysHospital.getId()); |
| | | //保存科室数据 |
| | | SysDepartment sysDepartment = new SysDepartment(); |
| | | sysDepartment.setHospitalId(sysHospital.getId()); |
| | | sysDepartment.setOrgId(organizationDep); |
| | | sysDepartment.setDepartmentName(userRegVo.getDepartmentName()); |
| | | sysDepartment.setSaleUserId(createUserId); |
| | |
| | | } |
| | | } else { |
| | | //创建字典数据 |
| | | sysDictionaries.setDictionariesKey(DictionariesConstants.DOCTOR_RANK); |
| | | sysDictionaries.setDictionariesClassId(DictionariesConstants.DOCTOR_RANK_ID.toString()); |
| | | sysDictionaries.setDictionariesClassId(DictionariesConstants.DOCTOR_RANK); |
| | | //将名称汉字转为拼音 |
| | | sysDictionaries.setDictionariesKey(Pinyin4jUtil.makeStringByStringSet(Pinyin4jUtil.getPinyin(userRegVo.getDoctorRank(), true))); |
| | | sysDictionaries.setDictionariesName(userRegVo.getDoctorRank()); |
| | |
| | | |
| | | sysUserOrgH.setUserId(sysUser.getId()); |
| | | sysUserOrgH.setOrgId(organizationHos); |
| | | sysUserOrgH.setFromLevel(CommonConstant.SYSTEM_ORG_HOS_LEVEL); |
| | | sysUserOrgH.setFromId(userRegVo.getHospitalId()); |
| | | sysUserOrgH.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysUserOrgH.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysUserOrgList.add(sysUserOrgH); |
| | | |
| | | sysUserOrgD.setUserId(sysUser.getId()); |
| | | sysUserOrgD.setOrgId(organizationDep); |
| | | sysUserOrgD.setFromId(userRegVo.getDepartmentId()); |
| | | sysUserOrgD.setFromLevel(CommonConstant.SYSTEM_ORG_DEP_LEVEL); |
| | | sysUserOrgD.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysUserOrgD.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysUserOrgList.add(sysUserOrgD); |
| | |
| | | sysDoctor.setDepartmentName(userRegVo.getDepartmentName()); |
| | | sysDoctor.setDoctorRank(userRegVo.getDoctorRank()); |
| | | sysDoctor.setDoctorRankId(userRegVo.getDoctorRankId()); |
| | | sysDoctor.setDoctorType(CommonConstant.H_DOCTOR_TYPE); |
| | | sysDoctor.setCreateUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setCreateUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | if (isReg) { |
| | | sysDoctor.setDoctorState(false); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | sysDoctor.setDoctorState(true); |
| | | } |
| | | sysDoctor.setDoctorTel(userRegVo.getMobile()); |
| | | sysDoctor.setDoctorName(userRegVo.getNickname()); |
| | | sysDoctor.setServerUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setServerUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysDoctor.setIsAdminUser(false); |
| | | sysDoctor.setEnabled(false); |
| | | if (sysDoctorMapper.insert(sysDoctor) == 1) { |
| | | //非自主注册的 返回信息带密码 |
| | | if (!isReg) { |
| | |
| | | if (sysDepartment == null) { |
| | | return 0; |
| | | } else { |
| | | List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysDepartment.getHospitalId(), depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID); |
| | | Long sysHospitalId=HospitalIdByDepartmentId(depatmentId); |
| | | if (sysHospitalId>0) { |
| | | List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysHospitalId, depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID); |
| | | if (hospitalDoctorListVos != null) { |
| | | int doctorCount = hospitalDoctorListVos.size(); |
| | | int accountCount = sysDepartment.getAccountsCount(); |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return 0; |
| | | } |
| | | // private Integer departmetAccountsCount(Long depatmentId) { |
| | | // SysDepartment sysDepartment = departmentService.getById(depatmentId); |
| | | // if (sysDepartment == null) { |
| | | // return 0; |
| | | // } else { |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据部门的id获取所属医院id |
| | | * |
| | | * @return |
| | | */ |
| | | public Long HospitalIdByDepartmentId(Long departmentId) { |
| | | Long hospitalId = -1L; |
| | | SysDepartment sysDepartment = departmentService.getById(departmentId); |
| | | if (sysDepartment != null) { |
| | | //先获取科室的组织数据 |
| | | SysOrganization sysOrganization = sysOrganizationMapper.selectById(sysDepartment.getOrgId()); |
| | | if (sysOrganization != null) { |
| | | //获取上级组织id |
| | | sysOrganization = sysOrganizationMapper.selectById(sysOrganization.getOrgParentId()); |
| | | if (sysOrganization != null) { |
| | | //根据组织id获取上级医院id |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("org_id", sysOrganization.getId()); |
| | | List<SysHospital> sysHospitalList = hospitalService.listByMap(selectMap); |
| | | if (sysHospitalList != null && sysHospitalList.size() > 0) { |
| | | //取第一个 |
| | | hospitalId = sysHospitalList.get(0).getId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return hospitalId; |
| | | } |
| | | /** |
| | | * 根据部门的id获取所属医院id |
| | | * |
| | | * @return |
| | | */ |
| | | // public List<Long> DepartmentIdListByhospitalId(Long hospitalId) { |
| | | // List<Long> hospitalIdList =new ArrayList<Long>(); |
| | | // SysHospital sysHospital = hospitalService.getById(hospitalId); |
| | | // if (sysHospital != null) { |
| | | // //先获取医院的组织数据 |
| | | // SysOrganization sysOrganization = sysOrganizationMapper.selectById(sysHospital.getOrgId()); |
| | | // if (sysOrganization != null) { |
| | | // //根据组织id获取下级科室组织id |
| | | // Map<String, Object> selectMap = new HashMap<>(); |
| | | // selectMap.put("department_id", depatmentId); |
| | | // selectMap.put("enabled", 1); |
| | | // List<SysDoctor> sysDoctorList = sysDoctorMapper.selectByMap(selectMap); |
| | | // if (sysDoctorList != null) { |
| | | // int doctorCount = sysDoctorList.size(); |
| | | // int accountCount = sysDepartment.getAccountsCount(); |
| | | // return (accountCount - doctorCount); |
| | | // } else { |
| | | // return 0; |
| | | // selectMap.put("org_parent_id", sysOrganization.getId()); |
| | | // List<SysOrganization> sysDepartmentList = sysOrganizationMapper.selectByMap(selectMap); |
| | | // if (sysDepartmentList != null && sysDepartmentList.size() > 0) { |
| | | // //hospitalIdList=sysDepartmentList.stream().sorted(Comparator.comparing(SysOrganization::getCreateTime).reversed()).map(SysOrganization::getId).collect(Collectors.toList()); |
| | | // sysDepartmentList.stream().sorted(Comparator.comparing(SysOrganization::getCreateTime).reversed()).map(SysOrganization::getId).collect(Collectors.toList()).get(0); |
| | | // } |
| | | // } |
| | | // } |
| | | // return hospitalIdList; |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 检查用户登录名是否已经注册 true存在 false不存在 |
| | |
| | | |
| | | /** |
| | | * 检查手机号是注册用户还是正式用户 |
| | | * |
| | | * @param userTel |
| | | * @return |
| | | */ |
| | | public ResultBody isRegUser(String userTel) |
| | | { |
| | | public ResultBody isRegUser(String userTel) { |
| | | if (StringUtils.isNotBlank(userTel)) { |
| | | List<SysUser> users = baseMapper.selectList( |
| | | new QueryWrapper<SysUser>().eq("username", userTel) |
| | |
| | | return ResultBody.ok().data(true); |
| | | } |
| | | return ResultBody.ok().data(false); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("用户数据有误!"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return ResultBody.failed("必要参数有误!"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody jiaMipython(String password) { |
| | | String encode = passwordEncoder.encode(password); |
| | | return ResultBody.ok().data(encode); |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.kidgrow.usercenter.mapper.SysCompanyMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | |
| | | <if test="p.id != null and p.id !=''"> |
| | | and id = #{p.id} |
| | | </if> |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and hospital_id = #{p.hospitalId} |
| | | </if> |
| | | <if test="p.departmentName != null and p.departmentName !=''"> |
| | | and department_name = #{p.departmentName} |
| | | </if> |
| | |
| | | <if test="p.updateTime != null and p.updateTime !=''"> |
| | | and update_time = #{p.updateTime} |
| | | </if> |
| | | <if test="p.accountsCount != null and p.accountsCount !=''"> |
| | | and accounts_count = #{p.accountsCount} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | <select id="checkDepartmentName" resultType="string"> |
| | | SELECT org_name FROM sys_organization |
| | | WHERE org_parent_id =( SELECT org_id FROM sys_hospital WHERE id = #{hosId} ) |
| | | AND org_name = #{departmentName} |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.kidgrow.usercenter.mapper.SysDoctorMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | DISTINCT * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | |
| | | username = #{userName} |
| | | OR mobile = #{userName}) |
| | | </select> |
| | | <select id="chartDoctor" resultType="int" parameterType="int"> |
| | | select count(id) doctorCount from sys_doctor where is_del=0 and enabled=1 |
| | | <if test="datatype==0"> |
| | | -- 自注册医生 |
| | | and (doctor_type=0 or doctor_type=1) and doctor_state=0 |
| | | </if> |
| | | <if test="datatype==1"> |
| | | -- 签约医生 |
| | | and is_signing=1 and doctor_state=1 |
| | | </if> |
| | | <if test="datatype==2"> |
| | | -- 医答医生 |
| | | and is_answer=1 and doctor_state=1 |
| | | </if> |
| | | <if test="datatype==3"> |
| | | -- C端医生 |
| | | and (doctor_type=2 or doctor_type=0) and doctor_state=1 |
| | | </if> |
| | | <if test="datatype==4"> |
| | | -- H端医生 |
| | | and (doctor_type=1 or doctor_type=0) and doctor_state=1 |
| | | </if> |
| | | <if test="datatype==5"> |
| | | -- H端医生 |
| | | and (doctor_type=1 or doctor_type=0) and doctor_state=0 and enabled=0 |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | <sql id="whereList"> |
| | | <where> |
| | | DEP.is_del = 0 |
| | | AND HOS.is_del = 0 |
| | | hosisdel = 0 |
| | | <if test="p.isScreen != null and p.isScreen !=''"> |
| | | and is_screen = #{p.isScreen} |
| | | </if> |
| | |
| | | <if test="p.hospitalName != null and p.hospitalName !=''"> |
| | | and hospital_name LIKE concat('%',#{p.hospitalName},'%') |
| | | </if> |
| | | <include refid="com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper.Role_Organization"></include> |
| | | <if test="p.roleOrg != null and p.roleOrg.size>0"> |
| | | |
| | | <foreach item="item" collection="p.roleOrg" index=""> |
| | | <foreach item="itemto" collection="item" index="inx"> |
| | | |
| | | <choose> |
| | | <when test="inx == 1"> |
| | | <if test="itemto.flag"> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx==2"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" |
| | | close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" |
| | | close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | and HOS.is_del = 0 and HOS.enabled=1 |
| | | ) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 3"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code = #{itemto.object} and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 4"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code like '${itemto.object}%' |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code like '${itemto.object}%' and HOS.is_del = 0 and |
| | | HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 5"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | HOS.create_user_id = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (HOS.create_user_id = #{itemto.object} and HOS.is_del = 0 and HOS.enabled=1) |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | AND id is null |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </foreach> |
| | | </foreach> |
| | | </if> |
| | | <!-- <include refid="com.kidgrow.usercenter.mapper.SysRoleOrganizationMapper.Role_Organization"></include>--> |
| | | </where> |
| | | </sql> |
| | | <select id="findHospitalList" resultType="com.kidgrow.usercenter.vo.HospitalListVo"> |
| | |
| | | DEP.org_id, |
| | | DEP.is_del, |
| | | DEP.enabled, |
| | | hospitals.* |
| | | FROM |
| | | sys_department DEP |
| | | LEFT JOIN sys_organization DEORG ON DEP.org_id = DEORG.id and DEP.is_del=0 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | HOS.id hospital_id, |
| | | HOS.hospital_name, |
| | | HOS.hospital_code, |
| | |
| | | HOS.is_answer, |
| | | HOS.tenant_id, |
| | | HOS.area_code, |
| | | HOS.create_time |
| | | HOS.create_time, |
| | | HOS.is_del hosisdel, |
| | | HOS.enabled hosenabled, |
| | | ORG.id AS hosorgid |
| | | FROM |
| | | sys_department DEP |
| | | LEFT JOIN sys_hospital HOS ON DEP.hospital_id = HOS.id |
| | | sys_hospital HOS |
| | | LEFT JOIN sys_organization ORG ON HOS.org_id = ORG.id and ORG.is_del=0 |
| | | ) AS hospitals ON DEORG.org_parent_id = hospitals.hosorgid |
| | | <include refid="whereList"/> |
| | | order by create_time desc |
| | | </select> |
| | |
| | | select id, |
| | | hospital_name |
| | | from sys_hospital |
| | | where hospital_name LIKE concat('%',#{hospitalName},'%') |
| | | where is_del=0 and enabled=1 and hospital_name LIKE concat('%',#{hospitalName},'%') |
| | | order by hospital_name desc |
| | | </select> |
| | | <select id="chartHospital" resultType="int" parameterType="int"> |
| | | SELECT |
| | | count( DISTINCT hospital_name ) hospitalCount |
| | | FROM |
| | | sys_hospital |
| | | WHERE |
| | | <if test="datatype==0"> |
| | | hospital_state =0 |
| | | </if> |
| | | <if test="datatype==1"> |
| | | hospital_state =1 |
| | | </if> |
| | | <if test="datatype==11"> |
| | | is_screen =1 and |
| | | hospital_state =1 |
| | | </if> |
| | | AND is_del = 0 |
| | | AND enabled = 1; |
| | | </select> |
| | | </mapper> |
| | |
| | | <!--定义数据权限的查询--> |
| | | <sql id="Role_Organization"> |
| | | <if test="p.roleOrg != null and p.roleOrg.size>0"> |
| | | |
| | | <foreach item="item" collection="p.roleOrg" index=""> |
| | | <foreach item="itemto" collection="item" index="inx"> |
| | | |
| | | |
| | | <choose> |
| | | <when test="inx == 1"></when> |
| | | <when test="inx == 1"> |
| | | <if test="itemto.flag"> |
| | | |
| | | <when test="inx==2"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_org_code like '${itemtoto.orgCode}%' |
| | | </foreach> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 3"> |
| | | <when test="inx==2"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or ( |
| | | <foreach item="itemtoto" collection="itemto.object" separator="or" open="(" close=")" |
| | | index=""> |
| | | create_user_org_code = #{itemtoto.orgCode} |
| | | </foreach> |
| | | and is_del = 0 and enabled=1 |
| | | ) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 3"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | create_user_org_code = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code = #{itemto.object} and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 4"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_org_code like '${itemtoto.orgCode}%' |
| | | </foreach> |
| | | create_user_org_code like '${itemto.object}%' |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_org_code like '${itemto.object}%' and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <when test="inx == 5"> |
| | | <if test="itemto.flag"> |
| | | AND |
| | | <foreach item="itemtoto" collection="itemto" separator="or" open="(" close=")" index=""> |
| | | create_user_id = #{itemtoto.orgCode} |
| | | </foreach> |
| | | create_user_id = #{itemto.object} |
| | | </if> |
| | | <if test="!itemto.flag"> |
| | | or (create_user_id = #{itemto.object} and is_del = 0 and enabled=1) |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | AND id is null |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | </foreach> |
| | | </foreach> |
| | | </if> |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | 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.SysOrganization; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "检查科室名是否存在") |
| | | @GetMapping("/checkName") |
| | | public ResultBody checkDepName(@RequestParam Map<String, Object> params) { |
| | | params.put("page", 1); |
| | | params.put("limit", 1); |
| | | if (sysDepartmentService.findList(params).getData().size() > 0) { |
| | | return ResultBody.failed().msg(String.format("该医院下已经存在科室 %s", params.get("departmentName"))); |
| | | public ResultBody checkDepName(Long hospitalId,String departmentName) { |
| | | if (departMentNameIsUsed(hospitalId,departmentName)) { |
| | | return ResultBody.failed().msg(String.format("该医院下已经存在科室 %s", departmentName)); |
| | | } |
| | | return ResultBody.ok().msg(""); |
| | | } |
| | | |
| | | /** |
| | | * 检查科室名是否存在 |
| | | * @param hosId |
| | | * @param departmentName |
| | | * @return |
| | | */ |
| | | private Boolean departMentNameIsUsed(Long hosId,String departmentName) |
| | | { |
| | | String departName=sysDepartmentService.checkDepartmentName(hosId,departmentName); |
| | | return StringUtils.isNotBlank(departName); |
| | | } |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping |
| | | public ResultBody save(@Valid @RequestBody SysDepartment sysDepartment, BindingResult bindingResult) { |
| | | @PostMapping("/{hosId}") |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public ResultBody save(@Valid @RequestBody SysDepartment sysDepartment,@PathVariable Long hosId, BindingResult bindingResult,@LoginUser SysUser sysUser) { |
| | | List<String> errMsg = new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | |
| | | } else { |
| | | //先检查该医院该科室是否已经存在 |
| | | if (sysDepartment.getId() == null) { |
| | | Map<String, Object> checkDepartment = new HashMap<String, Object>(); |
| | | checkDepartment.put("page", 1); |
| | | checkDepartment.put("limit", 1); |
| | | checkDepartment.put("hospitalId", sysDepartment.getHospitalId()); |
| | | checkDepartment.put("departmentName", sysDepartment.getDepartmentName()); |
| | | if (sysDepartmentService.findList(checkDepartment).getData().size() > 0) { |
| | | |
| | | if (departMentNameIsUsed(hosId,sysDepartment.getDepartmentName())) { |
| | | return ResultBody.failed().msg(String.format("该医院下已经存在科室 %s", sysDepartment.getDepartmentName())); |
| | | } |
| | | } |
| | |
| | | sysOrganization.setOrgLevel(2); |
| | | //临时暂用其它字段承载数据 |
| | | sysOrganization.setOrgParentId(sysDepartment.getUpdateUserId()); |
| | | if(!sysUser.getOrganizations().isEmpty()){ |
| | | sysOrganization.setCreateUserOrgCode(sysUser.getOrganizations().get(1).getOrgCode()); |
| | | } |
| | | } else { |
| | | sysOrganization.setOrgName(sysDepartment.getDepartmentName()); |
| | | } |
| | | boolean org = sysOrganizationService.saveOrUpdate(sysOrganization); |
| | | boolean org = sysOrganizationService.saveOrUpdateSer(sysOrganization); |
| | | sysDepartment.setOrgId(sysOrganization.getId()); |
| | | boolean v = sysDepartmentService.saveOrUpdate(sysDepartment); |
| | | if (v) { |
| | |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping |
| | | public PageResult<SysDoctorVo> list(@RequestParam Map<String, Object> params,@LoginUser SysUser user) { |
| | | public PageResult<SysDoctorDto> list(@RequestParam Map<String, Object> params,@LoginUser SysUser user) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | |
| | | /** |
| | | * 设为管理 |
| | | */ |
| | | @ApiOperation(value = "修改状态") |
| | | @ApiOperation(value = "设为管理员") |
| | | @PostMapping("setadmin") |
| | | public ResultBody setAdmin(@RequestBody Map<String, Object> params) { |
| | | return sysDoctorService.setAdminDoctor(params); |
| | | } |
| | | |
| | | /** |
| | | * 统计医生的数量 |
| | | * @param datatype 业务类型 |
| | | * 0 自注册医生 |
| | | * 1 签约医生 |
| | | * 2 医答医生 |
| | | * 3 C端医生 |
| | | * 4 H端医生 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "统计医生的数量") |
| | | @GetMapping("chartDoctor") |
| | | public ResultBody chartDoctor(int datatype) { |
| | | int counts= sysDoctorService.chartDoctor(datatype); |
| | | return ResultBody.ok().data(counts).msg("数据获取成功"); |
| | | } |
| | | } |
| | |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.service.ISysDepartmentService; |
| | | import com.kidgrow.usercenter.service.ISysHospitalService; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.vo.HospitalListVo; |
| | |
| | | public class SysHospitalController extends BaseController { |
| | | @Autowired |
| | | private ISysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private ISysDepartmentService departmentService; |
| | | @Autowired |
| | | private ISysOrganizationService organizationService; |
| | | |
| | |
| | | SysHospital model = sysHospitalService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | */ |
| | |
| | | return ResultBody.ok().data(null).msg(""); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据SysHospital当做查询条件进行查询 |
| | | */ |
| | |
| | | SysHospital model = sysHospitalService.findByObject(sysHospital); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改医院logo |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping("/updateLogo") |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) |
| | | { |
| | | public ResultBody updateLogo(@RequestBody Map<String, Object> params) { |
| | | return sysHospitalService.updateLogo(params); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | |
| | | //先检查该医院是否存在组织信息 |
| | | SysOrganization sysOrganization=new SysOrganization(); |
| | | if(sysHospital.getOrgId()!=null){ |
| | | sysOrganization.setId(sysHospital.getOrgId());} |
| | | else{ |
| | | sysOrganization.setId(sysHospital.getOrgId()); |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | } |
| | | sysOrganization=organizationService.findByObject(sysOrganization); |
| | | if(sysOrganization==null) |
| | | { |
| | | if (sysOrganization == null) { |
| | | //创建一个组织 |
| | | sysOrganization=new SysOrganization(); |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | sysOrganization.setOrgAttr(1); |
| | | sysOrganization.setOrgLevel(1); |
| | | sysOrganization.setOrgParentId(DictionariesConstants.ORG_PARENT_ID); |
| | | if(!sysUser.getOrganizations().isEmpty()){ |
| | | sysOrganization.setCreateUserOrgCode(sysUser.getOrganizations().get(1).getOrgCode()); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | sysOrganization.setOrgName(sysHospital.getHospitalName()); |
| | | } |
| | | boolean org=organizationService.saveOrUpdate(sysOrganization); |
| | | boolean org = organizationService.saveOrUpdateSer(sysOrganization); |
| | | sysHospital.setOrgId(sysOrganization.getId()); |
| | | List<SysOrganization> organizations = sysUser.getOrganizations(); |
| | | if (organizations.size()>0) { |
| | | sysHospital.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | } |
| | | //运营平台添加的医院默认就是正式的 |
| | | if (sysHospital.getHospitalState()==null) { |
| | | sysHospital.setHospitalState(1); |
| | | } |
| | | boolean v = sysHospitalService.saveOrUpdate(sysHospital); |
| | | if (v) { |
| | |
| | | } |
| | | return sysHospitalService.updateEnabled(params); |
| | | } |
| | | |
| | | /** |
| | | * 统计医院数量 |
| | | * @param datatype 医院类型 |
| | | * 0 试用医院 |
| | | * 1 正式医院 |
| | | * 11 筛查医院 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "统计医院数量") |
| | | @GetMapping("/chartHospital") |
| | | public ResultBody chartHospital(int datatype) { |
| | | return sysHospitalService.chartHospital(datatype); |
| | | } |
| | | } |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | boolean v = sysOrganizationService.saveOrUpdate(sysOrganization); |
| | | boolean v = sysOrganizationService.saveOrUpdateSer(sysOrganization); |
| | | if (v) { |
| | | return ResultBody.ok().data(sysOrganization).msg("保存成功"); |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 返回给Python加密密码 |
| | | */ |
| | | @GetMapping(value = "/users/python") |
| | | public ResultBody jiaMipython(@RequestBody String password) { |
| | | if (password==null||"".equals(password)) { |
| | | return ResultBody.failed().msg("请输入密码"); |
| | | } |
| | | ResultBody resultBody = appUserService.jiaMipython(password); |
| | | return resultBody; |
| | | } |
| | | |
| | | /** |
| | | * 用户自己修改密码 |
| | | */ |
| | | @PutMapping(value = "/users/password") |
| | |
| | | package com.kidgrow.usercenter.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.model.SysUserOrg; |
| | | import com.kidgrow.usercenter.model.SysDepartment; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import com.kidgrow.usercenter.service.ISysOrganizationService; |
| | | import com.kidgrow.usercenter.service.ISysUserOrgService; |
| | | import com.kidgrow.usercenter.service.impl.SysDepartmentServiceImpl; |
| | | import com.kidgrow.usercenter.service.impl.SysHospitalServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ISysUserOrgService sysUserOrgService; |
| | | @Autowired |
| | | private ISysOrganizationService sysOrganizationService; |
| | | @Autowired |
| | | private SysDepartmentServiceImpl sysDepartmentService; |
| | | @Autowired |
| | | private SysHospitalServiceImpl sysHospitalService; |
| | | |
| | | @PostMapping("getListByMap") |
| | | public List<SysUserOrg> getListByMap(@RequestParam Map<String, Object> map) { |
| | |
| | | } else { |
| | | if (sysUserOrg.getUserId() != null) { |
| | | String createUserOrgCode = ""; |
| | | List<SysOrganization> userOrgData = sysUser.getOrganizations(); |
| | | List<SysOrganization> userOrgData = new ArrayList<>(); |
| | | SysOrganization byId = sysOrganizationService.getById(sysUserOrg.getOrgId()); |
| | | if(byId==null){ |
| | | return ResultBody.failed().data(null).msg("该组织id异常"); |
| | | } |
| | | SysOrganization parentId = sysOrganizationService.getById(byId.getOrgParentId()); |
| | | userOrgData.add(parentId); |
| | | userOrgData.add(byId); |
| | | if(parentId==null){ |
| | | return ResultBody.failed().data(null).msg("该组织id异常"); |
| | | } |
| | | if (userOrgData != null) { |
| | | if (userOrgData.size() == 2) { |
| | | createUserOrgCode = userOrgData.get(1).getOrgCode(); |
| | |
| | | for (int i = 0; i < userOrgList.size(); i++) { |
| | | if (sysUserOrg.getId().equals(userOrgList.get(i).getId())) { |
| | | userOrgList.get(i).setOrgId(sysUserOrg.getOrgId()); |
| | | userOrgList.get(i).setFromLevel(2); |
| | | |
| | | //查询 科室 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysDepartment> list = sysDepartmentService.list(queryWrapper); |
| | | if (!list.isEmpty()) { |
| | | userOrgList.get(i).setFromId(list.get(0).getId()); |
| | | } else { |
| | | userOrgList.get(i).setFromId(null); |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysHospital> listHospital = sysHospitalService.list(queryWrapper); |
| | | if (!listHospital.isEmpty()) { |
| | | userOrgList.get(i).setFromId(listHospital.get(0).getId()); |
| | | } |
| | | userOrgList.get(i).setFromLevel(1); |
| | | userOrgList.get(i).setOrgId(sysUserOrg.getUpdateUserId()); |
| | | } |
| | | userOrgList.get(i).setEnabled(sysUserOrg.getEnabled()); |
| | |
| | | sysUserOrgTemp.setUserId(sysUserOrg.getUserId()); |
| | | sysUserOrgTemp.setEnabled(sysUserOrg.getEnabled()); |
| | | sysUserOrgTemp.setCreateUserOrgCode(createUserOrgCode); |
| | | userOrgList.add(sysUserOrgTemp); |
| | | sysUserOrgTemp.setFromLevel(2); |
| | | |
| | | sysUserOrg.setUpdateUserId(0L); |
| | | //查询 科室 |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysDepartment> list = sysDepartmentService.list(queryWrapper); |
| | | if (!list.isEmpty()) { |
| | | sysUserOrgTemp.setFromId(list.get(0).getId()); |
| | | } |
| | | userOrgList.add(sysUserOrgTemp); |
| | | //查询 医院 |
| | | queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("org_id", sysUserOrg.getUpdateUserId()); |
| | | queryWrapper.eq("is_del", 0); |
| | | queryWrapper.eq("enabled", 1); |
| | | List<SysHospital> listHospital = sysHospitalService.list(queryWrapper); |
| | | if (!listHospital.isEmpty()) { |
| | | sysUserOrgTemp.setFromId(listHospital.get(0).getId()); |
| | | } |
| | | sysUserOrgTemp.setFromLevel(1); |
| | | // sysUserOrg.setUpdateUserId(0L); |
| | | sysUserOrg.setOrgId(sysOrganization.getOrgParentId()); |
| | | sysUserOrg.setCreateUserOrgCode(createUserOrgCode); |
| | | userOrgList.add(sysUserOrg); |
| | | } else { |
| | | return ResultBody.failed().data(null).msg("该组织的上级组织数据异常!"); |
| | | } |
| | | } |
| | | //查询 |
| | | boolean v = sysUserOrgService.saveOrUpdateBatch(userOrgList); |
| | | if (v) { |
| | | return ResultBody.ok().data(sysUserOrg).msg("保存成功"); |
| | |
| | | /** |
| | | * 默认超级管理员账号 |
| | | */ |
| | | public final static String ROOT = "admin"; |
| | | public final static String ROOT = "admin-xg"; |
| | | |
| | | /** |
| | | * 负载均衡策略-版本号 信息头 |
| | |
| | | /** |
| | | * 生成缩略图需要的图片暂存目录 |
| | | */ |
| | | // public static final String TEMP_IMAGE_PATH="D:/resources/images/"; |
| | | public static final String TEMP_IMAGE_PATH="/root/data"; |
| | | public static final String TEMP_IMAGE_PATH="D:/resources/images/"; |
| | | // public static final String TEMP_IMAGE_PATH="/root/kidgrow"; |
| | | /** |
| | | * 普通医生角色ID |
| | | */ |
| | | public static final Long HOSPITAL_DOCTOR_ID=1268826800663289858L; |
| | | /** |
| | | * 普通医生角色code标识 |
| | | * 普通医生角色code标识` |
| | | */ |
| | | public static final String HOSPITAL_DOCTOR_CODE="hospital_doctor"; |
| | | |
| | | /** |
| | | * 管理员医生角色ID |
| | | */ |
| | | public static final Long HOSPITAL_ADMIN_ID=9L; |
| | | public static final Long HOSPITAL_ADMIN_ID=1238826800663299909L; |
| | | /** |
| | | * 管理员医生角色code标识 |
| | | */ |
| | |
| | | /** |
| | | * 自主注册医院的组织id |
| | | */ |
| | | public static final Long HOSPITAL_ORG_ID=1273809987709677569L; |
| | | public static final Long HOSPITAL_ORG_ID=15321234570L; |
| | | |
| | | /** |
| | | * 自主注册的科室组织id |
| | | */ |
| | | public static final Long DEPARTMENT_ORG_ID=1273810374550335490L; |
| | | public static final Long DEPARTMENT_ORG_ID=15321234571L; |
| | | |
| | | /** |
| | | * 自主注册的创建人id |
| | |
| | | */ |
| | | public static final String CREATE_USER_NAME= "自动创建"; |
| | | /** |
| | | * 管理员医生角色code标识 |
| | | * 管理员角色code标识 |
| | | */ |
| | | public static final String SYSTEM_ADMIN_ROLE_CODE="ADMIN"; |
| | | public static final String SYSTEM_ADMIN_ROLE_CODE="admin"; |
| | | |
| | | /** |
| | | * 销售主管角色code标识 |
| | | */ |
| | | public static final String SALE_MANAGER_ROLE_CODE="salemanager"; |
| | | |
| | | /** |
| | | * 喜高PC高管角色code标识 |
| | | */ |
| | | public static final String PC_ADMIN_ROLE_CODE="pc_admin"; |
| | | /** |
| | | * 喜高运营高管角色code标识 |
| | | */ |
| | | public static final String OPRATIONMANAGER_ROLE_CODE="oprationmanager"; |
| | | |
| | | /** |
| | | * 集团组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_TOP_CODE=0; |
| | | /** |
| | | * 公司/医院组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_HOS_LEVEL=1; |
| | | /** |
| | | * 科室部门组织级别 |
| | | */ |
| | | public static final Integer SYSTEM_ORG_DEP_LEVEL=2; |
| | | /** |
| | | * 医生类型 C+H |
| | | */ |
| | | public static final Integer CH_DOCTOR_TYPE=0; |
| | | /** |
| | | * 医生类型 H |
| | | */ |
| | | public static final Integer H_DOCTOR_TYPE=1; |
| | | /** |
| | | * 医生类型 C |
| | | */ |
| | | public static final Integer C_DOCTOR_TYPE=2; |
| | | /** |
| | | * 一个科室能最大试用多少次 |
| | | */ |
| | | public static final Integer MAX_FREE_COUNT=0; |
| | | } |
| | |
| | | */ |
| | | String DOCTOR_RANK = "DOCTOR_RANK"; |
| | | /** |
| | | * 医生职称分类id |
| | | */ |
| | | Long DOCTOR_RANK_ID=1248150699682988034L; |
| | | /** |
| | | * 最高组织ID |
| | | */ |
| | | Long ORG_PARENT_ID=1L; |
| | | Long ORG_PARENT_ID=15321234561L; |
| | | } |
| | |
| | | */ |
| | | private Boolean isDel; |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | private String createUserOrgCode; |
| | | /** |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | |
| | | package com.kidgrow.common.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | 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; |
| | |
| | | @NotNull(message = "组织ID不能为空") |
| | | private Long orgId; |
| | | /** |
| | | * 医院/科室表里面的id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @NotNull(message = "医院/科室表里面的id") |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private Long fromId; |
| | | /** |
| | | * 组织级别 0集团 1医院公司 2科室部门 |
| | | */ |
| | | private Integer fromLevel; |
| | | /** |
| | | * 数据权限code |
| | | */ |
| | | private String createUserOrgCode; |
| | |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM_SCREEN); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM); |
| | | requestHeaders.add(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | requestHeaders.add(SecurityConstants.USER_REAL_NAME); |
| | | } |
| | | |
| | | /** |
| | |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM_SCREEN); |
| | | requestHeaders.add(CommonConstant.USER_AGENT_SYSTEM); |
| | | requestHeaders.add(SecurityConstants.USER_HOSPITAL_ID_HEADER); |
| | | requestHeaders.add(SecurityConstants.USER_REAL_NAME); |
| | | } |
| | | |
| | | /** |
| | |
| | | kidgrow.audit-log.datasource.username=${kidgrow.datasource.username} |
| | | kidgrow.audit-log.datasource.password=${kidgrow.datasource.password} |
| | | |
| | | ## appUrl \u79FB\u52A8\u7AEFURL\u5730\u5740\u05B7 |
| | | ## appUrl \u9759\u6001\u6587\u4EF6\u4E0A\u4F20\u8DEF\u5F84 |
| | | appUrl=http://192.168.2.240/upload/ |
| | |
| | | if (sysUserOrgs == null || sysUserOrgs.isEmpty()) { |
| | | ctx.setSendZuulResponse(false); |
| | | ctx.setResponseBody(JSON.toJSONString(ResultBody.fail(1000, "您的组织已经被禁用,请联系管理员"))); |
| | | } else { |
| | | List<Long> collect = sysUserOrgs.stream().map(e -> e.getOrgId()).collect(Collectors.toList()); |
| | | List<SysOrganization> sysOrganizations = getSysOrganization(); |
| | | List<Long> orgIds = sysOrganizations.stream().filter(e -> e.getEnabled() == true && collect.contains(e.getId())).map(e -> e.getId()).collect(Collectors.toList()); |
| | | if (orgIds == null || orgIds.size() <= 0) { |
| | | ctx.setSendZuulResponse(false); |
| | | ctx.setResponseBody(JSON.toJSONString(ResultBody.fail(1000, "您的组织已经被禁用,请联系管理员"))); |
| | | } |
| | | } |
| | | // else { |
| | | // List<Long> collect = sysUserOrgs.stream().map(e -> e.getOrgId()).collect(Collectors.toList()); |
| | | // List<SysOrganization> sysOrganizations = getSysOrganization(); |
| | | // List<Long> orgIds = sysOrganizations.stream().filter(e -> e.getEnabled() == true && collect.contains(e.getId())).map(e -> e.getId()).collect(Collectors.toList()); |
| | | // if (orgIds == null || orgIds.size() <= 0) { |
| | | // ctx.setSendZuulResponse(false); |
| | | // ctx.setResponseBody(JSON.toJSONString(ResultBody.fail(1000, "您的组织已经被禁用,请联系管理员"))); |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | |
| | | doctorId=sysDoctors.get(0).getId(); |
| | | departmentId=sysDoctors.get(0).getDepartmentId(); |
| | | departmentName=sysDoctors.get(0).getDepartmentName(); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_ORG_NAME_HEADER, URLEncoder.encode(sysDoctors.get(0).getHospitalName(),"UTF-8")); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_DEP_ID_HEADER,String.valueOf(departmentId)); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_DEP_NAME_HEADER,URLEncoder.encode(departmentName,"UTF-8")); |
| | | } |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_ID_HEADER, String.valueOf(user.getId())); |
| | | ctx.addZuulRequestHeader(SecurityConstants.DOCTOR_ID_HEADER, String.valueOf(doctorId)); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_HEADER, user.getUsername()); |
| | | |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_REAL_NAME,URLEncoder.encode(str,"UTF-8"));//待完善 |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_REAL_NAME,URLEncoder.encode(str,"UTF-8")); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_HOSPITAL_ID_HEADER,hospital.toString()); |
| | | tenantId=hospital.toString(); |
| | | List<SysOrganization> organizations = (List<SysOrganization>) user.getOrganizations(); |
| | |
| | | organizations.sort((e1,e2)->e1.getOrgLevel().compareTo(e2.getOrgLevel())); |
| | | if (organizations != null&&organizations.size()>0) { |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_ORG_ID_HEADER,String.valueOf(organizations.get(0).getId())); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_ORG_NAME_HEADER, URLEncoder.encode(organizations.get(0).getOrgName(),"UTF-8")); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_DEP_ID_HEADER,String.valueOf(departmentId)); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_DEP_NAME_HEADER,(departmentName.equals("")?URLEncoder.encode(organizations.get(organizations.size()-1).getOrgName(),"UTF-8"):departmentName)); |
| | | ctx.addZuulRequestHeader(SecurityConstants.USER_ORGS_HEADER,JSON.toJSONString(organizations)); |
| | | } |
| | | //将角色放到header |
| | |
| | | - /api-evaluation/evaluationxrayinfo/appUpload |
| | | - /api-evaluation/evaluationxrayinfo/appSave |
| | | - /api-file/baseUplaod |
| | | - /api-user/users/python |
| | | # - /api-user/syshospital/findAllByMap |
| | | # - /api-user/sysdictionaries/findAll |
| | | # - /api-user/sysdepartment/findListByHospitalId |
| | |
| | | /api-user/users/passwordByPhone, |
| | | /api-evaluation/evaluationxrayinfo/appUpload, |
| | | /api-evaluation/evaluationxrayinfo/appSave, |
| | | /api-file/baseUplaod |
| | | /api-file/baseUplaod, |
| | | /api-user/users/python |
| | | # /api-user/syshospital/findAllByMap, |
| | | # /api-user/sysdictionaries/findAll, |
| | | # /api-user/sysdepartment/findListByHospitalId |
| | |
| | | security: |
| | | code: |
| | | # 忽略验证码的应用编号 |
| | | ignoreClientCode: app,hospital,webApp |
| | | ignoreClientCode: app,hospital,webApp,readxapp |
| | | |
| | | encrypt: |
| | | key-store: |
| | |
| | | // debugger; |
| | | if (data.code === 0) { |
| | | config.putToken(data.data); |
| | | layer.msg('登录成功', {icon: 1, time: 500}, function () { |
| | | layer.msg('登录成功', {icon: 1, time: 2000}, function () { |
| | | location.replace('./'); |
| | | }); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 5, time: 500}); |
| | | layer.msg(data.msg, {icon: 5, time: 2000}); |
| | | } |
| | | }, |
| | | error: function (xhr) { |
| | | //console.log(xhr) |
| | | layer.closeAll('loading'); |
| | | layer.msg(xhr.responseJSON.msg, {icon: 5, time: 500}); |
| | | layer.msg(xhr.responseJSON.msg, {icon: 5, time: 2000}); |
| | | } |
| | | }); |
| | | //阻止表单跳转 |
| | |
| | | layer.load(2); |
| | | admin.req('api-uaa/clients/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg('成功', {icon: 1, time: 500}); |
| | | layer.msg('成功', {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | layer.closeAll('loading'); |
| | | console.log(data); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | table.reload('app-table'); |
| | | layer.closeAll('page'); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#app-form').attr('method')); |
| | | return false; |
| | |
| | | admin.req('api-file/files/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.resp_code == 0) { |
| | | layer.msg(data.resp_msg, {icon: 1, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.resp_msg, {icon: 2, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-search/admin/index?indexName='+obj.data.indexName, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.resp_code == 0) { |
| | | layer.msg(data.resp_msg, {icon: 1, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.resp_msg, {icon: 2, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-search/admin/index', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.resp_code == 0) { |
| | | layer.msg(data.resp_msg, {icon: 1, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.msg(data.resp_msg, {icon: 2, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | if (0 == data.resp_code) { |
| | | $('#data').html(syntaxHighlight(data.datas)); |
| | | } else { |
| | | layer.msg('获取索引信息失败', {icon: 2, time: 500}); |
| | | layer.msg('获取索引信息失败', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | admin.req('api-user/menus/'+obj.data.id+'?tenantId='+tenantId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | renderTable({tenantId: tenantId}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | } |
| | | }); |
| | | if (keyword !== '' && searchCount === 0) { |
| | | layer.msg("没有匹配结果", {icon: 5, time: 500}); |
| | | layer.msg("没有匹配结果", {icon: 5, time: 2000}); |
| | | } else { |
| | | treetable.expandAll('#menus-table'); |
| | | } |
| | |
| | | } |
| | | form.render(); //菜单渲染 把内容加载进去 |
| | | } else { |
| | | layer.msg('获取一级菜单', {icon: 2, time: 500}); |
| | | layer.msg('获取一级菜单', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | admin.req('api-user/menus/saveOrUpdate?tenantId='+menus.tenantId, JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#menus-form').attr('method')); |
| | | return false; |
| | |
| | | if (data.code == 0) { |
| | | layer.closeAll('loading'); |
| | | $(".layui-nav-img").attr("src",$("[name=headImgUrl]").val()); |
| | | layer.msg("操作成功", {icon: 1, time: 500}); |
| | | layer.msg("操作成功", {icon: 1, time: 2000}); |
| | | |
| | | form.val('user-form',data.data); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'POST'); |
| | | return false; |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | layer.closeAll('loading'); |
| | | console.log(data); |
| | | if (data.code === 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | table.reload('role-table'); |
| | | layer.closeAll('page'); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#role-form').attr('method')); |
| | | return false; |
| | |
| | | admin.req('api-user/roles/' + obj.data.id+'?tenantId='+tenantId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-user/menus/granted?tenantId='+tenantId, JSON.stringify(data) , function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | layer.close(index); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'POST'); |
| | | } |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | layer.load(2); |
| | | admin.req('api-uaa/oauth/remove/token?token=' + obj.data.tokenValue, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg('成功', {icon: 1, time: 500}); |
| | | layer.msg('成功', {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-user/users/'+obj.data.id+'/password', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.ode == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'PUT'); |
| | | }); |
| | |
| | | admin.req('api-user/users/'+obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | table.reload('user-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | //table.reload('table-user', {}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | ,headers: {"Authorization" : "Bearer " + config.getToken().access_token} |
| | | ,done: function(data){ |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | table.reload('user-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | } |
| | | }); |
| | |
| | | formSelects.value('roleId', rds); |
| | | } |
| | | } else { |
| | | layer.msg('获取角色失败', {icon: 2, time: 500}); |
| | | layer.msg('获取角色失败', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | admin.req('api-user/users/saveOrUpdate', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | var center = this._center; |
| | | this._clusterMarker.addEventListener("click", function(event){ |
| | | //这个方法容易造成晃动 |
| | | //thatMap.setViewport(thatBounds); |
| | | //console.log(center); |
| | | var zoom = thatMap.getZoom(); |
| | | zoom = zoom > 14 ? zoom : 14; |
| | | thatMap.setZoom(zoom); |
| | |
| | | return this |
| | | }, |
| | | V: function () { |
| | | console.log('q.js <https://github.com/itorr/q.js> 2014/12/28'); |
| | | return this |
| | | }, |
| | | go: function (u) { |
| | |
| | | success: function (data) { |
| | | if (data.code === 0) { |
| | | config.putToken(data.data); |
| | | layer.msg('登录成功', {icon: 1, time: 500}, function () { |
| | | layer.msg('登录成功', {icon: 1, time: 2000}, function () { |
| | | location.replace('./'); |
| | | }); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 5, time: 500}); |
| | | layer.msg(data.msg, {icon: 5, time: 2000}); |
| | | } |
| | | }, |
| | | error: function (xhr) { |
| | | //console.log(xhr) |
| | | layer.closeAll('loading'); |
| | | layer.msg(xhr.responseJSON.msg, {icon: 5, time: 500}); |
| | | layer.msg(xhr.responseJSON.msg, {icon: 5, time: 2000}); |
| | | } |
| | | }); |
| | | //阻止表单跳转 |
| | |
| | | }; |
| | | //发送同步ajax请求 |
| | | param.async = false; |
| | | //console.log(param); |
| | | $.ajax(param); |
| | | }, |
| | | // 判断是否有权限 |
| | |
| | | // var my_api_server_url = 'http://zuul.kidgrow.com/'; |
| | | // var my_api_server_url = 'http://192.168.2.240:8888/'; |
| | | // var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | var my_api_server_url = 'http://127.0.0.1:8888/'; |
| | | // var my_api_server_url = 'http://uat-zuul.kidgrow.cloud/'; |
| | | var my_api_server_url = 'http://123.57.164.62:8888/'; |
| | | //var my_api_server_url = 'http://123.57.164.62:8888/'; |
| | | |
| | |
| | | clientsAll = data.data; |
| | | if (clientsAll.length > 0) { |
| | | area.areasClear(domId,levelType); |
| | | if(clientsAll[0].areaLeveltype==2) |
| | | if(clientsAll[0].areaLeveltype==3) |
| | | { |
| | | admin.putTempData("t_city",clientsAll); |
| | | admin.putTempData("t_area",clientsAll); |
| | | } |
| | | $.each(clientsAll, function (index, item) { |
| | | if (selectValue == item.areaName) { selected = "selected='selected'"; } |
| | |
| | | * 用于动态切换环境地址 |
| | | */ |
| | | //默认地址 |
| | | var defUrl = 'http://182.92.99.224:8887/'; |
| | | var defUrl = 'http://127.0.0.1:8888/'; |
| | | //var defUrl = 'http://182.92.99.224:8887/'; |
| | | //当前环境的api地址 |
| | | var apiUrl; |
| | | try{ |
| | |
| | | // 当前登录的用户 |
| | | getUser: function () { |
| | | var u = layui.data(config.tableName).login_user; |
| | | // debugger; |
| | | if (u) { |
| | | return JSON.parse(u); |
| | | } |
| | |
| | | // 渲染左侧菜单栏 |
| | | initLeftNav: function () { |
| | | admin.req('api-user/menus/current', {}, function (data) { |
| | | //data = data[1]; |
| | | // console.log(data); |
| | | // debugger; |
| | | admin.putTempData("menus", data.data); |
| | | var menus = data.data; |
| | | // 判断权限 |
| | |
| | | layer.load(2); |
| | | admin.req('api-user/users/current', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | // debugger; |
| | | // console.log(data); |
| | | if (data && data.code === 0) { |
| | | let user = data.data; |
| | | // debugger; |
| | | config.putUser(user); |
| | | admin.putTempData("permissions", user.permissions); |
| | | admin.putTempData("organization",user.organizations[user.organizations.length-1]); |
| | |
| | | location.replace('login.html'); |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | }, 'GET'); |
| | | }, |
| | |
| | | mData[len - 1].isParent = true; |
| | | } |
| | | mData.push(data[i]); |
| | | sort(data[i].id, data); |
| | | sort(""+data[i].id, data); |
| | | } |
| | | } |
| | | }; |
| | | sort(param.treeSpid, tNodes); |
| | | sort(""+param.treeSpid, tNodes); |
| | | |
| | | // 重写参数 |
| | | param.url = undefined; |
| | |
| | | layer.load(2); |
| | | admin.req('api-uaa/clients/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg('成功', {icon: 1, time: 500}); |
| | | layer.msg('成功', {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | layer.load(2); |
| | | admin.req('api-uaa/clients/saveOrUpdate', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | console.log(data); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | table.reload('app-table'); |
| | | layer.closeAll('page'); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#app-form').attr('method')); |
| | | return false; |
| | |
| | | .layui-card-header { |
| | | text-align:left; |
| | | } |
| | | |
| | | .layuiadmin-badge { |
| | | float:right; |
| | | margin-top:12px; |
| | | } |
| | | |
| | | .big-font { |
| | | text-align:left; |
| | | font-size: 250%; |
| | |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | |
| | | <div class="layui-card-body" style="text-align: center;"> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">在线人数 |
| | | <span class="layui-badge layui-bg-cyan layuiadmin-badge">时</span> |
| | | <div class="layui-card-header">正式医院 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="userCnt"></p> |
| | | <a href="/#!syshospital"> |
| | | <p class="big-font" id="h_hospital">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">PV |
| | | <span class="layui-badge layui-bg-green layuiadmin-badge">天</span> |
| | | <div class="layui-card-header">产品/套餐总量 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="pv"></p> |
| | | <a href="/#!product"> |
| | | <p class="big-font" id="u_product">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">UV |
| | | <span class="layui-badge layui-bg-green layuiadmin-badge">天</span> |
| | | <div class="layui-card-header">待审核试用套餐 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="uv"></p> |
| | | <a href="/#!verifyRecharge"> |
| | | <p class="big-font" id="t_product">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">周访问量 |
| | | <span class="layui-badge layui-bg-blue layuiadmin-badge">周</span> |
| | | <div class="layui-card-header">用户反馈 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="weekPv"></p> |
| | | <a href="/#!feedback"> |
| | | <p class="big-font" id="u_feedback">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">月访问量 |
| | | <span class="layui-badge layui-bg-orange layuiadmin-badge">月</span> |
| | | <div class="layui-card-header">数据需求 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <p class="big-font" id="monthPv"></p> |
| | | <a href="/#!dataneed"> |
| | | <p class="big-font" id="d_dataneed">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">H端医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="h_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">C端医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="c_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">待审核医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="ht_doctor">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">签约医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="u_signing">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">医答医生 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!doctor"> |
| | | <p class="big-font" id="d_isanswer">无权查看</p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-lg12 layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="week-container" style="height:350px"></div> |
| | | <div id="contract" style="height:350px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="layui-row layui-col-space10"> |
| | | <div class="layui-col-lg6 layui-col-md6"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="browser-container" style="height:300px"></div> |
| | | <div id="products" style="height:300px"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6 layui-col-lg6"> |
| | | <div class="layui-card"> |
| | | <div class="card-block"> |
| | | <div id="operatingSystem-container" style="height:300px"></div> |
| | | <div id="contract" style="height:300px"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <script type="text/javascript"> |
| | | layui.use(['admin'], function () { |
| | | layui.use(['util', 'admin', 'config'], function () { |
| | | let admin = layui.admin; |
| | | |
| | | let browserChart = echarts.init(document.getElementById("browser-container")); |
| | | browserChart.setOption({ |
| | | let config = layui.config; |
| | | let util = layui.util; |
| | | let $ = layui.jquery; |
| | | var counts = 0; |
| | | // 加载医院统计数据 |
| | | var loadHospitalChart = function (datatype) { |
| | | admin.req("api-user/syshospital/chartHospital?datatype=" + datatype, {}, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载医生统计数据 |
| | | var loadDoctorChart = function (datatype) { |
| | | admin.req("api-user/sysdoctor/chartDoctor?datatype=" + datatype, {}, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载反馈需求审核统计数据 |
| | | var loadOprationChart = function (datatype) { |
| | | admin.req("api-opration/productorderdetail/oprationChart?datatype=" + datatype, {}, |
| | | function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载合同统计数据 |
| | | var loadProductOrderChart = function (params) { |
| | | admin.req("api-opration/productorderdetail/productOrderChart", params, function (data) { |
| | | if (0 === data.code) { |
| | | counts = data.data; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载套餐使用量统计数据 |
| | | var loadProCountChart = function () { |
| | | admin.req("api-opration/productorderdetail/proCountChart", {}, function (data) { |
| | | if (0 === data.code) { |
| | | return data.data; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, "get"); |
| | | } |
| | | //加载套餐使用图表 |
| | | var loadContractChart = function () { |
| | | var chartcontract = echarts.init(document.getElementById('contract')); |
| | | admin.req("api-opration/productorderdetail/proCountChart", {}, function (data) { |
| | | if (0 === data.code) { |
| | | var listData = data.data; |
| | | var Xdata = new Array(); |
| | | var Ydata = new Array(); |
| | | if (listData != null) { |
| | | for (let index = 0; index < listData.length; index++) { |
| | | Xdata.push(listData[index].units); |
| | | Ydata.push(listData[index].ccount); |
| | | } |
| | | var optionchart = { |
| | | title : { |
| | | text: '浏览器分布', |
| | | subtext: '', |
| | | x:'center' |
| | | text: '套餐使用数量统计(前10个)' |
| | | }, |
| | | tooltip : { |
| | | trigger: 'item', |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)" |
| | | }, |
| | | legend: {}, |
| | | series : [] |
| | | }); |
| | | browserChart.showLoading(); |
| | | |
| | | let osChart = echarts.init(document.getElementById("operatingSystem-container")); |
| | | osChart.setOption({ |
| | | title : { |
| | | text: '系统分布', |
| | | subtext: '', |
| | | x:'center' |
| | | }, |
| | | tooltip : { |
| | | trigger: 'item', |
| | | formatter: "{a} <br/>{b} : {c} ({d}%)" |
| | | }, |
| | | legend: {}, |
| | | series : [] |
| | | }); |
| | | osChart.showLoading(); |
| | | |
| | | let weekChart = echarts.init(document.getElementById("week-container")); |
| | | weekChart.setOption({ |
| | | title: { |
| | | text: '流量趋势' |
| | | }, |
| | | color: ['#3398DB'], |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross', |
| | | label: { |
| | | backgroundColor: '#6a7985' |
| | | } |
| | | axisPointer: { // 坐标轴指示器,坐标轴触发有效 |
| | | type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['访问量(PV)', '独立用户(UV)'] |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: [] |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | data: Xdata |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | } |
| | | ], |
| | | series: [] |
| | | }); |
| | | weekChart.showLoading(); |
| | | |
| | | admin.req('api-log/requestStat', {}, function (data) { |
| | | $('#pv').html(data.currDate_pv); |
| | | $('#uv').html(data.currDate_uv); |
| | | $('#weekPv').html(data.currWeek_pv); |
| | | $('#monthPv').html(data.currMonth_pv); |
| | | $('#userCnt').html(data.currHour_uv); |
| | | |
| | | browserChart.hideLoading() |
| | | browserChart.setOption({ |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | data: data.browser_legendData |
| | | }, |
| | | series : [ |
| | | { |
| | | name: '浏览器', |
| | | type: 'pie', |
| | | radius : '55%', |
| | | center: ['50%', '60%'], |
| | | data: data.browser_datas, |
| | | itemStyle: { |
| | | emphasis: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | series: [{ |
| | | name: '使用数量', |
| | | data: Ydata, |
| | | type: 'bar', |
| | | barWidth: '10%', |
| | | showBackground: true |
| | | }] |
| | | }; |
| | | chartcontract.setOption(optionchart, true); |
| | | } |
| | | } |
| | | }, "get"); |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | osChart.hideLoading() |
| | | osChart.setOption({ |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: 'left', |
| | | data: data.operatingSystem_legendData |
| | | //加载合同图表 |
| | | var loadProductChart = function () { |
| | | var chartproducts = echarts.init(document.getElementById('products')); |
| | | admin.req("api-opration/productorderdetail/productOrderChart", { |
| | | datatype: 1, |
| | | startTime: "", |
| | | endTime: "" |
| | | }, function (data) { |
| | | if (0 === data.code) { |
| | | var listData = data.data; |
| | | var Xdata = new Array(); |
| | | var Ydata = new Array(); |
| | | if (listData != null) { |
| | | for (let index = 0; index < listData.length; index++) { |
| | | Xdata.push(listData[index].units); |
| | | Ydata.push(listData[index].ccount); |
| | | } |
| | | var optionchart = { |
| | | title: { |
| | | text: '合同签订统计' |
| | | }, |
| | | series : [ |
| | | { |
| | | name: '操作系统', |
| | | type: 'pie', |
| | | radius : '55%', |
| | | center: ['50%', '60%'], |
| | | data: data.operatingSystem_datas, |
| | | itemStyle: { |
| | | emphasis: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | color: ['#3398DB'], |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { // 坐标轴指示器,坐标轴触发有效 |
| | | type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | weekChart.hideLoading() |
| | | weekChart.setOption({ |
| | | xAxis: [ |
| | | { |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: data.statWeek_items |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: '访问量(PV)', |
| | | type: 'line', |
| | | areaStyle: {}, |
| | | label: { |
| | | normal: { |
| | | show: true, |
| | | position: 'top' |
| | | } |
| | | data: Xdata |
| | | }, |
| | | data: data.statWeek_pv |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | { |
| | | name: '独立用户(UV)', |
| | | type: 'line', |
| | | areaStyle: {}, |
| | | data: data.statWeek_uv |
| | | series: [{ |
| | | name: '合同数量', |
| | | data: Ydata, |
| | | type: 'bar', |
| | | barWidth: '10%', |
| | | showBackground: true |
| | | }] |
| | | }; |
| | | chartproducts.setOption(optionchart, true); |
| | | } |
| | | ] |
| | | }); |
| | | }, 'GET'); |
| | | } |
| | | }, "get"); |
| | | } |
| | | |
| | | //先拿到当前登录用户的信息 |
| | | var nowUser = config.getUser(); |
| | | if (!strUtil.isEmpty(nowUser)) { |
| | | var userRole = nowUser.roles; |
| | | for (let index = 0; index < userRole.length; index++) { |
| | | const element = userRole[index]; |
| | | if (element.code == "admin" || |
| | | element.code == "dev_admin" || |
| | | element.code == "pc_admin" || |
| | | element.code == "oprationmanager" || |
| | | element.code == "dev_user" || |
| | | element.code == "shop_admin" || |
| | | element.code == "app_admin") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //产品/套餐总量 |
| | | loadOprationChart(1); |
| | | $("#u_product").html(counts); |
| | | //待审核试用套餐 |
| | | loadOprationChart(0); |
| | | $("#t_product").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | $("#d_isanswer").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | loadContractChart(); |
| | | loadProductChart(); |
| | | } else if (element.code == "opration") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | $("#d_isanswer").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | loadProductChart(); |
| | | } else if (element.code == "sale") { |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //正式医院 |
| | | loadHospitalChart(0); |
| | | $("#h_hospital").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
| | | //数据需求 |
| | | loadOprationChart(2); |
| | | $("#d_dataneed").html(counts); |
| | | //H端医生 |
| | | loadDoctorChart(4); |
| | | $("#h_doctor").html(counts); |
| | | //C端医生 |
| | | loadDoctorChart(3); |
| | | $("#c_doctor").html(counts); |
| | | //待审核医生 |
| | | loadDoctorChart(5); |
| | | $("#ht_doctor").html(counts); |
| | | //签约医生 |
| | | loadDoctorChart(1); |
| | | $("#u_signing").html(counts); |
| | | //医答医生 |
| | | loadDoctorChart(2); |
| | | loadContractChart(); |
| | | loadProductChart(); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | admin.req('api-file/files/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.resp_code == 0) { |
| | | layer.msg(data.resp_msg, {icon: 1, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.resp_msg, {icon: 2, time: 500}); |
| | | layer.msg(data.resp_msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | <!-- <li class="layui-nav-item" lay-unselect> |
| | | <a id="btnMessage" title="消息"><i class="layui-icon layui-icon-notice"></i></a> |
| | | </li> --> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a title="消息"><i class="layui-icon layui-icon-notice" id="organization">1231</i></a> |
| | | </li> |
| | | <li class="layui-nav-item layui-hide-xs" lay-unselect> |
| | | <a ew-event="fullScreen" title="全屏"><i class="layui-icon layui-icon-screen-full"></i></a> |
| | | </li> |
| | | <li class="layui-nav-item" lay-unselect> |
| | | <a> |
| | | <!--<img src="assets/images/head.png" class="layui-nav-img">--> |
| | | <img p-bind="src:{{headImgUrl}}" class="layui-nav-img"> |
| | | <!--add by owen 修复页面显示问题 --> |
| | | <!--<cite>{{username}}</cite>--> |
| | | <cite>{{nickname}}</cite> |
| | | <cite> |
| | | {{organizations[1].orgName}} |
| | | </cite> |
| | | <cite> |
| | | {{username}} |
| | | </cite> |
| | | </a> |
| | | <dl class="layui-nav-child"> |
| | | <dd lay-unselect> |
| | |
| | | </dd> |
| | | </dl> |
| | | </li> |
| | | <!-- <li class="layui-nav-item" lay-unselect>--> |
| | | <!-- <a ew-event="theme" title="主题"><i class="layui-icon layui-icon-more-vertical"></i></a>--> |
| | | <!-- </li>--> |
| | | </ul> |
| | | <script> |
| | | layui.use([ 'admin'], function () { |
| | | var admin = layui.admin |
| | | , $ = layui.jquery; |
| | | var organization=admin.getTempData("organization"); |
| | | $("#organization").html("wer"); |
| | | console.log($("#organization").html()) |
| | | }) |
| | | |
| | | </script> |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="请输入标题" />  |
| | | <input type="text" class="layui-input search-input" id="test1"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2">   |
| | | <select id="role_clients" placeholder="选择一个应用" lay-filter="role_clients"> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按内容模糊查找" />  |
| | | <input type="text" class="layui-input search-input" id="test1" placeholder="开始时间"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2" placeholder="结束时间">   |
| | | <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | | <table class="layui-table" id="app-table" lay-filter="app-table"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="businessRecords-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="app-model"> |
| | | <form id="app-form" lay-filter="app-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">记录标题</label> |
| | | <div class="layui-input-block"> |
| | | <input name="recordTitle" disabled="true" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">操作人姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="userName" disabled="true" placeholder="请输入应用名称" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">应用名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="appName" disabled="true" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">ip</label> |
| | | <div class="layui-input-block"> |
| | | <input name="recordIp" disabled="true" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">业务操作记录</label> |
| | | <div class="layui-input-block"> |
| | | <input name="recordDetail" disabled="true" type="text" class="layui-input" maxlength="20"/> |
| | | </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> |
| | | |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin'], function () { |
| | |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | |
| | | // 获取应用列表 |
| | | // layer.load(2); |
| | | admin.req('api-user/users/findAll', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | | clientsAll = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#role_clients').append(new Option(item.username, item.id, false, selected)); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'Post'); |
| | | |
| | | //时间格式 |
| | | var laydate = layui.laydate; |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | cols: [[ |
| | | { type: 'numbers' }, |
| | | { field: 'userName', width: 180, sort: true, title: '用户' }, |
| | | { field: 'appName', width: 200, sort: true, title: '应用名' }, |
| | | { field: 'recordIp', width: 180, sort: true, title: 'IP' }, |
| | | { field: 'recordTitle', width: 300, sort: true, title: '标题' }, |
| | | { field: 'id', width: 250, align: 'center', toolbar: '#businessRecords-table-bar', sort: true, title: '查看详情' },// 0就诊数据 1筛查 |
| | | { field: 'createTime', width: 250, sort: true, title: '时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" } |
| | | { field: 'userName', width: 180, title: '用户' }, |
| | | { field: 'appName', width: 200, title: '应用名' }, |
| | | { field: 'recordIp', width: 180,title: 'IP' }, |
| | | { field: 'recordTitle', width: 300,title: '日志内容' }, |
| | | { field: 'createTime', width: 250, sort: true, title: '日志时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" } |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(app-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'detail') { // 查看详情 |
| | | showEditModel(data); |
| | | } |
| | | }); |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var userId = $('#role_clients').val(); |
| | | var key = $('#app-edit-search').val(); |
| | | var startTime = $('#test1').val(); |
| | | var endTime = $('#test2').val(); |
| | |
| | | } |
| | | } |
| | | |
| | | table.reload('app-table', { where: { recordTitle: key, startTime: startTime, endTime: endTime, userId: userId } }); |
| | | table.reload('app-table', { where: { recordTitle: key, startTime: startTime, endTime: endTime} }); |
| | | }); |
| | | //比较日期大小 |
| | | function compareDate(logintime, logouttime) { |
| | |
| | | } |
| | | } |
| | | } |
| | | // 导出 |
| | | $('#app-btn-export').click(function () { |
| | | var url = config.base_server + 'api-opration/dataneed/export'; |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open('POST', url, true); |
| | | xhr.responseType = "blob"; |
| | | xhr.setRequestHeader("client_type", "DESKTOP_WEB"); |
| | | xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token); |
| | | xhr.onload = function () { |
| | | if (this.status == 200) { |
| | | var fileName = "user.xlsx"; |
| | | var blob = this.response; |
| | | var a = document.createElement('a'); |
| | | a.innerHTML = fileName; |
| | | // 指定生成的文件名 |
| | | a.download = fileName; |
| | | a.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(a); |
| | | var evt = document.createEvent("MouseEvents"); |
| | | evt.initEvent("click", false, false); |
| | | a.dispatchEvent(evt); |
| | | document.body.removeChild(a); |
| | | } |
| | | } |
| | | xhr.send(); |
| | | }); |
| | | |
| | | // // 显示编辑弹窗 |
| | | var showEditModel = function (data) { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '查看详情', |
| | | area: '450px', |
| | | offset: '120px', |
| | | content: $('#app-model').html(), |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | if (data) { |
| | | $("input[name='clientId']").attr('disabled', true); |
| | | $("input[name='clientId']").attr('class', "layui-input layui-disabled"); |
| | | $("input[name='webServerRedirectUri']").attr('disabled', true); |
| | | $("input[name='webServerRedirectUri']").attr('class', "layui-input layui-disabled"); |
| | | form.val('app-form', data); |
| | | // $('#app-form').attr('method', 'POST'); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | }); |
| | | </script> |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="请输入公司名称" />  |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按公司名称" />  |
| | | <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="user-btn-add" class="layui-btn icon-btn permissions" permissions="syscompany-edit"><i class="layui-icon"></i>添加</button> |
| | | </div> |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'Post'); |
| | | |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('table-user', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | let selected = false; |
| | | clientsAll = data.data; |
| | | sheng = data.data; |
| | | |
| | | console.log(checkValue); |
| | | $.each(data.data, function (index, item) { |
| | | // console.log( item.areaName); |
| | | if (checkValue == item.areaName) { |
| | | selected = true; |
| | | console.log(item.areaName); |
| | | console.log(selected); |
| | | } else { |
| | | selected = false; |
| | | } |
| | |
| | | }) |
| | | form.render('select', id); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | admin.req('api-user/syscompany/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | } |
| | | var shiId = ""; |
| | | |
| | | console.log(shi_name) |
| | | $.each(shi_name, function (index, item) { |
| | | if (data.companyCity === item.areaName) { |
| | | shiId = item.id; |
| | | } |
| | | }) |
| | | console.log(data.companyArea) |
| | | if (data.companyArea) { |
| | | getShi_and_xian(shiId, "xian", data.companyArea) |
| | | } |
| | |
| | | layer.closeAll(); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" style="margin-bottom: -25px;">  |
| | | <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名..." autocomplete="off" width="400px" /></div>  |
| | | <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名" autocomplete="off" width="400px" /></div>  |
| | | <button id="contract-btn-search" class="layui-btn icon-btn permissions" permissions="contract-list" style="margin-bottom: -25px;"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | <table class="layui-table" id="contract-table" lay-filter="contract-table"></table> |
| | |
| | | layer.load(2); |
| | | admin.req('api-opration/contract/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | renderTable(); |
| | | }); |
| | | obj.del(); |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="输入医生姓名" />  |
| | | <input type="text" class="layui-input search-input" id="test1"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2">   |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按医生姓名" />  |
| | | <input type="text" class="layui-input search-input" id="test1" placeholder="开始时间" > 至 <input type="text" |
| | | class="layui-input search-input" id="test2" placeholder="结束时间" >   |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" permissions="diagnostic-get"><i class="layui-icon"></i>搜索</button> |
| | | <!-- <button id="app-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> --> |
| | | <button id="app-btn-export" class="layui-btn icon-btn permissions" permissions="dataneed-export"><i class="layui-icon"></i>导出</button> |
| | |
| | | }); |
| | | //更新上传的状态 |
| | | var updateEnabled = function (dataFile, enabled) { |
| | | console.log($("#upload-id").val()) |
| | | |
| | | admin.req('api-opration/dataneed/updateEnabled', { |
| | | id: $("#upload-id").val(), |
| | | enabled: enabled, |
| | |
| | | layer.closeAll(); |
| | | table.reload('app-table', { where: {} }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | } |
| | | // 导出 |
| | | $('#app-btn-export').click(function () { |
| | | var key = $('#app-edit-search').val(); |
| | | var needBegintime = $('#test1').val(); |
| | | var needEndtime = $('#test2').val(); |
| | | if (needBegintime != null && needEndtime != null) { |
| | | var flag = compareDate(needBegintime, needEndtime); |
| | | if (!flag) { |
| | | layer.msg('结束时间不得小于开始时间'); |
| | | return; |
| | | } |
| | | } |
| | | //获取 |
| | | var url = config.base_server + 'api-opration/dataneed/export'; |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open('POST', url, true); |
| | | xhr.responseType = "blob"; |
| | | var form = new FormData(); |
| | | // Add selected file to form |
| | | form.append("doctor_name", key); |
| | | form.append('need_begintime',needBegintime); |
| | | form.append('need_endtime',needEndtime); |
| | | |
| | | xhr.setRequestHeader("client_type", "DESKTOP_WEB"); |
| | | xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token); |
| | | xhr.onload = function () { |
| | |
| | | document.body.removeChild(a); |
| | | } |
| | | } |
| | | xhr.send(); |
| | | xhr.send(form); |
| | | }); |
| | | |
| | | // 显示编辑弹窗 |
| | |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline" style="margin-bottom: -25px;"> |
| | | <input id="doctorTel" class="layui-input search-input" type="text" placeholder="按手机号..." />  |
| | | <input id="doctorName" class="layui-input search-input" type="text" placeholder="按医生名..." />  |
| | | <input id="doctorTel" class="layui-input search-input" type="text" placeholder="按手机号" />  |
| | | <input id="doctorName" class="layui-input search-input" type="text" placeholder="按医生名" />  |
| | | <select id="doctorState" lay-filter="role_clients"> |
| | | <option value="">-医院状态-</option> |
| | | <option value="true">正常</option> |
| | | <option value="false">试用</option> |
| | | </select>  |
| | | <input name="hospitalName" id="hospitalName-seach" placeholder="请输入医院名称" type="text" |
| | | <input name="hospitalName" id="hospitalName-seach" placeholder="按医院名称" type="text" |
| | | class="layui-input search-input" maxlength="50" autocomplete="off" />  |
| | | </div> |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" layt="abc" |
| | |
| | | |
| | | <script type="text/html" id="doctor-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="users-edit" lay-event="reset">重置密码</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="sysdoctor-edit" lay-event="edit">修改</button> |
| | | {{# if (d.doctorType !=2){}} |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="users-edit" |
| | | lay-event="reset">重置密码</button> |
| | | {{#}}} |
| | | |
| | | <button class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="sysdoctor-edit" |
| | | lay-event="edit">修改</button> |
| | | <button class="layui-btn layui-btn-xs permissions" permissions="sysdoctor-del" lay-event="del">删除</button> |
| | | </script> |
| | | |
| | |
| | | <input name="id" type="hidden"/> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalName" type="hidden" class="layui-input" maxlength="20"/> |
| | | <select id="hospitalId" name="hospitalId" lay-filter="getdepartment" placeholder="选择一个应用" lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <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" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">科室</label> |
| | | <div class="layui-input-block"> |
| | | <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> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="departmentName" id="departmentName" placeholder="请选择科室" 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 class="layui-inline"> |
| | | <label class="layui-form-label">医生类型</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <select id="doctorType" name="doctorType" lay-filter="doctorType" lay-verify="required" |
| | | required> |
| | | <option value="2" selected>C端医生</option> |
| | | <option value="1">H端医生</option> |
| | | <option value="0">C端+H端</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorName" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >销售代表名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" type="text" class="layui-input" maxlength="15" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">联系方式</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorTel" type="text" class="layui-input" maxlength="20" lay-verify="required|phone" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">职称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorRank" type="text" class="layui-input" maxlength="20" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">其它联系方式</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorOtherLink" type="text" class="layui-input" maxlength="20" lay-verify="required" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的email</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email" required/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生简介</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorAbout" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否签约医生</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 是否置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 医生状态</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的头像</label> |
| | | <div class="layui-input-block" id="demo" > |
| | | <button type="button" class="layui-btn" id="phonto"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input name="doctorLogo" id="doctorLogo-add" type="hidden" class="layui-input" maxlength="20"/> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px; width:150px"> |
| | | 预览图: |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </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 permissions" permissions="sysdoctor-edit" id="sure" lay-filter="user-form-submit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗 添加--> |
| | | <script type="text/html" id="app-model-add"> |
| | | |
| | | <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"> |
| | | <label class="layui-form-label">医院名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalName" id="hospitalId-add" type="hidden" class="layui-input" maxlength="20"/> |
| | | <select id="hospitalName-add" name="hospitalId" lay-filter="getdepartment-add" placeholder="选择一个应用" lay-verify="required" required > |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">姓名</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorName" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorName" type="text" class="layui-input" maxlength="20" lay-verify="required" |
| | | required style="width: 150px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室</label> |
| | | <div class="layui-input-block"> |
| | | <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 class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">职称</label> |
| | | <div class="layui-input-block"> |
| | | <select id="doctorRankId" name="doctorRankId" lay-filter="doctorRankId" placeholder="选择一个职称" lay-verify="required" required> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <!-- <select id="doctorRankId" name="doctorRankId" lay-filter="doctorRankId" placeholder="选择一个职称" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input name="doctorRank" id='doctorRank' type="hidden" class="layui-input" maxlength="20"/> |
| | | </select> --> |
| | | <input name="doctorRank" id='doctorRank' class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">是否是管理员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAdminUser" id="isAdminUser-shi" type="radio" value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isAdminUser" id="isAdminUser-fou" type="radio" value="false" title="否" |
| | | class="layui-input" /> |
| | | </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"> |
| | | <input name="doctorTel" id="doctorTel-add" type="text" class="layui-input" maxlength="20" lay-verify="required|phone" required/> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorTel" id="doctorTel-add" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required|phone" required style="width: 150px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">其它联系方式</label> |
| | | <div class="layui-input-block"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">电话</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorOtherLink" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">Email</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required|email" required /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生的email</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生简介</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorAbout" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >销售代表名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserName" id="serverUserName-add" type="hidden" class="layui-input" maxlength="15"/> |
| | | <select id="serverUserId-add" name="serverUserId" lay-filter="serverUserId-add" placeholder="选择一个应用" lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 是否置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">是否签约医生</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | <textarea name="doctorAbout" id="doctorAbout" class="layui-textarea" maxlength="300" |
| | | style="width: 650px;"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 医生状态</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="是" class="layui-input" maxlength="20"/> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="否" class="layui-input" maxlength="20"/> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="正常" |
| | | class="layui-input" /> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="试用" |
| | | class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">签约</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" |
| | | class="layui-input" /> |
| | | </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"> |
| | | <input name="username" id="username" readonly type="text" class="layui-input" maxlength="15" lay-verify="required" required/> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="username" id="username" readonly type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">销售代表</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="serverUserName" id="serverUserName-add" class="layui-input" maxlength="15" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >登录密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="password" type="password" lay-verify="required" class="layui-input" maxlength="15" lay-verify="required|phone" required/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >确认密码</label> |
| | | <div class="layui-input-block"> |
| | | <input name="passwordSure" type="password" lay-verify="required|confirmPass" class="layui-input" maxlength="15"/> |
| | | </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" id="demo"> |
| | | <button type="button" class="layui-btn" id="phonto"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input name="doctorLogo" id="doctorLogo-add" type="hidden" class="layui-input" maxlength="20"/> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | 预览图: |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | <div class="layui-input-block" id="demo" style="width: 150px;"> |
| | | <img id="doctorLogo" src="" width="100px" height="100px"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label" >角色</label> |
| | | <div class="layui-input-block"> |
| | | <select name="roleId" xm-select="roleId" lay-verify="required"> |
| | | </select> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">资质证书</label> |
| | | <div class="layui-input-block" id="demo" style="width: 150px;"> |
| | | <img id="doctorCcie" src="" width="200px" height="200px"> |
| | | </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 permissions" permissions="sysdoctor-edit" id="sure" lay-filter="user-form-submit" lay-submit>保存</button> |
| | | <button class="layui-btn permissions" ew-event="closeDialog" id="shen_he" type="button">审核通过</button> |
| | | <button class="layui-btn permissions" ew-event="closeDialog" type="button" id="sure">关闭</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'autocomplete','formSelects'], function () { |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'upload', 'admin', 'autocomplete', 'formSelects'], |
| | | function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var upload = layui.upload; |
| | | var autocomplete = layui.autocomplete; |
| | | var formSelects = layui.formSelects; |
| | | var $ = layui.jquery; |
| | | form.verify({ confirmPass: function (value) { if ($('input[name=password]').val() !== value) return '两次密码输入不一致!'; } }); |
| | | form.verify({ |
| | | confirmPass: function (value) { |
| | | if ($('input[name=password]').val() !== value) return '两次密码输入不一致!'; |
| | | } |
| | | }); |
| | | |
| | | //医院数据绑定在弹框里 |
| | | var hospital = ""; |
| | |
| | | |
| | | // 获取应用列表 |
| | | // layer.load(2); |
| | | admin.req('api-user/syshospital/findAllByMap', JSON.stringify({ is_del: 0 }), function (data) { |
| | | admin.req('api-user/syshospital/findAllByMap', JSON.stringify({ |
| | | is_del: 0 |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#hospitalName-seach').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | $('#hospitalName-seach').append(new Option(item.hospitalName, item.id, |
| | | false, selected)); |
| | | form.render('select', 'app-form'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'Post'); |
| | | //自动完成-医院名称 |
| | |
| | | }); |
| | | |
| | | // 修改company状态 |
| | | form.on('switch(doctor-tpl-state)', function (obj) { |
| | | layer.load(2); |
| | | var updata_enable = function (obj) { |
| | | layer.confirm('确定审核通过吗?', function (i) { |
| | | admin.req('api-user/sysdoctor/enable', JSON.stringify({ |
| | | id: obj.elem.value, |
| | | enabled: obj.elem.checked ? true : false |
| | | id: obj.id, |
| | | enabled: true |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | //table.reload('table-user', {}); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | parent.layui.table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | | }, 'POST'); |
| | | }); |
| | | |
| | | }; |
| | | //职称添加数据 |
| | | var getZhiCheng = function () { |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ dictionariesClassId: "1248150699682988034" }), function (data) { |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ |
| | | dictionariesClassId: "1248150699682988034" |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#doctorRankId').append(new Option(item.dictionariesName, item.id, false, selected)); |
| | | $('#doctorRankId').append(new Option(item.dictionariesName, item.id, |
| | | false, selected)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'Post'); |
| | | } |
| | |
| | | user = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | console.log(item.nickname) |
| | | $('#serverUserId-add').append(new Option(item.nickname, item.id, false, false)); |
| | | $('#serverUserId-add').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | // 添加按钮点击事件 |
| | | $('#doctor-btn-add').click(function () { |
| | | showEditModel_add(undefined, 2); |
| | | showEditModel_add("添加"); |
| | | }); |
| | | //时间格式 |
| | | var laydate = layui.laydate; |
| | |
| | | elem: '#app-table', |
| | | url: config.base_server + 'api-user/sysdoctor', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 180, title: '医院名称' }, |
| | | { field: 'doctorName', width: 120, title: '医生姓名' }, |
| | | { field: 'doctorRank', width: 100, title: '职称' }, |
| | | { field: 'username', width: 150, title: '登录帐号' }, |
| | | { field: 'doctorTel', width: 150, title: '联系方式' }, |
| | | cols: [ |
| | | [{ |
| | | field: 'hospitalName', |
| | | width: 180, |
| | | title: '医院名称' |
| | | }, |
| | | { |
| | | field: 'isAnswer', width: 100, title: '医答', templet: function (d) { |
| | | field: 'doctorName', |
| | | width: 120, |
| | | title: '医生姓名' |
| | | }, |
| | | { |
| | | field: 'doctorRank', |
| | | width: 100, |
| | | title: '职称' |
| | | }, |
| | | { |
| | | field: 'username', |
| | | width: 150, |
| | | title: '登录帐号' |
| | | }, |
| | | { |
| | | field: 'doctorTel', |
| | | width: 150, |
| | | title: '联系方式' |
| | | }, |
| | | { |
| | | field: 'isAnswer', |
| | | width: 100, |
| | | title: '医答', |
| | | templet: function (d) { |
| | | return d.isAnswer ? "是" : "否" |
| | | } |
| | | }, |
| | | { |
| | | field: 'isSigning', width: 100, title: '签约', templet: function (d) { |
| | | field: 'isSigning', |
| | | width: 100, |
| | | title: '签约', |
| | | templet: function (d) { |
| | | return d.isSigning ? "是" : "否" |
| | | } |
| | | }, |
| | | { field: 'enabled', width: 100, align: 'center', templet: '#doctor-tpl-state', title: '状态' }, |
| | | // { |
| | | // field: 'enabled', |
| | | // width: 100, |
| | | // align: 'center', |
| | | // templet: '#doctor-tpl-state', |
| | | // title: '状态' |
| | | // }, |
| | | // { field: 'createTime', width: 150, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'createTime', width: 100, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'serverUserName', width: 100, title: '销售代表' }, |
| | | { width: 300, align: 'center', toolbar: '#doctor-table-bar', title: '操作' }, |
| | | ]], |
| | | { |
| | | field: 'createTime', |
| | | width: 150, |
| | | sort: true, |
| | | title: '创建时间', |
| | | templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" |
| | | }, |
| | | { |
| | | field: 'serverUserName', |
| | | width: 100, |
| | | title: '销售代表' |
| | | }, |
| | | { |
| | | width: 350, |
| | | align: 'center', |
| | | toolbar: '#doctor-table-bar', |
| | | title: '操作' |
| | | }, |
| | | ] |
| | | ], |
| | | done: function (res, curr, count) { |
| | | permissionsInput(res,config); |
| | | } |
| | | }); |
| | | // 显示编辑弹窗 |
| | | var showEditModel = function (data) { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '详情', |
| | | area: '900px', |
| | | offset: '120px', |
| | | content: $('#app-model').html(), |
| | | id: 'LAY_layuipro', |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | if (data.isAdminUser) { |
| | | $('#isAdminUser-shi').prop("checked", true) |
| | | } else { |
| | | $('#isAdminUser-fou').prop("checked", true) |
| | | } |
| | | if (data.isTop) { |
| | | $('#isTop-shi').prop("checked", true) |
| | | } else { |
| | | $('#isTop-fou').prop("checked", true) |
| | | } |
| | | if (data.isAnswer) { |
| | | $('#isAnswer-shi').prop("checked", true) |
| | | } else { |
| | | $('#isAnswer-fou').prop("checked", true) |
| | | } |
| | | if (data.isSigning) { |
| | | $('#isSigning-shi').prop("checked", true) |
| | | } else { |
| | | $('#isSigning-fou').prop("checked", true) |
| | | } |
| | | |
| | | $('#app-form').attr('method', 'POST'); |
| | | if (data) { |
| | | $('#doctorLogo').prop("src", data.doctorLogo); |
| | | $('#doctorCcie').prop("src", data.doctorCcie); |
| | | if (!data.enabled) { |
| | | $('#shen_he').show(); |
| | | } else { |
| | | $('#shen_he').hide(); |
| | | } |
| | | form.val('app-form', data); |
| | | $('#app-form').find('input,select,textarea').prop('readonly', true); |
| | | $('#app-form').find('select').prop('disabled', true); |
| | | $('#app-form').find('input[type="radio"]').prop('disabled', true); |
| | | $('#app-form').attr('method', 'POST'); |
| | | form.render(); |
| | | } |
| | | //点击审核通过按钮 |
| | | $('#shen_he').click(function () { |
| | | updata_enable(data); |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(app-table)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'detail') { // 查看详情 |
| | | showEditModel(data, 1); |
| | | showEditModel(data); |
| | | } else if (layEvent === 'reset') { |
| | | layer.confirm('确定重置此用户的密码吗?', function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-user/users/' + obj.data.userId + '/password', {}, function (data) { |
| | | admin.req('api-user/users/' + obj.data.userId + '/password', {}, function ( |
| | | data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'PUT'); |
| | | }); |
| | | } else if (layEvent === 'edit') { |
| | | showEditModel(data, 3); |
| | | showEditModel_add("编辑",data); |
| | | } else if (layEvent === 'del') { |
| | | layer.confirm('确定删除此用户吗?', function (i) { |
| | | layer.close(i); |
| | |
| | | admin.req('api-user/sysdoctor/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | var hospitalName = $("#hospitalName-seach").val(); |
| | | var doctorTel = $('#doctorTel').val(); |
| | | var doctorName = $('#doctorName').val(); |
| | | table.reload('app-table', { where: { doctorState: doctorState, hospitalName: hospitalName, doctorTel: doctorTel, doctorName: doctorName } }); |
| | | table.reload('app-table', { |
| | | where: { |
| | | doctorState: doctorState, |
| | | hospitalName: hospitalName, |
| | | doctorTel: doctorTel, |
| | | doctorName: doctorName |
| | | } |
| | | }); |
| | | //获取角色 |
| | | var get_role=function(){ |
| | | admin.req('api-user/findByMap?tenant_id=hospital',{}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | | var roleSelectData = new Array(); |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | roleSelectData.push({name: data.data[i].name, value: data.data[i].id}); |
| | | } |
| | | formSelects.data('roleId', 'local', {arr: roleSelectData}); |
| | | |
| | | // 回显user数据 |
| | | var user = admin.getTempData('t_user'); |
| | | $('#user-form').attr('method', 'POST'); |
| | | if (user) { |
| | | form.val('user-form', user); |
| | | $('#user-form').attr('method', 'POST'); |
| | | var rds = new Array(); |
| | | for (var i = 0; i < user.roles.length; i++) { |
| | | rds.push(user.roles[i].id); |
| | | } |
| | | formSelects.value('roleId', rds); |
| | | } |
| | | } else { |
| | | layer.msg('获取角色失败', {icon: 2, time: 500}); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | | }); |
| | | |
| | | // 显示新增弹窗 |
| | | var showEditModel_add = function () { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '新增', |
| | | area: '600px', |
| | | offset: '120px', |
| | | content: $('#app-model-add').html(), |
| | | success: function () { |
| | | $('#app-form-add')[0].reset(); |
| | | $('#app-form-add').attr('method', 'POST'); |
| | | $('.layui-layer-content').css('overflow', 'auto'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | | //执行实例 |
| | | upload.render({ |
| | | elem: '#phonto', |
| | | url: config.base_server + 'api-file/files-anon', |
| | | accept: 'file', |
| | | auto: true, |
| | | headers: { "Authorization": "Bearer " + config.getToken().access_token }, |
| | | before: function (obj) { |
| | | layer.load(); //上传loading |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function (index, file, result) { |
| | | $(".layui-upload-img").remove(); |
| | | $('#demo2').append('<img src="' + result + '" width="50px" height="50px" alt="' + file.name + '" class="layui-upload-img">') |
| | | }); |
| | | }, |
| | | done: function (data) { |
| | | layer.closeAll('loading'); |
| | | $("#doctorLogo-add").val(data.url); |
| | | }, |
| | | error: function (data) { |
| | | layer.closeAll('loading'); |
| | | } |
| | | }); |
| | | $.each(hospital, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | console.log(item) |
| | | $('#hospitalName-add').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | }) |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | $("#doctorTel-add").blur(function () { |
| | | $("#username").val($("#doctorTel-add").val()) |
| | | username_is_usered("username"); |
| | | }) |
| | | } |
| | | }); |
| | | }; |
| | | //判断用户名是否被使用 |
| | | var username_is_usered=function(username_id){ |
| | | var username=$("#"+username_id).val() |
| | | admin.req('api-user/users/findCountByMap',JSON.stringify({username:username}), function (data) { |
| | | if (data.code == 0) { |
| | | if(data.data>0){ |
| | | $("#"+username_id).val("") |
| | | layer.msg("该登录帐号已经使用",{ icon: 2, time: 500 }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | // 显示编辑弹窗 |
| | | var showEditModel = function (data, flag) { |
| | | var title = ""; |
| | | if (flag == 1) { |
| | | title = "查看详情"; |
| | | } else if (flag == 2) { |
| | | title = "新增"; |
| | | } else if (flag == 3) { |
| | | title = "编辑"; |
| | | } |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | var showEditModel_add = function (title,data) { |
| | | admin.putTempData('t_doctor', data); |
| | | admin.popupCenter({ |
| | | title: title, |
| | | area: '650px', |
| | | offset: '120px', |
| | | content: $('#app-model').html(), |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | $.each(hospital, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#hospitalId').append(new Option(item.hospitalName, item.id, false, selected)); |
| | | }) |
| | | //将科室的数据绑定到里面 |
| | | if (flag != 2) { |
| | | getdepartment(data.hospitalId); |
| | | } |
| | | if (data) { |
| | | if (data.isAnswer) { |
| | | $("#isAnswer-shi").attr('checked', true); |
| | | } else { |
| | | $("#isAnswer-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.isSigning) { |
| | | $("#isSigning-shi").attr('checked', true); |
| | | } else { |
| | | $("#isSigning-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.isTop) { |
| | | $("#isTop-shi").attr('checked', true); |
| | | } else { |
| | | $("#isTop-fou").attr('checked', true); |
| | | } |
| | | |
| | | if (data.doctorState) { |
| | | $("#doctorState-shi").attr('checked', true); |
| | | } else { |
| | | $("#doctorState-fou").attr('checked', true); |
| | | } |
| | | form.val('app-form', data); |
| | | if (flag == 1) { |
| | | //将确定隐藏 doctorState-shi |
| | | $("#sure").hide(); |
| | | $("#phonto").hide(); |
| | | //将所有的设置为只读 |
| | | $('#app-form').find('input').attr('readonly', true); |
| | | $('#app-form').find('select,input[type="radio"]').attr('disabled', true); |
| | | } else { |
| | | $("#sure").show(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | } |
| | | } |
| | | } |
| | | path: 'pages/opration/doctor_form.html', |
| | | area: '900px', |
| | | finish: function () {} |
| | | }); |
| | | }; |
| | | // 表单提交事件 |
| | | form.on('submit(user-form-submit)', function (data) { |
| | | layer.load(2); |
| | | data.field.hospitalId = parseInt(data.field.hospitalId); |
| | | if(data.field.roleId!=null&&data.field.roleId!=""){ |
| | | data.field.roles=data.field.roleId.split(','); |
| | | } |
| | | data.field.roleId=null; |
| | | admin.req('api-user/sysdoctor', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.closeAll(); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | | }); |
| | | //更新 点击医院触发的事件 |
| | | form.on('select(getdepartment)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(hospital, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#hospitalName').val(item.hospitalName); |
| | | } |
| | | }) |
| | | // |
| | | getdepartment(data.value); |
| | | }); |
| | | //新增----点击医院触发的事件 |
| | | form.on('select(getdepartment-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(hospital, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#hospitalId-add').val(item.hospitalName); |
| | | console.log($('#hospitalId-add').val()) |
| | | } |
| | | }) |
| | | // |
| | | getdepartment(data.value); |
| | | }); |
| | | //将新增 中的 serverUserName 赋值 |
| | | form.on('select(serverUserId-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $.each(user, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#serverUserName-add').val(item.nickname); |
| | | console.log($('#serverUserName-add').val()) |
| | | } |
| | | }) |
| | | // |
| | | }); |
| | | //新增 点击职称的触发事件 |
| | | form.on('select(doctorRankId)', function (data) { |
| | | //将部门名称赋值 |
| | | |
| | | $.each(doctorRank, function (index, item) { |
| | | if (item.id == data.value) { |
| | | console.log(12312312312) |
| | | $('#doctorRank').val(item.dictionariesName); |
| | | console.log($('#doctorRank').val()) |
| | | } |
| | | }) |
| | | }); |
| | | //新增 和 更新 科室触发的事件 |
| | | form.on('select(departmentId)', function (data) { |
| | | //将部门名称赋值 |
| | | $.each(department, function (index, item) { |
| | | if (item.id == data.value) { |
| | | $('#departmentName').val(item.departmentName); |
| | | } |
| | | }) |
| | | // |
| | | // getdepartment(data.value); |
| | | }); |
| | | //获取科室 |
| | | var getdepartment = function (data) { |
| | | admin.req('api-user/sysdepartment/findListByHospitalId', { id: data }, 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'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | |
| | | <option value="0">公开-</option> |
| | | <option value="1">私有</option> |
| | | </select> |
| | | <input name="templeteTitle" id="templeteTitle" placeholder="请输入标题名称" type="text" |
| | | <input name="templeteTitle" id="templeteTitle" placeholder="按标题" type="text" |
| | | class="layui-input search-input" maxlength="20" /> |
| | | <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="docto-templete-btn-add" class="layui-btn icon-btn permissions" permissions="doctortemplete-edit"><i class="layui-icon"></i>添加</button> |
| | |
| | | { field: 'templeteTitle', width: 180, sort: true, title: '标题' }, |
| | | { |
| | | field: 'publicType', width: 200, sort: true, title: '开放类型', templet: function (d) { |
| | | return d.publicType ==true ? "公开" : "私有" |
| | | return d.publicType ==true ? "私有" : "公开" |
| | | } |
| | | }, |
| | | { |
| | |
| | | admin.req('api-opration/doctortemplete/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | }else if (data.field.publicType==0){ |
| | | data.field.publicType=false; |
| | | } |
| | | console.log(data.field.publicType) |
| | | admin.req('api-opration/doctortemplete', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | // layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.closeAll(); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | if (data) { |
| | | console.log(data.publicType == true ? 1 : 0); |
| | | if(index==1){ |
| | | $('#sure').hide(); |
| | | } |
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 class="layui-inline"> |
| | | <label class="layui-form-label">医生类型</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <select id="doctorType" name="doctorType" lay-filter="doctorType" lay-verify="required" required> |
| | | <option value="2" selected>C端医生</option> |
| | | <option value="1">H端医生</option> |
| | | <option value="0">C端+H端</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" type="text" class="layui-input" maxlength="20" lay-verify="required" |
| | | required style="width: 150px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">职称</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <select id="doctorRankId" name="doctorRankId" lay-filter="doctorRankId" placeholder="选择一个职称" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | <input name="doctorRank" id='doctorRank' type="hidden" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">Email</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorEmail" type="text" class="layui-input" maxlength="20" lay-verify="required|email" |
| | | required /> |
| | | </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="doctorTel" id="doctorTel-add" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required|phone" required style="width: 150px;" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">其它联系方式</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="doctorOtherLink" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" id="roleId_div"> |
| | | <label class="layui-form-label">角色</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <select name="roleId" xm-select="roleId"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="doctorAbout" id="doctorAbout" class="layui-textarea" maxlength="300" |
| | | style="width: 650px;"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生状态</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorState" id="doctorState-shi" type="radio" checked value="true" title="正常" |
| | | class="layui-input" /> |
| | | <input name="doctorState" id="doctorState-fou" type="radio" value="false" title="试用" |
| | | class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label"> 置顶</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isTop" id="isTop-shi" type="radio" checked value="true" title="是" class="layui-input" /> |
| | | <input name="isTop" id="isTop-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医答</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isAnswer" id="isAnswer-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isAnswer" id="isAnswer-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">签约</label> |
| | | <div class="layui-input-block"> |
| | | <input name="isSigning" id="isSigning-shi" type="radio" checked value="true" title="是" |
| | | class="layui-input" /> |
| | | <input name="isSigning" id="isSigning-fou" type="radio" value="false" title="否" class="layui-input" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="display:flex" class="account"> |
| | | <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="username" id="username" readonly type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" id="password_div"> |
| | | <label class="layui-form-label">登录密码</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="password" type="password" id="password" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" id="passwordSure_div"> |
| | | <label class="layui-form-label">确认密码</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="passwordSure" type="password" id="passwordSure" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- </div> |
| | | <div class="layui-form-item"> |
| | | |
| | | </div> |
| | | <div class="layui-form-item"> --> |
| | | |
| | | </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" id="demo" style="width: 150px;"> |
| | | <button type="button" class="layui-btn" id="phonto"> |
| | | <i class="layui-icon"></i>上传图片 |
| | | </button> |
| | | <input name="doctorLogo" id="doctorLogo-add" type="hidden" class="layui-input" maxlength="20" /> |
| | | <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;"> |
| | | 预览效果 |
| | | <div class="layui-upload-list" id="demo2"></div> |
| | | </blockquote> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">销售代表</label> |
| | | <div class="layui-input-block" style="width: 150px;"> |
| | | <input name="serverUserName" id="serverUserName-add" type="hidden" class="layui-input" |
| | | maxlength="15" /> |
| | | <select id="serverUserId-add" name="serverUserId" lay-filter="serverUserId-add" |
| | | lay-verify="required" required> |
| | | <option value="">-请选择-</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> --> |
| | | |
| | | </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 permissions" permissions="sysdoctor-edit" id="sure" lay-filter="user-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 upload = layui.upload; |
| | | var autocomplete = layui.autocomplete; |
| | | var formSelects = layui.formSelects; |
| | | var $ = layui.jquery; |
| | | |
| | | |
| | | //医生管理员 |
| | | var guanliyuan_role = undefined; |
| | | //获取角色 |
| | | var get_role = function (flag) { |
| | | admin.req('api-user/findByMap?tenant_id=hospital', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | | var roleSelectData = new Array(); |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | roleSelectData.push({ |
| | | name: data.data[i].name, |
| | | value: data.data[i].id |
| | | }); |
| | | } |
| | | guanliyuan_role = data.data[0].id; |
| | | formSelects.data('roleId', 'local', { |
| | | arr: roleSelectData |
| | | }); |
| | | // 回显user数据 |
| | | var doctor = admin.getTempData('t_doctor'); |
| | | if (doctor.roles) { |
| | | formSelects.value('roleId', doctor.roles); |
| | | } |
| | | |
| | | } else { |
| | | layer.msg('获取角色失败', { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | | /* |
| | | * 验证手机号码 |
| | | */ |
| | | function validatorTel(content) { |
| | | |
| | | // 正则验证格式 |
| | | eval("var reg = /^1[34578]\\d{9}$/;"); |
| | | var flag=RegExp(reg).test(content) |
| | | return flag; |
| | | } |
| | | //判断用户名是否被使用 |
| | | var username_is_usered = function (username_id) { |
| | | var username = $("#" + username_id).val() |
| | | admin.req('api-user/users/findCountByMap', JSON.stringify({ |
| | | username: username |
| | | }), function (data) { |
| | | if (data.code == 0) { |
| | | if (data.data > 0) { |
| | | $("#" + username_id).val("") |
| | | layer.msg("该手机号已经使用", { |
| | | icon: 2, |
| | | time: 2000 |
| | | }) |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'post'); |
| | | } |
| | | |
| | | |
| | | // 表单提交事件 |
| | | form.on('submit(user-form-submit)', function (data) { |
| | | layer.load(2); |
| | | debugger |
| | | data.field.hospitalId = $("#hospitalId").val(); |
| | | if (data.field.roleId != null && data.field.roleId != "") { |
| | | data.field.roles = data.field.roleId.split(','); |
| | | } |
| | | if ($("#doctorType").val() == 2) { |
| | | //将关于密码的的去掉 |
| | | data.field.username = ""; |
| | | data.field.password = ""; |
| | | data.field.passwordSure = ""; |
| | | } else { |
| | | if (data.field.roles.length == 0) { |
| | | layer.msg("请选择角色"); |
| | | return |
| | | } |
| | | if (data.field.roles.includes(guanliyuan_role)) { |
| | | data.field.isAdminUser = true; |
| | | } else { |
| | | data.field.isAdminUser = false; |
| | | } |
| | | } |
| | | // guanliyuan_role |
| | | // data.field.hospitalId = ""+data.field.hospitalId; |
| | | data.field.roleId = null; |
| | | |
| | | admin.req('api-user/sysdoctor', 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; |
| | | }); |
| | | |
| | | //将新增 中的 serverUserName 赋值 |
| | | form.on('select(serverUserId-add)', function (data) { |
| | | //将医院名称赋值 |
| | | $('#serverUserName-add').val($(this)[0].innerHTML); |
| | | }); |
| | | //新增 点击职称的触发事件 |
| | | form.on('select(doctorRankId)', function (data) { |
| | | //将部门名称赋值 |
| | | $('#doctorRank').val($(this)[0].innerHTML); |
| | | }); |
| | | //新增 和 更新 科室触发的事件 |
| | | form.on('select(departmentId)', function () { |
| | | //将部门名称赋值 |
| | | $('#departmentName').val($(this)[0].innerHTML); |
| | | }); |
| | | //获取科室 |
| | | var getdepartment = function (data) { |
| | | admin.req('api-user/sysdepartment/findListByHospitalId', { |
| | | id: data |
| | | }, 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'); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | //职称添加数据 |
| | | var getZhiCheng = function () { |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ |
| | | dictionariesClassId: "1248150699682988034" |
| | | }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | let selected = false; |
| | | doctorRank = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | if (config.clientId === item.clientId) { |
| | | selected = true; |
| | | } else { |
| | | selected = false; |
| | | } |
| | | //往下拉菜单里添加元素 |
| | | $('#doctorRankId').append(new Option(item.dictionariesName, item.id, |
| | | false, selected)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'Post'); |
| | | } |
| | | //获取销售代表 |
| | | var getXiaoShouDaiBiao = function () { |
| | | admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | user = data.data; |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserId-add').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | }) |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | // 显示新增弹窗 |
| | | var loadEditData = function () { |
| | | $('#app-form-add')[0].reset(); |
| | | $('#app-form-add').attr('method', 'POST'); |
| | | $('.layui-layer-content').css('overflow', 'auto'); |
| | | //将医院的数据保存到下拉表 |
| | | let selected = false; |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | //获取角色 |
| | | get_role(); |
| | | var upload = layui.upload; |
| | | //执行实例 |
| | | upload.render({ |
| | | elem: '#phonto', |
| | | url: config.base_server + 'api-file/files-anon', |
| | | accept: 'file', |
| | | auto: true, |
| | | headers: { |
| | | "Authorization": "Bearer " + config.getToken().access_token |
| | | }, |
| | | before: function (obj) { |
| | | layer.load(); //上传loading |
| | | //预读本地文件示例,不支持ie8 |
| | | obj.preview(function (index, file, result) { |
| | | $(".layui-upload-img").remove(); |
| | | $('#demo2').append('<img src="' + result + |
| | | '" width="50px" height="50px" alt="' + file.name + |
| | | '" class="layui-upload-img">') |
| | | }); |
| | | }, |
| | | done: function (data) { |
| | | layer.closeAll('loading'); |
| | | $("#doctorLogo-add").val(data.url); |
| | | }, |
| | | error: function (data) { |
| | | layer.closeAll('loading'); |
| | | } |
| | | }); |
| | | //将密码隐藏 |
| | | $(".account").hide(); |
| | | //将密码置空 |
| | | $("#password").val(""); |
| | | form.render(); |
| | | $("#username").blur(function () { |
| | | username_is_usered("username"); |
| | | }) |
| | | |
| | | //医生类型的选择事件 |
| | | // form.on('select(doctorType)', function (data) { |
| | | // // console.log("eeeeeeeeeeeeeeeee"); |
| | | // // var doctor = admin.getTempData('t_doctor'); |
| | | // // debugger |
| | | // // console.log("doctordoctordoctordoctordoctor",doctor); |
| | | // var doctorType = $('#doctorType').val(); |
| | | // //将密码项取消 |
| | | // if (doctorType == 2) { |
| | | // $(".account").hide(); |
| | | // } else { |
| | | // $(".account").show(); |
| | | // } |
| | | // }) |
| | | }; |
| | | $("#doctorTel-add").blur(function () { |
| | | $("#username").val($("#doctorTel-add").val()) |
| | | var doctorTel_add = $("#doctorTel-add").val(); |
| | | debugger |
| | | if (!validatorTel(doctorTel_add)) { |
| | | layer.msg("请输入正确的手机号"); |
| | | } |
| | | username_is_usered("username"); |
| | | }) |
| | | //自动完成-医院名称 |
| | | 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(doctorType)', function (data) { |
| | | var doctor = admin.getTempData('t_doctor'); |
| | | var doctorType = $('#doctorType').val(); |
| | | if (doctor.doctorType == 2 && doctorType == 2) { |
| | | $(".account").hide(); |
| | | $("#roleId_div").hide() |
| | | } else if (doctor.doctorType == 2 && doctorType != 2) { |
| | | $(".account").show(); |
| | | $("#password_div").show(); |
| | | $("#passwordSure_div").show(); |
| | | $("#roleId_div").show() |
| | | if (doctor.username == null) { |
| | | $("#username").val(doctor.doctorTel); |
| | | form.render(); |
| | | } |
| | | } else if (doctor.doctorType != 2 && doctorType != 2) { |
| | | $(".account").show(); |
| | | $("#password_div").hide(); |
| | | $("#passwordSure_div").hide(); |
| | | $("#roleId_div").show() |
| | | } else if (doctor.doctorType != 2 && doctorType == 2) { |
| | | $(".account").hide(); |
| | | $("#roleId_div").hide() |
| | | } |
| | | |
| | | }) |
| | | //数据的回显 |
| | | var doctor = admin.getTempData('t_doctor'); |
| | | $('#app-form-add').attr('method', 'POST'); |
| | | if (doctor) { |
| | | //重新装载科室 |
| | | getdepartment(doctor.hospitalId); |
| | | //获取职称的 |
| | | getZhiCheng(); |
| | | //获取销售代表 |
| | | getXiaoShouDaiBiao(); |
| | | //获取角色 |
| | | get_role(doctor.isAdminUser); |
| | | |
| | | form.val('app-form-add', doctor); |
| | | $("#hospitalId").val(doctor.hospitalId); |
| | | $("#password_div").hide(); |
| | | $("#passwordSure_div").hide(); |
| | | |
| | | //将密码项取消 |
| | | if (doctor.doctorType == 2) { |
| | | $(".account").hide(); |
| | | $("#roleId_div").hide() |
| | | } else { |
| | | $(".account").show(); |
| | | $("#roleId_div").show() |
| | | } |
| | | $('#demo2').append('<img src="' + doctor.doctorLogo + |
| | | '" width="50px" height="50px" alt="' + "name" + |
| | | '" class="layui-upload-img">') |
| | | $("#password").removeAttr("lay-verify") |
| | | $("#password").removeAttr("required") |
| | | $("#passwordSure").removeAttr("lay-verify") |
| | | |
| | | form.render(); |
| | | } else { |
| | | loadEditData(); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar">  |
| | | <input id="user-search-value" class="layui-input search-input" type="text" placeholder="输入医生姓名" />  |
| | | <input type="text" name="date" id="datebegin" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" |
| | | <input id="user-search-value" class="layui-input search-input" type="text" placeholder="按医生姓名" />  |
| | | <input type="text" name="date" id="datebegin" lay-verify="date" placeholder="开始时间" autocomplete="off" |
| | | class="layui-input search-input"> |
| | | 至 |
| | | <input type="text" name="date" id="dateend" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" |
| | | <input type="text" name="date" id="dateend" lay-verify="date" placeholder="结束时间" autocomplete="off" |
| | | class="layui-input search-input">   |
| | | <button id="user-btn-search" class="layui-btn icon-btn permissioins" permissioins="feedback-list"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | layer.load(2); |
| | | admin.req('api-opration/sysfeedback/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | tableLoad(); |
| | | }); |
| | | obj.del(); |
| | |
| | | }); |
| | | } |
| | | else { |
| | | layer.msg('未找到相关数据', { icon: 1, time: 500 }); |
| | | layer.msg('未找到相关数据', { icon: 1, time: 2000 }); |
| | | } |
| | | }, |
| | | beforeSend: function (xhr) { |
| | |
| | | <option value="1">-是-</option> |
| | | <option value="0">-否-</option> |
| | | </select> |
| | |   --> |
| | |   |
| | | <select id="hospitalstate" placeholder="选择医院状态" lay-filter="hospitalstate"> |
| | | <option value="">-医院状态-</option> |
| | | <option value="0">试用</option> |
| | | <option value="1">正式</option> |
| | | </select> |
| | | </select> --> |
| | |   |
| | | <input id="hosName" class="layui-input search-input" type="text" placeholder="按医院名" />  |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i |
| | | class="layui-icon permissions" permissions="hospital-get"></i>搜索</button>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="hospital-save"></i>添加医院</button> |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="hospital-save"></i>添加医院/科室</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 250, title: '医院名称', fixed: 'left' }, |
| | | { field: 'departmentName', width: 100, title: '科室', fixed: 'left' }, |
| | | { field: 'departmentName', width: 100, title: '科室/部门', fixed: 'left' }, |
| | | { |
| | | field: 'hospitalArea', width: 250, title: '所在地区', templet: function (d) { |
| | | field: 'hospitalArea', width: 360, title: '所在地区', templet: function (d) { |
| | | return ((d.hospitalProvince == null) ? "" : d.hospitalProvince) + " " |
| | | + ((d.hospitalCity == null) ? "" : d.hospitalCity) + " " + |
| | | ((d.hospitalArea == null) ? "" : d.hospitalArea) |
| | | } |
| | | }, |
| | | { field: 'hospitalLink', width: 100, title: '联系人' }, |
| | | { field: 'hospitalTel', width: 100, title: '联系方式' }, |
| | | { |
| | | field: 'enabled', width: 80, title: '状态', templet: function (d) { |
| | | return d.hospitalState == 0 ? "试用" : "正式" |
| | | } |
| | | }, |
| | | { field: 'hospitalTel', width: 150, title: '联系方式' }, |
| | | // { |
| | | // field: 'enabled', width: 80, title: '状态', templet: function (d) { |
| | | // return d.hospitalState == 0 ? "试用" : "正式" |
| | | // } |
| | | // }, |
| | | { |
| | | field: 'isScreen', width: 80, title: '筛查', templet: function (d) { |
| | | return d.isScreen ? "是" : "否" |
| | |
| | | // } }, |
| | | |
| | | { field: 'serverUserName', width: 100, title: '服务人员' }, |
| | | { field: 'createTime', width: 120, title: '创建时间', templet:function (d) { |
| | | { field: 'createTime', width: 150, title: '创建时间', templet:function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } }, |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', title: '状态' }, |
| | | { field: 'hospitalId', width: 300, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作', fixed: 'right' } |
| | | { field: 'hospitalId', width: 200, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作', fixed: 'right' } |
| | | ]], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | |
| | | }; |
| | | admin.req('api-user/syshospital/delete', whereModel, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | $('#hospita-btn-search').click(); |
| | | }); |
| | | obj.del(); |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">医院简称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="50" |
| | | <input name="hospitalShortName" type="text" class="layui-input" maxlength="20" |
| | | style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | |
| | | <label class="layui-form-label">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" id="departmentName" placeholder="科室名称" type="text" class="layui-input" |
| | | maxlength="50" lay-verify="required" required style="width: 175px;" /> |
| | | maxlength="20" lay-verify="required" required style="width: 175px;" /> |
| | |  </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">联系电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" maxlength="50" /> |
| | | <input name="hospitalTel" id="hospitalTel" type="text" class="layui-input" maxlength="20" /> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3"> |
| | | <label class="layui-form-label">联系人</label> |
| | | <div class="layui-input-block"> |
| | | <input name="hospitalLink" type="text" class="layui-input" maxlength="50" style="width: 200px;" /> |
| | | <input name="hospitalLink" type="text" class="layui-input" maxlength="20" style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <label class="layui-form-label">帐号数量</label> |
| | | <div class="layui-input-block"> |
| | | <input id="accountsCount" name="accountsCount" type="text" value="6" class="layui-input" |
| | | maxlength="50" lay-verify="required|integer" style="width: 200px;" /> |
| | | maxlength="1" lay-verify="required|integer" style="width: 200px;" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">服务人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserId" id="serverUserId" type="hidden" value="" /> |
| | | <input name="serverUserId" id="serverUserId" type="hidden" value="" maxlength="20" /> |
| | | <select lay-verify="required" required name="serverUserName" id="serverUserName" |
| | | style="width: 150px;" lay-filter="serverUserName"> |
| | | </select> |
| | |
| | | <div class="layui-col-sm6"> |
| | | <label class="layui-form-label">服务人电话</label> |
| | | <div class="layui-input-block"> |
| | | <input name="serverUserTel" id="serverUserTel" type="text" class="layui-input" maxlength="20" value=""/> |
| | | <input name="serverUserTel" id="serverUserTel" type="text" class="layui-input" maxlength="20" |
| | | value="" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-sm4"> |
| | | <label class="layui-form-label">销售人员</label> |
| | | <div class="layui-input-block"> |
| | | <input name="saleUserId" id="saleUserId" type="hidden" value="" /> |
| | | <select lay-verify="required" required name="saleUserName" id="saleUserName" style="width: 150px;" lay-filter="saleUserName"> |
| | | <input name="saleUserId" id="saleUserId" type="hidden" value="" maxlength="20" /> |
| | | <select lay-verify="required" required name="saleUserName" id="saleUserName" style="width: 150px;" |
| | | lay-filter="saleUserName"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医院简介</label> |
| | | <div class="layui-input-block"> |
| | | <textarea name="hospitalAbout" class="layui-textarea" maxlength="500"></textarea> |
| | | <textarea name="hospitalAbout" class="layui-textarea" maxlength="300"></textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | |
| | | </form> |
| | | |
| | | <script> |
| | | |
| | | |
| | | layui.use(['form', 'table', 'util', 'config', 'admin', 'area', 'dic', 'autocomplete'], function () { |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | |
| | | var dic = layui.dic; |
| | | var autocomplete = layui.autocomplete; |
| | | var $ = layui.jquery; |
| | | |
| | | //加载服务人员信息 |
| | | var loadServerUser = function (selectVal) { |
| | | admin.req('api-user/users/getAppointUser', { type: 1 }, function (data) { |
| | | admin.req('api-user/users/getAppointUser', { |
| | | type: 1 |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | if (selectVal == item.id) { |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, true)); |
| | | } |
| | | else { |
| | | if (!strUtil.isEmpty(selectVal) && selectVal == item.id) { |
| | | $('#serverUserName').append(new Option(item.nickname, item |
| | | .id, false, true)); |
| | | } else { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | $('#serverUserName').append(new Option(item.nickname, item |
| | | .id, false, false)); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if(hosIdForEdit == ""){ |
| | | $("#serverUserTel").val(data.data[0].mobile); |
| | | $('#serverUserName').val(data.data[0].id); |
| | | form.render(); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | |
| | | }, 'get'); |
| | |
| | | |
| | | //加载销售人员信息 |
| | | var loadSaleUser = function (selectVal) { |
| | | admin.req('api-user/users/getAppointUser', { type: 0 }, function (data) { |
| | | admin.req('api-user/users/getAppointUser', { |
| | | type: 0 |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | if (selectVal == item.id) { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, false, true)); |
| | | if (!strUtil.isEmpty(selectVal) && selectVal == item.id) { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, true)); |
| | | } else { |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | $('#saleUserName').append(new Option(item.nickname, item.id, |
| | | false, false)); |
| | | } |
| | | }); |
| | | |
| | | if(hosIdForEdit == ""){ |
| | | $("#saleUserTel").val(data.data[0].mobile); |
| | | $('#saleUserName').val(data.data[0].id); |
| | | form.render(); |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | |
| | | }, 'get'); |
| | | } |
| | | |
| | | |
| | | //医院资质数据 |
| | | dic.dicData("#hospitalQualifiedName", "HOSPITAL_QUALIFIED", ""); |
| | | //医院类型数据 |
| | | dic.dicData("#hospitalTypeName", "HOSPITAL_TYPE", ""); |
| | | //省份数据加载 |
| | | area.areaData("#hospitalProvince", 1, "", ""); |
| | | //回显组织数据 |
| | | let edithospitalData = admin.getTempData('t_hospital'); |
| | | var hosIdForEdit = ""; |
| | | var departmentId = ""; |
| | | if (edithospitalData != null) { |
| | | hosIdForEdit = edithospitalData.hospitalId; |
| | | departmentId = edithospitalData.departmentId; |
| | | } |
| | | //装载销售人员 服务人员数据 |
| | | loadServerUser(); |
| | | loadSaleUser(); |
| | | |
| | | //装载市区数据 |
| | | form.on("select(hospitalProvince)", function (data) { |
| | | area.areasClear("#hospitalArea", 3); |
| | | area.areaData("#hospitalCity", 2, data.value, ""); |
| | | defaultValData(); |
| | | }); |
| | | //装载区县数据 |
| | | form.on("select(hospitalCity)", function (data) { |
| | | area.areaData("#hospitalArea", 3, data.value, ""); |
| | | defaultValData(); |
| | | }); |
| | | form.on("select(hospitalArea)", function (data) { |
| | | //区号,金纬度自动赋值 |
| | | var cityDataFor = admin.getTempData("t_city"); |
| | | if (cityDataFor != null) { |
| | | cityDataFor.forEach(function (item) { |
| | | var areaDataFor = admin.getTempData("t_area"); |
| | | if (areaDataFor != null) { |
| | | areaDataFor.forEach(function (item) { |
| | | if (data.value == item.id) { |
| | | $("#areaCode").val(item.areaCitycode); |
| | | $("#longitude").val(item.areaLng); |
| | |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | //赋值资质数据ID |
| | | form.on("select(hospitalQualifiedName)", function (data) { |
| | | $("#hospitalQualifiedId").val(data.value); |
| | |
| | | layer.load(2); |
| | | if (data.field != null) { |
| | | |
| | | data.field.hospitalTypeName = $("#hospitalTypeName option:selected").text() != "请选择" ? $("#hospitalTypeName option:selected").text() : ""; |
| | | data.field.hospitalQualifiedName = $("#hospitalQualifiedName option:selected").text() != "请选择" ? $("#hospitalQualifiedName option:selected").text() : ""; |
| | | data.field.hospitalProvince = $("#hospitalProvince option:selected").text() != "选择省" ? $("#hospitalProvince option:selected").text() : ""; |
| | | data.field.hospitalCity = $("#hospitalCity option:selected").text() != "选择市" ? $("#hospitalCity option:selected").text() : ""; |
| | | data.field.hospitalArea = $("#hospitalArea option:selected").text() != "选择区县" ? $("#hospitalArea option:selected").text() : ""; |
| | | data.field.hospitalTypeName = $("#hospitalTypeName option:selected").text() != "请选择" ? |
| | | $("#hospitalTypeName option:selected").text() : ""; |
| | | data.field.hospitalQualifiedName = $("#hospitalQualifiedName option:selected").text() != |
| | | "请选择" ? $("#hospitalQualifiedName option:selected").text() : ""; |
| | | data.field.hospitalProvince = $("#hospitalProvince option:selected").text() != "选择省" ? |
| | | $("#hospitalProvince option:selected").text() : ""; |
| | | data.field.hospitalCity = $("#hospitalCity option:selected").text() != "选择市" ? $( |
| | | "#hospitalCity option:selected").text() : ""; |
| | | data.field.hospitalArea = $("#hospitalArea option:selected").text() != "选择区县" ? $( |
| | | "#hospitalArea option:selected").text() : ""; |
| | | |
| | | admin.req('api-user/syshospital', JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | |
| | | serverUserTel: $("#serverUserTel").val(), |
| | | departmentName: $("#departmentName").val(), |
| | | id: $("#departmentId").val(), |
| | | orgId: $("#departmentOrgId").val(), |
| | | updateUserId: data.data.orgId, |
| | | hospitalId: data.data.id, |
| | | saleUserId: $("#saleUserName").val(), |
| | | orgId: '' + $("#departmentOrgId").val(), |
| | | updateUserId: '' + data.data.orgId, |
| | | hospitalId: '' + data.data.id, |
| | | saleUserId: '' + $("#saleUserName").val(), |
| | | saleUserName: $("#saleUserName option:selected").text(), |
| | | saleUserTel: $("#saleUserTel").val() |
| | | saleUserTel: $("#saleUserTel").val(), |
| | | accountsCount: $("#accountsCount").val() |
| | | }; |
| | | admin.req('api-user/sysdepartment', JSON.stringify(departmentData), function (data) { |
| | | admin.req('api-user/sysdepartment/'+data.data.id, JSON.stringify(departmentData), |
| | | function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 1000 |
| | | }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | admin.putTempData("t_hospital", ""); |
| | | admin.putTempData("t_city", ""); |
| | | admin.putTempData("t_area", ""); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | }, "POST"); |
| | | } |
| | | else { |
| | | layer.msg("数据异常!", { icon: 2, time: 1000 }); |
| | | } else { |
| | | layer.msg("数据异常!", { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | } |
| | | return false; |
| | | }); |
| | |
| | | template_val: '{{d.hospitalName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | departmentId = ""; |
| | | loadDatas(resp.id); |
| | | } |
| | | }); |
| | | //加载当前所在部门的在职员工 |
| | | /*admin.req('api-user/users/getThisUserOrganizationUser', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | if (data.data.length > 0) { |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | $('#serverUserName').append(new Option(item.nickname, item.id, false, false)); |
| | | }) |
| | | $('#serverUserName').val(config.getUser().id); |
| | | $('#serverUserId').val(config.getUser().id); |
| | | form.render('select'); |
| | | } |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get');*/ |
| | | |
| | | |
| | | |
| | | //检查科室名是否存在 |
| | | $("#departmentName").blur(function () { |
| | |
| | | } |
| | | let hosIdForDep = $("#id").val(); |
| | | if (!strUtil.isEmpty($("#departmentName").val()) && !strUtil.isEmpty(hosIdForDep)) { |
| | | admin.req('api-user/sysdepartment/checkName', { hospitalId: hosIdForDep, departmentName: $("#departmentName").val() }, function (data) { |
| | | admin.req('api-user/sysdepartment/checkName', { |
| | | hospitalId: hosIdForDep, |
| | | departmentName: $("#departmentName").val() |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 != data.code) { |
| | | layer.msg(data.msg, { icon: 2, time: 1000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 1000 |
| | | }); |
| | | return false; |
| | | } |
| | | }, 'get'); |
| | |
| | | if (!strUtil.isEmpty(hosData.hospitalProvince)) |
| | | area.areaData("#hospitalProvince", 1, "", hosData.hospitalProvince); |
| | | if (!strUtil.isEmpty(hosData.hospitalCity)) |
| | | area.areaData("#hospitalCity", 2, $("#hospitalProvince").val(), hosData.hospitalCity); |
| | | area.areaData("#hospitalCity", 2, $("#hospitalProvince").val(), hosData |
| | | .hospitalCity); |
| | | |
| | | if (!strUtil.isEmpty(hosData.hospitalArea)) |
| | | area.areaData("#hospitalArea", 3, $("#hospitalCity").val(), hosData.hospitalArea); |
| | | area.areaData("#hospitalArea", 3, $("#hospitalCity").val(), hosData |
| | | .hospitalArea); |
| | | //装载资质 类型 |
| | | $("#hospitalQualifiedName").val(hosData.hospitalQualifiedId); |
| | | $("#hospitalTypeName").val(hosData.hospitalTypeId); |
| | | |
| | | if (!strUtil.isEmpty(departmentId)) { |
| | | //装载科室数据 |
| | | admin.req('api-user/sysdepartment', { hospitalId: hosId, isDel: 0, page: 1, limit: 20 }, function (data) { |
| | | admin.req('api-user/sysdepartment', { |
| | | id: departmentId, |
| | | isDel: 0, |
| | | page: 1, |
| | | limit: 20 |
| | | }, function (data) { |
| | | if (data.code == 0) { |
| | | let departData = data.data.data; |
| | | if (departData.length > 0) { |
| | | if (departData.length > 1) { |
| | | layer.msg("该医院下有多个科室,默认显示第一个", { icon: 1, time: 2000 }); |
| | | layer.msg("该医院下有多个科室,默认显示第一个", { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | |
| | | $("#serverUserId").val(departData[0].serverUserId); |
| | | loadServerUser(departData[0].serverUserId); |
| | | $('#serverUserName').val(departData[0] |
| | | .serverUserId); |
| | | |
| | | $("#departmentName").val(departData[0].departmentName); |
| | | $("#departmentName").val(departData[0] |
| | | .departmentName); |
| | | $("#departmentId").val(departData[0].id); |
| | | $("#departmentOrgId").val(departData[0].orgId); |
| | | $("#saleUserId").val(departData[0].saleUserId); |
| | | loadSaleUser(departData[0].saleUserId); |
| | | $("#accountsCount").val(departData[0] |
| | | .accountsCount); |
| | | $('#saleUserName').val(departData[0].saleUserId); |
| | | |
| | | if(hosIdForEdit != ""){ |
| | | $("#serverUserTel").val(departData[0].serverUserTel); |
| | | $("#saleUserTel").val(departData[0].saleUserTel); |
| | | $("#serverUserTel").val(departData[0] |
| | | .serverUserTel); |
| | | $("#saleUserTel").val(departData[0] |
| | | .saleUserTel); |
| | | } |
| | | form.render(); |
| | | } |
| | | } |
| | | else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | } |
| | | }, 'get'); |
| | | form.render(); |
| | | |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | | } |
| | | //回显组织数据 |
| | | let edithospitalData = admin.getTempData('t_hospital'); |
| | | var hosIdForEdit = ""; |
| | | if (edithospitalData != null) { |
| | | hosIdForEdit = edithospitalData.hospitalId; |
| | | if (!strUtil.isEmpty(hosIdForEdit)){} |
| | | |
| | | //装载基本数据 |
| | | if (!strUtil.isEmpty(hosIdForEdit)) { |
| | | loadDatas(hosIdForEdit); |
| | | } |
| | | |
| | | layui.use('form', function () { |
| | | var $ = layui.$ |
| | | , layer = layui.layer |
| | | , form = layui.form |
| | | var $ = layui.$, |
| | | layer = layui.layer, |
| | | form = layui.form |
| | | |
| | | form.verify({ |
| | | integer: [ |
| | | /^[1-9]\d*$/ |
| | | , '只能输入正整数' |
| | | /^[1-9]\d*$/, '只能输入正整数' |
| | | ] |
| | | }); |
| | | }); |
| | |
| | | if (data != null) { |
| | | $("#" + id).val(data.mobile); |
| | | }else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | } |
| | | }, 'get') |
| | | } |
| | | //重置区号 金纬度 |
| | | var defaultValData = function () { |
| | | $("#areaCode").val(""); |
| | | $("#longitude").val(""); |
| | | $("#latitude").val(""); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar">  |
| | | <input id="product-search-value" class="layui-input search-input" type="text" placeholder="输入产品名" />  |
| | | <input id="product-search-value" class="layui-input search-input" type="text" placeholder="按产品名" />  |
| | | <button id="product-btn-search" class="layui-btn icon-btn"><i class="layui-icon permissions" |
| | | permissions="product-list"></i>搜索</button> |
| | | <button id="product-btn-add" class="layui-btn icon-btn permissions" permissions="product-edit"><i |
| | |
| | | { field: 'enabled', width: 150, templet: '#product-tpl-state', sort: true, title: '状态' }, |
| | | { |
| | | field: 'createTime', width: 200, sort: true, title: '创建时间', templet: function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd HH:mm"); |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } |
| | | }, |
| | | { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作' } |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | layer.load(2); |
| | | admin.req('api-opration/product/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | |
| | | renderTable(); |
| | | }); |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | // 表单提交事件 |
| | |
| | | admin.req('api-opration/product', JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, $('#product-form').attr('method')); |
| | | return false; |
| | |
| | | <div class="layui-form toolbar">  |
| | | <div class="layui-col-sm10"> |
| | | <div class="layui-col-sm4"> |
| | | <input type="text" class="layui-input search-input" id="startTime" placeholder="yyyy-MM-dd"> 至 <input type="text" |
| | | class="layui-input search-input" id="endTime" placeholder="yyyy-MM-dd">   |
| | | <input type="text" class="layui-input search-input" id="startTime" placeholder="开始时间"> 至 <input type="text" |
| | | class="layui-input search-input" id="endTime" placeholder="结束时间">   |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | <input id="product-search-value" class="layui-input search-input" type="text" placeholder="按产品名" />  |
| | |
| | | // { field: 'createTime', width: 160, sort: true, title: '创建时间',templet:function(d){ |
| | | // return new Date(d.createTime).dateFormat("yyyy/MM/dd hh:mm:ss"); |
| | | // } }, |
| | | { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'createTime', width: 200, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { align: 'center', width: 100, toolbar: '#product-table-bar', title: '操作' } |
| | | ]] |
| | | }); |
| | |
| | | layer.load(2); |
| | | admin.req('api-opration/productorderrecord/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | renderTable(); |
| | | }); |
| | | obj.del(); |
| | |
| | | }; |
| | | listDetailData.push(detailData); |
| | | }) |
| | | |
| | | if (listDetailData.length > 0) { |
| | | //提交订单数据 |
| | | admin.req('api-opration/productorderdetail/saveall', JSON.stringify(listDetailData), function (data) { |
| | |
| | | if (data.code === 0) { |
| | | //现将临时数据清理 |
| | | admin.putTempData("t_tempProduct", ""); |
| | | layer.msg(data.msg, { icon: 1, time: 1000 }, function () { |
| | | layer.msg(data.msg, { icon: 1, time: 20000 }, function () { |
| | | admin.finishPopupCenter(); |
| | | }); |
| | | } |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="orgName-search" class="layui-input search-input" type="text" placeholder="请输入名称" />  |
| | | <input id="orgName-search" class="layui-input search-input" type="text" placeholder="按名称" />  |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" permissions="sysorganization-list"><i class="layui-icon"></i>搜索</button> |
| | | <button id="organization-add" class="layui-btn icon-btn permissions" permissions="sysorganization-edit"><i class="layui-icon"></i>添加</button> |
| | | <!-- <button id="organization-add" class="layui-btn icon-btn permissions" permissions="sysorganization-edit"><i class="layui-icon"></i>添加</button> --> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="organization-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="sysorganization-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="sysorganization-del" lay-event="del">删除</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="sysorganization-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="sysorganization-del" lay-event="del">删除</a> --> |
| | | </script> |
| | | |
| | | <!-- 表格状态列 --> |
| | |
| | | } |
| | | } |
| | | }, |
| | | { field: 'enabled', align: 'right', sort: true, templet: '#organization-tpl-state', title: '状态' }, |
| | | { toolbar: '#organization-table-bar', align: 'right', align: 'center', title: '操作' } |
| | | // { field: 'enabled', align: 'right', sort: true, templet: '#organization-tpl-state', title: '状态' }, |
| | | // { toolbar: '#organization-table-bar', align: 'right', align: 'center', title: '操作' } |
| | | ]], |
| | | done: function (res) { |
| | | permissionsInput(res,config); |
| | |
| | | if (layEvent === 'edit') { // 查看详情 |
| | | showEditModel(data); |
| | | } else if (layEvent === 'del') { |
| | | layer.confirm('确定删除此菜单吗?', function () { |
| | | layer.confirm('确定删除此组织吗?', function () { |
| | | layer.load(2); |
| | | let tenantId = $('#menu_clients').val(); |
| | | admin.req('api-user/sysorganization/' + obj.data.id + '?tenantId=' + tenantId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | renderTable({ tenantId: tenantId }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | renderTable({ access_token: config.clientId, is_del: 0 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | admin.req('api-user/sysorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | // layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.closeAll(); |
| | | // treetable.reload('organization-table', {}); |
| | | renderTable({ access_token: config.clientId, is_del: 0 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | } |
| | | }); |
| | | if (keyword !== '' && searchCount === 0) { |
| | | layer.msg("没有匹配结果", { icon: 5, time: 500 }); |
| | | layer.msg("没有匹配结果", { icon: 5, time: 2000 }); |
| | | } else { |
| | | treetable.expandAll('#organization-table'); |
| | | } |
| | |
| | | { name: '标签邮件', id: 13 }] |
| | | }]; |
| | | if (0 === data.code) { |
| | | console.log(JSON.stringify(data.data)) |
| | | tree({ |
| | | elem: "#orgParentId-tree", |
| | | nodes: data.data, |
| | |
| | | }); |
| | | |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | |
| | | } |
| | | }); |
| | | function ccc() { |
| | | console.log(11111111) |
| | | } |
| | | // 删除 |
| | | var doDelete = function (obj) { |
| | |
| | | admin.req('api-user/sysdictionaries/' + obj.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | // 获取应用列表 |
| | | var getdata = function () { |
| | | var co = $('#role_clients'); |
| | | console.log(11111111111111); |
| | | console.log(co); |
| | | admin.req('api-user/sysdictionaries/findAll', JSON.stringify({ dictionariesClassIdIsNull: "str" }), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | console.log(123132132132132132) |
| | | let selected = false; |
| | | clientsAll = data; |
| | | $.each(data.data, function (index, item) { |
| | | //往下拉菜单里添加元素 |
| | | // console.log(JSON.stringify(item)) |
| | | $('#role_clients').append(new Option(item.dictionariesName, item.dictionariesKey, false, selected)); |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'Post'); |
| | | } |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | // layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | admin.req('api-user/sysdictionaries', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | // layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | // layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.closeAll(); |
| | | table.reload('app-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | { field: 'hospitalName', width: 300, title: '医院名称' }, |
| | | { field: 'departmentName', width: 100, title: '科室名称' }, |
| | | { field: 'proName', width: 250, title: '产品名称' }, |
| | | { |
| | | field: 'proType', sort: true, align: 'center', width: 80, templet: function (d) { |
| | | if (d.proType === 0) |
| | | return "试用" |
| | | else |
| | | return "正式" |
| | | }, title: '类型' |
| | | }, |
| | | { field: 'ailightCount', width: 150, title: '读片量' }, |
| | | { field: 'recordCount', width: 100, title: '报告量' }, |
| | | { |
| | |
| | | |
| | | // 修改状态 |
| | | form.on('switch(product-tpl-state)', function (obj) { |
| | | layer.load(2); |
| | | layer.confirm("确定要通过此试用吗?",{btn: ["确定", "返回"]},function(){ |
| | | admin.req('api-opration/productorderdetail/updateEnabled', { |
| | | id: obj.elem.value, |
| | | enabled: obj.elem.checked ? true : false |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | renderTable(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | | }, 'GET'); |
| | | },function(){ |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | }); |
| | | }); |
| | | // 搜索按钮点击事件 |
| | | $('#product-btn-search').click(function () { |
| | |
| | | admin.req('api-search/admin/index?indexName='+obj.data.indexName, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-search/admin/index', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | if (0 == data.code) { |
| | | $('#data').html(syntaxHighlight(data.datas)); |
| | | } else { |
| | | layer.msg('获取索引信息失败', {icon: 2, time: 500}); |
| | | layer.msg('获取索引信息失败', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | |
| | | <div class="layui-form toolbar"> |
| | | 所属应用:<select id="menu_clients" lay-filter="menu_clients"></select> |
| | |  搜索:<input id="menus-edit-search" class="layui-input search-input" type="text" |
| | | placeholder="输入关键字" />  |
| | | placeholder="按关键字" />  |
| | | <button id="menus-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="menus-btn-add" class="layui-btn icon-btn permissions" permissions="saveOrUpdate"><i class="layui-icon"></i>添加</button> |
| | | <button id="menus-btn-expand" class="layui-btn">全部展开</button> |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | admin.req('api-user/menus/' + obj.data.id + '?tenantId=' + tenantId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 === data.code) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | renderTable({ tenantId: tenantId }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | } |
| | | }); |
| | | if (keyword !== '' && searchCount === 0) { |
| | | layer.msg("没有匹配结果", { icon: 5, time: 500 }); |
| | | layer.msg("没有匹配结果", { icon: 5, time: 2000 }); |
| | | } else { |
| | | treetable.expandAll('#menus-table'); |
| | | } |
| | |
| | | } |
| | | form.render(); //菜单渲染 把内容加载进去 |
| | | } else { |
| | | layer.msg('获取一级菜单', {icon: 2, time: 500}); |
| | | layer.msg('获取一级菜单', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | // 表单提交事件 |
| | |
| | | admin.req('api-user/menus/saveOrUpdate?tenantId='+menus.tenantId, JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#menus-form').attr('method')); |
| | | return false; |
| | |
| | | if (data.code == 0) { |
| | | layer.closeAll('loading'); |
| | | $(".layui-nav-img").attr("src",$("[name=headImgUrl]").val()); |
| | | layer.msg("操作成功", {icon: 1, time: 500}); |
| | | layer.msg("操作成功", {icon: 1, time: 2000}); |
| | | |
| | | form.val('user-form',data.data); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'POST'); |
| | | return false; |
| | |
| | | }, |
| | | done: function(data){ |
| | | layer.closeAll('loading'); |
| | | console.log(data); |
| | | $("[name=headImgUrl]").val(data.url); |
| | | }, |
| | | error: function (data) { |
| | |
| | | <option value="">-请选择-</option> |
| | | <option value="name">角色名称</option> |
| | | </select>  |
| | | <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="输入关键字" />  |
| | | <input id="role-edit-value" class="layui-input search-input" type="text" placeholder="按关键字" />  |
| | | <button id="role-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="role-btn-add" class="layui-btn icon-btn permissions" permissions="saveOrUpdate"><i class="layui-icon"></i>添加</button> |
| | | </div> |
| | |
| | | page: true, |
| | | cellMinWidth: 80, |
| | | cols: [[ |
| | | { type: 'numbers' }, |
| | | { field: 'id', sort: true, title: 'ID', width: 80 }, |
| | | { field: 'name', sort: true, title: '角色名' }, |
| | | { field: 'code', sort: true, title: 'Code' }, |
| | | { field: 'tenantId', sort: true, title: '应用标识' }, |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | layer.load(2); |
| | | admin.req('api-user/roles/saveOrUpdate?tenantId=' + tenantId, JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | // console.log(data); |
| | | if (data.code === 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('role-table'); |
| | | layer.closeAll('page'); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, $('#role-form').attr('method')); |
| | | return false; |
| | |
| | | var treeObj = $.fn.zTree.getZTreeObj('treeMenu-role'); |
| | | var nodes = treeObj.getCheckedNodes(true); |
| | | $.each(nodes,function(i,item){ |
| | | // console.log(item) |
| | | if(!item.children){ |
| | | array.push(item.id); |
| | | } |
| | |
| | | layer.load(2); |
| | | admin.req('api-user/sysroleorganization', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | console.log(data); |
| | | if (data.code === 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('role-table'); |
| | | layer.closeAll('page'); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, $('#role-form').attr('method')); |
| | | layer.closeAll('page'); |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | layer.closeAll('loading'); |
| | | |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'get'); |
| | | } |
| | |
| | | }; |
| | | //数据权限的点击事件 |
| | | form.on('select(role_organization)', function (data) { |
| | | console.log(data.value) |
| | | if (data.value == 2) { |
| | | $("#tree").show(); |
| | | }else{ |
| | |
| | | $('#role-form').attr('method', 'POST'); |
| | | if (data) { |
| | | getData(); |
| | | console.log(data.type) |
| | | if(data.type!=2){ |
| | | $("#tree").hide(); |
| | | } |
| | |
| | | admin.req('api-user/roles/' + obj.data.id + '?tenantId=' + tenantId, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code === 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | obj.del(); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | admin.req('api-user/menus/granted?tenantId=' + tenantId, JSON.stringify(data), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.close(index); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'POST'); |
| | | } |
| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar">  |
| | | <input id="area-search-value" class="layui-input search-input" type="text" placeholder="输入地区名称" />  |
| | | <input id="area-search-value" class="layui-input search-input" type="text" placeholder="按地区名称" />  |
| | | <button id="area-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | <button id="area-btn-add" class="layui-btn icon-btn permissions" permissions="save-area"><i class="layui-icon"></i>添加</button> |
| | | <button id="area-btn-expand" class="layui-btn">全部展开</button> |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | } |
| | | }); |
| | | if (keyword !== '' && searchCount === 0) { |
| | | layer.msg("没有匹配结果", { icon: 5, time: 500 }); |
| | | layer.msg("没有匹配结果", { icon: 5, time: 2000 }); |
| | | } else { |
| | | treetable.expandAll('#area-table'); |
| | | } |
| | |
| | | admin.req('api-user/sysarea', JSON.stringify(data.field), function (data) { |
| | | if (data.code === 0) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.msg(data.msg, {icon: 1, time: 2000}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, $('#area-form').attr('method')); |
| | | return false; |
| | |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | 所属应用:<select id="token_clients" lay-filter="token_clients"></select> |
| | |  搜索:<input id="tokens-edit-search" class="layui-input search-input" type="text" placeholder="输入用户名"/>  |
| | |  搜索:<input id="tokens-edit-search" class="layui-input search-input" type="text" placeholder="按用户名"/>  |
| | | <button id="tokens-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | |
| | |
| | | }) |
| | | form.render(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | layer.load(2); |
| | | admin.req('api-uaa/oauth/remove/token?token=' + obj.data.tokenValue, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg('成功', {icon: 1, time: 500}); |
| | | layer.msg('成功', {icon: 1, time: 2000}); |
| | | obj.del(); |
| | | }, 'DELETE'); |
| | | }); |
| | |
| | | 搜索: |
| | | <select id="user-search-key"> |
| | | <option value="">-请选择-</option> |
| | | <option value="user_id">ID</option> |
| | | <option value="username">账号</option> |
| | | <option value="nick_name">用户名</option> |
| | | <option value="mobile">手机号</option> |
| | | </select>  |
| | | <input id="user-search-value" class="layui-input search-input" type="text" placeholder="输入关键字" />  |
| | | <input id="user-search-value" class="layui-input search-input" type="text" placeholder="按关键字" />  |
| | | <button id="user-btn-search" class="layui-btn icon-btn"><i class="layui-icon" ></i>搜索</button> |
| | | <button id="user-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="user-btn-add"></i>添加</button> |
| | | <button id="user-btn-export" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="user-btn-export"></i>导出</button> |
| | | <button type="button" class="layui-btn" id="user-btn-import"> |
| | | <i class="layui-icon permissions" permissions="user-btn-import"></i>导入 |
| | | </button> |
| | | <!-- <button id="user-btn-export" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="user-btn-export"></i>导出</button>--> |
| | | <!-- <button type="button" class="layui-btn" id="user-btn-import">--> |
| | | <!-- <i class="layui-icon permissions" permissions="user-btn-import"></i>导入 --> |
| | | <!-- </button>--> |
| | | </div> |
| | | |
| | | <table class="layui-table" id="user-table" lay-filter="user-table"></table> |
| | |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token}, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'id', sort: true, width: 200, title: '标识' }, |
| | | { field: 'username', sort: true, width: 100, title: '账号' }, |
| | | { field: 'nickname', sort: true, width: 200, title: '用户名' }, |
| | | { field: 'mobile', sort: true, width: 150, title: '手机号' }, |
| | | { field: 'username', width: 100, title: '账号' }, |
| | | { field: 'nickname', width: 200, title: '用户名' }, |
| | | { field: 'mobile', width: 150, title: '手机号' }, |
| | | { |
| | | sort: true, title: '性别', templet: function (d) { |
| | | return d.sex == 0 ? "男" : "女" |
| | | }, width: 100 |
| | | }, |
| | | // { |
| | | // sort: true, width: 200, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, title: '创建时间' |
| | | // }, |
| | | { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" }, |
| | | { field: 'enabled', width: 100, sort: true, templet: '#user-tpl-state', title: '状态' }, |
| | | { fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 300 } |
| | |
| | | admin.req('api-user/users/' + obj.data.id + '/password', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.alert("密码重置为:"+data.data, {icon: 1}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'PUT'); |
| | | }); |
| | |
| | | admin.req('api-user/users/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('user-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'delete'); |
| | | }); |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | //table.reload('table-user', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | , headers: { "Authorization": "Bearer " + config.getToken().access_token } |
| | | , done: function (data) { |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 500 }); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | table.reload('user-table', {}); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | // 获取所有角色 |
| | | layer.load(2); |
| | | admin.req('api-user/allRoles', {}, function (data) { |
| | | admin.req('api-user/findByMap', {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (0 == data.code) { |
| | | // 渲染多选下拉框 |
| | |
| | | formSelects.value('roleId', rds); |
| | | } |
| | | } else { |
| | | layer.msg('获取角色失败', {icon: 2, time: 500}); |
| | | layer.msg('获取角色失败', {icon: 2, time: 2000}); |
| | | } |
| | | }, 'GET'); |
| | | |
| | |
| | | admin.req('api-user/users/saveOrUpdate', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, {icon: 1, time: 500}); |
| | | layer.alert("用户添加成功,默认密码为:"+data.data.password, {icon: 1}); |
| | | admin.finishPopupCenter(); |
| | | } else { |
| | | layer.msg(data.msg, {icon: 2, time: 500}); |
| | | layer.msg(data.msg, {icon: 2, time: 2000}); |
| | | } |
| | | }, "POST"); |
| | | return false; |
| | |
| | | if (!strUtil.isEmpty($("#orgId").val())) { |
| | | if (data.field != null) { |
| | | data.field.enabled = (data.field.enabled == 0) ? false : true; |
| | | data.field.fromId=0; |
| | | admin.req('api-user/sysuserorg', JSON.stringify(data.field), function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | |
| | | var config = layui.config; |
| | | var admin = layui.admin; |
| | | var html = admin.getTempData("params"); |
| | | console.log(html); |
| | | console.log($('iframe:last')); |
| | | |
| | | if (!$('iframe:last').attr("src")){ |
| | | $('iframe:last').attr("src",html); |
| | | } |
| | |
| | | var config = layui.config; |
| | | var layer = layui.layer; |
| | | var user = config.getUser(); |
| | | console.log(user.id); |
| | | $("#id").val(user.id); |
| | | //监听提交 |
| | | form.on('submit(submit-psw)', function (data) { |