| @@ -49,6 +49,9 @@ public class WxVtwoCashBackActivityController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxVtwoActivityOrderService wxVtwoActivityOrderService; | private WxVtwoActivityOrderService wxVtwoActivityOrderService; | ||||
| @Autowired | |||||
| private WxVtwoCashBackGrantService wxVtwoCashBackGrantService; | |||||
| @ApiVersion(group = SwaggerConstant.V_A_2_0) | @ApiVersion(group = SwaggerConstant.V_A_2_0) | ||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @@ -289,6 +292,21 @@ public class WxVtwoCashBackActivityController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiVersion(group = SwaggerConstant.V_A_2_0) | |||||
| @ApiOperation("活动发放历史") | |||||
| @PostMapping("grantAwardHistory") | |||||
| public ResultData grantAwardHistory(@RequestBody WxVtwoCashBackGrant activityGrant) { | |||||
| TenantEntity tenantEntity = getTenantInfo(); | |||||
| activityGrant.updateTenantInfo(tenantEntity); | |||||
| if(activityGrant.getActivityId() == null){ | |||||
| return new ResultData(Result.ERROR,"活动ID为空"); | |||||
| } | |||||
| if(StringUtils.isBlank(activityGrant.getCusPhone())){ | |||||
| throw new MallinkException(Result.ERROR,"请输入用户手机号"); | |||||
| } | |||||
| return new ResultData(wxVtwoCashBackGrantService.getGrantAwardHistory(activityGrant)); | |||||
| } | |||||
| @ApiVersion(group = SwaggerConstant.V_A_2_0) | @ApiVersion(group = SwaggerConstant.V_A_2_0) | ||||
| @ApiOperation("活动发放") | @ApiOperation("活动发放") | ||||
| @@ -37,6 +37,8 @@ public class WxVtwoActivityGrantOrder extends TenantEntity { | |||||
| */ | */ | ||||
| @TableField(value = "order_id") | @TableField(value = "order_id") | ||||
| private Long orderId; | private Long orderId; | ||||
| @TableField(exist = false) | |||||
| private String orderNo; | |||||
| /** | /** | ||||
| * 是否参与总金额计算 | * 是否参与总金额计算 | ||||
| @@ -205,4 +205,7 @@ public class WxVtwoCashBackGrant extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<WxVtwoActivityOrder> orderList; | private List<WxVtwoActivityOrder> orderList; | ||||
| @TableField(exist = false) | |||||
| private List<WxVtwoActivityGrantOrder> grantOrderList; | |||||
| } | } | ||||
| @@ -16,6 +16,8 @@ import java.util.List; | |||||
| public interface WxVtwoActivityGrantOrderMapper extends CommonMapper<WxVtwoActivityGrantOrder, Long> { | public interface WxVtwoActivityGrantOrderMapper extends CommonMapper<WxVtwoActivityGrantOrder, Long> { | ||||
| void insertList(@Param("grantOrderList")List<WxVtwoActivityGrantOrder> grantOrderList); | void insertList(@Param("grantOrderList")List<WxVtwoActivityGrantOrder> grantOrderList); | ||||
| List<WxVtwoActivityGrantOrder> findOrderNoList(@Param("grantId")Long grantId, @Param("tenantId")String tenantId); | |||||
| } | } | ||||
| @@ -18,6 +18,8 @@ public interface WxVtwoCashBackGrantMapper extends CommonMapper<WxVtwoCashBackGr | |||||
| WxVtwoAwardStatistics activityAwardStatistics(WxVtwoCashBackGrant wxVtwoCashBackGrant); | WxVtwoAwardStatistics activityAwardStatistics(WxVtwoCashBackGrant wxVtwoCashBackGrant); | ||||
| List<WxVtwoAwardStatistics> activityAwardStatisticsChart(WxVtwoCashBackGrant wxVtwoCashBackGrant); | List<WxVtwoAwardStatistics> activityAwardStatisticsChart(WxVtwoCashBackGrant wxVtwoCashBackGrant); | ||||
| List<WxVtwoCashBackGrant> findList(WxVtwoCashBackGrant activityGrant); | |||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| @@ -28,4 +29,5 @@ public interface WxVtwoCashBackActivityService extends IService<WxVtwoCashBackAc | |||||
| void grantAward(WxVtwoCashBackActivity cashBackActivity,WxVtwoCashBackGrant activityGrant); | void grantAward(WxVtwoCashBackActivity cashBackActivity,WxVtwoCashBackGrant activityGrant); | ||||
| void grantExport(HttpServletRequest request, HttpServletResponse response, WxVtwoCashBackGrant activityGrant); | void grantExport(HttpServletRequest request, HttpServletResponse response, WxVtwoCashBackGrant activityGrant); | ||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxVtwoActivityOrder; | import com.iformall.domain.po.WxVtwoActivityOrder; | ||||
| import com.iformall.domain.po.WxVtwoCashBackGrant; | import com.iformall.domain.po.WxVtwoCashBackGrant; | ||||
| import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
| @@ -20,4 +21,6 @@ public interface WxVtwoCashBackGrantService extends IService<WxVtwoCashBackGrant | |||||
| WxVtwoAwardStatistics activityAwardStatistics(WxVtwoActivityStatisticsVo statisticsVo); | WxVtwoAwardStatistics activityAwardStatistics(WxVtwoActivityStatisticsVo statisticsVo); | ||||
| List<WxVtwoAwardStatistics> activityAwardStatisticsChart(WxVtwoActivityStatisticsVo statisticsVo); | List<WxVtwoAwardStatistics> activityAwardStatisticsChart(WxVtwoActivityStatisticsVo statisticsVo); | ||||
| List<WxVtwoCashBackGrant> getGrantAwardHistory(WxVtwoCashBackGrant activityGrant); | |||||
| } | } | ||||
| @@ -5,11 +5,14 @@ import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.WxVtwoActivityGrant; | import com.iformall.domain.po.WxVtwoActivityGrant; | ||||
| import com.iformall.domain.po.WxVtwoActivityGrantOrder; | |||||
| import com.iformall.domain.po.WxVtwoActivityOrder; | import com.iformall.domain.po.WxVtwoActivityOrder; | ||||
| import com.iformall.domain.po.WxVtwoCashBackGrant; | import com.iformall.domain.po.WxVtwoCashBackGrant; | ||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.vo.WxVtwoActivityStatisticsVo; | import com.iformall.domain.vo.WxVtwoActivityStatisticsVo; | ||||
| import com.iformall.domain.vo.WxVtwoAwardStatistics; | import com.iformall.domain.vo.WxVtwoAwardStatistics; | ||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.mapper.WxVtwoActivityGrantOrderMapper; | |||||
| import com.iformall.service.WxVtwoCashBackGrantService; | import com.iformall.service.WxVtwoCashBackGrantService; | ||||
| import com.iformall.mapper.WxVtwoCashBackGrantMapper; | import com.iformall.mapper.WxVtwoCashBackGrantMapper; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -33,6 +36,9 @@ public class WxVtwoCashBackGrantServiceImpl extends ServiceImpl<WxVtwoCashBackGr | |||||
| @Autowired | @Autowired | ||||
| private WxVtwoCashBackGrantMapper wxVtwoCashBackGrantMapper; | private WxVtwoCashBackGrantMapper wxVtwoCashBackGrantMapper; | ||||
| @Autowired | |||||
| private WxVtwoActivityGrantOrderMapper wxVtwoActivityGrantOrderMapper; | |||||
| @Override | @Override | ||||
| public void handleFromOrder(WxVtwoCashBackGrant activityGrant, List<WxVtwoActivityOrder> orderList, boolean isGrant) { | public void handleFromOrder(WxVtwoCashBackGrant activityGrant, List<WxVtwoActivityOrder> orderList, boolean isGrant) { | ||||
| activityGrant.setOrderList(orderList); | activityGrant.setOrderList(orderList); | ||||
| @@ -101,6 +107,21 @@ public class WxVtwoCashBackGrantServiceImpl extends ServiceImpl<WxVtwoCashBackGr | |||||
| WxVtwoCashBackGrant wxVtwoCashBackGrant = handleStatisticsVo(statisticsVo); | WxVtwoCashBackGrant wxVtwoCashBackGrant = handleStatisticsVo(statisticsVo); | ||||
| return wxVtwoCashBackGrantMapper.activityAwardStatisticsChart(wxVtwoCashBackGrant); | return wxVtwoCashBackGrantMapper.activityAwardStatisticsChart(wxVtwoCashBackGrant); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxVtwoCashBackGrant> getGrantAwardHistory(WxVtwoCashBackGrant activityGrant) { | |||||
| activityGrant.setStatus(EnumYesOrNo.YES.getCode()); | |||||
| activityGrant.setSortColumns(BaseEntity.SortField.CreateDate_DESC); | |||||
| List<WxVtwoCashBackGrant> cashBackGrantList = wxVtwoCashBackGrantMapper.findList(activityGrant); | |||||
| if(cashBackGrantList != null && !cashBackGrantList.isEmpty()){ | |||||
| cashBackGrantList.forEach(wxVtwoCashBackGrant -> { | |||||
| List<WxVtwoActivityGrantOrder> orderNoList = wxVtwoActivityGrantOrderMapper.findOrderNoList(wxVtwoCashBackGrant.getId(), wxVtwoCashBackGrant.getTenantId()); | |||||
| wxVtwoCashBackGrant.setGrantOrderList(orderNoList); | |||||
| }); | |||||
| return cashBackGrantList; | |||||
| } | |||||
| return Collections.emptyList(); | |||||
| } | |||||
| } | } | ||||
| @@ -60,6 +60,13 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="findOrderNoList" parameterType="java.util.HashMap" resultType="com.iformall.domain.po.WxVtwoActivityGrantOrder"> | |||||
| select go.order_id,o.order_no,go.is_amount | |||||
| from wx_vtwo_activity_grant_order go | |||||
| left join wx_vtwo_activity_order o on o.id = go.order_id | |||||
| where go.grant_id = #{grantId} and go.tenant_id=#{tenantId} | |||||
| </select> | |||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns" /> from wx_vtwo_activity_grant_order | select <include refid="allColumns" /> from wx_vtwo_activity_grant_order | ||||
| where id = #{id} and tenant_id=#{tenantId} | where id = #{id} and tenant_id=#{tenantId} | ||||