Jelajahi Sumber

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-entity/sql记录
yeshijie 3 tahun lalu
induk
melakukan
be37622712

+ 0 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/care/sign/CapacityAssessmentRecordDO.java

@ -301,7 +301,6 @@ public class CapacityAssessmentRecordDO extends UuidIdentityEntityWithCreateTime
        this.signTime = signTime;
    }
    @Transient
    public Integer getAge() {
        return age;
    }

+ 15 - 13
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/CapacityAssessmentRecordService.java

@ -98,7 +98,9 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
    public CapacityAssessmentRecordDO findAssessmentById(String id)  {
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findOne(id);
        BasePatientDO basePatientDO = patientDao.findById(recordDO.getPatient());
        recordDO.setAge(IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        if(recordDO.getAge()==null){
            recordDO.setAge(IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        }
        recordDO.setPhoto(basePatientDO.getPhoto());
        recordDO.setSexName(dictService.fingByNameAndCode(ConstantUtil.DICT_SEX,String.valueOf(recordDO.getSex())));
        recordDO.setServicePackageStatusName(dictService.fingByNameAndCode(ConstantUtil.DICT_SERVICEPACKAGESTATUS,String.valueOf(recordDO.getServicePackageStatus())));
@ -137,15 +139,6 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
            int c = Integer.valueOf(map.get("count").toString());
            res.put(String.valueOf(map.get("level_conclusion")),c);
        }
//        String sql2 = "SELECT COUNT(DISTINCT ar.id) from base_patient ar, " +
//                "base_service_package_sign_record sr,base_service_package_record r,  " +
//                "                base_service_package_item i,base_team_member m  " +
//                "                WHERE sr.id = r.sign_id and sr.status=1 and r.service_package_id = i.service_package_id  " +
//                "                and i.del = 1 and m.team_code = i.team_code and ar.id = sr.patient and ar.archive_type = 2 " +
//                "                and m.doctor_code = '"+doctorId+"' and m.del = '1' and sr.`status`=1";
//        Integer count = jdbcTemplate.queryForObject(sql2,Integer.class);
//        res.put("10",count);
        return res;
    }
@ -216,7 +209,16 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
        JSONObject result = new JSONObject();
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        CapacityAssessmentRecordDO recordDO = JSONObject.parseObject(jsonObject.getJSONObject("assessment").toJSONString(), CapacityAssessmentRecordDO.class);
        if(recordDO.getAge()==null){
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"年龄必填");
            return result;
        }
        if(recordDO.getSex()==null){
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"性别必填");
            return result;
        }
        if(isCapacityAssessment(recordDO.getPatient())==0){
            String year = DateUtil.getNowYear()+"";
            JSONObject obj = getAssessmentItemDetail(recordDO.getPatient(),0,year);
@ -229,7 +231,7 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
                String id = tmp.containsKey("id")?tmp.getString("id"):"";
                if (StringUtils.isBlank(id)){
                    result.put(ResponseContant.resultFlag, ResponseContant.fail);
                    result.put(ResponseContant.resultMsg,"患者存在未完成的评估表"+key);
                    result.put(ResponseContant.resultMsg,"居民存在未完成的评估表"+key);
                    finishFlag=false;
                    break;
                }
@ -262,7 +264,7 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
        }
        else{
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"患者今年已做过能力评估报告,不可重复操作");
            result.put(ResponseContant.resultMsg,"居民今年已做过能力评估报告,不可重复操作");
        }
        if(StringUtils.isNotBlank(recordDO.getPatient())){
            BasePatientDO patientDO= patientDao.findById(recordDO.getPatient());

+ 13 - 0
svr/svr-statistics-es/doc/sql/初始统计数据.txt

@ -10,5 +10,18 @@ INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f4d23c0179f4f837f30007', NULL, 'quota_org_type', '34', '4', '', '7', NULL, '2021-06-10 16:09:38.547', '123', NULL, '2021-06-10 16:09:38.547', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f4d23c0179f4f856d40008', NULL, 'quota_org_type', '35', '4', '', '8', NULL, '2021-06-10 16:09:46.452', '123', NULL, '2021-06-10 16:09:46.452', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f4d23c0179f4f884be0009', NULL, 'quota_org_type', '36', '4', '', '9', NULL, '2021-06-10 16:09:58.205', '123', NULL, '2021-06-10 16:09:58.205', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d12f670007', NULL, 'quota_org_type', '37', '3', '', '37', NULL, '2021-06-11 14:45:06.535', '123', NULL, '2021-06-11 14:45:06.535', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d155bc0008', NULL, 'quota_org_type', '38', '3', '', '38', NULL, '2021-06-11 14:45:16.348', '123', NULL, '2021-06-11 14:45:16.348', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d17e420009', NULL, 'quota_org_type', '39', '3', '', '3', NULL, '2021-06-11 14:45:26.722', '123', NULL, '2021-06-11 14:45:26.722', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d19ec9000a', NULL, 'quota_org_type', '40', '3', '', '40', NULL, '2021-06-11 14:45:35.049', '123', NULL, '2021-06-11 14:45:35.049', '123', NULL, '', '统计机构类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d2be41000c', NULL, 'quota_age', '0', '60岁以下', '', '0', NULL, '2021-06-11 14:46:48.641', '123', NULL, '2021-06-11 14:46:48.641', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d30558000d', NULL, 'quota_age', '1', '60-65', '', '1', NULL, '2021-06-11 14:47:06.84', '123', NULL, '2021-06-11 14:47:06.84', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d32af6000e', NULL, 'quota_age', '2', '66-70', '', '2', NULL, '2021-06-11 14:47:16.469', '123', NULL, '2021-06-11 14:47:16.469', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d3585f000f', NULL, 'quota_age', '3', '71-75', '', '3', NULL, '2021-06-11 14:47:28.094', '123', NULL, '2021-06-11 14:47:28.094', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d3897e0010', NULL, 'quota_age', '4', '76-80', '', '4', NULL, '2021-06-11 14:47:40.67', '123', NULL, '2021-06-11 14:47:40.67', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9d3b5fb0011', NULL, 'quota_age', '5', '80岁以上', '', '5', NULL, '2021-06-11 14:47:52.058', '123', NULL, '2021-06-11 14:47:52.058', '123', NULL, '', '统计年龄类型');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9cfce630005', NULL, 'quota_sex', '1', '男', '', '1', NULL, '2021-06-11 14:43:36.162', '123', NULL, '2021-06-11 14:43:36.162', '123', NULL, '', '统计性别');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('808080eb79f8cbf90179f9cfe9e00006', NULL, 'quota_sex', '2', '女', '', '2', NULL, '2021-06-11 14:43:43.2', '123', NULL, '2021-06-11 14:43:43.2', '123', NULL, '', '统计性别');

+ 58 - 0
svr/svr-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/AgeConvert.java

@ -0,0 +1,58 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.util.IdCardUtil;
import com.yihu.wlyy.statistics.vo.BaseDimensionQuota;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2021/6/11.
 */
public class AgeConvert implements Convert {
    /**
     * @param oneList    数据
     * @param slaveLevel 从1开始
     * @return
     */
    @Override
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List<DataModel> oneList, String slaveLevel, BaseDimensionQuota temp) {
        Map<String,Object> tempMap = new HashMap<>();
        List<DataModel> result = new ArrayList<>();
        for(DataModel one:oneList) {
            try {
                Object value = one.getIdcard();
                Integer age= IdCardUtil.getAgeForIdcard(String.valueOf(value));
                String key = getAgeCode(age);
                tempMap.put(String.valueOf(value),one);
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, key);
            } catch (Exception e) {
                e.printStackTrace();
            }
        };
        return oneList;
    }
    public String getAgeCode(Integer age) {
        if (age <= 6) {
            return Contant.convert.level_age_1;
        } else if (age >= 7 && age <= 18) {
            return Contant.convert.level_age_2;
        } else if (age >= 19 && age <= 30) {
            return Contant.convert.level_age_3;
        } else if (age >= 31 && age <= 50) {
            return Contant.convert.level_age_4;
        } else if (age >= 51 && age < 65) {
            return Contant.convert.level_age_5;
        } else {
            return Contant.convert.level_age_6;
        }
    }
}