| | |
| | | @PostMapping("/base/coupon/queryCouponListSearch1") |
| | | public List<Map<String,Object>> getCouponListOfSearch1(@RequestBody CouponListOfSearch ofSearch){ |
| | | List<Map<String, Object>> mapList = couponService.queryCouponListOfSearch1(ofSearch); |
| | | |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String currentDateStr = sdf.format(currentDate); |
| | | |
| | | // Iterate over the mapList and remove entries where endTime is less than the current date |
| | | Iterator<Map<String, Object>> iterator = mapList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map<String, Object> map = iterator.next(); |
| | | String endTime = (String) map.get("endTime"); |
| | | if (endTime.compareTo(currentDateStr) < 0) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (mapList.size() > 0){ |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Integer o = (Integer) stringObjectMap.get("id"); |
| | |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date endTime; |
| | | /** |
| | | * 报名结束时间 |
| | | */ |
| | | @TableField("registerEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | private Date registerEndTime; |
| | | /** |
| | | * 报名条件(1=全部用户,2=仅限年度会员参与,3=仅限学员参与) |
| | |
| | | package com.dsh.competition.feignclient.account; |
| | | |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.account.model.TStudent; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @PostMapping("/student/queryStudentByPhone") |
| | | Student queryStudentByPhone(String phone); |
| | | |
| | | |
| | | @PostMapping("/student/queryStudentList") |
| | | List<TStudent> queryStudentList(@RequestBody Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.account.model; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员信息 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_student") |
| | | public class TStudent{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员姓名 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 学员电话 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @TableField("birthday") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date birthday; |
| | | /** |
| | | * 性别(1=男,2=女) |
| | | */ |
| | | @TableField("sex") |
| | | private Integer sex; |
| | | /** |
| | | * 身高 |
| | | */ |
| | | @TableField("height") |
| | | private Double height; |
| | | /** |
| | | * 体重 |
| | | */ |
| | | @TableField("weight") |
| | | private Double weight; |
| | | /** |
| | | * bmi健康值 |
| | | */ |
| | | @TableField("bmi") |
| | | private Double bmi; |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @TableField("idCard") |
| | | private String idCard; |
| | | /** |
| | | * 体侧表 |
| | | */ |
| | | @TableField("lateralSurface") |
| | | private String lateralSurface; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @TableField("headImg") |
| | | private String headImg; |
| | | /** |
| | | * 是否默认 1默认 2不是默认 |
| | | */ |
| | | @TableField("isDefault") |
| | | private Integer isDefault; |
| | | |
| | | |
| | | private String image1; |
| | | |
| | | private String image2; |
| | | private String image3; |
| | | } |
| | |
| | | private Integer gender; |
| | | @ApiModelProperty("剩余课时") |
| | | private Integer residueClassHour; |
| | | @ApiModelProperty("是否为学员") |
| | | private Integer isStudent; |
| | | } |
| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | Store store = storeClient.queryStoreById(Integer.valueOf(s)); |
| | | map.put("name",store.getName()); |
| | | map.put("address",store.getAddress()); |
| | | |
| | | |
| | | String str = store.getAddress(); |
| | | str = str.substring(str.indexOf("省") + 1); |
| | | |
| | | // 去掉第一个“市”及之前的字符串 |
| | | str = str.substring(str.indexOf("市") + 1); |
| | | |
| | | // 去掉第一个“区”及之前的字符串 |
| | | str = str.substring(str.indexOf("区") + 1); |
| | | |
| | | map.put("address",str); |
| | | map.put("storeLon",store.getLon()); |
| | | map.put("storeLat",store.getLat()); |
| | | map.put("storeCoverDrawing",store.getCoverDrawing()); |
| | |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.account.model.TStudent; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import com.dsh.competition.mapper.ParticipantMapper; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取参赛人员列表 |
| | | * @param uid |
| | |
| | | */ |
| | | @Override |
| | | public List<ParticipantVo> queryParticipantList(Integer uid) throws Exception { |
| | | //拿到学员列表 |
| | | List<TStudent> tStudents = studentClient.queryStudentList(uid); |
| | | //利用HashMap去重身份证 |
| | | LinkedHashMap<String,ParticipantVo> linkedHashMap =new LinkedHashMap<>(); |
| | | SimpleDateFormat sdf_year = new SimpleDateFormat("yyyy"); |
| | | for (TStudent tStudent : tStudents) { |
| | | ParticipantVo participantVo = new ParticipantVo(); |
| | | participantVo.setId(tStudent.getId()); |
| | | participantVo.setName(tStudent.getName()); |
| | | participantVo.setIdcard(tStudent.getIdCard()); |
| | | Integer age = Integer.valueOf(sdf_year.format(new Date())) - Integer.valueOf(sdf_year.format(tStudent.getBirthday())); |
| | | participantVo.setAge(age); |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHour(tStudent.getId()); |
| | | participantVo.setResidueClassHour(integer); |
| | | participantVo.setPhone(tStudent.getPhone()); |
| | | participantVo.setHeight(tStudent.getHeight().intValue()); |
| | | participantVo.setWeight(tStudent.getWeight()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(null != tStudent.getBirthday()){ |
| | | String format = sdf.format(tStudent.getBirthday()); |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(tStudent.getSex()); |
| | | participantVo.setIsStudent(1); |
| | | linkedHashMap.put(tStudent.getIdCard(),participantVo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //查出临时表里的数据,也去重 |
| | | List<Participant> list = this.list(new QueryWrapper<Participant>().eq("appUserId", uid).eq("state", 1)); |
| | | List<ParticipantVo> listVo = new ArrayList<>(); |
| | | SimpleDateFormat sdf_year = new SimpleDateFormat("yyyy"); |
| | | for (Participant participant : list) { |
| | | ParticipantVo participantVo = new ParticipantVo(); |
| | | participantVo.setId(participant.getId()); |
| | |
| | | Integer age = Integer.valueOf(sdf_year.format(new Date())) - Integer.valueOf(sdf_year.format(participant.getBirthday())); |
| | | participantVo.setAge(age); |
| | | Student student = studentClient.queryStudentByPhone(participant.getPhone()==null?"0":participant.getPhone()); |
| | | |
| | | //设为不是学员 |
| | | participantVo.setIsStudent(0); |
| | | |
| | | if(null != student){ |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHour(student.getId()); |
| | | participantVo.setResidueClassHour(integer); |
| | | participantVo.setIsStudent(1); |
| | | |
| | | }else{ |
| | | participantVo.setResidueClassHour(0); |
| | | } |
| | |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(participant.getGender()); |
| | | |
| | | linkedHashMap.put(participant.getIdcard(),participantVo); |
| | | listVo.add(participantVo); |
| | | } |
| | | return listVo; |
| | | |
| | | |
| | | |
| | | |
| | | List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values()); |
| | | |
| | | |
| | | return listVo1; |
| | | } |
| | | |
| | | |
| | |
| | | //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。 |
| | | AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); |
| | | model.setBody(body);//对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。 |
| | | model.setSubject(subject);//商品的标题/交易标题/订单标题/订单关键字等。 |
| | | model.setSubject("报名赛事");//商品的标题/交易标题/订单标题/订单关键字等。 |
| | | model.setOutTradeNo(outTradeNo);//商户网站唯一订单号 |
| | | model.setTimeoutExpress("30m"); |
| | | model.setTotalAmount(amount);//付款金额 |
| | |
| | | FROM t_course_package_payment py |
| | | LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id |
| | | GROUP BY studentId |
| | | ORDER BY studentId, totalClassHours |
| | | ORDER BY studentId, length(name) desc ,totalClassHours |
| | | ) subquery |
| | | ) a |
| | | <where> |
| | |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date endTime; |
| | | /** |
| | | * 报名结束时间 |
| | | */ |
| | | @TableField("registerEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
| | | private Date registerEndTime; |
| | | /** |
| | | * 报名条件(1=全部用户,2=仅限年度会员参与,3=仅限学员参与) |
| | |
| | | model.addAttribute("objectType",objectType); |
| | | Competition competition = competitionClient.queryById(id); |
| | | System.out.println("======competition======"+competition); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | String startTime = formatter.format(competition.getStartTime()); |
| | | model.addAttribute("startTime",startTime); |
| | | String endTime = formatter.format(competition.getEndTime()); |
| | |
| | | |
| | | |
| | | |
| | | |
| | | model.addAttribute("item",competition); |
| | | String[] split = competition.getStoreId().split(","); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | for (String s : split) { |
| | | integers.add(Integer.valueOf(s)); |
| | | } |
| | | |
| | | model.addAttribute("storeIds",integers); |
| | | |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("type", tCoursePackage.getType()); |
| | | |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | model.addAttribute("objectType",objectType); |
| | | |
| | | String classStartTime = tCoursePackage.getClassStartTime(); |
| | | String classEndTime = tCoursePackage.getClassEndTime(); |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时有效期:</label> |
| | | <div class="col-sm-4"> |
| | | <label class="col-sm-3 control-label" ${type == 2||type == 3 ? 'hidden=hidden' : ''}>*课时有效期:</label> |
| | | <div class="col-sm-4" ${type == 2||type == 3 ? 'hidden=hidden' : ''}> |
| | | 购买后 <input id="validDays" name="validDays" type="number" value="${item.validDays}" min="0" placeholder="天数" style="width: 80px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 天内有效 |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | ,type:"datetime", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | ,type:"datetime", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | |
| | | |
| | |
| | | |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"date" |
| | | ,type:"date", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"date" |
| | | ,type:"date", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | ,type:"datetime", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | |
| | | <option value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <input id="storeIds" type="hidden" value="${storeIds}"> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="赛事名称" type="text" value="${item.name}"/> |
| | |
| | | multiple: true, |
| | | closeOnSelect: false |
| | | }); |
| | | |
| | | console.log("===========storeIds="+$('#storeIds').val()) |
| | | var selectedValues = JSON.parse($('#storeIds').val()); // Replace with the desired selected values |
| | | |
| | | $('#shopId').val(selectedValues); // Set the selected values |
| | | |
| | | $('#shopId').trigger('change') |
| | | }); |
| | | |
| | | let id = "${item.imgs}" |
| | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | ,format: 'yyyy-MM-dd HH:mm:ss' |
| | | ,format: 'yyyy-MM-dd HH:mm' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | ,type:"datetime", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | ,type:"datetime", |
| | | format: "yyyy-MM-dd HH:mm" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | nickname = "该赛事"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | title: language==1?"您是否确认取消" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.TGame; |
| | |
| | | if(one.getStatus() == 1){ |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode() == 200 && one.getStatus() == 0){ |
| | | AlipayTradeQueryResponse resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode().equals("10000") && one.getStatus() == 0){ |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("tradeStatus"); |
| | | String tradeNo = data1.get("tradeNo"); |
| | | // Map<String, String> data1 = resultUtil.getData(); |
| | | // String s = data1.get("tradeStatus"); |
| | | // String tradeNo = data1.get("tradeNo"); |
| | | String tradeNo = resultUtil.getTradeNo(); |
| | | String s = resultUtil.getTradeStatus(); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | break; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | Double payMoney = 0D; |
| | | if(reservationSite.getPayType() == 3){ |
| | | if(reservationSite.getIsHalf()==2){ |
| | | payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | payMoney = new BigDecimal(site.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() ; |
| | | }else { |
| | | payMoney = new BigDecimal(site.getPlayPaiCoinOne()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | payMoney = new BigDecimal(site.getPlayPaiCoinOne()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() /2; |
| | | } |
| | | if(appUser.getPlayPaiCoins().compareTo(payMoney.intValue()) < 0){ |
| | | |
| | | return new ResultUtil(3,"玩湃币不足"); |
| | | } |
| | | }else{ |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | if(reservationSite.getIsHalf()==2){ |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() ; |
| | | }else { |
| | | payMoney = new BigDecimal(site.getCashPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN).doubleValue() / 2; |
| | | |
| | | } |
| | | } |
| | | |
| | | //校验优惠券 |
| | |
| | | siteBooking.setIsHalf(reservationSite.getIsHalf()); |
| | | siteBooking.setHalfName(reservationSite.getHalfName()); |
| | | siteBookingService.save(siteBooking); |
| | | |
| | | |
| | | |
| | | |
| | | if(reservationSite.getPayType() == 1){//微信支付 |
| | | ResultUtil resultUtil = weChatPaymentSite(payMoney, siteBooking); |
| | |
| | | if(siteBooking.getStatus() != 0){ |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode() == 200 && siteBooking.getStatus() == 0){ |
| | | AlipayTradeQueryResponse resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode().equals("10000") && siteBooking.getStatus() == 0){ |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("tradeStatus"); |
| | | String tradeNo = data1.get("tradeNo"); |
| | | // Map<String, String> data1 = resultUtil.getData(); |
| | | // String s = data1.get("tradeStatus"); |
| | | String tradeNo = resultUtil.getTradeNo(); |
| | | String s = resultUtil.getTradeStatus(); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | break; |
| | | } |
| | |
| | | siteBooking.setStatus(1); |
| | | siteBooking.setPayOrderNo(tradeNo); |
| | | siteBookingService.updateById(siteBooking); |
| | | System.err.println("======完成支付"); |
| | | break; |
| | | } |
| | | if("WAIT_BUYER_PAY".equals(s)){ |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil queryALIOrder(String out_trade_no) throws Exception{ |
| | | public AlipayTradeQueryResponse queryALIOrder(String out_trade_no) throws Exception{ |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do",aliAppid, appPrivateKey,"json","UTF-8",alipay_public_key,"RSA2"); |
| | | AlipayTradeQueryRequest request = new AlipayTradeQueryRequest(); |
| | | request.setBizContent("{" + |
| | | " \"out_trade_no\":\"" + out_trade_no + "\"" + |
| | | "}"); |
| | | AlipayTradeQueryResponse response = alipayClient.execute(request); |
| | | |
| | | if(response.isSuccess()){ |
| | | String tradeStatus = response.getTradeStatus();//交易状态:WAIT_BUYER_PAY(交易创建,等待买家付款)、TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、TRADE_SUCCESS(交易支付成功)、TRADE_FINISHED(交易结束,不可退款) |
| | | return ResultUtil.success(tradeStatus); |
| | | return response; |
| | | } else { |
| | | return ResultUtil.error(response.getMsg()); |
| | | // return ResultUtil.error(response.getMsg()); |
| | | return response; |
| | | } |
| | | } |
| | | |