Prechádzať zdrojové kódy

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

wsl 2 rokov pred
rodič
commit
429e12344e
15 zmenil súbory, kde vykonal 349 pridanie a 34 odobranie
  1. 17 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 144 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.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. 7 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  7. 31 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportMonthReportJob.java
  8. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindJob.java
  9. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportRemindSecondJob.java
  10. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportTotalRemindJob.java
  11. 1 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/dailyReport/DailyReportWsbTotalRemindJob.java
  12. 118 3
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/DailyReportService.java
  13. 11 4
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  14. 2 0
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  15. 2 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dailyReport/DailyReportUploadPoint.java

+ 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){

+ 144 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -2348,6 +2348,150 @@ public class EntranceService {
    }
    public net.sf.json.JSONObject MS02004(boolean demoFlag,String idcard) throws Exception {
        int i = 0;
        String fid = "MS02003";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10000</endNum><Msg></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        }
        net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(resp);
        logger.info("获取医生数据"+jsonObject.toString());
        net.sf.json.JSONObject jsonObject1 = new  net.sf.json.JSONObject();
        if (null != jsonObject && "1".equals(jsonObject.get("code").toString())) {
            JSONArray jsonObjectMgsInfo = (JSONArray) jsonObject.get("MsgInfo");
            if (null != jsonObjectMgsInfo) {
                for (Object object : jsonObjectMgsInfo) {
                    JSONArray jsonArray = JSONArray.fromObject(object);
                    net.sf.json.JSONObject jsonArraySub = jsonArray.getJSONObject(0);
//                    net.sf.json.JSONObject jsonArraySub = (net.sf.json.JSONObject) object;
                    jsonObjectMgsInfo = (JSONArray) jsonArraySub.get("body");
                    if (jsonObjectMgsInfo instanceof JSONArray) {
                        for (Object objectSub : jsonObjectMgsInfo) {
                            net.sf.json.JSONObject jsonObjectBody = (net.sf.json.JSONObject) objectSub;
                            String doctorCode = "";
                            String doctorName = "";
                            if (null != jsonObjectBody) {
                                //获取中山医院的医生
                                String winNo = "6";
                                doctorCode = null == jsonObjectBody.get("Emp_Code") ? "" : jsonObjectBody.get("Emp_Code").toString();
                                //根据医生及分部,获取医生号别
                                net.sf.json.JSONArray jsonArrayCharge = BS55010(winNo, doctorCode, null, false);
                                String chareType = null;
                                if (null != jsonArrayCharge) {
                                    for (Object objectCharge : jsonArrayCharge) {
                                        net.sf.json.JSONObject jsonObjectBodyCharge = (net.sf.json.JSONObject) objectCharge;
                                        if (null != jsonObjectBodyCharge) {
                                            chareType = null == jsonObjectBodyCharge.get("charge_type") ? null : jsonObjectBodyCharge.get("charge_type").toString();
                                        }
                                    }
                                }
                                //保存医生信息
                                BaseDoctorDO baseDoctorDO = new BaseDoctorDO();
                                String idCard = null == jsonObjectBody.get("Card_Id") ? "" : jsonObjectBody.get("Card_Id").toString();
                                if (idCard.equalsIgnoreCase(idcard)){
                                    jsonObject1 = jsonObjectBody;
                                    List<BaseDoctorDO> baseDoctorDOS = baseDoctorDao.findByIdcard(idCard);
                                    if (baseDoctorDOS!=null&&baseDoctorDOS.size()!=0){
                                        baseDoctorDO=baseDoctorDOS.get(0);
                                        String disableFlag = null == jsonObjectBody.get("Disable_Flag") ? "" : jsonObjectBody.get("Disable_Flag").toString();
                                        //互联网医院:1停用,0使用  转 i健康:1正常,0作废
                                        baseDoctorDO.setDel("1".equals(disableFlag) ? "0" : "1");
                                    }else {
                                        baseDoctorDO.setIdcard(idCard);
                                        baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                                        baseDoctorDO.setSex(Integer.valueOf(IdCardUtil.getSexForIdcard(idCard)));
                                        baseDoctorDO.setLocked(0);
                                        baseDoctorDO.setEnabled(1);
                                        String disableFlag = null == jsonObjectBody.get("Disable_Flag") ? "" : jsonObjectBody.get("Disable_Flag").toString();
                                        //互联网医院:1停用,0使用  转 i健康:1正常,0作废
                                        baseDoctorDO.setDel("1".equals(disableFlag) ? "0" : "1");
                                        baseDoctorDO.setMobile("0");
                                        baseDoctorDO.setName(doctorName);
                                        baseDoctorDO.setIsFamous(0);
                                        baseDoctorDO.setCreateTime(new Date());
                                        baseDoctorDO.setUpdateTime(new Date());
                                        if (StringUtils.isNotBlank(idCard)) {
                                            baseDoctorDO.setSalt(PwdUtil.randomString(5));
                                            try {
                                                baseDoctorDO.setPassword(com.yihu.utils.security.MD5.md5Hex(baseDoctorDO.getIdcard().substring(baseDoctorDO.getIdcard().length() - 6) + "{" + baseDoctorDO.getSalt() + "}"));
                                            } catch (Exception e) {
                                                logger.error(e.getMessage() + "docotr=" + doctorCode + ";idcard=" + baseDoctorDO.getIdcard());
                                            }
                                        } else {
                                            baseDoctorDO.setPassword(com.yihu.utils.security.MD5.md5Hex("123456" + "{" + baseDoctorDO.getSalt() + "}"));
                                        }
                                        //拼音码
                                        baseDoctorDO.setSpell(null == jsonObjectBody.get("PinYin_Code") ? "" : jsonObjectBody.get("PinYin_Code").toString());
                                        //姓名
                                        doctorName = null == jsonObjectBody.get("Emp_Name") ? "" : jsonObjectBody.get("Emp_Name").toString();
                                        //号别
                                        baseDoctorDO.setChargeType(chareType);
                                        // 用医生和机构id、部门判断数据是否存在,若不存在则保存医生机构关联关系
                                        String deptCode = null == jsonObjectBody.get("Dept_Code") ? "" : jsonObjectBody.get("Dept_Code").toString();
                                        List<BaseDoctorHospitalDO> baseDoctorHospitalDOS = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode("350211A1002", deptCode, baseDoctorDO.getId());
                                        if (!(null != baseDoctorHospitalDOS && baseDoctorHospitalDOS.size() > 0)) {
                                            baseDoctorHospitalDao.delete(baseDoctorHospitalDOS);
                                            BaseDoctorHospitalDO baseDoctorHospitalDO = new BaseDoctorHospitalDO();
                                            baseDoctorHospitalDO.setOrgCode("350211A1002");
                                            baseDoctorHospitalDO.setOrgName("厦门大学附属中山医院");
                                            baseDoctorHospitalDO.setDoctorCode(baseDoctorDO.getId());
                                            baseDoctorHospitalDO.setDeptCode(deptCode);
                                            //根据机构编码获取机构名称
                                            List<DictHospitalDeptDO> dictHospitalDeptDOS = dictHospitalDeptDao.findByOrgCodeAndCode("350211A1002", deptCode);
                                            if (null != dictHospitalDeptDOS && dictHospitalDeptDOS.size() > 0) {
                                                DictHospitalDeptDO dictHospitalDeptDO = dictHospitalDeptDOS.get(0);
                                                baseDoctorHospitalDO.setDeptName(dictHospitalDeptDO.getName());
                                            }
                                            baseDoctorHospitalDO.setDel("1");
                                            baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                                        }
                                    }
                                    baseDoctorDO = baseDoctorDao.save(baseDoctorDO);
                                    //根据医生和机构判断数据是否存在,若不存在则在mapping中追加记录
                                    List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByDoctorAndOrgCode(baseDoctorDO.getId(), "350211A1002");
                                    if (!(null != doctorMappingDOS && doctorMappingDOS.size() > 0)) {
                                        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
                                        doctorMappingDao.delete(doctorMappingDOS);
                                        doctorMappingDO.setDoctor(baseDoctorDO.getId());
                                        doctorMappingDO.setDoctorName(doctorName);
                                        doctorMappingDO.setMappingCode(doctorCode);
                                        doctorMappingDO.setMappingName(doctorName);
                                        doctorMappingDO.setOrgCode("350211A1002");
                                        doctorMappingDO.setOrgName("厦门大学附属中山医院");
                                        doctorMappingDao.save(doctorMappingDO);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
//            net.sf.json.JSONArray jsonArray = ConvertUtil.convertListEnvelopInBodyRowMS02003(resp);
//            for (Object object : jsonArray) { }
//        }
        return jsonObject1;
    }

+ 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(

+ 7 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -374,6 +374,13 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(obj);
    }
    @GetMapping(value = "/MS02004")
    @ApiOperation(value = "获取医生信息")
    public Envelop MS02004(@ApiParam(name = "idcard", value = "身份证")
                               @RequestParam(value = "idcard", required = true) String idcard) throws Exception {
        return success(entranceService.MS02004(demoFlag,idcard));
    }
    @GetMapping(value = "/MS02014")
    @ApiOperation(value = "医生详细信息同步")
    public ObjEnvelop MS02014() throws Exception {

+ 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 * ? *

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

@ -369,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已核实")