Browse Source

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

liubing 2 years ago
parent
commit
a647587218

+ 270 - 24
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -370,7 +370,7 @@ public class DailyReportUploadService {
        dailyReportUploadDO = dailyReportUploadDao.save(dailyReportUploadDO);
        for (BaseDailyReportDetailDO tmp :detailDOList){
            tmp.setReportId(dailyReportUploadDO.getId());
            if (tmp.getReportItemFlag()==true){//新则自建关联项目
            if (tmp.isReportItemFlag()==true){//新则自建关联项目
                String title = tmp.getReportItemTitle();
                BaseDailyReportItemDO reportItemDO = new BaseDailyReportItemDO();
                reportItemDO.setState(0);
@ -409,22 +409,29 @@ public class DailyReportUploadService {
        if (boosSenderIds.size()>0){
            boosID=boosSenderIds.get(0);
        }
        List<BaseDoctorRoleDO> roleDOS = doctorRoleDao.findByDoctorCode(doctorId);
        if (roleDOS.size()==0){//普通员工 需要查询对应上级人员
            if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                sql = " select role.doctor_code from base_doctor_role role INNER JOIN base_doctor_hospital dh  " +
                        "on role.doctor_code = dh.doctor_code and dh.dept_code='"+doctorHospitalDO.getDeptCode()+"'  " +
                        "where role.role_code='deptAdmin' ";
                List<String> deptAdmins = jdbcTemplate.queryForList(sql,String.class);
                if (deptAdmins.size()>0){
                    senderID = deptAdmins.get(0);
                }else {
                    senderID=boosID;
        //优先查询核实人指定表无记录再按默认逻辑
        sql = " select verify_user from base_daily_report_verify where upload_user='"+doctorId+"' and del=1 ";
        List<String> verifyList = jdbcTemplate.queryForList(sql,String.class);
        if (verifyList.size()>0){
            senderID = verifyList.get(0);
        }else {
            List<BaseDoctorRoleDO> roleDOS = doctorRoleDao.findByDoctorCode(doctorId);
            if (roleDOS.size()==0){//普通员工 需要查询对应上级人员
                if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) {
                    BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                    sql = " select role.doctor_code from base_doctor_role role INNER JOIN base_doctor_hospital dh  " +
                            "on role.doctor_code = dh.doctor_code and dh.dept_code='"+doctorHospitalDO.getDeptCode()+"'  " +
                            "where role.role_code='deptAdmin' ";
                    List<String> deptAdmins = jdbcTemplate.queryForList(sql,String.class);
                    if (deptAdmins.size()>0){
                        senderID = deptAdmins.get(0);
                    }else {
                        senderID=boosID;
                    }
                }
            }else {//部门管理员 发送对象为老板
                senderID = boosID;
            }
        }else {//部门管理员 发送对象为老板
            senderID = boosID;
        }
        if (StringUtils.isNotBlank(senderID)){
            BaseDoctorDO remindDoctorDO = baseDoctorDao.findById(senderID);
@ -466,6 +473,7 @@ public class DailyReportUploadService {
    @Transactional(rollbackFor = Exception.class)
    public BaseDailyReportUploadDO verifiedItem(String doctorId,String reportId,List<BaseDailyReportDetailDO> detailDOList) throws Exception {
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
        String nowDate = DateUtil.getStringDateShort();
        if (null==doctorDO){
            throw  new Exception("无权限审核");
        }
@ -474,10 +482,13 @@ public class DailyReportUploadService {
        if (null==dailyReportUploadDO){
            throw  new Exception("核实记录未查询到");
        }
        if (DateUtil.getDays(nowDate,dailyReportUploadDO.getReportDate())>7){
            throw  new Exception("上传记录已超过7天无法再次操作");
        }
        if(detailDOList.size()>0){//无完成事项内容
            boolean doubt  =false;
            for (BaseDailyReportDetailDO tmp:detailDOList){
                if (1==tmp.getDoubt()){
                if (1==tmp.getDoubt()&&(null==tmp.getDoubtState()||0==tmp.getDoubtState())){
                    doubt = true;
                }
                tmp.setVerificationTime(new Date());
@ -657,6 +668,7 @@ public class DailyReportUploadService {
     * @throws Exception
     */
    public BaseDailyReportUploadDO selectReportById(String reportId) throws Exception {
        String nowDate = DateUtil.getStringDateShort();
        BaseDailyReportUploadDO reportUploadDO = dailyReportUploadDao.findOne(reportId);
        if (null==reportUploadDO){
            throw new Exception("未找到日报记录");
@ -666,6 +678,11 @@ public class DailyReportUploadService {
            List<BaseDailyReportLogDO> dailyReportLogDOList = dailyReportLogDao.findByReportId(reportUploadDO.getId());
            reportUploadDO.setDailyReportLogDOList(dailyReportLogDOList);
        }
        if (DateUtil.getDays(nowDate,reportUploadDO.getReportDate())>7){
            reportUploadDO.setVerifiedRepeatFlag(false);
        }else {
            reportUploadDO.setVerifiedRepeatFlag(true);
        }
        return reportUploadDO;
    }
@ -985,7 +1002,7 @@ public class DailyReportUploadService {
     * @param endDate
     * @return
     */
    public JSONArray selectListByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
    public JSONArray selectListByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name,Integer doubtType) {
        List<String> list = new ArrayList<>();
        Date startTime = DateUtil.strToDateShort(startDate);
        Date endDateTime = DateUtil.strToDateShort(endDate);
@ -1021,6 +1038,9 @@ public class DailyReportUploadService {
                    doctorSql += " and d.id not in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
                }
            }
            if (null!=doubtType){
                doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 inner join base_daily_report_detail rd on d1.id = rd.report_id and rd.doubt_type='"+doubtType+"' where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
            }
            if (StringUtils.isNoneBlank(state)) {//核实状态
                doctorSql +=" and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date +"' and d1.state='"+state+"' ) ";
            }
@ -1054,7 +1074,8 @@ public class DailyReportUploadService {
     * @param name      total
     * @return
     */
    public JSONArray selectListInfoByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name) {
    public JSONArray selectListInfoByTotal(String dept, String idType, String status, String state, String startDate, String endDate, String name,
                                           Integer doubtType) {
        List<String> list = new ArrayList<>();
        Date startTime = DateUtil.strToDateShort(startDate);
        Date endDateTime = DateUtil.strToDateShort(endDate);
@ -1090,6 +1111,9 @@ public class DailyReportUploadService {
                    doctorSql += " and d.id not in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
                }
            }
            if (null!=doubtType){
                doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 inner join base_daily_report_detail rd on d1.id = rd.report_id and rd.doubt_type='"+doubtType+"' where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' ) ";
            }
            if (StringUtils.isNoneBlank(state)) {//核实状态
                doctorSql += " and d.id in(select d1.doctor_id from base_doctor_daily_report_upload d1 where 1=1 and d1.report_date >='" + date + "' and d1.report_date<='" + date + "' and d1.state='" + state + "' ) ";
            }
@ -1138,6 +1162,165 @@ public class DailyReportUploadService {
        return array;
    }
    /**
     * 获取存疑列表列表的时间及数量
     * @param dept
     * @param idType
     * @param startDate
     * @param endDate
     * @param name
     * @param doubtType
     * @return
     */
    public JSONArray selectListByTotalDoubt(String dept, String idType, String startDate, String endDate, String name,Integer doubtType) {
        List<String> list = new ArrayList<>();
        Date startTime = DateUtil.strToDateShort(startDate);
        Date endDateTime = DateUtil.strToDateShort(endDate);
        int i=0;
        do{
            startTime = DateUtil.getPreDays(startTime, i);
            String str = DateUtil.dateToStrShort(startTime);
            list.add(str);
            i=1;
        }while (startTime.before(endDateTime));
        JSONArray array = new JSONArray();
        for ( i = 0; i < list.size(); i++) {
            String date = list.get(i);
            String doubtSql = " select count(distinct rd.id) as 'total' from base_doctor_daily_report_upload up " +
                    " inner join base_doctor d on up.doctor_id = d.id and d.del=1 and d.identity=0 " +
                    " inner join base_daily_report_detail rd on up.id = rd.report_id  " +
                    "  where rd.doubt=1 and up.report_date >='" + date + "' and up.report_date<='" + date + "' and up.state=1  ";
            String deptCondition = "";
            if (StringUtils.isNoneBlank(dept)) {
                deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
            }
            if (StringUtils.isNoneBlank(idType)) {
                doubtSql += " and  d.id_type = '" + idType + "' ";
            }
            if (StringUtils.isNoneBlank(deptCondition)) {
                doubtSql += " and d.id IN " + deptCondition;
            }
            if (null!=doubtType){
                if (0==doubtType){
                    doubtSql += " and rd.doubt_type is not null ";
                }else{
                    doubtSql += " and rd.doubt_type='"+doubtType+"' ";
                }
            }
            if (StringUtils.isNoneBlank(name)) {
                doubtSql += " and d.name LIKE  '%" + name + "%' ";
            }
            Map<String, Object> map = jdbcTemplate.queryForMap(doubtSql);
            Integer total = 0;
            if (map != null) {
                if (map.get("total") != null) {
                    total = Integer.parseInt(map.get("total").toString());
                }
            }
            JSONObject object = new JSONObject();
            object.put("time", date);
            object.put("total", total);
            array.add(object);
        }
        return array;
    }
    /**
     * 获取存疑列表的具体人员信息
     *
     * @param dept
     * @param idType
     * @param startDate
     * @param endDate
     * @param name
     * @return
     */
    public JSONArray selectListInfoByTotalDoubt(String dept, String idType, String startDate, String endDate, String name,
                                           Integer doubtType) {
        List<String> list = new ArrayList<>();
        Date startTime = DateUtil.strToDateShort(startDate);
        Date endDateTime = DateUtil.strToDateShort(endDate);
        int i=0;
        do{
            startTime = DateUtil.getPreDays(startTime, i);
            String str = DateUtil.dateToStrShort(startTime);
            list.add(str);
            i=1;
        }while (startTime.before(endDateTime));
        JSONArray array = new JSONArray();
        for (i = 0; i < list.size(); i++) {
            String date = list.get(i);
            String doubtSql = " select up.doctor_id,up.doctor_name,rd.id detailId,rd.report_id uploadId,rd.sort,rd.report_content, " +
                    " rd.completion_schedule,rd.actual_completion_hour,rd.completion_hour, " +
                    " rd.state,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time,rd.remark,rd.doubt,rd.doubt_state, " +
                    " rd.doubt_remark,rd.report_item_id,rd.report_item_name,rd.verification_user_name,rd.doubt_type " +
                    " from base_doctor_daily_report_upload up " +
                    " inner join base_doctor d on up.doctor_id = d.id and d.del=1 and d.identity=0 " +
                    " inner join base_daily_report_detail rd on up.id = rd.report_id  " +
                    "  where rd.doubt=1 and up.report_date >='" + date + "' and up.report_date<='" + date + "' and up.state=1  ";
            String deptCondition = "";
            if (StringUtils.isNoneBlank(dept)) {
                deptCondition += " (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
            }
            if (StringUtils.isNoneBlank(idType)) {
                doubtSql += "   and d.id_type = '" + idType + "')";
            }
            if (StringUtils.isNoneBlank(deptCondition)) {
                doubtSql += " and d.id IN " + deptCondition;
            }
            if (null!=doubtType){
                if(0==doubtType){
                    doubtSql += " and rd.doubt_type is not null ";
                }else {
                    doubtSql += " and rd.doubt_type='"+doubtType+"' ";
                }
            }
            if (StringUtils.isNoneBlank(name)) {
                doubtSql += " and d.name LIKE  '%" + name + "%' ";
            }
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(doubtSql);
            for (Map<String, Object> map : mapList) {
                String id = map.get("doctor_id").toString();
                List<BaseDoctorHospitalDO> hospitalDOList = baseDoctorHospitalDao.findByDoctorCode(id);
                map.put("deptInfo", hospitalDOList);
                String stateMap = map.get("state").toString();
                String doubtState = map.get("doubt_state")==null?"":map.get("doubt_state").toString();
                String doubt_type = map.get("doubt_type")==null?"":map.get("doubt_type").toString();
                if("1".equals(stateMap)){
                    map.put("verifiedState", "已核实");
                } else {
                    map.put("verifiedState", "未核实");
                }
                map.put("doubt_state", "");
                if (StringUtils.isNotBlank(doubtState)){
                    if("1".equals(doubtState)){
                        map.put("doubt_state", "存疑已核实");
                    } else {
                        map.put("doubt_state", "存疑未核实");
                    }
                }
                map.put("doubt_type", "");
                if (StringUtils.isNotBlank(doubt_type)){
                    if("1".equals(doubt_type)){
                        map.put("doubt_type", "不饱和存疑");
                    } else if ("2".equals(doubt_type)){
                        map.put("doubt_type", "效率存疑");
                    }else {
                        map.put("doubt_type", "");
                    }
                }
            }
            JSONObject object = new JSONObject();
            object.put("time", date);
            object.put("list", mapList);
            array.add(object);
        }
        return array;
    }
    /**
     * 查下上报最新一次记录
     * @param doctor
@ -1389,6 +1572,8 @@ public class DailyReportUploadService {
        Integer weishangbaoTotal = 0;
        Integer verifiedTotal = 0;
        Integer notVerifiedTotal = 0;
        Integer baoheDoubt = 0;
        Integer xiaolvDoubt = 0;
        //已上传
        Map<String, Object> yishangchaungMap = jdbcTemplate.queryForMap(sql);
        if (yishangchaungMap != null) {
@ -1443,19 +1628,54 @@ public class DailyReportUploadService {
        if (level==2){
            notVerifiedTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
        }
        //正常
        Map<String, Object> yichangMap = jdbcTemplate.queryForMap(notVerifiedTotalSql);
        if (yichangMap != null) {
            if (yichangMap.get("total") != null) {
                notVerifiedTotal = Integer.parseInt(yichangMap.get("total").toString());
            }
        }
        //不饱和存疑
        String baoheTotalSql = "select COUNT(de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on de.report_id = d.id  where  de.doubt_type=1  ";
        if (StringUtils.isNoneBlank(startDate)) {
            baoheTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (level==2){
            baoheTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
        }
        Map<String, Object> baoheMap = jdbcTemplate.queryForMap(baoheTotalSql);
        if (baoheMap != null) {
            if (baoheMap.get("total") != null) {
                baoheDoubt = Integer.parseInt(baoheMap.get("total").toString());
            }
        }
        //效率存疑
        String xiaolvTotalSql = "select COUNT(de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on de.report_id = d.id  where  de.doubt_type=2  ";
        if (StringUtils.isNoneBlank(startDate)) {
            xiaolvTotalSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (level==2){
            xiaolvTotalSql +=" and d.doctor_id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) ";
        }
        Map<String, Object> xiaolvMap = jdbcTemplate.queryForMap(xiaolvTotalSql);
        if (xiaolvMap != null) {
            if (xiaolvMap.get("total") != null) {
                xiaolvDoubt = Integer.parseInt(xiaolvMap.get("total").toString());
            }
        }
        object.put("total", total);//总人次
        object.put("yishangbaoTotal", yishangbaoTotal);//已上报
        object.put("weishangbaoTotal", weishangbaoTotal);//未上报
        object.put("verifiedTotal", verifiedTotal);//已核实
        object.put("notVerifiedTotal", notVerifiedTotal);//未核实
        object.put("shangchuanTotal", shangchuanTotal);//上传总次数
        object.put("baoheDoubt", baoheDoubt);//不饱和存疑数量
        object.put("xiaolvDoubt", xiaolvDoubt);//效率存疑数量
        object.put("doubtTotal", baoheDoubt+xiaolvDoubt);//存疑总数
        return object;
    }
@ -1517,6 +1737,8 @@ public class DailyReportUploadService {
        Integer notVerified=0;//未核实
        Integer verified=0;//已核实
        Integer shangchuanTotal=0;//上传总次数
        Integer baoheDoubt=0;//饱和度存疑次数
        Integer xiaolvDoubt=0;//效益存疑数量
        if (StringUtils.isNoneBlank(startDate)) {
            sql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
@ -1560,24 +1782,41 @@ public class DailyReportUploadService {
        //已核实数量
        String verifiedSql = "select COUNT(DISTINCT d.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=1 ";
        //不饱和存疑
        String bubaoheSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=1 and de.doubt_type=1 ";
        //效率存疑
        String xiaolvSql = "select COUNT(DISTINCT de.id) as 'total' from base_doctor_daily_report_upload d inner join base_daily_report_detail de " +
                " on d.id = de.report_id where de.state=1 and de.doubt_type=2 ";
        if (StringUtils.isNoneBlank(startDate)) {
            notVerifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
            verifiedSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
            bubaoheSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
            xiaolvSql += " and d.report_date >='" + startDate + "' and d.report_date<='" + endDate + "' ";
        }
        if (StringUtils.isNoneBlank(deptCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + deptCondition;
            verifiedSql += " and d.doctor_id IN " + deptCondition;
            bubaoheSql += " and d.doctor_id IN " + deptCondition;
            xiaolvSql += " and d.doctor_id IN " + deptCondition;
        }
        if (StringUtils.isNoneBlank(idTypeCondition)) {
            notVerifiedSql += " and d.doctor_id IN " + idTypeCondition;
            verifiedSql += " and d.doctor_id IN " + idTypeCondition;
            bubaoheSql += " and d.doctor_id IN " + idTypeCondition;
            xiaolvSql += " and d.doctor_id IN " + idTypeCondition;
        }
        if (StringUtils.isNoneBlank(name)) {
            notVerifiedSql += " and d.doctor_name like '%" + name + "%'";
            verifiedSql += " and d.doctor_name like '%" + name + "%'";
            bubaoheSql += " and d.doctor_name like '%" + name + "%'";
            xiaolvSql += " and d.doctor_name like '%" + name + "%'";
        }
        notVerified = jdbcTemplate.queryForObject(notVerifiedSql,Integer.class);
        verified = jdbcTemplate.queryForObject(verifiedSql,Integer.class);
        baoheDoubt = jdbcTemplate.queryForObject(bubaoheSql,Integer.class);
        xiaolvDoubt = jdbcTemplate.queryForObject(xiaolvSql,Integer.class);
        //上传总次数
        shangchuanTotal = jdbcTemplate.queryForObject(shangchuanTotalSql,Integer.class);
@ -1588,6 +1827,9 @@ public class DailyReportUploadService {
        object.put("notVerified", notVerified);//未核实数量
        object.put("verified", verified);//已核实数量
        object.put("shangchuanTotal", shangchuanTotal);//上传总次数
        object.put("baoheDoubt", baoheDoubt);//饱和度存疑次数
        object.put("xiaolvDoubt", xiaolvDoubt);//效率存疑次数
        object.put("doubtTotal", baoheDoubt+xiaolvDoubt);//存疑总数
        return object;
    }
@ -2108,7 +2350,8 @@ public class DailyReportUploadService {
                "CASE up.leave_state WHEN 1 THEN '请假' else '未请假' END as 'leave_state',IFNULL(up.leave_hour,0) leave_hour, " +
                "it.title,it.content,rd.sort,rd.report_content,IFNULL(rd.actual_completion_hour,IFNULL(rd.completion_hour,0)) 'completion_hour', " +
                "DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', rd.remark " +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', " +
                " CASE rd.doubt WHEN 1 THEN '不饱和存疑' WHEN 2 THEN '效率存疑' ELSE null END as 'doubtType', rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id  " +
                "INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN  " +
                "base_daily_report_detail rd on up.id = rd.report_id " +
@ -2166,7 +2409,8 @@ public class DailyReportUploadService {
                "CASE up.leave_state WHEN 1 THEN '请假' else '未请假' END as 'leave_state',IFNULL(up.leave_hour,0) leave_hour, " +
                "it.title,it.content,rd.sort,rd.report_content,IFNULL(rd.actual_completion_hour,IFNULL(rd.completion_hour,0)) 'completion_hour', " +
                "DATE_FORMAT(rd.create_time,'%Y-%m-%d %H:%i:%S') create_time,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time," +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt', rd.remark " +
                " CASE rd.state WHEN 1 THEN '已核实' ELSE '未核实' END as 'verification_state',rd.verification_user_name,CASE rd.doubt WHEN 1 THEN '存疑' ELSE '无存疑' END as 'doubt'," +
                " CASE rd.doubt WHEN 1 THEN '不饱和存疑' WHEN 2 THEN '效率存疑' ELSE null END as 'doubtType', rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id  " +
                "INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1 LEFT JOIN  " +
                "base_daily_report_detail rd on up.id = rd.report_id " +
@ -2332,14 +2576,14 @@ public class DailyReportUploadService {
    public void UserReportListExcel(List<Map<String,Object>> userCompleteList,OutputStream os,String startDate,String endDate) throws IOException, WriteException {
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        WritableSheet sheet = wwb.createSheet("sheet", 1);
        String[] header = {"员工完成情况("+startDate+"至"+endDate+")","","","","","","","","","","","","","","","","",""};//
        String[] header = {"员工完成情况("+startDate+"至"+endDate+")","","","","","","","","","","","","","","","","","",""};//
        int k = 0;
        for (String h : header) {
            addCell(sheet, 0, k, h);//表名,行,列,header
            k++;
        }
        sheet.mergeCells(0, 0, header.length-1, 0);
        header = new String[]{"人员", "部门","岗位","日期", "上报日期", "请假状态", "请假时长","关联项目","关联项目内容","事项序号", "事项内容", "用时", "创建时间", "上级核实","核实人员","核实时间","是否存疑","备注"};
        header = new String[]{"人员", "部门","岗位","日期", "上报日期", "请假状态", "请假时长","关联项目","关联项目内容","事项序号", "事项内容", "用时", "创建时间", "上级核实","核实人员","核实时间","是否存疑","存疑类型","备注"};
        int i = 0;
        for (String h : header) {
            addCell(sheet, 1, i, h);
@ -2368,6 +2612,7 @@ public class DailyReportUploadService {
                sheet.mergeCells(a3+1, b3, c3, d3);//请假
                sheet.mergeCells(a3+2, b3, c3, d3);//请假时长
                doctorIdMerge = doctorId;
                reportDateMerge = reportDate;
                b1=i;d1=0;
                b3=i;d3=0;
            }else {//同一个医生。
@ -2406,7 +2651,8 @@ public class DailyReportUploadService {
            addCell(sheet,i , 14,null==completeTmp.get("verification_user_name")?"":completeTmp.get("verification_user_name").toString());
            addCell(sheet,i , 15,null==completeTmp.get("verification_time")?"":completeTmp.get("verification_time").toString());
            addCell(sheet,i , 16,null==completeTmp.get("doubt")?"":completeTmp.get("doubt").toString());
            addCell(sheet,i , 17,null==completeTmp.get("remark")?"":completeTmp.get("remark").toString());
            addCell(sheet,i , 17,null==completeTmp.get("doubtType")?"":completeTmp.get("doubtType").toString());
            addCell(sheet,i , 18,null==completeTmp.get("remark")?"":completeTmp.get("remark").toString());
            i++;
        }
        sheet.mergeCells(a1, b1, c1, d1);

+ 10 - 0
common/common-entity/sql记录

@ -2119,3 +2119,13 @@ alter table base_daily_report_detail add column verification_user_name VARCHAR(5
alter table base_daily_report_item add column `completion_user_name` varchar(50) DEFAULT NULL COMMENT '完成人';
alter table base_daily_report_item_members add column `user_name` varchar(50) DEFAULT NULL COMMENT '成员成员姓名';
--2022-08-11
ALTER table base_daily_report_detail add column doubt_type TINYINT(2) DEFAULT NULL COMMENT '存疑类型,1不饱和存疑 2效率存疑';
CREATE TABLE `base_daily_report_verify` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `upload_user` varchar(50) DEFAULT NULL COMMENT '日报提交人',
  `verify_user` varchar(50) DEFAULT NULL COMMENT '核实人',
  `del` tinyint(2) DEFAULT NULL COMMENT '1有效0无效',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工日报核实人指定表';

+ 11 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportDetailDO.java

@ -27,6 +27,7 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    private String verificationUserName;//核实人姓名
    private String remark; //备注内容
    private Integer doubt; //疑惑0无疑惑1存疑
    private Integer doubtType; //存疑类型,1不饱和存疑 2效率存疑
    private Integer doubtState; //疑惑核实状态0未核实1已核实
    private String doubtRemark; //疑惑核实备注
    private String actualCompletionHour; //实际完成时长
@ -125,6 +126,14 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
        this.doubt = doubt;
    }
    public Integer getDoubtType() {
        return doubtType;
    }
    public void setDoubtType(Integer doubtType) {
        this.doubtType = doubtType;
    }
    public Integer getDoubtState() {
        return doubtState;
    }
@ -166,7 +175,7 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    }
    @Transient
    public boolean getReportItemFlag() {
    public boolean isReportItemFlag() {
        return reportItemFlag;
    }
@ -182,4 +191,5 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    public void setReportItemTitle(String reportItemTitle) {
        this.reportItemTitle = reportItemTitle;
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportUploadDO.java

@ -24,6 +24,7 @@ public class BaseDailyReportUploadDO extends UuidIdentityEntityWithOperator {
    private String reportDate; //上报日期
    private String totalHour;//上报时长
    private boolean verifiedRepeatFlag;
    public String getTotalHour() {
        return totalHour;
@ -111,4 +112,12 @@ public class BaseDailyReportUploadDO extends UuidIdentityEntityWithOperator {
        this.leaveHour = leaveHour;
    }
    @Transient
    public boolean isVerifiedRepeatFlag() {
        return verifiedRepeatFlag;
    }
    public void setVerifiedRepeatFlag(boolean verifiedRepeatFlag) {
        this.verifiedRepeatFlag = verifiedRepeatFlag;
    }
}

+ 3 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/YsConfig.java

@ -41,6 +41,9 @@ public class YsConfig {
    //获取设备有效直播地址
    public static final String getDeviceLiveAddress = iotBaseUrl+ "/api/lapp/live/address/limited";
    //获取设备有效直播地址(对讲)
    public static final String getDeviceLiveAddress2 = iotBaseUrl+ "/api/lapp/v2/live/address/get";
    //设备视频加解密开关
    public static final String deviceEncrypt = baseUrl+ "/api/resource/device/encrypt/switch";

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/YsDeviceController.java

@ -406,5 +406,25 @@ public class YsDeviceController extends BaseController {
        }
    }
    @ApiOperation("获取播放地址--协议")
    @RequestMapping(value = "getDeviceLiveAddress2", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String getDeviceLiveAddress2(
            @ApiParam(name="deviceSerial",required = false,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = false) String deviceSerial,
            @ApiParam(name="channelNo",required = false,value="设备通道号,默认为1")
            @RequestParam(value = "channelNo",required = false,defaultValue = "1") Integer channelNo
    ){
        try {
            JSONObject result = ysDeviceService.getDeviceLiveAddress2(deviceSerial,channelNo);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                return error(200,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"查询成功","data",result.getJSONObject(ResponseContant.resultMsg));
        }catch (Exception e){
            return errorResult(e);
        }
    }
}

+ 27 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/YsDeviceService.java

@ -750,6 +750,33 @@ public class YsDeviceService {
        return result;
    }
    public JSONObject getDeviceLiveAddress2(String deviceSerial,Integer channelNo) throws Exception {
        JSONObject result = new JSONObject();
        MultiValueMap<String,String> param = new LinkedMultiValueMap<>();
        String accessToken=getIotAccessToken(deviceSerial);
        param.add("accessToken",accessToken);
        if (StringUtils.isNotBlank(deviceSerial)){
            param.add("deviceSerial",deviceSerial);
        }
        if (channelNo!=null){
            param.add("channelNo",channelNo+"");
        }
        HttpEntity<JSONObject> response = httpClientUtil.iotAssesTokenPostHttp(YsConfig.getDeviceLiveAddress2,param,HttpMethod.POST);
        JSONObject responseBody = response.getBody();
        if (responseBody.getInteger("code")==200){
            result.put(ResponseContant.resultFlag,ResponseContant.success);
            JSONObject tmp = new JSONObject();
            tmp.put("url",responseBody.getJSONObject("data").getString("url"));
            tmp.put("accessToken",accessToken);
            result.put(ResponseContant.resultMsg,tmp.toJSONString());
        }else {
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,responseBody.getString("msg"));
        }
        return result;
    }
    /**
     * 消息解密
     * @param sSrc

+ 50 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dailyReport/DailyReportUploadPoint.java

@ -14,19 +14,14 @@ import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.utils.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -321,6 +316,8 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "status", required = false) String status,
                                         @ApiParam(name = "state", value = "核实状态 0未核实 1已核实")
                                         @RequestParam(value = "state", required = false) String state,
                                         @ApiParam(name = "doubtType", value = "存疑类型 存疑类型,1不饱和存疑 2效率存疑")
                                         @RequestParam(value = "doubtType", required = false) Integer doubtType,
                                         @ApiParam(name = "startDate", value = "开始时间")
                                         @RequestParam(value = "startDate", required = false) String startDate,
                                         @ApiParam(name = "endDate", value = "结束时间")
@ -328,7 +325,7 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                         @ApiParam(name = "name", value = "名字搜索")
                                         @RequestParam(value = "name", required = false) String name) {
        try {
            JSONArray jsonArray = dailyReportUploadService.selectListByTotal(dept,idType,status,state,startDate,endDate,name);
            JSONArray jsonArray = dailyReportUploadService.selectListByTotal(dept,idType,status,state,startDate,endDate,name,doubtType);
            return success(jsonArray);
        } catch (Exception e) {
            return failedListEnvelopException(e);
@ -345,6 +342,8 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                             @RequestParam(value = "status", required = false) String status,
                                             @ApiParam(name = "state", value = "核实状态 0未核实 1已核实")
                                             @RequestParam(value = "state", required = false) String state,
                                             @ApiParam(name = "doubtType", value = "存疑类型 存疑类型,1不饱和存疑 2效率存疑")
                                             @RequestParam(value = "doubtType", required = false) Integer doubtType,
                                             @ApiParam(name = "startDate", value = "开始时间")
                                             @RequestParam(value = "startDate", required = false) String startDate,
                                             @ApiParam(name = "endDate", value = "结束时间")
@ -352,7 +351,51 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                             @ApiParam(name = "name", value = "具体医生姓名")
                                             @RequestParam(value = "name", required = false) String name) {
        try {
            JSONArray jsonArray = dailyReportUploadService.selectListInfoByTotal(dept,idType,status,state,startDate,endDate,name);
            JSONArray jsonArray = dailyReportUploadService.selectListInfoByTotal(dept,idType,status,state,startDate,endDate,name,doubtType);
            return success(jsonArray);
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = "selectListByTotalDoubt")
    @ApiOperation(value = "获取存疑列表的时间及数量")
    public ListEnvelop selectListByTotalDoubt(@ApiParam(name = "dept", value = "科室code")
                                         @RequestParam(value = "dept", required = false) String dept,
                                         @ApiParam(name = "idType", value = "身份类别")
                                         @RequestParam(value = "idType", required = false) String idType,
                                         @ApiParam(name = "doubtType", value = "存疑类型0全部 存疑类型,1不饱和存疑 2效率存疑")
                                         @RequestParam(value = "doubtType", required = false) Integer doubtType,
                                         @ApiParam(name = "startDate", value = "开始时间")
                                         @RequestParam(value = "startDate", required = false) String startDate,
                                         @ApiParam(name = "endDate", value = "结束时间")
                                         @RequestParam(value = "endDate", required = false) String endDate,
                                         @ApiParam(name = "name", value = "名字搜索")
                                         @RequestParam(value = "name", required = false) String name) {
        try {
            JSONArray jsonArray = dailyReportUploadService.selectListByTotalDoubt(dept,idType,startDate,endDate,name,doubtType);
            return success(jsonArray);
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = "selectListInfoByTotalDoubt")
    @ApiOperation(value = "获取存疑列表的具体人员信息")
    public ListEnvelop selectListInfoByTotalDoubt(@ApiParam(name = "dept", value = "科室code")
                                             @RequestParam(value = "dept", required = false) String dept,
                                             @ApiParam(name = "idType", value = "身份类别")
                                             @RequestParam(value = "idType", required = false) String idType,
                                             @ApiParam(name = "doubtType", value = "存疑类型0全部 存疑类型,1不饱和存疑 2效率存疑")
                                             @RequestParam(value = "doubtType", required = false) Integer doubtType,
                                             @ApiParam(name = "startDate", value = "开始时间")
                                             @RequestParam(value = "startDate", required = false) String startDate,
                                             @ApiParam(name = "endDate", value = "结束时间")
                                             @RequestParam(value = "endDate", required = false) String endDate,
                                             @ApiParam(name = "name", value = "具体医生姓名")
                                             @RequestParam(value = "name", required = false) String name) {
        try {
            JSONArray jsonArray = dailyReportUploadService.selectListInfoByTotalDoubt(dept,idType,startDate,endDate,name,doubtType);
            return success(jsonArray);
        } catch (Exception e) {
            return failedListEnvelopException(e);