@@ -0,0 +1,46 @@ | |||
package cn.com.taiji.managew.dto.equity.multiple; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class IssueMultipleEquityDTO extends BaseModel { | |||
private String multipleEquityId;//批量权益编号 | |||
private String equityName;//权益名称 | |||
private String productIntro;//权益类产品内容简介 | |||
private Integer customerGroup;//客户群体 | |||
private Integer chargeType;//收费类型 字典取CHARGE_TYPE | |||
private Long discountPrice;//优惠售价 | |||
private String costDescription;//成本组成描述 | |||
private LocalDateTime endDate;//下架结束日期 | |||
private Integer memberPoints;//会员积分 | |||
private Integer refundOnEtcCancel;//ETC设备强绑定权益注销时是否退费(1---是;0---否) | |||
private Integer validityFormat;//有效期格式 1日 2月 3季 4年 | |||
private String sellingPoint;//卖点 | |||
private List<String> channelAuthorization;//渠道授权 | |||
private Long originalPrice;//原价 | |||
private Long totalCost;//总成本 | |||
private LocalDateTime startDate;//上架启用日期 | |||
private String equityProvider;//权益提供方 | |||
private Integer transferable;//是否支持权益产品过户(1---是;0---否) | |||
private Integer discountCouponUsable;//是否可使用积分商城所兑换的折扣券(1---是;0---否) | |||
private Integer usageValidity;//使用有效期 | |||
private EnableStatus status;//状态 | |||
private Integer examine;//审核状态(0--通过 1---不通过 2--待审核) | |||
private String examineDes;//审核原因 | |||
private String operateUserId;//操作人id | |||
private String operateUserName;//操作人名称 | |||
private Integer alonePay;//是否单独售卖 1是 0否 | |||
private List<String> singleIds;//单项权益编号集合 | |||
private LocalDateTime insertTime = LocalDateTime.now();//创建时间 | |||
private LocalDateTime updateTime = LocalDateTime.now();//更新时间 | |||
} |
@@ -43,7 +43,7 @@ public class MultipleEquityAddReqDTO extends AbstractStaffBizRequestDTO { | |||
private LocalDateTime endDate; | |||
@ApiModelProperty(value = "会员积分") | |||
@NotNull | |||
private Long memberPoints; | |||
private Integer memberPoints; | |||
@ApiModelProperty(value = "ETC设备强绑定权益注销时是否退费(1---是;0---否)") | |||
@NotNull | |||
@IntegerConstant(values = "0,1") |
@@ -5,11 +5,13 @@ import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.issue.IssueMultipleEquity; | |||
import cn.com.taiji.core.entity.issue.IssueSingleEquity; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueMultipleEquityRepo; | |||
import cn.com.taiji.core.repo.jpa.issue.IssueSingleEquityRepo; | |||
import cn.com.taiji.core.repo.jpa.user.StaffRepo; | |||
import cn.com.taiji.managew.dto.equity.multiple.*; | |||
import cn.com.taiji.managew.dto.equity.single.IssueSingleEquityDTO; | |||
import cn.com.taiji.managew.repo.jpa.request.IssueMultipleEquityPageRequest; | |||
import cn.com.taiji.managew.tools.StringUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
@@ -103,9 +105,20 @@ public class MultipleEquityManagerImpl extends AbstractManager implements Multip | |||
@Override | |||
public Pagination page(MultipleEquityPageReqDTO dto) { | |||
IssueMultipleEquityPageRequest request = copyProperties(dto, new IssueMultipleEquityPageRequest()); | |||
return issueMultipleEquityRepo.page(request); | |||
return issueMultipleEquityRepo.page(request).convertResult(this::covert); | |||
} | |||
private IssueMultipleEquityDTO covert(IssueMultipleEquity from) { | |||
IssueMultipleEquityDTO to = new IssueMultipleEquityDTO(); | |||
copyProperties(from, to); | |||
if (hasText(from.getChannelAuthorization())) | |||
to.setChannelAuthorization(List.of(from.getChannelAuthorization().split(","))); | |||
if (hasText(from.getSingleIds())) | |||
to.setSingleIds(List.of(from.getSingleIds().split(","))); | |||
return to; | |||
} | |||
@Override | |||
public MultipleEquityDetailResDTO detail(MultipleEquityDetailReqDTO dto) throws ManagerException { | |||
IssueMultipleEquity multipleEquity = getMultipleEquity(dto.getId()); |
@@ -103,12 +103,15 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
if (IssueOrderStep.WAITING_ACTIVE != orderInfo.getOrderStep()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("订单当前状态不可激活"); | |||
} | |||
if(orderInfo.getCardStatus()==null||orderInfo.getCardStatus()!=CardStatus.ZC){ | |||
if (orderInfo.getCardStatus() == null || orderInfo.getCardStatus() != CardStatus.ZC) { | |||
// 卡库存 | |||
InvwCardDetails cardDetail = cardDetailsRepo.findByCardIdAndStatus(req.getCardId(), InvDeviceStatus.NEW); | |||
InvwCardDetails cardDetail = cardDetailsRepo.findBy(req.getCardId()); | |||
if (cardDetail == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡不在库存中"); | |||
} | |||
if (cardDetail.getStatus() != InvDeviceStatus.NEW && cardDetail.getStatus() != InvDeviceStatus.OUT) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡已使用或已报损"); | |||
} | |||
InvwWarehouse cardWarehouse = warehouseRepo.findByCode(cardDetail.getStoreCode()); | |||
if (cardWarehouse == null || EnableStatus.ENABLE != cardWarehouse.getStatus()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException(cardWarehouse.getName() + "仓库已禁用:" + cardDetail.getStoreCode()); | |||
@@ -119,10 +122,13 @@ public class InstApplyManager extends RedisCacheManager implements LogManager<In | |||
} | |||
// 签库存 | |||
InvwObuDetails obuDetail = obuDetailsRepo.findByObuIdAndStatus(req.getObuId(), InvDeviceStatus.NEW); | |||
InvwObuDetails obuDetail = obuDetailsRepo.findBy(req.getObuId()); | |||
if (obuDetail == null) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("OBU不在库存中"); | |||
} | |||
if (obuDetail.getStatus() != InvDeviceStatus.NEW && obuDetail.getStatus() != InvDeviceStatus.OUT) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("OBU已使用或已报损"); | |||
} | |||
InvwWarehouse obuWarehouse = warehouseRepo.findByCode(obuDetail.getStoreCode()); | |||
if (obuWarehouse == null || EnableStatus.ENABLE != obuWarehouse.getStatus()) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException(obuWarehouse.getName() + "仓库已禁用:" + obuDetail.getStoreCode()); |