Browse Source

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

wangzhinan 2 years ago
parent
commit
c96b865466
15 changed files with 265 additions and 44 deletions
  1. 55 7
      business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java
  2. 17 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 11 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java
  4. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java
  5. 1 24
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java
  6. 31 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportMonthReportJob.java
  7. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindJob.java
  8. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindSecondJob.java
  9. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportTotalRemindJob.java
  10. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportWsbTotalRemindJob.java
  11. 118 3
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java
  12. 11 4
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  13. 2 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  14. 13 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dailyReport/DailyReportUploadPoint.java
  15. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

+ 55 - 7
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -1038,9 +1038,10 @@ public class DailyReportUploadService {
        result.put("benrenVerified",benrenVerified);//本人上级未核实
        result.put("benrenNotVerified",benrenNotVerified);//本人上级已核实
        result.put("notVerifiedTotal",selectListInfoByTotal2(doctorId,dept,"0",null,null,null,null,null).size());//未核实数量(本人+管辖部门)
        result.put("doubtTotal",selectListInfoByTotal2(doctorId,dept,null,null,null,null,1,null).size());//效能异常(本人+管辖部门)
        result.put("urgingTotal",getUrgingList(doctorId,dept,null,null,null,null,null,null).size());//催促数量(本人+管辖部门)
        result.put("notVerifiedTotal",selectListInfoByTotal2(doctorId,dept,"0",DateUtil.getStringDateShort(),DateUtil.getStringDateShort(),null,null,null,null).size());//未核实数量(本人+管辖部门)
        result.put("doubtTotal",selectListInfoByTotal2(doctorId,dept,null,DateUtil.getStringDateShort(),DateUtil.getStringDateShort(),null,1,null,null).size());//效能异常(本人+管辖部门)
        result.put("urgingTotal",getUrgingList(doctorId,dept,null,null,null,null,DateUtil.getStringDateShort()+" 00:00:00",DateUtil.getStringDateShort()+" 23:59:59").size());//催促数量(本人+管辖部门)
        result.put("reportUploadDO",reportUploadDO);
        return result;
    }
@ -1478,7 +1479,7 @@ public class DailyReportUploadService {
     * @param doubtState 存疑0无存疑1存疑
     * @return
     */
    public List<Map<String,Object>> selectListInfoByTotal2(String user,String dept,String state,String startDate,String endDate,String name,Integer doubtState,Integer readState) {
    public List<Map<String,Object>> selectListInfoByTotal2(String user,String dept,String state,String startDate,String endDate,String name,Integer doubtState,Integer readState,String filterOthers) {
        String sqlCondition = " ";
        String boosID = "";
@ -1519,13 +1520,21 @@ public class DailyReportUploadService {
            for (BaseDoctorRoleDO roleDO:baseDoctorRoleDOS){
                if (roleDO.getRoleCode().equalsIgnoreCase("admin")||roleDO.getRoleCode().equalsIgnoreCase("deptAdmin")){
                    flag = false;
                    if (StringUtils.isNotBlank(filterOthers)){//只返回自己应核实的数据
                        if("1".equals(filterOthers)){
                            List<String> myDoctors = getDoctorByRole(user);
                            String doctorsIn = myDoctors.stream().map(String::valueOf).collect(Collectors.joining("','"));
                            condition += " and doc.id in ('"+doctorsIn+"') ";
                        }
                    }
                    break;
                }
            }
            if (flag){
                condition = " and doc.id='"+user+"' ";
                condition += " and doc.id='"+user+"' ";
            }
        }
        sql = " select doc.name,dh.dept_code,dh.dept_name,d1.id,doc.job_title_name as jobTitleName,doc.photo,report_date reportDate,d1.state,total_hour," +
                "\tdoubt_type AS doubtType,\n" +
                "\tdoubt_state AS doubtState,\n" +
@ -4496,6 +4505,45 @@ public class DailyReportUploadService {
        return result;
    }
    /**
     * 获取管理员直系下属,
     * @param user
     * @return
     */
    public List<String> getDoctorByRole(String user){
        List<String> doctors = new ArrayList<>();
        String sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='BOOS_ADMIN_SENDER'  ";
        List<String> boosSenderIds = jdbcTemplate.queryForList(sql, String.class);
        String boosID = " ";
        if (boosSenderIds.size() > 0) {
            boosID = boosSenderIds.get(0);
        }
        sql = " select * from base_doctor_role where doctor_code='"+user+"' ";
        List<Map<String,Object>> userRoles = jdbcTemplate.queryForList(sql);
        if (userRoles.size()==0){
        }else {
            String role_code = userRoles.get(0).get("role_code").toString();
            if ("admin".equals(role_code)){
                sql =  " select DISTINCT doctor_code from base_doctor_role where doctor_code<>'"+boosID+"'" +
                        " UNION " +
                        "SELECT DISTINCT doc.id from base_doctor doc INNER JOIN base_doctor_hospital dh  " +
                        "on doc.id = dh.doctor_code and doc.del=1 and dh.del=1 and doc.identity=0  " +
                        "LEFT JOIN (select role.doctor_code,dh.dept_code from base_doctor_role role INNER JOIN base_doctor doc on role.doctor_code = doc.id and doc.del=1 " +
                        " INNER JOIN base_doctor_hospital dh on doc.id = dh.doctor_code and dh.del=1  )RU on dh.dept_code = RU.dept_code " +
                        " where RU.dept_code is null  ";
                doctors = jdbcTemplate.queryForList(sql,String.class);
            } else if ("deptAdmin".equals(role_code)) {//查询出管理员所在部门
                sql =" select distinct dh2.doctor_code from base_doctor_hospital dh " +
                        "INNER JOIN base_doctor_hospital dh2 on dh.dept_code = dh2.dept_code " +
                        "INNER JOIN base_doctor doc on dh2.doctor_code = doc.id   " +
                        "where dh.doctor_code='"+user+"' and dh.del=1 and doc.identity=0 and dh2.del=1 and doc.del=1  ";
                doctors = jdbcTemplate.queryForList(sql,String.class);
            }
        }
        return doctors;
    }
    /**
     * 初始化项目成员
@ -4581,7 +4629,7 @@ public class DailyReportUploadService {
        sql = " select up.doctor_id,up.doctor_name,doc.job_title_name,dh.dept_name,up.week_name,up.report_date, " +
                "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," +
                "DATE_FORMAT(up.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.doubt_type doubtType, rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +
@ -4640,7 +4688,7 @@ public class DailyReportUploadService {
        sql = " select up.doctor_id,up.doctor_name,doc.job_title_name,dh.dept_name,up.week_name,up.report_date, " +
                "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," +
                "DATE_FORMAT(up.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.doubt_type doubtType, rd.remark " +
                "from base_doctor_daily_report_upload up INNER JOIN base_doctor doc on up.doctor_id = doc.id " +

+ 17 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -11691,6 +11691,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    List<WlyyInspectionVO> inspectionVOs = new ArrayList<>();
                    vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(), 1), inspectionVOs, WlyyInspectionVO.class));
                    //物流信息
                    List<WlyyPrescriptionExpressageDO> expressageDOs = prescriptionExpressageDao.findByOutpatientId(vo.getOutpatientId());
                    if (expressageDOs != null && expressageDOs.size() > 0) {
                        vo.setExpressage(convertToModel(expressageDOs.get(0), WlyyPrescriptionExpressageVO.class));
                        vo.setOneselfPickupFlg(expressageDOs.get(0).getOneselfPickupFlg());
                    } else {
                        vo.setExpressage(null);
                        vo.setOneselfPickupFlg(null);
                    }
                    List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(vo.getOutpatientId());
                    List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
                    if (expressageLogDOs != null && expressageLogDOs.size() > 0) {
                        convertToModels(expressageLogDOs, expressageLogVOs, WlyyPrescriptionExpressageLogVO.class);
                    }
                    vo.setExpressageLogs(expressageLogVOs);
                    //支付信息
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(vo.getId());
                    if (null!=businessOrderDO){

+ 11 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionVO.java

@ -371,6 +371,9 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "检查检验", example = "模块1")
    private List<WlyyInspectionVO> inspectionVOs;
    @ApiModelProperty(value = "物流信息", example = "模块1")
    private List<WlyyPrescriptionExpressageLogVO> expressageLogs ;
    @ApiModelProperty(value = "电子病历", example = "模块1")
    private WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO;
@ -917,4 +920,12 @@ public class WlyyPrescriptionVO extends UuidIdentityVOWithOperator {
    public void setWlyyPrescriptionEmrDO(WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO) {
        this.wlyyPrescriptionEmrDO = wlyyPrescriptionEmrDO;
    }
    public List<WlyyPrescriptionExpressageLogVO> getExpressageLogs() {
        return expressageLogs;
    }
    public void setExpressageLogs(List<WlyyPrescriptionExpressageLogVO> expressageLogs) {
        this.expressageLogs = expressageLogs;
    }
}

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.*;
 * @Date: 2021/8/20 9:28
 */
@RestController
@RequestMapping(value = "open/platform")
@RequestMapping(value = "largeScreen/platform")
@Api(value = "物联网健康监测展示平台v1.0.0", description = "物联网健康监测展示平台v1.0.0", tags = {"物联网健康监测展示平台v1.0.0"})
public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {

+ 1 - 24
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/OpenStatisticsEndpoint.java

@ -9,7 +9,6 @@ import com.yihu.jw.care.service.lifeCare.LifeCareOrderService;
import com.yihu.jw.care.service.patient.CarePatientService;
import com.yihu.jw.care.service.statistics.StatisticsService;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.es.util.SaveModel;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -32,7 +31,7 @@ import java.util.Map;
 * @Description:
 */
@RestController
@RequestMapping(value = "open/statistics")
@RequestMapping(value = "largeScreen/statistics")
@Api(value = "大屏-统计相关", description = "大屏-统计相关", tags = {"大屏-统计相关"})
public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
@ -49,28 +48,6 @@ public class OpenStatisticsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @GetMapping(value = "executeESSQL1")
    @ApiOperation(value = "执行essql语句 返回savemodel")
    public ListEnvelop executeESSQL1(
            @RequestParam(required = true) String sql) {
        try {
            return success(elasticsearchUtil.excute(sql, SaveModel.class, null, null));
        } catch (Exception e) {
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "executeESSQL2")
    @ApiOperation(value = "执行essql语句")
    public ObjEnvelop executeESSQL2(
            @RequestParam(required = true) String sql) {
        try {
            return success(elasticsearchUtil.excuteSql(sql));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "statisticsTotalAmount")
    @ApiOperation(value = "统计总数")
    public ObjEnvelop statisticsTotalAmount(

+ 31 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportMonthReportJob.java

@ -0,0 +1,31 @@
package com.yihu.jw.job.dailyReport;
import com.yihu.jw.service.channel.DailyReportService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 员工月报统计推送通知
 */
public class DailyReportMonthReportJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DailyReportMonthReportJob.class);
    @Autowired
    private DailyReportService dailyReportService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("START========DailyReportMonthReportJob========");
        try {
            dailyReportService.dailyReportMonth();
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("END===ERROE===DailyReportMonthReportJob,message:"+e.getMessage());
        }
    }
}

+ 1 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindJob.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Bing on 2022/7/26.
 * 日报未上传第一次提醒
 */
public class DailyReportRemindJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DailyReportRemindJob.class);

+ 1 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindSecondJob.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Bing on 2022/7/26.
 * 日报未上传二次提醒
 */
public class DailyReportRemindSecondJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DailyReportRemindSecondJob.class);

+ 1 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportTotalRemindJob.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Bing on 2022/7/26.
 * 日报当日上传情况统计通知
 */
public class DailyReportTotalRemindJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DailyReportTotalRemindJob.class);

+ 1 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportWsbTotalRemindJob.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
 * Created by Bing on 2022/7/26.
 * 日报未上报统计通知
 */
public class DailyReportWsbTotalRemindJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(DailyReportWsbTotalRemindJob.class);

+ 118 - 3
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java

@ -1,5 +1,6 @@
package com.yihu.jw.service.channel;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dailyReport.dao.BaseDailyReportDetailDao;
import com.yihu.jw.dailyReport.dao.BaseDailyReportUploadDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -30,9 +31,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
 * Created by Bing on 2022/7/26.
@ -259,4 +259,119 @@ public class DailyReportService {
        }
    }
    public void dailyReportMonth(){
        String sql = " select dict_value from wlyy_hospital_sys_dict where dict_name='BOOS_ADMIN_SENDER'  ";
        List<String> boosSenderIds = jdbcTemplate.queryForList(sql, String.class);
        String boosID = " ";
        if (boosSenderIds.size() > 0) {
            boosID = boosSenderIds.get(0);
        }
        sql = "select id,name,mobile from base_doctor where del=1 and identity=0 and id<>'"+boosID+"' ";
        List<Map<String,Object>> patientList = jdbcTemplate.queryForList(sql);
        Date lastMonth= DateUtil.getNextMonthReturnDate(new Date(),-1);
        String monthStartDay = DateUtil.getFristDayOfMonthThisDate(lastMonth);
        String monthEndDay = DateUtil.getLastDayOfMonthThisDate(lastMonth);
        sql = " select dict_value from  wlyy_hospital_sys_dict where dict_name='healthUpload' and dict_code='healthUpload' ";
        List<String> dictValues = jdbcTemplate.queryForList(sql,String.class);
        JSONObject doubtTypeObj = new JSONObject();
        if (dictValues.size()>0){
            doubtTypeObj = JSONObject.parseObject(dictValues.get(0)).getJSONObject("dailyReportDoubtTypeName");
        }
        String monthStr = DateUtil.dateToStr(lastMonth,"MM");
        for (Map<String,Object>tmp:patientList){
            String msg = "{name},{month}月份月报:效能异常:{doubtTotal}次,请假:{leaveHour}个小时,未上报:{weishangbao}次,{doubtTypeMsg},项目催促:{xmcc}次,效能异常超过3次扣绩效! ";
            String user = tmp.get("id").toString();
            String name = null==tmp.get("name")?"":tmp.get("name").toString();
            String mobile = null==tmp.get("mobile")?"":tmp.get("mobile").toString();
            //效能异常
           sql = "select count(distinct d1.id)from base_doctor_daily_report_upload d1 INNER JOIN base_doctor doc on d1.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 de on d1.id = de.report_id " +
                    "where doc.del=1 and doc.identity=0 and doc.id='"+user+"' and d1.report_date>='"+monthStartDay+"' and d1.report_date<='"+monthEndDay+"'  and de.doubt=1 ";
           Integer doubtTotal = jdbcTemplate.queryForObject(sql,Integer.class);
           if (doubtTotal>3){
               continue;
           }
            //请假
            Double leaveHour = 0d;
            sql = " select sum(cast(IFNULL(leave_hour,IFNULL(leave_hour,0)) as decimal(18,2))) from base_doctor_daily_report_upload up where up.doctor_id='"+user+"' and up.report_date>='"+monthStartDay+"' and up.report_date<='"+monthEndDay+"' ";
            leaveHour = jdbcTemplate.queryForObject(sql,Double.class);
            leaveHour = null==leaveHour?0:leaveHour;
            //未上报
            Long weishangbao=0l;
            Long workDays=0l;
            if (StringUtils.isNotBlank(monthStartDay)&&StringUtils.isNotBlank(monthEndDay)) {
                workDays = DateUtil.getWorkDays(monthStartDay, monthEndDay);
            }
            sql = " select count(id) from base_doctor_daily_report_upload up where up.doctor_id='"+user+"' and up.report_date>='"+monthStartDay+"' and up.report_date<='"+monthEndDay+"' ";
            Long yishangbao = jdbcTemplate.queryForObject(sql,Long.class);
            weishangbao = (workDays-yishangbao)<0?0:workDays-yishangbao;
            sql = " select count(distinct up.id) as total,rd.doubt_type " +
                    " from base_doctor_daily_report_upload up  " +
                    "INNER JOIN base_doctor doc on up.doctor_id = doc.id and doc.del=1 " +
                    "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 " +
                    "LEFT join base_daily_report_item i on i.id = rd.report_item_id and i.del=1 and up.state=1 where 1=1 " +
                    " and doc.id='"+user+"' and up.report_date>='"+monthStartDay+"' and up.report_date<='"+monthEndDay+"'  group by rd.doubt_type";
            List<Map<String,Object>> doubtTypeList = jdbcTemplate.queryForList(sql);
            List<Map<String,Object>> personDoubtList = new ArrayList<>();
            for (Map<String,Object>doubtTmp:doubtTypeList){
                if (doubtTmp.get("doubt_type")==null){
                }else {
                    String doubtType = doubtTmp.get("doubt_type").toString();
                    if(doubtTypeObj.containsKey(doubtType)){
                        doubtTmp.put("doubtTypeName",doubtTypeObj.get(doubtType));
                    }else {
                        doubtTmp.put("doubtTypeName","其他");
                    }
                    personDoubtList.add(doubtTmp);
                }
            }
            List<String> doubtListStr = personDoubtList.stream().map(e -> e.get("doubt_type").toString()).collect(Collectors.toList());
            for (String key:doubtTypeObj.keySet()){
                if (!doubtListStr.contains(key)){
                    Map<String,Object>doubtTmp = new HashMap<>();
                    doubtTmp.put("doubt_type",key);
                    doubtTmp.put("doubtTypeName",doubtTypeObj.get(key));
                    doubtTmp.put("total",0);
                    personDoubtList.add(doubtTmp);
                }
            }
            personDoubtList.sort((Comparator.comparing(e->e.get("doubt_type").toString())));
            List<String> doubtTypeMsgs = new ArrayList<>();
            for (Map<String,Object> personDoubt:personDoubtList ){
                String doubtName = personDoubt.get("doubtTypeName").toString();
                String total = personDoubt.get("total").toString();
                doubtTypeMsgs.add(doubtName+total+"次");
            }
            String doubtTypeMsg = doubtTypeMsgs.stream().map(String::valueOf).collect(Collectors.joining(","));
            //项目催促
            Integer xmcc=0;
            sql = " select count(id) from base_daily_urging_record where receive_doctor='"+user+"' and create_time>='"+monthStartDay +" 00:00:00' and create_time<='"+monthEndDay+" 23:59:59' ";
            xmcc = jdbcTemplate.queryForObject(sql,Integer.class);
            try {
                WxEnterpriseUserDO enterpriseUserDO = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(wechatId, mobile);
                if (enterpriseUserDO == null) {
                    logger.info("该用户" + name + "没有企业微信手机号,无法推送模版消息,用户ID:" + user + "wechatId:" + wechatId);
                } else {
                    String title = "月报反馈";
                    String des = msg.replace("{name}",name).replace("{name}",name).replace("{month}",monthStr+"")
                            .replace("{doubtTotal}",doubtTotal+"").replace("{leaveHour}",leaveHour+"")
                            .replace("{weishangbao}",weishangbao+"").replace("{doubtTypeMsg}",doubtTypeMsg).replace("{xmcc}",xmcc+"");
                    logger.info(des);
                    String url = "https://ehr.yihu.com/hlwyy/zjxl/dailyReport/#/home/index";
                    String res = enterpriseService.sendTWMesByDoctor(wechatId, user, title, des, url);
                }
            }catch (Exception e){
                e.printStackTrace();
            }
        }
    }
}

+ 11 - 4
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -10,10 +10,7 @@ import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.internet.service.YkyyCommonService;
import com.yihu.jw.internet.service.ykyy.YkyyInternetService;
import com.yihu.jw.job.*;
import com.yihu.jw.job.dailyReport.DailyReportRemindJob;
import com.yihu.jw.job.dailyReport.DailyReportRemindSecondJob;
import com.yihu.jw.job.dailyReport.DailyReportTotalRemindJob;
import com.yihu.jw.job.dailyReport.DailyReportWsbTotalRemindJob;
import com.yihu.jw.job.dailyReport.*;
import com.yihu.jw.job.yk.YKYYDataUploadJob;
import com.yihu.jw.job.ykyy.UnCheckPrescriptionJob;
import com.yihu.jw.job.ykyy.UnSettledHISPrescriptionJob;
@ -370,6 +367,16 @@ public class JobController extends BaseController {
                        logger.info("DailyReportWsbTotalRemindJob  job exist");
                    }
                    break;
                case "DailyReportMonthReportJob" :
                    //日报未上报通知
                    if (!quartzHelper.isExistJob("DailyReportMonthReportJob")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("DailyReportMonthReportJob");
                        quartzHelper.addJob(DailyReportMonthReportJob.class, trigger, "DailyReportMonthReportJob", new HashMap<String, Object>());
                        logger.info("DailyReportMonthReportJob  job success");
                    } else {
                        logger.info("DailyReportMonthReportJob  job exist");
                    }
                    break;
                default :
            }
            return success("启动成功!");

+ 2 - 0
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -49,3 +49,5 @@ DailyReportTotalRemindJob=0 0 22 * * ? *
DailyReportWsbTotalRemindJob=0 0 21 * * ? *
DailyReportMonthReportJob=0 0 9 1 * ? *

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

@ -15,6 +15,7 @@ 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.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -118,6 +120,11 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                        @ApiParam(name = "jsonData", value = "事项信息实体")
                                        @RequestParam(value = "jsonData", required = true) String jsonData) {
        try {
            Date date = new Date();
            Date date2 = DateUtil.strToDate(DateUtil.getStringDateShort()+" 22:00:00");
            if (date.after(date2)){
                return ObjEnvelop.getError("您已错过提交时间,无法提交!日报提交和修改时间为当天晚上十点之前。");
            }
            List<BaseDailyReportDetailDO> healthUploadDOs = new ArrayList<>();
            if (StringUtils.isNoneBlank(jsonData)){
                healthUploadDOs = JSONArray.parseArray(jsonData,BaseDailyReportDetailDO.class);
@ -362,8 +369,8 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "首页按照科室统计")
    public ListEnvelop selectHeaderListHeshi(@ApiParam(name = "dept", value = "科室code")
                                        @RequestParam(value = "dept", required = false) String dept,
                                             @ApiParam(name = "doctor", value = "当前用户")
                                             @RequestParam(value = "doctor", required = false) String doctor,
                                        @ApiParam(name = "doctor", value = "当前用户")
                                        @RequestParam(value = "doctor", required = false) String doctor,
                                        @ApiParam(name = "idType", value = "身份类别")
                                        @RequestParam(value = "idType", required = false) String idType,
                                        @ApiParam(name = "state", value = "核实状态0未核实1已核实")
@ -454,9 +461,11 @@ public class DailyReportUploadPoint extends EnvelopRestEndpoint {
                                             @ApiParam(name = "endDate", value = "结束时间")
                                             @RequestParam(value = "endDate", required = false) String endDate,
                                             @ApiParam(name = "name", value = "具体医生姓名")
                                             @RequestParam(value = "name", required = false) String name) {
                                             @RequestParam(value = "name", required = false) String name,
                                             @ApiParam(name = "filterOthers", value = "过滤不属于自己核实的数据1过滤 0不过滤")
                                             @RequestParam(value = "filterOthers", required = false) String filterOthers) {
        try {
            return ListEnvelop.getSuccess("success",dailyReportUploadService.selectListInfoByTotal2(user,dept,state,startDate,endDate,name,doubtState,readState));
            return ListEnvelop.getSuccess("success",dailyReportUploadService.selectListInfoByTotal2(user,dept,state,startDate,endDate,name,doubtState,readState,filterOthers));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -476,7 +476,7 @@ public class RehabilitationManageService {
        for (int i=1;i<planIdlist.length;i++){
            planCondition .append(",'"+planIdlist[i]+"'");
        }
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,IF(d.followup_detail_type=1,'康复随访(社区)',i.name) name,1 as flag from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
        String sql = " select d.*,DATE_FORMAT(d.execute_time,'%Y/%m/%d %H:%i') as executeTime ,i.code,IF(d.followup_detail_type=1,'社区随访(厦心)',i.name) name,1 as flag from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_rehabilitation_service_item i on i.code = d.hospital_service_item_id  " +
                " where  d.plan_id in ("+planCondition+" )AND  d.execute_time IS NOT NULL  and d.execute_time <>'' " ;
        if(searchTask!=null){