Trick 5 anni fa
parent
commit
5fb1b25f04

+ 26 - 11
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -13,6 +13,8 @@ import com.yihu.mysql.query.BaseJpaService;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -23,6 +25,9 @@ import java.util.Map;
@Service
public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDao> {
    private static Logger logger = LoggerFactory.getLogger(BaseDoctorService.class);
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
@ -42,15 +47,15 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param page
     * @param pageSize
     */
    public Envelop queryList(String city, String hospital, String status, String name, String type, int page, int pageSize){
    public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode, int page, int pageSize){
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE " +
                " 1 = 1";
        if (StringUtils.isNotBlank(city)){
@ -75,8 +80,10 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            sqlTotal += " AND a.outpatient_type like:type";
            params.put("type",type);
        }
        sqlTotal += " AND e.dept_type_code =:typeCode";
        params.put("typeCode",6);
        if(StringUtils.isNotBlank(typeCode)){
            sqlTotal += " AND e.dept_type_code =:typeCode";
            params.put("typeCode",typeCode);
        }
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
        if(count!=null){
@ -95,8 +102,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
                " JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
            sql += " AND a.city_name =:city";
@ -113,7 +120,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        if (StringUtils.isNotBlank(type)){
            sql += " AND a.outpatient_type like:type";
        }
        sql += " AND e.dept_type_code =:typeCode";
        if(StringUtils.isNotBlank(typeCode)){
            sql += " AND e.dept_type_code =:typeCode";
        }
        logger.info("queryList sql:"+sql);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pageSize);
@ -125,7 +136,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param doctorId
     * @return
     */
    public Object queryById(String doctorId) {
    public Object queryById(String doctorId,String typeCode) {
        Map<String,Object> params = new HashedMap();
        String sql ="SELECT " +
                " a.NAME AS \"name\", " +
@ -151,8 +162,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            sql+=" AND a.id =:id";
            params.put("id",doctorId);
        }
        sql+=" AND e.dept_type_code =:typeCode";
        params.put("typeCode",6);
        if(StringUtils.isNotBlank(typeCode)){
            sql+=" AND e.dept_type_code =:typeCode";
            params.put("typeCode",typeCode);
        }
        logger.info("queryById sql:"+sql);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        StringBuilder disease = new StringBuilder();

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -617,7 +617,7 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    public static void main(String arg[]){
        String ps = MD5.md5Hex("123456" + "{" + "Ar8f2" + "}");
        String ps = MD5.md5Hex("327127" + "{" + "Ar8f2" + "}");
        System.out.println(ps);
    }
}

+ 1 - 1
server/svr-discovery/src/main/resources/application.yml

@ -12,7 +12,7 @@ security:
    enabled: true
  user:
    name: jw
    password: jkzljwhlwyy@2020
    password: jkzl
eureka:
  server:

+ 8 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -43,12 +43,14 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "type", value = "咨询类型")
            @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "typeCode", value = "分部,无分部不传")
            @RequestParam(value = "typeCode", required = false)String typeCode,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        return baseDoctorService.queryList(city,hospital,status,name,type,page,pageSize);
        return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,page,pageSize);
    }
@ -56,8 +58,11 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据医生id查询详情")
    public Envelop queryById(
            @ApiParam(name = "doctorId", value = "医生id")
            @RequestParam(value = "doctorId", required = true) String doctorId)throws Exception{
        Object object = baseDoctorService.queryById(doctorId);
            @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "typeCode", value = "分部,无不传")
            @RequestParam(value = "typeCode", required = false)String typeCode)throws Exception{
        Object object = baseDoctorService.queryById(doctorId,typeCode);
        if (null != object){
            return success("查询成功",object);
        }