Merge remote-tracking branch 'origin/pay_master' into pay_master
# Conflicts:
# kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/resources/application.yml
13 files renamed
4 files added
15 files modified
| | |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 诊断医生所在科室 |
| | | */ |
| | | @NotEmpty(message = "科室的名称不能为空") |
| | | private String createHospitalDepartment; |
| | | /** |
| | | * 科室的唯一标识 |
| | |
| | | /** |
| | | * 创建医院的唯一标识 |
| | | */ |
| | | @NotEmpty(message = "创建医院的唯一标识不能为空") |
| | | @NotNull(message = "创建医院的唯一标识不能为空") |
| | | private Long createHospitalId; |
| | | /** |
| | | * 创建医院名称 |
| | | */ |
| | | @NotEmpty(message = "医院名称不能为空") |
| | | private String createHospitalName; |
| | | /** |
| | | * 医生id |
| | | */ |
| | | @NotEmpty(message = "医生id不能为空") |
| | | private String createDoctorId; /** |
| | | * 医生姓名 |
| | | */ |
| | | @NotEmpty(message = "医生姓名不能为空") |
| | | private String createDoctorName; |
| | | /** |
| | | * 金额 (单位为分) |
| | | */ |
| | | @NotEmpty(message = "金额 (单位为分)不能为空") |
| | | |
| | | private Integer payPrice; |
| | | /** |
| | | * 内部订单号 |
| | | */ |
| | | @NotEmpty(message = "内部订单号不能为空") |
| | | |
| | | private String outTradeNo; |
| | | /** |
| | | * 支付完成时间 |
| | |
| | | */ |
| | | @NotEmpty(message = "关联诊断记录ID不能为空") |
| | | private String diaId; |
| | | |
| | | /** |
| | | * 孩子的id |
| | | */ |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/alipay/AlipayConfig.java |
| | |
| | | package com.kidgrow.oprationcenter.config.alipay; |
| | | package com.kidgrow.oprationcenter.alipay; |
| | | |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.DefaultAlipayClient; |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/alipay/AlipayProperties.java |
| | |
| | | package com.kidgrow.oprationcenter.config.alipay; |
| | | package com.kidgrow.oprationcenter.alipay; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | |
| | | package com.kidgrow.oprationcenter.mapper; |
| | | |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | int delProductDetail(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 获取用户套餐的使用状态(正式 和 试用) |
| | | * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; |
| | | * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 |
| | | * @param productOrder |
| | | * @return |
| | | */ |
| | | int getStatus(ProductOrder productOrder); |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface AlipayService { |
| | | /** |
| | | * 获取支付宝的 预支付 base64 二维码 |
| | | * @param saasClientPay |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | String getCode(SaasClientPay saasClientPay) throws Exception; |
| | | |
| | | String notify( Map<String, String> requestMap); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | boolean saveProductDetail(Map<String,Object> params,SysUser sysUser); |
| | | |
| | | /** |
| | | * 获取用户套餐的使用状态(正式 和 试用) |
| | | * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; |
| | | * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 |
| | | * @param productOrder |
| | | * @return |
| | | */ |
| | | ResultBody getStatus(ProductOrder productOrder); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.vo.SaasClientPayExcel; |
| | | import com.kidgrow.oprationcenter.vo.SaasClientPayVo; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | |
| | | List<SaasClientPayExcel> export(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 获取微信和支付宝的二维码 |
| | | * @param saasClientPay |
| | | * @param request |
| | | * @return |
| | | */ |
| | | ResultBody getCode(SaasClientPay saasClientPay,HttpServletRequest request) throws Exception; |
| | | } |
| | | |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | public interface WxService { |
| | | /** |
| | | * 获取支付宝的 微信 base64 二维码 |
| | | * @param saasClientPay |
| | | * @param request |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | Map<String,String> getCode(SaasClientPay saasClientPay, HttpServletRequest request) throws Exception; |
| | | |
| | | /** |
| | | * 微信的回调接口 |
| | | * @param requestMap |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | String callback(Map<String, String> requestMap) throws Exception; |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.domain.AlipayTradePrecreateModel; |
| | | import com.alipay.api.request.AlipayTradePrecreateRequest; |
| | | import com.alipay.api.response.AlipayTradePrecreateResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.utils.QRCodeUtil; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.alipay.AlipayProperties; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.AlipayService; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class AlipayServiceImpl implements AlipayService { |
| | | @Resource |
| | | private AlipayProperties alipayProperties; |
| | | @Resource |
| | | private AlipayClient alipayClient; |
| | | @Autowired |
| | | @Lazy |
| | | private ISaasClientPayService saasClientPayService; |
| | | @Override |
| | | public String getCode(SaasClientPay saasClientPay) throws Exception { |
| | | AlipayTradePrecreateModel model = new AlipayTradePrecreateModel(); |
| | | model.setProductCode("FACE_TO_FACE_PAYMENT"); //销售产品码 |
| | | model.setOutTradeNo(saasClientPay.getOutTradeNo()); //商户订单号 |
| | | model.setSubject(saasClientPay.getChildName()+"的支付"); //订单标题 |
| | | double l = Double.parseDouble(saasClientPay.getPayPrice().toString()) / 100; |
| | | model.setTotalAmount(l+""); //订单总金额 单位为元 |
| | | AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest(); |
| | | request.setBizModel(model); |
| | | //兼容pkcs1 编码; |
| | | java.security.Security.addProvider( |
| | | new org.bouncycastle.jce.provider.BouncyCastleProvider() |
| | | ); |
| | | request.setNotifyUrl(alipayProperties.getNotifyUrl()); |
| | | request.setReturnUrl(alipayProperties.getReturnUrl()); |
| | | AlipayTradePrecreateResponse alipayTradePrecreateResponse = alipayClient.execute(request); |
| | | if (StringUtils.isBlank(alipayTradePrecreateResponse.getQrCode())) { |
| | | return null; |
| | | } |
| | | String content = alipayTradePrecreateResponse.getQrCode(); |
| | | String base64 = QRCodeUtil.creatRrCode(content, 200, 200, 0).replaceAll("\n", "").replaceAll("\r", ""); |
| | | return base64; |
| | | } |
| | | |
| | | @Override |
| | | public String notify(Map<String, String> requestMap) { |
| | | log.error("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); |
| | | log.error(requestMap.toString()); |
| | | log.error("eeeeeeeeeeeeeeeewwwwwwwwwwww:"+requestMap.toString()); |
| | | if(requestMap.get("trade_status").equals("TRADE_SUCCESS")){ |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("out_trade_no",requestMap.get("out_trade_no")); |
| | | queryWrapper.eq("pay_status",0); |
| | | List<SaasClientPay> list = saasClientPayService.list(queryWrapper); |
| | | if(!list.isEmpty()){ |
| | | SaasClientPay saasClientPay = list.get(0); |
| | | saasClientPay.setPayTime(new Date()); |
| | | saasClientPay.setPayStatus(2); |
| | | saasClientPay.setPayMethod(1); |
| | | saasClientPay.setTradeNo(requestMap.get("trade_no")); |
| | | boolean b = saasClientPayService.updateById(saasClientPay); |
| | | } |
| | | return "success"; |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户套餐的使用状态(正式 和 试用) |
| | | * 只要要有一个充值的套餐为 为正式套餐,则为正式用户; |
| | | * 只要有一个充值的套餐为 分享状态,则该医院的医生为正式用户 |
| | | * @param productOrder |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody getStatus(ProductOrder productOrder) { |
| | | int status = baseMapper.getStatus(productOrder); |
| | | if (status>0) { |
| | | return ResultBody.ok().data(true); |
| | | }else { |
| | | return ResultBody.ok().data(false); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.oprationcenter.mapper.SaasClientPayMapper; |
| | | import com.kidgrow.oprationcenter.model.PayManager; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.AlipayService; |
| | | import com.kidgrow.oprationcenter.service.IPayManagerService; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import com.kidgrow.oprationcenter.service.WxService; |
| | | import com.kidgrow.oprationcenter.vo.SaasClientPayExcel; |
| | | import com.kidgrow.oprationcenter.vo.SaasClientPayVo; |
| | | //import com.kidgrow.recordcenter.feign.ChildService; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | |
| | | //import com.kidgrow.recordcenter.feign.ChildService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Autowired |
| | | private SysDoctorService sysDoctorService; |
| | | // @Autowired |
| | | // private ChildService childService; |
| | | @Autowired |
| | | WxService wxService; |
| | | @Autowired |
| | | AlipayService alipayService; |
| | | @Autowired |
| | | IPayManagerService payManagerService; |
| | | @Override |
| | | public PageResult<SaasClientPayVo> findList(Map<String, Object> params){ |
| | | Long doctorId = MapUtils.getLong(params, "doctorId"); |
| | |
| | | beanCopier.copy(saasClientPay,vo,null); |
| | | double v = Double.parseDouble(vo.getPayPrice().toString())/100; |
| | | vo.setPrice(v+""); |
| | | // if (StringUtils.isNotBlank(vo.getChildId())) { |
| | | // Map<String,Object> map=new HashMap<>(); |
| | | // map.put("id",vo.getChildId()); |
| | | // ResultBody byId = childService.findById(map); |
| | | // if(byId.getCode()==0){ |
| | | // Child parse = JSON.parseObject(JSON.toJSONString(byId.getData()), Child.class); |
| | | // if(parse!=null){ |
| | | // vo.setChildName(parse.getChildName()); |
| | | // vo.setChildSex(parse.getChildSex()); |
| | | // vo.setChildBirthday(parse.getChildBirthday()); |
| | | // } |
| | | // } |
| | | // } |
| | | listVo.add(vo); |
| | | } |
| | | } |
| | |
| | | vo.setPayCustom(vc); |
| | | Double vk = Double.parseDouble(saasClientPay.getPayKidgrow().toString())/100; |
| | | vo.setPayKidgrow(vk); |
| | | // if (StringUtils.isNotBlank(saasClientPay.getChildId())) { |
| | | // Map<String,Object> map=new HashMap<>(); |
| | | // map.put("id",saasClientPay.getChildId()); |
| | | // ResultBody byId = childService.findById(map); |
| | | // if(byId.getCode()==0){ |
| | | // Child parse = JSON.parseObject(JSON.toJSONString(byId.getData()), Child.class); |
| | | // if(parse!=null){ |
| | | // vo.setChildName(parse.getChildName()); |
| | | // vo.setChildSex(parse.getChildSex()); |
| | | // vo.setChildBirthday(parse.getChildBirthday()); |
| | | // } |
| | | // } |
| | | // } |
| | | listVo.add(vo); |
| | | } |
| | | } |
| | | return listVo; |
| | | } |
| | | |
| | | /** |
| | | * 获取微信和支付宝的二维码 |
| | | * @param saasClientPay |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody getCode(SaasClientPay saasClientPay,HttpServletRequest request) throws Exception { |
| | | SaasClientPay modelByObject = findByObject(saasClientPay); |
| | | if(modelByObject!=null){ |
| | | String str=""; |
| | | Map<String, String> wxCode = this.getWxCode(modelByObject, request); |
| | | if(wxCode!=null){ |
| | | saasClientPay.setPrepayId(wxCode.get("prepay_id")); |
| | | str=wxCode.get("code_url"); |
| | | } |
| | | String aliCode = this.getaliPayCode(modelByObject); |
| | | List<String> list=new ArrayList<>(); |
| | | list.add(str); |
| | | list.add(aliCode); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("list",list); |
| | | double v = Double.parseDouble(modelByObject.getPayPrice().toString())/100; |
| | | map.put("payPrice",v); |
| | | return ResultBody.ok().data(map); |
| | | } |
| | | saasClientPay.setId(UUID.randomUUID().toString().replace("-","")); |
| | | saasClientPay.setOutTradeNo(UUID.randomUUID().toString().replace("-","")); |
| | | PayManager payManager = new PayManager(); |
| | | payManager.setDepartmentId(Long.valueOf(saasClientPay.getCreateHospitalDepartid())); |
| | | payManager.setHospitalId(saasClientPay.getCreateHospitalId()); |
| | | payManager.setIsDel(false); |
| | | payManager.setEnabled(true); |
| | | PayManager byObject = payManagerService.findByObject(payManager); |
| | | if(byObject==null){ |
| | | return ResultBody.failed().msg("该部门或医院没有开通单次支付"); |
| | | } |
| | | saasClientPay.setPayPrice(byObject.getPayPrice()); |
| | | // saasClientPay.setPayPrice(1); |
| | | saasClientPay.setPayKidgrow(byObject.getPayKidgrow()); |
| | | saasClientPay.setPayCustom(byObject.getPayCustom()); |
| | | saasClientPay.setPayStatus(0); |
| | | String str=""; |
| | | Map<String, String> wxCode = this.getWxCode(saasClientPay, request); |
| | | if(wxCode!=null){ |
| | | saasClientPay.setPrepayId(wxCode.get("prepay_id")); |
| | | str=wxCode.get("code_url"); |
| | | } |
| | | boolean b = this.saveOrUpdate(saasClientPay); |
| | | String aliCode = this.getaliPayCode(saasClientPay); |
| | | List<String> list=new ArrayList<>(); |
| | | list.add(str); |
| | | list.add(aliCode); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("list",list); |
| | | double v = Double.parseDouble(byObject.getPayPrice().toString())/100; |
| | | map.put("payPrice",v); |
| | | return ResultBody.ok().data(map); |
| | | } |
| | | /** |
| | | * 获取微信的二维码 |
| | | * @param saasClientPay |
| | | * @return |
| | | */ |
| | | public Map<String,String> getWxCode(SaasClientPay saasClientPay, HttpServletRequest request) throws Exception{ |
| | | return wxService.getCode(saasClientPay,request); |
| | | |
| | | } |
| | | /** |
| | | * 获取支付宝的二维码 |
| | | * @param saasClientPay |
| | | * @return |
| | | */ |
| | | public String getaliPayCode(SaasClientPay saasClientPay) throws Exception{ |
| | | return alipayService.getCode(saasClientPay); |
| | | } |
| | | } |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.utils.QRCodeUtil; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import com.kidgrow.oprationcenter.service.WxService; |
| | | import com.kidgrow.oprationcenter.weixin.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class WxServiceImpl implements WxService { |
| | | @Resource |
| | | WeiXinOfficPayProperties weiXinOfficPayProperties; |
| | | @Autowired |
| | | @Lazy |
| | | ISaasClientPayService iSaasClientPayService; |
| | | |
| | | @Override |
| | | public Map<String,String> getCode(SaasClientPay saasClientPay, HttpServletRequest request) throws Exception { |
| | | Map<String,String> jsonObject=new HashMap<>(); |
| | | Map<String,Object> mapto=new HashMap<>(); |
| | | jsonObject.put("body",saasClientPay.getChildName());//商品描述 |
| | | jsonObject.put("out_trade_no", saasClientPay.getOutTradeNo());//商户订单号 |
| | | jsonObject.put("total_fee",saasClientPay.getPayPrice().toString());//标价金额 单位为分 |
| | | jsonObject.put("spbill_create_ip",getIpAddress(request));//终端IP |
| | | jsonObject.put("notify_url",weiXinOfficPayProperties.getPayNotifyUrl());//通知地址 |
| | | jsonObject.put("trade_type","NATIVE");//交易类型 |
| | | MyConfig wxPayConfig= new MyConfig(weiXinOfficPayProperties); |
| | | WXPay wxPay=new WXPay(wxPayConfig); |
| | | Map<String, String> stringStringMap = wxPay.fillRequestData(jsonObject); |
| | | Map<String, String> result = wxPay.unifiedOrder(stringStringMap); |
| | | String resultStr = result.get("code_url"); |
| | | log.error(""); |
| | | if(result.get("code_url")==null|| StringUtils.isBlank(resultStr)){ |
| | | return null; |
| | | } |
| | | String s = QRCodeUtil.creatRrCode(resultStr, 200, 200, 0).replaceAll("\n","").replaceAll("\r",""); |
| | | String prepay_id = result.get("prepay_id"); |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("code_url",s); |
| | | map.put("prepay_id",prepay_id); |
| | | return map; |
| | | } |
| | | public static String getIpAddress(HttpServletRequest request) { |
| | | String ip = request.getHeader("x-forwarded-for"); |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("WL-Proxy-Client-IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_CLIENT_IP"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); |
| | | } |
| | | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { |
| | | ip = request.getRemoteAddr(); |
| | | } |
| | | return ip; |
| | | } |
| | | |
| | | @Override |
| | | public String callback(Map<String, String> requestMap) throws Exception { |
| | | Map<String,String> map=new HashMap<>(); |
| | | map.put("return_code","FAIL"); |
| | | map.put("return_msg","INVALID_REQUEST"); |
| | | log.error("eeeeeeeeeeeeeee:"+requestMap.toString()); |
| | | boolean signatureValid = WXPayUtil.isSignatureValid(requestMap, weiXinOfficPayProperties.getKey(), WXPayConstants.SignType.HMACSHA256); |
| | | if(signatureValid){ |
| | | log.error("wwwwwwwwwwwwweeeeeeeeeeeeeeeeeeeee"); |
| | | //支付成功 |
| | | if(WXPayConstants.SUCCESS.equals(requestMap.get("result_code"))){ |
| | | //更新状态 out_trade_no |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("out_trade_no",requestMap.get("out_trade_no")); |
| | | queryWrapper.eq("pay_status",0); |
| | | List<SaasClientPay> list = iSaasClientPayService.list(queryWrapper); |
| | | if(!list.isEmpty()){ |
| | | SaasClientPay saasClientPay = list.get(0); |
| | | saasClientPay.setPayTime(new Date()); |
| | | saasClientPay.setPayStatus(2); |
| | | saasClientPay.setPayMethod(0); |
| | | saasClientPay.setTradeNo(requestMap.get("transaction_id")); |
| | | boolean b = iSaasClientPayService.updateById(saasClientPay); |
| | | map.put("return_code","SUCCESS"); |
| | | map.put("return_msg","OK"); |
| | | } |
| | | } |
| | | } |
| | | return WXPayUtil.mapToXml(map); |
| | | } |
| | | } |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/IWXPayDomain.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | |
| | | /** |
| | | * 域名管理,实现主备域名自动切换 |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/MyConfig.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | |
| | | public class MyConfig extends WXPayConfig{ |
| | |
| | | |
| | | private byte[] certData; |
| | | |
| | | public MyConfig() throws Exception { |
| | | String certPath = "D:\\develop\\chengxu\\houtai\\3cc.txt"; |
| | | File file = new File(certPath); |
| | | InputStream certStream = new FileInputStream(file); |
| | | this.certData = new byte[(int) file.length()]; |
| | | certStream.read(this.certData); |
| | | certStream.close(); |
| | | public MyConfig() { |
| | | |
| | | } |
| | | // public MyConfig() throws Exception { |
| | | // String certPath = "D:\\develop\\chengxu\\houtai\\3cc.txt"; |
| | | // File file = new File(certPath); |
| | | // InputStream certStream = new FileInputStream(file); |
| | | // this.certData = new byte[(int) file.length()]; |
| | | // certStream.read(this.certData); |
| | | // certStream.close(); |
| | | // } |
| | | //wx84c77dcda51c612c |
| | | @Override |
| | | public String getAppID() { |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/MyIWXPayDomain.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | public class MyIWXPayDomain implements IWXPayDomain { |
| | | @Override |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPay.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | //import com.github.wxpay.sdk.WXPayConstants.SignType; |
| | | |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayConfig.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import java.io.InputStream; |
| | | |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayConstants.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import org.apache.http.client.HttpClient; |
| | | |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayReport.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayRequest.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayUtil.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | //import com.github.wxpay.sdk.WXPayConstants.SignType; |
| | | |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WXPayXmlUtil.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import org.w3c.dom.Document; |
| | | |
File was renamed from kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-server/src/main/java/com/kidgrow/oprationcenter/config/weixin/WeiXinOfficPayProperties.java |
| | |
| | | package com.kidgrow.oprationcenter.config.weixin; |
| | | package com.kidgrow.oprationcenter.weixin; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | |
| | | /** |
| | | * API证书绝对路径 (本项目放在了 resources/cert/wxpay/apiclient_cert.p12") |
| | | */ |
| | | private String certPath; |
| | | // private String certPath; |
| | | |
| | | /** |
| | | * HTTP(S) 连接超时时间,单位毫秒 |
| | |
| | | UPDATE product_order_record SET is_del=1,update_time=now() WHERE order_id= #{orderId}; |
| | | UPDATE product_order_detail SET is_del=1,update_time=now() WHERE order_id= #{orderId}; |
| | | </update> |
| | | <select id="getStatus" parameterType="com.kidgrow.oprationcenter.model.ProductOrder" resultType="int"> |
| | | SELECT |
| | | SUM(total) |
| | | FROM |
| | | ( |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND order_order.department_id = #{departmentId} |
| | | AND record.pro_type = 1 |
| | | AND order_order.enabled = 1 |
| | | AND order_order.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.is_del = 0 |
| | | UNION ALL |
| | | SELECT |
| | | count(*) total |
| | | FROM |
| | | `product_order` order_order |
| | | LEFT JOIN product_order_record record ON order_order.id = record.order_id |
| | | WHERE |
| | | order_order.hospital_id = #{hospitalId} |
| | | AND record.pro_type = 1 |
| | | AND record.is_share = 1 |
| | | AND order_order.enabled = 1 |
| | | AND order_order.is_del = 0 |
| | | AND record.enabled = 1 |
| | | AND record.is_del = 0 |
| | | ) cc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="p.prepayId != null and p.prepayId !=''"> |
| | | and prepay_id = #{p.prepayId} |
| | | </if> |
| | | <if test="p.type != null "> |
| | | <if test="p.type != null and p.type !=''"> |
| | | and type = #{p.type} |
| | | </if> |
| | | <if test="p.createUserId != null and p.createUserId !=''"> |
| | |
| | | <if test="p.createHospitalName != null and p.createHospitalName !=''"> |
| | | and create_hospital_name = #{p.createHospitalName} |
| | | </if> |
| | | <if test="p.createDoctorId != null and p.createDoctorId !=''"> |
| | | and create_doctor_id = #{p.createDoctorId} |
| | | </if> |
| | | <if test="p.createDoctorIdName != null and p.createDoctorIdName !=''"> |
| | | and create_doctor_name like '%${p.createDoctorIdName}%' |
| | | </if> |
| | | <if test="p.payPrice != null and p.payPrice !=''"> |
| | | and pay_price = #{p.payPrice} |
| | | </if> |
| | |
| | | <if test="p.prepayId != null and p.prepayId !=''"> |
| | | and prepay_id = #{p.prepayId} |
| | | </if> |
| | | <if test="p.type != null "> |
| | | <if test="p.type != null and p.type !='' "> |
| | | and type = #{p.type} |
| | | </if> |
| | | <if test="p.createUserId != null and p.createUserId !=''"> |
| | |
| | | } |
| | | return resultBody; |
| | | } |
| | | @ApiOperation(value = "获取用户套餐的使用状态") |
| | | @PostMapping("/getStatus") |
| | | public ResultBody getStatus(@RequestBody ProductOrder productOrder) { |
| | | return productOrderService.getStatus(productOrder); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | |
| | | ExcelUtil.exportExcel(saasClientPayExcel, null, "支付导出", SaasClientPayExcel.class, "saas_client_pay", response); |
| | | return ResultBody.ok().msg("导出成功"); |
| | | } |
| | | /** |
| | | * 获取微信和支付宝的二维码 |
| | | */ |
| | | @ApiOperation(value = "获取微信和支付宝的二维码") |
| | | @PostMapping("/getCode") |
| | | public ResultBody getCode(@Valid @RequestBody SaasClientPay saasClientPay, BindingResult bindingResult, HttpServletRequest request) throws Exception { |
| | | List<String> errMsg= new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } |
| | | return saasClientPayService.getCode(saasClientPay,request); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.common.utils.QRCodeUtil; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.config.alipay.AlipayProperties; |
| | | import com.kidgrow.oprationcenter.alipay.AlipayProperties; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.AlipayService; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private AlipayProperties alipayProperties; |
| | | @Autowired |
| | | private ISaasClientPayService saasClientPayService; |
| | | @Autowired |
| | | private AlipayService alipayService; |
| | | |
| | | @ApiOperation(value = "调用预支付的接口,生成二维码") |
| | | @PostMapping("/precreate") |
| | | public ResultBody precreate(HttpServletResponse response) throws Exception{ //商户预创建支付订单,生成二维码 |
| | | |
| | | String outTradeNo = UUID.randomUUID().toString().replaceAll("_", ""); |
| | | String outTradeNo = UUID.randomUUID().toString().replaceAll("-", ""); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("dia_id","1"); |
| | | queryWrapper.eq("pay_status",0); |
| | |
| | | java.security.Security.addProvider( |
| | | new org.bouncycastle.jce.provider.BouncyCastleProvider() |
| | | ); |
| | | request.setNotifyUrl(alipayProperties.getNotifyUrl()); |
| | | request.setReturnUrl(alipayProperties.getReturnUrl()); |
| | | AlipayTradePrecreateResponse alipayTradePrecreateResponse=alipayClient.execute(request); |
| | | if (StringUtils.isBlank(alipayTradePrecreateResponse.getQrCode())) { |
| | | return ResultBody.failed().data("生成二维码失败"); |
| | |
| | | System.out.println(base64); |
| | | return ResultBody.ok().data(base64); |
| | | } |
| | | |
| | | //数据封装 |
| | | public SaasClientPay fengData(AlipayTradePrecreateModel model){ |
| | | SaasClientPay saasClientPay = new SaasClientPay(); |
| | | saasClientPay.setCreateHospitalDepartment(""); |
| | | saasClientPay.setCreateHospitalDepartid(""); |
| | | saasClientPay.setCreateHospitalId(Long.valueOf(1L)); |
| | | saasClientPay.setPayPrice(1); |
| | | saasClientPay.setOutTradeNo(model.getOutTradeNo()); |
| | | saasClientPay.setPayStatus(0); |
| | | saasClientPay.setPayMethod(1); |
| | | saasClientPay.setDiaId("1"); |
| | | saasClientPay.setId( UUID.randomUUID().toString().replaceAll("_", "")); |
| | | saasClientPay.setId(UUID.randomUUID().toString().replaceAll("-", "")); |
| | | saasClientPay.setCreateTime(new Date()); |
| | | saasClientPay.setCreateUserId(Long.valueOf(1L)); |
| | | saasClientPay.setCreateUserName(""); |
| | | return saasClientPay; |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单,支付超时、支付结果未知是可撤销,超过24小时不可撤销-------暂时没有配置") |
| | | @PostMapping("/cancel") |
| | | public ResultBody cancel() throws Exception{ //取消订单,支付超时、支付结果未知是可撤销,超过24小时不可撤销 |
| | |
| | | |
| | | @ApiOperation(value = "trade_success状态下异步通知接口,端口异常的接口") |
| | | @PostMapping("/notify") |
| | | public ResultBody notify(HttpServletRequest request) throws Exception{ //trade_success状态下异步通知接口 |
| | | public String notify(HttpServletRequest request) throws Exception { //trade_success状态下异步通知接口 |
| | | if (check(request.getParameterMap())){ |
| | | System.out.println(request.getParameter("trade_status")); |
| | | Map<String, String> requestMap = this.getRequestMap(request.getParameterMap()); |
| | | log.error("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); |
| | | log.error(request.toString()); |
| | | log.error(requestMap.toString()); |
| | | log.error("eeeeeeeeeeeeeeeewwwwwwwwwwww:"); |
| | | if (requestMap.get("trade_status").equals("TRADE_SUCCESS")) { |
| | | log.error("wwwwwwwwwww"); |
| | | //更新状态 out_trade_no |
| | | log.error("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); |
| | | System.out.println("异步通知 "+ Instant.now()); |
| | | return alipayService.notify(requestMap); |
| | | }else { |
| | | return "fail"; |
| | | } |
| | | }else { |
| | | System.out.println("验签失败"); |
| | | return "fail"; |
| | | } |
| | | return ResultBody.ok().data("订单失败"); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单支付成功后同步返回地址") |
| | | @PostMapping("/return") |
| | | public ResultBody returnUrl(HttpServletRequest request, Map<String,Object> map) throws Exception{ //订单支付成功后同步返回地址 |
| | |
| | | return ResultBody.failed().data("false"); |
| | | } |
| | | } |
| | | |
| | | private Map<String,String> getRequestMap(Map<String,String[]> requestParams){ |
| | | Map<String,String> params = new HashMap<>(); |
| | | for (String name : requestParams.keySet()) { |
| | |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | private boolean check(Map<String,String[]> requestParams) throws Exception{ //对return、notify参数进行验签 |
| | | Map<String, String> requestMap = this.getRequestMap(requestParams); |
| | | return AlipaySignature.rsaCheckV1(requestMap, alipayProperties.getAlipayPublicKey(), |
| | |
| | | package com.kidgrow.oprationcenter.controller.weixin; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.common.utils.QRCodeUtil; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.config.weixin.MyConfig; |
| | | import com.kidgrow.oprationcenter.config.weixin.WXPay; |
| | | import com.kidgrow.oprationcenter.config.weixin.WXPayUtil; |
| | | import com.kidgrow.oprationcenter.config.weixin.WeiXinOfficPayProperties; |
| | | import com.kidgrow.oprationcenter.model.SaasClientPay; |
| | | import com.kidgrow.oprationcenter.service.ISaasClientPayService; |
| | | import com.kidgrow.oprationcenter.service.WxService; |
| | | import com.kidgrow.oprationcenter.weixin.MyConfig; |
| | | import com.kidgrow.oprationcenter.weixin.WXPay; |
| | | import com.kidgrow.oprationcenter.weixin.WXPayUtil; |
| | | import com.kidgrow.oprationcenter.weixin.WeiXinOfficPayProperties; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | ISaasClientPayService iSaasClientPayService; |
| | | @Resource |
| | | WeiXinOfficPayProperties weiXinOfficPayProperties; |
| | | @Autowired |
| | | WxService wxService; |
| | | |
| | | @ApiOperation(value = "保存") |
| | | /** |
| | | * 测试微信的预支付接口 |
| | | * @param map |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @ApiOperation(value = "测试微信的预支付接口") |
| | | @PostMapping("pay") |
| | | public ResultBody save(@RequestBody Map<String,Object> map) throws Exception { |
| | | Long hospitalId = MapUtils.getLong(map, "hospitalId"); |
| | |
| | | if (doctorId!=null) { |
| | | return ResultBody.failed().data("请输入医生id"); |
| | | } |
| | | |
| | | if (diaId!=null) { |
| | | return ResultBody.failed().data("请输入诊断记录ID"); |
| | | } |
| | | Map<String,String> jsonObject=new HashMap<>(); |
| | | Map<String,Object> mapto=new HashMap<>(); |
| | | jsonObject.put("body","腾讯");//商品描述 |
| | | jsonObject.put("out_trade_no","20150806123434");//商户订单号 |
| | | jsonObject.put("out_trade_no",UUID.randomUUID().toString().replaceAll("-",""));//商户订单号 |
| | | jsonObject.put("total_fee","1");//标价金额 |
| | | jsonObject.put("spbill_create_ip","192.168.2.240");//终端IP |
| | | // jsonObject.put("notify_url",myConfig.getPayNotifyUrl());//通知地址 |
| | |
| | | } |
| | | SaasClientPay saasClientPay=new SaasClientPay(); |
| | | saasClientPay.setId(UUID.randomUUID().toString().replaceAll("_", "")); |
| | | saasClientPay.setCreateHospitalDepartment(""); |
| | | saasClientPay.setCreateHospitalDepartid(""); |
| | | saasClientPay.setCreateHospitalId(Long.valueOf(1L)); |
| | | saasClientPay.setPayPrice(1); |
| | | saasClientPay.setCreateHospitalName(""); |
| | | saasClientPay.setOutTradeNo(jsonObject.get("out_trade_no")); |
| | |
| | | saasClientPay.setPayStatus(0); |
| | | saasClientPay.setPayMethod(0); |
| | | saasClientPay.setDiaId("1"); |
| | | saasClientPay.setCreateTime(new Date()); |
| | | boolean save = iSaasClientPayService.saveOrUpdate(saasClientPay); |
| | | String s = QRCodeUtil.creatRrCode(resultStr, 200, 200, 0).replaceAll("\n","").replaceAll("\r",""); |
| | | return ResultBody.ok().data(s); |
| | | } |
| | | |
| | | /** |
| | | * 微信的回调接口 |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @RequestMapping("/callback") |
| | | public void OrderCallBack(HttpServletRequest request, HttpServletResponse response,Map<String,Object> map) throws Exception { |
| | | Map<String, String> requestMap = this.getRequestMap(request.getParameterMap()); |
| | | log.error("wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"); |
| | | log.error(requestMap.toString()); |
| | | log.error("wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"); |
| | | log.error(map.toString()); |
| | | log.error("eeeeeeeeeeeeeeeeeeeeee"); |
| | | if(WXPayUtil.isSignatureValid(requestMap, "GSFcX6WdgRTAS6154EW14WE3SGBSER49")){ |
| | | //支付成功 |
| | | if(requestMap.get("result_code").equals("SUCCESS")){ |
| | | //更新状态 out_trade_no |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("out_trade_no",requestMap.get("out_trade_no")); |
| | | queryWrapper.eq("pay_status",0); |
| | | List<SaasClientPay> list = iSaasClientPayService.list(queryWrapper); |
| | | if(!list.isEmpty()){ |
| | | SaasClientPay saasClientPay = list.get(0); |
| | | saasClientPay.setPayTime(DateUtils.parseDate(requestMap.get("time_end"))); |
| | | saasClientPay.setPayStatus(2); |
| | | saasClientPay.setTradeNo(requestMap.get("transaction_id")); |
| | | boolean b = iSaasClientPayService.saveOrUpdate(saasClientPay); |
| | | public String OrderCallBack(HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | InputStream inStream = request.getInputStream(); |
| | | ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | int len = 0; |
| | | while ((len = inStream.read(buffer)) != -1) { |
| | | outSteam.write(buffer, 0, len); |
| | | } |
| | | String resultxml = new String(outSteam.toByteArray(), "utf-8"); |
| | | Map<String, String> requestMap = WXPayUtil.xmlToMap(resultxml); |
| | | String callback = wxService.callback(requestMap); |
| | | return callback; |
| | | } |
| | | }else { |
| | | System.out.println("验签失败"); |
| | | } |
| | | } |
| | | private Map<String,String> getRequestMap(Map<String,String[]> requestParams){ |
| | | Map<String,String> params = new HashMap<>(); |
| | | for (String name : requestParams.keySet()) { |
| | | String[] values = requestParams.get(name); |
| | | String valueStr = ""; |
| | | for (int i = 0; i < values.length; i++) { |
| | | valueStr = (i == values.length - 1) ? valueStr + values[i] |
| | | : valueStr + values[i] + ","; |
| | | } |
| | | params.put(name, valueStr); |
| | | System.out.println(name+" ==> "+valueStr); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | WxController weixinController=new WxController(); |
| | | Map<String,Object> map=null; |
| | |
| | | alipay-public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlxD+qCFXTnJrwbGgKPNEcZqrPpHnNoJDTdP+zhWI7ABv/rASfOhWZi56vyQhKldgbc01VBFa0myTpECHlPMZn32DGNg8DIxuV+LEIT+l2Lqjn4wQtX3zUNPHR3bTZlMEVw9JYQZI+XR2i4ZWoOszo6ahAO9SxEuNUlsCSBDMEIPaEjGJmu57X+os8TRlgj8Mxo90JVqSZlRq7eFc7wVTMe5e9p9ITctdiB+utkO0/rSh4T+VUaV1zNk8/n5jh0xDSXL4QdEe832Naeu67Y6w6vezkvF9GUwEmfJqs6PH3sF1gOKgjakbFXauEOJXnXEdyMmOKhG93jT+9GtvV/ywmwIDAQAB |
| | | |
| | | |
| | | |
| | |
| | | - /api-file/baseUplaod |
| | | - /api-user/users/python |
| | | - /api-evaluation/evaluationxrayinfo/checkQRCode |
| | | - /api-record/wxController/callback |
| | | - /api-record/alipay/return |
| | | - /api-record/alipay/notify |
| | | - /api-opration/wxController/callback |
| | | - /api-opration/alipay/notify |
| | | - /api-opration/alipay/return |
| | | # - /api-user/syshospital/findAllByMap |
| | | # - /api-user/sysdictionaries/findAll |
| | | # - /api-user/sysdepartment/findListByHospitalId |
| | |
| | | /api-file/baseUplaod, |
| | | /api-user/users/python, |
| | | /api-evaluation/evaluationxrayinfo/checkQRCode, |
| | | /api-record/wxController/callback, |
| | | /api-record/alipay/return, |
| | | /api-record/alipay/notify |
| | | /api-opration/wxController/callback, |
| | | /api-opration/alipay/return, |
| | | /api-opration/alipay/notify |
| | | # /api-user/syshospital/findAllByMap, |
| | | # /api-user/sysdictionaries/findAll, |
| | | # /api-user/sysdepartment/findListByHospitalId |
| | |
| | | type:0, |
| | | createHospitalId: $("#hospitalId").val(), |
| | | createHospitalDepartid: departmentId, |
| | | doctorId: doctorId, |
| | | createDoctorId: doctorId, |
| | | startTime: startTime, |
| | | endTime: endTime |
| | | } |