Pārlūkot izejas kodu

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

suhaiwen 4 gadi atpakaļ
vecāks
revīzija
e9396c21a5

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

@ -58,6 +58,8 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
@ -6788,7 +6790,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        String uid = userAgent.getUID();
        StringBuffer sql = new StringBuffer("SELECT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
        StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a WHERE a.patient_code = '");
        sql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id ");
        sql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(uid).append("') b LEFT JOIN wlyy_prescription_info d ON b.id = d.prescription_id LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        if (StringUtils.isNotEmpty(status)){
@ -6816,8 +6818,38 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    " OR b.real_order LIKE '%"+keyName+"%' " +
                    ")");
        }
        sql.append(" order by b.prescribe_time DESC limit ").append((page-1)*size).append(",").append(size);
        List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
        sql.append(" order by b.prescribe_time DESC ");
        List<WlyyPrescriptionVO>  list=null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=sql.toString();
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
        }else {
//            sql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            sql.append("  limit ").append((page-1)*size).append(",").append(size);
            list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
        }
//        List<WlyyPrescriptionVO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
        long count = Long.parseLong(mapList.get(0).get("count").toString());
        logger.info("sql="+sql.toString());

+ 51 - 2
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -14,12 +14,15 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
@ -75,6 +78,13 @@ public class WlyyBusinessService {
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    /**
     * 推送系统门诊wlyy系统消息
     * @param doctor
@ -254,7 +264,7 @@ public class WlyyBusinessService {
     * @return
     * @throws Exception
     */
    public String wlyyGetPatientAccetokenByIdcard(String patientId) throws Exception {
    public String wlyyGetPatientAccetokenByIdcard(String patientId,String wxId) throws Exception {
        
        String idcard = "";
        String result = "";
@ -264,7 +274,46 @@ public class WlyyBusinessService {
    
            Map<String,String> params = new HashMap<>();
            params.put("idcard",idcard);
            
            String patientCardNo = null;
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                net.sf.json.JSONArray array =prescriptionService.findPatientCard(patientId);
                for (int i=0;i<array.size();i++){
                    net.sf.json.JSONObject object = array.getJSONObject(i);
                    String cardType = object.getString("CARD_TYPE");
                    String cardNo = object.getString("CARD_NO");
                    String cardTypeName = object.getString("CARD_TYPE_NAME");
                    PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByCode(cardNo);
                    if (patientMedicareCardDO==null){
                        patientMedicareCardDO = new PatientMedicareCardDO();
                        patientMedicareCardDO.setCode(cardNo);
                        patientMedicareCardDO.setParentType("A");
                        if (cardType.equalsIgnoreCase("2")){
                            patientMedicareCardDO.setType("A_01");
                            patientCardNo = cardNo;
                        }else {
                            patientMedicareCardDO.setType("A_03");
                        }
                        patientMedicareCardDO.setPatientCode(patientId);
                        patientMedicareCardDO.setOrgCode("350211A1002");
                        patientMedicareCardDO.setCityCode("350200");
                        patientMedicareCardDO.setDel("1");
                        patientMedicareCardDO.setRemark(cardTypeName);
                        patientMedicareCardDao.save(patientMedicareCardDO);
                    }
                }
            }else {
                //TODO
            }
            //查询i健康信息,没有就注册;
            Map<String,String> patientSccParams = new HashMap<>();
            patientSccParams.put("scc",patientCardNo);
            patientSccParams.put("name",basePatientDO.getName());
            patientSccParams.put("idCard",basePatientDO.getIdcard());
            patientSccParams.put("phone",basePatientDO.getPhone());
            patientSccParams.put("birthday",basePatientDO.getBirthday().toString());
            wlyyHttpService.sendWlyyMes("wlyyFindAccountBySsc",null,params);
            JSONObject rs = wlyyHttpService.sendWlyyMes("wlyyGetPatientAccetokenByIdcard",null,params);
            if(rs!=null){
                Integer status = rs.getInteger("status");

+ 7 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -304,8 +304,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
    
        //医生咨询
        result.put("zxCount",imService.SessionsUnreadMessageCount(doctor.getId(),"1"));//专家咨询咨询数量
        result.put("fzCount",imService.SessionsUnreadMessageCount(doctor.getId(),"9"));//图文复诊数量
        Integer zxCount = imService.SessionsUnreadMessageCount(doctor.getId(), "1");
        Integer fzCount = imService.SessionsUnreadMessageCount(doctor.getId(), "9");
        Integer spCount = imService.SessionsUnreadMessageCount(doctor.getId(), "16");
        result.put("zxCount",zxCount);//专家咨询咨询数量
        result.put("fzCount",fzCount);//图文复诊数量
        result.put("spCount",spCount);//图文复诊数量
        result.put("totalCount",zxCount+fzCount+spCount);
        return success("请求成功",result);
    }

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1020,7 +1020,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据居民CODE换取居民请求秘钥")
    public Envelop getPatientAccetokenByIdcard(@ApiParam(name = "patientCode", value = "居民CODE")
                                               @RequestParam(value = "patientCode",required = true) String patientCode)throws Exception{
        return success(wlyyBusinessService.wlyyGetPatientAccetokenByIdcard(patientCode));
        return success(wlyyBusinessService.wlyyGetPatientAccetokenByIdcard(patientCode,wxId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findWlyyPatient)

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -360,7 +360,7 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
                size = 10;
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Platform.message_success_find, iotInterfaceLogService.findInterfaceLog(page,size,interfaceName,addressIp));
            return iotInterfaceLogService.findInterfaceLog(page,size,interfaceName,addressIp);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());

+ 6 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceLogService.java

@ -101,17 +101,21 @@ public class IotInterfaceLogService extends BaseJpaService<IotInterfaceLogDO, Io
        StringBuffer sql =new StringBuffer("SELECT c.* FROM iot_interface_log c WHERE 1=1 ");
        StringBuffer countSql=new StringBuffer("SELECT COUNT(c.id) count FROM iot_interface_log c WHERE 1=1 ");
        if (StringUtils.isNotBlank(interfaceName)){
            sql.append(" and c.interface_name like'%").append(interfaceName).append("%'");
            countSql.append(" and c.interface_name like'%").append(interfaceName).append("%'");
        }
        if (StringUtils.isNotBlank(addressIP)){
            sql.append(" and c.address_ip='").append(addressIP).append("'");
            countSql.append(" and c.address_ip='").append(addressIP).append("'");
        }
        sql.append(" order by c.time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotInterfaceLogDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(IotInterfaceLogDO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
        ArrayList<IotInterfaceLogVO> resultList = new ArrayList<>();
        list.forEach(one->{
@ -120,7 +124,7 @@ public class IotInterfaceLogService extends BaseJpaService<IotInterfaceLogDO, Io
            resultList.add(target);
        });
        long count =list.size();
        long count = (long) mapList.get(0).get("count");
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Platform.message_success_find,resultList,page, size,count);