Browse Source

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 7 years ago
parent
commit
87045fab73

+ 6 - 6
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionReasonDict.java

@ -15,8 +15,8 @@ public class PrescriptionReasonDict extends IdEntity {
    private String code;//编码code
    private String value;//原因内容
    private String type;//类型:0 审核原因标签;1 调整原因标签
    private String sort;//排序号
    private Integer type;//类型:0 审核原因标签;1 调整原因标签
    private Integer sort;//排序号
    private Date createTime;//创建时间
    private Date updateTime;//修改时间
@ -36,19 +36,19 @@ public class PrescriptionReasonDict extends IdEntity {
        this.value = value;
    }
    public String getType() {
    public Integer getType() {
        return type;
    }
    public void setType(String type) {
    public void setType(Integer type) {
        this.type = type;
    }
    public String getSort() {
    public Integer getSort() {
        return sort;
    }
    public void setSort(String sort) {
    public void setSort(Integer sort) {
        this.sort = sort;
    }

+ 12 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -110,7 +110,7 @@ public class PrescriptionInfoService extends BaseService {
    }
    public JSONObject getPrescriptionFilter(Integer teamCode) {
    public JSONObject getPrescriptionFilter(Integer teamCode,String patient) {
        JSONObject rs = new JSONObject();
        List<SystemDict> sdict = systemDictDao.findByDictName("PRESCRIPTION_STATE");
@ -119,7 +119,7 @@ public class PrescriptionInfoService extends BaseService {
            Map<String,Object> m = new HashedMap();
            m.put("code",sd.getCode());
            m.put("value",sd.getValue());
            m.put("count",getPresCountByState(teamCode,sd.getCode()));
            m.put("count",getPresCountByState(teamCode,sd.getCode(),patient));
            states.add(m);
        }
        rs.put("states", states);
@ -137,7 +137,7 @@ public class PrescriptionInfoService extends BaseService {
        return rs;
    }
    public int getPresCountByState(Integer teamCode,String states){
    public int getPresCountByState(Integer teamCode,String states,String patient){
        String sql = "SELECT " +
                " COUNT(1) AS count " +
                " FROM " +
@ -145,6 +145,9 @@ public class PrescriptionInfoService extends BaseService {
                " WHERE " +
                " p.admin_team_id =" +teamCode+
                " AND p.`status` in ("+states+")";
        if(StringUtils.isNotBlank(patient)){
            sql = sql+ " AND p.patient = '"+patient+"'";
        }
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
        if(rs!=null&&rs.size()>0){
            Long r = (Long) rs.get(0).get("count");
@ -1367,8 +1370,11 @@ public class PrescriptionInfoService extends BaseService {
    }
    public List<PrescriptionReasonDict> getReasonByType(Integer type){
        List<PrescriptionReasonDict> list =  prescriptionReasonDictDao.findByTypeOrderBySortAsc(type);
        return list;
    public JSONArray getReasonByType(Integer type){
        String sql = "SELECT t.value,t.code FROM wlyy_prescription_reason_dict t WHERE t.type = "+type+" ORDER BY t.sort ASC ";
        List<Map<String,Object>> list =  jdbcTemplate.queryForList(sql);
        //System.out.println("list:"+list.size());
        return  new JSONArray(list);
    }
}

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -52,9 +52,10 @@ public class PrescriptionInfoController extends BaseController {
    @RequestMapping(value = "/getPrescriptionFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取过滤规则信息列表")
    public String getPrescriptionFilter(Integer teamCode) {
    public String getPrescriptionFilter(@RequestParam(required = true) @ApiParam(value = "团队code", name = "teamCode")Integer teamCode,
                                        @RequestParam(required = false) @ApiParam(value = "居民code", name = "patient")String patient) {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionFilter(teamCode));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionFilter(teamCode,patient));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");