| | |
| | | <groupId>com.kidgrow</groupId> |
| | | <artifactId>kidgrow-usercenter-api</artifactId> |
| | | </dependency> |
| | | <!-- 消息总线rabbitMQ --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bus-amqp</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | </project> |
| | |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | //import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | //import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | ResultBody listByMap = sysDoctorService.getListByMap(doctoerMap); |
| | | List<SysDoctor> sysDoctors = JSON.parseArray(JSON.toJSONString(listByMap.getData()), SysDoctor.class); |
| | | if (sysDoctors!=null&&sysDoctors.size()>0){ |
| | | List<DataNeed> dataNeedList=baseMapper.findHList(map); |
| | | return ResultBody.ok().data(dataNeedList); |
| | | Page<DataNeed> page = new Page<>(MapUtils.getInteger(map, "page"), MapUtils.getInteger(map, "limit")); |
| | | // List<DataNeed> dataNeedList=baseMapper.findHList(map); |
| | | List<DataNeed> list = baseMapper.findList(page, map); |
| | | PageResult<DataNeed> build = PageResult.<DataNeed>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | return ResultBody.ok().data(build); |
| | | }else { |
| | | return ResultBody.failed("非管理用户无权查看"); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @ApiOperation(value = "H端列表,需要医院和科室id") |
| | | @GetMapping("/hlist") |
| | | public ResultBody list(@RequestParam Map<String, Object> params, @LoginUser(isFull = true) SysUser sysUser) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | if(MapUtils.getString(params,"page")==null){ |
| | | params.put("page", 1); |
| | | }if(MapUtils.getString(params,"limit")==null){ |
| | | params.put("limit", 10); |
| | | } |
| | | return dataNeedService.FindAllByHId(params, sysUser); |
| | | } |
| | | |
| | |
| | | private boolean doctorState; |
| | | private String Mobile; |
| | | private String userName; |
| | | private boolean isDefaultAuth; |
| | | private boolean defaultAuth; |
| | | private boolean enabled; |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long roleId; |
| | |
| | | sysRoleUser.setRoleId(CommonConstant.HOSPITAL_DOCTOR_ID); |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("user_id",adminId); |
| | | queryWrapper.eq("role_id",CommonConstant.HOSPITAL_ADMIN_ID); |
| | | int update = sysUserRoleMapper.update(sysRoleUser, queryWrapper); |
| | | //现将操作人员设为非管理角色 |
| | | sysDoctor.setIsAdminUser(false); |
| | |
| | | if (!sysDoctor.getIsAdminUser()) { |
| | | //现将普通人员设为管理角色 |
| | | sysRoleUser=new SysRoleUser(); |
| | | sysRoleUser.setUserId(adminId); |
| | | sysRoleUser.setRoleId(CommonConstant.HOSPITAL_DOCTOR_ID); |
| | | sysRoleUser.setUserId(sysDoctor.getUserId()); |
| | | sysRoleUser.setRoleId(CommonConstant.HOSPITAL_ADMIN_ID); |
| | | queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("user_id",id); |
| | | queryWrapper.eq("user_id",sysDoctor.getUserId()); |
| | | queryWrapper.eq("role_id",CommonConstant.HOSPITAL_DOCTOR_ID); |
| | | sysUserRoleMapper.update(sysRoleUser, queryWrapper); |
| | | sysDoctor.setIsAdminUser(true); |
| | | if (baseMapper.updateById(sysDoctor)>0) { |
| | |
| | | user.setPassword(passwordEncoder.encode(newPassword)); |
| | | if (isdefault) { |
| | | user.setDefaultAuth(true); |
| | | }else { |
| | | user.setDefaultAuth(false); |
| | | } |
| | | baseMapper.updateById(user); |
| | | if (isdefault) { |
| | |
| | | if (sysDepartment == null) { |
| | | return 0; |
| | | } else { |
| | | 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(); |
| | | List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysDepartment.getHospitalId(), depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID); |
| | | if (hospitalDoctorListVos != null) { |
| | | int doctorCount = hospitalDoctorListVos.size(); |
| | | int accountCount = sysDepartment.getAccountsCount(); |
| | | return (accountCount - doctorCount); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | // private Integer departmetAccountsCount(Long depatmentId) { |
| | | // SysDepartment sysDepartment = departmentService.getById(depatmentId); |
| | | // if (sysDepartment == null) { |
| | | // return 0; |
| | | // } else { |
| | | // 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; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * 检查用户登录名是否已经注册 true存在 false不存在 |
| | |
| | | dc.doctor_state, |
| | | us.mobile, |
| | | us.username, |
| | | us.is_default_auth, |
| | | us.default_auth, |
| | | us.enabled, |
| | | roleuser.role_id |
| | | FROM |
| | |
| | | <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> |
| | | </dependency> |
| | | <!-- 消息总线rabbitMQ --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-bus-amqp</artifactId> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.cloud</groupId>--> |
| | | <!-- <artifactId>spring-cloud-starter-bus-amqp</artifactId>--> |
| | | <!-- </dependency>--> |
| | | <!-- https://mvnrepository.com/artifact/com.google.zxing/core --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | |
| | | @TableLogic |
| | | private boolean isDel; |
| | | //是否默认密码 |
| | | private boolean isDefaultAuth; |
| | | private boolean defaultAuth; |
| | | //是否医院管理 |
| | | @TableField(exist = false) |
| | | private boolean isHAdminUser; |
| | |
| | | import com.google.common.collect.Maps; |
| | | import com.kidgrow.common.utils.WebUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.amqp.core.AmqpTemplate; |
| | | //import org.springframework.amqp.core.AmqpTemplate; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.cloud.netflix.zuul.filters.support.FilterConstants; |
| | | import org.springframework.http.HttpHeaders; |
| | |
| | | private ExecutorService executorService; |
| | | |
| | | // @Autowired |
| | | private AmqpTemplate amqpTemplate; |
| | | // private AmqpTemplate amqpTemplate; |
| | | |
| | | @Value("${spring.application.name}") |
| | | private String defaultServiceId; |
| | |
| | | - /actuator/info |
| | | - /api-sms/smsChangLan/send |
| | | - /api-user/users/doctorUserReg |
| | | - /api-user/users/isRegUser |
| | | - /api-user/users/passwordByPhone |
| | | # - /api-user/syshospital/findAllByMap |
| | | # - /api-user/sysdictionaries/findAll |
| | | # - /api-user/sysdepartment/findListByHospitalId |
| | |
| | | /user/login, |
| | | /api-sms/smsChangLan/send, |
| | | /api-user/users/doctorUserReg, |
| | | /api-file/files-upload |
| | | /api-file/files-upload, |
| | | /api-user/users/isRegUser, |
| | | /api-user/users/passwordByPhone |
| | | # /api-user/syshospital/findAllByMap, |
| | | # /api-user/sysdictionaries/findAll, |
| | | # /api-user/sysdepartment/findListByHospitalId |