Преглед на файлове

Merge branch 'dev' of yeshijie/wlyy2.0 into dev

叶仕杰 преди 4 години
родител
ревизия
2d3ab0aa23

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/area/dao/BaseCityDao.java

@ -28,5 +28,7 @@ public interface BaseCityDao extends PagingAndSortingRepository<BaseCityDO, Inte
    @Query("select code,name from BaseCityDO")
    List<BaseCityDO> getAllCity();
    @Query("select a from BaseCityDO a where a.province = ?1 order by id")
    Iterable<BaseCityDO> findByProvince(String province);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -46,6 +46,8 @@ public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String
    List<BaseOrgDO> findByCityCode(String cityCode);
    List<BaseOrgDO> findByTownCode(String townCode);
    List<BaseOrgDO> findByCityCodeAndOrgLevel(String cityCode,Integer level);
    List<BaseOrgDO> findByDel(String del);

+ 131 - 0
svr/svr-door-serivce/sql/初始sql.sql

@ -570,6 +570,137 @@ CREATE TABLE `wlyy_sign_family` (
  KEY `idx_type` (`type`,`status`,`expenses_status`,`apply_date`,`sign_year`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='家庭签约/三师签约';
CREATE TABLE `wlyy_doctor_registration_temp` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '业务无关主键',
  `code` varchar(50) NOT NULL COMMENT '二级模板标识',
  `doctor` varchar(50) DEFAULT NULL COMMENT '医生标识',
  `registration` varchar(50) DEFAULT NULL COMMENT '一级模板标识',
  `content` text COMMENT '服务登记内容',
  `send_times` int(11) DEFAULT NULL COMMENT '发送次数',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `last_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '最后一次发送时间',
  PRIMARY KEY (`id`),
  KEY `idx_code` (`code`) USING BTREE,
  KEY `idx_owner` (`doctor`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='医生登记服务模板表';
CREATE TABLE `wlyy_doctor_registration` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `code` varchar(50) NOT NULL COMMENT '登记服务一级模板编码',
  `model_name` varchar(50) DEFAULT NULL COMMENT '模板名称',
  `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  `is_hide` int(2) NOT NULL DEFAULT '0' COMMENT '是否隐藏 0 隐藏 1不隐藏',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('1', '1', '主诉记录', '2019-03-14 10:14:07', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('2', '2', '现病史', '2019-03-14 10:14:24', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('3', '3', '既往史、个人史、家族史', '2019-03-14 10:15:25', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('4', '4', '体格检查', '2019-03-14 10:15:49', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('5', '5', '既往辅助检查', '2019-03-14 10:16:09', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('6', '6', '诊断记录', '2019-03-14 10:16:23', '0');
INSERT INTO `wlyy_doctor_registration` (`id`, `code`, `model_name`, `create_time`, `is_hide`) VALUES ('7', '7', '治疗情况', '2019-03-14 10:16:38', '0');
INSERT INTO `base`.`base_doctor_role_dict` ( `code`, `name`, `del`, `create_user`, `create_user_name`, `create_time`, `update_user`, `update_user_name`, `update_time`) VALUES ( 'dispatcher', '调度员', '1', 'admin', '系统默认', '2020-12-29 11:38:31', NULL, NULL, '2020-12-29 11:38:26');
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('1', NULL, 'PROFESSIONAL_STATE', '0', '工单--患者职业', '国家机关、党群组织、企业、事业单位负责人', '1', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('2', NULL, 'PROFESSIONAL_STATE', '1', '1', '专业技术人员', '2', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('3', NULL, 'PROFESSIONAL_STATE', '2', '1', '办事人员和有关人员', '3', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('4', NULL, 'PROFESSIONAL_STATE', '3', '1', '商业、服务业人员', '4', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('5', NULL, 'PROFESSIONAL_STATE', '4', '1', '农、林、牧、渔、水利业生产人员', '5', '');
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('6', NULL, 'PROFESSIONAL_STATE', '5', '1', '生产、运输设备操作人员及有关人员', '6', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('7', NULL, 'PROFESSIONAL_STATE', '6', '1', '军人', '7', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('8', NULL, 'PROFESSIONAL_STATE', '7', '1', '不便分类的其他从业人员', '8', NULL);
INSERT INTO `base`.`base_system_dict_entry` (`id`, `saas_id`, `dict_code`, `code`, `py_code`, `value`, `sort`, `remark`) VALUES ('9', NULL, 'PROFESSIONAL_STATE', '8', '1', '无职业', '9', NULL);
DROP TABLE IF EXISTS `zy_nation_dict`;
CREATE TABLE `zy_nation_dict` (
  `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `ORG_ID` int(11) DEFAULT NULL,
  `NATION_CODE` varchar(3) DEFAULT NULL COMMENT '民族编码',
  `NATION_NAME` varchar(50) DEFAULT NULL COMMENT '民族名称',
  `VALID_FLAG` varchar(2) DEFAULT NULL,
  `USER_CODE` varchar(50) DEFAULT NULL,
  `CUSTOM_CODE` varchar(50) DEFAULT NULL,
  `SPELL_CODE` varchar(50) DEFAULT NULL,
  `WBZX_CODE` varchar(50) DEFAULT NULL,
  `SORT_NO` varchar(50) DEFAULT NULL,
  `CREATE_TIME` datetime DEFAULT NULL,
  `CREATE_OPERATOR` varchar(50) DEFAULT NULL,
  `MODIFY_TIME` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `MODIFY_OPERATOR` varchar(50) DEFAULT NULL,
  `REMARK` varchar(50) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of zy_nation_dict
-- ----------------------------
INSERT INTO `zy_nation_dict` VALUES ('1', '0', '1', '汉族', '1', '', '', 'HZ', 'IY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('2', '0', '2', '蒙古族', '1', '', '', 'MGZ', 'ADY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('3', '0', '3', '回族', '1', '', '', 'HZ', 'LY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('4', '0', '4', '藏族', '1', '', '', 'CZ', 'AY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('5', '0', '5', '维吾尔族', '1', '', '', 'WWEZ', 'XGQY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('6', '0', '6', '苗族', '1', '', '', 'MZ', 'AY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('7', '0', '7', '彝族', '1', '', '', 'YZ', 'XY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('8', '0', '8', '壮族', '1', '', '', 'ZZ', 'UY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('9', '0', '9', '布依族', '1', '', '', 'BYZ', 'DWY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('10', '0', '10', '朝鲜族', '1', '', '', 'CXZ', 'FQY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('11', '0', '11', '满族', '1', '', '', 'MZ', 'IY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('12', '0', '12', '侗族', '1', '', '', 'DZ', 'WY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('13', '0', '13', '瑶族', '1', '', '', 'YZ', 'GY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('14', '0', '14', '白族', '1', '', '', 'BZ', 'RY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('15', '0', '15', '土家族', '1', '', '', 'TJZ', 'FPY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('16', '0', '16', '哈尼族', '1', '', '', 'HNZ', 'KNY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('17', '0', '17', '哈萨克族', '1', '', '', 'HSKZ', 'KADY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('18', '0', '18', '傣族', '1', '', '', 'DZ', 'WY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('19', '0', '19', '黎族', '1', '', '', 'LZ', 'TY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('20', '0', '20', '傈僳族', '1', '', '', 'LSZ', 'WWY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('21', '0', '21', '佤族', '1', '', '', 'WZ', 'WY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('22', '0', '22', '畲族', '1', '', '', 'SZ', 'WY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('23', '0', '23', '高山族', '1', '', '', 'GSZ', 'YMY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('24', '0', '24', '拉祜族', '1', '', '', 'LBZ', 'RPY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('25', '0', '25', '水族', '1', '', '', 'SZ', 'IY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('26', '0', '26', '东乡族', '1', '', '', 'DXZ', 'AXY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('27', '0', '27', '纳西族', '1', '', '', 'NXZ', 'XSY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('28', '0', '28', '景颇族', '1', '', '', 'JPZ', 'JHY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('29', '0', '29', '柯尔克孜族', '1', '', '', 'KEKZZ', 'SQDBY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('30', '0', '30', '土族', '1', '', '', 'TZ', 'FY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('31', '0', '31', '达斡尔族', '1', '', '', 'DHEZ', 'DFQY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('32', '0', '32', '仫佬族', '1', '', '', 'MLZ', 'WWY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('33', '0', '33', '羌族', '1', '', '', 'QZ', 'UY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('34', '0', '34', '布朗族', '1', '', '', 'BLZ', 'DYY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('35', '0', '35', '撒拉族', '1', '', '', 'SLZ', 'RRY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('36', '0', '36', '毛南族', '1', '', '', 'MNZ', 'TFY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('37', '0', '37', '仡佬族', '1', '', '', 'GLZ', 'WWY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('38', '0', '38', '锡伯族', '1', '', '', 'XBZ', 'QWY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('39', '0', '39', '阿昌族', '1', '', '', 'ACZ', 'BJY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('40', '0', '40', '普米族', '1', '', '', 'PMZ', 'UOY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('41', '0', '41', '塔吉克族', '1', '', '', 'TJKZ', 'FFDY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('42', '0', '42', '怒族', '1', '', '', 'NZ', 'VY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('43', '0', '43', '乌孜别克族', '1', '', '', 'WZBKZ', 'QBKDY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('44', '0', '44', '俄罗斯族', '1', '', '', 'ELSZ', 'WLAY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('45', '0', '45', '鄂温克族', '1', '', '', 'EWKZ', 'KIDY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('46', '0', '46', '德昂族', '1', '', '', 'DAZ', 'TJY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('47', '0', '47', '保安族', '1', '', '', 'BAZ', 'WPY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('48', '0', '48', '裕固族', '1', '', '', 'YGZ', 'PLY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('49', '0', '49', '京族', '1', '', '', 'JZ', 'YY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('50', '0', '50', '塔塔尔族', '1', '', '', 'TTEZ', 'FFQY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('51', '0', '51', '独龙族', '1', '', '', 'DLZ', 'QDY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('52', '0', '52', '鄂伦春族', '1', '', '', 'ELCZ', 'KWDY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('53', '0', '53', '赫哲族', '1', '', '', 'HZZ', 'FRY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('54', '0', '54', '门巴族', '1', '', '', 'MBZ', 'UCY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('55', '0', '55', '珞巴族', '1', '', '', 'LBZ', 'CY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('56', '0', '56', '基诺族', '1', '', '', 'JNZ', 'AYY', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('57', '0', '99', '其他', '1', '', '', 'QT', 'AW', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('58', '0', '57', '穿青人', '1', '', '57', 'CQZ', 'CQZ', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('59', '0', '58', 'Turkish', '1', '', '', 'teq', 'Turkish', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('60', '0', '59', 'BRITAIN', '1', '', '', 'BRITISH', 'BRITAIN', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('61', '0', '60', 'AUSTRALIAN', '1', '', '', 'AUSTRALIAN', 'AUSTRALIAN', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('62', '0', '61', '/', '1', '', '', '/', '/', '0', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('63', '0', '63', 'Ukrainian', '1', '', '', 'Ukrainian', 'Ukrainian', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('64', '0', '101', '亻革家人', '1', '', '', 'RGJR', '', '', null, '', null, '', '');
INSERT INTO `zy_nation_dict` VALUES ('65', '0', '62', '山由族', '1', '', '', 'SYZ', 'MMY', '', null, '', null, '', '');

+ 160 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/common/DistrictController.java

@ -0,0 +1,160 @@
package com.yihu.jw.door.controller.common;
import com.yihu.jw.area.dao.BaseCityDao;
import com.yihu.jw.area.dao.BaseProvinceDao;
import com.yihu.jw.area.dao.BaseStreetDao;
import com.yihu.jw.area.dao.BaseTownDao;
import com.yihu.jw.door.controller.BaseController;
import com.yihu.jw.entity.base.area.BaseCityDO;
import com.yihu.jw.entity.base.area.BaseProvinceDO;
import com.yihu.jw.entity.base.area.BaseStreetDO;
import com.yihu.jw.entity.base.area.BaseTownDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
 * Created by yeshijie on 2020/12/30.
 */
@RestController
@RequestMapping(value = "common", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "省市区三级地址")
public class DistrictController extends BaseController {
    @Autowired
    private BaseProvinceDao provinceDao;
    @Autowired
    private BaseCityDao cityDao;
    @Autowired
    private BaseTownDao townDao;
    @Autowired
    private BaseStreetDao streetDao;
    @Autowired
    private BaseOrgDao orgDao;
    /**
     * 省市一二三级查询接口
     * @param type 1一级目录,2二级目录,3三级目录,4街道目录
     * @param code 省或市标识
     * @return
     */
    @RequestMapping(value = "district",method = RequestMethod.POST)
    @ResponseBody
    public String district(int type, String code) {
        try {
            List<?> list = null;
            switch (type) {
                case 1:
                    list =  findProvince();
                    break;
                case 2:
                    list = findCity(code);
                    break;
                case 3:
                    list = findTown(code);
                    break;
                case 4:
                    list = findStreet(code);
                    break;
                case 5:
                    list = findHospital(code);
                    break;
            }
            return write(200, "查询成功!", "list", list);
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    /**
     * 查询所有的省份信息
     * @return
     */
    public List<BaseProvinceDO> findProvince() {
        List<BaseProvinceDO> list = new ArrayList<>();
        Iterable<BaseProvinceDO> iterable = provinceDao.findAll(new Sort(Direction.ASC, "id"));
        if (iterable != null) {
            Iterator<BaseProvinceDO> it = iterable.iterator();
            while (it != null && it.hasNext()) {
                list.add(it.next());
            }
        }
        return list;
    }
    /**
     * 查询省份下的城市信息
     * @param province 省编码
     * @return
     */
    public List<BaseCityDO> findCity(String province) {
        List<BaseCityDO> list = new ArrayList<>();
        Iterable<BaseCityDO> iterable = cityDao.findByProvince(province);
        if (iterable != null) {
            Iterator<BaseCityDO> it = iterable.iterator();
            while (it != null && it.hasNext()) {
                list.add(it.next());
            }
        }
        return list;
    }
    /**
     * 查询城市下的区县信息
     * @param city 城市编码
     * @return
     */
    public List<BaseTownDO> findTown(String city) {
        List<BaseTownDO> list = new ArrayList<>();
        Iterable<BaseTownDO> iterable = townDao.findByCityCode(city);
        if (iterable != null) {
            Iterator<BaseTownDO> it = iterable.iterator();
            while (it != null && it.hasNext()) {
                list.add(it.next());
            }
        }
        return list;
    }
    /**
     * 查询城市下的街道信息
     * @param town 区县编码
     * @return
     */
    public List<BaseStreetDO> findStreet(String town) {
        List<BaseStreetDO> list = new ArrayList<>();
        Iterable<BaseStreetDO> iterable = streetDao.findByTown(town);
        if (iterable != null) {
            Iterator<BaseStreetDO> it = iterable.iterator();
            while (it != null && it.hasNext()) {
                list.add(it.next());
            }
        }
        return list;
    }
    public List<BaseOrgDO> findHospital(String town) {
        List<BaseOrgDO> list = new ArrayList<>();
        Iterable<BaseOrgDO> iterable = orgDao.findByTownCode(town);
        if (iterable != null) {
            Iterator<BaseOrgDO> it = iterable.iterator();
            while (it != null && it.hasNext()) {
                list.add(it.next());
            }
        }
        return list;
    }
}

+ 8 - 8
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -121,7 +121,7 @@ public class DoorOrderController extends BaseController {
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = false) String orderId,
            @ApiParam(name = "level", value = "医院等级,1.三级医院,2.二级医院,3.一级及以下")
            @RequestParam(value = "level",required = true)Integer level) {
            @RequestParam(value = "level",required = false)Integer level) {
        try {
            // 没有提供工单id的情况下,则获取该医生当前最新一条的工单
            if (StringUtils.isEmpty(orderId)) {
@ -146,7 +146,7 @@ public class DoorOrderController extends BaseController {
            @ApiParam(value = "工单id", name = "orderId", required = true) @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "医生职称code", name = "jobCode", required = true) @RequestParam(value = "jobCode", required = true) String jobCode,
            @ApiParam(value = "医生职称", name = "jobCodeName", required = true) @RequestParam(value = "jobCodeName", required = true) String jobCodeName,
            @ApiParam(value = "医院级别", name = "hospitalLevel", required = true) @RequestParam(value = "hospitalLevel", required = true) int hospitalLevel) {
            @ApiParam(value = "医院级别", name = "hospitalLevel", required = true) @RequestParam(value = "hospitalLevel", required = false) int hospitalLevel) {
        try {
            doorOrderService.acceptOrder(orderId,jobCode,jobCodeName,hospitalLevel);
            return write(200, "操作成功");
@ -600,9 +600,9 @@ public class DoorOrderController extends BaseController {
            List<JSONObject> array = new ArrayList<>();
            WlyyDoorServiceOrderDO one = doorServiceOrderDao.findOne(orderId);
            // 被服务的居民的次数(非代理居民)
            Integer times = wlyyDoorServiceOrderService.countPatientDoorTimes(one.getPatient());
//            Integer times = wlyyDoorServiceOrderService.countPatientDoorTimes(one.getPatient());
            List<String> doctors = doorDoctorDao.findDoctors(orderId);
            List<Map<String, Object>> list = hospitalService.getDoctorsByhospitalNoPage(hospital, name, type, times);
            List<Map<String, Object>> list = hospitalService.getDoctorsByhospitalNoPage(hospital, name, type, 0);
            if (list != null) {
                for (Map<String, Object> doctor : list) {
                    if (doctor == null) {
@ -611,7 +611,7 @@ public class DoorOrderController extends BaseController {
                    JSONObject json = new JSONObject();
                    json.put("id", doctor.get("id"));
                    // 医生标识
                    json.put("code", doctor.get("code"));
                    json.put("id", doctor.get("code"));
                    // 医生姓名
                    json.put("name", doctor.get("name"));
                    // 所在医院名称
@ -622,7 +622,7 @@ public class DoorOrderController extends BaseController {
                    json.put("dept_name", (doctor.get("dept_name") == null ||
                            org.apache.commons.lang3.StringUtils.isEmpty(doctor.get("dept_name").toString())) ? " " : doctor.get("dept_name"));
                    json.put("level", doctor.get("level") );
//                    json.put("level", doctor.get("level") );
                    json.put("job", doctor.get("job") );
                    // 职称名称
                    json.put("job_name", (doctor.get("job_name") == null ||
@ -636,7 +636,7 @@ public class DoorOrderController extends BaseController {
                    json.put("flag", doctors.contains(String.valueOf(doctor.get("code"))) ? true : false);
                    json.put("fixed", one != null && String.valueOf(doctor.get("code")).equals(one.getDoctor()) ? true : false);
                    //出诊费用
                    json.put("fee", doctor.get("fee"));
                    json.put("fee", 0);
                    array.add(json);
                }
            }
@ -708,7 +708,7 @@ public class DoorOrderController extends BaseController {
    @GetMapping(value = "queryDoctorList")
    @ApiOperation(value = "服务人员列表(医生列表)")
    public String queryDoctorList(
            @ApiParam(name = "town", value = "调度员所在的机构code") @RequestParam(value = "town", required = true) String town,
            @ApiParam(name = "town", value = "调度员所在的机构code") @RequestParam(value = "town", required = false) String town,
            @ApiParam(name = "doctorName", value = "医生姓名") @RequestParam(value = "doctorName", required = false) String doctorName,
            @ApiParam(name = "status", value = "医生接单状态,状态为全部时不传") @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patient,

+ 26 - 3
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/PatientController.java

@ -16,9 +16,7 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@ -43,6 +41,31 @@ public class PatientController extends BaseController {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @GetMapping(value = "getProfessionalDict")
    @ApiOperation("职业状态字典")
    public String getProfessionalDict(){
        try {
            String sql = "SELECT code,`value` from base_system_dict_entry WHERE dict_code = 'PROFESSIONAL_STATE' ORDER BY sort";
            List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
            return write(200, "获取成功!", "data",rs);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取字典信息失败!");
        }
    }
    @GetMapping(value = "getNationDict")
    @ApiOperation("获取民族信息列表")
    public String getNationDict(){
        try {
            String sql = "SELECT t.NATION_CODE,t.NATION_NAME FROM zy_nation_dict t";
            List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
            return write(200, "获取成功!", "data",rs);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取字典信息失败!");
        }
    }
    /**
     * 患者基本信息查询接口

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -261,7 +261,7 @@ public class DoorOrderService {
     * @return
     */
    public List<Map<String, Object>> getDoorServiceDoctor(String orderId) {
        String sql = "SELECT dd.id as id,CONCAT(d.`name`,' (',dd.doctor_job_name,')') as name, dd.doctor from wlyy_door_doctor dd join wlyy_doctor d on d.`code` = dd.doctor WHERE order_id=?";
        String sql = "SELECT dd.id as id,CONCAT(d.`name`,' (',dd.doctor_job_name,')') as name, dd.doctor from wlyy_door_doctor dd JOIN base_doctor d ON d.id = dd.doctor WHERE order_id=?";
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, orderId);
        return mapList;
    }

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java

@ -301,7 +301,7 @@ public class DoorServiceApplicationService {
        String sql="SELECT d.code,d.name FROM " +
                " manage_role_user ru LEFT JOIN " +
                " manage_roles r  ON ru.role_id=r.id " +
                " LEFT JOIN (select d.code,d.name from wlyy.wlyy_doctor d LEFT JOIN wlyy.wlyy_sign_family a ON d.hospital=a.hospital  " +
                " LEFT JOIN (select d.code,d.name from wlyy_doctor d LEFT JOIN wlyy_sign_family a ON d.hospital=a.hospital  " +
                "                 where a.patient = '"+patient+"' and a.status > 0  " +
                "                 AND d.status=1 and d.del=1) d ON ru.user_code=d.code " +
                " WHERE r.code='dispatcher' AND d.`code` IS NOT NULL";

+ 5 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -493,7 +493,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    /**
     * 获取居民所签约的机构的调度员(一个机构可以有多个调度员)
     * wlyy_doctor中,level -- 11-- 调度员
     * doctor中,level -- 11-- 调度员
     * @param hospitalCode
     * @return
     */
@ -927,6 +927,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        orderBriefInfo.put("doctorSignTime", DateUtil.dateToStr(orderDO.getDoctorSignTime(), "MM-dd HH:mm"));
        orderBriefInfo.put("completeTime", DateUtil.dateToStr(orderDO.getCompleteTime(), "MM-dd HH:mm"));
        orderBriefInfo.put("prescriptionTime", DateUtil.dateToStr(orderDO.getPrescriptionTime(), "MM-dd HH:mm"));
        orderBriefInfo.put("cancelTime", DateUtil.dateToStr(orderDO.getCancelTime(), "MM-dd HH:mm"));
        // 计算服务包支付多少钱
        List<Map<String, Object>> feeDetailDOS = doorOrderService.getDoorFeeDetailGroupByStatus(id);
@ -1882,7 +1883,9 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : size;
        if(StringUtils.isEmpty(hospital)){
            hospital = "350211A1002";
        }
        //
        String sql = "SELECT " +
                "  d.id as doctor, " +

+ 14 - 9
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/HospitalService.java

@ -1,6 +1,5 @@
package com.yihu.jw.door.service.common;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.org.dao.BaseOrgDao;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,35 +21,41 @@ public class HospitalService {
    private BaseOrgDao baseOrgDao;
    public List<Map<String, Object>> getDoctorsByhospitalNoPage(String hospital, String name, Integer type, Integer times) throws Exception {
        BaseOrgDO h = baseOrgDao.findByCode(hospital);
/*        BaseOrgDO h = baseOrgDao.findByCode(hospital);
        Integer level = 1;
        if(h != null && h.getOrgLevel()!=null) {
            level = h.getOrgLevel();
        }else {
            throw new Exception("未获取到机构等级");
        }
        String sql = "";
        }*/
//        String sql = "";
        //服务次数是否大于12
        if (times != null && times <= 12) {
/*        if (times != null && times <= 12) {
            sql = "select d.*,j.fee_level_" + level + " - j.subsidy as fee  from wlyy_doctor d LEFT JOIN dm_job j on d.job = j.`code` and j.del = 1 " +
                    "where d.del=1  and d.status=1 ";
        }else {
            sql = "select d.*,j.fee_level_" + level + " as fee  from wlyy_doctor d LEFT JOIN dm_job j on d.job = j.`code` and j.del = 1 " +
                    "where d.del=1  and d.status=1 ";
        }
        }*/
        String sql = "SELECT d.id," +
                " d.id name,d.name,h.org_code hospital,h.org_name hospital_name, " +
                " h.dept_name,d.job_title_code job,d.job_title_name job_name,d.photo,d.expertise,d.introduce " +
                "FROM base_doctor d, base_doctor_hospital h " +
                "WHERE d.id = h.doctor_code AND h.del = 1 AND d.del = 1";
        List<Object> params = new ArrayList<Object>();
        if (StringUtils.isNoneEmpty(hospital)) {
            sql += " and hospital =? ";
            sql += " and h.org_code =? ";
            params.add(hospital);
        }
        if (StringUtils.isNoneEmpty(name)) {
            sql += " and d.name like ? ";
            params.add("%" + name + "%");
        }
        if (type != null && type > 0) {
/*        if (type != null && type > 0) {
            sql += " and level =? ";
            params.add(type);
        }
        }*/
        return jdbcTemplate.queryForList(sql, params.toArray());
    }