| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.constant.DictionariesConstants; |
| | |
| | | import com.kidgrow.common.utils.AesUtils; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.common.utils.Pinyin4jUtil; |
| | | import com.kidgrow.oprationcenter.feign.ProductOrderService; |
| | | import com.kidgrow.redis.util.RedisUtils; |
| | | import com.kidgrow.sms.feign.SmsChuangLanService; |
| | | import com.kidgrow.sms.model.ConstantSMS; |
| | |
| | | private SysUserRoleMapper sysUserRoleMapper; |
| | | @Autowired |
| | | private SysOrganizationMapper sysOrganizationMapper; |
| | | @Autowired |
| | | private ProductOrderService productOrderService; |
| | | |
| | | |
| | | @Override |
| | | public LoginAppUser findByUsername(String username) { |
| | |
| | | sysDepartment.setServerUserTel("0"); |
| | | sysDepartment.setServerUserName(createUserName); |
| | | boolean d = departmentService.save(sysDepartment); |
| | | if (!d) { |
| | | if (d) { |
| | | userRegVo.setDepartmentId(sysDepartment.getId()); |
| | | //自动充入系统指定的试用套餐 |
| | | if(!saveProductDetail(sysHospital.getId(),sysDepartment.getId(),sysHospital.getHospitalName(),sysDepartment.getDepartmentName())) |
| | | { |
| | | isSuccess = false; |
| | | expMsg = "套餐充值失败"; |
| | | } |
| | | } else { |
| | | isSuccess = false; |
| | | expMsg = "科室数据写入失败"; |
| | | } else { |
| | | userRegVo.setDepartmentId(sysDepartment.getId()); |
| | | } |
| | | } else { |
| | | isSuccess = false; |
| | |
| | | sysDoctor.setServerUserId(isReg ? createUserId : sysUserd.getId()); |
| | | sysDoctor.setServerUserName(isReg ? createUserName : sysUserd.getUsername()); |
| | | sysDoctor.setIsAdminUser(false); |
| | | sysDoctor.setEnabled(!isReg); |
| | | sysDoctor.setDoctorCcie(userRegVo.getDoctorCcie()); |
| | | sysDoctor.setEnabled(true); |
| | | if (sysDoctorMapper.insert(sysDoctor) == 1) { |
| | | //非自主注册的 返回信息带密码 |
| | | if (!isReg) { |
| | |
| | | return ResultBody.ok().data(sysUser); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * feign客户端调用写入试用套餐 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @param hospitalName |
| | | * @param departmentName |
| | | * @return |
| | | */ |
| | | private boolean saveProductDetail(Long hospitalId,Long departmentId,String hospitalName,String departmentName) |
| | | { |
| | | Map<String,Object> params=new HashMap<String,Object>(); |
| | | params.put("hospitalId",hospitalId); |
| | | params.put("departmentId",departmentId); |
| | | params.put("hospitalName",hospitalName); |
| | | params.put("departmentName",departmentName); |
| | | ResultBody resultBody= productOrderService.saveProductDetail(params); |
| | | return (boolean)resultBody.getData(); |
| | | } |
| | | /** |
| | | * 获取医院科室下的所有H端有效的医生 |
| | | * |
| | |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("mobile", phone); |
| | | selectMap.put("is_del", 0); |
| | | selectMap.put("tenant_id", "hospital"); |
| | | List<SysUser> sysUsers = baseMapper.selectByMap(selectMap); |
| | | return (sysUsers.size() > 0); |
| | | } |