Преглед изворни кода

[浮层广告][修改][查询列表及上下架]

release_toaliyun_real
gongbiao пре 6 година
родитељ
комит
e103877e24
8 измењених фајлова са 122 додато и 9 уклоњено
  1. +2
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxFloatingLayerController.java
  2. +5
    -0
      mallinkService/src/main/java/com/iformall/common/ErrorCode.java
  3. +39
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxFloatingLayerVO.java
  4. +5
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxFloatingLayerMapper.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/service/WxFloatingLayerService.java
  6. +5
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java
  7. +11
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFloatingLayerServiceImpl.java
  8. +53
    -0
      mallinkService/src/main/resources/mapper/WxFloatingLayerMapper.xml

+ 2
- 1
mallinkAdmin/src/main/java/com/iformall/controller/market/WxFloatingLayerController.java Прегледај датотеку

@@ -7,6 +7,7 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.BaseEntity; import com.iformall.domain.po.BaseEntity;
import com.iformall.domain.po.WxFloatingLayer; import com.iformall.domain.po.WxFloatingLayer;
import com.iformall.domain.vo.WxFloatingLayerVO;
import com.iformall.enums.EnumFloatingLayerStatus; import com.iformall.enums.EnumFloatingLayerStatus;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.service.WxFloatingLayerService; import com.iformall.service.WxFloatingLayerService;
@@ -41,7 +42,7 @@ public class WxFloatingLayerController extends BaseController {
logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list"); logger.debug("[" + getIpAddr() + "] WxFloatingLayerController::list");
wxFloatingLayer.setTenantId(getTenantId()); wxFloatingLayer.setTenantId(getTenantId());
wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC); wxFloatingLayer.setSortColumns(BaseEntity.SortField.CreateTime_DESC, BaseEntity.SortField.Id_DESC);
final PageInfo<WxFloatingLayer> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize);
final PageInfo<WxFloatingLayerVO> page = wxFloatingLayerService.listAsPage(wxFloatingLayer, pageNum, pageSize);
return new ResultData(page); return new ResultData(page);
} }




+ 5
- 0
mallinkService/src/main/java/com/iformall/common/ErrorCode.java Прегледај датотеку

@@ -514,6 +514,11 @@ public enum ErrorCode{
*/ */
POWER_BILL_CONFIGU_NOT_FOUND(50001, "未配置电费账单生成规则"), POWER_BILL_CONFIGU_NOT_FOUND(50001, "未配置电费账单生成规则"),


/**
* 首页浮屠广告
*/
FLOATING_LAYER_FOUND(60001, "首页广告已存在,请先下线再重新投放"),



; ;




+ 39
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxFloatingLayerVO.java Прегледај датотеку

@@ -0,0 +1,39 @@
package com.iformall.domain.vo;

import com.iformall.domain.po.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
public class WxFloatingLayerVO extends BaseEntity {
private static final long serialVersionUID = 1L;

protected Long id;

@io.swagger.annotations.ApiModelProperty(value = "租户ID", name = "tenantId")
private String tenantId;

@io.swagger.annotations.ApiModelProperty(value = "封面图", name = "coverImg")
private String coverImg;

@io.swagger.annotations.ApiModelProperty(value = "产品ID", name = "produceId")
private Long produceId;

@io.swagger.annotations.ApiModelProperty(value = "小程序跳转路径", name = "pagePath")
private String pagePath;

@io.swagger.annotations.ApiModelProperty(value = "0上线 1下线", name = "status")
private Integer status;

@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createTime")
private Date createTime;

@io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updateTime")
private Date updateTime;

@io.swagger.annotations.ApiModelProperty(value = "名称", name = "title")
private String title;
}

+ 5
- 0
mallinkService/src/main/java/com/iformall/mapper/WxFloatingLayerMapper.java Прегледај датотеку

@@ -2,6 +2,7 @@ package com.iformall.mapper;


import com.iformall.common.CommonMapper; import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxFloatingLayer; import com.iformall.domain.po.WxFloatingLayer;
import com.iformall.domain.vo.WxFloatingLayerVO;


import java.util.List; import java.util.List;


@@ -12,4 +13,8 @@ public interface WxFloatingLayerMapper extends CommonMapper<WxFloatingLayer, Lon


List<WxFloatingLayer> findList(WxFloatingLayer wxFloatingLayer); List<WxFloatingLayer> findList(WxFloatingLayer wxFloatingLayer);


List<WxFloatingLayerVO> findListVO(WxFloatingLayer wxFloatingLayer);

void updateStatus(Long couponId);

} }

+ 2
- 1
mallinkService/src/main/java/com/iformall/service/WxFloatingLayerService.java Прегледај датотеку

@@ -3,6 +3,7 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.WxFloatingLayer; import com.iformall.domain.po.WxFloatingLayer;
import com.iformall.domain.vo.WxFloatingLayerVO;


/** /**
* @author gongbiao * @author gongbiao
@@ -17,7 +18,7 @@ public interface WxFloatingLayerService {
* @param pageSize * @param pageSize
* @return * @return
*/ */
PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize);
PageInfo<WxFloatingLayerVO> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize);


/** /**
* 根据Id获得实体 * 根据Id获得实体


+ 5
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java Прегледај датотеку

@@ -13,10 +13,7 @@ import com.iformall.domain.vo.WxCouponChannelAddVo;
import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.domain.vo.WxCouponChannelVo;
import com.iformall.domain.vo.WxMerchantVo; import com.iformall.domain.vo.WxMerchantVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.mapper.WxCardInfoMapper;
import com.iformall.mapper.WxCouponChannelMapper;
import com.iformall.mapper.WxCouponMerchantMapper;
import com.iformall.mapper.WxMerchantMapper;
import com.iformall.mapper.*;
import com.iformall.service.*; import com.iformall.service.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -46,6 +43,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
QrCodeService qrCodeService; QrCodeService qrCodeService;
@Autowired @Autowired
WxCardInfoMapper wxCardInfoMapper; WxCardInfoMapper wxCardInfoMapper;
@Autowired
WxFloatingLayerMapper wxFloatingLayerMapper;


/** /**
* B端业务端 * B端业务端
@@ -105,7 +104,8 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService {
wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode()); wxOrderService.updateOrderGroupStatusByCouponChannelId(record.getId(), record.getTenantId(), EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode());
//修改卡状态 //修改卡状态
wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId()); wxCardInfoMapper.updateTransferStatusByCouponId(orignal.getCouponId());

//浮层下架
wxFloatingLayerMapper.updateStatus(orignal.getCouponId());
} }
} }
record.setUpdateDate(new Date()); record.setUpdateDate(new Date());


+ 11
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxFloatingLayerServiceImpl.java Прегледај датотеку

@@ -1,5 +1,6 @@
package com.iformall.service.impl; package com.iformall.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode; import com.iformall.common.ErrorCode;
@@ -7,6 +8,7 @@ import com.iformall.common.IdWorker;
import com.iformall.common.Result; import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.WxFloatingLayer; import com.iformall.domain.po.WxFloatingLayer;
import com.iformall.domain.vo.WxFloatingLayerVO;
import com.iformall.mapper.WxFloatingLayerMapper; import com.iformall.mapper.WxFloatingLayerMapper;
import com.iformall.service.WxFloatingLayerService; import com.iformall.service.WxFloatingLayerService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -30,8 +32,8 @@ public class WxFloatingLayerServiceImpl implements WxFloatingLayerService {
WxFloatingLayerMapper wxFloatingLayerMapper; WxFloatingLayerMapper wxFloatingLayerMapper;


@Override @Override
public PageInfo<WxFloatingLayer> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFloatingLayerMapper.findList(record));
public PageInfo<WxFloatingLayerVO> listAsPage(WxFloatingLayer record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFloatingLayerMapper.findListVO(record));
} }


@Override @Override
@@ -48,6 +50,13 @@ public class WxFloatingLayerServiceImpl implements WxFloatingLayerService {
if (StringUtils.isEmpty(wxFloatingLayer.getPagePath())) { if (StringUtils.isEmpty(wxFloatingLayer.getPagePath())) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "小程序跳转路径不能为空");
} }
WxFloatingLayer wxFloatingLayerQuery = new WxFloatingLayer();
wxFloatingLayerQuery.setTenantId(wxFloatingLayer.getTenantId());
wxFloatingLayerQuery.setStatus(wxFloatingLayer.getStatus());
Integer integer = wxFloatingLayerMapper.selectCount(new QueryWrapper<>(wxFloatingLayerQuery));
if (integer > 0) {
return new ResultData(ErrorCode.FLOATING_LAYER_FOUND);
}
Date date = new Date(); Date date = new Date();
if (wxFloatingLayer.getId() == null) { if (wxFloatingLayer.getId() == null) {
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();


+ 53
- 0
mallinkService/src/main/resources/mapper/WxFloatingLayerMapper.xml Прегледај датотеку

@@ -41,11 +41,64 @@
<if test=" null != sortColumns">order by ${sortColumns}</if> <if test=" null != sortColumns">order by ${sortColumns}</if>
</sql> </sql>
<sql id="allColumnsVO">
fl.`id` as id, fl.`tenant_id` , fl.`cover_img` , fl.`produce_id`,
fl.`page_path` , fl.`status`, fl.`create_time` as create_time, fl.`update_time`,
c.title
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="BaseResultMap"> <select id="findList" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="BaseResultMap">
select select
<include refid="allColumns"/> <include refid="allColumns"/>
from wx_floating_layer from wx_floating_layer
<include refid="dynamicWhereConditions"/> <include refid="dynamicWhereConditions"/>
</select> </select>
<resultMap id="resultListVO" type="com.iformall.domain.vo.WxFloatingLayerVO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="cover_img" jdbcType="VARCHAR" property="coverImg"/>
<result column="produce_id" jdbcType="VARCHAR" property="produceId"/>
<result column="page_path" jdbcType="VARCHAR" property="pagePath"/>
<result column="status" jdbcType="VARCHAR" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
</resultMap>
<sql id="dynamicWhereConditionsVO">
<if test=" null != id ">
and fl.`id` = #{id}
</if>
<if test=" null != tenantId ">
and fl.`tenant_id` = #{tenantId}
</if>
<if test=" null != status ">
and fl.`status` = #{status}
</if>
<if test=" null != ids ">
and fl.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>
<select id="findListVO" parameterType="com.iformall.domain.po.WxFloatingLayer" resultMap="resultListVO">
select
<include refid="allColumnsVO"/>
from wx_floating_layer fl left join wx_coupon c on fl.produce_id=c.id
where c.status = 0
<include refid="dynamicWhereConditionsVO"/>
</select>
<update id="updateStatus">
update wx_floating_layer set status=1 where produce_id=#{value}
</update>


</mapper> </mapper>

Loading…
Откажи
Сачувај