| | |
| | | import com.dsh.activity.feignclient.model.TAppUser; |
| | | import com.dsh.activity.feignclient.other.OperatorClient; |
| | | import com.dsh.activity.feignclient.other.RegionClient; |
| | | import com.dsh.activity.feignclient.other.SiteClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.feignclient.other.model.StoreInfoDto; |
| | | import com.dsh.activity.feignclient.other.model.TOperatorCity; |
| | | import com.dsh.activity.feignclient.other.model.*; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.CouponRecordQuery; |
| | | import com.dsh.activity.model.request.CommodityRequest; |
| | | import com.dsh.activity.model.request.CouponDataVo; |
| | | import com.dsh.activity.model.request.CouponPackageReq; |
| | | import com.dsh.activity.model.response.CouponPackageResp; |
| | | import com.dsh.activity.model.response.HuiminAgreementVO; |
| | | import com.dsh.activity.model.response.HuiminCardVO; |
| | | import com.dsh.activity.model.response.*; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | | import com.dsh.activity.util.ResultUtil; |
| | | import com.dsh.activity.util.TokenUtil; |
| | | import com.dsh.activity.util.ToolUtil; |
| | | import com.dsh.activity.util.*; |
| | | import com.google.gson.Gson; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.tags.EditorAwareTag; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private HuiminCardService huiminCardService; |
| | | @Resource |
| | | private PayHuiminService payHuiminService; |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | @Resource |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Resource |
| | | private HuiminRecordService huiminRecordService; |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | |
| | | private String smid = "2088330203191220";//平台支付宝商户号 |
| | | |
| | | |
| | | /** |
| | | * 查询注册赠送优惠券 判断当前优惠券限领数量 |
| | | * 查看惠民卡详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/payHuiminCard") |
| | | @ApiOperation(value = "购买惠民卡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "支付方式1微信2支付宝", name = "payType", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "绑定学员ids多,个逗号拼接", name = "studentIds", dataType = "String", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<THuiminCard> payHuiminCard(Integer id,Integer payType,String studentIds) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | THuiminCard huiminCard = huiminCardService.getById(id); |
| | | if (huiminCard.getEndTime()!=null && huiminCard.getEndTime().before(new Date())){ |
| | | return ResultUtil.error("该惠民卡已过期"); |
| | | } |
| | | if (huiminCard.getGrantCount()!=null){ |
| | | if (huiminCard.getGrantCount()<=payHuiminService.lambdaQuery().eq(TPayHuimin::getCardId, huiminCard.getId()) |
| | | .eq(TPayHuimin::getStatus,2).count()){ |
| | | return ResultUtil.error("该惠民卡已售完"); |
| | | } |
| | | } |
| | | if (huiminCard.getLimitCount()!=null){ |
| | | if (huiminCard.getLimitCount()<=payHuiminService.lambdaQuery().eq(TPayHuimin::getCardId, huiminCard.getId()) |
| | | .eq(TPayHuimin::getStatus,2) |
| | | .eq(TPayHuimin::getAppUserId, uid) |
| | | .count()){ |
| | | return ResultUtil.error("该惠民卡购买次数已达上限"); |
| | | } |
| | | } |
| | | TPayHuimin tPayHuimin = new TPayHuimin(); |
| | | tPayHuimin.setSalesMoney(huiminCard.getSalesMoney()); |
| | | tPayHuimin.setAppUserId(uid); |
| | | tPayHuimin.setStudentId(studentIds); |
| | | switch (huiminCard.getHuiMinType()){ |
| | | case 1: |
| | | // 年度卡 |
| | | LocalDateTime localDateTime = LocalDateTime.now().plusDays(365); |
| | | // 将LocalDateTime转换为Date类型 |
| | | Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | tPayHuimin.setEndTime(date); |
| | | break; |
| | | case 2: |
| | | // 年内卡 |
| | | Date date1 = new Date(); |
| | | |
| | | date1.setMonth(11); |
| | | date1.setDate(31); |
| | | date1.setHours(23); |
| | | date1.setMinutes(59); |
| | | date1.setSeconds(59); |
| | | tPayHuimin.setEndTime(date1); |
| | | break; |
| | | } |
| | | tPayHuimin.setInsertTime(new Date()); |
| | | tPayHuimin.setStatus(1); |
| | | tPayHuimin.setPaymentType(payType); |
| | | tPayHuimin.setRefundStatus(1); |
| | | tPayHuimin.setCardId(huiminCard.getId()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | tPayHuimin.setCode(sdf.format(new Date()) + UUIDUtil.getNumberRandom(5)); |
| | | System.err.println("支付数据"+tPayHuimin); |
| | | payHuiminService.save(tPayHuimin); |
| | | BigDecimal bigDecimal = new BigDecimal(studentIds.split(",").length); |
| | | switch (payType){ |
| | | case 1: |
| | | return payMoneyUtil.weixinpay("购买惠民卡"+"-"+0, "", tPayHuimin.getCode(), tPayHuimin.getSalesMoney().multiply(bigDecimal).toString(), |
| | | "/base/huimin/callBack/weixinPayHuiminCallback", "APP", ""); |
| | | case 2: |
| | | String string = tPayHuimin.getSalesMoney().multiply(bigDecimal).setScale(2).toString(); |
| | | return payMoneyUtil.alipay(smid,"购买惠民卡", "购买惠民卡", "", tPayHuimin.getCode(), string, |
| | | "/base/huimin/callBack/aliPayHuiminCallback"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 查看惠民卡详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getHuiminCardDetail") |
| | | @ApiOperation(value = "查看惠民卡详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "门店id", name = "storeId", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<THuiminCard> getHuiminCardDetail(Integer id,Integer storeId) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | THuiminCard huiminCard = huiminCardService.getById(id); |
| | | List<TPayHuimin> payHuimins = payHuiminService.list(new LambdaQueryWrapper<TPayHuimin>() |
| | | .eq(TPayHuimin::getAppUserId, uid) |
| | | .ge(TPayHuimin::getEndTime,new Date()) |
| | | .eq(TPayHuimin::getStatus, 1)); |
| | | List<TPayHuimin> collect = payHuimins.stream().filter(e -> e.getCardId().equals(huiminCard.getId())).collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | huiminCard.setIsBuy(1); |
| | | }else{ |
| | | huiminCard.setIsBuy(0); |
| | | } |
| | | List<Store> stores = storeClient.queryStoreByIds(Collections.singletonList(storeId)); |
| | | if (!stores.isEmpty()){ |
| | | Store store = stores.get(0); |
| | | Integer operatorId = store.getOperatorId(); |
| | | if (operatorId==null||operatorId==0){ |
| | | // 平台门店 |
| | | THuiminAgreement huiminAgreement = huiminAgreementService.getOne(new LambdaQueryWrapper<THuiminAgreement>() |
| | | .isNull(THuiminAgreement::getOperatorId)); |
| | | if (huiminAgreement!=null){ |
| | | List<THuiminAgreementSetting> list = huiminAgreementSettingService.list(new LambdaQueryWrapper<THuiminAgreementSetting>() |
| | | .eq(THuiminAgreementSetting::getAgreementId, huiminAgreement.getId())); |
| | | huiminCard.setAgreementSettings(list); |
| | | }else { |
| | | huiminCard.setAgreementSettings(new ArrayList<>()); |
| | | |
| | | } |
| | | }else{ |
| | | // 运营商门店 |
| | | THuiminAgreement huiminAgreement = huiminAgreementService.getOne(new LambdaQueryWrapper<THuiminAgreement>() |
| | | .eq(THuiminAgreement::getOperatorId,operatorId)); |
| | | if (huiminAgreement!=null){ |
| | | List<THuiminAgreementSetting> list = huiminAgreementSettingService.list(new LambdaQueryWrapper<THuiminAgreementSetting>() |
| | | .eq(THuiminAgreementSetting::getAgreementId, huiminAgreement.getId())); |
| | | huiminCard.setAgreementSettings(list); |
| | | }else { |
| | | huiminCard.setAgreementSettings(new ArrayList<>()); |
| | | } |
| | | } |
| | | }else{ |
| | | huiminCard.setAgreementSettings(new ArrayList<>()); |
| | | } |
| | | |
| | | return ResultUtil.success(huiminCard); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡富文本内容-惠民卡列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getHuiminAgreementAndList") |
| | |
| | | } |
| | | pageNo = (pageNo - 1) * pageSize; |
| | | HuiminAgreementVO huiminAgreementVO = new HuiminAgreementVO(); |
| | | List<THuiminCard> list = huiminCardService.list(new LambdaQueryWrapper<THuiminCard>() |
| | | .eq(THuiminCard::getStoreId, storeId)); |
| | | if (list.isEmpty()){ |
| | | List<THuiminCard> cardList = huiminCardService.getHuiminAgreementAndList(pageNo,pageSize,storeId); |
| | | List<THuiminCard> cardListNolimit = huiminCardService.getHuiminAgreementAndListNolimit(storeId); |
| | | if (cardListNolimit.isEmpty()){ |
| | | // 没有配置惠民卡 展示富文本内容 |
| | | huiminAgreementVO.setShowType(1); |
| | | }else{ |
| | | huiminAgreementVO.setShowType(2); |
| | | } |
| | | List<THuiminCard> cardList = huiminCardService.getHuiminAgreementAndList(pageNo,pageSize,storeId); |
| | | List<Store> stores = storeClient.queryStoreByIds(Collections.singletonList(storeId)); |
| | | Store store = stores.get(0); |
| | | if (store.getOperatorId()==null || store.getOperatorId()==0){ |
| | | // 平台 |
| | | THuiminAgreement one = huiminAgreementService.getOne(new LambdaQueryWrapper<THuiminAgreement>() |
| | | .isNull(THuiminAgreement::getOperatorId).last("limit 1")); |
| | | huiminAgreementVO.setIntroduce(one.getStoreNoHuiminCardIntro()); |
| | | |
| | | }else{ |
| | | THuiminAgreement one = huiminAgreementService.getOne(new LambdaQueryWrapper<THuiminAgreement>() |
| | | .eq(THuiminAgreement::getOperatorId,store.getOperatorId()).last("limit 1")); |
| | | huiminAgreementVO.setIntroduce(one.getStoreNoHuiminCardIntro()); |
| | | |
| | | } |
| | | |
| | | List<TPayHuimin> payHuimins = payHuiminService.list(new LambdaQueryWrapper<TPayHuimin>() |
| | | .eq(TPayHuimin::getAppUserId, uid) |
| | | .ge(TPayHuimin::getEndTime,new Date()) |
| | | .eq(TPayHuimin::getStatus, 1)); |
| | | .in(TPayHuimin::getStatus, Arrays.asList(2,3))); |
| | | List<HuiminCardVO> huiminCardVOS = new ArrayList<>(); |
| | | for (THuiminCard huiminCardVO : cardList) { |
| | | HuiminCardVO huiminCardVO1 = new HuiminCardVO(); |
| | | huiminCardVO1.setId(huiminCardVO.getId()); |
| | | List<TPayHuimin> collect = payHuimins.stream().filter(e -> e.getCardId().equals(huiminCardVO.getId())).collect(Collectors.toList()); |
| | | if (!collect.isEmpty()){ |
| | | huiminCardVO1.setCover(huiminCardVO.getBuyCover()); |
| | | for (TPayHuimin tPayHuimin : collect) { |
| | | if (tPayHuimin.getStatus().equals(2)){ |
| | | huiminCardVO1.setCover(huiminCardVO.getBuyCover()); |
| | | huiminCardVO1.setIsBuy(1); |
| | | break; |
| | | }else{ |
| | | huiminCardVO1.setCover(huiminCardVO.getUnBuyCover()); |
| | | huiminCardVO1.setIsBuy(0); |
| | | } |
| | | } |
| | | }else{ |
| | | huiminCardVO1.setCover(huiminCardVO.getUnBuyCover()); |
| | | huiminCardVO1.setIsBuy(0); |
| | | } |
| | | huiminCardVOS.add(huiminCardVO1); |
| | | } |
| | |
| | | return ResultUtil.success(new HuiminAgreementVO()); |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡富文本内容-惠民卡列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/myHuiminCardList") |
| | | @ApiOperation(value = "个人中心-我的惠民卡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageSize", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "页条数", name = "pageNo", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<MyHuiminCardVO>> myHuiminCardList(Integer pageSize, Integer pageNo) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | pageNo = (pageNo - 1) * pageSize; |
| | | List<MyHuiminCardVO> cardList = huiminCardService.getMyHuiminCardList(pageNo,pageSize,uid); |
| | | List<THuiminCard> list = huiminCardService.list(); |
| | | for (MyHuiminCardVO myHuiminCardVO : cardList) { |
| | | TPayHuimin byId = payHuiminService.getById(myHuiminCardVO.getId()); |
| | | myHuiminCardVO.setEndTime(byId.getEndTime()); |
| | | |
| | | myHuiminCardVO.setSalesMoney(byId.getSalesMoney()); |
| | | |
| | | int count = huiminRecordService.count(new LambdaQueryWrapper<THuiminRecord>() |
| | | .eq(THuiminRecord::getHuiminCardId, myHuiminCardVO.getCardId())); |
| | | // 购卡7日内没有使用记录可退款。超过7日不管有没有使用记录都不能退款 |
| | | if (new Date().after(DateUtil.addDay(myHuiminCardVO.getPaymentTime(),7))){ |
| | | // 超过七天不可退款 |
| | | myHuiminCardVO.setIsRefund(0); |
| | | }else if (count>=7){ |
| | | myHuiminCardVO.setIsRefund(0); |
| | | }else{ |
| | | myHuiminCardVO.setIsRefund(1); |
| | | } |
| | | THuiminCard huiminCard = list.stream().filter(e -> e.getId().equals(myHuiminCardVO.getCardId())).findFirst().orElse(null); |
| | | if (null!=huiminCard){ |
| | | myHuiminCardVO.setCover(huiminCard.getBuyCover()); |
| | | } |
| | | if (myHuiminCardVO.getEndTime().before(new Date())){ |
| | | // 已过期 |
| | | myHuiminCardVO.setIsExpire(1); |
| | | if (null!=huiminCard){ |
| | | myHuiminCardVO.setCover(huiminCard.getUnBuyCover()); |
| | | } |
| | | }else{ |
| | | myHuiminCardVO.setIsExpire(0); |
| | | } |
| | | // 查询绑定人员列表 |
| | | List<TStudent> studentByIds = studentClient.getStudentByIds(myHuiminCardVO.getStudentId()); |
| | | myHuiminCardVO.setStudentList(studentByIds); |
| | | } |
| | | return ResultUtil.success(cardList); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(new ArrayList<>()); |
| | | } |
| | | } |
| | | /** |
| | | * 个人中心-我的惠民卡-退款 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/refund") |
| | | @ApiOperation(value = "个人中心-我的惠民卡-退款") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付记录id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<MyHuiminCardVO>> refund(Integer id) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TPayHuimin tPayHuimin = payHuiminService.getById(id); |
| | | if (tPayHuimin==null){ |
| | | return ResultUtil.error("订单不存在"); |
| | | } |
| | | if (tPayHuimin.getStatus()==3 && tPayHuimin.getRefundStatus()!=1){ |
| | | return ResultUtil.error("不可重复退款"); |
| | | } |
| | | if (tPayHuimin.getEndTime().before(new Date())){ |
| | | // 已过期 |
| | | return ResultUtil.error("惠民卡已过期,不可退款"); |
| | | } |
| | | int count = huiminRecordService.count(new LambdaQueryWrapper<THuiminRecord>() |
| | | .eq(THuiminRecord::getHuiminCardId, tPayHuimin.getCardId())); |
| | | // 购卡7日内没有使用记录可退款。超过7日不管有没有使用记录都不能退款 |
| | | if (new Date().after(DateUtil.addDay(tPayHuimin.getPaymentTime(),7))){ |
| | | // 超过七天不可退款 |
| | | return ResultUtil.error("惠民卡购买超过七天,不可退款"); |
| | | }else if (count>=7){ |
| | | // 使用记录大于等于7次不可退款 |
| | | return ResultUtil.error("惠民卡使用记录大于等于7次,不可退款"); |
| | | } |
| | | if (tPayHuimin.getPaymentType()==1){ |
| | | Map<String, String> map = payMoneyUtil.wxRefund(tPayHuimin.getOrderNumber(), tPayHuimin.getCode(), |
| | | tPayHuimin.getSalesMoney().toString(), tPayHuimin.getSalesMoney().toString(), "/base/huimin/callBack/wxRefundHuiminCallback"); |
| | | if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | System.err.println("-------------微信退款失败---------"); |
| | | System.err.println(map.get("return_msg")); |
| | | return ResultUtil.error("微信退款失败"); |
| | | } |
| | | }else{ |
| | | Map<String, String> map = payMoneyUtil.aliRefund(tPayHuimin.getOrderNumber(), tPayHuimin.getSalesMoney().toString()); |
| | | String return_code = map.get("code"); |
| | | if (!"10000".equals(return_code)) { |
| | | return ResultUtil.error(map.get("msg")); |
| | | } |
| | | String refund_id = map.get("trade_no"); |
| | | tPayHuimin.setRefundNumber(refund_id); |
| | | tPayHuimin.setRefundTime(new Date()); |
| | | tPayHuimin.setStatus(3); |
| | | tPayHuimin.setRefundStatus(2); |
| | | payHuiminService.updateById(tPayHuimin); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(new ArrayList<>()); |
| | | } |
| | | } |
| | | /** |
| | | * 个人中心-我的惠民卡-查看详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/myHuiminCardDetail") |
| | | @ApiOperation(value = "个人中心-我的惠民卡-查看详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付记录id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<MyHuiminCardDetailVO> myHuiminCardDetail(Integer id) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TPayHuimin tPayHuimin = payHuiminService.getById(id); |
| | | if (tPayHuimin==null){ |
| | | return ResultUtil.error("惠民卡不存在"); |
| | | } |
| | | THuiminCard byId = huiminCardService.getById(tPayHuimin.getCardId()); |
| | | MyHuiminCardDetailVO myHuiminCardDetailVO = new MyHuiminCardDetailVO(); |
| | | String siteIds = ""; |
| | | if (byId.getUseScope()==2){ |
| | | siteIds = byId.getUseIds(); |
| | | }else{ |
| | | siteIds = siteClient.querySiteByStoreIds(byId.getStoreIds()) |
| | | .stream() |
| | | .map(Site::getId) |
| | | .map(String::valueOf) |
| | | .collect(Collectors.joining(",")); |
| | | } |
| | | String temp ="{\"siteIds\":\"" +siteIds+"\","+"\"useTimes:\"\""+byId.getUseWeeks()+"\","+"\"unUseTimes:\""+byId.getUnUseTimes()+"\"}"; |
| | | myHuiminCardDetailVO.setQrCode(temp); |
| | | myHuiminCardDetailVO.setCardId(tPayHuimin.getCardId()); |
| | | myHuiminCardDetailVO.setHuiminCard(byId); |
| | | myHuiminCardDetailVO.setIntroduce(byId.getIntroduce()); |
| | | myHuiminCardDetailVO.setEndTime(tPayHuimin.getEndTime()); |
| | | // 查询绑定人员列表 |
| | | List<TStudent> studentByIds = studentClient.getStudentByIds(tPayHuimin.getStudentId()); |
| | | myHuiminCardDetailVO.setStudentList(studentByIds); |
| | | return ResultUtil.success(myHuiminCardDetailVO); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(new MyHuiminCardDetailVO()); |
| | | } |
| | | } |
| | | /** |
| | | * 获取添加人员、选择人员说明文案 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getContentForStudent") |
| | | @ApiOperation(value = "获取添加人员、选择人员说明文案") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<THuiminAgreement> getContentForStudent() { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | THuiminAgreement one = huiminAgreementService.lambdaQuery() |
| | | .isNull(THuiminAgreement::getOperatorId).last("limit 1").one(); |
| | | return ResultUtil.success(one); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(new THuiminAgreement()); |
| | | } |
| | | } |
| | | |
| | | } |