Browse Source

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

trick9191 5 years ago
parent
commit
b300e1a3a3

+ 31 - 1
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -11,6 +11,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -49,7 +50,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param page
     * @param pageSize
     */
    public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode, int page, int pageSize){
    public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode,String dept, int page, int pageSize){
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
                " COUNT(1) AS \"total\" " +
@ -86,6 +87,11 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            sqlTotal += " AND e.dept_type_code =:typeCode";
            params.put("typeCode",typeCode);
        }
        if(StringUtils.isNotBlank(dept)){
            sqlTotal += " AND b.dept_code =:dept";
            params.put("dept",dept);
        }
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
        if(count!=null){
@ -125,6 +131,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        if(StringUtils.isNotBlank(typeCode)){
            sql += " AND e.dept_type_code =:typeCode";
        }
        if(StringUtils.isNotBlank(dept)){
            sql += " AND b.dept_code =:dept";
        }
        logger.info("queryList sql:"+sql);
@ -196,6 +205,19 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        return null;
    }
    public Boolean updateList(JSONArray jsonArray){
        if(jsonArray!=null&&jsonArray.size()>0){
            for(int i=0;i<jsonArray.size();i++){
                JSONObject doctor = jsonArray.getJSONObject(i);
                try {
                    update(doctor);
                }catch (Exception e){
                    logger.info("update doctor error:"+e.toString());
                }
            }
        }
        return true;
    }
    /**
     * 修改医生服务配置
@ -277,4 +299,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        return buffer.toString();
    }
//    public static void main(String ag[]){
//        String str = "[{\"doctor\",\"1\"},{\"doctor\",\"2\"}]";
//        JSONArray json = JSONArray.fromObject(str);
//        for(int i=0;i<json.size();i++){
//            JSONObject doctor = json.getJSONObject(i);
//            doctor.getString("doctor");
//        }
//    }
}

+ 7 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1091,7 +1091,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public MixEnvelop findDoctorWithMouthWork(String orgCode,String dept,String chargeType,String date,Integer page,Integer size){
    public MixEnvelop findDoctorWithMouthWork(String orgCode,String dept,String chargeType,String date,String nameKey,Integer page,Integer size){
        String totalSql ="SELECT " +
                " count(1) AS total " +
@ -1106,6 +1106,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNotBlank(dept)){
            totalSql+= " AND h.dept_code = '"+dept+"' " ;
        }
        if(StringUtils.isNotBlank(nameKey)){
            totalSql+= " AND d.name like '%"+nameKey+"%' " ;
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
@ -1135,6 +1138,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNotBlank(dept)){
            sql+= " AND h.dept_code = '"+dept+"' " ;
        }
        if(StringUtils.isNotBlank(nameKey)){
            sql+= " AND d.name like '%"+nameKey+"%' " ;
        }
        sql += " LIMIT " + (page - 1) * size + "," + size + "";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if(list!=null&&list.size()>0){

+ 1 - 1
business/es-service/src/main/java/com/yihu/jw/es/es/ElasticFactory.java

@ -110,7 +110,7 @@ public class ElasticFactory {
    /**
     * 9300
     * 厦门I健康版本不需要密码
     *
     * @throws UnknownHostException
     */
    private synchronized void initTranClient() throws UnknownHostException {

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

@ -659,6 +659,7 @@ public class BaseHospitalRequestMapping {
        public static final String queryList  = "/queryList";
        public static final String queryById  = "/queryById";
        public static final String update  = "/update";
        public static final String updateList  = "/updateList";
        public static final String updateStatus  = "/updateStatus";
        public static final String updateDoctorPw  = "/updateDoctorPw";
    }

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

@ -8,6 +8,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -45,12 +46,14 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "type", required = false) String type,
            @ApiParam(name = "typeCode", value = "分部,无分部不传")
            @RequestParam(value = "typeCode", required = false)String typeCode,
            @ApiParam(name = "dept", value = "部门")
            @RequestParam(value = "dept", required = false)String dept,
            @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,typeCode,page,pageSize);
        return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
    }
@ -83,6 +86,16 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
        return success("保存成功");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateList)
    @ApiOperation(value = "批量修改医生服务配置")
    public Envelop updateList(
            @ApiParam(name = "baseDoctorVos", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVos") String baseDoctorVos)throws Exception{
        JSONArray jsonArray = JSONArray.fromObject(baseDoctorVos);
        Boolean update = baseDoctorService.updateList(jsonArray);
        return success("保存成功");
    }
    @GetMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateStatus)
    @ApiOperation(value = "修改医生状态")

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -429,12 +429,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "date", required = true)String date,
                                         @ApiParam(name = "chargeType", value = "号别")
                                         @RequestParam(value = "chargeType", required = false)String chargeType,
                                         @ApiParam(name = "nameKey", value = "名字关键字")
                                         @RequestParam(value = "nameKey", required = false)String nameKey,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return success(prescriptionService.findDoctorWithMouthWork(orgCode,dept,chargeType,date,page,size));
        return success(prescriptionService.findDoctorWithMouthWork(orgCode,dept,chargeType,date,nameKey,page,size));
    }