Pārlūkot izejas kodu

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
wangzhinan 4 gadi atpakaļ
vecāks
revīzija
40f8017e0a

+ 39 - 3
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 {
@ -6407,4 +6418,29 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("distance",distance);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,rs);
    }
    public MixEnvelop selectByUrl(String prescriptionId,String wxId) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wxId);
        if (wxWechatDO==null){
            throw new Exception("微信配置不存在!");
        }
        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

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

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

@ -1698,4 +1698,24 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(baseCitys, BaseCityVO.class);
    }
    /**
     * 获取诊间支付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 ObjEnvelop.getSuccess("ok",prescriptionService.selectByUrl(prescriptionId,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}