Explorar el Código

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
mengkang hace 4 años
padre
commit
b28b3efcc2

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

@ -10,12 +10,13 @@ import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorPatientDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorVo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
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.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
@ -74,6 +75,8 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import com.ylzinfo.ehc.EhcHandler;
@ -217,6 +220,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private BasePatientWechatDao patientWechatDao;
    @Value("${demo.flag}")
@ -3044,7 +3051,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "WHERE " +
                    "a.relation_code=b.id " +
                    "AND b.doctor='"+doctor+"' " +
                    "GROUP BY a.score_type";
                    "GROUP BY a.score_type ORDER BY  a.score_type ASC ";
            List<Map<String,Object>> listscore = jdbcTemplate.queryForList(sqlscore);
    
            Double doctorScore = new Double("0");
@ -4071,6 +4078,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("idcard",basePatientDO.getIdcard());
        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("mobile",basePatientDO.getMobile());
        rs.put("photo",basePatientDO.getPhoto());
        rs.put("address",basePatientDO.getAddress());
        if (patientMedicareCardDO!=null){
            rs.put("ssc",patientMedicareCardDO.getCode());
        }else {
@ -4157,6 +4166,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("idcard",basePatientDO.getIdcard());
        rs.put("age",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
        rs.put("mobile",basePatientDO.getMobile());
        rs.put("photo",basePatientDO.getPhoto());
        rs.put("address",basePatientDO.getAddress());
        if (patientMedicareCardDO!=null){
            rs.put("ssc",patientMedicareCardDO.getCode());
        }else {
@ -6409,20 +6420,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 查询患者问诊信息
     * @param status
     * @param page
     * @param size
     * @return
     */
    public MixEnvelop findPatientAllOutpatient(String status, Integer page, Integer size) {
        StringBuffer sql = new StringBuffer("SELECT c.* FROM wlyy_outpatient c WHERE c.patient = '"+userAgent.getUID()+"'");
        if (StringUtils.isNotEmpty(status)){
            sql.append(" AND c.pay_status=").append(status);
    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO==null){
            throw new Exception("微信配置不存在!");
        }
        sql.append("ORDER BY c.create_time DESC LIMIT ").append((page-1)*size).append(",").append(size);
        return null;
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (prescriptionDO==null){
            throw new Exception("处方不存在!");
        }
        List<BasePatientWechatDo> patientWechatDos =patientWechatDao.findByWechatIdAndPatientId(wxId,prescriptionDO.getPatientCode());
        if (patientWechatDos==null||patientWechatDos.size()==0){
            throw new Exception("openid不存在!");
        }
        BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",prescriptionDO.getPatientCode(),"1");
        if (patientMedicareCardDO==null){
            throw new Exception("就诊卡不存在!");
        }
        String url = ylzPayService.createSicardPayUrl(wxWechatDO.getAppOriginId(),patientWechatDo.getOpenid(),patientMedicareCardDO.getCode(),"WX");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(url);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,object);
    }
}

+ 3 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -19,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
/*    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
/*    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -442,6 +442,8 @@ public class BaseHospitalRequestMapping {
        public static final String findProvince="/findProvince";
        public static final String findCity="/findCity";
        public static final String selectByUrl="/selectByUrl";
    }

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

@ -1697,22 +1697,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        List<BaseCityDO> baseCitys = baseCityService.search(fields, filters, sorts);
        return success(baseCitys, BaseCityVO.class);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientAllOutpatient)
    @ApiOperation(value = "查询患者问诊信息", notes = "查询患者问诊信息")
    public MixEnvelop findPatientAllOutpatient( @ApiParam(name = "status", value = "状态")
                                                    @RequestParam(value = "status", required = false)String status,
                                                @ApiParam(name = "page", value = "第几页")
                                                    @RequestParam(value = "page",required = false,defaultValue = "1") Integer page,
                                                @ApiParam(name = "size", value = "页面大小")
                                                    @RequestParam(value = "size",required = false,defaultValue = "10") Integer size)throws Exception {
    /**
     * 获取诊间支付url
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.selectByUrl)
    @ApiOperation("获取诊间支付url")
    public ObjEnvelop selectByUrl(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            return prescriptionService.findPatientAllOutpatient(status,page,size);
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(prescriptionId,wxId));
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}