Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 7 years ago
parent
commit
92069b15f3

+ 11 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -75,6 +75,8 @@ public class Prescription extends IdEntity {
    private List<PrescriptionInfo> prescriptionInfo;
    private String reviewedState;
    @Column(name = "code", unique = true, nullable = false)
    public String getCode() {
        return code;
@ -555,4 +557,13 @@ public class Prescription extends IdEntity {
    public void setPrescriptionInfo(List<PrescriptionInfo> prescriptionInfo) {
        this.prescriptionInfo = prescriptionInfo;
    }
    @Transient
    public String getReviewedState() {
        return reviewedState;
    }
    public void setReviewedState(String reviewedState) {
        this.reviewedState = reviewedState;
    }
}

+ 0 - 14
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/ConsultJob.java

@ -107,20 +107,6 @@ public class ConsultJob implements Job {
        }
    }
    private String saveContent(List<ConsultTeam> consultTeams, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent,Long errorCount,String sql) {
        StringBuffer string=new StringBuffer("统计"+yesterday+" 的咨询数据完成 ,数据库查询到咨询数目:"+consultTeams.size());
        string.append(",sql语句:"+sql);
        string.append(",过滤的脏数据数目:"+errorCount);
        string.append(",统计到市的数据总数:"+cityCount);
        string.append(",统计到区的数据总数:"+townCount);
        string.append(",统计到机构的数据总数:"+orgCount);
        string.append(",统计到团队的数据总数:"+qkCount);
        string.append(",是否统计成功:"+isAll);
        if(!isAll){
            string.append(",失败原因:"+errorContent);
        }
        return string.toString();
    }
    public String getYesterday() {
        Calendar cal = Calendar.getInstance();

+ 5 - 16
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/ConsultTotalJob.java

@ -83,7 +83,7 @@ public class ConsultTotalJob implements Job {
            quartzJobLog.setJobStartTime(new Date());
            quartzJobLog.setJobId(wlyyJobConfig.getId());
            quartzJobLog.setJobName(wlyyJobConfig.getJobName());
            String sql=" select admin_team_code,id from wlyy_consult_team a where a.czrq< '"+yesterday+ Constant.quota_date_last+"' and a.czrq >'"+Constant.getStartTimeByDate(yesterday)+"'";
            String sql=" select admin_team_code,id from wlyy_consult_team a where a.czrq< '"+yesterday+ Constant.quota_date_last+"' and a.czrq >='"+Constant.getStartTimeByDate(yesterday)+ Constant.quota_date_last+"'";
            //抽取數據
            List<ConsultTeam> consultTeams= dbExtract.extract(ConsultTeam.class,sql);
            //過濾數據
@ -103,25 +103,14 @@ public class ConsultTotalJob implements Job {
        }
    }
    private String saveContent(List<ConsultTeam> consultTeams, Long qkCount, Long orgCount, Long townCount, Long cityCount, boolean isAll, StringBuffer errorContent,Long errorCount,String sql) {
        StringBuffer string=new StringBuffer("统计"+yesterday+" 的咨询数据完成 ,数据库查询到咨询数目:"+consultTeams.size());
        string.append(",sql语句:"+sql);
        string.append(",过滤的脏数据数目:"+errorCount);
        string.append(",统计到市的数据总数:"+cityCount);
        string.append(",统计到区的数据总数:"+townCount);
        string.append(",统计到机构的数据总数:"+orgCount);
        string.append(",统计到团队的数据总数:"+qkCount);
        string.append(",是否统计成功:"+isAll);
        if(!isAll){
            string.append(",失败原因:"+errorContent);
        }
        return string.toString();
    }
    public String getYesterday() {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DATE, -1);
        String yesterday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
        return yesterday;
    }
    public static void main(String[] args) throws Exception{
        System.out.println(Constant.getStartTimeByDate("2017-08-12"));
    }
}

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -1117,7 +1117,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId = "25";
        try {
            //找出总的咨询信息
            String sql = " select * from wlyy_consult_team a where a.czrq< '" + tomorrow + "' and  a.czrq> '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'";
            String sql = " select * from wlyy_consult_team a where a.czrq< '" + tomorrow + "' and  a.czrq>= '" + Constant.getStartTimeByDate(tomorrow)+Constant.quota_date_last + "'";
            //抽取數據
            List<ConsultTeam> consultTeams = SpringUtil.getBean(DBExtract.class).extract(ConsultTeam.class, sql);
            //過濾數據

+ 1 - 0
patient-co/patient-co-wlyy/pom.xml

@ -445,6 +445,7 @@
                <excludes>
                    <exclude>downloadPage.html</exclude>
                    <exclude>ssgg_doctor.plist</exclude>
                    <exclude>images/**</exclude>
                </excludes>
            </resource>
            <resource>

+ 16 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -116,16 +116,24 @@ public class PresModeAdapter {
            while (iterator.hasNext()){
                JSONArray modeArray = (JSONArray) iterator.next();
                JSONObject mode = (JSONObject) modeArray.get(0);
                Prescription p  = new Prescription();
                p.setCode(mode.getInteger("RECIPE_NO")+"");
                p.setCreateTime(mode.getDate("APPLY_TIME"));
                JSONObject p  = new JSONObject();
                p.put("code",mode.getInteger("RECIPE_NO")+"");
                p.put("createTime",mode.getString("APPLY_TIME"));
                Doctor doctor =  zyDictService.getDoctByJw(mode.getString("APPLY_OPERATOR"),mode.getString("HEALTH_ORG_CODE"));
                // "APPLY_OPERATOR_NAME": 开单医生姓名","HEALTH_ORG_CODE": "开单机构编码",
                p.setDoctor(doctor.getCode());
                p.setDoctorName(doctor.getName());
                p.setHospitalName(doctor.getHospitalName());
                p.setHospital(doctor.getHospital());
                if(doctor!=null){
                    p.put("doctor",doctor.getCode());
                    p.put("doctorName",doctor.getName());
                    p.put("hospitalName",doctor.getHospitalName());
                    p.put("hospital",doctor.getHospital());
                }else{
                    p.put("doctor",mode.getString("APPLY_OPERATOR"));
                    p.put("hospitalName",mode.getString("APPLY_OPERATOR_NAME"));
                    //p.setHospitalName(doctor.getHospitalName());
                    p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
                }
                PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
                diagnosis.setCode(mode.getString("DIAGNOSE_CODE"));//诊断代码
@ -177,7 +185,7 @@ public class PresModeAdapter {
                    prescriptionInfo.setPhysicSkinTestName(info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
                    prescriptionInfos.add(prescriptionInfo);
                }
                p.setPrescriptionInfo(prescriptionInfos);
                p.put("prescriptionInfo",prescriptionInfos);
                rs.add(p);
            }
            return rs;

+ 9 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.service.app.prescription;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -498,14 +499,14 @@ public class PatientPrescriptionPayService extends BaseService {
                        expressage.setDel(1);//快递信息状态 1可用 0删除
                        expressageDao.save(expressage);
                        prescriptionDao.save(prescription);
                        if (sendType==2){
                        if (sendType == 2) {
                            //插入发送给团队长的系统消息
                            Message message= messageDao.findByRelationCode(prescriptionCode);
                            Message message = messageDao.findByRelationCode(prescriptionCode);
                            String receiver = message.getReceiver();
                            int type = message.getType();
                            String title = message.getTitle();
                            String content = message.getContent();
                            pushMsgTask.put(receiver,"3",title , content,"");
                            pushMsgTask.put(receiver, "3", title, content, "");
                            message.setOver("1");//操作结束
                            message.setState(1);//已发送
                            message.setCzrq(new Date());
@ -662,7 +663,7 @@ public class PatientPrescriptionPayService extends BaseService {
                        " FROM wlyy_sign_family t,wlyy_admin_team a,wlyy_doctor d " +
                        " WHERE t.admin_team_code=a.id AND d.code=a.leader_code " +
                        " AND t.patient=? ";
                Map<String,Object> team = jdbcTemplate.queryForMap(sql,people);
                Map<String, Object> team = jdbcTemplate.queryForMap(sql, people);
                String teamCode = team.get("teamCode").toString();
                String leaderCode = team.get("leaderCode").toString();
                String leaderName = team.get("leaderName").toString();
@ -678,8 +679,8 @@ public class PatientPrescriptionPayService extends BaseService {
                message.setSender("SYSTEM");//发送者
                message.setSenderName("SYSTEM");//发送者
                message.setTitle("新增系统消息");
                SimpleDateFormat format=new SimpleDateFormat("MM月dd日");
                String content=format.format(new Date())+"新增1个签约居民待分配健管师,目前共"+amount+"人待处理";
                SimpleDateFormat format = new SimpleDateFormat("MM月dd日");
                String content = format.format(new Date()) + "新增1个签约居民待分配健管师,目前共" + amount + "人待处理";
                message.setContent(content);
                message.setType(3);//分配健管师
                message.setPlatform(2);//消息平台,1微信端/患者端,2医生APP端
@ -789,10 +790,10 @@ public class PatientPrescriptionPayService extends BaseService {
            JSONObject recipe = jsonParams.getJSONObject("recipeContent");
            params.put("recipeContent", recipe);// 处方主信息
            prescriptionPay.setRecipeContent(recipe.toJSONString());//处方主信息
            JSONObject zdContent = jsonParams.getJSONObject("zdlist");
            JSONArray zdContent = jsonParams.getJSONArray("zdlist");
            params.put("zdlist", zdContent);// 诊断明细
            prescriptionPay.setZdlist(zdContent.toJSONString());//诊断明细
            JSONObject mxContent = jsonParams.getJSONObject("mxlist");
            JSONArray mxContent = jsonParams.getJSONArray("mxlist");
            params.put("mxlist", mxContent);//处方明细
            prescriptionPay.setMxlist(mxContent.toJSONString());//处方明细

+ 3 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -129,9 +129,8 @@ public class PrescriptionInfoService extends BaseService {
                String rp= jwPrescriptionService.getLastRecipe(p.getSsc(),null,null,null);
                com.alibaba.fastjson.JSONArray pres =presModeAdapter.modeToPrescription(rp);
                Iterator iterator = pres.iterator();
                while(iterator.hasNext()){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject)iterator.next();
                for(int i=0;i<pres.size();i++){
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) pres.get(i);
                    r.put("reviewedState",presCheckState(r.getString("code")));
                }
                return pres;
@ -1008,7 +1007,7 @@ public class PrescriptionInfoService extends BaseService {
     * @return 0 审核中,1为处理完成
     */
    public String presCheckState(String code){
        StringBuffer sql = new StringBuffer(" SELECT pr.code FORM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND r.status = 0");
        StringBuffer sql = new StringBuffer(" SELECT pr.code FROM wlyy_prescription pr JOIN wlyy_prescription_reviewed r ON pr.code = r.prescription_code WHERE pr.parent_code = ? AND r.status = 0");
        List<Map<String,Object>> mp = jdbcTemplate.queryForList(sql.toString(),code);
        if(mp!=null&&mp.size()>0){
            return "0";

+ 16 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -237,22 +237,22 @@ public class WeiXinEventProcess {
        articles.add(articleExamination);
//        新增处方记录图文消息
//        Map<String, String> articlePrescription = new HashMap<>();
//        // 图文URL
//        String prescription = systemConf.getProperty("patient_prescription_url");
//        // 图文消息图片URL
//        String prescription_pic = systemConf.getProperty("patient_prescription_pic");
//        // URL设置服务器URL、AppId
//        prescription = prescription.replace("{server}",wechat_base_url)
//                .replace("{appId}",appId);
//        //图片地址
//        prescription_pic = prescription_pic.replace("{server}",serverUrl);
//
//        articlePrescription.put("Url", prescription);
//        articlePrescription.put("Title", "处方记录");
//        articlePrescription.put("Description", "处方记录");
//        articlePrescription.put("PicUrl", prescription_pic);
//        articles.add(articlePrescription);
        Map<String, String> articlePrescription = new HashMap<>();
        // 图文URL
        String prescription = systemConf.getProperty("patient_prescription_url");
        // 图文消息图片URL
        String prescription_pic = systemConf.getProperty("patient_prescription_pic");
        // URL设置服务器URL、AppId
        prescription = prescription.replace("{server}",wechat_base_url)
                .replace("{appId}",appId);
        //图片地址
        prescription_pic = prescription_pic.replace("{server}",serverUrl);
        articlePrescription.put("Url", prescription);
        articlePrescription.put("Title", "处方记录");
        articlePrescription.put("Description", "处方记录");
        articlePrescription.put("PicUrl", prescription_pic);
        articles.add(articlePrescription);
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -25,7 +25,7 @@ patient_inspect_url =https://open.weixin.qq.com/connect/oauth2/authorize?appid={
#社区体检
patient_examination_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fjkda%2fhtml%2fjiankangtijian.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#处方记录
patient_prescription_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fjkda%2fhtml%2fjiankangtijian.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
patient_prescription_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fprescription%2fhtml%2fprescription_records.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#就诊记录