Browse Source

居委会字段查询

trick9191 7 years ago
parent
commit
c45b5c510d

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

@ -10,4 +10,5 @@ import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class PrescriptionInfoService extends BaseService {
}

+ 62 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -3682,7 +3682,7 @@ public class FamilyContractService extends BaseService {
                for(Map<String,Object> map :serlist){
                    String labelCode = (String)map.get("labelCode");
                    List<Map<String,String>> codes = new ArrayList<>();
                    Iterator iterator = patientList.iterator();
                    Iterator iterator = totalList.iterator();
                    while(iterator.hasNext()){
                        Map<String,Object> p =  ( Map<String,Object>)iterator.next();
                        String serverType = p.get("serverType") ==null?"":((String)p.get("serverType"));
@ -3725,11 +3725,72 @@ public class FamilyContractService extends BaseService {
                " f.`status` >= 0 " +
                " AND f.admin_team_code = ? " +
                " AND f.doctor_health IS NULL " +
                " AND f.sick_village IS NOT NULL "+
                " GROUP BY " +
                " f.sick_village " +
                " ORDER BY " +
                " number DESC ";
        List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientSql,new Object[]{teamCode});
        if(patientList!=null&&patientList.size()>0){
            for(Map<String,Object> map : patientList){
                String labelCode = (String)map.get("labelCode");
                if(StringUtils.isNotBlank(labelCode)){
                    List<Map<String,String>> codes = new ArrayList<>();
                    Iterator iterator = totalList.iterator();
                    while(iterator.hasNext()){
                        Map<String,Object> p =  ( Map<String,Object>)iterator.next();
                        String lbCode = p.get("labelCode") ==null?"":((String)p.get("labelCode"));
                        if(labelCode.equals(lbCode)){
                            Map<String,String> code = new HashMap<>();
                            code.put("code",(String)p.get("patient"));
                            codes.add(code);
                            iterator.remove();
                        }
                    }
                    map.put("codes",codes);
                }
            }
        }
        rs.put("patients",patientList);
        return rs;
    }
    public JSONObject getTeamCountryPatientChangeDoctorList(Long teamCode,String level,String oldDoctorCode){
        String totalSql = " SELECT " +
                " s.patient,ifnull(s.sick_village,0) as labelCode" +
                " FROM " +
                " wlyy_sign_family s " +
                " WHERE " +
                " s.`status` >= 0 " +
                " AND s.admin_team_code = ? ";
        if("2".equals(level)){
            totalSql =  totalSql+" AND s.doctor ='"+oldDoctorCode+"'";
        }else{
            totalSql =  totalSql+" AND s.doctor_health ='"+oldDoctorCode+"'";
        }
        JSONObject rs = new JSONObject();
        List<Map<String,Object>> totalList = jdbcTemplate.queryForList(totalSql,new Object[]{teamCode});
        rs.put("count",(totalList!=null&&totalList.size()>0)?totalList.size():0);
        String patientSql ="SELECT " +
                " f.sick_village AS labelCode, " +
                " f.sick_village_name AS label, " +
                " COUNT(1) AS number " +
                " FROM " +
                " wlyy_sign_family f " +
                " WHERE " +
                " f.`status` >= 0 " +
                " AND f.sick_village IS NOT NULL "+
                " AND f.admin_team_code = ? " ;
        if("2".equals(level)){
            patientSql =  patientSql+" AND s.doctor ='"+oldDoctorCode+"'";
        }else{
            patientSql =  patientSql+" AND s.doctor_health ='"+oldDoctorCode+"'";
        }
        patientSql = patientSql+" GROUP BY " +
                " f.sick_village " +
                " ORDER BY " +
                " number DESC ";
        List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientSql,new Object[]{teamCode});
        if(patientList!=null&&patientList.size()>0){
            for(Map<String,Object> map : patientList){
                String labelCode = (String)map.get("labelCode");

+ 2 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.doctor.patient;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.app.sign.SignWebService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.web.BaseController;
@ -32,6 +33,7 @@ public class SignPatientLabelInfoController extends BaseController {
    @Autowired
    PatientService patientService;
    /**
     * 根据姓名,地址,身份证号搜索团队内居民
     *

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

@ -0,0 +1,21 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.quartz.impl.calendar.BaseCalendar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Trick on 2017/7/25.
 */
@RestController
@RequestMapping(value = "/doctor/prescriptionInfo")
@Api("医生端-长处方接口")
public class PrescriptionInfoController extends BaseController{
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
}

+ 4 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -232,7 +232,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                JSONObject rs = familyContractService.getServerPatientListNum(teamCode, level, oldDoctorCode);
                return write(200, "查询成功!", "data", rs);
            }
            if ("5".equals(labelType)) {
                JSONObject rs = familyContractService.getTeamCountryPatientChangeDoctorList(teamCode, level, oldDoctorCode);
                return write(200, "查询成功!", "data", rs);
            }
            int count = 0;
            List listNum = new ArrayList();
            JSONObject list = familyContractService.getPatientByLable(oldDoctorCode, labelType, level, teamCode);