后端 + 前端:优惠劵更新功能
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package cn.iocoder.mall.promotion.application.convert;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponTemplateBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.CouponTemplatePageBO;
|
||||
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplatePageVO;
|
||||
import cn.iocoder.mall.promotion.application.vo.admins.AdminsCouponTemplateVO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-04-05T22:26:04+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 11.0.1 (Oracle Corporation)"
|
||||
)
|
||||
public class CouponTemplateConvertImpl implements CouponTemplateConvert {
|
||||
|
||||
@Override
|
||||
public AdminsCouponTemplateVO convert(CouponTemplateBO template) {
|
||||
if ( template == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminsCouponTemplateVO adminsCouponTemplateVO = new AdminsCouponTemplateVO();
|
||||
|
||||
adminsCouponTemplateVO.setId( template.getId() );
|
||||
adminsCouponTemplateVO.setTitle( template.getTitle() );
|
||||
adminsCouponTemplateVO.setDescription( template.getDescription() );
|
||||
adminsCouponTemplateVO.setType( template.getType() );
|
||||
adminsCouponTemplateVO.setCodeType( template.getCodeType() );
|
||||
adminsCouponTemplateVO.setStatus( template.getStatus() );
|
||||
adminsCouponTemplateVO.setQuota( template.getQuota() );
|
||||
adminsCouponTemplateVO.setPriceAvailable( template.getPriceAvailable() );
|
||||
adminsCouponTemplateVO.setRangeType( template.getRangeType() );
|
||||
adminsCouponTemplateVO.setRangeValues( template.getRangeValues() );
|
||||
adminsCouponTemplateVO.setDateType( template.getDateType() );
|
||||
adminsCouponTemplateVO.setValidStartTime( template.getValidStartTime() );
|
||||
adminsCouponTemplateVO.setValidEndTime( template.getValidEndTime() );
|
||||
adminsCouponTemplateVO.setFixedStartTerm( template.getFixedStartTerm() );
|
||||
adminsCouponTemplateVO.setFixedEndTerm( template.getFixedEndTerm() );
|
||||
adminsCouponTemplateVO.setPreferentialType( template.getPreferentialType() );
|
||||
adminsCouponTemplateVO.setPercentOff( template.getPercentOff() );
|
||||
adminsCouponTemplateVO.setPriceOff( template.getPriceOff() );
|
||||
adminsCouponTemplateVO.setDiscountPriceLimit( template.getDiscountPriceLimit() );
|
||||
adminsCouponTemplateVO.setStatFetchNum( template.getStatFetchNum() );
|
||||
adminsCouponTemplateVO.setCreateTime( template.getCreateTime() );
|
||||
adminsCouponTemplateVO.setTotal( template.getTotal() );
|
||||
|
||||
return adminsCouponTemplateVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminsCouponTemplateVO> convert2(CommonResult<CouponTemplateBO> result) {
|
||||
if ( result == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CommonResult<AdminsCouponTemplateVO> commonResult = new CommonResult<AdminsCouponTemplateVO>();
|
||||
|
||||
commonResult.setCode( result.getCode() );
|
||||
commonResult.setMessage( result.getMessage() );
|
||||
commonResult.setData( convert( result.getData() ) );
|
||||
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminsCouponTemplatePageVO> convert(CommonResult<CouponTemplatePageBO> result) {
|
||||
if ( result == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CommonResult<AdminsCouponTemplatePageVO> commonResult = new CommonResult<AdminsCouponTemplatePageVO>();
|
||||
|
||||
commonResult.setCode( result.getCode() );
|
||||
commonResult.setMessage( result.getMessage() );
|
||||
commonResult.setData( couponTemplatePageBOToAdminsCouponTemplatePageVO( result.getData() ) );
|
||||
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminsCouponTemplateVO> convertList(List<CouponTemplateBO> templates) {
|
||||
if ( templates == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AdminsCouponTemplateVO> list = new ArrayList<AdminsCouponTemplateVO>( templates.size() );
|
||||
for ( CouponTemplateBO couponTemplateBO : templates ) {
|
||||
list.add( convert( couponTemplateBO ) );
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
protected AdminsCouponTemplatePageVO couponTemplatePageBOToAdminsCouponTemplatePageVO(CouponTemplatePageBO couponTemplatePageBO) {
|
||||
if ( couponTemplatePageBO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminsCouponTemplatePageVO adminsCouponTemplatePageVO = new AdminsCouponTemplatePageVO();
|
||||
|
||||
adminsCouponTemplatePageVO.setList( convertList( couponTemplatePageBO.getList() ) );
|
||||
adminsCouponTemplatePageVO.setTotal( couponTemplatePageBO.getTotal() );
|
||||
|
||||
return adminsCouponTemplatePageVO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package cn.iocoder.mall.promotion.application.convert;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.product.api.bo.ProductSpuBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
|
||||
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
|
||||
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO;
|
||||
import cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO;
|
||||
import cn.iocoder.mall.promotion.application.vo.users.UsersProductRecommendVO;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@Generated(
|
||||
value = "org.mapstruct.ap.MappingProcessor",
|
||||
date = "2019-04-05T22:26:04+0800",
|
||||
comments = "version: 1.3.0.Final, compiler: javac, environment: Java 11.0.1 (Oracle Corporation)"
|
||||
)
|
||||
public class ProductRecommendConvertImpl implements ProductRecommendConvert {
|
||||
|
||||
@Override
|
||||
public AdminsProductRecommendVO convert(ProductRecommendBO bannerBO) {
|
||||
if ( bannerBO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminsProductRecommendVO adminsProductRecommendVO = new AdminsProductRecommendVO();
|
||||
|
||||
adminsProductRecommendVO.setId( bannerBO.getId() );
|
||||
adminsProductRecommendVO.setType( bannerBO.getType() );
|
||||
adminsProductRecommendVO.setProductSpuId( bannerBO.getProductSpuId() );
|
||||
adminsProductRecommendVO.setSort( bannerBO.getSort() );
|
||||
adminsProductRecommendVO.setStatus( bannerBO.getStatus() );
|
||||
adminsProductRecommendVO.setMemo( bannerBO.getMemo() );
|
||||
adminsProductRecommendVO.setCreateTime( bannerBO.getCreateTime() );
|
||||
|
||||
return adminsProductRecommendVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminsProductRecommendVO> convert2(CommonResult<ProductRecommendBO> result) {
|
||||
if ( result == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CommonResult<AdminsProductRecommendVO> commonResult = new CommonResult<AdminsProductRecommendVO>();
|
||||
|
||||
commonResult.setCode( result.getCode() );
|
||||
commonResult.setMessage( result.getMessage() );
|
||||
commonResult.setData( convert( result.getData() ) );
|
||||
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminsProductRecommendPageVO> convert(CommonResult<ProductRecommendPageBO> result) {
|
||||
if ( result == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CommonResult<AdminsProductRecommendPageVO> commonResult = new CommonResult<AdminsProductRecommendPageVO>();
|
||||
|
||||
commonResult.setCode( result.getCode() );
|
||||
commonResult.setMessage( result.getMessage() );
|
||||
commonResult.setData( productRecommendPageBOToAdminsProductRecommendPageVO( result.getData() ) );
|
||||
|
||||
return commonResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UsersProductRecommendVO convert(ProductSpuBO productSpu) {
|
||||
if ( productSpu == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
UsersProductRecommendVO usersProductRecommendVO = new UsersProductRecommendVO();
|
||||
|
||||
usersProductRecommendVO.setId( productSpu.getId() );
|
||||
usersProductRecommendVO.setName( productSpu.getName() );
|
||||
usersProductRecommendVO.setSellPoint( productSpu.getSellPoint() );
|
||||
List<String> list = productSpu.getPicUrls();
|
||||
if ( list != null ) {
|
||||
usersProductRecommendVO.setPicUrls( new ArrayList<String>( list ) );
|
||||
}
|
||||
usersProductRecommendVO.setPrice( productSpu.getPrice() );
|
||||
|
||||
return usersProductRecommendVO;
|
||||
}
|
||||
|
||||
protected List<AdminsProductRecommendVO> productRecommendBOListToAdminsProductRecommendVOList(List<ProductRecommendBO> list) {
|
||||
if ( list == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<AdminsProductRecommendVO> list1 = new ArrayList<AdminsProductRecommendVO>( list.size() );
|
||||
for ( ProductRecommendBO productRecommendBO : list ) {
|
||||
list1.add( convert( productRecommendBO ) );
|
||||
}
|
||||
|
||||
return list1;
|
||||
}
|
||||
|
||||
protected AdminsProductRecommendPageVO productRecommendPageBOToAdminsProductRecommendPageVO(ProductRecommendPageBO productRecommendPageBO) {
|
||||
if ( productRecommendPageBO == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AdminsProductRecommendPageVO adminsProductRecommendPageVO = new AdminsProductRecommendPageVO();
|
||||
|
||||
adminsProductRecommendPageVO.setList( productRecommendBOListToAdminsProductRecommendVOList( productRecommendPageBO.getList() ) );
|
||||
adminsProductRecommendPageVO.setTotal( productRecommendPageBO.getTotal() );
|
||||
|
||||
return adminsProductRecommendPageVO;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user