|
|
@ -1,6 +1,9 @@ |
|
|
package org.jeecg.api.service.impl; |
|
|
package org.jeecg.api.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang.StringUtils; |
|
|
import org.apache.commons.lang.StringUtils; |
|
|
import org.jeecg.api.bean.PageBean; |
|
|
import org.jeecg.api.bean.PageBean; |
|
|
@ -14,6 +17,7 @@ import org.jeecg.modules.commonIconImage.service.ICommonIconImageService; |
|
|
import org.jeecg.modules.commonShop.entity.CommonShop; |
|
|
import org.jeecg.modules.commonShop.entity.CommonShop; |
|
|
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; |
|
|
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; |
|
|
import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; |
|
|
import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; |
|
|
|
|
|
import org.jeecg.modules.pay.MpWxPayService; |
|
|
import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; |
|
|
import org.jeecg.modules.popularizeActivity.entity.PopularizeActivity; |
|
|
import org.jeecg.modules.popularizeActivity.service.IPopularizeActivityService; |
|
|
import org.jeecg.modules.popularizeActivity.service.IPopularizeActivityService; |
|
|
import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; |
|
|
import org.jeecg.modules.popularizeAuthentication.entity.PopularizeAuthentication; |
|
|
@ -22,6 +26,7 @@ import org.jeecg.modules.popularizeCity.entity.PopularizeCity; |
|
|
import org.jeecg.modules.popularizeCity.service.IPopularizeCityService; |
|
|
import org.jeecg.modules.popularizeCity.service.IPopularizeCityService; |
|
|
import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; |
|
|
import org.jeecg.modules.popularizeCollect.entity.PopularizeCollect; |
|
|
import org.jeecg.modules.popularizeCollect.service.IPopularizeCollectService; |
|
|
import org.jeecg.modules.popularizeCollect.service.IPopularizeCollectService; |
|
|
|
|
|
import org.jeecg.modules.popularizeCountry.entity.PopularizeCountry; |
|
|
import org.jeecg.modules.popularizeCountry.service.IPopularizeCountryService; |
|
|
import org.jeecg.modules.popularizeCountry.service.IPopularizeCountryService; |
|
|
import org.jeecg.modules.popularizeEvaluate.entity.PopularizeEvaluate; |
|
|
import org.jeecg.modules.popularizeEvaluate.entity.PopularizeEvaluate; |
|
|
import org.jeecg.modules.popularizeEvaluate.service.IPopularizeEvaluateService; |
|
|
import org.jeecg.modules.popularizeEvaluate.service.IPopularizeEvaluateService; |
|
|
@ -31,7 +36,12 @@ import org.jeecg.modules.popularizeOrder.entity.PopularizeOrder; |
|
|
import org.jeecg.modules.popularizeOrder.service.IPopularizeOrderService; |
|
|
import org.jeecg.modules.popularizeOrder.service.IPopularizeOrderService; |
|
|
import org.jeecg.modules.popularizeRecruit.entity.PopularizeRecruit; |
|
|
import org.jeecg.modules.popularizeRecruit.entity.PopularizeRecruit; |
|
|
import org.jeecg.modules.popularizeRecruit.service.IPopularizeRecruitService; |
|
|
import org.jeecg.modules.popularizeRecruit.service.IPopularizeRecruitService; |
|
|
|
|
|
import org.jeecg.modules.popularizeRecruitLog.entity.PopularizeRecruitLog; |
|
|
|
|
|
import org.jeecg.modules.popularizeRecruitLog.service.IPopularizeRecruitLogService; |
|
|
|
|
|
import org.jeecg.modules.popularizeSchool.entity.PopularizeSchool; |
|
|
import org.jeecg.modules.popularizeSchool.service.IPopularizeSchoolService; |
|
|
import org.jeecg.modules.popularizeSchool.service.IPopularizeSchoolService; |
|
|
|
|
|
import org.jeecg.modules.popularizeSchoolSub.entity.PopularizeSchoolSub; |
|
|
|
|
|
import org.jeecg.modules.popularizeSchoolSub.service.IPopularizeSchoolSubService; |
|
|
import org.jeecg.modules.popularizeSignLog.service.IPopularizeSignLogService; |
|
|
import org.jeecg.modules.popularizeSignLog.service.IPopularizeSignLogService; |
|
|
import org.jeecg.modules.popularizeTravel.entity.PopularizeTravel; |
|
|
import org.jeecg.modules.popularizeTravel.entity.PopularizeTravel; |
|
|
import org.jeecg.modules.popularizeTravel.service.IPopularizeTravelService; |
|
|
import org.jeecg.modules.popularizeTravel.service.IPopularizeTravelService; |
|
|
@ -40,8 +50,8 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import javax.transaction.Transactional; |
|
|
import javax.transaction.Transactional; |
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@ -67,13 +77,21 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IPopularizeCityService popularizeCityService; |
|
|
private IPopularizeCityService popularizeCityService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private IPopularizeSchoolSubService popularizeSchoolSubService; |
|
|
|
|
|
@Autowired |
|
|
private IPopularizeSignLogService popularizeSignLogService; |
|
|
private IPopularizeSignLogService popularizeSignLogService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IPopularizeAuthenticationService popularizeAuthenticationService; |
|
|
private IPopularizeAuthenticationService popularizeAuthenticationService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IPopularizeActivityService popularizeActivityService; |
|
|
private IPopularizeActivityService popularizeActivityService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IPopularizeRecruitLogService popularizeRecruitLogService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//支付接口 |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private MpWxPayService mpWxPayService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private IHanHaiMemberService hanHaiMemberService; |
|
|
private IHanHaiMemberService hanHaiMemberService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
@ -85,6 +103,7 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
private ShiroRealm shiroRealm; |
|
|
private ShiroRealm shiroRealm; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取首页地区 |
|
|
//获取首页地区 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getArea(){ |
|
|
public Result<?> getArea(){ |
|
|
@ -108,10 +127,11 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
|
|
|
|
|
|
//获取首页活动列表带分页 |
|
|
//获取首页活动列表带分页 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getActivityPageList(String title, PageBean pageBean){ |
|
|
|
|
|
|
|
|
public Result<?> getActivityPageList(String title, String state, PageBean pageBean){ |
|
|
Page<PopularizeActivity> page = new Page<PopularizeActivity>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeActivity> page = new Page<PopularizeActivity>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeActivity> page1 = popularizeActivityService |
|
|
Page<PopularizeActivity> page1 = popularizeActivityService |
|
|
.lambdaQuery() |
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeActivity::getState,state) |
|
|
.orderByDesc(PopularizeActivity::getCreateTime) |
|
|
.orderByDesc(PopularizeActivity::getCreateTime) |
|
|
.page(page); |
|
|
.page(page); |
|
|
//如果标题不为空 |
|
|
//如果标题不为空 |
|
|
@ -119,9 +139,29 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
page1 = popularizeActivityService |
|
|
page1 = popularizeActivityService |
|
|
.lambdaQuery() |
|
|
.lambdaQuery() |
|
|
.like(PopularizeActivity::getTitle,title) |
|
|
.like(PopularizeActivity::getTitle,title) |
|
|
|
|
|
.eq(PopularizeActivity::getState,state) |
|
|
.orderByDesc(PopularizeActivity::getCreateTime) |
|
|
.orderByDesc(PopularizeActivity::getCreateTime) |
|
|
.page(page); |
|
|
.page(page); |
|
|
} |
|
|
} |
|
|
|
|
|
//得到集合 |
|
|
|
|
|
List<PopularizeActivity> records = page1.getRecords(); |
|
|
|
|
|
//创建一个新的集合 |
|
|
|
|
|
List<PopularizeActivity> recruitList = new ArrayList<>(); |
|
|
|
|
|
for (PopularizeActivity recruit : records) { |
|
|
|
|
|
//创建一个对象 |
|
|
|
|
|
PopularizeActivity recruitObj = recruit; |
|
|
|
|
|
recruitObj.setPopularizeOrderList( |
|
|
|
|
|
popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getActivityOrderId, recruit.getId()) |
|
|
|
|
|
.ge(PopularizeOrder::getState, 1) |
|
|
|
|
|
.list() |
|
|
|
|
|
); |
|
|
|
|
|
recruitObj.setNum(recruitObj.getPopularizeOrderList().size()); |
|
|
|
|
|
recruitList.add(recruitObj); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
page1.setRecords(recruitList); |
|
|
return Result.OK(page1); |
|
|
return Result.OK(page1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -129,14 +169,26 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getActivityInfo(String activityId){ |
|
|
public Result<?> getActivityInfo(String activityId){ |
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
PopularizeActivity byId = popularizeActivityService.getById(activityId); |
|
|
PopularizeActivity byId = popularizeActivityService.getById(activityId); |
|
|
return Result.OK(byId); |
|
|
|
|
|
|
|
|
map.put("activityInfo",byId); |
|
|
|
|
|
//根据活动中主理人用户标识查询用户信息 |
|
|
|
|
|
HanHaiMember byId1 = hanHaiMemberService.getById(byId.getAdminUser()); |
|
|
|
|
|
map.put("adminUserInfo",byId1); |
|
|
|
|
|
//根据用户标识查询主理人信息 |
|
|
|
|
|
PopularizeAuthentication one = popularizeAuthenticationService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeAuthentication::getUserId, byId1.getId()) |
|
|
|
|
|
.eq(PopularizeAuthentication::getState, "1") |
|
|
|
|
|
.one(); |
|
|
|
|
|
map.put("adminUser",one); |
|
|
|
|
|
return Result.OK(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取旅行列表带分页 |
|
|
//获取旅行列表带分页 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getTravelPageList(String title, PageBean pageBean){ |
|
|
|
|
|
|
|
|
public Result<?> getTravelPageList(String title,String state, PageBean pageBean){ |
|
|
Page<PopularizeTravel> page = new Page<PopularizeTravel>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeTravel> page = new Page<PopularizeTravel>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeTravel> page1 = popularizeTravelService |
|
|
Page<PopularizeTravel> page1 = popularizeTravelService |
|
|
.lambdaQuery() |
|
|
.lambdaQuery() |
|
|
@ -147,9 +199,31 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
page1 = popularizeTravelService |
|
|
page1 = popularizeTravelService |
|
|
.lambdaQuery() |
|
|
.lambdaQuery() |
|
|
.like(PopularizeTravel::getTitle,title) |
|
|
.like(PopularizeTravel::getTitle,title) |
|
|
|
|
|
.eq(PopularizeTravel::getState,state) |
|
|
.orderByDesc(PopularizeTravel::getCreateTime) |
|
|
.orderByDesc(PopularizeTravel::getCreateTime) |
|
|
.page(page); |
|
|
.page(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//得到集合 |
|
|
|
|
|
List<PopularizeTravel> records = page1.getRecords(); |
|
|
|
|
|
//创建一个新的集合 |
|
|
|
|
|
List<PopularizeTravel> recruitList = new ArrayList<>(); |
|
|
|
|
|
for (PopularizeTravel recruit : records) { |
|
|
|
|
|
//创建一个对象 |
|
|
|
|
|
PopularizeTravel recruitObj = recruit; |
|
|
|
|
|
recruitObj.setOrderList( |
|
|
|
|
|
popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getTravelOrderId, recruit.getId()) |
|
|
|
|
|
.ge(PopularizeOrder::getState, 1) |
|
|
|
|
|
.list() |
|
|
|
|
|
); |
|
|
|
|
|
recruitObj.setNum(recruitObj.getOrderList().size()); |
|
|
|
|
|
recruitList.add(recruitObj); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
page1.setRecords(recruitList); |
|
|
|
|
|
|
|
|
return Result.OK(page1); |
|
|
return Result.OK(page1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -157,8 +231,23 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getTravelInfo(String travelId){ |
|
|
public Result<?> getTravelInfo(String travelId){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
PopularizeTravel byId = popularizeTravelService.getById(travelId); |
|
|
PopularizeTravel byId = popularizeTravelService.getById(travelId); |
|
|
return Result.OK(byId); |
|
|
|
|
|
|
|
|
map.put("travel",byId); |
|
|
|
|
|
//根据活动中主理人用户标识查询用户信息 |
|
|
|
|
|
HanHaiMember byId1 = hanHaiMemberService.getById(byId.getAdminUser()); |
|
|
|
|
|
map.put("adminUserInfo",byId1); |
|
|
|
|
|
//根据用户标识查询主理人信息 |
|
|
|
|
|
PopularizeAuthentication one = popularizeAuthenticationService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeAuthentication::getUserId, byId1.getId()) |
|
|
|
|
|
.eq(PopularizeAuthentication::getState, "1") |
|
|
|
|
|
.one(); |
|
|
|
|
|
map.put("adminUser",one); |
|
|
|
|
|
|
|
|
|
|
|
return Result.OK(map); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -177,18 +266,37 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getTwoPageList(String token,Integer type, PageBean pageBean){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
if(type == 1){ |
|
|
|
|
|
return this.getTravelPageList(null,"1",pageBean); |
|
|
|
|
|
}else{ |
|
|
|
|
|
return this.getActivityPageList(null,"1",pageBean); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取订单列表数据带分页 |
|
|
//获取订单列表数据带分页 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getOrderPageList(String token, PageBean pageBean){ HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
|
|
|
public Result<?> getOrderPageList(String token,String state, PageBean pageBean){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
Page<PopularizeOrder> page = new Page<PopularizeOrder>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeOrder> page = new Page<PopularizeOrder>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
Page<PopularizeOrder> page1 = popularizeOrderService |
|
|
Page<PopularizeOrder> page1 = popularizeOrderService |
|
|
.lambdaQuery() |
|
|
.lambdaQuery() |
|
|
.eq(PopularizeOrder::getUserId,hanHaiMember.getId()) |
|
|
.eq(PopularizeOrder::getUserId,hanHaiMember.getId()) |
|
|
// .orderByDesc(PopularizeOrder::getCreateTime) |
|
|
|
|
|
|
|
|
.orderByDesc(PopularizeOrder::getCreateTime) |
|
|
.page(page); |
|
|
.page(page); |
|
|
|
|
|
if(StringUtils.isNotBlank(state)){ |
|
|
|
|
|
page1 = popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getUserId,hanHaiMember.getId()) |
|
|
|
|
|
.eq(PopularizeOrder::getState,state) |
|
|
|
|
|
.orderByDesc(PopularizeOrder::getCreateTime) |
|
|
|
|
|
.page(page); |
|
|
|
|
|
} |
|
|
return Result.OK(page1); |
|
|
return Result.OK(page1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -206,7 +314,7 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
public Result<?> cancelOrder(String token,String orderId){ |
|
|
public Result<?> cancelOrder(String token,String orderId){ |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(orderId); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(orderId); |
|
|
byId.setState("2"); |
|
|
|
|
|
|
|
|
byId.setState("3"); |
|
|
popularizeOrderService.updateById(byId); |
|
|
popularizeOrderService.updateById(byId); |
|
|
return Result.OK("取消成功"); |
|
|
return Result.OK("取消成功"); |
|
|
} |
|
|
} |
|
|
@ -216,7 +324,7 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
public Result<?> signIn(String token,String orderId){ |
|
|
public Result<?> signIn(String token,String orderId){ |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(orderId); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(orderId); |
|
|
byId.setState("3"); |
|
|
|
|
|
|
|
|
byId.setState("2"); |
|
|
popularizeOrderService.updateById(byId); |
|
|
popularizeOrderService.updateById(byId); |
|
|
return Result.OK("签到成功"); |
|
|
return Result.OK("签到成功"); |
|
|
} |
|
|
} |
|
|
@ -241,18 +349,76 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
} |
|
|
} |
|
|
evaluateObj.setDetails(evaluate); |
|
|
evaluateObj.setDetails(evaluate); |
|
|
boolean save = popularizeEvaluateService.save(evaluateObj); |
|
|
boolean save = popularizeEvaluateService.save(evaluateObj); |
|
|
|
|
|
|
|
|
|
|
|
//修改订单评价状态 |
|
|
|
|
|
byId.setIsFp("Y"); |
|
|
|
|
|
popularizeOrderService.updateById(byId); |
|
|
return Result.OK("评价成功"); |
|
|
return Result.OK("评价成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//我的发票列表带分页 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getInvoicePageList(String token, PageBean pageBean){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
Page<PopularizeInvoicing> page = new Page<PopularizeInvoicing>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
|
|
|
Page<PopularizeInvoicing> page1 = popularizeInvoicingService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeInvoicing::getUserId,hanHaiMember.getId()) |
|
|
|
|
|
.orderByDesc(PopularizeInvoicing::getCreateTime) |
|
|
|
|
|
.page(page); |
|
|
|
|
|
|
|
|
|
|
|
//得到集合 |
|
|
|
|
|
List<PopularizeInvoicing> records = page1.getRecords(); |
|
|
|
|
|
//创建一个新的集合 |
|
|
|
|
|
List<PopularizeInvoicing> recruitList = new ArrayList<>(); |
|
|
|
|
|
for (PopularizeInvoicing recruit : records) { |
|
|
|
|
|
//创建一个对象 |
|
|
|
|
|
PopularizeInvoicing recruitObj = recruit; |
|
|
|
|
|
if (recruit.getNoType().equals("0")){ |
|
|
|
|
|
recruitObj.setActivityList( |
|
|
|
|
|
popularizeActivityService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeActivity::getId, recruit.getActivityId()) |
|
|
|
|
|
.list() |
|
|
|
|
|
); |
|
|
|
|
|
}else{ |
|
|
|
|
|
recruitObj.setTravelList( |
|
|
|
|
|
popularizeTravelService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeTravel::getId, recruit.getTravelId()) |
|
|
|
|
|
.list() |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
recruitList.add(recruitObj); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
page1.setRecords(recruitList); |
|
|
|
|
|
return Result.OK(page1); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//订单开具发票 |
|
|
//订单开具发票 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> invoice( String token, PopularizeInvoicing popularizeInvoicing){ |
|
|
public Result<?> invoice( String token, PopularizeInvoicing popularizeInvoicing){ |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(popularizeInvoicing.getOrderId()); |
|
|
PopularizeOrder byId = popularizeOrderService.getById(popularizeInvoicing.getOrderId()); |
|
|
|
|
|
|
|
|
//创建发票信息 |
|
|
//创建发票信息 |
|
|
popularizeInvoicing.setUserId(hanHaiMember.getId()); |
|
|
popularizeInvoicing.setUserId(hanHaiMember.getId()); |
|
|
popularizeInvoicing.setCreateTime(new Date()); |
|
|
popularizeInvoicing.setCreateTime(new Date()); |
|
|
|
|
|
popularizeInvoicing.setNoType(byId.getType()); |
|
|
|
|
|
if(byId.getType().equals("0")){ |
|
|
|
|
|
popularizeInvoicing.setActivityId(byId.getActivityOrderId()); |
|
|
|
|
|
}else{ |
|
|
|
|
|
popularizeInvoicing.setTravelId(byId.getTravelOrderId()); |
|
|
|
|
|
} |
|
|
|
|
|
popularizeInvoicing.setState("0"); |
|
|
|
|
|
//名称必填 |
|
|
|
|
|
if(StringUtils.isBlank(popularizeInvoicing.getName())){ |
|
|
|
|
|
return Result.error("请填写发票抬头"); |
|
|
|
|
|
} |
|
|
|
|
|
if(StringUtils.isBlank(popularizeInvoicing.getEmil())){ |
|
|
|
|
|
return Result.error("请填写邮箱地址"); |
|
|
|
|
|
} |
|
|
popularizeInvoicingService.save(popularizeInvoicing); |
|
|
popularizeInvoicingService.save(popularizeInvoicing); |
|
|
|
|
|
|
|
|
return Result.OK("开票成功"); |
|
|
return Result.OK("开票成功"); |
|
|
@ -264,13 +430,25 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
public Result<?> collect(String token,String activityId){ |
|
|
public Result<?> collect(String token,String activityId){ |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
PopularizeCollect byId = popularizeCollectService.getById(activityId); |
|
|
PopularizeCollect byId = popularizeCollectService.getById(activityId); |
|
|
byId.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
byId.setCreateTime(new Date()); |
|
|
|
|
|
popularizeCollectService.save(byId); |
|
|
|
|
|
return Result.OK("收藏成功"); |
|
|
|
|
|
|
|
|
//如果不为空则删除数据取消收藏 |
|
|
|
|
|
if(byId != null){ |
|
|
|
|
|
popularizeCollectService.removeById(byId.getId()); |
|
|
|
|
|
return Result.OK("取消收藏成功"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
byId = new PopularizeCollect(); |
|
|
|
|
|
byId.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
byId.setActivityId(activityId); |
|
|
|
|
|
byId.setCreateTime(new Date()); |
|
|
|
|
|
popularizeCollectService.save(byId); |
|
|
|
|
|
return Result.OK("收藏成功"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取招募列表数据带分页 |
|
|
//获取招募列表数据带分页 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getRecruitPageList(String title, PageBean pageBean){ |
|
|
public Result<?> getRecruitPageList(String title, PageBean pageBean){ |
|
|
@ -287,22 +465,92 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
.orderByDesc(PopularizeRecruit::getCreateTime) |
|
|
.orderByDesc(PopularizeRecruit::getCreateTime) |
|
|
.page(page); |
|
|
.page(page); |
|
|
} |
|
|
} |
|
|
|
|
|
//得到集合 |
|
|
|
|
|
List<PopularizeRecruit> records = page1.getRecords(); |
|
|
|
|
|
//创建一个新的集合 |
|
|
|
|
|
List<PopularizeRecruit> recruitList = new ArrayList<>(); |
|
|
|
|
|
for (PopularizeRecruit recruit : records) { |
|
|
|
|
|
//创建一个对象 |
|
|
|
|
|
PopularizeRecruit recruitObj = recruit; |
|
|
|
|
|
recruitObj.setPopularizeRecruitLogList( |
|
|
|
|
|
popularizeRecruitLogService.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeRecruitLog::getRecruitId,recruit.getId()) |
|
|
|
|
|
.list() |
|
|
|
|
|
); |
|
|
|
|
|
recruitObj.setNum(recruitObj.getPopularizeRecruitLogList().size()); |
|
|
|
|
|
recruitList.add(recruitObj); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
page1.setRecords(recruitList); |
|
|
|
|
|
|
|
|
return Result.OK(page1); |
|
|
return Result.OK(page1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//点击参与招募 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取招募详情 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getRecruitInfo(String recruitId){ |
|
|
|
|
|
PopularizeRecruit byId = popularizeRecruitService.getById(recruitId); |
|
|
|
|
|
return Result.OK(byId); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//主理人认证 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> joinRecruit(String token, PopularizeAuthentication authentication){ |
|
|
public Result<?> joinRecruit(String token, PopularizeAuthentication authentication){ |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
authentication.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
boolean save = popularizeAuthenticationService.save(authentication); |
|
|
|
|
|
|
|
|
//查询该用户是否已经提交 |
|
|
|
|
|
PopularizeAuthentication one = popularizeAuthenticationService.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeAuthentication::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
if(one!=null){ |
|
|
|
|
|
//审核成功 |
|
|
|
|
|
if(one.getState().equals("1")){ |
|
|
|
|
|
return Result.OK("您已经成为了主理人,请不要重复提交"); |
|
|
|
|
|
}else if(one.getState().equals("2")){ |
|
|
|
|
|
authentication.setId(one.getId()); |
|
|
|
|
|
authentication.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
boolean save = popularizeAuthenticationService.updateById(authentication); |
|
|
|
|
|
return Result.OK("参与成功"); |
|
|
|
|
|
}else{ |
|
|
|
|
|
authentication.setId(one.getId()); |
|
|
|
|
|
authentication.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
boolean save = popularizeAuthenticationService.updateById(authentication); |
|
|
|
|
|
return Result.OK("您已经提交了,请等待审核"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
authentication.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
boolean save = popularizeAuthenticationService.saveOrUpdate(authentication); |
|
|
|
|
|
} |
|
|
return Result.OK("参与成功"); |
|
|
return Result.OK("参与成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取主理人认证信息 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getJoinRecruitInfo(String token){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
//查询该用户是否已经提交 |
|
|
|
|
|
PopularizeAuthentication one = popularizeAuthenticationService.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeAuthentication::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
return Result.OK(one); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<?> getActivityMemberPageList( String token, String title, PageBean pageBean){ |
|
|
|
|
|
return Result.OK(); |
|
|
|
|
|
|
|
|
public Result<?> getActivityMemberPageList( String token, String title, Integer type,PageBean pageBean){ |
|
|
|
|
|
|
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
if(type == 1){ |
|
|
|
|
|
return this.getTravelPageList(null,"1",pageBean); |
|
|
|
|
|
}else{ |
|
|
|
|
|
return this.getActivityPageList(null,"1",pageBean); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//招募活动签到里面的签到用户列表带分页 |
|
|
//招募活动签到里面的签到用户列表带分页 |
|
|
@Override |
|
|
@Override |
|
|
@ -316,9 +564,44 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
return Result.OK(); |
|
|
return Result.OK(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//主理人认证 |
|
|
|
|
|
|
|
|
//点击参与招募 |
|
|
@Override |
|
|
@Override |
|
|
public Result<?> shopUserAuth(String token,String recruitId){ |
|
|
public Result<?> shopUserAuth(String token,String recruitId){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
if(StringUtils.isBlank(recruitId)){ |
|
|
|
|
|
return Result.error("招募标识不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
//根据标识查询招募活动信息 |
|
|
|
|
|
PopularizeRecruit byId = popularizeRecruitService.getById(recruitId); |
|
|
|
|
|
if(byId==null){ |
|
|
|
|
|
return Result.error("招募标识错误"); |
|
|
|
|
|
} |
|
|
|
|
|
//根据用户标识查询主理人信息 |
|
|
|
|
|
PopularizeAuthentication one = popularizeAuthenticationService.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeAuthentication::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.eq(PopularizeAuthentication::getState, "1") |
|
|
|
|
|
.one(); |
|
|
|
|
|
if(one==null){ |
|
|
|
|
|
return Result.error("您还不是主理人,请先认证"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询是否已经点击了招募 |
|
|
|
|
|
PopularizeRecruitLog one1 = popularizeRecruitLogService.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeRecruitLog::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.eq(PopularizeRecruitLog::getRecruitId, recruitId) |
|
|
|
|
|
.one(); |
|
|
|
|
|
if(one1!=null){ |
|
|
|
|
|
return Result.error("您已经参与过该招募活动"); |
|
|
|
|
|
} |
|
|
|
|
|
//增加招募记录 |
|
|
|
|
|
PopularizeRecruitLog popularizeRecruitLog = new PopularizeRecruitLog(); |
|
|
|
|
|
popularizeRecruitLog.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
popularizeRecruitLog.setRecruitId(recruitId); |
|
|
|
|
|
popularizeRecruitLog.setCreateTime(new Date()); |
|
|
|
|
|
popularizeRecruitLog.setRecruitTime(byId.getStartTime()); |
|
|
|
|
|
popularizeRecruitLog.setName(one.getName()); |
|
|
|
|
|
popularizeRecruitLog.setPhone(one.getPhone()); |
|
|
|
|
|
popularizeRecruitLog.setHeadImage(hanHaiMember.getHeadImage()); |
|
|
|
|
|
popularizeRecruitLogService.save(popularizeRecruitLog); |
|
|
return Result.OK(); |
|
|
return Result.OK(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -327,9 +610,258 @@ public class ApiIndexServiceImpl implements ApiIndexService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//创建订单 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> createOrder(String token, String id,Integer typePrice,Integer type){ |
|
|
|
|
|
if(type == 1){ |
|
|
|
|
|
return this.createOrderTravel(token, id); |
|
|
|
|
|
}else{ |
|
|
|
|
|
return this.createOrderActivity(token, id, typePrice); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result<?> createOrderTravel(String token, String id){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
//判断活动标识不能为空 |
|
|
|
|
|
if(StringUtils.isBlank(id)){ |
|
|
|
|
|
return Result.error("旅行标识不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
//根据标识查活动信息 |
|
|
|
|
|
PopularizeTravel byId = popularizeTravelService.getById(id); |
|
|
|
|
|
if(byId==null){ |
|
|
|
|
|
return Result.error("旅行不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
//判断活动是否已结束 |
|
|
|
|
|
if(byId.getState().equals("1")){ |
|
|
|
|
|
return Result.error("旅行已结束"); |
|
|
|
|
|
} |
|
|
|
|
|
//活动超时 |
|
|
|
|
|
if(byId.getStartTime().getTime()<new Date().getTime()){ |
|
|
|
|
|
return Result.error("旅行已结束,当前时间无法报名"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询是否已报名该活动 |
|
|
|
|
|
PopularizeOrder order = popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getTravelOrderId, id) |
|
|
|
|
|
.eq(PopularizeOrder::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
if(order!=null){ |
|
|
|
|
|
return Result.error("已报名该旅行,请不要重复报名!"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询报名该活动的已支付成功的订单数是否大于报名人数 |
|
|
|
|
|
long count = popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getTravelOrderId, id) |
|
|
|
|
|
.eq(PopularizeOrder::getState, "1") |
|
|
|
|
|
.count(); |
|
|
|
|
|
if(count>=byId.getNum()){ |
|
|
|
|
|
return Result.error("报名人数已满,请不要重复报名!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//创建订单 |
|
|
|
|
|
BigDecimal payPrice = byId.getPrice(); |
|
|
|
|
|
String orderId =System.currentTimeMillis()+""; |
|
|
|
|
|
PopularizeOrder popularizeOrder = new PopularizeOrder(); |
|
|
|
|
|
popularizeOrder.setId(orderId); |
|
|
|
|
|
popularizeOrder.setActivityOrderId(id); |
|
|
|
|
|
popularizeOrder.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
popularizeOrder.setType("0"); //0活动1旅行 |
|
|
|
|
|
popularizeOrder.setTitle(byId.getTitle()); |
|
|
|
|
|
popularizeOrder.setImage(byId.getImage()); |
|
|
|
|
|
popularizeOrder.setStartTime(byId.getStartTime()); |
|
|
|
|
|
popularizeOrder.setAddress(byId.getAddress()); |
|
|
|
|
|
popularizeOrder.setPrice(byId.getPrice()); //活动价格 |
|
|
|
|
|
popularizeOrder.setNum(1); |
|
|
|
|
|
popularizeOrder.setState("0"); |
|
|
|
|
|
popularizeOrder.setCreateTime(new Date()); |
|
|
|
|
|
popularizeOrder.setIsFp("N"); |
|
|
|
|
|
popularizeOrder.setIsPj("N"); |
|
|
|
|
|
popularizeOrder.setOpen("N"); |
|
|
|
|
|
popularizeOrderService.save(popularizeOrder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//吊起微信支付 |
|
|
|
|
|
String s = payPrice.multiply(new BigDecimal(100)).toString(); |
|
|
|
|
|
int i1 = Double.valueOf(s).intValue(); |
|
|
|
|
|
Object appOrder = mpWxPayService.createOrder( |
|
|
|
|
|
"购买"+popularizeOrder.getTitle(), |
|
|
|
|
|
"127.0.0.1", |
|
|
|
|
|
orderId, |
|
|
|
|
|
i1, |
|
|
|
|
|
orderId, |
|
|
|
|
|
hanHaiMember.getAppletOpenid(), |
|
|
|
|
|
popularizeOrder.toString()); |
|
|
|
|
|
|
|
|
|
|
|
return Result.OK("支付成功",appOrder); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Result<?> createOrderActivity(String token, String id,Integer typePrice){ |
|
|
|
|
|
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); |
|
|
|
|
|
//判断活动标识不能为空 |
|
|
|
|
|
if(StringUtils.isBlank(id)){ |
|
|
|
|
|
return Result.error("活动标识不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
//判断报名类型不能为空 |
|
|
|
|
|
if(typePrice==null){ |
|
|
|
|
|
return Result.error("报名价格类型不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
//根据标识查活动信息 |
|
|
|
|
|
PopularizeActivity byId = popularizeActivityService.getById(id); |
|
|
|
|
|
if(byId==null){ |
|
|
|
|
|
return Result.error("活动不存在"); |
|
|
|
|
|
} |
|
|
|
|
|
//判断活动是否已结束 |
|
|
|
|
|
if(byId.getState()==1){ |
|
|
|
|
|
return Result.error("活动已结束"); |
|
|
|
|
|
} |
|
|
|
|
|
//活动超时 |
|
|
|
|
|
if(byId.getStartTime().getTime()<new Date().getTime()){ |
|
|
|
|
|
return Result.error("活动已结束,当前时间无法报名"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询是否已报名该活动 |
|
|
|
|
|
PopularizeOrder order = popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getActivityOrderId, id) |
|
|
|
|
|
.eq(PopularizeOrder::getUserId, hanHaiMember.getId()) |
|
|
|
|
|
.one(); |
|
|
|
|
|
if(order!=null){ |
|
|
|
|
|
return Result.error("已报名该活动,请不要重复报名!"); |
|
|
|
|
|
} |
|
|
|
|
|
//查询报名该活动的已支付成功的订单数是否大于报名人数 |
|
|
|
|
|
long count = popularizeOrderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(PopularizeOrder::getActivityOrderId, id) |
|
|
|
|
|
.eq(PopularizeOrder::getState, "1") |
|
|
|
|
|
.count(); |
|
|
|
|
|
if(count>=byId.getSum()){ |
|
|
|
|
|
return Result.error("报名人数已满"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//创建订单 |
|
|
|
|
|
BigDecimal payPrice = new BigDecimal(0); |
|
|
|
|
|
String orderId =System.currentTimeMillis()+""; |
|
|
|
|
|
PopularizeOrder popularizeOrder = new PopularizeOrder(); |
|
|
|
|
|
popularizeOrder.setId(orderId); |
|
|
|
|
|
popularizeOrder.setActivityOrderId(id); |
|
|
|
|
|
popularizeOrder.setUserId(hanHaiMember.getId()); |
|
|
|
|
|
popularizeOrder.setType("0"); //0活动1旅行 |
|
|
|
|
|
popularizeOrder.setTitle(byId.getTitle()); |
|
|
|
|
|
popularizeOrder.setImage(byId.getImage()); |
|
|
|
|
|
popularizeOrder.setStartTime(byId.getStartTime()); |
|
|
|
|
|
popularizeOrder.setAddress(byId.getAddress()); |
|
|
|
|
|
popularizeOrder.setPrice(byId.getPrice()); //活动价格 |
|
|
|
|
|
//如果typePrice=0为早鸟价 1为单人价 2为尊享价 |
|
|
|
|
|
if(typePrice==0){ |
|
|
|
|
|
popularizeOrder.setPayPrice(byId.getBirdPrice()); |
|
|
|
|
|
payPrice = byId.getBirdPrice(); |
|
|
|
|
|
}else if(typePrice==1){ |
|
|
|
|
|
popularizeOrder.setPayPrice(byId.getPersonPrice()); |
|
|
|
|
|
payPrice = byId.getPersonPrice(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
popularizeOrder.setPayPrice(byId.getExpensivePrice()); |
|
|
|
|
|
payPrice = byId.getExpensivePrice(); |
|
|
|
|
|
} |
|
|
|
|
|
popularizeOrder.setNum(1); |
|
|
|
|
|
popularizeOrder.setState("0"); |
|
|
|
|
|
popularizeOrder.setCreateTime(new Date()); |
|
|
|
|
|
popularizeOrder.setIsFp("N"); |
|
|
|
|
|
popularizeOrder.setIsPj("N"); |
|
|
|
|
|
popularizeOrder.setOpen("N"); |
|
|
|
|
|
popularizeOrder.setDetails(byId.getOrderDetails()); |
|
|
|
|
|
popularizeOrderService.save(popularizeOrder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//吊起微信支付 |
|
|
|
|
|
String s = payPrice.multiply(new BigDecimal(100)).toString(); |
|
|
|
|
|
int i1 = Double.valueOf(s).intValue(); |
|
|
|
|
|
Object appOrder = mpWxPayService.createOrder( |
|
|
|
|
|
"购买"+popularizeOrder.getTitle(), |
|
|
|
|
|
"127.0.0.1", |
|
|
|
|
|
orderId, |
|
|
|
|
|
i1, |
|
|
|
|
|
orderId, |
|
|
|
|
|
hanHaiMember.getAppletOpenid(), |
|
|
|
|
|
popularizeOrder.toString()); |
|
|
|
|
|
|
|
|
|
|
|
return Result.OK("支付成功",appOrder); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//商城-支付回调 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Object payNotify(String requestBody){ |
|
|
|
|
|
WxPayOrderNotifyResult notify = mpWxPayService.notify(requestBody); |
|
|
|
|
|
String outTradeNo = notify.getOutTradeNo(); |
|
|
|
|
|
log.info("活动报名支付回调订单号码:"+outTradeNo); |
|
|
|
|
|
//查询活动订单 |
|
|
|
|
|
PopularizeOrder order = popularizeOrderService.getById(outTradeNo); |
|
|
|
|
|
//如果订单存在 |
|
|
|
|
|
if(order!=null){ |
|
|
|
|
|
if(order.getState().equals("0")){ |
|
|
|
|
|
order.setState("1"); |
|
|
|
|
|
order.setPayTime(new Date()); |
|
|
|
|
|
popularizeOrderService.updateById(order); |
|
|
|
|
|
//修改当前报名人数 |
|
|
|
|
|
PopularizeActivity byId = popularizeActivityService.getById(order.getActivityOrderId()); |
|
|
|
|
|
byId.setNum(byId.getNum()+1); |
|
|
|
|
|
popularizeActivityService.updateById(byId); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取国籍 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getNationalityPageList(String title, PageBean pageBean){ |
|
|
|
|
|
Page<PopularizeCountry> page = new Page<>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
|
|
|
QueryWrapper<PopularizeCountry> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.like(StringUtils.isNotBlank(title),"title",title); |
|
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
|
IPage<PopularizeCountry> pageList = popularizeCountryService.page(page, queryWrapper); |
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取城市 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getCityPageList(String title, PageBean pageBean){ |
|
|
|
|
|
Page<PopularizeCity> page = new Page<>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
|
|
|
QueryWrapper<PopularizeCity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.like(StringUtils.isNotBlank(title),"title",title); |
|
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
|
IPage<PopularizeCity> pageList = popularizeCityService.page(page, queryWrapper); |
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取学院 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getSchoolPageList(String title, PageBean pageBean){ |
|
|
|
|
|
Page<PopularizeSchool> page = new Page<>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
|
|
|
QueryWrapper<PopularizeSchool> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.like(StringUtils.isNotBlank(title),"title",title); |
|
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
|
IPage<PopularizeSchool> pageList = popularizeSchoolService.page(page, queryWrapper); |
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取标签 |
|
|
|
|
|
@Override |
|
|
|
|
|
public Result<?> getLabelPageList(String title, PageBean pageBean){ |
|
|
|
|
|
Page<PopularizeSchoolSub> page = new Page<>(pageBean.getPageNo(), pageBean.getPageSize()); |
|
|
|
|
|
QueryWrapper<PopularizeSchoolSub> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.like(StringUtils.isNotBlank(title),"title",title); |
|
|
|
|
|
queryWrapper.orderByDesc("create_time"); |
|
|
|
|
|
IPage<PopularizeSchoolSub> pageList = popularizeSchoolSubService.page(page, queryWrapper); |
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |