Przeglądaj źródła

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

zhangdan 6 lat temu
rodzic
commit
a9e28a2ff7
28 zmienionych plików z 373 dodań i 107 usunięć
  1. 6 6
      common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java
  2. 3 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  3. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java
  4. 9 6
      gateway/ag-basic/src/main/resources/application.yml
  5. 6 3
      server/svr-authentication/src/main/resources/application.yml
  6. 6 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleInfoDao.java
  7. 5 2
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseModuleRoleDao.java
  8. 2 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgUserDao.java
  9. 9 6
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java
  10. 34 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorRoleInfoEndpoint.java
  11. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/org/BaseOrgEndpoint.java
  12. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java
  13. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/team/BaseTeamEndpoint.java
  14. 2 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java
  15. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WechatCoreController.java
  16. 90 3
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleInfoService.java
  17. 21 17
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  18. 21 5
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseModuleRoleService.java
  19. 25 13
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/excelImport/BaseDoctorExcelDOReader.java
  20. 6 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgUserService.java
  21. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/OrgTree.java
  22. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/tree/SimpleTreeNode.java
  23. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java
  24. 20 16
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  25. 13 13
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java
  26. 6 0
      svr/svr-base/src/main/resources/application.yml
  27. 17 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java
  28. 60 3
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/base/user/UserDO.java

@ -59,7 +59,7 @@ public class UserDO extends UuidIdentityEntityWithOperator {
    private String  saasId;
    //平台角色标识(超管,租管,机管)
    private String  roleCode;
    private String roleId;
    public UserDO(){}
@ -203,11 +203,11 @@ public class UserDO extends UuidIdentityEntityWithOperator {
        this.saasId = saasId;
    }
    public String getRoleCode() {
        return roleCode;
    public String getRoleId() {
        return roleId;
    }
    @Column(name = "role_code",nullable = false)
    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode;
    @Column(name = "role_id",nullable = false)
    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }
}

+ 3 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -425,6 +425,9 @@ public class BaseRequestMapping {
    public static class BaseDoctorRoleInfo extends Basic {
        public static final String PREFIX  = "/baseDoctorRoleInfo";
        public static final String enableOrDis  = "/enableOrDis";
        public static final String checkRoleName  = "/checkRoleName";
        public static final String queryOne  = "/queryOne";
        public static final String moduleTree  = "/moduleTree";
    }
/**
     * 医生模块角色关联表

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/specialist/SpecialistMapping.java

@ -37,6 +37,7 @@ public class SpecialistMapping {
        public static final String findSpecialistSignFamilyPatientCout ="/findSpecialistSignFamilyPatientCout";
        public static final String getSpecialistSignFamilyPatientByName ="/getSpecialistSignFamilyPatientByName";
        public static final String getPatientAndDiseaseByDoctor ="/getPatientAndDiseaseByDoctor";
        public static final String searchPatientInSpecialist ="/searchPatientInSpecialist";

+ 9 - 6
gateway/ag-basic/src/main/resources/application.yml

@ -69,12 +69,12 @@ spring:
spring:
  profiles: jwtest
  datasource:
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
     url: jdbc:mysql://172.17.110.160/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
     username: ssgg
     password: ssgg
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
---
spring:
  profiles: jwprod
@ -82,5 +82,8 @@ spring:
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址

+ 6 - 3
server/svr-authentication/src/main/resources/application.yml

@ -39,9 +39,12 @@ spring:
spring:
  profiles: jwtest
  datasource:
    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: ssgg
    password: ssgg
#    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
#    username: ssgg
#    password: ssgg
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.

+ 6 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorRoleInfoDao.java

@ -18,4 +18,10 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @since 1.
 */
public interface BaseDoctorRoleInfoDao extends PagingAndSortingRepository<BaseDoctorRoleInfoDO, Integer>, JpaSpecificationExecutor<BaseDoctorRoleInfoDO>  {
    BaseDoctorRoleInfoDO findBySaasidAndName(String saasId,String name);
    boolean existsByCode(String code);
    BaseDoctorRoleInfoDO findByCode(String code);
}

+ 5 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseModuleRoleDao.java

@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Set;
@ -22,6 +23,8 @@ import java.util.Set;
 */
public interface BaseModuleRoleDao extends PagingAndSortingRepository<BaseModuleRoleDO, Integer>, JpaSpecificationExecutor<BaseModuleRoleDO>  {
    @Query("select id from BaseModuleRoleDO where id = ?1")
    Set<Object> findModuleIdList(Integer id);
    @Query("select id from BaseModuleRoleDO where roleCode = ?1")
    Set<Object> findModuleIdList(String id);
    List<BaseModuleRoleDO> findAllByRoleCode(String roleCode);
}

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/org/BaseOrgUserDao.java

@ -31,4 +31,6 @@ public interface BaseOrgUserDao extends PagingAndSortingRepository<BaseOrgUserDO
    @Query("select orgCode from BaseOrgUserDO where userId = ?1")
    Set<String> findorgCodeListByUserId(String userId);
    List<BaseOrgUserDO> findAllByUserId(String userId);
}

+ 9 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java

@ -54,6 +54,9 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private OrgTreeService orgTreeService;
    @Autowired
    private BaseDoctorExcelDOReader doctorExcelDOReader;
    @PostMapping(value = BaseRequestMapping.BaseDoctor.CREATE)
    @ApiOperation(value = "新增医生")
    public Envelop create(
@ -128,7 +131,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value = BaseRequestMapping.BaseDoctor.DOCINFO)
    @GetMapping(value = BaseRequestMapping.BaseDoctor.DOCINFO)
    @ApiOperation(value = "获取单个医生及其执业信息")
    public Envelop doctorHosplist(
            @ApiParam(name = "doctorId", value = "医生标识")
@ -172,7 +175,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value = BaseRequestMapping.BaseDoctor.docFullInfo)
    @GetMapping(value = BaseRequestMapping.BaseDoctor.docFullInfo)
    @ApiOperation(value = "获取医生基础信息列表")
    public PageEnvelop getDoctorFullInfolist(
            @ApiParam(name = "nameOrIdcard", value = "医生姓名或医生身份证号")
@ -269,11 +272,11 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
            HttpServletRequest request) throws IOException, ManageException {
        try {
            request.setCharacterEncoding("UTF-8");
            AExcelReader excelReader = new BaseDoctorExcelDOReader();
            excelReader.read(file);
//            AExcelReader excelReader = new BaseDoctorExcelDOReader();
            doctorExcelDOReader.read(file);
            //验证未通过(暂无验证)
            List<BaseDoctorExcelDO> errorLs = excelReader.getErrorLs();
            List<BaseDoctorExcelDO> correctLs = excelReader.getCorrectLs();
            List<BaseDoctorExcelDO> errorLs = doctorExcelDOReader.getErrorLs();
            List<BaseDoctorExcelDO> correctLs = doctorExcelDOReader.getCorrectLs();
            if(correctLs.size()>0){
                Map<String, Object> result = baseDoctorService.batchInsertDoctor(correctLs);
                result.put("errorLs", errorLs);

+ 34 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorRoleInfoEndpoint.java

@ -103,7 +103,7 @@ public class BaseDoctorRoleInfoEndpoint extends EnvelopRestEndpoint {
        return success(baseDoctorRoleInfos, BaseDoctorRoleInfoVO.class);
    }
    @GetMapping(value = BaseRequestMapping.BaseTeam.queryOne)
    @GetMapping(value = BaseRequestMapping.BaseDoctorRoleInfo.queryOne)
    @ApiOperation(value = "查询某一个角色")
    public Envelop getTeamById(
            @ApiParam(name = "roleId", value = "根据角色标识查询某一个角色信息")
@ -115,6 +115,20 @@ public class BaseDoctorRoleInfoEndpoint extends EnvelopRestEndpoint {
        return success(team.getJSONObject("msg"));
    }
    @GetMapping(value = BaseRequestMapping.BaseDoctorRoleInfo.moduleTree)
    @ApiOperation(value = "查询业务模块树形结构")
    public Envelop queryModuleTree(
            @ApiParam(name = "saasId", value = "租户id")
            @RequestParam(value = "saasId", required = true) String saasId,
            @ApiParam(name = "roleCode", value = "角色code")
            @RequestParam(value = "roleCode", required = false) String roleCode) throws Exception {
        JSONObject moduleTree = baseDoctorRoleInfoService.getModuleTreeBySaas(saasId,roleCode);
        if (moduleTree.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
            return failed(moduleTree.getString("msg"));
        }
        return success(moduleTree.get("msg"));
    }
    /**
     * 生效或失效某个角色
@ -138,4 +152,23 @@ public class BaseDoctorRoleInfoEndpoint extends EnvelopRestEndpoint {
        return success(jsonObject.getString("response"));
    }
    @GetMapping(value = BaseRequestMapping.BaseDoctorRoleInfo.checkRoleName)
    @ApiOperation(value = "检查角色名称是否可用(message=available代表可用,message=inavailable代表不可用)")
    public Envelop checkRoleName (
            @ApiParam(name = "saasid", value = "租户id", required = true)
            @RequestParam(value = "saasid", required = false) String saasid,
            @ApiParam(name = "name", value = "角色名称", required = true)
            @RequestParam(value = "name", required = false) String name) throws Exception {
        JSONObject jsonObject = baseDoctorRoleInfoService.existNameOfSaas(saasid, name);
        if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
            return failed(jsonObject.getString("msg"));
        }
        if(jsonObject.getBoolean("msg")){
            return success("available");
        }else{
            return success("inavailable");
        }
    }
}

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/org/BaseOrgEndpoint.java

@ -129,7 +129,7 @@ public class BaseOrgEndpoint extends EnvelopRestEndpoint {
    }
    @PostMapping(value = BaseRequestMapping.BaseOrg.baseInfoList)
    @GetMapping(value = BaseRequestMapping.BaseOrg.baseInfoList)
    @ApiOperation(value = "获取机构基础信息列表")
    public PageEnvelop queryBaseOrgInfolist(
            @ApiParam(name = "codeOrName", value = "机构名称或机构代码")
@ -185,7 +185,7 @@ public class BaseOrgEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value = BaseRequestMapping.BaseOrg.queryOrgCodeAndNameListBySaasId)
    @GetMapping(value = BaseRequestMapping.BaseOrg.queryOrgCodeAndNameListBySaasId)
    @ApiOperation(value = "查询机构代码和名称列表")
    public ListEnvelop queryOrgCodeAndNameList() throws Exception {
        return success(baseOrgService.findOrgListBySaasId(""));

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java

@ -71,7 +71,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
        return success(msg);
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.getPatientById)
    @GetMapping(value = BaseRequestMapping.BasePatient.getPatientById)
    @ApiOperation(value = "获取列表")
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
@ -111,7 +111,7 @@ public class BasePatientEndpoint extends EnvelopRestEndpoint {
        return success(basePatients, BasePatientVO.class);
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.getBaseInfo)
    @GetMapping(value = BaseRequestMapping.BasePatient.getBaseInfo)
    @ApiOperation(value = "获取居民基础信息列表")
    public ListEnvelop queryPatientBaseInfo(
            @ApiParam(name = "nameOrIdcard", value = "居民姓名或身份证")

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/team/BaseTeamEndpoint.java

@ -140,7 +140,7 @@ public class BaseTeamEndpoint extends EnvelopRestEndpoint {
        return success(team.getJSONArray("msg"));
    }
    @PostMapping(value = BaseRequestMapping.BaseTeam.teamInfoList)
    @GetMapping(value = BaseRequestMapping.BaseTeam.teamInfoList)
    @ApiOperation(value = "获取团队信息列表")
    public PageEnvelop queryBaseOrgInfolist(
            @ApiParam(name = "teamName", value = "团队名称")

+ 2 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/user/UserEndpoint.java

@ -135,7 +135,7 @@ public class UserEndpoint extends EnvelopRestEndpoint {
     * @return
     * @throws Exception
     */
    @PostMapping(value = BaseRequestMapping.User.queryOne)
    @GetMapping(value = BaseRequestMapping.User.queryOne)
    @ApiOperation(value = "获取单个用户信息")
    public Envelop doctorHosplist(
            @ApiParam(name = "id", value = "获取单个用户信息")
@ -233,6 +233,6 @@ public class UserEndpoint extends EnvelopRestEndpoint {
        if (jsonObject.getString("response").equalsIgnoreCase(ConstantUtils.FAIL)) {
            return failed(jsonObject.getString("msg"));
        }
        return success(jsonObject.getString("response"));
        return success(jsonObject.getString("msg"));
    }
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/wx/WechatCoreController.java

@ -187,7 +187,7 @@ public class WechatCoreController extends EnvelopRestEndpoint {
        return strDigest;
    }
    @RequestMapping(value ="test", method = RequestMethod.POST)
    @RequestMapping(value ="test", method = RequestMethod.GET)
    @ResponseBody
    public String  testProcess() throws Exception{
        return wechatCoreService.testProcess();

+ 90 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorRoleInfoService.java

@ -3,12 +3,14 @@ package com.yihu.jw.base.service.doctor;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.contant.CommonContant;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.dao.doctor.BaseModuleRoleDao;
import com.yihu.jw.base.dao.role.BaseRoleMenuDao;
import com.yihu.jw.base.dao.role.RoleDao;
import com.yihu.jw.base.dao.saas.SaasDao;
import com.yihu.jw.base.dao.user.UserDao;
import com.yihu.jw.base.service.module.SaasModuleService;
import com.yihu.jw.base.service.org.BaseOrgSaasService;
import com.yihu.jw.base.service.org.BaseOrgUserService;
import com.yihu.jw.base.service.org.OrgTree;
@ -18,10 +20,14 @@ import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleInfoDO;
import com.yihu.jw.entity.base.doctor.BaseModuleRoleDO;
import com.yihu.jw.entity.base.module.ModuleDO;
import com.yihu.jw.entity.base.module.SaasModuleDO;
import com.yihu.jw.entity.base.org.BaseOrgUserDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.restmodel.base.module.ModuleVO;
import com.yihu.jw.restmodel.base.module.SaasModuleVO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
@ -35,7 +41,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
/**
 * 
@ -67,10 +75,67 @@ public class BaseDoctorRoleInfoService extends BaseJpaService<BaseDoctorRoleInfo
    @Autowired
    private BaseModuleRoleService baseModuleRoleService;
    @Autowired
    private SaasModuleService saasModuleService;
    @Value("${configDefault.saasId}")
    private String defaultSaasId;
    /**
     * 获取租户下的模块列表
     * @param saasId
     */
    public JSONObject getModuleTreeBySaas(String saasId,String roleId) throws ParseException {
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(saasId) && StringUtils.isEmpty(roleId)){
            result.put("msg","parameter saasId and roleId are null ");
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        String filters = "status="+ ModuleDO.Status.available.getValue()+";";
        List<SaasModuleDO> modules = new ArrayList<>();
        if(!StringUtils.isEmpty(saasId) && StringUtils.isEmpty(roleId)){
            filters += "saasId="+saasId;
            modules = saasModuleService.search(null, filters, null);
        }else if(!StringUtils.isEmpty(saasId) && !StringUtils.isEmpty(roleId)){
            Set<Object> moduleIdSet = new HashSet<>();
            moduleIdSet = baseModuleRoleService.findModuleIdList(roleId);
            if(moduleIdSet.size() < 0){
                result.put("msg","no modules under this role:" + roleId);
                result.put("response",ConstantUtils.FAIL);
            }
            StringBuilder sb = new StringBuilder();
            moduleIdSet.forEach(one -> sb.append(one).append(","));
            filters += "id=" + sb.toString();
            modules = saasModuleService.search(null, filters, null);
        }
        List<SaasModuleVO> moduleVOs = convertToModels(modules,new ArrayList<>(modules.size()),SaasModuleVO.class);
        List<ModuleVO> moduleVOList = new ArrayList<>(moduleVOs.size());
        //转化为module
        moduleVOs.forEach(one->{
            ModuleVO vo = new ModuleVO();
            vo.setId(one.getModuleId());
            vo.setParentId(one.getParentModuleId());
            vo.setIsMust(one.getIsMust());
            vo.setName(one.getName());
            moduleVOList.add(vo);
        });
        List<ModuleVO> moduleVOList2 = moduleVOList;
        Map<String,List<ModuleVO>> map = moduleVOList2.stream().collect(Collectors.groupingBy(ModuleVO::getParentId));
        moduleVOList2.forEach(module->{
            List<ModuleVO> tmp = map.get(module.getId());
            module.setChildren(tmp);
        });
        moduleVOList2 = moduleVOList2.stream()
                .filter(module -> CommonContant.DEFAULT_PARENTID.equals(module.getParentId()))
                .collect(Collectors.toList());
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",moduleVOList2);
        return result;
    }
    /**
     * 创建角色信息
     *
@ -172,7 +237,7 @@ public class BaseDoctorRoleInfoService extends BaseJpaService<BaseDoctorRoleInfo
        this.save(roleInfoDO);
        //修改角色与模块关联关系
        Set<Object> roleIdList = baseModuleRoleService.findModuleIdList(roleInfoDO.getId());
        Set<Object> roleIdList = baseModuleRoleService.findModuleIdList(roleInfoDO.getCode());
        BaseModuleRoleDO moduleRoleDO = null;
        try {
            for (Object obj : module) {
@ -218,9 +283,12 @@ public class BaseDoctorRoleInfoService extends BaseJpaService<BaseDoctorRoleInfo
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        List<BaseModuleRoleDO> moduleRoleDOList =  baseModuleRoleService.findModuleListByRoleCode(roleInfoDO.getCode());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("role",roleInfoDO);
        jsonObject.put("module",moduleRoleDOList);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",roleInfoDO);
        result.put("msg",jsonObject);
        return result;
    }
@ -251,6 +319,25 @@ public class BaseDoctorRoleInfoService extends BaseJpaService<BaseDoctorRoleInfo
        return result;
    }
    /**
     * 判断某一租户下角色名称是否存在
     * @param saasId
     * @param name
     * @return
     */
    public JSONObject existNameOfSaas(String saasId,String name){
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(saasId) || StringUtils.isEmpty(name)){
            result.put("msg","parameter saasId or name is null");
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        BaseDoctorRoleInfoDO roleInfoDO = baseDoctorRoleInfoDao.findBySaasidAndName(saasId,name);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",null == roleInfoDO);
        return result;
    }
}

+ 21 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -8,6 +8,8 @@ import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
import com.yihu.jw.base.service.dict.DictHospitalDeptService;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
@ -27,6 +29,7 @@ import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleInfoDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.mysql.query.BaseJpaService;
@ -90,6 +93,10 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    @Autowired
    private DictHospitalDeptService dictHospitalDeptService;
    @Autowired
    private BaseDoctorRoleDao doctorRoleDao;
    @Autowired
    private BaseDoctorRoleInfoDao doctorRoleInfoDao;
    /**
@ -645,24 +652,21 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                    doctorHospitalList.add(doctorHospitalDO);
                }
                doctorHospitalDao.save(doctorHospitalList);
                if(!StringUtils.isEmpty(one.getRoleInfo())){
                    BaseDoctorRoleDO baseDoctorRoleDO = null;
                    DictJobTitleDO dictJobTitleDO = null;
                    String[] roles = one.getRoleInfo().split(";");
                    List<BaseDoctorRoleDO> baseDoctorRoleDOList = new ArrayList<>();
                    for(String role:roles){
                        String[] element = role.split(",");
                        String roleCode = element[0];
                        dictJobTitleDO = jobTitleDao.findByCode(roleCode);
                        baseDoctorRoleDO = new BaseDoctorRoleDO();
                        baseDoctorRoleDO.setDoctorCode(baseDoctorDO.getId());
//                        baseDoctorRoleDO.setRoleModuleCode(dictJobTitleDO.getCode());
//                        baseDoctorRoleDO.setName(dictJobTitleDO.getName());
//                        baseDoctorRoleDO.setDel("1");
                        baseDoctorRoleDOList.add(baseDoctorRoleDO);
                    }
                    baseDoctorRoleService.batchInsert(baseDoctorRoleDOList);
            }
            if(!StringUtils.isEmpty(one.getRoleInfo())){
                BaseDoctorRoleDO baseDoctorRoleDO = null;
                String[] roles = one.getRoleInfo().split(";");
                List<BaseDoctorRoleDO> baseDoctorRoleDOList = new ArrayList<>();
                for(String role:roles){
                    String[] element = role.split(",");
                    String roleCode = element[0];
                    baseDoctorRoleDO = new BaseDoctorRoleDO();
                    baseDoctorRoleDO.setDoctorCode(baseDoctorDO.getId());
                    baseDoctorRoleDO.setRoleCode(roleCode);
                    baseDoctorRoleDOList.add(baseDoctorRoleDO);
                }
                baseDoctorRoleService.batchInsert(baseDoctorRoleDOList);
            }
        }
        result.put("correctCount", doctors.size());

+ 21 - 5
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseModuleRoleService.java

@ -8,7 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.xml.ws.Action;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@ -31,17 +33,31 @@ public class BaseModuleRoleService extends BaseJpaService<BaseModuleRoleDO, Base
    /**
     * 根据角色id获取角色对应的模块Id列表
     * 根据角色code获取角色对应的模块Id列表
     *
     * @param roleId
     * @param roleCode
     * @return
     */
    public Set<Object> findModuleIdList(Integer roleId) {
    public Set<Object> findModuleIdList(String roleCode) {
        Set<Object> result = new HashSet<>();
        if (null == roleId) {
        if (null == roleCode) {
            return result;
        }
        return baseModuleRoleDao.findModuleIdList(roleId);
        return baseModuleRoleDao.findModuleIdList(roleCode);
    }
    /**
     * 根据角色code获取角色对应的模块列表
     *
     * @param roleCode
     * @return
     */
    public List<BaseModuleRoleDO> findModuleListByRoleCode(String roleCode) {
        List<BaseModuleRoleDO> result = new ArrayList<>();
        if (null == roleCode) {
            return result;
        }
        return baseModuleRoleDao.findAllByRoleCode(roleCode);
    }
}

+ 25 - 13
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/excelImport/BaseDoctorExcelDOReader.java

@ -3,6 +3,7 @@ package com.yihu.jw.base.service.doctor.excelImport;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.dao.org.BaseOrgDao;
import com.yihu.jw.base.endpoint.common.excel.AExcelReader;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
@ -11,6 +12,8 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.*;
@ -18,6 +21,7 @@ import java.util.*;
 * 医生信息列表-excel解析类
 * Created by 刘文彬 on 2018/10/24.
 */
@Component
public class BaseDoctorExcelDOReader extends AExcelReader {
    @Autowired
    private BaseOrgDao baseOrgDao;
@ -27,6 +31,8 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
    private DictDoctorDutyDao dutyDao;
    @Autowired
    private DictJobTitleDao jobTitleDao;
    @Autowired
    private BaseDoctorRoleInfoDao roleInfoDao;
    @Override
    public void read(Workbook rwb) throws Exception {
@ -91,19 +97,19 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
                String[] element = hospital.split("/");
                String[] org = element[0].split(",");//机构
                String[] dept = element[1].split(",");//部门
                String[] duty = element[1].split(",");//职务
                String[] duty = element[2].split(",");//职务
                String orgCode = org[0];
                String deptCode = dept[0];
                String dutyCode = duty[0];
//                if(!baseOrgDao.existsByCode(orgCode)){
//                    return 0;
//                }
//                if(!deptDao.existsByCodeAndOrgCode(deptCode,orgCode)){
//                    return 0;
//                }
//                if(!dutyDao.existsByCode(dutyCode)){
//                    return 0;
//                }
                if(!baseOrgDao.existsByCode(orgCode)){
                    return 0;
                }
                if(!deptDao.existsByCodeAndOrgCode(deptCode,orgCode)){
                    return 0;
                }
                if(!dutyDao.existsByCode(dutyCode)){
                    return 0;
                }
            }
        }
        if(StringUtils.isNotEmpty(baseDoctorExcelDO.getRoleInfo())){
@ -111,11 +117,17 @@ public class BaseDoctorExcelDOReader extends AExcelReader {
            for(String role:roles){
                String[] element = role.split(",");
                String roleCode = element[0];
//                if(jobTitleDao.existsByCode(roleCode)){
//                    return 0;
//                }
                if(!roleInfoDao.existsByCode(roleCode)){
                    return 0;
                }
            }
        }
        if(StringUtils.isEmpty(baseDoctorExcelDO.getIdcard())){
            return 0;
        }
        if(StringUtils.isEmpty(baseDoctorExcelDO.getMobile())){
            return 0;
        }
        return rs;
    }
}

+ 6 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgUserService.java

@ -36,6 +36,12 @@ public class BaseOrgUserService extends BaseJpaService<BaseOrgUserDO, BaseOrgUse
    }
    public List<BaseOrgUserDO> findAllByUserId(String userId) {
        List<BaseOrgUserDO> result = new ArrayList<>();
        return StringUtils.isEmpty(userId) ? result : baseOrgUserDao.findAllByUserId(userId);
    }
    /**
     * 根据用户标识获取用户关联的机构Id列表
     *

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/OrgTree.java

@ -63,7 +63,7 @@ public class OrgTree extends IntegerIdentityEntity implements TreeNode {
    @Override
    public Integer extractLevel() {
        return this.level;
        return getLevel();
    }
    @Override

+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/tree/SimpleTreeNode.java

@ -20,7 +20,7 @@ public class SimpleTreeNode {
    private int orderNum;
    //节点所在的层级
    @JSONField(ordinal=5)
    private int level;
    private Integer level;
    //节点是否被选中
    @JSONField(ordinal=6)
    private boolean checked;
@ -62,10 +62,10 @@ public class SimpleTreeNode {
    public void setParentNodeId(String parentNodeId) {
        this.parentNodeId = parentNodeId;
    }
    public int getLevel() {
    public Integer getLevel() {
        return level;
    }
    public void setLevel(int level) {
    public void setLevel(Integer level) {
        this.level = level;
    }
    public SimpleTreeNode getParent() {

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasService.java

@ -349,7 +349,7 @@ public class SaasService extends BaseJpaService<SaasDO, SaasDao> {
            }
            user.setPassword(MD5.md5Hex(password + "{" + user.getSalt() + "}"));
            user.setSaasId(saas.getId());
            user.setRoleCode(roleCode);
            user.setRoleId(roleCode);
            user = userDao.save(user);
        } else {
            userDO.setSaasId(saas.getId());

+ 20 - 16
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -162,7 +162,7 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        Map<String, Object> userinfo = new HashedMap();
        UserDO user = userDao.findOne(id);
        RoleDO role = roleDao.findByCode(user.getRoleCode());
        RoleDO role = roleDao.findByCode(user.getRoleId());
        userinfo.put("id", user.getId());
        userinfo.put("name", user.getName());
@ -340,7 +340,6 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                    if (roleIdList.contains(orgUserDO.getId())) {
                        roleIdList.remove(orgUserDO.getId());
                    }
                    orgUserDO.setUserId(userDO.getId());
                    baseOrgUserService.save(orgUserDO);
                }
            } catch (IOException e) {
@ -379,9 +378,13 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
            result.put("response",ConstantUtils.FAIL);
            return result;
        }
        //用户关联的机构
        List<BaseOrgUserDO>  orgList = baseOrgUserService.findAllByUserId(user.getId());
        JSONObject userInfo = new JSONObject();
        userInfo.put("user",user);
        userInfo.put("org",orgList);
        result.put("response",ConstantUtils.SUCCESS);
        result.put("msg",user);
        result.put("msg",userInfo);
        return result;
    }
@ -392,11 +395,11 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
     * @param userId
     * @return
     */
    public JSONObject generateUserOrgTree(String saasid,String userId,String roleCode) throws IOException {
    public JSONObject generateUserOrgTree(String saasid,String userId,String roleId) throws IOException {
        JSONObject result = new JSONObject();
        List<OrgTree> orgList = new ArrayList<>();
        // 有归属租户加载saas底下的所有机构树列表,角色为机构管理员时不需要选管理机构
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleCode)){
        if(!StringUtils.isEmpty(saasid) && !StringUtils.endsWithIgnoreCase(RoleDO.BaseRoleType.admin.toString(),roleId)){
            StringBuilder sql = new StringBuilder("SELECT " +
                    "  tree.* " +
                    " FROM " +
@ -409,7 +412,8 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                    " and  (tree.code = org.code or tree.code = org.province_code or tree.code = org.city_code or tree.code = town_code) " +
                    " ORDER BY tree.name;");
            orgList = jdbcTemplate.query(sql.toString().replace("{saasid}",saasid),new BeanPropertyRowMapper(OrgTree.class));
        } else if(!StringUtils.isEmpty(userId)){// 用户不为空表示修改,需要筛选出用户已经选择过的机构,设置checked为true
        }
        if(!StringUtils.isEmpty(userId)){// 用户不为空表示修改,需要筛选出用户已经选择过的机构,设置checked为true
            Set<String> codeSet = baseOrgUserService.findorgCodeListByUserId(userId);
            orgList.forEach( one -> {
                if(codeSet.contains(one.getCode())){
@ -502,19 +506,19 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
     * 用户信息列表
     * @param name
     * @param saasid
     * @param roleCode
     * @param roleId
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    public JSONObject userInfoList(String name,String saasid,String roleCode,int page,int size) throws Exception {
    public JSONObject userInfoList(String name,String saasid,String roleId,int page,int size) throws Exception {
        JSONObject result = new JSONObject();
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
        String realName = null == name ? "" : name;
        String saasidValue = null == saasid ? "" : saasid;
        String roleCodeValue = null == roleCode ? "" : roleCode;
        String roleIdValue = null == roleId ? "" : roleId;
        String sql = "SELECT " +
                "  user.id as id, " +
@ -531,16 +535,16 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                " WHERE " +
                "  user.saas_id = saas.id " +
                "  AND " +
                "  user.role_code = role.code " +
                "  user.role_id = role.id " +
                " and (user.name like '{realName}' or '' ='{realName}') " +
                "  and (saas.id = '{saasid}' or '' = '{saasid}') " +
                "  and ( user.role_code = '{roleCode}' or '' = '{roleCode}') " +
                "  and ( user.role_id = '{roleId}' or '' = '{roleId}') " +
                " ORDER BY user.create_time DESC" +
                "  limit {start},{end} ";
        String finalSql = sql
                .replace("{realName}","%" + realName + "%")
                .replace("{saasid}",saasidValue)
                .replace("{roleCode}",roleCodeValue)
                .replace("{roleId}",roleIdValue)
                .replace("{start}",String.valueOf(start))
                .replace("{end}",String.valueOf(end));
@ -553,14 +557,14 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
                "WHERE " +
                "  user.saas_id = saas.id " +
                "  AND " +
                "  user.role_code = role.code " +
                "  user.role_id = role.id " +
                " and (user.name like '{realName}' or '' ='{realName}') " +
                "  and (saas.id = '{saasid}' or '' = '{saasid}') " +
                "  and ( user.role_code = '{roleCode}' or '' = '{roleCode}') ";
                "  and ( user.role_id = '{roleId}' or '' = '{roleId}') ";
        String finalCountSql = countSql
                .replace("{realName}", "%" + realName + "%")
                .replace("{saasid}",  saasidValue )
                .replace("{roleCode}",  roleCodeValue );
                .replace("{roleId}",  roleIdValue );
        List<Map<String, Object>> list = jdbcTemplate.queryForList(finalSql);
        Integer count = jdbcTemplate.queryForObject(finalCountSql, Integer.class);

+ 13 - 13
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java

@ -27,7 +27,7 @@ import java.util.Map;
import java.util.UUID;
/**
 * Created by trick on 2017/5/20 0020
 * Created by trick on 2017/5/20
 */
@Service
@Transactional
@ -65,21 +65,21 @@ public class WechatService {
                " w.type, " +
                " w.public_type AS publicType," +
                " w.token," +
                " w.encType," +
                " w.enc_type AS encType," +
                " w.type," +
                " w.appId," +
                " w.appSecret," +
                " w.appOriginId," +
                " w.baseUrl," +
                " w.userName," +
                " w.app_id AS appId," +
                " w.app_secret AS appSecret," +
                " w.app_origin_id AS appOriginId," +
                " w.base_url AS baseUrl," +
                " w.user_name AS userName," +
                " w.password," +
                " w.remark," +
                " w.createTime," +
                " w.createUser," +
                " w.createUserName," +
                " w.updateTime," +
                " w.updateUser," +
                " w.updateUserName" +
                " w.create_time AS createTime," +
                " w.create_user AS createUser," +
                " w.create_user_name AS createUserName," +
                " w.update_time AS updateTime," +
                " w.update_user AS updateUser," +
                " w.update_user_name AS updateUserName" +
                " FROM " +
                " wx_wechat w ";
        if (StringUtils.isNotBlank(saasName)) {

+ 6 - 0
svr/svr-base/src/main/resources/application.yml

@ -72,6 +72,9 @@ configDefault: # 默认配置
spring:
  profiles: jwdev
  datasource:
#    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#    username: ssgg
#    password: ssgg
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
@ -103,6 +106,9 @@ jw:
spring:
  profiles: jwtest
  datasource:
#    url: jdbc:mysql://172.17.110.160/base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#    username: ssgg
#    password: ssgg
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456

+ 17 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -371,4 +371,21 @@ public class SpecialistController extends EnvelopRestEndpoint {
//            return Envelop.getError(e.getMessage());
//        }
//    }
    @GetMapping(value = SpecialistMapping.specialist.searchPatientInSpecialist)
    @ApiOperation(value = "搜索注册居民")
    public MixEnvelop searchPatientInSpecialist(
            @ApiParam(name = "doctorCode", value = "医生code",required = true) @RequestParam(required = true)String doctorCode,
            @ApiParam(name = "keywords", value = "居民姓名,手机号,身份证") @RequestParam(required = false)String keywords,
            @ApiParam(name = "page", value = "第几页,1开始",defaultValue = "1") @RequestParam(required = true,defaultValue = "1")Integer page,
            @ApiParam(name = "pageSize", value = "每页大小",defaultValue = "5") @RequestParam(required = true,defaultValue = "5")Integer pageSize){
        try {
            return specialistService.searchPatientInSpecialist(doctorCode,keywords,page,pageSize);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 60 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -4,7 +4,9 @@ import com.yihu.jw.dao.*;
import com.yihu.jw.entity.specialist.*;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.specialist.*;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -14,9 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by Trick on 2018/4/25.
@ -768,4 +768,61 @@ public class SpecialistService{
//        specialistConsultDao.save(consultDO);
//        return Envelop.getSuccess(SpecialistMapping.api_success,true);
//    }
    /**
     * 专科-模糊搜索注册居民
     * @param doctorCode
     * @param keywords
     */
    public MixEnvelop searchPatientInSpecialist(String doctorCode,String keywords,Integer page,Integer pageSize) throws Exception{
        String sql1 = " select count(1) as num ";
        String sql2 = " select p.name as name,p.idcard,p.code,p.photo ";
        String whereSql ="";
        if(!StringUtils.isEmpty(keywords)){
            whereSql+=" and (p.name like '%"+keywords+"%' or p.idcard like '%"+keywords+"%' or p.mobile like '%"+keywords+"%') ";
        }
        String centerSql =" from "+basedb+".wlyy_patient p " +
                " LEFT JOIN wlyy_specialist.wlyy_specialist_patient_relation r on p.code=r.patient and sign_status='1' and doctor='"+doctorCode+"'"+
                " where r.id is not null "+whereSql;
        String sqlCount=sql1+centerSql;
        String sql=sql2+centerSql+" LIMIT "+(page-1)*pageSize+","+pageSize;
        List<Map<String,Object>> map = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> countMap = jdbcTemplate.queryForList(sqlCount);
        List<Map<String,Object>> resultList = new ArrayList<>();
        Map m = null;
        Integer age = null;
        String sex = null;
        String sexName="";
        for(Map<String,Object> one:map){
            m = new HashMap();
            age = IdCardUtil.getAgeForIdcard(one.get("idcard")+"");
            sex = IdCardUtil.getSexForIdcard_new(one.get("idcard")+"");
            m.put("name",one.get("name"));
            m.put("age",age);
            m.put("sex",sex);
            if("1".equals(sex)){
                sexName="男";
            }else if("2".equals(sex)){
                sexName="女";
            }else{
                sexName="未知";
            }
            m.put("sexName",sexName);
            m.put("patientCode",one.get("code"));
            m.put("photo",one.get("photo"));
            resultList.add(m);
        }
        return MixEnvelop.getSuccessListWithPage(SpecialistMapping.api_success,resultList,page,pageSize,countMap.size()>0?Long.valueOf(countMap.get(0).get("num")+""):0);
    }
    /**
     * 医生的专科信息
     * @param doctor
     */
    public ObjEnvelop doctorForSpecialistInfo(String doctor){
        Map<String,Object> resultMap = new HashMap<>();
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,resultMap);
    }
}