记得上下班打卡 | git大法好,push需谨慎

Commit 4b54fe5d authored by 张国柄's avatar 张国柄

+API复用发放券;演出场次票种查询;

parent 3c60324c
......@@ -76,6 +76,15 @@ public interface IKylinPerformancesAdminService {
*/
List<PerformanceSimpleAllDao> getListDetailByStatus(String status, String title);
/**
* 根据(演出\场次\票种)ID 查询演出、场次、票种信息
*
* @param scope ID所属字段
* @param id ID值
* @return 1条记录(包括演出名称、场次名称?、票种名称?及对于ID)
*/
PerformanceSimpleAllDao getSimpleDetailByScopeAndId(String scope, String id);
/**
* 修改演出的巡演关联
......
......@@ -19,6 +19,7 @@ import com.liquidnet.service.candy.dto.admin.CandyMgtCouponInfoDto;
import com.liquidnet.service.candy.dto.admin.CandyMgtCouponListParam;
import com.liquidnet.service.candy.entity.CandyCouponRule;
import com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao;
import com.liquidnet.service.kylin.service.admin.IKylinPerformancesAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
......@@ -51,7 +52,7 @@ public class CandyMgtCouponAdminController extends BaseController {
@Autowired
private ICandyCouponRuleAdminService candyCouponRuleAdminService;
@Autowired
private KylinPerformancesAdminServiceImpl kylinPerformancesService;
private IKylinPerformancesAdminService kylinPerformancesAdminService;
@RequiresPermissions("candy:coupon:mgt:view")
@GetMapping()
......@@ -114,7 +115,7 @@ public class CandyMgtCouponAdminController extends BaseController {
case 1:// 演出
StringBuffer busiNameChildNodeStringBuffer = new StringBuffer();
if (Arrays.asList(91, 92).contains(couponRule.getUseScope())) {
List<PerformanceSimpleAllDao> performanceSimpleAllDaoList = kylinPerformancesService.getListDetailByStatus("(3,6)", couponRule.getBusiName());
List<PerformanceSimpleAllDao> performanceSimpleAllDaoList = kylinPerformancesAdminService.getListDetailByStatus("(3,6)", couponRule.getBusiName());
PerformanceSimpleAllDao performanceSimpleAllDao = null;
switch (couponRule.getUseScope()) {
case 91:
......@@ -143,32 +144,39 @@ public class CandyMgtCouponAdminController extends BaseController {
}
return prefix + "/detail" + couType;
}
//
// @Log(title = "我的券包:复用发放", businessType = BusinessType.DETAIL)
// @RequiresPermissions("candy:coupon:mgt:reuse")
// @GetMapping("reuse/{couType}/{mcouponId}")
// public String reuse(@PathVariable("couType") int couType,
// @PathVariable("mcouponId") String mcouponId, ModelMap mmap) {
// CandyMgtCouponListParam listParam = new CandyMgtCouponListParam();
// listParam.setMcouponId(mcouponId);
// List<CandyMgtCouponInfoDto> list = candyMgtCouponAdminService.listForMgtCouponInfoDto(listParam);
// if (!CollectionUtils.isEmpty(list)) {
// CandyMgtCouponInfoDto mgtCouponInfoDto = list.get(0);
// mmap.put("mgtCouponInfoDto", mgtCouponInfoDto);
//
// LambdaQueryWrapper<CandyCouponRule> queryWrapper = Wrappers.lambdaQuery(CandyCouponRule.class);
// queryWrapper.eq(CandyCouponRule::getCouponId, mgtCouponInfoDto.getCouponId());
// queryWrapper.eq(CandyCouponRule::getState, 1);
// queryWrapper.select(CandyCouponRule::getUseScope, CandyCouponRule::getBusiName, CandyCouponRule::getBusiId);
//
// List<CandyCouponRule> couponRuleList = candyCouponRuleAdminService.list(queryWrapper);
// if (!CollectionUtils.isEmpty(couponRuleList)) {
// CandyCouponRule couponRule = couponRuleList.get(0);
// mmap.put("couponRule", couponRule);
// }
// }
// return prefix + "/reuse" + couType;
// }
@Log(title = "我的券包:复用发放", businessType = BusinessType.DETAIL)
@RequiresPermissions("candy:coupon:mgt:reuse")
@GetMapping("reuse/{couType}/{mcouponId}")
public String reuse(@PathVariable("couType") int couType,
@PathVariable("mcouponId") String mcouponId, ModelMap mmap) {
CandyMgtCouponListParam listParam = new CandyMgtCouponListParam();
listParam.setMcouponId(mcouponId);
List<CandyMgtCouponInfoDto> list = candyMgtCouponAdminService.listForMgtCouponInfoDto(listParam);
if (!CollectionUtils.isEmpty(list)) {
CandyMgtCouponInfoDto mgtCouponInfoDto = list.get(0);
mmap.put("mgtCouponInfoDto", mgtCouponInfoDto);
LambdaQueryWrapper<CandyCouponRule> queryWrapper = Wrappers.lambdaQuery(CandyCouponRule.class);
queryWrapper.eq(CandyCouponRule::getCouponId, mgtCouponInfoDto.getCouponId());
queryWrapper.eq(CandyCouponRule::getState, 1);
queryWrapper.select(CandyCouponRule::getUseScope, CandyCouponRule::getBusiName, CandyCouponRule::getBusiId);
List<CandyCouponRule> couponRuleList = candyCouponRuleAdminService.list(queryWrapper);
if (!CollectionUtils.isEmpty(couponRuleList)) {
CandyCouponRule couponRule = couponRuleList.get(0);
mmap.put("couponRule", couponRule);
String scope = couponRule.getUseScope() == 90 ? "1" :
couponRule.getUseScope() == 91 ? "2" : couponRule.getUseScope() == 92 ? "3" : "";
if (StringUtils.isNotEmpty(scope)) {// 针对演出类别单独查询三级数据
PerformanceSimpleAllDao simpleAllDao = kylinPerformancesAdminService.getSimpleDetailByScopeAndId(scope, couponRule.getBusiId());
mmap.put("performanceSimpleAllDao", simpleAllDao);
}
}
}
return prefix + "/add" + couType;
}
@GetMapping("add/{couType}")
public String add(@PathVariable("couType") String couType, ModelMap mmap) {
......
......@@ -251,6 +251,20 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
return dto2List;
}
@Override
public PerformanceSimpleAllDao getSimpleDetailByScopeAndId(String scope, String id) {
switch (scope) {
case "1":
return performancesMapper.getPerformanceSimpleByPerformancesId(id);
case "2":
return performancesMapper.getPerformanceSimpleByTimesId(id);
case "3":
return performancesMapper.getPerformanceSimpleByTicketId(id);
default:
return null;
}
}
@Override
public boolean changeRoadShowId(String performancesId, String roadShowId) {
try {
......
......@@ -55,4 +55,8 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
List<OrderExportDao> exportOrderByPerformanceIdAll(String performancesId);
List<OrderExportDao> exportOrderByPerformanceIdPay(String performancesId);
PerformanceSimpleAllDao getPerformanceSimpleByPerformancesId(String performancesId);
PerformanceSimpleAllDao getPerformanceSimpleByTimesId(String timesId);
PerformanceSimpleAllDao getPerformanceSimpleByTicketId(String ticketId);
}
......@@ -587,4 +587,57 @@ WHERE performance_id = #{performancesId}
AND status IN (1, 3)
GROUP BY user_mobile;
</select>
<select id="getPerformanceSimpleByTicketId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao">
<!-- select kp.performances_id as performancesId,-->
<!-- kp.title,-->
<!-- ktt.ticket_times_id as timeId,-->
<!-- ktt.title as timeTitle,-->
<!-- kt.tickets_id as ticketId,-->
<!-- kt.title as ticketTitle-->
<!-- from kylin_performances kp-->
<!-- left join kylin_ticket_time_relation kttr on kttr.performance_id = kp.performances_id-->
<!-- left join kylin_ticket_times ktt on kttr.times_id = ktt.ticket_times_id-->
<!-- left join kylin_ticket_relations ktr on ktr.times_id = kttr.times_id-->
<!-- left join kylin_tickets kt on kt.tickets_id = ktr.ticket_id-->
<!-- <where>-->
<!-- <if test="scope != null and scope == '1'">-->
<!-- kp.performances_id=#{id}-->
<!-- </if>-->
<!-- <if test="scope != null and scope == '2'">-->
<!-- ktr.times_id=#{id}-->
<!-- </if>-->
<!-- <if test="scope != null and scope == '3'">-->
<!-- ktr.ticket_id=#{id}-->
<!-- </if>-->
<!-- </where>-->
<!-- limit 1-->
select kp.performances_id as performancesId,
kp.title,
ktt.ticket_times_id as timeId,
ktt.title as timeTitle,
kt.tickets_id as ticketId,
kt.title as ticketTitle
from kylin_performances kp
left join kylin_ticket_time_relation kttr on kttr.performance_id = kp.performances_id
left join kylin_ticket_times ktt on kttr.times_id = ktt.ticket_times_id
left join kylin_ticket_relations ktr on ktr.times_id = kttr.times_id
left join kylin_tickets kt on kt.tickets_id = ktr.ticket_id
where ktr.ticket_id = #{ticketId}
</select>
<select id="getPerformanceSimpleByTimesId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao">
select kp.performances_id as performancesId,
kp.title,
ktt.ticket_times_id as timeId,
ktt.title as timeTitle
from kylin_performances kp
left join kylin_ticket_time_relation kttr on kttr.performance_id = kp.performances_id
left join kylin_ticket_times ktt on kttr.times_id = ktt.ticket_times_id
where ktt.ticket_times_id = #{timesId}
</select>
<select id="getPerformanceSimpleByPerformancesId" resultType="com.liquidnet.service.kylin.dao.PerformanceSimpleAllDao">
select kp.performances_id as performancesId,
kp.title
from kylin_performances kp
where kp.performances_id = #{performancesId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment