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

Commit e9e3c380 authored by zhengfuxin's avatar zhengfuxin

Merge branch 'master' into dev-smile

# Conflicts:
#	liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
parents 53596a4b 447ae015
...@@ -48,5 +48,5 @@ public interface ICandyCouponService { ...@@ -48,5 +48,5 @@ public interface ICandyCouponService {
ResponseDto<CandyCouponVo> receiveCouponDetails(String ccode); ResponseDto<CandyCouponVo> receiveCouponDetails(String ccode);
ResponseDto<List<CandyCouponVo>> couponListById(String uCouponIds); ResponseDto<List<CandyCouponVo>> couponListById(String uCouponIds,String uid);
} }
...@@ -17,6 +17,10 @@ public class CandyUseResultVo implements Serializable, Cloneable { ...@@ -17,6 +17,10 @@ public class CandyUseResultVo implements Serializable, Cloneable {
private BigDecimal value; private BigDecimal value;
@ApiModelProperty(value = "券类型[-1-不可用 | 1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]",example = "1") @ApiModelProperty(value = "券类型[-1-不可用 | 1-代金券|2-满减券|3-兑换券|4-折扣券|101-优先券]",example = "1")
private Integer couType; private Integer couType;
@ApiModelProperty(value = "目标数组")
private List<String> targetIds;
@ApiModelProperty(value = "满减金额[满多少]")
private BigDecimal fullValue;
private static final CandyUseResultVo obj = new CandyUseResultVo(); private static final CandyUseResultVo obj = new CandyUseResultVo();
......
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
@Data @Data
@ApiModel @ApiModel
...@@ -16,6 +17,8 @@ public class GoblinUseResultVo implements Serializable, Cloneable { ...@@ -16,6 +17,8 @@ public class GoblinUseResultVo implements Serializable, Cloneable {
private BigDecimal value; private BigDecimal value;
@ApiModelProperty(value = "券类型[1-代金券|2-折扣券|3-满减券]", example = "1") @ApiModelProperty(value = "券类型[1-代金券|2-折扣券|3-满减券]", example = "1")
private String couType; private String couType;
@ApiModelProperty(value = "适用spu范围")
private List<String> spuIds;
private static final GoblinUseResultVo obj = new GoblinUseResultVo(); private static final GoblinUseResultVo obj = new GoblinUseResultVo();
......
...@@ -9,6 +9,7 @@ import lombok.Data; ...@@ -9,6 +9,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* 商城:用户优惠券展示信息(缓存) * 商城:用户优惠券展示信息(缓存)
...@@ -61,6 +62,8 @@ public class GoblinUserCouponVo implements Serializable, Cloneable { ...@@ -61,6 +62,8 @@ public class GoblinUserCouponVo implements Serializable, Cloneable {
@ApiModelProperty(position = 35, value = "店铺ID") @ApiModelProperty(position = 35, value = "店铺ID")
private String storeId; private String storeId;
@ApiModelProperty(position = 36, value = "spuIds")
private List<String> spuIds;
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
......
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
@Api
@Data
public class CouponCanUse2Param implements Serializable, Cloneable {
@ApiModelProperty(dataType = "String", name = "spuId", value = "spuId",example = "1",required = true)
@NotNull @NotBlank
private String spuId;
@ApiModelProperty(dataType = "Number", name = "price", value = "当前spu总价",example = "10",required = true)
@NotNull @NotBlank
private BigDecimal price;
private static final CouponCanUse2Param obj = new CouponCanUse2Param();
public static CouponCanUse2Param getNew() {
try {
return (CouponCanUse2Param) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new CouponCanUse2Param();
}
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Api
@Data
public class CouponCanUseAllParam implements Serializable, Cloneable {
@ApiModelProperty(name = "spuIds", value = "spuId集合",required = true)
@NotNull @NotBlank
private List<String> spuIds;
@ApiModelProperty(dataType = "String", name = "uid", value = "用户id",example = "10",required = true)
private String uid;
private static final CouponCanUseAllParam obj = new CouponCanUseAllParam();
public static CouponCanUseAllParam getNew() {
try {
return (CouponCanUseAllParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new CouponCanUseAllParam();
}
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Api
@Data
public class CouponCanUseParam implements Serializable, Cloneable {
@ApiModelProperty(name = "param", value = "对象", required = true)
@NotNull
@NotBlank
private List<CouponCanUse2Param> param;
@ApiModelProperty(dataType = "String", name = "uid", value = "用户id", example = "10", required = false)
private String uid;
@ApiModelProperty(dataType = "String", name = "storeId", value = "店铺id", example = "10", required = false)
private String storeId;
private static final CouponCanUseParam obj = new CouponCanUseParam();
public static CouponCanUseParam getNew() {
try {
return (CouponCanUseParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new CouponCanUseParam();
}
}
package com.liquidnet.service.goblin.param;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@Api
@Data
public class CouponHelpUseParam implements Serializable, Cloneable {
@ApiModelProperty(name = "param", value = "对象", required = true)
@NotNull
@NotBlank
private List<CouponCanUse2Param> param;
@ApiModelProperty(dataType = "String", name = "uid", value = "用户id", example = "10", required = false)
private String uid;
@ApiModelProperty(dataType = "String", name = "ucouponId", value = "店铺券id", required = false)
private String ucouponId;
@ApiModelProperty(dataType = "String", name = "platformUcouponId", value = "平台券id", required = false)
private String platformUcouponId;
private static final CouponHelpUseParam obj = new CouponHelpUseParam();
public static CouponHelpUseParam getNew() {
try {
return (CouponHelpUseParam) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new CouponHelpUseParam();
}
}
package com.liquidnet.service.goblin.param;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Api
@Data
public class CouponHelpUseVo implements Serializable, Cloneable {
// @ApiModelProperty(name = "param", value = "对象")
// private List<CouponCanUse2Param> param;
// @ApiModelProperty(name = "couponVo", value = "券vo")
// private GoblinUserCouponVo couponVo;
@ApiModelProperty(dataType = "String", name = "ucouponId", value = "券id", required = true)
private String ucouponId;
@ApiModelProperty(dataType = "String", name = "platformUcouponId", value = "平台券id", required = true)
private String platformUcouponId;
@ApiModelProperty(dataType = "number", name = "price", value = "优惠金额", required = true)
private BigDecimal price;
private static final CouponHelpUseVo obj = new CouponHelpUseVo();
public static CouponHelpUseVo getNew() {
try {
return (CouponHelpUseVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new CouponHelpUseVo();
}
}
...@@ -43,6 +43,9 @@ public class GoblinOrderPreParam implements Cloneable{ ...@@ -43,6 +43,9 @@ public class GoblinOrderPreParam implements Cloneable{
private GoblinStoreOrder storeOrder; private GoblinStoreOrder storeOrder;
private GoblinOrderAttr orderAttr; private GoblinOrderAttr orderAttr;
private List<GoblinOrderSku> orderSkuList; private List<GoblinOrderSku> orderSkuList;
private List<String> storeSpuIds;
private List<String> platformSpuIds;
private static final GoblinOrderPreParam obj = new GoblinOrderPreParam(); private static final GoblinOrderPreParam obj = new GoblinOrderPreParam();
......
...@@ -3,7 +3,7 @@ package com.liquidnet.service.goblin.service; ...@@ -3,7 +3,7 @@ package com.liquidnet.service.goblin.service;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo; import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo; import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo; import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam; import com.liquidnet.service.goblin.param.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -28,9 +28,21 @@ public interface GoblinCouponService { ...@@ -28,9 +28,21 @@ public interface GoblinCouponService {
//可用券列表 [价格] [spuId逗号隔开] [uid] //可用券列表 [价格] [spuId逗号隔开] [uid]
List<GoblinUserCouponVo> useList(BigDecimal totalPrice, String spuId, String uid); List<GoblinUserCouponVo> useList(BigDecimal totalPrice, String spuId, String uid);
//可用券列表[可用券列表[返回商品下所有券]]
List<GoblinUserCouponVo> useList3(CouponCanUseAllParam param);
List<GoblinUserCouponVo> useList2(CouponCanUseParam param);
//使用券 [券id] [消费内容] [价格] [spuId逗号隔开] //使用券 [券id] [消费内容] [价格] [spuId逗号隔开]
GoblinUseResultVo useCoupon(String ucouponId,String content, BigDecimal totalPrice, String spuId, String uid); GoblinUseResultVo useCoupon(String ucouponId,String content, BigDecimal totalPrice, String spuId, String uid);
//回退券 [list<Data>] [券id , 用户id] //回退券 [list<Data>] [券id , 用户id]
Boolean backCoupon(List<BackCouponParam> params); Boolean backCoupon(List<BackCouponParam> params);
/**
* 帮前端写选择券逻辑
* @param params
* @return
*/
CouponHelpUseVo helpUseCoupon(CouponHelpUseParam params);
} }
...@@ -12,6 +12,7 @@ public class KylinRedisConst { ...@@ -12,6 +12,7 @@ public class KylinRedisConst {
public static final String PERFORMANCES_ROADLIST = "kylin:performances:roadShowId:"; public static final String PERFORMANCES_ROADLIST = "kylin:performances:roadShowId:";
public static final String PERFORMANCES_AGENT_INFO = "kylin:agent:hash:id:"; public static final String PERFORMANCES_AGENT_INFO = "kylin:agent:hash:id:";
public static final String PERFORMANCES_INVENTORY = "kylin:performances_inventory:ticket:id:"; public static final String PERFORMANCES_INVENTORY = "kylin:performances_inventory:ticket:id:";
public static final String TICKET_PAY_TXT = "kylin:payTxt:ticket:id:";
public static final String SURPLUS_GENERAL = "surplusGeneral"; public static final String SURPLUS_GENERAL = "surplusGeneral";
public static final String SURPLUS_EXCHANGE = "surplusExchange"; public static final String SURPLUS_EXCHANGE = "surplusExchange";
public static final String TICKET = "kylin:ticket:id:"; public static final String TICKET = "kylin:ticket:id:";
......
package com.liquidnet.service.kylin.dto.vo.admin;
import com.liquidnet.service.kylin.dao.TicketAgentDao;
import com.liquidnet.service.kylin.dao.TicketPayTxtDao;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
@ApiModel
@Data
public class KylinPerformancePayTxtVo {
private String performancesId;
private String title;
private List<TicketPayTxtDao> tickets;
}
...@@ -6,10 +6,7 @@ import com.liquidnet.service.kylin.dao.*; ...@@ -6,10 +6,7 @@ import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dto.param.PerformanceAdminListParam; import com.liquidnet.service.kylin.dto.param.PerformanceAdminListParam;
import com.liquidnet.service.kylin.dto.param.PerformanceMemberAuditParam; import com.liquidnet.service.kylin.dto.param.PerformanceMemberAuditParam;
import com.liquidnet.service.kylin.dto.param.SysDamaiParam; import com.liquidnet.service.kylin.dto.param.SysDamaiParam;
import com.liquidnet.service.kylin.dto.vo.admin.KylinPerformanceAgentVo; import com.liquidnet.service.kylin.dto.vo.admin.*;
import com.liquidnet.service.kylin.dto.vo.admin.KylinPerformanceDamaiVo;
import com.liquidnet.service.kylin.dto.vo.admin.PerformanceRefundConfigVo;
import com.liquidnet.service.kylin.dto.vo.admin.PerformanceTransferConfigVo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo; import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import com.liquidnet.service.kylin.entity.KylinOrderImport; import com.liquidnet.service.kylin.entity.KylinOrderImport;
import com.liquidnet.service.kylin.entity.KylinPerformances; import com.liquidnet.service.kylin.entity.KylinPerformances;
...@@ -188,6 +185,14 @@ public interface IKylinPerformancesAdminService { ...@@ -188,6 +185,14 @@ public interface IKylinPerformancesAdminService {
*/ */
boolean changeTicketAgent(String performancesId,String ticketId, Integer status); boolean changeTicketAgent(String performancesId,String ticketId, Integer status);
/**
* 修改 当前票种支付文案
* @param ticketId 票务id
* @param payTxt 支付文案
* @return
*/
boolean changeTicketPayTxt(String performancesId,String ticketId, String payTxt);
/** /**
* 修改 演出&票种&是否同步到大麦 * 修改 演出&票种&是否同步到大麦
* @return * @return
...@@ -240,6 +245,8 @@ public interface IKylinPerformancesAdminService { ...@@ -240,6 +245,8 @@ public interface IKylinPerformancesAdminService {
KylinPerformanceAgentVo getPerformanceAgent(String performancesId); KylinPerformanceAgentVo getPerformanceAgent(String performancesId);
KylinPerformancePayTxtVo getPerformancePayTxt(String performancesId);
KylinPerformanceDamaiVo getPerformanceDamai(String performancesId); KylinPerformanceDamaiVo getPerformanceDamai(String performancesId);
List<PerformanceOrderStatisticalDao> getPerformanceOrderStatisticalList(String performancesId); List<PerformanceOrderStatisticalDao> getPerformanceOrderStatisticalList(String performancesId);
......
...@@ -134,4 +134,9 @@ public enum BusinessType ...@@ -134,4 +134,9 @@ public enum BusinessType
* 会员订单退款 * 会员订单退款
*/ */
MORDER_REFUND, MORDER_REFUND,
/**
* 修改
*/
PERFORMANCE_SAVE,
} }
...@@ -16,10 +16,7 @@ import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao; ...@@ -16,10 +16,7 @@ import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import com.liquidnet.service.kylin.dto.param.PerformanceAdminListParam; import com.liquidnet.service.kylin.dto.param.PerformanceAdminListParam;
import com.liquidnet.service.kylin.dto.param.PerformanceMemberAuditParam; import com.liquidnet.service.kylin.dto.param.PerformanceMemberAuditParam;
import com.liquidnet.service.kylin.dto.param.SysDamaiParam; import com.liquidnet.service.kylin.dto.param.SysDamaiParam;
import com.liquidnet.service.kylin.dto.vo.admin.KylinPerformanceAgentVo; import com.liquidnet.service.kylin.dto.vo.admin.*;
import com.liquidnet.service.kylin.dto.vo.admin.KylinPerformanceDamaiVo;
import com.liquidnet.service.kylin.dto.vo.admin.PerformanceRefundConfigVo;
import com.liquidnet.service.kylin.dto.vo.admin.PerformanceTransferConfigVo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo; import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import com.liquidnet.service.kylin.entity.KylinOrderImport; import com.liquidnet.service.kylin.entity.KylinOrderImport;
import com.liquidnet.service.kylin.service.admin.IKylinPerformancesAdminService; import com.liquidnet.service.kylin.service.admin.IKylinPerformancesAdminService;
...@@ -87,7 +84,7 @@ public class KylinPerformancesController extends BaseController { ...@@ -87,7 +84,7 @@ public class KylinPerformancesController extends BaseController {
return prefix + "/details"; return prefix + "/details";
} }
@Log(title = "演出列表", businessType = BusinessType.AUDIT) @Log(title = "演出审核", businessType = BusinessType.AUDIT)
@PostMapping(value = "/audit") @PostMapping(value = "/audit")
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@ResponseBody @ResponseBody
...@@ -99,11 +96,12 @@ public class KylinPerformancesController extends BaseController { ...@@ -99,11 +96,12 @@ public class KylinPerformancesController extends BaseController {
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@PostMapping(value = "/isShow") @PostMapping(value = "/isShow")
@ResponseBody @ResponseBody
@Log(title = "演出管理:是否显示", businessType = BusinessType.PERFORMANCE_SAVE)
public AjaxResult setIsShow(String performancesId, Integer isShow) { public AjaxResult setIsShow(String performancesId, Integer isShow) {
return toAjax(kylinPerformancesService.setIsShow(performancesId, isShow)); return toAjax(kylinPerformancesService.setIsShow(performancesId, isShow));
} }
@Log(title = "演出列表", businessType = BusinessType.DETAIL) // @Log(title = "演出列表", businessType = BusinessType.DETAIL)
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@GetMapping(value = "/memberInfo/{performancesId}") @GetMapping(value = "/memberInfo/{performancesId}")
public String memberInfo(@PathVariable("performancesId") String performancesId, ModelMap mmap) { public String memberInfo(@PathVariable("performancesId") String performancesId, ModelMap mmap) {
...@@ -112,7 +110,7 @@ public class KylinPerformancesController extends BaseController { ...@@ -112,7 +110,7 @@ public class KylinPerformancesController extends BaseController {
return prefix + "/memberInfo"; return prefix + "/memberInfo";
} }
@Log(title = "演出列表", businessType = BusinessType.UPDATE) @Log(title = "演出管理:提交会员信息", businessType = BusinessType.PERFORMANCE_SAVE)
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@PostMapping(value = "/memberInfo/submit") @PostMapping(value = "/memberInfo/submit")
@ResponseBody @ResponseBody
...@@ -121,7 +119,7 @@ public class KylinPerformancesController extends BaseController { ...@@ -121,7 +119,7 @@ public class KylinPerformancesController extends BaseController {
return toAjax(result); return toAjax(result);
} }
@Log(title = "演出列表-演出数据", businessType = BusinessType.LIST) // @Log(title = "演出列表-演出数据", businessType = BusinessType.LIST)
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@GetMapping(value = "/performanceStatic/{performancesId}") @GetMapping(value = "/performanceStatic/{performancesId}")
public String performanceStatic(@PathVariable("performancesId") String performancesId, ModelMap mmap) { public String performanceStatic(@PathVariable("performancesId") String performancesId, ModelMap mmap) {
...@@ -165,14 +163,30 @@ public class KylinPerformancesController extends BaseController { ...@@ -165,14 +163,30 @@ public class KylinPerformancesController extends BaseController {
return prefix + "/agent"; return prefix + "/agent";
} }
@GetMapping(value = "/payTxt/{performancesId}")
public String payTxt(@PathVariable("performancesId") String performancesId, ModelMap mmap) {
KylinPerformancePayTxtVo result = kylinPerformancesService.getPerformancePayTxt(performancesId);
mmap.put("kylinPerformancePayTxtVo", result);
return prefix + "/payTxt";
}
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@PostMapping(value = "/agent/change") @PostMapping(value = "/agent/change")
@ResponseBody @ResponseBody
@Log(title = "演出管理:票种代理", businessType = BusinessType.PERFORMANCE_SAVE)
public AjaxResult changeTicketAgent(@RequestParam("performancesId") String performancesId, @RequestParam("ticketsId") String ticketsId, @RequestParam("status") Integer status) { public AjaxResult changeTicketAgent(@RequestParam("performancesId") String performancesId, @RequestParam("ticketsId") String ticketsId, @RequestParam("status") Integer status) {
boolean result = kylinPerformancesService.changeTicketAgent(performancesId, ticketsId, status); boolean result = kylinPerformancesService.changeTicketAgent(performancesId, ticketsId, status);
return toAjax(result); return toAjax(result);
} }
@PostMapping(value = "/payTxt/change")
@ResponseBody
@Log(title = "演出管理:支付文案", businessType = BusinessType.PERFORMANCE_SAVE)
public AjaxResult changeTicketPayTxt(@RequestParam("performancesId") String performancesId, @RequestParam("ticketsId") String ticketsId, @RequestParam("payTxt") String payTxt) {
boolean result = kylinPerformancesService.changeTicketPayTxt(performancesId, ticketsId, payTxt);
return toAjax(result);
}
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@PostMapping(value = "/damai/change") @PostMapping(value = "/damai/change")
@ResponseBody @ResponseBody
...@@ -202,6 +216,7 @@ public class KylinPerformancesController extends BaseController { ...@@ -202,6 +216,7 @@ public class KylinPerformancesController extends BaseController {
//@RequiresPermissions("kylin:performances:view") //@RequiresPermissions("kylin:performances:view")
@PostMapping(value = "/refundConfig/change") @PostMapping(value = "/refundConfig/change")
@ResponseBody @ResponseBody
@Log(title = "演出管理:退款配置", businessType = BusinessType.PERFORMANCE_SAVE)
public AjaxResult changeRefundConfig(@RequestParam("performancesId") String performancesId, public AjaxResult changeRefundConfig(@RequestParam("performancesId") String performancesId,
@RequestParam("isCanRefund") Integer isCanRefund, @RequestParam("isCanRefund") Integer isCanRefund,
@RequestParam("refundOpenTime") String refundOpenTime, @RequestParam("refundOpenTime") String refundOpenTime,
...@@ -238,6 +253,7 @@ public class KylinPerformancesController extends BaseController { ...@@ -238,6 +253,7 @@ public class KylinPerformancesController extends BaseController {
@PostMapping(value = "/transferConfig/change") @PostMapping(value = "/transferConfig/change")
@ResponseBody @ResponseBody
@Log(title = "演出管理:转赠配置", businessType = BusinessType.PERFORMANCE_SAVE)
public AjaxResult changeTransferConfig(@RequestParam("performancesId") String performancesId, public AjaxResult changeTransferConfig(@RequestParam("performancesId") String performancesId,
@RequestParam("isCanTransfer") Integer isCanTransfer, @RequestParam("isCanTransfer") Integer isCanTransfer,
@RequestParam("transferStartTime") String transferStartTime, @RequestParam("transferStartTime") String transferStartTime,
......
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<span class="labelName">发送类型:</span> <span class="labelName">发送类型:</span>
<div class="layui-input-block" style="display: flex"> <div class="layui-input-block" style="display: flex">
<input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span> <!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input type="radio" value="1" class="sendType" name="sendType"><span>会员</span> <input type="radio" value="1" class="sendType" name="sendType"><span>会员</span>
<input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span> <input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span>
</div> </div>
......
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<span class="labelName">发送类型:</span> <span class="labelName">发送类型:</span>
<div class="layui-input-block" style="display: flex"> <div class="layui-input-block" style="display: flex">
<input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span> <!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input type="radio" value="1" class="sendType" name="sendType"><span>会员</span> <input type="radio" value="1" class="sendType" name="sendType"><span>会员</span>
<input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span> <input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span>
</div> </div>
......
...@@ -207,7 +207,7 @@ ...@@ -207,7 +207,7 @@
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<span class="labelName">发送类型:</span> <span class="labelName">发送类型:</span>
<div class="layui-input-block" style="display: flex"> <div class="layui-input-block" style="display: flex">
<input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span> <!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input type="radio" value="1" class="sendType" name="sendType"><span>会员</span> <input type="radio" value="1" class="sendType" name="sendType"><span>会员</span>
<input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span> <input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span>
</div> </div>
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<span class="labelName">发送类型:</span> <span class="labelName">发送类型:</span>
<div class="layui-input-block" style="display: flex"> <div class="layui-input-block" style="display: flex">
<input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span> <!-- <input type="radio" value="10" class="sendType" name="sendType" checked><span>全体用户</span>-->
<input type="radio" value="1" class="sendType" name="sendType"><span>会员</span> <input type="radio" value="1" class="sendType" name="sendType"><span>会员</span>
<input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span> <input type="radio" value="2" class="sendType" name="sendType"><span>手机号</span>
</div> </div>
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
</li> </li>
<li id="li-tab-8"><a data-toggle="tab" href="#tab-8" aria-expanded="false" onclick="importInfo()">订单导入</a> <li id="li-tab-8"><a data-toggle="tab" href="#tab-8" aria-expanded="false" onclick="importInfo()">订单导入</a>
</li> </li>
<li id="li-tab-9"><a data-toggle="tab" href="#tab-9" aria-expanded="false" onclick="payTxtInfo()">支付文案</a>
</li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div id="tab-1" class="tab-pane"> <div id="tab-1" class="tab-pane">
...@@ -69,7 +71,7 @@ ...@@ -69,7 +71,7 @@
th:object="${kylinPerformanceMisVo}"> th:object="${kylinPerformanceMisVo}">
<div> <div>
<h4>场地核进度:</h4> <h4>场地核进度:</h4>
<span th:if="*{fieldAuditStatus==0}" >通过</span> <span th:if="*{fieldAuditStatus==0}">通过</span>
<span th:if="*{fieldAuditStatus==1}" style="color: red">待审核</span> <span th:if="*{fieldAuditStatus==1}" style="color: red">待审核</span>
<span th:if="*{fieldAuditStatus==2}" style="color: red">拒绝</span> <span th:if="*{fieldAuditStatus==2}" style="color: red">拒绝</span>
</div> </div>
...@@ -298,6 +300,16 @@ ...@@ -298,6 +300,16 @@
height=800px frameborder=0></iframe> height=800px frameborder=0></iframe>
</div> </div>
</div> </div>
<div id="tab-9" class="tab-pane">
<div class="panel-body">
<form class="form-horizontal m" th:object="${kylinPerformanceMisVo}">
<input name="title" th:field="*{title}" class="form-control" type="text" readonly>
</form>
<iframe id="pay_txt_iframe" name="order_import_iframe" marginwidth=0 marginheight=0
width=100%
height=800px frameborder=0></iframe>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -351,7 +363,12 @@ ...@@ -351,7 +363,12 @@
document.getElementById("li-tab-8").style.display = "none"; document.getElementById("li-tab-8").style.display = "none";
} }
if (auditStatus == 1 || fieldStatus == 1 || fieldStatus == 2 ||auditStatus == 2) { var payTxt = [[${@permission.hasPermi('kylin:performances:payTxt')}]];
if (payTxt == "hidden") {
document.getElementById("li-tab-9").style.display = "none";
}
if (auditStatus == 1 || fieldStatus == 1 || fieldStatus == 2 || auditStatus == 2) {
document.getElementsByName("auditBtn")[0].style.display = "none"; document.getElementsByName("auditBtn")[0].style.display = "none";
} }
...@@ -433,6 +450,11 @@ ...@@ -433,6 +450,11 @@
document.getElementById("order_import_iframe").src = "../orderImport/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", ""); document.getElementById("order_import_iframe").src = "../orderImport/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
} }
//支付文案
function payTxtInfo() {
document.getElementById("pay_txt_iframe").src = "../payTxt/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "");
}
$("#tab-nav-1").bind("click", function () { $("#tab-nav-1").bind("click", function () {
$("#tab_iframe_1").attr("src", prefix + "/performanceStatic/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", "")); $("#tab_iframe_1").attr("src", prefix + "/performanceStatic/" + '[[${kylinPerformanceMisVo.performancesId}]]'.replaceAll("\"", ""));
}); });
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('支付文案')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-agent-edit" th:object="${kylinPerformancePayTxtVo}">
<div class="form-group">
<label class="col-sm-3 control-label is-required">performances_id:</label>
<div class="col-sm-8">
<input name="performancesId" th:field="*{performancesId}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">演出名称:</label>
<div class="col-sm-8">
<input name="title" th:value="*{title}" class="form-control" type="text" readonly>
</div>
</div>
<div th:each="ticket : ${kylinPerformancePayTxtVo.tickets}">
<div class="form-group">
<label class="col-sm-3 control-label is-required">票种名称:</label>
<div class="col-sm-8">
<input name="title" th:value="${ticket.title}" class="form-control" type="text" readonly>
<input name="ticketsId" th:value="${ticket.ticketsId}" class="form-control" type="hidden" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">支付文案:</label>
<div class="col-sm-8">
<input name="payTxt" th:value="${ticket.payTxt}" class="form-control" type="text" maxlength="16">
</div>
<button type="button" class="btn btn-w-m btn-success" onclick="submitHandler(this)">
保存
</button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var prefix = ctx + "kylin/performances";
$("#form-performances-edit").validate({
focusCleanup: true
});
function submitHandler(res) {
var param = {
"performancesId": '[[${kylinPerformancePayTxtVo.performancesId}]]'.replaceAll("\"", ""),
"ticketsId": $(res).parent().parent().find("input[name^='ticketsId']").val(),
"payTxt": $(res).parent().parent().find("input[name^='payTxt']").val()
}
$.operate.post(prefix + "/payTxt/change", param, function (res) {
location.reload();
});
}
</script>
</body>
</html>
...@@ -71,6 +71,15 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe ...@@ -71,6 +71,15 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
} else { } else {
goblinFrontCube.setUpdateTime(LocalDateTime.now()); goblinFrontCube.setUpdateTime(LocalDateTime.now());
//数据库修改 //数据库修改
String spuIds="";
for(String spuId:goblinFrontCube.getSpuId().split(",")){
if(spuId.equals("")||spuId.equals("undefined")){
}else{
spuIds=spuIds.concat(spuId).concat(",");
}
}
goblinFrontCube.setSpuId(spuIds);
goblinFrontCubeMapper.updateById(goblinFrontCube); goblinFrontCubeMapper.updateById(goblinFrontCube);
} }
} }
......
...@@ -601,6 +601,12 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -601,6 +601,12 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
} }
} }
@Override
public boolean changeTicketPayTxt(String performancesId, String ticketId, String payTxt) {
dataUtils.setTicketPayTxt(ticketId, payTxt);
return true;
}
@Override @Override
public boolean changeSysDamai(List<SysDamaiParam> params) { public boolean changeSysDamai(List<SysDamaiParam> params) {
try { try {
...@@ -746,6 +752,25 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -746,6 +752,25 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
return vo; return vo;
} }
@Override
public KylinPerformancePayTxtVo getPerformancePayTxt(String performancesId) {
KylinPerformances performanceData = performancesMapper.selectOne(new UpdateWrapper<KylinPerformances>().eq("performances_id", performancesId));
List<TicketAgentDao> ticketData = ticketsMapper.ticketAgent(performancesId);
KylinPerformancePayTxtVo vo = new KylinPerformancePayTxtVo();
vo.setPerformancesId(performanceData.getPerformancesId());
vo.setTitle(performanceData.getTitle());
List<TicketPayTxtDao> payTxtDaoList = new ArrayList();
for (TicketAgentDao item : ticketData) {
TicketPayTxtDao payTxtDao = new TicketPayTxtDao();
payTxtDao.setTicketsId(item.getTicketsId());
payTxtDao.setTitle(item.getTitle());
payTxtDao.setPayTxt(dataUtils.getTicketPayTxt(item.getTicketsId()));
payTxtDaoList.add(payTxtDao);
}
vo.setTickets(payTxtDaoList);
return vo;
}
public KylinPerformanceDamaiVo getPerformanceDamai(String performancesId) { public KylinPerformanceDamaiVo getPerformanceDamai(String performancesId) {
KylinPerformances performanceData = performancesMapper.selectOne(new UpdateWrapper<KylinPerformances>().eq("performances_id", performancesId)); KylinPerformances performanceData = performancesMapper.selectOne(new UpdateWrapper<KylinPerformances>().eq("performances_id", performancesId));
KylinPerformanceStatus performanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); KylinPerformanceStatus performanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
......
...@@ -373,17 +373,17 @@ public class DataUtils { ...@@ -373,17 +373,17 @@ public class DataUtils {
} }
// 获取 快递地址 // 获取 快递地址
public OrderRefundAddress getRefundAddress(){ public OrderRefundAddress getRefundAddress() {
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER_REFUND_ADDRESS); Object obj = redisDataSourceUtil.getRedisKylinUtil().get(KylinRedisConst.ORDER_REFUND_ADDRESS);
if(obj==null){ if (obj == null) {
OrderRefundAddress vo = OrderRefundAddress.getNew(); OrderRefundAddress vo = OrderRefundAddress.getNew();
vo.setName("张三"); vo.setName("张三");
vo.setPhone("010 124412"); vo.setPhone("010 124412");
vo.setAddress("北京 北京市朝阳区广渠路3-12"); vo.setAddress("北京 北京市朝阳区广渠路3-12");
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER_REFUND_ADDRESS,vo); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER_REFUND_ADDRESS, vo);
return vo; return vo;
}else{ } else {
return (OrderRefundAddress)obj; return (OrderRefundAddress) obj;
} }
} }
...@@ -444,12 +444,12 @@ public class DataUtils { ...@@ -444,12 +444,12 @@ public class DataUtils {
} }
//订单信息存redis //订单信息存redis
public void orderSetRedis(String orderCode){ public void orderSetRedis(String orderCode) {
KylinOrderTicketVo orderTicketVo = mongoTemplate.findOne(Query.query(Criteria.where("orderCode").is(orderCode)), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName()); KylinOrderTicketVo orderTicketVo = mongoTemplate.findOne(Query.query(Criteria.where("orderCode").is(orderCode)), KylinOrderTicketVo.class, KylinOrderTicketVo.class.getSimpleName());
String orderTicketsId = orderTicketVo.getOrderTicketsId(); String orderTicketsId = orderTicketVo.getOrderTicketsId();
List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderTicketsId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName()); List<KylinOrderTicketEntitiesVo> kylinOrderTicketEntitiesVoList = mongoTemplate.find(Query.query(Criteria.where("orderId").is(orderTicketsId)), KylinOrderTicketEntitiesVo.class, KylinOrderTicketEntitiesVo.class.getSimpleName());
orderTicketVo.setEntitiesVoList(kylinOrderTicketEntitiesVoList); orderTicketVo.setEntitiesVoList(kylinOrderTicketEntitiesVoList);
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER +orderTicketsId, orderTicketVo); redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.ORDER + orderTicketsId, orderTicketVo);
} }
public void setkylinExpressModules(List<KylinExpressModuleVo> voList) { public void setkylinExpressModules(List<KylinExpressModuleVo> voList) {
...@@ -469,7 +469,7 @@ public class DataUtils { ...@@ -469,7 +469,7 @@ public class DataUtils {
if (obj != null) { if (obj != null) {
return (KylinTicketExpressModuleVo) obj; return (KylinTicketExpressModuleVo) obj;
} else { } else {
return KylinTicketExpressModuleVo.getNew() ; return KylinTicketExpressModuleVo.getNew();
} }
} }
...@@ -497,4 +497,18 @@ public class DataUtils { ...@@ -497,4 +497,18 @@ public class DataUtils {
return KylinTicketExpressModuleVo.getNew(); return KylinTicketExpressModuleVo.getNew();
} }
} }
public void setTicketPayTxt(String ticketId, String payTxt) {
redisDataSourceUtil.getRedisKylinUtil().set(KylinRedisConst.TICKET_PAY_TXT + ticketId, payTxt);
}
public String getTicketPayTxt(String ticketId) {
String rdsKey = KylinRedisConst.TICKET_PAY_TXT.concat(ticketId);
Object obj = redisDataSourceUtil.getRedisKylinUtil().get(rdsKey);
if(obj==null){
return "";
}else{
return (String) obj;
}
}
} }
...@@ -27,14 +27,11 @@ public class FilesUtils { ...@@ -27,14 +27,11 @@ public class FilesUtils {
*/ */
public static File multipartFileToFile(MultipartFile file) { public static File multipartFileToFile(MultipartFile file) {
try { try {
File toFile = null;
if (!file.equals("") && file.getSize() > 0) {
InputStream ins = null; InputStream ins = null;
ins = file.getInputStream(); ins = file.getInputStream();
toFile = new File(file.getOriginalFilename()); File toFile = new File(file.getOriginalFilename());
inputStreamToFile(ins, toFile); inputStreamToFile(ins, toFile);
ins.close(); ins.close();
}
return toFile; return toFile;
} catch (Exception e) { } catch (Exception e) {
log.error("multipartFileToFileError", e); log.error("multipartFileToFileError", e);
......
package com.liquidnet.service.kylin.dao;
import lombok.Data;
@Data
public class TicketPayTxtDao {
private String ticketsId;
private String title;
private String payTxt;
}
...@@ -2,6 +2,7 @@ package com.liquidnet.service.adam.controller; ...@@ -2,6 +2,7 @@ package com.liquidnet.service.adam.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport; import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoDto; import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoDto;
import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoReq; import com.liquidnet.service.adam.dto.rsc.AdamChimeUinfoReq;
import com.liquidnet.service.adam.dto.vo.*; import com.liquidnet.service.adam.dto.vo.*;
...@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -26,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -82,6 +84,17 @@ public class AdamRscController { ...@@ -82,6 +84,17 @@ public class AdamRscController {
return ResponseDto.success(adamRdmService.getUserMemberVoByUid(uid)); return ResponseDto.success(adamRdmService.getUserMemberVoByUid(uid));
} }
@ApiOperationSupport(order = 22)
@ApiOperation(value = "@API:用户创建日期")
@GetMapping("inquire/createdAt")
public ResponseDto<LocalDateTime> queryCreatedAt(@NotBlank(message = "用户ID不能为空") @RequestParam String uid) {
AdamUserInfoVo vo = adamRdmService.getUserInfoVoByUid(uid);
if (vo == null) {
return ResponseDto.success(LocalDateTime.of(2222, 1, 1, 1, 1, 1, 1));
}
return ResponseDto.success(vo.getCreateAt());
}
@ApiOperationSupport(order = 30) @ApiOperationSupport(order = 30)
@ApiOperation(value = "@API:票务下单所需信息查询", notes = "包括是否会员、收货地址及入场人信息") @ApiOperation(value = "@API:票务下单所需信息查询", notes = "包括是否会员、收货地址及入场人信息")
@PostMapping("inquire/of_buy_ticket") @PostMapping("inquire/of_buy_ticket")
...@@ -136,12 +149,12 @@ public class AdamRscController { ...@@ -136,12 +149,12 @@ public class AdamRscController {
@ApiOperationSupport(order = 40) @ApiOperationSupport(order = 40)
@ApiOperation(value = "@API:社交用户点击喜欢或不喜欢", notes = "发送点击事件计数") @ApiOperation(value = "@API:社交用户点击喜欢或不喜欢", notes = "发送点击事件计数")
@PostMapping("inquire/sendMsgToRedis") @PostMapping("inquire/sendMsgToRedis")
public ResponseDto<Boolean> sendMsgToRedis(@RequestParam(required = true) String redisKey,@RequestParam(required = true) String jsonParamStr) { public ResponseDto<Boolean> sendMsgToRedis(@RequestParam(required = true) String redisKey, @RequestParam(required = true) String jsonParamStr) {
if (null == redisKey || null == jsonParamStr || redisKey.isEmpty() || jsonParamStr.isEmpty()) { if (null == redisKey || null == jsonParamStr || redisKey.isEmpty() || jsonParamStr.isEmpty()) {
return ResponseDto.failure(); return ResponseDto.failure();
} }
try { try {
queueUtils.sendMsgByRedis(redisKey,jsonParamStr); queueUtils.sendMsgByRedis(redisKey, jsonParamStr);
} catch (Exception e) { } catch (Exception e) {
log.error("@API:社交用户点击喜欢或不喜欢计数入队", e); log.error("@API:社交用户点击喜欢或不喜欢计数入队", e);
} }
......
...@@ -346,8 +346,11 @@ public class CandyCouponController { ...@@ -346,8 +346,11 @@ public class CandyCouponController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "uCouponIds", value = "券id(逗号隔开的字符串)", required = true), @ApiImplicitParam(type = "form", dataType = "String", name = "uCouponIds", value = "券id(逗号隔开的字符串)", required = true),
}) })
public ResponseDto<List<CandyCouponVo>> couponListById(@RequestParam("uCouponIds") @NotNull @NotBlank String uCouponIds) { public ResponseDto<List<CandyCouponVo>> couponListById(@RequestParam("uCouponIds") @NotNull @NotBlank String uCouponIds, @RequestParam(value = "uid", required = false) String uid) {
return candyCouponService.couponListById(uCouponIds); if (uid == null || uid.equals("")) {
uid = CurrentUtil.getCurrentUid();
}
return candyCouponService.couponListById(uCouponIds, uid);
// if (result != null) { // if (result != null) {
// return ResponseDto.success(result); // return ResponseDto.success(result);
// } else { // } else {
......
...@@ -252,7 +252,11 @@ public class CouponBaseUtil { ...@@ -252,7 +252,11 @@ public class CouponBaseUtil {
BigDecimal valOver) { BigDecimal valOver) {
boolean isTarget = false; boolean isTarget = false;
ArrayList<String> targetIdList = new ArrayList(Arrays.asList(targetId.split(","))); ArrayList<String> targetIdList = new ArrayList(Arrays.asList(targetId.split(",")));
if (targetIdList.contains(busiId)) {//判断id 对应 for (String item : targetIdList) {
if (item.contains("ZZ")) {
item = item.split("ZZ")[0];
}
if (item.equals(busiId)) {//判断id 对应
if (couType.equals(2)) { if (couType.equals(2)) {
if (priceTotal.compareTo(valOver) >= 0) { if (priceTotal.compareTo(valOver) >= 0) {
isTarget = true; isTarget = true;
...@@ -261,6 +265,16 @@ public class CouponBaseUtil { ...@@ -261,6 +265,16 @@ public class CouponBaseUtil {
isTarget = true; isTarget = true;
} }
} }
}
// if (targetIdList.contains(busiId)) {//判断id 对应
// if (couType.equals(2)) {
// if (priceTotal.compareTo(valOver) >= 0) {
// isTarget = true;
// }
// } else {
// isTarget = true;
// }
// }
return isTarget; return isTarget;
} }
......
...@@ -65,7 +65,7 @@ public class RedisDataUtils { ...@@ -65,7 +65,7 @@ public class RedisDataUtils {
boolean needSet = false; boolean needSet = false;
if (userCreateTime == null) { if (userCreateTime == null) {
userCreateTime = LocalDateTime.MIN; userCreateTime = LocalDateTime.of(2222,1,1,0,0,0);
} }
List<String> userIds = userDto.stream().map(CandyUserCouponBasicDto::getCcouponId).collect(Collectors.toList()); List<String> userIds = userDto.stream().map(CandyUserCouponBasicDto::getCcouponId).collect(Collectors.toList());
if (userIds!=null && userIds.size() > 0) { if (userIds!=null && userIds.size() > 0) {
......
#eurekaServer配置
eureka:
client:
register-with-eureka: true
fetch-registry: true
serviceUrl:
defaultZone: http://${liquidnet.security.username}:${liquidnet.security.password}@${liquidnet.eureka.host}/eureka-server/eureka
#configServer配置
spring:
cloud:
config:
# uri: http://39.107.71.112:7002/support-config
profile: ${liquidnet.cloudConfig.profile}
name: ${spring.application.name} #默认为spring.application.name
discovery:
enabled: true
service-id: liquidnet-support-config
...@@ -95,10 +95,10 @@ public class PayController { ...@@ -95,10 +95,10 @@ public class PayController {
dragonPayBaseReqDto.setType(type); dragonPayBaseReqDto.setType(type);
dragonPayBaseReqDto.setPrice(price); dragonPayBaseReqDto.setPrice(price);
dragonPayBaseReqDto.setAuthCode(authCode); dragonPayBaseReqDto.setAuthCode(authCode);
// if(StringUtil.isNotNull(name)&&name.length()>=32){ if(StringUtil.isNotNull(name)&&name.length()>=32){
// name = name.substring(0,32); name = name.substring(0,32);
// } }
dragonPayBaseReqDto.setName("正在现场"); dragonPayBaseReqDto.setName(name);
// if(StringUtil.isNotNull(detail)&&detail.length()>=64){ // if(StringUtil.isNotNull(detail)&&detail.length()>=64){
// detail = detail.substring(0,64); // detail = detail.substring(0,64);
// } // }
......
...@@ -416,6 +416,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -416,6 +416,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
parameters.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID());
} else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) { } else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) {
parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID());
}else if(paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_MICROPAY_WEPAY.getCode())){
parameters.put("appid", PayWepayUtils.getInstance().getAPP_ID());
} }
parameters.put("nonce_str", nonceStr); parameters.put("nonce_str", nonceStr);
parameters.put("out_refund_no", refundCode); parameters.put("out_refund_no", refundCode);
......
...@@ -6,7 +6,7 @@ import com.liquidnet.service.base.ResponseDto; ...@@ -6,7 +6,7 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo; import com.liquidnet.service.goblin.dto.vo.GoblinStoreCouponVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo; import com.liquidnet.service.goblin.dto.vo.GoblinUseResultVo;
import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo; import com.liquidnet.service.goblin.dto.vo.GoblinUserCouponVo;
import com.liquidnet.service.goblin.param.BackCouponParam; import com.liquidnet.service.goblin.param.*;
import com.liquidnet.service.goblin.service.GoblinCouponService; import com.liquidnet.service.goblin.service.GoblinCouponService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil; import com.liquidnet.service.goblin.util.ObjectUtil;
...@@ -181,11 +181,11 @@ public class GoblinCouponController { ...@@ -181,11 +181,11 @@ public class GoblinCouponController {
if (uid == null) { if (uid == null) {
uid = CurrentUtil.getCurrentUid(); uid = CurrentUtil.getCurrentUid();
} }
return ResponseDto.success(goblinCouponService.canUse(totalPrice, spuId, uid,storeId)); return ResponseDto.success(goblinCouponService.canUse(totalPrice, spuId, uid, storeId));
} }
@PostMapping("useList") @PostMapping("useList")
@ApiOperation("可用券列表") @ApiOperation("可用券列表[不判断部分商品]")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "totalPrice", value = "应付价格"), @ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "totalPrice", value = "应付价格"),
...@@ -201,24 +201,44 @@ public class GoblinCouponController { ...@@ -201,24 +201,44 @@ public class GoblinCouponController {
return ResponseDto.success(goblinCouponService.useList(totalPrice, spuId, uid)); return ResponseDto.success(goblinCouponService.useList(totalPrice, spuId, uid));
} }
@PostMapping("useCoupon") @PostMapping("useList2")
@ApiOperation("用券") @ApiOperation("可用券列表[判断部分商品]")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({ public ResponseDto<List<GoblinUserCouponVo>> useList2(@RequestBody CouponCanUseParam param) {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "ucouponId", value = "券id"), if (param.getUid() == null) {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "content", value = "消费内容"), param.setUid(CurrentUtil.getCurrentUid());
@ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "totalPrice", value = "总价格"), }
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId逗号隔开"), return ResponseDto.success(goblinCouponService.useList2(param));
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "uid", value = "uid"), }
})
public ResponseDto<GoblinUseResultVo> checkOrderResult(@RequestParam("ucouponId") @Valid String ucouponId, @PostMapping("useList3")
@RequestParam("content") @Valid String content, @ApiOperation("可用券列表[返回商品下所有券]")
@RequestParam("totalPrice") @Valid BigDecimal totalPrice, @ApiResponse(code = 200, message = "接口返回对象参数")
@RequestParam("spuId") @Valid String spuId, public ResponseDto<List<GoblinUserCouponVo>> useList3(@RequestBody CouponCanUseAllParam param) {
@RequestParam("uid") @Valid String uid) { if (param.getUid() == null) {
return ResponseDto.success(goblinCouponService.useCoupon(ucouponId, content, totalPrice, spuId, uid)); param.setUid(CurrentUtil.getCurrentUid());
}
return ResponseDto.success(goblinCouponService.useList3(param));
} }
// @PostMapping("useCoupon")
// @ApiOperation("用券")
// @ApiResponse(code = 200, message = "接口返回对象参数")
// @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "ucouponId", value = "券id"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "content", value = "消费内容"),
// @ApiImplicitParam(type = "form", required = true, dataType = "Number", name = "totalPrice", value = "总价格"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "spuId", value = "spuId逗号隔开"),
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "uid", value = "uid"),
// })
// public ResponseDto<GoblinUseResultVo> checkOrderResult(@RequestParam("ucouponId") @Valid String ucouponId,
// @RequestParam("content") @Valid String content,
// @RequestParam("totalPrice") @Valid BigDecimal totalPrice,
// @RequestParam("spuId") @Valid String spuId,
// @RequestParam("uid") @Valid String uid) {
// return ResponseDto.success(goblinCouponService.useCoupon(ucouponId, content, totalPrice, spuId, uid));
// }
@PostMapping("backCoupon") @PostMapping("backCoupon")
@ApiOperation("退券") @ApiOperation("退券")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
...@@ -228,4 +248,18 @@ public class GoblinCouponController { ...@@ -228,4 +248,18 @@ public class GoblinCouponController {
} }
return ResponseDto.success(goblinCouponService.backCoupon(backCouponParam)); return ResponseDto.success(goblinCouponService.backCoupon(backCouponParam));
} }
@PostMapping("helpUseCoupon")
@ApiOperation("帮助用券")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<CouponHelpUseVo> helpUseCoupon(@RequestBody CouponHelpUseParam param) {
if (param.getUid() == null || param.getUid().equals("")) {
param.setUid(CurrentUtil.getCurrentUid());
}
CouponHelpUseVo vo = goblinCouponService.helpUseCoupon(param);
if(vo==null){
return ResponseDto.failure("券不存在");
}
return ResponseDto.success(vo);
}
} }
...@@ -29,10 +29,6 @@ import java.util.List; ...@@ -29,10 +29,6 @@ import java.util.List;
@RestController @RestController
@RequestMapping("/front") @RequestMapping("/front")
public class GoblinFrontController { public class GoblinFrontController {
@Autowired
private RedisUtil redisUtil;
@Autowired
private GoblinRedisUtils goblinRedisUtils;
@Autowired @Autowired
private GoblinFrontServiceImpl goblinFrontService; private GoblinFrontServiceImpl goblinFrontService;
......
...@@ -631,23 +631,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -631,23 +631,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pageable pageable=null; Pageable pageable=null;
// //
if(type.equals("1")){ if(type.equals("1")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count")); pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count","createdAt"));
}else if(type.equals("2")){ }else if(type.equals("2")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt")); pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt","createdAt"));
}else if(type.equals("3")){ }else if(type.equals("3")){
Document source = new Document(); Document source = new Document();
source.put("locale", "zh"); source.put("locale", "zh");
source.put("numericOrdering", true); source.put("numericOrdering", true);
Collation collation = Collation.from(source); Collation collation = Collation.from(source);
query.collation(collation); query.collation(collation);
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "priceGe")); pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "priceGe","createdAt"));
}else if(type.equals("4")){ }else if(type.equals("4")){
Document source = new Document(); Document source = new Document();
source.put("locale", "zh"); source.put("locale", "zh");
source.put("numericOrdering", true); source.put("numericOrdering", true);
Collation collation = Collation.from(source); Collation collation = Collation.from(source);
query.collation(collation); query.collation(collation);
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.ASC, "priceGe")); pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.ASC, "priceGe","createdAt"));
} }
// 排序 分页 // 排序 分页
// Query query = Query.query(Criteria.where("status").ne(1).and("status").ne(0)); // Query query = Query.query(Criteria.where("status").ne(1).and("status").ne(0));
...@@ -853,14 +853,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService { ...@@ -853,14 +853,25 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
} }
} }
}else{ }else{
//查看是否有 配置的 spuid的顺序 /* //查看是否有 配置的 spuid的顺序
String selectGoodsSpuids= getRedisKey(GoblinRedisConst.SELECT_GOODS_PAGE1); String selectGoodsSpuids= getRedisKey(GoblinRedisConst.SELECT_GOODS_PAGE1);
if(StringUtil.isBlank(selectGoodsSpuids)){ if(StringUtil.isBlank(selectGoodsSpuids)){
List<GoblinFrontSelectGoods> list= (List<GoblinFrontSelectGoods>) redisUtil.get(GoblinRedisConst.SELECT_GOODS); List<GoblinFrontSelectGoods> list= (List<GoblinFrontSelectGoods>) redisUtil.get(GoblinRedisConst.SELECT_GOODS);
setPage1AndSpu(list,pageSize); setPage1AndSpu(list,pageSize);
this.getSelectGoods(page,pageSize); this.getSelectGoods(page,pageSize);
} }
String[] spuidss=selectGoodsSpuids.split(","); String[] spuidss=selectGoodsSpuids.split(",");*/
//查看是否有 配置的 spuid的顺序
/* String selectGoodsSpuids= getRedisKey(GoblinRedisConst.SELECT_GOODS_PAGE1);*/
if(!redisUtil.hasKey(GoblinRedisConst.SELECT_GOODS_SPUIDS)){
List<GoblinFrontSelectGoods> list= (List<GoblinFrontSelectGoods>) redisUtil.get(GoblinRedisConst.SELECT_GOODS);
setPage1AndSpu(list,pageSize);
this.getSelectGoods(page,pageSize);
}
String[] spuidss=redisUtil.get(GoblinRedisConst.SELECT_GOODS_SPUIDS).toString().split(",");
//String[] spuidss=selectGoodsSpuids.split(",");
//找到对应的spuid //找到对应的spuid
int start =page*pageSize; int start =page*pageSize;
int end=(page+1)*pageSize; int end=(page+1)*pageSize;
......
...@@ -557,7 +557,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -557,7 +557,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo.setOrderCode(orderVo.getOrderCode()); logVo.setOrderCode(orderVo.getOrderCode());
logVo.setPayCode(orderVo.getPayCode()); logVo.setPayCode(orderVo.getPayCode());
logVo.setStoreId(orderVo.getStoreId()); logVo.setStoreId(orderVo.getStoreId());
if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue()) > 0) { if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()) > 0) {
logVo.setOrderType("zhengzai"); logVo.setOrderType("zhengzai");
} else { } else {
logVo.setOrderType("order"); logVo.setOrderType("order");
...@@ -627,7 +627,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService { ...@@ -627,7 +627,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
logVo.setOrderId(orderVo.getOrderId()); logVo.setOrderId(orderVo.getOrderId());
logVo.setOrderCode(orderVo.getOrderCode()); logVo.setOrderCode(orderVo.getOrderCode());
logVo.setPayCode(orderVo.getPayCode()); logVo.setPayCode(orderVo.getPayCode());
if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_PURCHASE.getValue()) > 0) { if (orderSkuVo.getSkuId().indexOf(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue()) > 0) {
logVo.setOrderType("zhengzai"); logVo.setOrderType("zhengzai");
} else { } else {
logVo.setOrderType("order"); logVo.setOrderType("order");
......
...@@ -138,7 +138,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService { ...@@ -138,7 +138,7 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo.setPayTime(orderVo.getPayTime()); vo.setPayTime(orderVo.getPayTime());
vo.setPriceExpress(orderVo.getPriceExpress()); vo.setPriceExpress(orderVo.getPriceExpress());
if (!(orderVo.getUcouponId() == null || orderVo.getUcouponId().equals(""))) { if (!(orderVo.getUcouponId() == null || orderVo.getUcouponId().equals(""))) {
CandyCouponVo candyCouponVo = orderUtils.getCouponDetails(orderVo.getUcouponId()); CandyCouponVo candyCouponVo = orderUtils.getCouponDetails(orderVo.getUcouponId(),orderVo.getUserId());
vo.setPlatformUcouponId(candyCouponVo.getUcouponId()); vo.setPlatformUcouponId(candyCouponVo.getUcouponId());
vo.setPlatformUcouponName(candyCouponVo.getTitle()); vo.setPlatformUcouponName(candyCouponVo.getTitle());
vo.setPlatformUcouponPrice(orderVo.getPriceCoupon()); vo.setPlatformUcouponPrice(orderVo.getPriceCoupon());
......
...@@ -948,7 +948,7 @@ public class GoblinMongoUtils { ...@@ -948,7 +948,7 @@ public class GoblinMongoUtils {
); );
} }
Query query = Query.query(criteria); Query query = Query.query(criteria);
query.skip(skipCount).limit(size); query.skip(skipCount).limit(size).with(Sort.by(Sort.Order.desc("createdAt")));
List<GoblinOrderLogVo> dataList = mongoTemplate.find(query, GoblinOrderLogVo.class, GoblinOrderLogVo.class.getSimpleName()); List<GoblinOrderLogVo> dataList = mongoTemplate.find(query, GoblinOrderLogVo.class, GoblinOrderLogVo.class.getSimpleName());
//查询总数量 //查询总数量
Query countQuery = Query.query(criteria); Query countQuery = Query.query(criteria);
......
...@@ -21,6 +21,7 @@ import org.springframework.util.MultiValueMap; ...@@ -21,6 +21,7 @@ import org.springframework.util.MultiValueMap;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
@Component @Component
@Slf4j @Slf4j
...@@ -35,119 +36,6 @@ public class GoblinOrderUtils { ...@@ -35,119 +36,6 @@ public class GoblinOrderUtils {
@Autowired @Autowired
GoblinRedisUtils redisUtils; GoblinRedisUtils redisUtils;
public AdamRscPolymer01Vo adamAddressEnterMember(String uid, String enterIds, String addressId) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Accept", "application/json;charset=UTF-8");
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("addressId", addressId);
params.add("entersIds", enterIds);
params.add("uid", uid);
String resultData = HttpUtil.post(adamUrl + "/adam/rsc/inquire/of_buy_ticket", params, header);
ResponseDto<AdamRscPolymer01Vo> vo = JsonUtils.fromJson(resultData, new TypeReference<ResponseDto<AdamRscPolymer01Vo>>() {
});
if (null != vo.getData()) {
return vo.getData();
} else {
return null;
}
} catch (Exception e) {
log.error("获取用户信息,e:{}", e);
e.printStackTrace();
return null;
}
}
//判断 数量限购
public String judgeOrderLimit(String uid, String skuId, int number, int limitCount) {
int buyCount = redisUtils.getSkuCountByUid(uid, skuId);
if (buyCount + number > limitCount) {
return "已超出限购数量";
} else {
int a = redisUtils.incrSkuCountByUid(uid, skuId, number);
return "";
}
}
//判断指定人群购买
public Boolean judgeOrderRose(Boolean isMember, String skuId, String mobile, int buyFactor) {
Boolean result = false;
switch (buyFactor) {
case 0:
result = true;
break;
case 1:
result = isMember;
break;
case 2:
result = redisUtils.getSkuCanBuyByUid(mobile, skuId);
break;
}
return result;
}
/**
* 使用优惠券
*
* @param uCouponId 券id
* @param content 消费内容
* @param totalPrice 订单总价
* @return
*/
public HashMap<String, Object> useCoupon(String uCouponId, String content, BigDecimal totalPrice, String spuId, String uid) {
HashMap<String, Object> hashMap = CollectionUtil.mapStringObject();
try {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("uCouponId", uCouponId);
params.add("content", content);
params.add("totalPrice", totalPrice.toString());
params.add("goodId", spuId);
params.add("performanceId", "null");
params.add("timeId", "null");
params.add("ticketId", "null");
params.add("uid", uid);
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Authorization", "Bearer " + CurrentUtil.getToken());
header.add("Accept", "application/json;charset=UTF-8");
log.debug("url=" + candyUrl + "/candy-coupon/use");
String returnData = HttpUtil.post(candyUrl + "/candy-coupon/use", params, header);
ResponseDto<CandyUseResultVo> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<CandyUseResultVo>>() {
});
CandyUseResultVo candyUseResultVo = innerReturnVo.getData();
Integer type = candyUseResultVo.getCouType();
BigDecimal value = candyUseResultVo.getValue();
BigDecimal voucher = BigDecimal.ZERO;
switch (type) {
case -1:
voucher = BigDecimal.valueOf(-1);
break;
case 1:
voucher = voucher.add(value);
break;
case 2:
voucher = voucher.add(value);
break;
case 3:
voucher = voucher.add(totalPrice);
break;
case 4:
voucher = totalPrice.subtract(totalPrice.multiply(value));
break;
default:
voucher = BigDecimal.ZERO;
break;
}
hashMap.put("type", type);
hashMap.put("voucher", voucher.setScale(2, BigDecimal.ROUND_HALF_UP));
return hashMap;
} catch (Exception e) {
log.error("用券ERROR:{}", e);
hashMap.put("type", -1);
hashMap.put("voucher", 0);
return hashMap;
}
}
public void backCoupon(String uCouponId, String uid) { public void backCoupon(String uCouponId, String uid) {
try { try {
BackCouponParam param = BackCouponParam.getNew(); BackCouponParam param = BackCouponParam.getNew();
...@@ -166,7 +54,7 @@ public class GoblinOrderUtils { ...@@ -166,7 +54,7 @@ public class GoblinOrderUtils {
} }
} }
public CandyCouponVo getCouponDetails(String uCouponId) { public CandyCouponVo getCouponDetails(String uCouponId,String uid) {
try { try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Authorization", "Bearer " + CurrentUtil.getToken()); header.add("Authorization", "Bearer " + CurrentUtil.getToken());
...@@ -174,10 +62,15 @@ public class GoblinOrderUtils { ...@@ -174,10 +62,15 @@ public class GoblinOrderUtils {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString(); MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("uCouponIds", uCouponId); params.add("uCouponIds", uCouponId);
params.add("uid", uid);
String returnData = HttpUtil.post(candyUrl + " /candy-coupon/receive/ListById", params, header); String returnData = HttpUtil.post(candyUrl + " /candy-coupon/receive/ListById", params, header);
ResponseDto<CandyCouponVo> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<CandyCouponVo>>() { ResponseDto<List<CandyCouponVo>> innerReturnVo = JsonUtils.fromJson(returnData, new TypeReference<ResponseDto<List<CandyCouponVo>>>() {
}); });
return innerReturnVo.getData(); if(innerReturnVo.getData().size()>0){
return innerReturnVo.getData().get(0);
}else{
return null;
}
} catch (Exception e) { } catch (Exception e) {
log.error("回退券ERROR:{}", e); log.error("回退券ERROR:{}", e);
CandyCouponVo vo = CandyCouponVo.getNew(); CandyCouponVo vo = CandyCouponVo.getNew();
...@@ -201,19 +94,4 @@ public class GoblinOrderUtils { ...@@ -201,19 +94,4 @@ public class GoblinOrderUtils {
e.printStackTrace(); e.printStackTrace();
} }
} }
public void desTask(String uid, BigDecimal price) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Accept", "application/json;charset=UTF-8");
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("score", price.intValue() + "");
params.add("content", "购买商品:");
params.add("uid", uid);
String resultData = HttpUtil.post(stoneUrl + "/user/logs/de2111", params, header);
} catch (Exception e) {
log.error("添加积分失败,e:{}", e);
e.printStackTrace();
}
}
} }
...@@ -22,6 +22,7 @@ import org.springframework.util.StringUtils; ...@@ -22,6 +22,7 @@ import org.springframework.util.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import static com.liquidnet.service.goblin.constant.GoblinRedisConst.REDIS_GOBLIN_TEMP_COUPON_MARKET; import static com.liquidnet.service.goblin.constant.GoblinRedisConst.REDIS_GOBLIN_TEMP_COUPON_MARKET;
...@@ -104,7 +105,7 @@ public class GoblinRedisUtils { ...@@ -104,7 +105,7 @@ public class GoblinRedisUtils {
if (obj == null) { if (obj == null) {
return CollectionUtil.arrayListString(); return CollectionUtil.arrayListString();
} else { } else {
return (List<String>) obj; return ((List<String>) obj).stream().distinct().collect(Collectors.toList());
} }
} }
......
...@@ -344,7 +344,7 @@ public class KylinOrderTicketsRefundServiceImpl { ...@@ -344,7 +344,7 @@ public class KylinOrderTicketsRefundServiceImpl {
if (isCanRefund > 0) { if (isCanRefund > 0) {
chargesRatio = refundPoundage.get(2).getPresent(); chargesRatio = refundPoundage.get(2).getPresent();
} else { } else {
chargesRatio = BigDecimal.valueOf(Long.parseLong("-1")); chargesRatio = BigDecimal.valueOf(Long.parseLong("1"));
// return ResponseDto.failure("当前日期不支持退票"); // return ResponseDto.failure("当前日期不支持退票");
} }
} }
......
package com.liquidnet.service.dragon.config;
import org.springframework.context.annotation.Configuration;
@Configuration
public class RedisStreamConfig {
// @Autowired
// private RedisPayNotifyReceiver redisPayNotifyReceiver;
// @Bean
// public Subscription subscriptionAlipayNotify0(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_GROUP.getCode(), "alipay-pay-notify-0"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionAlipayNotify1(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_GROUP.getCode(), "alipay-pay-notify-1"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.ALIPAY_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionWepayNotify0(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_GROUP.getCode(), "wepay-pay-notify-0"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
//
// @Bean
// public Subscription subscriptionWepayNotify1(RedisConnectionFactory factory) {
// var options = StreamMessageListenerContainer
// .StreamMessageListenerContainerOptions
// .builder()
// .pollTimeout(Duration.ofMillis(1))
// .build();
// var listenerContainer = StreamMessageListenerContainer.create(factory, options);
// var subscription = listenerContainer.receiveAutoAck(Consumer.from(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_GROUP.getCode(), "wepay-pay-notify-1"),
// StreamOffset.create(DragonConstant.ChannelRedisQueueEnum.WECHAT_PAY_KEY.getCode(), ReadOffset.lastConsumed()), redisPayNotifyReceiver);
// listenerContainer.start();
// return subscription;
// }
}
...@@ -413,6 +413,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService ...@@ -413,6 +413,8 @@ public class DragonOrderRefundsServiceImpl implements IDragonOrderRefundsService
parameters.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getAPPLET_APP_ID());
} else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) { } else if (paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_WAP_WEPAY.getCode())) {
parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID()); parameters.put("appid", PayWepayUtils.getInstance().getWAP_APP_ID());
} else if(paymentType.equalsIgnoreCase(DragonConstant.PayTypeEnum.PAYMENT_TYPE_MICROPAY_WEPAY.getCode())){
parameters.put("appid", PayWepayUtils.getInstance().getAPP_ID());
} }
parameters.put("nonce_str", nonceStr); parameters.put("nonce_str", nonceStr);
parameters.put("out_refund_no", refundCode); parameters.put("out_refund_no", refundCode);
......
...@@ -234,7 +234,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -234,7 +234,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if (isOldMember) { if (isOldMember) {
} else { } else {
if (memberType == 1) { if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == 1 && DateUtil.compareStrDay(DateUtil.getNowTime(), timeStart) == -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());
if (advanceMap == null) { if (advanceMap == null) {
return ResponseDto.failure("优先券不可用"); return ResponseDto.failure("优先券不可用");
...@@ -247,7 +247,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -247,7 +247,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
} }
if (isMember || advanceMap != null) { if ((isOldMember && memberType == 1) || advanceMap != null) {
if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == -1) { if (DateUtil.compareStrDay(DateUtil.getNowTime(), memberTimeStart) == -1) {
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid); orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
return ResponseDto.failure(ErrorMapping.get("20011"));//未开始 return ResponseDto.failure(ErrorMapping.get("20011"));//未开始
...@@ -321,16 +321,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -321,16 +321,20 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
//限购判断 如果实名 则身份证维度限购 如果不实名则数量限购 //限购判断 如果实名 则身份证维度限购 如果不实名则数量限购
if (entersVoList.size() > 0) { if (entersVoList.size() > 0) {
for (int i = 0; i < entersVoList.size(); i++) { for (int i = 0; i < entersVoList.size(); i++) {
dataUtils.changeBuyInfo(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), 1);
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, entersVoList.get(i).getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, memberType, isTrueName); String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, entersVoList.get(i).getIdCard(), payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, 1, 1, memberType, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
dataUtils.changeBuyInfo(uid, entersVoList.get(i).getIdCard(), performanceData.getPerformancesId(), ticketData.getTicketsId(), -1);
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber()); orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid); orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
} }
} }
} else { } else {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), payOrderParam.getNumber());
String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, payOrderParam.getNumber(), payOrderParam.getNumber(), memberType, isTrueName); String res1 = orderUtils.judgeOrderLimit(performanceData.getType(), uid, "", payOrderParam.getPerformanceId(), payOrderParam.getTicketId(), performanceLimit, performanceMemberLimit, ticketLimit, ticketMemberLimit, payOrderParam.getNumber(), payOrderParam.getNumber(), memberType, isTrueName);
if (!res1.equals("")) { if (!res1.equals("")) {
dataUtils.changeBuyInfo(uid, "", performanceData.getPerformancesId(), ticketData.getTicketsId(), -payOrderParam.getNumber());
orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber()); orderUtils.changeSurplus(isPay, payOrderParam.getTicketId(), payOrderParam.getNumber());
orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid); orderUtils.backAdvanceCoupon(payOrderParam.getAdvanceCode(), uid);
return ResponseDto.failure(res1);//乱七八糟异常 return ResponseDto.failure(res1);//乱七八糟异常
...@@ -568,7 +572,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -568,7 +572,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderTicketEntitiesVo.setUpdatedAt(null); orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt()); orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName()); mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1); // dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1);
} }
} else { } else {
for (int i = 0; i < payOrderParam.getNumber(); i++) { for (int i = 0; i < payOrderParam.getNumber(); i++) {
...@@ -602,7 +606,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -602,7 +606,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderTicketEntitiesVo.setUpdatedAt(null); orderTicketEntitiesVo.setUpdatedAt(null);
orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt()); orderTicketEntitiesVo.setChangeDate(orderTicketEntities.getCreatedAt());
mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName()); mongoTemplate.insert(orderTicketEntitiesVo, KylinOrderTicketEntitiesVo.class.getSimpleName());
dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1); // dataUtils.changeBuyInfo(orderTicketEntitiesVo.getUserId(), orderTicketEntitiesVo.getEnterIdCode(), orderTicketEntitiesVo.getPerformanceId(), orderTicketEntitiesVo.getTicketId(), 1);
} }
} }
...@@ -611,11 +615,15 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -611,11 +615,15 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
PayResultVo payResultVo; PayResultVo payResultVo;
if (orderTickets.getPriceActual().compareTo(BigDecimal.valueOf(0)) > 0) { if (orderTickets.getPriceActual().compareTo(BigDecimal.valueOf(0)) > 0) {
String name = dataUtils.getTicketPayTxt(ticketData.getTicketsId());
if (name.equals("")) {
name = "正在现场";
}
// 调用支付 // 调用支付
LinkedMultiValueMap<String, String> httpData = ObjectUtil.cloneLinkedMultiValueMapStringAndString(); LinkedMultiValueMap<String, String> httpData = ObjectUtil.cloneLinkedMultiValueMapStringAndString();
httpData.add("type", "TICKET"); httpData.add("type", "TICKET");
httpData.add("price", orderTickets.getPriceActual().toString()); httpData.add("price", orderTickets.getPriceActual().toString());
httpData.add("name", useTime + ticketData.getTitle() + "-" + performanceData.getTitle()); httpData.add("name", name);
httpData.add("detail", content); httpData.add("detail", content);
httpData.add("orderCode", orderTickets.getOrderCode()); httpData.add("orderCode", orderTickets.getOrderCode());
httpData.add("clientIp", CurrentUtil.getCliIpAddr()); httpData.add("clientIp", CurrentUtil.getCliIpAddr());
...@@ -735,10 +743,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -735,10 +743,14 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
} }
KylinOrderTicketEntitiesVo entitiesData = orderTicketData.getEntitiesVoList().get(0); KylinOrderTicketEntitiesVo entitiesData = orderTicketData.getEntitiesVoList().get(0);
String name = dataUtils.getTicketPayTxt(orderTicketData.getTicketId());
if (name.equals("")) {
name = "正在现场";
}
LinkedMultiValueMap<String, String> httpData = ObjectUtil.cloneLinkedMultiValueMapStringAndString(); LinkedMultiValueMap<String, String> httpData = ObjectUtil.cloneLinkedMultiValueMapStringAndString();
httpData.add("type", "TICKET"); httpData.add("type", "TICKET");
httpData.add("price", orderTicketData.getPriceActual().toString()); httpData.add("price", orderTicketData.getPriceActual().toString());
httpData.add("name", entitiesData.getUseStart() + "" + entitiesData.getPerformanceTitle()); httpData.add("name", name);
httpData.add("detail", entitiesData.getPerformanceTitle() + "-" + entitiesData.getTicketTitle() + "-" + entitiesData.getUseStart()); httpData.add("detail", entitiesData.getPerformanceTitle() + "-" + entitiesData.getTicketTitle() + "-" + entitiesData.getUseStart());
httpData.add("orderCode", orderTicketData.getOrderCode()); httpData.add("orderCode", orderTicketData.getOrderCode());
httpData.add("clientIp", CurrentUtil.getCliIpAddr()); httpData.add("clientIp", CurrentUtil.getCliIpAddr());
......
...@@ -316,4 +316,14 @@ public class DataUtils { ...@@ -316,4 +316,14 @@ public class DataUtils {
} }
return price; return price;
} }
public String getTicketPayTxt(String ticketId) {
String rdsKey = KylinRedisConst.TICKET_PAY_TXT.concat(ticketId);
Object obj = redisUtil.get(rdsKey);
if(obj==null){
return "";
}else{
return (String) obj;
}
}
} }
...@@ -67,6 +67,8 @@ public class OrderUtils { ...@@ -67,6 +67,8 @@ public class OrderUtils {
} else { } else {
integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName); integers = roadShowOrderLimit(userId, idCard, performanceId, ticketId, performanceBuyCount, ticketBuyCount, isTrueName);
} }
log.debug("演出购买数量="+integers[0]);
log.debug("票种购买数量="+integers[1]);
return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName); return judgeMemberType(performanceLimitCount, performanceMemberLimitCount, ticketLimitCount, ticketMemberLimitCount, memberType, integers[0], integers[1], isTrueName);
} }
...@@ -80,11 +82,11 @@ public class OrderUtils { ...@@ -80,11 +82,11 @@ public class OrderUtils {
int isTrueName int isTrueName
) { ) {
if (1 == isTrueName) {//实名 if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId);
} else {//非实名 } else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId); performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId); ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId);
} }
Integer[] array = ObjectUtil.cloneInteger2Array(); Integer[] array = ObjectUtil.cloneInteger2Array();
array[0] = performanceBuyCount; array[0] = performanceBuyCount;
...@@ -102,11 +104,11 @@ public class OrderUtils { ...@@ -102,11 +104,11 @@ public class OrderUtils {
int isTrueName int isTrueName
) { ) {
if (1 == isTrueName) {//实名 if (1 == isTrueName) {//实名
performanceBuyCount += dataUtils.getIdCardPBuyCount(idCard, performanceId); performanceBuyCount = dataUtils.getIdCardPBuyCount(idCard, performanceId);
ticketBuyCount += dataUtils.getIdCardTBuyCount(idCard, ticketId); ticketBuyCount = dataUtils.getIdCardTBuyCount(idCard, ticketId);
} else {//非实名 } else {//非实名
performanceBuyCount += dataUtils.getUserPBuyCount(userId, performanceId); performanceBuyCount = dataUtils.getUserPBuyCount(userId, performanceId);
ticketBuyCount += dataUtils.getUserTBuyCount(userId, ticketId); ticketBuyCount = dataUtils.getUserTBuyCount(userId, ticketId);
} }
Integer[] array = ObjectUtil.cloneInteger2Array(); Integer[] array = ObjectUtil.cloneInteger2Array();
...@@ -116,6 +118,10 @@ public class OrderUtils { ...@@ -116,6 +118,10 @@ public class OrderUtils {
} }
public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) { public String judgeMemberType(int performanceLimitCount, int performanceMemberLimitCount, int ticketLimitCount, int ticketMemberLimitCount, int memberType, int performanceBuyCount, int ticketBuyCount, int isTrueName) {
log.debug("会员限购演出="+performanceMemberLimitCount);
log.debug("限购演出="+performanceLimitCount);
log.debug("会员限购票种="+ticketMemberLimitCount);
log.debug("限购票种="+ticketLimitCount);
if (memberType == 1 || memberType == 2) { if (memberType == 1 || memberType == 2) {
if (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) { if (performanceBuyCount > performanceMemberLimitCount && performanceMemberLimitCount != 0) {
return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量 return (1 == isTrueName ? "实名制" : "本场") + "演出限购" + performanceMemberLimitCount + "张,已超出";//超过演出维度购买量
......
...@@ -125,6 +125,11 @@ ...@@ -125,6 +125,11 @@
<artifactId>liquidnet-api-feign-stone</artifactId> <artifactId>liquidnet-api-feign-stone</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<groupId>com.liquidnet</groupId>
<artifactId>liquidnet-common-third-shumei</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.liquidnet.service.platform.controller.basicServices; package com.liquidnet.service.platform.controller.basicServices;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS; import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder; import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.common.utils.BinaryUtil; import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.model.GenericResult; import com.aliyun.oss.model.GenericResult;
import com.aliyun.oss.model.ProcessObjectRequest; import com.aliyun.oss.model.ProcessObjectRequest;
import com.aliyun.oss.model.PutObjectRequest; import com.aliyun.oss.model.PutObjectRequest;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.common.third.shumei.util.ShumeiUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.FilesUtils; import com.liquidnet.commons.lang.util.FilesUtils;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
...@@ -19,6 +22,7 @@ import io.swagger.annotations.Api; ...@@ -19,6 +22,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -29,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -45,6 +50,7 @@ import java.util.UUID; ...@@ -45,6 +50,7 @@ import java.util.UUID;
* @since 2021-07-09 * @since 2021-07-09
*/ */
@Api(tags = "basicServices") @Api(tags = "basicServices")
@Slf4j
@RestController @RestController
@RequestMapping("basicServices/alOss") @RequestMapping("basicServices/alOss")
public class AlOssController { public class AlOssController {
...@@ -61,6 +67,9 @@ public class AlOssController { ...@@ -61,6 +67,9 @@ public class AlOssController {
@Autowired @Autowired
private PlatformOssFilesMapper platformOssFilesMapper; private PlatformOssFilesMapper platformOssFilesMapper;
@Autowired
private ShumeiUtil shumeiUtil;
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation("阿里云上传") @ApiOperation("阿里云上传")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -77,25 +86,35 @@ public class AlOssController { ...@@ -77,25 +86,35 @@ public class AlOssController {
@RequestParam(defaultValue = "0", required = false) int resize, @RequestParam(defaultValue = "0", required = false) int resize,
@RequestParam(defaultValue = "0", required = false) int isCutFrame @RequestParam(defaultValue = "0", required = false) int isCutFrame
) { ) {
if (file.equals("") || file.getSize() <= 0) {
return ResponseDto.failure("不能上传大小为0的文件");
}
File fileNew = FilesUtils.multipartFileToFile(file); File fileNew = FilesUtils.multipartFileToFile(file);
if (null == fileNew) { if (null == fileNew) {
return ResponseDto.failure("上传失败"); return ResponseDto.failure("multipartFileToFile Error");
} }
// 是否上传过 有直接返回 // 是否上传过 有直接返回
PlatformOssFiles ossFile = this.getOldOssFile(fileNew); PlatformOssFiles ossFile = this.getOldOssFile(fileNew);
UploadVo uploadVo = new UploadVo(); UploadVo uploadVo = new UploadVo();
if (null == ossFile) { try {
if (null == ossFile || (isCutFrame > 0 && ossFile.getVideoImg().isEmpty())) { //保证上传过的文件也能截帧
// 上传 // 上传
ossFile = this.uploadOssFile(file, pathName, buckType, resize, fileNew, isCutFrame); ossFile = this.uploadOssFile(file, pathName, buckType, resize, fileNew, isCutFrame);
} }
BeanUtils.copyProperties(ossFile, uploadVo); } finally {
// 删除临时文件 因为老文件也生成了所以也要删除 // 删除临时文件 因为老文件也生成了所以也要删除
FilesUtils.deleteTempFile(fileNew); FilesUtils.deleteTempFile(fileNew);
}
if (null == ossFile) {
return ResponseDto.failure("上传失败,该文件不合规,请勿上传带有联系方式、色情、涉政、广告等敏感文件");
} else {
BeanUtils.copyProperties(ossFile, uploadVo);
return ResponseDto.success(uploadVo); return ResponseDto.success(uploadVo);
} }
}
/** /**
* 获取老的上传文件 * 获取老的上传文件
...@@ -108,6 +127,7 @@ public class AlOssController { ...@@ -108,6 +127,7 @@ public class AlOssController {
List<PlatformOssFiles> platformOssFiles = platformOssFilesMapper.selectList( List<PlatformOssFiles> platformOssFiles = platformOssFilesMapper.selectList(
Wrappers.lambdaQuery(PlatformOssFiles.class) Wrappers.lambdaQuery(PlatformOssFiles.class)
.eq(PlatformOssFiles::getMd5str, fileMD5) .eq(PlatformOssFiles::getMd5str, fileMD5)
.orderByDesc(PlatformOssFiles::getMid)
); );
if (CollectionUtils.isEmpty(platformOssFiles)) { if (CollectionUtils.isEmpty(platformOssFiles)) {
return null; return null;
...@@ -128,38 +148,49 @@ public class AlOssController { ...@@ -128,38 +148,49 @@ public class AlOssController {
*/ */
private PlatformOssFiles uploadOssFile(MultipartFile file, String pathName, int buckType, int resize, File fileNew, int isCutFrame) { private PlatformOssFiles uploadOssFile(MultipartFile file, String pathName, int buckType, int resize, File fileNew, int isCutFrame) {
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret); OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
String filename = "";
String contentType = "";
int size = 0; int size = 0;
String filename, contentType, uploadPath = "";
PlatformOssFiles ossFileVideoImg = null;
try {
if (null == file) { if (null == file) {
filename = fileNew.getName(); filename = fileNew.getName();
Path fileNewPath = new File(fileNew.getPath()).toPath(); Path fileNewPath = new File(fileNew.getPath()).toPath();
try {
contentType = Files.probeContentType(fileNewPath); contentType = Files.probeContentType(fileNewPath);
} catch (Exception e) {
}
size = (int) fileNew.length(); size = (int) fileNew.length();
} else { } else {
filename = file.getResource().getFilename(); filename = file.getResource().getFilename();
contentType = file.getContentType(); contentType = file.getContentType();
size = (int) file.getSize(); size = (int) file.getSize();
} }
String uploadPath = FilesUtils.getUploadPath(pathName, filename); uploadPath = FilesUtils.getUploadPath(pathName, filename);
String bucketName = FilesUtils.getBucketName(buckType); String bucketName = FilesUtils.getBucketName(buckType);
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, uploadPath, fileNew); PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, uploadPath, fileNew);
ossClient.putObject(putObjectRequest); ossClient.putObject(putObjectRequest);
if (contentType.contains("image") && !contentType.equals("image/vnd.adobe.photoshop")) {
if (!shumeiUtil.checkImage(IDGenerator.nextSnowId(), imgUrl.concat(uploadPath))) {
ossClient.deleteObject(bucketName, uploadPath);
return null;
}
}
if (resize > 0) { // 裁切 if (resize > 0) { // 裁切
this.ossFileResize(resize, uploadPath, bucketName, ossClient); this.ossFileResize(resize, uploadPath, bucketName, ossClient);
} }
PlatformOssFiles ossFileVideoImg = null; if (isCutFrame > 0 && contentType.contains("video")) { // 截取帧数
if (isCutFrame > 0) { // 截取帧数
ossFileVideoImg = this.ossFileCutFrame(uploadPath, pathName, buckType); ossFileVideoImg = this.ossFileCutFrame(uploadPath, pathName, buckType);
} }
ossClient.shutdown(); ossClient.shutdown();
} catch (OSSException | ClientException | IOException e) {
log.error("alOssUploadEx [e:{}]", e);
return null;
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
// 入库 // 入库
PlatformOssFiles platformOssFilesDate = new PlatformOssFiles(); PlatformOssFiles platformOssFilesDate = new PlatformOssFiles();
......
...@@ -40,7 +40,8 @@ public class PlatformGoblinGoodsTaskController { ...@@ -40,7 +40,8 @@ public class PlatformGoblinGoodsTaskController {
queryWrapper.eq(GoblinGoods::getSpuAppear, "0"); queryWrapper.eq(GoblinGoods::getSpuAppear, "0");
queryWrapper.eq(GoblinGoods::getShelvesHandle, "3"); queryWrapper.eq(GoblinGoods::getShelvesHandle, "3");
queryWrapper.le(GoblinGoods::getShelvesTime, now); queryWrapper.le(GoblinGoods::getShelvesTime, now);
queryWrapper.eq(GoblinGoods::getShelvesStatus, "0"); // queryWrapper.eq(GoblinGoods::getShelvesStatus, "0");
queryWrapper.in(GoblinGoods::getShelvesStatus, "0", "1");
queryWrapper.orderByAsc(GoblinGoods::getShelvesTime); queryWrapper.orderByAsc(GoblinGoods::getShelvesTime);
queryWrapper.select(GoblinGoods::getSpuId); queryWrapper.select(GoblinGoods::getSpuId);
......
...@@ -420,7 +420,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa ...@@ -420,7 +420,7 @@ public class KylinPerformancesPartnerServiceImpl implements IKylinPerformancesPa
ticketData.setTimeEndExpress(ticketItem.getTimeEndExpress()); ticketData.setTimeEndExpress(ticketItem.getTimeEndExpress());
ticketData.setPrice(ticketItem.getPrice()); ticketData.setPrice(ticketItem.getPrice());
ticketData.setMemberPrice(ticketItem.getPrice()); ticketData.setMemberPrice(ticketItem.getPrice());
ticketData.setMemberTimeStart(DateUtil.Formatter.yyyyMMddHHmmss.format(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeStart()).minusMinutes(kylinPerformanceMisVo.getPayCountdownMinute()))); ticketData.setMemberTimeStart(DateUtil.Formatter.yyyyMMddHHmmss.format(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeStart()).minusMinutes(ticketData.getAdvanceMinuteMember())));
ticketData.setTotalExchange(ticketItem.getTotalExchange()); ticketData.setTotalExchange(ticketItem.getTotalExchange());
ticketData.setTotalGeneral(ticketItem.getTotalGeneral()); ticketData.setTotalGeneral(ticketItem.getTotalGeneral());
ticketData.setIsTrueName(kylinPerformanceMisVo.getIsTrueName()); ticketData.setIsTrueName(kylinPerformanceMisVo.getIsTrueName());
......
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