Bladeren bron

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

wangzhinan 4 jaren geleden
bovenliggende
commit
6b80e82f94

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

@ -6788,7 +6788,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public PageEnvelop findPatientAllPrescription(String keyName,String status,Integer page, Integer size) {
        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 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  ");
        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  ");
@ -6840,6 +6840,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            logger.info("oracleSql="+oracleSql);
            list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper<>(WlyyPrescriptionVO.class));
        }else {
//            sql+=" LIMIT  " + (page - 1) * size + "," + size + "";

+ 57 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
/**
@ -35,6 +36,7 @@ public class YkyyService {
    private BasePatientDao patientDao;
    private static String yktUrl = "http://www.yanketong.com:133/api/";
    private static String yktUrl_90 = "http://www.yanketong.com:90/";
@ -73,6 +75,61 @@ public class YkyyService {
    }
    /**
     * 获取充值订单号接口
     * @param mzhm 卡号
     * @param jkje  交款金额
     * @param type  类型0 就诊卡号 1 门诊卡号
     * @param PaymentType  1支付宝 2微信
     * @param UserId  用户Id
     * @param HospitalId  医院Id
     * @return
     */
    public String getNewSerialNumber(String mzhm,Integer jkje,Integer type,Integer PaymentType,String UserId,String HospitalId){
        String response="";
        Map<String, String> map = new HashMap<>();
        map.put("mzhm",mzhm);
        map.put("jkje",Integer.toString(jkje));
        map.put("type",Integer.toString(type));
        map.put("PaymentType",Integer.toString(PaymentType));
        map.put("UserId",UserId);
        if (StringUtils.isNotEmpty(HospitalId)){
            map.put("HospitalId",HospitalId);
        }
        String url=yktUrl_90+"api/His/GetNewSerialNumber";
        try {
            response=httpClientUtil.httpPost(url,map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
    /**
     * 充值接口(充值成功后在回调中调用此接口)
     * @param guid  订单号
     * @param jkje  交款金额
     * @param type  类型0 就诊卡号 1 门诊卡号
     * @return
     */
    public String upRecharge4Jkzl(String guid,Integer jkje,Integer type){
        String response="";
        Map<String, String> map = new HashMap<>();
        map.put("guid",guid);
        map.put("jkje",Integer.toString(jkje));
        map.put("type",Integer.toString(type));
        String url=yktUrl_90+"api/His/UpRecharge4Jkzl";
        try {
            response=httpClientUtil.httpPost(url,map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
    /**
     * 互联网-添加就诊卡
     * @param patient

+ 56 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -47,6 +47,7 @@ import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.mysql.query.BaseJpaService;
import com.ylzinfo.ehc.common.utils.DateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -626,6 +627,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if("SUCCESS".equals(wxrs.get("return_code").toString())){
            // 我方 订单号+时间差
            String seqNo = wxrs.get("out_trade_no")+"";
            String totalFee=wxrs.get("total_fee")+"";
            // 微信充值流水号
            String wxSeqNo = wxrs.get("transaction_id")+"";
            // 微信分配的终端设备号
@ -660,9 +662,22 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                            e.printStackTrace();
                        }
                    }
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
                    String price = Integer.parseInt(totalFee)/100+"";
                    if (businessOrderDO.getOrderType()==10){
                        ykyyService.upRecharge4Jkzl(seqNo,Integer.parseInt(price),0);
                    }
                    if (businessOrderDO.getOrderType()==11){
                        ykyyService.upRecharge4Jkzl(seqNo,Integer.parseInt(price),1);
                    }
                }
            }
            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),businessOrderDO.getStatus().toString());
            else if (businessOrderDO!=null&&!businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
                ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),businessOrderDO.getStatus().toString());
            }
            //操作微信日志表记录
            List<WxPayLogDO> wxPayLogDOs = wxPayLogDao.findBySeqNo(seqNo);
            WxPayLogDO wxPayLogDO = wxPayLogDOs.get(0);
@ -1129,4 +1144,44 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        return ykyyService.getPayCDATA4Jkzl(businessOrderDO.getRematk(),businessOrderDO.getOrderNo(),totalFee,serverIp,notifyUrl);
    }
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId){
        BasePatientDO patientDO = patientDao.findById(patientId);
        BusinessOrderDO businessOrderDO = new BusinessOrderDO();
        businessOrderDO.setPatient(patientId);
        businessOrderDO.setPatientName(patientDO.getName());
        businessOrderDO.setCreateTime(DateUtil.getNowDate());
        businessOrderDO.setOrderCategory("5");
        businessOrderDO.setDescription("眼科就诊卡充值");
        if (paymentType==1){
            businessOrderDO.setPayType(2);
        }
        if (paymentType==2){
            businessOrderDO.setPayType(1);
        }
        businessOrderDO.setPayPrice(jkje);
        if (type==0){
            businessOrderDO.setOrderType(10);
        }
        if (type==1){
            businessOrderDO.setOrderType(11);
        }
        String rs = ykyyService.getNewSerialNumber(mzhm, jkje.intValue(), type, paymentType, patientDO.getUserId(), "");
        businessOrderDO = businessOrderDao.save(businessOrderDO);
        List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
        Map<String,Object> map=null;
        if (patientWechatDoList.isEmpty()){
            map.put("error","无opinId");
            return map;
        }
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        String url = wxWechatDO.getBaseUrl();
        String notifyUrl =url;
        String price = businessOrderDO.getPayPrice()*100+"";
//       map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,WeChatConfig.TRADE_TYPE_JSAPI,patientWechatDoList.get(0).getOpenid(),orderNo,notifyUrl);
        return map;
    }
}

+ 4 - 1
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -310,9 +310,12 @@ public class WlyyBusinessService {
            patientSccParams.put("scc",patientCardNo);
            patientSccParams.put("name",basePatientDO.getName());
            patientSccParams.put("idCard",basePatientDO.getIdcard());
            patientSccParams.put("sex",basePatientDO.getSex().toString());
            patientSccParams.put("phone",basePatientDO.getPhone());
            patientSccParams.put("birthday",basePatientDO.getBirthday().toString());
            wlyyHttpService.sendWlyyMes("wlyyFindAccountBySsc",null,params);
            JSONObject object = wlyyHttpService.sendWlyyMes("wlyyFindAccountBySsc", null, patientSccParams);
            JSONObject rs = wlyyHttpService.sendWlyyMes("wlyyGetPatientAccetokenByIdcard",null,params);
            if(rs!=null){

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -24,7 +24,7 @@ public class BusinessOrderDO extends IntegerIdentityEntity {
    private String patientName;//居民名字
    private String orderNo;//订单号
    private Integer orderType;//订单类型订单类型:目前只能1表示图文,3表示视频大类细分如下:专家咨询:1图文咨询 |2电话咨询|3视频咨询|4免费义诊图文诊室:1图文复诊视频诊室:3视频复诊| 5社区协同
    private String orderCategory;//1:专家咨询|2:图文诊室|3:视频诊室|)
    private String orderCategory;//1:专家咨询|2:图文诊室|3:视频诊室|4处方结算|5就诊卡充值)
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private String description;//支付备注

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

@ -415,6 +415,7 @@ public class BaseHospitalRequestMapping {
        public static final String selectOrderByRelationCode = "/selectOrderByRelationCode";
        public static final String ylzRechargeJson="ylzRechargeJson";
        public static final String yktMedicalCardTopUp="/yktMedicalCardTopUp";
        public static final String ylzRefund = "/ylzRefund";

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

@ -379,8 +379,6 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                    prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                    prescriptionVO.setPayStatus(1);
                    imService.pushPrescriptionImMessage(prescriptionVO);
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
                }
            }
        }

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

@ -1248,7 +1248,38 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 充值卡一支付
     * @param mzhm
     * @param jkje
     * @param type
     * @param paymentType
     * @param patientId
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.yktMedicalCardTopUp)
    @ApiOperation("眼科--充值卡支付")
    public ObjEnvelop yktMedicalCardTopUp(
            @ApiParam(name = "mzhm", value = "卡号", required = true)
            @RequestParam(required = true)String mzhm,
            @ApiParam(name = "jkje", value = "充值金额", required = true)
            @RequestParam(required = true)Double jkje,
            @ApiParam(name = "type", value = "类型0 就诊卡号 1 门诊卡号", required = true)
            @RequestParam(required = true)Integer type,
            @ApiParam(name = "paymentType", value = "1支付宝 2微信", required = true)
            @RequestParam(required = true)Integer paymentType,
            @ApiParam(name = "patientId", value = "居民Ccode", required = true)
            @RequestParam(required = true)String patientId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
    /**
     * 查询支付状态

+ 5 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceLogService.java

@ -69,13 +69,17 @@ public class IotInterfaceLogService extends BaseJpaService<IotInterfaceLogDO, Io
    public MixEnvelop<IotInterfaceLogVO,IotInterfaceLogVO> findAll(Integer page, Integer size,String name) throws ParseException {
        StringBuffer sql = new StringBuffer("SELECT * FROM (select * from iot_interface_log c where 1=1  ORDER BY c.time desc) b   ");
        StringBuffer countSql = new StringBuffer("SELECT COUNT(b.id) count FROM (select * from iot_interface_log c where 1=1  ORDER BY c.time desc) b   ");
        if (StringUtils.isNotBlank(name)){
            sql.append(" where b.method LIKE '%").append(name).append("%'OR b.interface_name LIKE '%").append(name).append("%'");
            countSql.append(" where b.method LIKE '%").append(name).append("%'OR b.interface_name LIKE '%").append(name).append("%'");
        }
        sql.append(" GROUP BY b.interface_name 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<>();
@ -85,7 +89,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);
    }