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

Commit 89f785ed authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_member_voucher_refund_09151' into...

Merge remote-tracking branch 'origin/dev_member_voucher_refund_09151' into dev_member_voucher_refund_09151
parents 0c6395ac fe2be456
......@@ -13,6 +13,7 @@ import com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponAdminServic
import com.liquidnet.client.admin.zhengzai.candy.service.ICandyCouponRuleAdminService;
import com.liquidnet.client.admin.zhengzai.candy.service.ICandyMgtCouponAdminService;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinPerformancesAdminServiceImpl;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.candy.dto.admin.CandyCouponRuleBuildParam;
import com.liquidnet.service.candy.dto.admin.CandyMgtCouponBuildParam;
import com.liquidnet.service.candy.dto.admin.CandyMgtCouponInfoDto;
......@@ -71,23 +72,21 @@ public class CandyMgtCouponAdminController extends BaseController {
startPage();
List<CandyMgtCouponInfoDto> list = candyMgtCouponAdminService.listForMgtCouponInfoDto(listParam);
if (!CollectionUtils.isEmpty(list)) {
switch (listParam.getCouType()) {
case 3:
String[] couponIdArr = list.stream().map(CandyMgtCouponInfoDto::getCouponId).toArray(String[]::new);
if (Arrays.asList(3, 101).contains(listParam.getCouType())) {
String[] couponIdArr = list.stream().map(CandyMgtCouponInfoDto::getCouponId).toArray(String[]::new);
LambdaQueryWrapper<CandyCouponRule> queryWrapper = Wrappers.lambdaQuery(CandyCouponRule.class);
queryWrapper.in(CandyCouponRule::getCouponId, couponIdArr);
queryWrapper.eq(CandyCouponRule::getState, 1);
queryWrapper.select(CandyCouponRule::getCruleId, CandyCouponRule::getCouponId, CandyCouponRule::getComment);
List<CandyCouponRule> couponRuleList = candyCouponRuleAdminService.list(queryWrapper);
list.stream().forEach(r->{
couponRuleList.forEach(cr -> {
if (r.getCouponId().equals(cr.getCouponId())) {
r.setCouponRuleScopeName(cr.getBusiName());
}
});
LambdaQueryWrapper<CandyCouponRule> queryWrapper = Wrappers.lambdaQuery(CandyCouponRule.class);
queryWrapper.in(CandyCouponRule::getCouponId, couponIdArr);
queryWrapper.eq(CandyCouponRule::getState, 1);
queryWrapper.select(CandyCouponRule::getCruleId, CandyCouponRule::getCouponId, CandyCouponRule::getBusiName);
List<CandyCouponRule> couponRuleList = candyCouponRuleAdminService.list(queryWrapper);
list.stream().forEach(r->{
couponRuleList.forEach(cr -> {
if (r.getCouponId().equals(cr.getCouponId())) {
r.setCouponRuleScopeName(cr.getBusiName());
}
});
break;
});
}
}
return getDataTable(list);
......@@ -161,7 +160,7 @@ public class CandyMgtCouponAdminController extends BaseController {
@PostMapping("add")
@ResponseBody
public AjaxResult addSave(@RequestBody @Validated CandyMgtCouponBuildParam buildParam) {
logger.info("operator:{},buildParam:{}", ShiroUtils.getLoginName(), buildParam);
logger.info("operator:{},buildParam:{}", ShiroUtils.getLoginName(), JsonUtils.toJson(buildParam));
AjaxResult ajaxResult = this.buildValidProcessing(buildParam);
if (((int) ajaxResult.get(AjaxResult.CODE_TAG)) != 0) {
return ajaxResult;
......@@ -205,17 +204,20 @@ public class CandyMgtCouponAdminController extends BaseController {
if (null == discount || discount.compareTo(BigDecimal.ZERO) <= 0) {
return AjaxResult.warn("折扣配置无效");
}
if (buildParam.getBusiType() != 3) {
if (buildParam.getBusiType() != 2) {
return AjaxResult.warn("当前类别不支持折扣券");
}
buildParam.setValFace(null);
buildParam.setValOver(null);
buildParam.setValMinus(null);
break;
case 101:
case 101:// 优先券
if (null == buildParam.getOverlay()) {
return AjaxResult.warn("叠加限制配置无效");
}
if (buildParam.getBusiType() != 3) {
return AjaxResult.warn("当前类别不支持优先券");
}
buildParam.setDiscount(null);
buildParam.setValFace(null);
buildParam.setValOver(null);
......
......@@ -13,7 +13,7 @@
<ul>
<input type="text" name="couponId" hidden="hidden" th:value="${couponId}" readonly/>
<li>
状态:<select name="state" th:with="type=${@dict.getType('zhengzai_coupon_code_state')}">
状态:<select name="state" th:with="type=${@dict.getType('zhengzai_coupon_code_state')}" onchange="selectChange()" class="selectChange">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
......@@ -31,10 +31,10 @@
<a class="btn btn-warning multiple disabled" onclick="$.table.exportExcel()" shiro:hasPermission="candy:coupon:code:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-primary multiple disabled" onclick="invalidHandler()" shiro:hasPermission="candy:coupon:code:invalid">
<a class="btn btn-primary multiple disabled selectChangeShow" style="display: none" onclick="invalidHandler()" shiro:hasPermission="candy:coupon:code:invalid">
<i class="fa fa-edit"></i> 批量失效
</a>
<a class="btn btn-danger multiple disabled" onclick="recoverHandler()" shiro:hasPermission="candy:coupon:code:recover">
<a class="btn btn-danger multiple disabled selectChangeShow" style="display: none" onclick="recoverHandler()" shiro:hasPermission="candy:coupon:code:recover">
<i class="fa fa-remove"></i> 批量退回
</a>
</div>
......@@ -66,7 +66,7 @@
},
{
field: 'ccode',
title: '代金码'
title: '码'
},
{
field: 'redeemMobile',
......@@ -89,8 +89,10 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-primary btn-xs ' + invalidFlag + '" href="javascript:void(0)" onclick="invalidHandler(\'' + row.ccode + '\')"><i class="fa fa-edit"></i>失效</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + recoverFlag + '" href="javascript:void(0)" onclick="recoverHandler(\'' + row.ccode + '\')"><i class="fa fa-remove"></i>退回</a>');
if (row.state === 0) {
actions.push('<a class="btn btn-primary btn-xs ' + invalidFlag + '" href="javascript:void(0)" onclick="invalidHandler(\'' + row.ccode + '\')"><i class="fa fa-edit"></i>失效</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + recoverFlag + '" href="javascript:void(0)" onclick="recoverHandler(\'' + row.ccode + '\')"><i class="fa fa-remove"></i>退回</a>');
}
return actions.join('');
}
}]
......@@ -125,6 +127,16 @@
$.operate.batchProcessingForCouponCode(couponId, 2);
}
}
function selectChange() {
let val = $(".selectChange").val();
console.log(typeof val);
if (val === '0') {
$(".selectChangeShow").show();
} else {
$(".selectChangeShow").hide();
}
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -150,7 +150,7 @@
<input type="radio" value="0" class="typeOne" name="typeOne" checked><span>全场</span>
<input type="radio" value="1" class="typeOne" name="typeOne"><span>演出</span>
<input type="radio" value="2" class="typeOne" name="typeOne"><span>商品</span>
<input type="radio" value="3" class="typeOne" name="typeOne"><span>优先购</span>
<!-- <input type="radio" value="3" class="typeOne" name="typeOne"><span>优先购</span>-->
</div>
</div>
......
......@@ -153,7 +153,7 @@
<input type="radio" value="0" class="typeOne" name="typeOne" checked><span>全场</span>
<input type="radio" value="1" class="typeOne" name="typeOne"><span>演出</span>
<input type="radio" value="2" class="typeOne" name="typeOne"><span>商品</span>
<input type="radio" value="3" class="typeOne" name="typeOne"><span>优先购</span>
<!-- <input type="radio" value="3" class="typeOne" name="typeOne"><span>优先购</span>-->
</div>
</div>
......
......@@ -132,7 +132,7 @@
// if (row.state === 0) {
// actions.push('<a class="btn btn-danger btn-xs ' + cancelMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mcouponId + '\')"><i class="fa fa-remove"></i>取消</a>');
// }
if (row.bindType === 0) {
if (row.bindType === 0 && row.state === 1) {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="couponCodeList(\'' + row.couponId + '\')"><i class="fa fa-list-ul"></i>码列表</a> ');
}
return actions.join('');
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('兑换券')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="coupon-form">
<div class="select-list">
<ul>
<input type="hidden" name="couType" th:value="${couType}" />
<li>
<input type="text" name="keyword" placeholder="搜索"/>
</li>
<li>
类型:<select name="bindType" th:with="type=${@dict.getType('zhengzai_coupon_bind_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
适用范围:<select name="busiType" th:with="type=${@dict.getType('zhengzai_coupon_busi_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" th:onclick="$.operate.addTab([[${couType}]])" shiro:hasPermission="candy:coupon:mgt:add">
<i class="fa fa-plus"></i> 新增
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "candy/coupon/mgt";
var viewMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:detail')}]];
var cancelMgtCouponFlag = [[${@permission.hasPermi('candy:coupon:mgt:cancel')}]];
var couType = [[${couType}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add/{id}",
detailUrl: prefix + "/detail/" + couType + "/{id}",
removeUrl: prefix + "/cancel/{id}",
// updateUrl: prefix + "/edit/{id}",
// exportUrl: prefix + "/export",
sortName: "createdAt",
modalName: "优先券",
columns: [
{
checkbox: true
},
{
field: 'couponRuleScopeName',
title: '适用演出'
},
{
field: 'eventAmt',
title: '数量'
},
{
field: 'title',
title: '标题'
},
{
field: 'notice',
title: '描述'
},
{
field: 'operator',
title: '创建人'
},
{
field: 'createdAt',
title: '生成时间',
sortable: true,
formatter: function (value, row, index) {
return $.common.sprintf("<span>%s</span>", null != value ? value.substring(0, 19) : value);
}
},
{
field: 'expireAt',
title: '失效时间',
formatter: function (value, row, index) {
return $.common.sprintf("<span>%s</span>", value);
}
},
{
title: '操作',
// align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + viewMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.mcouponId + '\')"><i class="fa fa-search"></i>详情</a>');
// if (row.state === 0) {
// actions.push('<a class="btn btn-danger btn-xs ' + cancelMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mcouponId + '\')"><i class="fa fa-remove"></i>取消</a>');
// }
if (row.bindType === 0 && row.state === 1) {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="couponCodeList(\'' + row.couponId + '\')"><i class="fa fa-list-ul"></i>码列表</a> ');
}
return actions.join('');
}
}]
};
$.table.init(options);
});
/* 查看码列表 */
function couponCodeList(couponId) {
var url = 'candy/coupon/code?couponId=' + couponId;
$.modal.openTab("查看码列表", url);
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -132,7 +132,7 @@
// if (row.state === 0) {
// actions.push('<a class="btn btn-danger btn-xs ' + cancelMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mcouponId + '\')"><i class="fa fa-remove"></i>取消</a>');
// }
if (row.bindType === 0) {
if (row.bindType === 0 && row.state === 1) {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="couponCodeList(\'' + row.couponId + '\')"><i class="fa fa-list-ul"></i>码列表</a> ');
}
return actions.join('');
......
......@@ -113,7 +113,7 @@
// if (row.state === 0) {
// actions.push('<a class="btn btn-danger btn-xs ' + cancelMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mcouponId + '\')"><i class="fa fa-remove"></i>取消</a>');
// }
if (row.bindType === 0) {
if (row.bindType === 0 && row.state === 1) {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="couponCodeList(\'' + row.couponId + '\')"><i class="fa fa-list-ul"></i>码列表</a> ');
}
return actions.join('');
......
......@@ -132,7 +132,7 @@
// if (row.state === 0) {
// actions.push('<a class="btn btn-danger btn-xs ' + cancelMgtCouponFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mcouponId + '\')"><i class="fa fa-remove"></i>取消</a>');
// }
if (row.bindType === 0) {
if (row.bindType === 0 && row.state === 1) {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="couponCodeList(\'' + row.couponId + '\')"><i class="fa fa-list-ul"></i>码列表</a> ');
}
return actions.join('');
......
......@@ -57,10 +57,12 @@ public class AdamMemberServiceAdminImpl extends ServiceImpl<AdamMemberMapper, Ad
// adamMember.setLimitbAt(LocalDateTime.parse(parameter.getLimitbAt(), dateTimeFormatter));
// adamMember.setLimiteAt(LocalDateTime.parse(parameter.getLimitbAt(), dateTimeFormatter));
adamMember.setUpdatedAt(LocalDateTime.now());
AdamMemberVo vo = AdamMemberVo.getNew().copy(adamMember);
LambdaQueryWrapper<AdamMember> updateMemberWrapper = Wrappers.lambdaQuery(AdamMember.class).eq(AdamMember::getMemberId, parameter.getMemberId());
if (adamMemberMapper.update(adamMember, updateMemberWrapper) > 0) {
adamMember = adamMemberMapper.selectOne(updateMemberWrapper);
AdamMemberVo vo = AdamMemberVo.getNew().copy(adamMember);
redisUtil.set(AdamRedisConst.INFO_MEMBER_CATEGORY.concat(vo.getMemberId()), vo);
redisUtil.del(AdamRedisConst.INFO_MEMBER_SIMPLE);
return true;
......
package com.liquidnet.service.feign.kylin.api;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.feign.kylin.config.SecuringRequestInterceptor;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.HashMap;
import java.util.List;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: FeignKylinForChimeClient
* @Package com.liquidnet.service.feign.kylin.api
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/9/11 18:20
*/
@Component
@FeignClient(name = "liquidnet-service-kylin",
contextId = "FeignKylinForChimeClient", path = "",
url = "${liquidnet.service.kylin.url}",
fallback = FallbackFactory.Default.class,
configuration = SecuringRequestInterceptor.class)
public interface FeignKylinForChimeClient {
@GetMapping("myPerformance/performancesList")
ResponseDto<List<KylinPerformanceVo>> myPerformancesList();
@GetMapping("performance/localList")
ResponseDto<HashMap<String, Object>> localList(
@RequestParam(value = "cityName",defaultValue = "") String cityName,
@RequestParam(value = "days",defaultValue = "0") int days,
@RequestParam(value = "type",defaultValue = "0") int type,
@RequestParam(value = "isDiscount",defaultValue = "") Integer isDiscount,
@RequestParam(value = "isAdvance",defaultValue = "") Integer isAdvance,
@RequestParam(value = "isExclusive",defaultValue = "") Integer isExclusive,
// 排序
@RequestParam(value = "orderBy",defaultValue = "") String orderBy,
@RequestParam(value = "sort",defaultValue = "") String sort
);
// @GetMapping(value = "/performance/list")
// ResponseDto<List<KylinPerformanceVo>> performanceList(@RequestParam("performancesIds") String... performancesIds);
@GetMapping("myPerformance/getDetail")
ResponseDto<KylinPerformanceVo> getDetail(
@RequestParam("performancesId") String performancesId
);
}
package com.liquidnet.service.feign.kylin.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 解决feign调用传递header问题
* @class: SecuringRequestInterceptor
* @Package com.liquidnet.service.chime.config
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/9/11 19:22
*/
@Component
public class SecuringRequestInterceptor implements RequestInterceptor {
@Override
public void apply(RequestTemplate requestTemplate) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
Enumeration<String> headerNames = request.getHeaderNames();
if (headerNames != null) {
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
String values = request.getHeader(name);
requestTemplate.header(name, values);
}
}
}
}
\ No newline at end of file
package com.liquidnet.service.kylin.controller;
import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import com.liquidnet.service.kylin.service.impl.KylinPerformancesServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -36,4 +37,26 @@ public class KylinMyPerformancesController {
List<KylinPerformanceVo> result = kylinPerformancesService.myPerformancesList();
return ResponseDto.success(result);
}
@GetMapping("getDetail")
@ApiOperation("演出详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "path", dataType = "String", name = "performancesId", value = "演出id", required = true)
})
public ResponseDto<KylinPerformanceVo> getDetail(
@RequestParam("performancesId") String performancesId
) {
try {
KylinPerformanceVo result = kylinPerformancesService.detail(performancesId, 0, 0, "0");
if (result != null) {
return ResponseDto.success(result);
} else {
return ResponseDto.failure(ErrorMapping.get("20700"));
}
} catch (Exception e) {
log.error("演出详情Error", e);
return ResponseDto.failure(ErrorMapping.get("20700"));
}
}
}
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