فهرست منبع

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

trick9191 7 سال پیش
والد
کامیت
3cd7171f1a

+ 72 - 64
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -4506,85 +4506,93 @@ public class SignPatientLabelInfoService extends BaseService {
        //1.清空居民标签
        String delSql = " DELETE FROM wlyy_sign_patient_label_info WHERE patient ='"+patient+"'";
        jdbcTemplate.execute(delSql);
        //2.新增健康情况标签
        String healths[] = health.split(",");
        //获取所有健康情况标签
        List<Map<String,Object>> healthList = getLabelsByType("2");
        //减低循环层级
        Map<String,Map<String,Object>> healthMap = new HashedMap();
        for(Map<String,Object> map : healthList){
            String code = (String)map.get("code");
            healthMap.put(code,map);
        }
        if(healths!=null&&healths.length>0){
            for(int i=0;i<healths.length;i++){
                SignPatientLabelInfo info = new SignPatientLabelInfo();
                info.setCzrq(new Date());
                info.setLabelType("2");
                info.setPatient(patient);
                info.setPname(p.getName());
                info.setLabel(healths[i]);
                info.setStatus(1);
                String name = (String)healthMap.get(healths[i]).get("name");
                info.setLabelName(name);
                signPatientLabelInfoDao.save(info);
        //2.新增健康情况标签
        if(StringUtils.isNotBlank(health)){
            String healths[] = health.split(",");
            //获取所有健康情况标签
            List<Map<String,Object>> healthList = getLabelsByType("2");
            //减低循环层级
            Map<String,Map<String,Object>> healthMap = new HashedMap();
            for(Map<String,Object> map : healthList){
                String code = (String)map.get("code");
                healthMap.put(code,map);
            }
            if(healths!=null&&healths.length>0){
                for(int i=0;i<healths.length;i++){
                    SignPatientLabelInfo info = new SignPatientLabelInfo();
                    info.setCzrq(new Date());
                    info.setLabelType("2");
                    info.setPatient(patient);
                    info.setPname(p.getName());
                    info.setLabel(healths[i]);
                    info.setStatus(1);
                    String name = (String)healthMap.get(healths[i]).get("name");
                    info.setLabelName(name);
                    signPatientLabelInfoDao.save(info);
                }
            }
        }
        //2.新增疾病标签
        String diseases[] = disease.split(",");
        //获取所有健康情况标签
        List<Map<String,Object>> diseaseList = getLabelsByType("3");
        //减低循环层级
        Map<String,Map<String,Object>> diseaseMap = new HashedMap();
        for(Map<String,Object> map : diseaseList){
            String code = (String)map.get("code");
            diseaseMap.put(code,map);
        }
        if(StringUtils.isNotBlank(disease)){
            String diseases[] = disease.split(",");
            //获取所有健康情况标签
            List<Map<String,Object>> diseaseList = getLabelsByType("3");
            //减低循环层级
            Map<String,Map<String,Object>> diseaseMap = new HashedMap();
            for(Map<String,Object> map : diseaseList){
                String code = (String)map.get("code");
                diseaseMap.put(code,map);
            }
        if(diseases!=null&&diseases.length>0){
            for(int i=0;i<diseases.length;i++){
                SignPatientLabelInfo info = new SignPatientLabelInfo();
                info.setCzrq(new Date());
                info.setLabelType("3");
                info.setPatient(patient);
                info.setPname(p.getName());
                info.setLabel(diseases[i]);
                String name = (String)diseaseMap.get(diseases[i]).get("name");
                info.setLabelName(name);
                info.setStatus(1);
                signPatientLabelInfoDao.save(info);
            if(diseases!=null&&diseases.length>0){
                for(int i=0;i<diseases.length;i++){
                    SignPatientLabelInfo info = new SignPatientLabelInfo();
                    info.setCzrq(new Date());
                    info.setLabelType("3");
                    info.setPatient(patient);
                    info.setPname(p.getName());
                    info.setLabel(diseases[i]);
                    String name = (String)diseaseMap.get(diseases[i]).get("name");
                    info.setLabelName(name);
                    info.setStatus(1);
                    signPatientLabelInfoDao.save(info);
                }
            }
        }
        //3.新增自定义标签
        String customs[] = custom.split(",");
        //获取所有健康情况标签
        List<Map<String,Object>> customList = getLabelsByType("4");
        //减低循环层级
        Map<String,Map<String,Object>> customMap = new HashedMap();
        for(Map<String,Object> map : customList){
            String code = (String)map.get("code");
            customMap.put(code,map);
        }
        if(StringUtils.isNotBlank(custom)){
            String customs[] = custom.split(",");
            //获取所有健康情况标签
            List<Map<String,Object>> customList = getLabelsByType("4");
            //减低循环层级
            Map<String,Map<String,Object>> customMap = new HashedMap();
            for(Map<String,Object> map : customList){
                String code = (String)map.get("code");
                customMap.put(code,map);
            }
        if(customs!=null&&customs.length>0){
            for(int i=0;i<customs.length;i++){
                SignPatientLabelInfo info = new SignPatientLabelInfo();
                info.setCzrq(new Date());
                info.setLabelType("4");
                info.setPatient(patient);
                info.setPname(p.getName());
                info.setLabel(customs[i]);
                String name = (String)customMap.get(customs[i]).get("name");
                info.setLabelName(name);
                info.setStatus(1);
                signPatientLabelInfoDao.save(info);
            if(customs!=null&&customs.length>0){
                for(int i=0;i<customs.length;i++){
                    SignPatientLabelInfo info = new SignPatientLabelInfo();
                    info.setCzrq(new Date());
                    info.setLabelType("4");
                    info.setPatient(patient);
                    info.setPname(p.getName());
                    info.setLabel(customs[i]);
                    String name = (String)customMap.get(customs[i]).get("name");
                    info.setLabelName(name);
                    info.setStatus(1);
                    signPatientLabelInfoDao.save(info);
                }
            }
        }
        return 1;
    }

+ 3 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -861,10 +861,9 @@ public class SignPatientLabelInfoController extends BaseController {
    @RequestMapping(value = "/resetPatientLabels", method = {RequestMethod.GET, RequestMethod.POST})
    @ResponseBody
    public String resetPatientLabels(@RequestParam(required = true)String patient,
                                     @RequestParam(required = true)String health,
                                     @RequestParam(required = true)String disease,
                                     @RequestParam(required = true)String custom,
                                     @RequestParam(required = true)String doctor){
                                     @RequestParam(required = false)String health,
                                     @RequestParam(required = false)String disease,
                                     @RequestParam(required = false)String custom){
        try {
            return write(200, "保存成功", "data", signPatientLabelService.resetPatientLabels(patient,health,disease,custom));
        } catch (Exception e) {