Bläddra i källkod

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 2 år sedan
förälder
incheckning
a5222a80ca

+ 25 - 1
business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java

@ -388,7 +388,15 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
     * @return
     * @return
     */
     */
    public JSONObject selectHealthByRole(String dept, int level, String doctorId) {
    public JSONObject selectHealthByRole(String dept, int level, String doctorId) {
        String nowDate = DateUtil.getStringDateShort();
        String nowDate = DateUtil.getStringDateShort();
        Date startDate = DateUtil.strToDateLong(nowDate + " 00:00:00'");
        Date endDate = DateUtil.strToDateLong(nowDate + " 23:59:59'");
        BaseDoctorHealthUploadDO healthUploadDO = new BaseDoctorHealthUploadDO();
        List<BaseDoctorHealthUploadDO> healthUploadDOList = baseDoctorHealthUploadDao.selectHealthUploadInfoByDoctorIdAndStartAndEnd(doctorId,startDate,endDate);
        if (healthUploadDOList!=null&&healthUploadDOList.size()!=0){
            healthUploadDO = healthUploadDOList.get(0);
        }
        //今日本人提交
        //今日本人提交
        String benrenSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id) and  create_time >='" + nowDate + " 00:00:00' and create_time<='" + nowDate + " 23:59:59'";
        String benrenSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id) and  create_time >='" + nowDate + " 00:00:00' and create_time<='" + nowDate + " 23:59:59'";
        //今日提交
        //今日提交
@ -399,16 +407,21 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        String benrenshangbaoSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id)";
        String benrenshangbaoSql = "select count(1) as total from base_doctor_health_upload where consumer='" + doctorId + "' and consumer in(doctor_id)";
        String doctorSql = "";
        String doctorSql = "";
        String sql = "";
        String sql = "";
        String yichangSql = "";
        if (level == 1) {
        if (level == 1) {
            //总人次
            //总人次
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 ";
            //今日上报人次
            //今日上报人次
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' ";
            //今日异常人次
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
        } else if (level == 2) {
        } else if (level == 2) {
            //总人次
            //总人次
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 and id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
            doctorSql = " select COUNT(1) as \"total\" from base_doctor d where d.del=1 and id IN (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 )";
            //今日上报人次
            //今日上报人次
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
            sql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59'";
            //今日异常人次
            yichangSql = "select COUNT(DISTINCT d.doctor_id) as \"total\" from base_doctor_health_upload d where 1=1 and doctor_id in (select dh.doctor_code from base_doctor_hospital dh where dh.dept_code = '" + dept + "' and dh.del=1 ) and d.create_time >='" + nowDate + " 00:00:00' and d.create_time<='" + nowDate + " 23:59:59' and (d.health_code in(2,3) OR CAST(d.temperature as DECIMAL)>=37.3 OR  d.is_symptoms=1 OR d.is_epidemic=1)";
        }
        }
        //今日提交
        //今日提交
        int personTotal = 0;
        int personTotal = 0;
@ -422,6 +435,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        int sqlTotal = 0;
        int sqlTotal = 0;
        //今日未上报人次
        //今日未上报人次
        int notUploadTotal = 0;
        int notUploadTotal = 0;
        //
        int yichangTotal = 0;
        Map<String, Object> personMap = jdbcTemplate.queryForMap(personSql);
        Map<String, Object> personMap = jdbcTemplate.queryForMap(personSql);
        if (personMap != null) {
        if (personMap != null) {
            if (personMap.get("total") != null) {
            if (personMap.get("total") != null) {
@ -463,6 +478,13 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            }
            }
        }
        }
        Map<String, Object> yichangMap = jdbcTemplate.queryForMap(yichangSql);
        if (yichangMap != null) {
            if (yichangMap.get("total") != null) {
                yichangTotal = Integer.parseInt(yichangMap.get("total").toString());
            }
        }
        JSONObject object = new JSONObject();
        JSONObject object = new JSONObject();
        object.put("personTotal", personTotal);//今日上报人数
        object.put("personTotal", personTotal);//今日上报人数
@ -472,6 +494,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
        object.put("sqlTotal", sqlTotal);//今日上报人数
        object.put("sqlTotal", sqlTotal);//今日上报人数
        object.put("notUploadTotal", doctorTotal - sqlTotal);//今日未上报人数
        object.put("notUploadTotal", doctorTotal - sqlTotal);//今日未上报人数
        object.put("benrenTotal", benrenTotal);//今日本人提交
        object.put("benrenTotal", benrenTotal);//今日本人提交
        object.put("healthUploadDO",healthUploadDO);
        object.put("yichangTotal",yichangTotal);//今日异常
        return object;
        return object;
    }
    }

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

@ -3201,18 +3201,19 @@ public class EntranceService {
                                ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
                                ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
                            }
                            }
                            ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                            ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                            if (resultJSON.get("zdlist")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlist")).nextValue();
                            if (resultJSON.get("zdlists")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
                                if(json instanceof net.sf.json.JSONObject){
                                if(json instanceof net.sf.json.JSONObject){
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setDiseaseType(icdJSON.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJSON.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJSON.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJSON.getString("zdxh"));
                                    ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                } else if (json instanceof JSONArray) {
                                } else if (json instanceof JSONArray) {
@ -3365,18 +3366,19 @@ public class EntranceService {
                            ylzMedicalIcdDO.setDiseaseOrder("01");
                            ylzMedicalIcdDO.setDiseaseOrder("01");
                            ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                            ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                            icdDOList.add(ylzMedicalIcdDO);*/
                            icdDOList.add(ylzMedicalIcdDO);*/
                            if (resultJSON.get("zdlist")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlist")).nextValue();
                            if (resultJSON.get("zdlists")!=null){
                                Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
                                if(json instanceof net.sf.json.JSONObject){
                                if(json instanceof net.sf.json.JSONObject){
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
                                    net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setDel(1);
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setCreateTime(new Date());
                                    ylzMedicalIcdDO.setDiseaseType(icdJSON.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJSON.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJSON.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJSON.getString("zdxh"));
                                    ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
                                    ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
                                    ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
                                    ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                    icdDOList.add(ylzMedicalIcdDO);
                                } else if (json instanceof JSONArray) {
                                } else if (json instanceof JSONArray) {
@ -3389,7 +3391,7 @@ public class EntranceService {
                                        ylzMedicalIcdDO.setCreateTime(new Date());
                                        ylzMedicalIcdDO.setCreateTime(new Date());
                                        ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
                                        ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
                                        ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
                                        ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
                                        ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("bqzdms"));
                                        ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
                                        ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
                                        ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
                                        ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                        ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
                                        icdDOList.add(ylzMedicalIcdDO);
                                        icdDOList.add(ylzMedicalIcdDO);

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1971,6 +1971,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                return "无需线上支付";
                return "无需线上支付";
            }
            }
            BigDecimal balance = c.subtract(b);
            BigDecimal balance = c.subtract(b);
            if (balance.doubleValue()<=0){
                return "无需线上支付";
            }
            businessOrderDO.setPayPrice(balance.doubleValue());
            businessOrderDO.setPayPrice(balance.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setPayType(4);
            businessOrderDO.setHistoryOrder(businessOrderDO.getOrderNo());
            businessOrderDO.setHistoryOrder(businessOrderDO.getOrderNo());
@ -1981,6 +1985,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                openId = patientWechatDo.getOpenid();
                openId = patientWechatDo.getOpenid();
            }else {
                throw new Exception("请关注“厦门大学附属中山医院”公众号,点击互联网医院-在线诊室进行结算!");
            }
            }
            String price = businessOrderDO.getPayPrice().toString();
            String price = businessOrderDO.getPayPrice().toString();
            String notifyUrl = hospitalSysDictDO.getDictCode();
            String notifyUrl = hospitalSysDictDO.getDictCode();

+ 44 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -1,5 +1,6 @@
package com.yihu.jw.security.core.userdetails.jdbc;
package com.yihu.jw.security.core.userdetails.jdbc;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
@ -18,6 +19,7 @@ import com.yihu.jw.security.model.WlyyUserSimple;
import com.yihu.jw.security.service.HcyyService;
import com.yihu.jw.security.service.HcyyService;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.ImUtil;
import com.yihu.jw.security.utils.ImUtil;
import com.yihu.jw.util.common.StringUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.utils.security.MD5;
import com.yihu.utils.security.MD5;
@ -44,6 +46,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import javax.sql.DataSource;
import java.io.IOException;
import java.security.KeyPair;
import java.security.KeyPair;
import java.sql.Timestamp;
import java.sql.Timestamp;
import java.util.*;
import java.util.*;
@ -87,6 +90,8 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    private Integer reflashFailedCountTime;//将失败次数重置为0 ,以分钟计算
    private Integer reflashFailedCountTime;//将失败次数重置为0 ,以分钟计算
    @Value("${user.tryLoginTimes}")
    @Value("${user.tryLoginTimes}")
    private Integer tryLoginTimes;//失败重试次数
    private Integer tryLoginTimes;//失败重试次数
    @Value("${wechat.id}")
    private String wxId;//微信id
    @Value("${iHealth.user-info-uri}")
    @Value("${iHealth.user-info-uri}")
    private String iHealthUserInfoUrl;//失败重试次数
    private String iHealthUserInfoUrl;//失败重试次数
@ -274,7 +279,23 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                        logger.error("将i健康居民微信openid数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                        logger.error("将i健康居民微信openid数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                        return users;
                        return users;
                    }
                    }
                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                        logger.info("获取中山医院openid:=====");
                        try {
                            this.getJdbcTemplate().update(PATIENT_INSERT_WEHCAT,
                                    new Object[]{
                                            UUID.randomUUID().toString(),
                                            wxId,
                                            patient.getString("code"),
                                            getZsyyOpenid(idcard),
                                            new Date()
                                    }
                            );
                        }catch (Exception e){
                            logger.error("将i健康居民转为中山医院openid数据同步到互联网医院居民微信关联表失败:" + e.getMessage());
                            return users;
                        }
                    }
                    WlyyUserDetails user = new WlyyUserDetails();
                    WlyyUserDetails user = new WlyyUserDetails();
                    user.setName(patient.getString("name"));
                    user.setName(patient.getString("name"));
                    user.setPassword(patient.getString("password"));
                    user.setPassword(patient.getString("password"));
@ -823,6 +844,28 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
        return openid;
        return openid;
    }
    }
    /**
     * 获取i健康用户登录openid型
     *
     * @return
     */
    public String getZsyyOpenid(String idcard) throws IOException {
        String openid = "";
        String url = "https://wx.xmzsh.com/interface/queryOpenIdByIdCard.htm";
        JSONObject object = new JSONObject();
        object.put("idCard",idcard);
        String response = httpClientUtil.sendPost(url,object.toJSONString());
        logger.info("获取中山医院openid:"+response);
        if (StringUtils.isNotBlank(response)){
            JSONObject jsonObject = JSONObject.parseObject(response);
            if (jsonObject.getString("respCode").equalsIgnoreCase("00")){
                JSONObject respEntityJson = jsonObject.getJSONObject("respEntity");
                openid = respEntityJson.getString("openId");
            }
        }
        return openid;
    }
    /**
    /**
     * 获取用户登录的clientId
     * 获取用户登录的clientId
     *
     *

+ 5 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -157,6 +157,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private BaseDoctorDao doctorDao;
    private BaseDoctorDao doctorDao;
    @Value("${wechat.id}")
    @Value("${wechat.id}")
    private String wechatId;
    private String wechatId;
    @Value("${wechat.id}")
    private String wxId;//微信id
    @Value("${kick.eachOther}")
    @Value("${kick.eachOther}")
    private String kickEachOther;
    private String kickEachOther;
    @Autowired
    @Autowired
@ -392,6 +394,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    logger.info("gengxin进入"+wechatId);
                    logger.info("gengxin进入"+wechatId);
                    userDetailsService.updateOpenIdAndWechatId(openid,wlyyUserSimple.getId(),wechatId);
                    userDetailsService.updateOpenIdAndWechatId(openid,wlyyUserSimple.getId(),wechatId);
                }
                }
                if (wxId.equalsIgnoreCase("xm_zsyy_wx")&&wechatId.equalsIgnoreCase("xm_ihealth_wx")){
                    userDetailsService.updateOpenIdAndWechatId(userDetailsService.getZsyyOpenid(wlyyUserSimple.getIdcard()),wlyyUserSimple.getId(),wxId);
                }
            }else if (!StringUtils.isEmpty(openid) && !"undefined".equalsIgnoreCase(openid) && ("2".equals(loginType))) {
            }else if (!StringUtils.isEmpty(openid) && !"undefined".equalsIgnoreCase(openid) && ("2".equals(loginType))) {
                if (wechatId.equalsIgnoreCase("xm_mlwyy_wx")){
                if (wechatId.equalsIgnoreCase("xm_mlwyy_wx")){
                    logger.info("gengxin进入"+openid);
                    logger.info("gengxin进入"+openid);