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

Commit 622c4dc3 authored by 刘喆's avatar 刘喆

Merge branch 'pre' into 'master'

Pre

See merge request !104
parents 5f0048b0 ce62934b
...@@ -306,18 +306,16 @@ ...@@ -306,18 +306,16 @@
// type:'get', // type:'get',
// url:phpMallUrl + '/admin/goodListForQuick', // url:phpMallUrl + '/admin/goodListForQuick',
// success:function(e){ // success:function(e){
// console.log(e)
// } // }
// }); // });
}; };
function selectOne(id,name) { function selectOne(id,name) {
console.log(id, showId, 'showId')
$("#searchIpt").val(name); $("#searchIpt").val(name);
showId = id; showId = id;
if (typeOne == 2) { if (typeOne == 2) {
return return
} }
let str = `<option value="0" label="">所有</option>`; let str = `<option value="" label="">所有</option>`;
let obj = {}; let obj = {};
let filterData = []; let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
...@@ -340,7 +338,6 @@ ...@@ -340,7 +338,6 @@
if (typeOne == 2) { if (typeOne == 2) {
getMallList() getMallList()
} else { } else {
console.log('search')
search() search()
} }
$('#dataList').show() $('#dataList').show()
...@@ -356,16 +353,14 @@ ...@@ -356,16 +353,14 @@
if (typeOne == 2) { if (typeOne == 2) {
getMallList() getMallList()
} else { } else {
console.log('search')
search() search()
} }
}); });
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
console.log(selectTwoId,'kankna')
selectTwoName = $('#selectTwo').find('option:selected').attr('label'); selectTwoName = $('#selectTwo').find('option:selected').attr('label');
let str = `<option value="0" label="" >所有</option>`; let str = `<option value="" label="" >所有</option>`;
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.timeId == selectTwoId) { if (item.timeId == selectTwoId) {
str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>` str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>`
...@@ -385,7 +380,6 @@ ...@@ -385,7 +380,6 @@
$("#searchIpt").attr('placeholder', '全部'); $("#searchIpt").attr('placeholder', '全部');
} }
if (typeOne != 0) { if (typeOne != 0) {
console.log('???')
showId = ''; // 选中演出id showId = ''; // 选中演出id
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
...@@ -520,7 +514,6 @@ ...@@ -520,7 +514,6 @@
} }
busiName = $("#searchIpt").val(); busiName = $("#searchIpt").val();
} }
console.log(showId,busiId, 'showId')
let data = { let data = {
"bindType": Number(typeTwo), // 兑换券/发放 "bindType": Number(typeTwo), // 兑换券/发放
"busiType": Number(typeOne), // 业务类别 "busiType": Number(typeOne), // 业务类别
...@@ -557,7 +550,6 @@ ...@@ -557,7 +550,6 @@
if (sendType != 2) { if (sendType != 2) {
delete data.eventLimit; delete data.eventLimit;
} }
console.log(data,'data')
promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{ promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{
layer.msg('' + res); layer.msg('' + res);
if (res.code != undefined && res.code != web_status.SUCCESS) { if (res.code != undefined && res.code != web_status.SUCCESS) {
......
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
if (typeOne == 2) { if (typeOne == 2) {
return return
} }
let str = `<option value="0" label="">所有</option>`; let str = `<option value="" label="">所有</option>`;
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.performancesId == id) { if (item.performancesId == id) {
str+= `<option value='${item.timeId}' label='${item.timeTitle}'>${item.timeTitle}</option>` str+= `<option value='${item.timeId}' label='${item.timeTitle}'>${item.timeTitle}</option>`
...@@ -321,7 +321,6 @@ ...@@ -321,7 +321,6 @@
if (typeOne == 2) { if (typeOne == 2) {
getMallList() getMallList()
} else { } else {
console.log('search')
search() search()
} }
$('#dataList').show() $('#dataList').show()
...@@ -338,9 +337,8 @@ ...@@ -338,9 +337,8 @@
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
console.log(selectTwoId,'kankna')
selectTwoName = $('#selectTwo').find('option:selected').attr('label'); selectTwoName = $('#selectTwo').find('option:selected').attr('label');
let str = `<option value="0" label="" >所有</option>`; let str = `<option value="" label="" >所有</option>`;
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.timeId == selectTwoId) { if (item.timeId == selectTwoId) {
str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>` str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>`
...@@ -459,7 +457,6 @@ ...@@ -459,7 +457,6 @@
if (sendType != 2) { if (sendType != 2) {
delete data.eventLimit; delete data.eventLimit;
} }
console.log(data,'data')
promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{ promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{
layer.msg('' + res); layer.msg('' + res);
if (res.code != undefined && res.code != web_status.SUCCESS) { if (res.code != undefined && res.code != web_status.SUCCESS) {
......
...@@ -308,7 +308,6 @@ ...@@ -308,7 +308,6 @@
// type:'get', // type:'get',
// url:phpMallUrl + '/admin/goodListForQuick', // url:phpMallUrl + '/admin/goodListForQuick',
// success:function(e){ // success:function(e){
// console.log(e)
// } // }
// }); // });
}; };
...@@ -318,7 +317,7 @@ ...@@ -318,7 +317,7 @@
if (typeOne == 2) { if (typeOne == 2) {
return return
} }
let str = `<option value="0" label="">所有</option>`; let str = `<option value="" label="">所有</option>`;
let obj = {}; let obj = {};
let filterData = []; let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
...@@ -341,7 +340,6 @@ ...@@ -341,7 +340,6 @@
if (typeOne == 2) { if (typeOne == 2) {
getMallList() getMallList()
} else { } else {
console.log('search')
search() search()
} }
$('#dataList').show() $('#dataList').show()
...@@ -357,16 +355,14 @@ ...@@ -357,16 +355,14 @@
if (typeOne == 2) { if (typeOne == 2) {
getMallList() getMallList()
} else { } else {
console.log('search')
search() search()
} }
}); });
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
console.log(selectTwoId,'kankna')
selectTwoName = $('#selectTwo').find('option:selected').attr('label'); selectTwoName = $('#selectTwo').find('option:selected').attr('label');
let str = `<option value="0" label="" >所有</option>`; let str = `<option value="" label="" >所有</option>`;
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.timeId == selectTwoId) { if (item.timeId == selectTwoId) {
str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>` str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>`
......
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
function selectOne(id,name) { function selectOne(id,name) {
$("#searchIpt").val(name); $("#searchIpt").val(name);
showId = id; showId = id;
let str = `<option value="0" label="">所有</option>`; let str = `<option value="" label="">所有</option>`;
let obj = {}; let obj = {};
let filterData = []; let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
$('#selectThree').empty().append('<option value="0" label="">所有</option>'); $('#selectThree').empty().append('<option value="" label="">所有</option>');
}; };
$("#searchIpt").focus(function(){ $("#searchIpt").focus(function(){
search() search()
...@@ -274,9 +274,8 @@ ...@@ -274,9 +274,8 @@
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
console.log(selectTwoId,'kankna')
selectTwoName = $('#selectTwo').find('option:selected').attr('label'); selectTwoName = $('#selectTwo').find('option:selected').attr('label');
let str = `<option value="0" label="" >所有</option>`; let str = `<option value="" label="" >所有</option>`;
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.timeId == selectTwoId) { if (item.timeId == selectTwoId) {
str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>` str+= `<option value='${item.ticketId}' label='${item.ticketTitle}'>${item.ticketTitle}</option>`
......
...@@ -254,7 +254,6 @@ ...@@ -254,7 +254,6 @@
function selectOne(id,name) { function selectOne(id,name) {
$("#searchIpt").val(name); $("#searchIpt").val(name);
showId = id; showId = id;
console.log(showId, 'showId')
}; };
$("input[name=typeTwo]").change(function(e){ $("input[name=typeTwo]").change(function(e){
typeTwo = e.target.value; typeTwo = e.target.value;
...@@ -320,7 +319,6 @@ ...@@ -320,7 +319,6 @@
busiName = $('#searchIpt').val(); busiName = $('#searchIpt').val();
busiId = showId; busiId = showId;
} }
console.log(showId,busiId, 'showId')
let data = { let data = {
"bindType": Number(typeTwo), // 兑换券/发放 "bindType": Number(typeTwo), // 兑换券/发放
"busiType": 2, // 业务类别 "busiType": 2, // 业务类别
......
...@@ -406,9 +406,23 @@ public class KylinRefundsStatusServiceImpl { ...@@ -406,9 +406,23 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setExecutorName(authName); kylinOrderRefunds.setExecutorName(authName);
kylinOrderRefunds.setExecutorAt(LocalDateTime.now()); kylinOrderRefunds.setExecutorAt(LocalDateTime.now());
kylinOrderRefunds.setRefuse(refundApplyParam.getRefuse()); kylinOrderRefunds.setRefuse(refundApplyParam.getRefuse());
kylinOrderRefunds.setUpdatedAt(LocalDateTime.now());
for (KylinOrderRefunds refund : refundList) { for (KylinOrderRefunds refund : refundList) {
// 更新退款表
kylinOrderRefunds.setUpdatedAt(LocalDateTime.now());
kylinOrderRefundsMapper.update(
kylinOrderRefunds,
new UpdateWrapper<KylinOrderRefunds>().eq("order_refunds_id", refund.getOrderRefundsId())
);
// 修改缓存
KylinOrderRefundsVo kylinOrderRefundsVo = new KylinOrderRefundsVo();
BeanUtils.copyProperties(kylinOrderRefunds, kylinOrderRefundsVo);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(kylinOrderRefundsVo));
UpdateResult updateResult = mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderRefundsId").is(refund.getOrderRefundsId())).getQueryObject(),
object
);
KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectOne( KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>() new QueryWrapper<KylinOrderTickets>()
.eq("order_tickets_id", refund.getOrderTicketsId()) .eq("order_tickets_id", refund.getOrderTicketsId())
...@@ -426,7 +440,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -426,7 +440,7 @@ public class KylinRefundsStatusServiceImpl {
params.add("reason", "按需退款"); params.add("reason", "按需退款");
MultiValueMap<String, String> headers = new LinkedMultiValueMap(); MultiValueMap<String, String> headers = new LinkedMultiValueMap();
// headers.add("Content-Type", "application/json;charset=UTF-8"); // headers.add("Content-Type", "application/json;charset=UTF-8");
headers.add("Accept", "application/json;charset=UTF-8"); headers.add("Accept", "application/json;charset=UTF-8");
log.info("退款参数" + JsonUtils.toJson(params)); log.info("退款参数" + JsonUtils.toJson(params));
// 请求pay // 请求pay
...@@ -443,23 +457,23 @@ public class KylinRefundsStatusServiceImpl { ...@@ -443,23 +457,23 @@ public class KylinRefundsStatusServiceImpl {
KylinOrderRefunds kylinOrderRefundsFail = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefundsFail = new KylinOrderRefunds();
kylinOrderRefundsFail.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR); kylinOrderRefundsFail.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR);
kylinOrderRefundsFail.setRefundError(message); kylinOrderRefundsFail.setRefundError(message);
kylinOrderRefunds.setUpdatedAt(LocalDateTime.now()); kylinOrderRefundsFail.setUpdatedAt(LocalDateTime.now());
kylinOrderRefundsMapper.update( kylinOrderRefundsMapper.update(
kylinOrderRefundsFail, kylinOrderRefundsFail,
new UpdateWrapper<KylinOrderRefunds>().eq("order_refunds_id", refund.getOrderRefundsId()) new UpdateWrapper<KylinOrderRefunds>().eq("order_refunds_id", refund.getOrderRefundsId())
); );
// 修改缓存 // 修改缓存
KylinOrderRefundsVo kylinOrderRefundsVo = new KylinOrderRefundsVo(); KylinOrderRefundsVo kylinOrderRefundsVoFail = new KylinOrderRefundsVo();
BeanUtils.copyProperties(kylinOrderRefundsFail, kylinOrderRefundsVo); BeanUtils.copyProperties(kylinOrderRefundsFail, kylinOrderRefundsVoFail);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(kylinOrderRefundsVo)); BasicDBObject objectFail = new BasicDBObject("$set", mongoConverter.convertToMongoType(kylinOrderRefundsVoFail));
UpdateResult updateResult = mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne( UpdateResult updateFailResult = mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderRefundsId").is(refund.getOrderRefundsId())).getQueryObject(), Query.query(Criteria.where("orderRefundsId").is(refund.getOrderRefundsId())).getQueryObject(),
object objectFail
); );
List<String> strings = Arrays.asList(refund.getOrderRefundsId()); // List<String> strings = Arrays.asList(refund.getOrderRefundsId());
List<String> strings1 = Arrays.asList(refund.getOrderTicketsId()); // List<String> strings1 = Arrays.asList(refund.getOrderTicketsId());
dataUtils.delOrderRefundVo(strings); // dataUtils.delOrderRefundVo(strings);
dataUtils.delOrderRefundVoByOrderId(strings1); // dataUtils.delOrderRefundVoByOrderId(strings1);
continue; continue;
}else{ }else{
...@@ -474,19 +488,6 @@ public class KylinRefundsStatusServiceImpl { ...@@ -474,19 +488,6 @@ public class KylinRefundsStatusServiceImpl {
log.info("退款请求pay失败e" + e.getMessage()); log.info("退款请求pay失败e" + e.getMessage());
continue; continue;
} }
// 更新退款表
kylinOrderRefundsMapper.update(
kylinOrderRefunds,
new UpdateWrapper<KylinOrderRefunds>().eq("order_refunds_id", refund.getOrderRefundsId())
);
// 修改缓存
KylinOrderRefundsVo kylinOrderRefundsVo = new KylinOrderRefundsVo();
BeanUtils.copyProperties(kylinOrderRefunds, kylinOrderRefundsVo);
BasicDBObject object = new BasicDBObject("$set", mongoConverter.convertToMongoType(kylinOrderRefundsVo));
UpdateResult updateResult = mongoTemplate.getCollection(KylinOrderRefundsVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("orderRefundsId").is(refund.getOrderRefundsId())).getQueryObject(),
object
);
} }
List<String> orderRefundIds = refundList.stream().map( List<String> orderRefundIds = refundList.stream().map(
......
...@@ -127,6 +127,7 @@ global-auth: ...@@ -127,6 +127,7 @@ global-auth:
- ${liquidnet.info.context}/send - ${liquidnet.info.context}/send
- ${liquidnet.info.context}/member/info - ${liquidnet.info.context}/member/info
- ${liquidnet.info.context}/member/info/rights - ${liquidnet.info.context}/member/info/rights
- ${liquidnet.info.context}/member/onsale
- ${liquidnet.info.context}/member/check/depth - ${liquidnet.info.context}/member/check/depth
- ${liquidnet.info.context}/member/order/callback - ${liquidnet.info.context}/member/order/callback
- ${liquidnet.info.context}/enters/query/depth - ${liquidnet.info.context}/enters/query/depth
......
...@@ -80,6 +80,18 @@ public class AdamMemberController { ...@@ -80,6 +80,18 @@ public class AdamMemberController {
return ResponseDto.success(adamRdmService.getMemberRightsDetailVoByRightsId(memberId, mrightsId)); return ResponseDto.success(adamRdmService.getMemberRightsDetailVoByRightsId(memberId, mrightsId));
} }
@ApiOperationSupport(order = 1)
@ApiOperation(value = "会员开售状态")
@GetMapping("onsale")
public ResponseDto<Integer> onsale() {
AdamMemberSimpleVo memberSimpleVo = adamRdmService.getMemberSimpleVo();
AdamMemberVo memberVo = null;
if (null != memberSimpleVo && null != (memberVo = adamRdmService.getMemberVoByMemberId(memberSimpleVo.getMemberId()))) {
return ResponseDto.success(memberVo.getOnsale());
}
return ResponseDto.success(1);
}
/* ------------------------------------------------------------|@API:RSC */ /* ------------------------------------------------------------|@API:RSC */
@ApiOperationSupport(order = 99) @ApiOperationSupport(order = 99)
......
...@@ -209,6 +209,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -209,6 +209,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (isOldMember) { if (isOldMember) {
} else { } else {
if (memberType == 1) {
advanceMap = orderUtils.useCoupon(payOrderParam.getAdvanceCode(), "购买 " + performanceData.getTitle(), BigDecimal.ZERO, payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId()); advanceMap = orderUtils.useCoupon(payOrderParam.getAdvanceCode(), "购买 " + performanceData.getTitle(), BigDecimal.ZERO, payOrderParam.getPerformanceId(), payOrderParam.getTimeId(), payOrderParam.getTicketId());
Integer typeVoucher = (Integer) advanceMap.get("type"); Integer typeVoucher = (Integer) advanceMap.get("type");
if (typeVoucher.equals(-1)) { if (typeVoucher.equals(-1)) {
...@@ -216,6 +217,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -216,6 +217,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
} }
} }
}
if (isMember || advanceMap != null) { if (isMember || advanceMap != null) {
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == -1) { if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == -1) {
...@@ -1106,11 +1108,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -1106,11 +1108,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
long orderTicketEntitiesKey; long orderTicketEntitiesKey;
if (item.getOrderTicketEntitiesId().length() > 13) { if (item.getOrderTicketEntitiesId().length() > 13) {
if(isMember==1){ if (isMember == 1) {
orderTicketEntitiesKey = Long.valueOf(IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("010")); orderTicketEntitiesKey = Long.valueOf(IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("010"));
obj3.setExt("登登登VIP"); obj3.setExt("登登登VIP");
obj3.setTicketItemId(Long.valueOf(ticketIdKey+"".concat("010"))); obj3.setTicketItemId(Long.valueOf(ticketIdKey + "".concat("010")));
}else{ } else {
orderTicketEntitiesKey = Long.valueOf(IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("020")); orderTicketEntitiesKey = Long.valueOf(IDGenerator.getDamaiCode(item.getOrderTicketEntitiesId()).toString().concat("020"));
obj3.setExt(""); obj3.setExt("");
obj3.setTicketItemId(ticketIdKey); obj3.setTicketItemId(ticketIdKey);
...@@ -1120,7 +1122,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -1120,7 +1122,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
obj3.setPerformId(ticketTimesKey);//场次id obj3.setPerformId(ticketTimesKey);//场次id
obj3.setVoucherId(orderTicketEntitiesKey);//票单号 入场人id obj3.setVoucherId(orderTicketEntitiesKey);//票单号 入场人id
obj3.setQrCode("http://m.zhengzai.tv?c="+IDGenerator.ticketQrCode(item.getOrderTicketEntitiesId())); obj3.setQrCode("http://m.zhengzai.tv?c=" + IDGenerator.ticketQrCode(item.getOrderTicketEntitiesId()));
obj3.setOrderId(orderIdKey);//订单id orderId obj3.setOrderId(orderIdKey);//订单id orderId
obj3.setMediumType(orderData.getGetTicketType().equals("express") ? 1L : 2L);//票类型 快递 电子 obj3.setMediumType(orderData.getGetTicketType().equals("express") ? 1L : 2L);//票类型 快递 电子
obj3.setSupplierSecret(taobaoTicketUtils.getSupplierSecret()); obj3.setSupplierSecret(taobaoTicketUtils.getSupplierSecret());
......
...@@ -8,6 +8,7 @@ import com.liquidnet.service.base.ResponseDto; ...@@ -8,6 +8,7 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.candy.constant.CandyRedisConst; import com.liquidnet.service.candy.constant.CandyRedisConst;
import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto; import com.liquidnet.service.candy.dto.CandyCommonCouponBasicDto;
import com.liquidnet.service.candy.dto.CandyCouponCodeDto; import com.liquidnet.service.candy.dto.CandyCouponCodeDto;
import com.liquidnet.service.candy.dto.CandyUserCouponBasicDto;
import com.liquidnet.service.candy.entity.CandyCommonCoupon; import com.liquidnet.service.candy.entity.CandyCommonCoupon;
import com.liquidnet.service.candy.entity.CandyCoupon; import com.liquidnet.service.candy.entity.CandyCoupon;
import com.liquidnet.service.candy.entity.CandyCouponCode; import com.liquidnet.service.candy.entity.CandyCouponCode;
...@@ -30,6 +31,7 @@ import java.util.List; ...@@ -30,6 +31,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream;
/** /**
* <p> * <p>
...@@ -59,6 +61,8 @@ public class CandyCouponDueTaskController { ...@@ -59,6 +61,8 @@ public class CandyCouponDueTaskController {
@Autowired @Autowired
private PlatformCandyUserCouponService platformCandyUserCouponService; private PlatformCandyUserCouponService platformCandyUserCouponService;
private static final String OPERATOR_CHECK = "CHECK";
/** /**
* <p> * <p>
* 兑换类 * 兑换类
...@@ -80,7 +84,7 @@ public class CandyCouponDueTaskController { ...@@ -80,7 +84,7 @@ public class CandyCouponDueTaskController {
AtomicInteger pl = new AtomicInteger(); AtomicInteger pl = new AtomicInteger();
int remainCount = totalCount; int remainCount = totalCount;
int num = 0, pSize = 1000; int num = 0, pSize = 1000;
log.info("券到期检查处理:兑换码[到期总记录数:{}] >>> BEGIN BEGIN BEGIN", totalCount); log.info("券到期检查处理:兑换码[到期总记录数:{}] >>> BEGIN BEGIN BEGIN", totalCount);
ArrayList<CandyCouponCode> updateCouponCodeList = ObjectUtil.getCandyCouponCodeArrayList(); ArrayList<CandyCouponCode> updateCouponCodeList = ObjectUtil.getCandyCouponCodeArrayList();
couponCodeQueryWrapper.select(CandyCouponCode::getMid, CandyCouponCode::getCcode); couponCodeQueryWrapper.select(CandyCouponCode::getMid, CandyCouponCode::getCcode);
...@@ -89,7 +93,7 @@ public class CandyCouponDueTaskController { ...@@ -89,7 +93,7 @@ public class CandyCouponDueTaskController {
updateCouponCodeList.clear(); updateCouponCodeList.clear();
LambdaQueryWrapper<CandyCouponCode> couponCodeLambdaQueryWrapper = couponCodeQueryWrapper.clone(); LambdaQueryWrapper<CandyCouponCode> couponCodeLambdaQueryWrapper = couponCodeQueryWrapper.clone();
String lastLimitSql = "LIMIT " + (num * pSize) + "," + pSize; String lastLimitSql = "LIMIT " + 0 + "," + pSize;
couponCodeLambdaQueryWrapper.last(lastLimitSql); couponCodeLambdaQueryWrapper.last(lastLimitSql);
List<CandyCouponCode> couponCodeList = platformCandyCouponCodeService.list(couponCodeLambdaQueryWrapper); List<CandyCouponCode> couponCodeList = platformCandyCouponCodeService.list(couponCodeLambdaQueryWrapper);
...@@ -98,12 +102,13 @@ public class CandyCouponDueTaskController { ...@@ -98,12 +102,13 @@ public class CandyCouponDueTaskController {
CandyCouponCode couponCode = couponCodeList.get(i); CandyCouponCode couponCode = couponCodeList.get(i);
couponCode.setState(3); couponCode.setState(3);
couponCode.setOperator(OPERATOR_CHECK);
couponCode.setUpdatedAt(now); couponCode.setUpdatedAt(now);
updateCouponCodeList.add(couponCode); updateCouponCodeList.add(couponCode);
} }
if (!CollectionUtils.isEmpty(couponCodeList)) { if (!CollectionUtils.isEmpty(updateCouponCodeList)) {
if (platformCandyCouponCodeService.updateBatchById(updateCouponCodeList, updateCouponCodeList.size())) { if (platformCandyCouponCodeService.updateBatchById(updateCouponCodeList, updateCouponCodeList.size())) {
updateCouponCodeList.forEach(r -> { updateCouponCodeList.forEach(r -> {
String ccKey = CandyRedisConst.BASIC_COUPON_CODE.concat(r.getCcode()); String ccKey = CandyRedisConst.BASIC_COUPON_CODE.concat(r.getCcode());
...@@ -123,9 +128,9 @@ public class CandyCouponDueTaskController { ...@@ -123,9 +128,9 @@ public class CandyCouponDueTaskController {
num++; num++;
remainCount -= pSize; remainCount -= pSize;
log.info("券到期检查处理中:兑换码[到期总记录数:{},单次处理:{},剩余处理数:{}]", totalCount, lastLimitSql, remainCount); log.info("券到期检查处理中:兑换码[到期总记录数:{},单次处理:{},剩余处理数:{}]", totalCount, lastLimitSql, remainCount);
} }
log.info("券到期检查处理:兑换码[到期总记录数:{},处理总数:{}] >>> END END END", totalCount, pl.get()); log.info("券到期检查处理:兑换码[到期总记录数:{},处理总数:{}] >>> END END END", totalCount, pl.get());
return ResponseDto.success(); return ResponseDto.success();
} }
...@@ -167,7 +172,7 @@ public class CandyCouponDueTaskController { ...@@ -167,7 +172,7 @@ public class CandyCouponDueTaskController {
couponQueryWrapper.orderByAsc(CandyCoupon::getMid); couponQueryWrapper.orderByAsc(CandyCoupon::getMid);
while (remainCount > 0) { while (remainCount > 0) {
LambdaQueryWrapper<CandyCoupon> couponLambdaQueryWrapper = couponQueryWrapper.clone(); LambdaQueryWrapper<CandyCoupon> couponLambdaQueryWrapper = couponQueryWrapper.clone();
String lastLimitSql = "LIMIT " + (num * pSize) + "," + pSize; String lastLimitSql = "LIMIT " + 0 + "," + pSize;
couponLambdaQueryWrapper.last(lastLimitSql); couponLambdaQueryWrapper.last(lastLimitSql);
List<CandyCoupon> couponList = platformCandyCouponService.list(couponLambdaQueryWrapper); List<CandyCoupon> couponList = platformCandyCouponService.list(couponLambdaQueryWrapper);
...@@ -178,7 +183,7 @@ public class CandyCouponDueTaskController { ...@@ -178,7 +183,7 @@ public class CandyCouponDueTaskController {
List<CandyCommonCoupon> inCommonCouponList = commonCouponIdToListMap.get(coupon.getCouponId()); List<CandyCommonCoupon> inCommonCouponList = commonCouponIdToListMap.get(coupon.getCouponId());
inCommonCouponList.forEach(r -> { inCommonCouponList.forEach(r -> {
r.setState(3); r.setState(3);
r.setOperator("system"); r.setOperator(OPERATOR_CHECK);
r.setUpdatedAt(now); r.setUpdatedAt(now);
updateCommonCouponList.add(r); updateCommonCouponList.add(r);
...@@ -238,8 +243,62 @@ public class CandyCouponDueTaskController { ...@@ -238,8 +243,62 @@ public class CandyCouponDueTaskController {
int num = 0, pSize = 1000; int num = 0, pSize = 1000;
log.info("券到期检查处理:私有券[到期总记录数:{}] >>> BEGIN BEGIN BEGIN", totalCount); log.info("券到期检查处理:私有券[到期总记录数:{}] >>> BEGIN BEGIN BEGIN", totalCount);
ArrayList<CandyUserCoupon> candyUserCouponArrayList = ObjectUtil.getCandyUserCouponArrayList(); ArrayList<CandyUserCoupon> updateUserCouponList = ObjectUtil.getCandyUserCouponArrayList();
userCouponQueryWrapper.select(CandyUserCoupon::getMid, CandyUserCoupon::getUcouponId);
userCouponQueryWrapper.orderByAsc(CandyUserCoupon::getMid);
while (remainCount > 0) {
updateUserCouponList.clear();
LambdaQueryWrapper<CandyUserCoupon> userCouponLambdaQueryWrapper = userCouponQueryWrapper.clone();
String lastLimitSql = "LIMIT " + 0 + "," + pSize;
userCouponLambdaQueryWrapper.last(lastLimitSql);
List<CandyUserCoupon> userCouponList = platformCandyUserCouponService.list(userCouponLambdaQueryWrapper);
int listSize = CollectionUtils.isEmpty(userCouponList) ? -1 : userCouponList.size();
for (int i = 0; i < listSize; i++) {
CandyUserCoupon userCoupon = userCouponList.get(i);
userCoupon.setState(3);
userCoupon.setOperator(OPERATOR_CHECK);
userCoupon.setUpdatedAt(now);
updateUserCouponList.add(userCoupon);
}
if (!CollectionUtils.isEmpty(updateUserCouponList)) {
if (platformCandyUserCouponService.updateBatchById(updateUserCouponList, updateUserCouponList.size())) {
// 需要更新的用户券记录按UID分组处理
Map<String, List<CandyUserCoupon>> userCouponListByUidMap = updateUserCouponList.stream().collect(Collectors.groupingBy(CandyUserCoupon::getUid));
userCouponListByUidMap.forEach((uid, updateUserCouponListByUid) -> {
String uckey = CandyRedisConst.BASIC_USER_COUPON.concat(uid);
List<CandyUserCouponBasicDto> vos = (List<CandyUserCouponBasicDto>) redisUtil.get(uckey);
if (!CollectionUtils.isEmpty(vos)) {
updateUserCouponListByUid.forEach(r -> {
int idx = IntStream.range(0, vos.size())
.filter(i -> vos.get(i).getUcouponId().equals(r.getUcouponId()))
.findFirst().orElse(-1);
if (idx != -1) {
CandyUserCouponBasicDto dto = vos.get(idx);
dto.setState(3);
vos.set(idx, dto);
}
pl.getAndIncrement();
});
redisUtil.set(uckey, vos);
}
});
} else {
throw new LiquidnetServiceException("-1", String.format("券到期处理失败[updateUserCouponList.size=%s]", updateUserCouponList.size()));
}
}
num++;
remainCount -= pSize;
log.info("券到期检查处理中:私有券[到期总记录数:{},单次处理:{},剩余处理数:{}]", totalCount, lastLimitSql, remainCount);
}
log.info("券到期检查处理:私有券[到期总记录数:{},处理总数:{}] >>> END END END", totalCount, pl.get());
return ResponseDto.success(); return ResponseDto.success();
} }
} }
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