Parcourir la source

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

# Conflicts:
#	svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatMenuController.java
wangzhinan il y a 4 ans
Parent
commit
1f0a6eee81

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

@ -6041,7 +6041,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "AND consult.relation_code=outpatient.id " +
                "AND consult.relation_code=outpatient.id " +
                "AND outpatient.pay_status=1 " +
                "AND outpatient.pay_status=1 " +
                "AND outpatient.type =2 " +
                "AND outpatient.type =2 " +
                "AND outpatient.outpatient_type !=2 " +
                "AND consult.status = 0 ";
                "AND consult.status = 0 ";
        if (StringUtils.isNoneBlank(doctor)) {
        if (StringUtils.isNoneBlank(doctor)) {
            sql = sql + "AND room.doctor='" + doctor + "' " +
            sql = sql + "AND room.doctor='" + doctor + "' " +

+ 39 - 8
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -52,6 +52,8 @@ import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.Logger;
@ -432,18 +434,46 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        return HttpUtil.doRefund("https://api.mch.weixin.qq.com/secapi/pay/refund",xml,hospitalSysDictDO.getDictCode(),hospitalSysDictDO.getDictValue());
        return HttpUtil.doRefund("https://api.mch.weixin.qq.com/secapi/pay/refund",xml,hospitalSysDictDO.getDictCode(),hospitalSysDictDO.getDictValue());
    }
    }
    public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag) throws Exception {
    public Map<String, Object> checkApplets(String code,String appid,String appSecret) throws Exception {
        HttpUtils httpUtils = new HttpUtils();
        Map<String, Object> param = new HashedMap();
        param.put("appid", appid);
        param.put("secret", appSecret);
        param.put("js_code", code);
        param.put("grant_type", "authorization_code");
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session", param);
        org.json.JSONObject rs = new org.json.JSONObject(response.getContent());
        Map<String, Object> res = new HashedMap();
        logger.info("checkApplets:"+response.getContent());
        if (rs.has("openid")){
            res.put("openid", rs.getString("openid"));
            res.put("sessionKey", rs.getString("session_key"));
        }
        return res;
    }
    public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag,String appletCode) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        String body = businessOrderDO.getDescription();
        String body = businessOrderDO.getDescription();
        String totalFee = businessOrderDO.getPayPrice().intValue()+"";
        String totalFee = businessOrderDO.getPayPrice().intValue()+"";
        String patient = businessOrderDO.getPatient();
        String patient = businessOrderDO.getPatient();
        String openid = "";
        String openid = "";
        if (StringUtils.isNoneBlank(patient)){
            List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,patient);
            if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                openid = patientWechatDo.get(0).getOpenid();
        if (StringUtils.isNotBlank(appletCode)){
            logger.info("appletCode不为空"+appletCode);
            Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
            if (objectMap!=null){
                openid = objectMap.get("openid").toString();
                logger.info("appletCode"+appletCode);
                logger.info("openid"+openid);
            }
        }else {
            logger.info("appletCode为空"+appletCode);
            if (StringUtils.isNoneBlank(patient)){
                List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,patient);
                if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                    openid = patientWechatDo.get(0).getOpenid();
                }
            }
            }
        }
        }
        String ourTradeNo = businessOrderDO.getOrderNo();
        String ourTradeNo = businessOrderDO.getOrderNo();
@ -516,10 +546,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            map.put("openid", openId);
            map.put("openid", openId);
        }
        }
        if (tradeType.equalsIgnoreCase("APPLETS")){
        if (tradeType.equalsIgnoreCase("APPLETS")){
            BasePatientDO patientDO = patientDao.findById(code);
            /*BasePatientDO patientDO = patientDao.findById(code);
            if (patientDO!=null){
            if (patientDO!=null){
                map.put("openid",patientDO.getOpenid());
                map.put("openid",patientDO.getOpenid());
            }
            }*/
            map.put("openid", openId);
        }
        }
        String wapUrl = "";
        String wapUrl = "";
        String wapName = "";
        String wapName = "";

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

@ -1,6 +1,5 @@
package com.yihu.jw.entity;
package com.yihu.jw.entity;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.persistence.*;
@ -19,13 +18,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
    @Id
//==========mysql 环境 id策略======================================================
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
/*    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
    @Column(name = "id", unique = true, nullable = false)*/
//==========mysql 环境 id策略 end======================================================
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
/*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
    public Integer getId() {
        return id;
        return id;

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

@ -24,10 +24,7 @@ import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PayInfoNoticeService;
import com.yihu.jw.hospital.prescription.service.PrescriptionExpressageService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.WorkTimeService;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
@ -120,6 +117,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private WechatInfoService wechatInfoService;
    private WechatInfoService wechatInfoService;
    @Value("${wechat.id}")
    @Value("${wechat.id}")
    private String wxId;
    private String wxId;
    @Value("${pay.flag}")
    private boolean payFlag;
    @Autowired
    @Autowired
    private StringRedisTemplate redisTemplate;
    private StringRedisTemplate redisTemplate;
    @Autowired
    @Autowired
@ -170,6 +169,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private BasePatientWechatDao patientWechatDao;
    private BasePatientWechatDao patientWechatDao;
    @Autowired
    private YkyyPrescriptionService ykyyPrescriptionService;
@ -1173,4 +1175,42 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return success(prescriptionService.findOutpatientAndPatient(startTime,endTime));
        return success(prescriptionService.findOutpatientAndPatient(startTime,endTime));
    }
    }
    /**
     * 获取微信支付参数
     *
     * @param relationCode 关联code
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "selectOrderByRelationCode", method = RequestMethod.POST)
    @ApiOperation("获取微信支付参数")
    public ObjEnvelop selectOrderByRelationCode(
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode,
            @ApiParam(name = "tradeType", value = "tradeType", required = false)
            @RequestParam(required = false)String tradeType,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(value = "appletCode",required = false)String appletCode) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderByRelationCode(relationCode,tradeType,wxId,payFlag,appletCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.prescriptionPay)
    @ApiOperation(value = "处方支付", notes = "处方支付")
    public ObjEnvelop findPatientCard(@ApiParam(name = "code", value = "处方code")
                                      @RequestParam(value = "code", required = true)String code,
                                      @ApiParam(name = "price", value = "支付费用")
                                      @RequestParam(value = "price", required = false)Double price,
                                      @ApiParam(name = "tradeType", value = "支付方式")
                                      @RequestParam(value = "tradeType", required = false)String tradeType)throws Exception {
        try {
            return success("ok",ykyyPrescriptionService.savePrescriptionOrder(code,price,tradeType,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}
}

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -325,9 +325,11 @@ public class YkyyController extends EnvelopRestEndpoint {
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode,
            @RequestParam(required = true)String relationCode,
            @ApiParam(name = "tradeType", value = "tradeType", required = false)
            @ApiParam(name = "tradeType", value = "tradeType", required = false)
            @RequestParam(required = false)String tradeType) throws Exception {
            @RequestParam(required = false)String tradeType,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false)String appletCode) throws Exception {
        try {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderByRelationCode(relationCode,tradeType,wxId,payFlag));
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderByRelationCode(relationCode,tradeType,wxId,payFlag,appletCode));
        } catch (Exception e) {
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
        }