Browse Source

Merge branch 'baseCopy1' of wangjun/wlyy2.0 into dev

wangzhinan 3 years ago
parent
commit
b6dcd94be7

+ 18 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/BaseUserMsgService.java

@ -192,7 +192,7 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
    }
    //评论留言展示
    public Envelop getMessage(String doctor, String showAll, String showAllType, String beginTime, String endTime, Integer page, Integer pageSize) {
    public Envelop getMessage(String doctor, String showAll, String showAllType, String beginTime, String endTime,String patient, Integer page, Integer pageSize) {
        StringBuffer sql = new StringBuffer();
        Map<String,Object> params = new HashedMap();
        sql.append("select t.id as \"id\" ,t.content as \"content\",t.type as \"type\"," +
@ -214,6 +214,9 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        if (StringUtils.isNotEmpty(doctor)) {
            sql.append(" and t.receiver = '" + doctor + "'");
        }
        if (StringUtils.isNotEmpty(patient)) {
            sql.append(" and t.sender = '" + patient + "'");
        }
        if (StringUtils.isNotEmpty(showAll)) {
            sql.append(" and t.status = " + showAll);
        }
@ -527,9 +530,19 @@ public class BaseUserMsgService extends BaseJpaService<BaseUserMessageDO, BaseUs
        }
        return true;
    }
    public static void main(String[] args) throws Exception {
        String sex = IdCardUtil.getSexForIdcard_new("411526199410084833");
        System.out.println(sex);
    public void deleteMessageOrMessageContent(String msgId,String isDelParent){
        if ("1".equalsIgnoreCase(isDelParent)){
            BaseUserMessageDO baseUserMessageDO = baseUserMessageDao.findOne(msgId);
            if (baseUserMessageDO!=null){
                baseUserMessageDO.setDel(0);
                baseUserMessageDao.save(baseUserMessageDO);
            }
        }else {
            BaseUserMsgContentDO baseUserMsgContentDO = baseUserMsgContentDao.findOne(msgId);
            if (baseUserMsgContentDO!=null){
                baseUserMsgContentDO.setDel(0);
                baseUserMsgContentDao.save(baseUserMsgContentDO);
            }
        }
    }
}

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

@ -11745,7 +11745,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //先进行核算检测预约
            String realOrder="";
            String addressNow=provinceName+cityName+townName+streetName+address;
            String result = tasyNatService.initNatParams("",name,mediaCard,addressNow,firstJobCode,secondJobCode);
            String result = tasyNatService.initNatParams("",name.trim(),mediaCard.trim(),addressNow,firstJobCode,secondJobCode);
            Boolean flag = false;
            if (StringUtils.isNoneBlank(result)){
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(result);
@ -11771,10 +11771,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                logger.info("BaseNatAppointmentDO保存开始");
                BaseNatAppointmentDO baseNatAppointmentDO= new BaseNatAppointmentDO();
                baseNatAppointmentDO.setChargeAmount(itemPrice);
                baseNatAppointmentDO.setMedicare(mediaCard);
                baseNatAppointmentDO.setMedicare(mediaCard.trim());
                //baseNatAppointmentDO.setRegisterNo(HisSeqNo);
                baseNatAppointmentDO.setName(name);
                baseNatAppointmentDO.setCardNo(cardNo);
                baseNatAppointmentDO.setCardNo(cardNo.trim());
                baseNatAppointmentDO.setCardType(cardType);
                baseNatAppointmentDO.setAddress(address);
                //baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
@ -11836,8 +11836,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                orderObj.put("tradeNo",businessDO.getOrderNo());
                orderObj.put("openId",openId);
                orderObj.put("name",name);
                orderObj.put("idNo",cardNo);
                Map mapHis=tasyNatService.getPatientHisId(cardNo,mediaCard);
                orderObj.put("idNo",cardNo.trim());
                Map mapHis=tasyNatService.getPatientHisId(cardNo.trim(),mediaCard.trim());
                orderObj.put("patientId",mapHis.get("Patientid").toString());
                orderObj.put("mobile",mapHis.get("MobilePhone").toString());
                //orderObj.put("socialCard","");
@ -12278,7 +12278,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            //String registerCancel =tasyNatService.cancleOrder(baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getRegisterNo(),baseNatAppointmentDO.getOderNum());
                            /*com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(registerCancel);
                            String isSuccess=jsonObject.getString("success");*/
                            String natCancel=tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName());
                            String natCancel=tasyNatService.cancelNat(baseNatAppointmentDO.getRealOrder(),baseNatAppointmentDO.getMedicare().trim(),baseNatAppointmentDO.getName());
                            com.alibaba.fastjson.JSONObject jsonObject1 = JSON.parseObject(natCancel);
                            String returnCode=jsonObject1.getString("ReturnCode");
                            if ("1".equalsIgnoreCase(returnCode)){

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

@ -40,6 +40,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.ByteToInputStream;
@ -55,6 +56,8 @@ import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -140,6 +143,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private WlyyInspectionDao inspectionDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
@ -1923,7 +1928,25 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        mixEnvelop.setTotalCount(listCount==null?0:listCount.size());
        return mixEnvelop;
    }
    public  JSONObject validateGeet( String geetestChallenge,String geetestValidate,String geetestSeccode,String isPatient){
        String validateUrl = "http://localhost:8088/validate";
        List<WlyyHospitalSysDictDO> list = hospitalSysDictDao.findByDictName("geetConfig");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
            if ("validateUrl".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                validateUrl=wlyyHospitalSysDictDO.getDictValue();
            }
        }
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("geetest_challenge",geetestChallenge));
        params.add(new BasicNameValuePair("geetest_validate",geetestValidate));
        params.add(new BasicNameValuePair("geetest_seccode",geetestSeccode));
        params.add(new BasicNameValuePair("isPatient",isPatient));
        String res = httpClientUtil.post(validateUrl, params, "UTF-8");
        JSONObject statusObject = JSONObject.parseObject(res);
        System.out.println(statusObject.toJSONString());
        return statusObject;
    }
    /**
     * 眼科就诊卡充值
     * @param mzhm
@ -1936,7 +1959,20 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
     * @return
     * @throws Exception
     */
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType,String appletCode) throws Exception {
    public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType,String appletCode,String geetestChallenge
    ,String geetestValidate,String geetestSeccode) throws Exception {
        String isNeedGeet= "0";//1需要 0不需要
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO1= hospitalSysDictDao.findById("isCardNeedGeet");
        if (wlyyHospitalSysDictDO1!=null){
            isNeedGeet=wlyyHospitalSysDictDO1.getDictValue();
        }
        if("1".equalsIgnoreCase(isNeedGeet)){
            JSONObject resResult =validateGeet(geetestChallenge,geetestValidate,geetestSeccode,"2");
            if (resResult==null||!resResult.getString("result").equalsIgnoreCase("success")){
                throw new  Exception("验证失败");
            }
        }
        BasePatientDO patientDO = patientDao.findById(patientId);
        BusinessOrderDO businessOrderDO = new BusinessOrderDO();
        businessOrderDO.setPatient(patientId);

+ 19 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java

@ -11,10 +11,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.print.Doc;
import java.io.IOException;
@ -89,12 +86,14 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                   @RequestParam(value = "beginTime", required = false)String beginTime,
                               @ApiParam(name = "endTime", value = "endTime", required = false)
                                   @RequestParam(value = "endTime", required = false)String endTime,
                               @ApiParam(name = "patient", value = "patient", required = false)
                                   @RequestParam(value = "patient", required = false)String patient,
                                           @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                                           @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                   @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,patient,page,pageSize);
        }catch (Exception e){
            return failedException(e);
        }
@ -200,4 +199,19 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
            return failedException(e);
        }
    }
    @ApiOperation("医生评论删除")
    @GetMapping("/deleteMessage")
    public Envelop deleteMessage(@ApiParam(name = "msgId", value = "msgId", required = false)
                                     @RequestParam(value = "msgId", required = false)String msgId,
                                     @ApiParam(name = "isDelParent", value = "isDelParent", required = false)
                                     @RequestParam(value = "isDelParent", required = false)String isDelParent) throws ParseException {
        try {
            baseUserMsgService.deleteMessageOrMessageContent(msgId,isDelParent);
            return success("操作成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
}

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

@ -1631,13 +1631,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                               @RequestParam(value = "beginTime", required = false)String beginTime,
                               @ApiParam(name = "endTime", value = "endTime", required = false)
                               @RequestParam(value = "endTime", required = false)String endTime,
                               @ApiParam(name = "patient", value = "patient", required = false)
                                   @RequestParam(value = "patient", required = false)String patient,
                               @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
                               @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try {
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,patient,page,pageSize);
        } catch (Exception e) {
            return failedException(e);
        }
@ -1905,10 +1907,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(required = true)String hospitalId,
            @ApiParam(name = "wxPayType", value = "微信交易类型 公众号支付:JSAPI  原生扫码支付:NATIVE", required = true)
            @RequestParam(required = true)String wxPayType,
            @ApiParam(name = "geetestChallenge", value = "geetestChallenge")
            @RequestParam(value = "geetestChallenge", required = false)String geetestChallenge,
            @ApiParam(name = "geetestValidate", value = "geetestValidate")
            @RequestParam(value = "geetestValidate", required = false)String geetestValidate,
            @ApiParam(name = "geetestSeccode", value = "geetestSeccode")
            @RequestParam(value = "geetestSeccode", required = false)String geetestSeccode,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false)String appletCode) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId,wxPayType,appletCode));
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId,wxPayType,appletCode,geetestChallenge,geetestValidate,geetestSeccode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
@ -2344,7 +2352,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            if (baseNatAppointmentDO.getPayStatus().equalsIgnoreCase("0")){
                                JSONObject chargeObj=new JSONObject();
                                chargeObj.put("hisTradeNo",baseNatAppointmentDO.getRealOrder());
                                chargeObj.put("icCardNo",baseNatAppointmentDO.getMedicare());
                                chargeObj.put("icCardNo",baseNatAppointmentDO.getMedicare().trim());
                                chargeObj.put("patientName",baseNatAppointmentDO.getName());
                                //调用扣费接口
                                String feeRes=tasyNatService.ChargenucleicBill(chargeObj);

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

@ -1862,10 +1862,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(required = true)String hospitalId,
            @ApiParam(name = "wxPayType", value = "微信交易类型 公众号支付:JSAPI  原生扫码支付:NATIVE", required = true)
            @RequestParam(required = true)String wxPayType,
            @ApiParam(name = "geetestChallenge", value = "geetestChallenge")
            @RequestParam(value = "geetestChallenge", required = false)String geetestChallenge,
            @ApiParam(name = "geetestValidate", value = "geetestValidate")
            @RequestParam(value = "geetestValidate", required = false)String geetestValidate,
            @ApiParam(name = "geetestSeccode", value = "geetestSeccode")
            @RequestParam(value = "geetestSeccode", required = false)String geetestSeccode,
            @ApiParam(name = "appletCode", value = "appletCode", required = false)
            @RequestParam(required = false)String appletCode) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId,wxPayType,appletCode));
            return ObjEnvelop.getSuccess("ok",businessOrderService.yktMedicalCardTopUp(mzhm,jkje,type,paymentType,patientId,wxId,hospitalId,wxPayType,appletCode,geetestChallenge,geetestValidate,geetestSeccode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }